문제: control cache의 active pointer entry는 있는데 저장된 본문이 다시
쓰기 전까지 계속 읽히지 않으면(blob 손실 등) Cache Storage 관리가 모두
멈춘다. readActivePointer는 이 실패를 UNAVAILABLE/RETRY(또는
NOT_READABLE/REOPEN)로 돌려주고 CORRUPT_DATA로 보지 않는다. activation은
CORRUPT_DATA 밖의 pointer 실패에서 멈추고, cleanup·inspect·조회도 같은
실패에서 멈춘다. pointer를 쓰는 곳은 activation 하나라서 RETRY를
지켜도 돌아오지 않는다. 돌아오는 길은 adapter 밖에서 control cache를
지우는 것뿐이다. 리뷰 실험 02-R1 X3이 이것을 보였다.
고른 방법: activateRelease에 선택 옵션 replaceUnreadablePointer를 둔다.
true면 이전 pointer를 읽지 못한 이유와 상관없이, 손상 pointer와 같은
0929/02-01 경로로 검증된 후보를 rollback 목록 없이 덮어쓴다. 기본값은
지금처럼 멈춤이라 "일시 오류 하나로 rollback 목록을 잃지 않는다"는
보존 조건이 지켜진다. 포트 주석, 설계 문서 8.3절, 운영 문서에 언제
쓰는지와 rollback 목록을 잃는다는 것을 적었다.
버린 대안: (가) 문서에 "control cache를 지우고 다시 activate"만 적기.
제품이 adapter 밖 코드로 소유 cache 이름을 알고 지워야 하고, 그동안
조회가 pointer 없음으로 바뀐다. (다) 연속 N회 실패를 손상으로 보기.
실패 횟수를 저장해야 하고, 긴 일시 오류에서도 rollback 목록을 잃는다.
위험·한계: 옵션을 켜면 일시 오류에서도 rollback 목록을 잃고, 다음
cleanup이 새 활성 release 밖의 owned release cache를 모두 지운다. 그래서
기본값으로 두지 않았다. 일시와 지속을 가르는 판단은 운영자 몫이다.
포트에 선택 칸이 하나 늘었다. 호출부·구현부 모두 호환이라 breaking이
아니다. CHANGELOG [계약] 행은 CHANGELOG 담당에게 남긴다.
1105/02-02의 남은 부분(release marker 본문이 계속 읽히지 않으면 stage가
marker를 다시 쓰지 않는다)은 이 변경으로 풀리지 않는다. marker는 release
cache 안의 entry라 stage 경로를 바꿔야 한다. 범위 밖으로 둔다.
service-worker-pwa 레시피 번들(여유 306 B)에 수십 B가 더해진다.
실제 브라우저에서 pointer 본문 읽기 실패가 지속되는지는 확인하지
못했다(리뷰 5절 미검증과 같다).
검증: desktop batch에서 확인.
node scripts/run-vitest.ts run tests/unit/public-response-cache-repair.test.ts
RED(이 커밋의 테스트 + 부모 src): "replaces a pointer whose body stays
unreadable when the activation asks to (1106/02-01)"가 옵션을 준
activation에서 실패한다. 부모는 옵션을 모르므로 UNAVAILABLE/RETRY를
돌려주고 pointer를 다시 쓰지 않는다. 그 앞의 멈춤 단언(X3와 같은
결과)은 부모에서도 통과한다. 일시 오류 테스트 "still stops activation
when the pointer read fails transiently"는 바뀌지 않았고 통과해야 한다.
Refs: 1106/02-01
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>
The default policy has allowedVaryHeaderNames: [], so any Vary header was
POLICY_REJECTED. nginx `gzip_vary` and most CDNs send
`Vary: Accept-Encoding` on JS and CSS, so the default policy could not
stage real assets. Accept-Encoding is a forbidden request header, so a
policy could not allowlist it as a request header either.
validateVary now skips `accept-encoding`. No script-built Request carries
that header, so the stored and lookup requests both lack it and Cache.match
still matches exactly. Every other Vary name keeps the existing checks.
A policy whose allowedResponseHeaderNames lacked `content-type` passed
assertPublicCachePolicy, but activation re-validates the stored
Content-Type, so every activation failed as INTEGRITY_FAILED. The policy
check now rejects it. The ops runbook lists both rules.
Verified: "stages, activates and looks up a Vary: Accept-Encoding response
with the default policy" (stage returned ok:false) and "rejects a policy
that strips Content-Type from stored responses" (no throw) 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>
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>
STO-03: reject at composition any policy that enables Vary variants while
stripping vary from the stored response allowlist, since every stored variant
would collide on the same cache key.
STO-04: extract one verifyReleaseCandidate authority shared by the stage fast
path and activation. A matching release marker is a claim, not evidence, so a
restage now re-verifies each entry, deletes only the owned candidate on a
mismatch and refetches. Abort or an unreadable candidate is never stage success
and never moves the active pointer.
STO-05: split the availability guard. Staging keeps the fetcher requirement
with ONLINE_ONLY recovery; activation, rollback and cleanup need only cache
storage and the mutation lock, so an offline rollback or quota-recovery cleanup
is no longer reported UNSUPPORTED.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>