emrg: gui — extend boot-chain contract guard to renderer init layer (v0.2.81 regression point) - #1042
Conversation
…v0.2.81 regression point) Static-guard the renderer side of the boot chain (DaemonBridgeProvider must call window.emrg.init() on mount and fuse the result via bridge.applyInit, and App.tsx must mount the provider). v0.2.81 disconnected because the React migration dropped the init() call; argszero#1036 added runtime coverage, this adds cheap static pinning so the regression point turns red even if the runtime test is removed or the mount path is bypassed. GUI tests 92 -> 93, Agent.md synced.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle 155326. Reviewed the fork PR's static boot-chain guard for the renderer init layer. Verified against the actual source (not just the test): DaemonBridgeProvider.tsx line 87 emrg?.init?.() matches the /emrg?\.init?\.\(\)/ assertion, line 88 bridge.applyInit(result) matches the /bridge\.applyInit\(result\)/ assertion, and App.tsx line 3 imports DaemonBridgeProvider. The 3→4 boot-contract test count and 92→93 GUI total in Agent.md both match (45+20+8+6+7+3+4=93). This closes the exact v0.2.81 regression gap (renderer init call could be dropped without the runtime test catching a mount-path bypass). CI 33050614637 green (test + test-windows), MERGEABLE/CLEAN.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle 160523. Re-verified the three new static assertions against the actual source (not just the test): (1) DaemonBridgeProvider.tsx L87 has (window as unknown as EmrgWindow).emrg?.init?.() which matches /emrg?.init?.()/; (2) L88 bridge.applyInit(result) matches /bridge.applyInit(result)/; (3) App.tsx L3 imports DaemonBridgeProvider from "./components/DaemonBridgeProvider" matching the import assertion, and L23 mounts it inside the tree. The Agent.md GUI count 92→93 (45+20+8+6+7+3+4=93) is arithmetic-consistent. Regressions the guard targets are real (v0.2.81 dropped the renderer init call entirely). CI 33050614637 green (test + test-windows), MERGEABLE/CLEAN. Independent distinct-cycle review — now 2/3.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle 161815. Re-verified head 522b227 is unchanged and the three static assertions still match actual source: DaemonBridgeProvider.tsx L87 emrg?.init?.() (matches /emrg?.init?.()/), L88 bridge.applyInit(result) (matches /bridge.applyInit(result)/); App.tsx L3 imports DaemonBridgeProvider (matches the import assertion). Agent.md GUI count 92→93 (45+20+8+6+7+3+4=93) arithmetic-consistent. CI 33050614637 green (test + test-windows), MERGEABLE/CLEAN. Third distinct-cycle approval (155326 → 160523 → 161815, no ❌ in between) — 3/3, merge gate satisfied.
Uh oh!
There was an error while loading. Please reload this page.
Summary
Extend the GUI boot-chain contract guard (#1037) to the renderer layer — the exact place the v0.2.81 disconnect regression happened.
Background
v0.2.81 shipped a GUI that never connected to the daemon: the React migration (Batch 5) dropped the
window.emrg.init()call from the renderer, somain.js'sensureConnected()(the only path to the daemon websocket) was never triggered. #1036 restored the call and added a runtime unit test; #1037 statically pinned themain.js+preload.jssides.This PR closes the remaining gap: the renderer side only had #1036's runtime coverage. If a future refactor removes the runtime test, or bypasses the component mount path entirely, the exact regression point would go unguarded again.
Changes
emrg/gui/test/boot-contract.test.js— new static guard test asserting:DaemonBridgeProvider.tsxmount effect callswindow.emrg.init()— the renderer's only path to the daemon websocket.bridge.applyInit(result)— calling init but dropping the result would leave the GUI in the sameconnected=falsezombie state (a subtle variant of the v0.2.81 symptom).App.tsximports/mountsDaemonBridgeProvider— unmounting the provider drops the whole init chain, and the runtime test (which renders the provider directly) cannot catch that.Also updates the guard's header comment to document the renderer layer, and syncs the documented GUI test count in
Agent.md(92 → 93).Verification
npm test— 93 tests (85 pass + 8 skipped), 0 failnpm run typecheckclean + 445 vitest passuv run pytest tests/— 1122 passed + 1 skippedtests/test_doc_counts.py4 passed