02-02 initially wrote an import-based harness (dynamic import from
./packages/bus/dist/index.js). 02-03 replaced the bundle copy with an
injection-based harness (relies on the WKUserScript document-start
Injection.js to set up window.jarvisBus before any inline script runs).
The injection-based approach is architecturally correct per RESEARCH.md
§handshake — it lets the native side inject the bridge before any web
code runs, and removes the compile-time dependency on the dist/
bundle layout.
Syncing canonical to match so check-bus-harness-parity.sh passes.
- installJarvisBus() wires receive/send/onOutbound around decode pipeline
- receive() routes to handler if set; auto-acks hello when unset so the
minimal harness completes the handshake without page-side code
- send() is the ONLY surface that calls webkit.messageHandlers.jarvisBus
- Missing-webkit surfaces a helpful Error instead of a TypeError
- bus-harness.html is the static stub Plan 03's loadFileURL targets;
imports compiled ./packages/bus/dist/index.js, calls installJarvisBus
- index.ts now re-exports protocol + bridge
- 7 bridge tests green; 28 total vitest assertions; tsc --strict clean