Tabs that did not request an activation only observe()d
ACTIVATED_RELOAD_REQUIRED, and the host contract had no way to tell the
app. Worse, the worker targeted that broadcast at the requester's build,
so a tab on another build dropped it as TARGET_BUILD_MISMATCH. A waiting
worker produced by the periodic registration.update() was never reported
either.
- ServiceWorkerRuntimeHost gains optional onReloadRequired/onUpdateWaiting
(additive; existing host implementations still type-check).
- The page controller notifies reload subscribers when an expected worker
source sends ACTIVATED_RELOAD_REQUIRED, and watches `updatefound` +
`statechange` to announce an update that reached `installed` while an
active worker exists (a first install is never announced). Listeners
are removed on stop(); a throwing subscriber is isolated.
- Worker post-commit/reject notifications are untargeted; the requester
still pairs by nonce.
- Test fixtures: registration and workers are now EventTarget-backed.
RED before fix (listener called 0 times):
- announces an update that finished installing as waiting (R-6.3)
- page ↔ worker activation seam > tells a tab that did not ask that a
reload is required (R-6.3)
Gates: check:architecture, check:types:{app,test,service-worker}, lint,
test:component pass. test:unit passes except the pre-existing
removal-fixture.test.ts case that needs generated release evidence
under artifacts/ (absent in a fresh worktree; unrelated to this diff).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>