Skip to content

feat: add CSP-safe Web Worker scanner entry point - #287

Merged
truthixify merged 5 commits into
wraith-protocol:developfrom
collinsezedike:feat/worker-scanner-csp
Nov 25, 2026
Merged

truthixify merged 5 commits into
wraith-protocol:developfrom
collinsezedike:feat/worker-scanner-csp

Conversation

@collinsezedike

@collinsezedike collinsezedike commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Resolves #269.

Semver: minor. Adds a new package entry point and new root exports; no existing export changes.

Changes:

  • New entry point @wraith-protocol/sdk/scanner/worker for off-main-thread scanning
  • Versioned message schema: start, progress, cancel, result, failure
  • Deterministic ordering: EVM, Stellar, Solana, CKB, then input order
  • createWorkerScanner() client with AbortSignal cancellation, progress forwarding, typed ScannerWorkerError
  • Worker auto-installs on import in a worker global scope; also exposes exposeScannerWorker() for explicit control
  • CSP-safe: no eval, Function, blob URLs; verified by pnpm test:worker-csp running bundles with eval/Function poisoned
  • Vite, Next.js and plain module worker fixtures included

Testing:

  • All existing tests pass (1616)
  • New tests in test/scanner/worker.test.ts cover protocol, cancellation, progress and equivalence to the main-thread scanner
  • pnpm build, pnpm api:check, pnpm size and pnpm test:worker-csp all pass

Docs:

  • docs/guides/worker-scanner.mdx with protocol, ordering and Vite/Next/plain setup
  • README entry points table updated with a Worker Scanner section
  • CHANGELOG, BUNDLE_SIZE and COMPAT updated

@drips-wave

drips-wave Bot commented Nov 21, 2026

Copy link
Copy Markdown

@collinsezedike Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@truthixify truthixify left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The protocol version is declared but never travels in either worker message envelope, and neither validator nor handler rejects a version mismatch. That means incompatible host and worker builds can still exchange messages despite the compatibility guarantee. Include the version in requests and responses, validate it at both boundaries, and cover rejected mismatches.

@truthixify truthixify left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue #269 ownership verified: collinsezedike is the current assignee and PR author. Malware preflight passed for head 79762b0. The new commit only updates the bundle-size baseline, so the prior protocol blocker remains: the version constant is not carried through scanner requests and responses, and validation does not reject a mismatched peer version. Current CI is also failing.

@collinsezedike
collinsezedike force-pushed the feat/worker-scanner-csp branch from 6c919d8 to c769187 Compare November 25, 2026 13:04

@truthixify truthixify left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed exact head c769187. Remote malware preflight and full changed risk-file scan passed; linked issue #269 is assigned to @collinsezedike; required checks pass. The protocol-version blocker is resolved.

@truthixify
truthixify merged commit 25c1e7b into wraith-protocol:develop Nov 25, 2026
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Wave 11] Ship a CSP-safe Web Worker scanner entry point

2 participants