문제: cross-context host는 `storage` 이벤트의 `storageArea`를 캡처한
`localStorage` 객체와 동일성으로 비교해 sessionStorage 등 다른 영역의 같은
key 이벤트를 거절한다(`browser-cross-context-host.ts` `storageEventTarget`).
transport 테스트는 core에 이미 판정된 영역 값을 넘기므로 이 비교를 지워도
(변이 N38) cross-context 테스트 46건이 모두 통과한다(1101/02-04 ②, 지난
커밋 `3bfe6a8`이 하네스가 필요해 미룸).
고른 방법: `createBrowserCrossContextInvalidationFromHost`에 탭 둘을 흉내 낸
host를 넘기는 단위 테스트를 둔다. host에는 BroadcastChannel이 없어 storage
pulse만 쓴다. 한 탭의 `localStorage.setItem`이 다른 탭 listener에 `storage`
이벤트를 보낸다. 이벤트의 `storageArea`가 받는 탭의 sessionStorage이거나
모양만 같은 다른 객체이면 구독자가 받지 않고, 받는 탭의 localStorage이면 한
번 받는다.
버린 대안: browser spec에 sessionStorage `storage` 이벤트 행을 더하기. 실제
브라우저 증거는 더 강하지만 3엔진 spec 시간이 늘고, 비교 하나를 고정하는 데는
host 단위 테스트로 충분하다.
위험·한계: 테스트만 더한다. 실제 브라우저의 `StorageEvent.storageArea`
동작은 이 테스트가 보지 않는다(기존 browser spec 몫).
검증: desktop batch에서 확인
- node scripts/run-vitest.ts run tests/unit/cross-tab-invalidation.test.ts
- 변이 N38: `storageArea === expectedLocalStorage` 비교를 지우면(늘
`EXPECTED_LOCAL_STORAGE`) 새 테스트가 실패해야 한다.
Refs: 1101/02-04
문제: cross-context publish가 실패하면 원인과 상관없이 관측 reason이
INVALID_ENVELOPE다. createEventId가 던질 때(host에서는 secure random
실패)와 자기 envelope 검사 실패가 같은 invalidPublish()로 가고, 그
함수가 reason을 고정한다. bootstrap은 이 reason을 그대로
cache.operation.failed 진단에 싣는다. 난수 실패나 topic version
불일치가 "wire 형식 오류"로 보여 원인을 찾으려면 코드를 읽어야 한다.
고른 방법: invalidPublish가 reason을 인자로 받는다. event ID 실패는
이미 reason 목록에 있는 SECURE_RANDOM_UNAVAILABLE, envelope 검사
실패는 parse 결과의 reason(TOPIC_REJECTED 등)을 싣는다. 새 reason
값은 만들지 않는다. 호출자에게 돌려주는 결과
{ok:false, reason:"INVALID_EVENT"}는 그대로다.
위험·한계: 관측 reason 값이 바뀌므로 INVALID_ENVELOPE로 경보를 거는
대시보드가 있다면 새 값도 봐야 한다. 이 repo 안에는 그런 소비자가
없다. cross-context는 기본 조립이라 초기 JS에 들어간다. 바뀐 코드는
수십 바이트이고, 빌드 기반 번들 게이트(check:bundle)는 pnpm이 필요해
이 worktree에서 돌리지 않았다.
검증:
- RED(수정 전): cross-tab-invalidation.test.ts 새 1건이
"expected [ 'INVALID_ENVELOPE' ] to deeply equal
[ 'SECURE_RANDOM_UNAVAILABLE' ]"로 실패.
- GREEN: 같은 파일 통과.
- 회귀: cross-tab-invalidation·tanstack-cache-coordinator·
runtime-adapters 단위 3파일 46건 통과. tsc app·test 통과. 바꾼 파일
eslint 통과.
Refs: docs/reviews/2026-11-01-maturity-review/02-adapters-browser-files-cache.md
Cross-origin handoff, retained byte cap, typed preview Blob, native picker
user activation and first-seen-source GAP each get an input that only that
rule rejects. Removing any of the five lines now fails exactly one test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
createBrowserCrossContextInvalidationFromHost returned undefined without any
diagnostic when the cache epoch was invalid or secure random was missing, and
bootstrap built the epoch as `release.${releaseId}`, so any release ID with
`+`, `/`, `@` or over the length limit silently turned cross-tab
invalidation off.
- The host factory now reports OPEN/FAILED/NONE with the new reasons
INVALID_CACHE_EPOCH or SECURE_RANDOM_UNAVAILABLE before returning
undefined (the zero-topic build still probes nothing and reports nothing).
- New crossContextCacheEpochForRelease() derives `release.<fnv1a-64 hex>`
from the release ID; bootstrap uses it (one call-site change in
src/bootstrap/runtime-adapters.ts).
- The observation reason union gains two members (additive); the ops runbook
lists them.
Verified: two new unit tests failed before (no observation; missing epoch
helper) and pass now. Lane gates, reference-feature and V3 integration tests,
and check:diagnostics pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A tab whose BroadcastChannel postMessage failed once called
closeBroadcast(), which also removed its receive listener. Publishers
that broadcast successfully never write a storage pulse, so from then on
the tab missed every other tab's event while reporting
ACTIVE_STORAGE_FALLBACK. A tab whose BroadcastChannel failed to open had
the same blind spot and the same healthy-looking status.
Per D-4 there is no dual broadcast+storage publishing. Instead:
- A publish failure only sets broadcastPublishFailed. Later publishes go
to storage, and the channel stays open for receiving.
- BROADCAST_OPEN_FAILED now yields the additive status
DEGRADED_STORAGE_FALLBACK (the union lives in the adapter and is only
passed through by bootstrap). A browser without BroadcastChannel at all
keeps ACTIVE_STORAGE_FALLBACK, because every tab there uses storage.
- A successful storage publish recomputes the status instead of forcing
ACTIVE_STORAGE_FALLBACK, so it cannot hide the degraded state.
Existing tests fixed: "falls back when BroadcastChannel open or publish
fails" and "enters explicit local-only degradation when every transport
fails" expected ACTIVE_STORAGE_FALLBACK for a tab whose channel failed to
open. The ops runbook lists the new status.
Verified: "keeps receiving broadcasts after its own broadcast publish
fails" (received [] instead of [BROADCAST]) and the open-failure status
assertion (ACTIVE_STORAGE_FALLBACK) failed before the fix and pass now.
check:architecture, check:types:app, check:types:test, lint,
test:component, verify:documentation pass. test:unit passes except
removal-fixture, which needs generated artifacts/release files that a
fresh worktree lacks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The per-source high watermark was stored with the event's expiresAt and
pruned with it. After a source was quiet for longer than the 60 s event
TTL, its next event had no previous watermark and `sequence > 1`, so it
was delivered as GAP, and the query-cache coordinator then invalidated
every topic.
The watermark now carries only the sequence. It is removed only by the
existing sourceCapacity LRU. Event dedupe entries still expire with the
event TTL.
The existing test "bounds TTL and LRU tracking instead of growing with
remote sources" expected a same-source replay of seq 1 to be delivered
again after the TTL, which only worked because the watermark expired.
It now expects that replay to be dropped as STALE.
Verified: "keeps the per-source sequence watermark past the event TTL"
failed before the fix (seq 2 after 61 s was GAP) and passes now.
check:architecture, check:types:app, check:types:test, lint,
test:component pass. test:unit passes except removal-fixture, which needs
generated artifacts/release files that a fresh worktree lacks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
N-05: the conditional-validator key was a colon join over components that may
themselves contain colons, so two distinct valid bindings could collide and one
definition's ETag could be prepared for another. The key is now a validated,
byte-bounded fixed tuple encoded with JSON.stringify.
N-09: capture localStorage exactly once and compare StorageEvent.storageArea
against that object identity, so a pulse from sessionStorage or any other area
is rejected instead of matching on key and value alone. The pulse key is
registered in the storage registry as CACHE_INVALIDATION_PULSE.
N-10: race loadPage against the caller signal and re-check before observing a
page, so a non-cooperative loader can neither hold loadAll forever nor have a
post-abort completion accumulated into a successful result.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>