Bus: 'JarvisBusWorld' documentation drift across 20+ docstrings post fb41c5f rename to WKContentWorld.page
#45
Reference in new issue
Block a user
fb41c5f rename to WKContentWorld.page
#45
Summary
Commit
fb41c5funified the WKWebView bridge onWKContentWorld.page, but the codebase still describes the prior topology in 20+ docstrings and one variable comment. Not a runtime bug — but exactly the stale-doc trap that produces the next outage: a future agent readsbridge.ts:60and "fixes" the duck-type-guard branch because the rationale no longer applies, deleting load-bearing protection.Evidence
WebviewBridge.swift:10: "Install aWKScriptMessageHandlerWithReplyin an isolated content world (JarvisBusWorld)..." — no longer true; page scripts CAN observe (shared world)Injection.js:1: "Injected at document-start in WKContentWorld('JarvisBusWorld')." — wrongbridge.ts:60-99: "WKContentWorld attach-to-existing path (H-02)" — the duck-typeisJarvisBusShapecheck is still load-bearing (prevents bundle'sinstallJarvisBusfrom clobbering Injection.js's stub), but the reason documented is now obsoletemain.tsx:9-15: comments still describing cross-world attachAppDelegate.swift:484: same driftwebview/packages/bus/dist/bridge.{js,d.ts}— shipped build artifact with stale commentsRecommended fix
Rename "JarvisBusWorld" → "page" / "shared world" in all comments. Rewrite the
bridge.ts:60-99rationale to reflect that the duck-type guard is now defensive against double-install (Injection.js + bundle both runninginstallJarvisBus-like logic in same world), not cross-world attach. Bump the bus package patch version.Test
scripts/check-no-jarvis-bus-world-references.sh: assert no comment matchesJarvisBusWorldoutside historical commit-message refsSource
.planning/audit-2026-05-12/bus-hud-audit.md(2026-05-12) — finding S2 (Documentation drift)