config/architecture/layers.json was read by nothing and contradicted the
enforced adapter rule. It is deleted; .dependency-cruiser.json is the one rule
source, and the ESLint layer patterns are marked as an editor aid.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every adapter group's second-level index.ts counted as a public barrel although
only storage/indexeddb and storage/opfs need one. layers.md called the
cross-context-invalidation kernel edge frozen while any adapter could use it.
Exceptions now name the exempt path, reason, owner and revisit condition.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A glob loaded adapter modules without naming one, so the graph, ESLint and the
type check all passed it. It is now a parse failure like a non-literal import().
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dependency-cruiser 18 cannot parse TypeScript 7, so it cruised no module, passed,
and its report and the docs claimed it checked the layers. The import graph is
the only checker; .dependency-cruiser.json stays as its rule file (D-11).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Icon vendor, design-system deep import and realtime composition were regular
expressions beside graph rules, and the regex missed relative deep imports
inside presentation. They are graph rules with fixtures now, with the
components/ui facades and page-templates named. package-script-graph.ts stays;
the reason is recorded.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The graph checks one edge at a time, so presentation reached a concrete adapter
through a re-export in a feature root file or a context with every rule passing.
Those modules may no longer import src/adapters, and presentation may no longer
import apps or contexts (app-router.tsx is the named exception).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No CI job ran any scale tier, and every tier past pr compares timings only on
the baseline CPU. The pr tier checks counts, bounds and growth shape; it now
includes S2 composition, since S0/S1 stay under the noise floor and let a
quadratic accumulation through. The ungated-test check reads tier paths.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drills held constant true verdicts and read public/ placeholders, so they
passed with no build or with JS assets deleted. They now check the local dist,
mark boot, live traffic and provider steps UNVERIFIED (exit 3), and FE-GATE-016
is retired because it repeated FE-GATE-025's FE-RB-005 drill.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The signed review is per release candidate, so the merge gate could never pass.
FE-GATE-009 now checks only the record format; the checked-in records are
source-controlled evidence, not command output.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tests/architecture, tests/release, tests/scripts, the top-level
tests/features files and the browser-soak contract now run in
test:coverage (FE-GATE-005); check:adapter-inventory joins FE-GATE-010
and the image resolve-signal type fixture joins FE-GATE-003 (baseline
updated). check:ci fails on a test file no gate command reaches unless
config/ci/ungated-tests.json gives a reason; only the tests/scale suite
is listed, pending 11-03. defineFeatureModule's id mismatch is tested.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The generator rendered only gateIds[0] for non-matrix jobs, so
immutable_build never ran FE-GATE-027 and the snapshot test pinned that.
Each owned gate now gets its own run step, check:ci rejects a workflow in
which any contract gate has no run step, and release admission refuses
APP_PROFILE != RELEASE_TARGET. Both variables are documented.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Gate/command/artifact counts and the gate-shape SHA-256 were code
constants, so any real removal or addition failed check:ci and removal
fixtures passed only in a relaxed mode. They now live in
config/ci/contract-baseline.json (owner, reason) with
update:ci-contract-baseline; update:registry-baseline wraps the existing
registry script. Removal fixtures re-baseline and run canonical check:ci
and check:registries; CI_CONTRACT_MODE, --reduced-removal-fixture and
check:registries:structure are gone. ci-quality-gates.md lists the
baselines a new project resets.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CLAUDE.md makes the guide the standing review standard for this repo.
The review folder holds 14 area reports and the summary with the
28-perspective table and the finding index.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
verify-hosting-headers.ts passed the serviceWorker probe only when
cache-policy.json said `enabled: false` AND dist had no worker script, so no
configuration let a supported ACTIVE build through the hosting gate. The
probe now follows the static selection: ACTIVE requires exactly the selected
`service-worker.js` at the dist root; null / REMOVE_REGISTRATION /
PURGE_OWNED_RESOURCES still reject any worker script. The now-unused
`serviceWorker.enabled` policy flag is removed; the artifact keeps the same
`serviceWorker`/`enabled` probe key.
RED (ACTIVE build from the previous commit, `node scripts/verify-hosting-headers.ts`):
Hosting cache/content-type/security header verification failed. exit=1
{ surface: serviceWorker, header: enabled, expected: false, observed: true, passed: false }
GREEN: same ACTIVE build -> PASS exit=0 (expected: true, observed: true);
default build -> PASS; default build + stray dist/service-worker.js -> exit=1
(reason "dist worker scripts: service-worker.js");
tests/unit/hosting-probe.test.ts 13 passed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
readSubject/getSubject must be an opaque, non-empty id that is stable per
user and never a token. Without it, every authenticated notification
clears server state.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The application port (best-effort-telemetry) and the feature port
(feature-telemetry pipeline) each posted to TELEMETRY_ENDPOINT on their
own: 20+20 sends per minute, cookies on the application side, no
pagehide flush or dispose abort on the feature side, and no deadline on
any fetch, so a hung collector held activeFlush forever (6.3-10).
New src/adapters/telemetry/telemetry-collector.ts is the one transport:
shared send-rate window (createTelemetrySendRate, now in the platform
pipeline and injectable via `sendRate`), credentials "omit", cache
"no-store", a per-request deadline through the kernel
createAbortableOperation, and one pagehide fan-out. runtime-adapters
builds one collector and passes it to both ports. Body projections are
unchanged and pinned by characterization tests first.
Verified: new tests in tests/unit/telemetry.test.ts (5 RED before
wiring: credentials/cache, hung collector timeout, shared rate,
feature pagehide flush, feature dispose abort); all gates pass except
the known tests/unit/removal-fixture.test.ts (artifacts/ absent);
check:adapter-inventory 137/137; FE-RB-004 drill PASS.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Realtime kept three DataSnapshot readers and about ten hand-written
abort/timeout races, and two parsers had drifted copies in other adapters.
Snapshot: reconnect-coordinator and bounded-poll now use result.ts
captureRealtimeDataSnapshot (+ `source`, variadic hasExactSnapshotKeys).
Kept the result.ts rules, the stricter ones: Object.hasOwn instead of
`"value" in` (prototype pollution), enumerable fields only, keys read from
one descriptor snapshot, frozen computed at snapshot time instead of a
later Object.isFrozen. Poll therefore now rejects non-enumerable fields;
it also accepts null-prototype records, which the other two copies
already did (pure data, no inherited accessors). Characterization test
added for both in bounded-poll-coordinator.test.ts.
Race: one raceRealtimeTask(task, signal, deadline) in result.ts, built on
kernel createAbortableOperation, replaces fetch-sse timed/cancelReader,
reconnect race/drain (the drain keeps a host timer via timerDeadline,
since the clock itself may hang), poll awaitTaskOrAbort/awaitWithinLease,
live-poll checkpoint + two quiescence races (now one), stream-coordinator
deadline/recovery-wait/close-drain, and the two WS inline races. Kept
semantics: deadline armed first and wins a tie (poll lease), task still
starts when the clock throws (reader cancel), collaborator rejections
still reach stream-coordinator callers, scheduler install failure still
fails closed as a timeout. Small change: nothing starts once the signal is
already aborted (WS apply / SSE onEvent / reader.read could run just
before being reported ABORTED). The mapping adds one microtask per race,
so the reconnect test flush() helper gets 16 turns instead of 8.
Kernel: parseRetryAfterDelay moves to platform/retry-after.ts (realtime
re-exports it; http retry-policy parseRetryAfter now delegates, so it
rejects "", " ", "1e3", "1.5", "0x10" and non-IMF dates it used to
accept). json-member-scanner moves to platform/; web-push push-codec uses
it instead of its top-level-only duplicate-key check, so nested
duplicates are rejected too. INVENTORY 136 -> 137, detail tables updated.
Tests: RED for http strict Retry-After, web-push nested duplicate, poll
snapshot rules; new direct raceRealtimeTask tests. Gates: architecture,
types app/test (+ service-worker/web-worker), lint, adapter-inventory
(abort ratchet 21/21), test:unit, test:component, realtime-boundaries,
integration/platform all pass. Realtime bundle 40346 -> 39433 gzip.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
isReconnectAttemptResetEligible returned true on either a valid
heartbeat/event or stableOpenMs elapsed. A server or proxy that sends one
`:` comment and drops kept attemptIndex at 0, so the delay stayed in
[0, baseDelay) and maxAttempts/maxElapsed were never reached (many
clients reconnecting in lockstep). Both conditions are now required. The
reconnect coordinator uses this helper at both close paths, so no
coordinator change is needed. The two design docs that stated "or" now
say "and".
Existing tests encoded the old "either" rule (policy unit test and the
coordinator "resets a spent retry" test) and are rewritten. RED: the
policy test (heartbeat-only returned true) and the coordinator test
(heartbeat on an instant close still reset: 3 attempts, expected 2)
failed before the fix. Gates: architecture, types app/test, lint,
adapter-inventory, test:unit, test:component pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A full dedupe window (2,048 IDs / 4 MiB) used to trigger a full
DEDUPE_OVERFLOW recovery on every event past capacity, so a steady
3.4 events/s stream re-fetched snapshots and reconnected every window.
The coordinator now drops the oldest entry (Map insertion order equals
apply order) and keeps applying; a replay pushed out of the window still
drops as STALE_EVENT through the sequence check. The design doc row and
the maxDedupeBytes contract comment now say eviction instead of recovery.
The semantic fingerprint is now a 16-char 64-bit FNV-1a hash of the
canonical envelope instead of the canonical text itself (up to 64 KiB
each). The canonical-size EVENT_TOO_LARGE check only bounded that stored
text, so it goes too; the wire-size check stays. pruneDedupe stops at the
first unexpired entry instead of scanning every entry.
The old "recovers instead of evicting" coordinator test encoded the bug
and is replaced by an eviction test. RED: the eviction test (got
RECOVERED/DEDUPE_OVERFLOW) and a fixed-size fingerprint codec test (got
3326 vs 333 bytes) failed before the change. Added a TTL prune
characterization test (passes before and after). Gates: architecture,
types app/test, lint, adapter-inventory, test:unit, test:component pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
theme.css (1435 lines) is now an import-order entry point: tailwind, the
three token files, then styles/theme/{base,shell,primitives,templates,
pages,responsive}.css holding the original rules verbatim and in the same
order (components-layer chunks each wrap their part in
`@layer components`). check-design-system now reads every CSS file under
styles/ so the undefined-token check still covers the moved rules; the
design-system doc names the new layout.
Verified: `corepack pnpm build` before and after produce the same CSS
asset, dist/assets/index-6KRF2bCu.css, byte-identical (cmp and sha256
bdaa8521...). A probe undefined token in theme/pages.css fails
check:design-system. Lane gates pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The V2 client only attempted 401 session recovery while the physical
attempt count was under maxRetryAttempts + 1. With MAX_RETRY_ATTEMPTS=0,
or when a 503 retry had already used the budget, a recoverable 401 went
straight to onUnauthenticated() and logged the user out. Recovery is
already bounded to one replay by recoveryUsed and by the deadline, so
the budget check is removed.
The comments in runtime-adapters.ts and adapters/http/index.ts said V2
works as a rollback path for V3 once its four slots are injected. That
is wrong: V2 validates the {success,data,meta} envelope and V3 the bare
DTO, so the same backend fails every V2 response with
ENVELOPE_MISMATCH. The comments and the client.ts ledger row in
docs/reviews/adapters/01-network-and-state.md now say a rollback also
needs a V2-envelope server. No docs/architecture page made the claim.
V2 code is kept.
Verified: two new auth-recovery cases (retries disabled; 503 then 401)
failed RED with ok:false and now recover. All lane gates pass except
the known removal-fixture test; verify:documentation passes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
public-response-cache-adapter.ts (1986 lines) and download-delivery-adapter.ts
(1491 lines) mixed the facade with codecs and validators. Moved verbatim:
- cache-storage/public-cache-codec.ts: manifest normalization and canonical
digest input, marker/active-pointer validation, bounded control JSON,
owned cache names, CacheValidationFailure -> Result mapping.
- cache-storage/public-cache-response-validation.ts: response admission
(status, directives, Content-Type, Vary, bounded body, digest).
- browser-files/download-input-validation.ts: request snapshot, input/limit
checks, presigned and browser-managed capability validation, handoff target.
The adapters drop to 1164 and 1157 lines.
Two non-verbatim edits: validateDownloadInput takes a structural
DownloadInputValidationOptions instead of DownloadDeliveryAdapterOptions (no
import cycle), and readBodyBounded races reads on the kernel
createAbortableOperation instead of its own abort listener. Moving it out of
a primitive-importing file would otherwise have raised the hand-rolled abort
ratchet to 20/19; the abort outcome (ABORTED, reader cancelled) is unchanged.
Verified: characterization tests added first and passing before the move
(cache manifest/response/control-JSON failure codes, lookup abort during a
pending body read; download input validation codes); a line diff confirms the
moved code is verbatim apart from the two edits above. Inventory 139/139,
lane gates, check:browser-file-storage-boundaries pass.
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>
web-push/codec-primitives.ts now owns OPAQUE_ID/validOpaqueId, isRecord,
hasExactKeys, exactRecord, validAuthority, base64UrlDecode and (to share the
alphabet) base64UrlEncode. push-codec,
push-registration-gateway, push-association-fence-store,
push-subscription-adapter and service-worker-runtime import them instead of
carrying their own copies (the fence store's control/association key checks
now use exactRecord/hasExactKeys with the same key lists). The duplicate-key
JSON scan in push-codec.ts is untouched (realtime lane, T76).
Where the copies differed, the stricter validated behavior is kept:
- validAuthority: the fence store's null guard. The gateway's copy threw a
TypeError for a null authority, so register()/reconcile() rejected instead
of returning INVALID_INPUT; they now return INVALID_INPUT (the only change a
caller can observe; characterization test was RED before the merge).
Non-record values (arrays) are also refused.
- base64UrlDecode: the gateway's decoder, which refuses a lone trailing
character (length % 4 == 1). The window adapter's copy accepted it when the
spare bits were zero; its only caller pre-checks an 87-char VAPID key, so
that difference was not reachable. `>>` vs `>>>` gave identical bytes.
- OPAQUE_ID, isRecord/hasExactKeys/exactRecord were already identical.
Page controller: PageControllerDependencies gains optional `document`; the
6-hour update check reads it (falling back to the global document), and
bootstrap/register-service-worker.ts now passes host.document through.
New adapter file: INVENTORY.md row 126 + renumber, total 137/137; detail row in
docs/reviews/adapters/05-service-worker-and-web-push.md.
Verified: characterization tests pinned the caller-visible behavior of every
copy before the merge (spare-bit keys, VAPID key, null authority in fence
store and gateway, array/extra-key backend answers, opaque ids); all pass
after, plus direct base64UrlDecode tests and an encode round-trip against
Node's base64url for lengths 0..66. Document injection test was RED
(update() ran while the injected document was hidden), green after. Gates:
check:architecture, types app/test/service-worker, lint, test:unit (only
pre-existing removal-fixture failure), test:component,
check:realtime-boundaries, check:adapter-inventory.
Realtime reference bundle (check:optional-recipes:source, already over budget
at b953142): 40139 -> 40097 gzip bytes after T89+T90.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
D-14. A click whose data or authority was refused (EXPIRED, association or
release mismatch, unreadable fence, unknown route) closed the notification and
opened nothing, so the user's tap was silently dropped. The click adapter now
opens `<origin>/` with no handoff message in that case; the refusal is still
the returned result and the terminal observation (FAILED + reason) carries the
root window's native-effect certainty. NATIVE_FAILURE (browser refused the
target window), ABORTED and a deadline-aborted signal are not retried.
The bounded openWindow step (certainty phases + late-effect observation) is
now one helper, openWindowBounded, used by both the route open and the root
open; observeLateEffect moved to the adapter scope. No behavior change for
the route path. Net effect on the realtime reference bundle stays negative
together with T90 (see T90).
The silent push drop stays by design and is now documented with its costs
(Chrome's "updated in the background" notice, WebKit revoking subscriptions
after repeated silent pushes) in
docs/architecture/realtime-events-web-push-and-bounded-polling.md 8.4/8.5.
Verified: RED first (expired and release-mismatch clicks: openWindow never
called), then green; a guard test pins that a null target window is not
retried with the root. Gates: check:architecture, types app/test/service-worker,
lint, test:unit (only pre-existing removal-fixture failure), test:component,
check:realtime-boundaries, check:adapter-inventory.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
resumable-upload-runtime.ts carried the upload flow, retry/deadline, the
server response decoders and eight dependency snapshot wrappers in one
2.3k-line file. Moved without changing behavior:
- runtime-dependencies.ts: the dependency types, snapshotDependencies and
its per-collaborator wrappers, safeNow/safeRandom and the default sleep.
- upload-response-validation.ts: validateSession, validateStatus,
validatePartCapability, the receipt check and the small shared helpers
(exactKeys, sameFingerprint, snapshotReceipts).
The runtime re-exports ResumableUploadRuntimeDependencies, so the public
surface is unchanged. The default sleep now waits on the kernel
createAbortableOperation instead of its own timer/listener pair, so the
moved file does not add a hand-rolled abort offender (ratchet stays 20/21).
INVENTORY and the detail review list the two files.
Verified: new characterization suite resumable-upload-runtime-contract
(invalid collaborators throw at composition, methods captured at
composition, frozen observer copies, throwing clock, default sleep retry
and abort, session/capability/status/receipt rejections) written and green
before the move, still green after + existing runtime suites + all gates.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The presigned executor and the capability provider each carried a copy of
createAbortScope, readWithSignal, transferFailure, isAbortSignal,
byteBucket, body/reader cancel, Content-Length parsing and statusFailure.
They now import them from presigned/http-common.ts.
Behavior changes:
- statusFailure is one table. The provider used NONE for 401/403 and RETRY
for 429/5xx; it now answers REISSUE_CAPABILITY like the executor. Retry
decisions (retryable) are unchanged. Chosen because capabilities are
single-use and the architecture doc (3.2) and BT-PRE-04 already say a
refusal is recovered by a new capability.
- The download check used Number(Content-Length), which let "5e0", "0x5",
"+5" and "5.0" through; it now uses the strict decimal parser the upload
path and the provider already had.
- The executor's compensateLateResponse had no caller and is deleted.
- The resumable runtime's invokeProviderAttempt now bounds each attempt with
the kernel createAbortableOperation instead of its own listener/timer
race; outcomes (ABORTED on caller abort, retryable UNAVAILABLE on the
deadline) are unchanged.
INVENTORY and the browser-transfer detail review list the new file. The
hand-rolled abort ratchet drops to 20/21; the ceiling constant is left for
the integration step so parallel lanes do not conflict on it.
Verified: RED tests "rejects a download Content-Length that is not a plain
decimal" (5e0 was accepted) and "maps capability endpoint statuses with the
executor's recovery table" (401 was NONE); existing presigned and runtime
suites cover the moved code + all gates.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The probe accepts a decode only when it matches the primary candidate's
pixel size exactly. fit inside/outside keep the source ratio, so for any
asset whose ratio differs the preset could only fail with
INTEGRITY_FAILED, and PRIVATE_SIGNED forces the probe. Per D-12 the
registry now rejects PRIMARY_REQUIRED unless fit is cover, contain or
fill; ratio-preserving fits stay allowed on presets without the probe.
README and the architecture doc state the rule.
Verified: RED test "allows a PRIMARY_REQUIRED probe only with an
exact-size fit" (inside/outside were accepted) + all gates.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A corrupt row, or one a newer build wrote with an unknown schemaVersion,
failed both upload and abort with CORRUPT_DATA until the whole partition
was deleted. The checkpoint store port gains an optional
removeUnreadable(): in one transaction it deletes the row only if it does
not parse as a checkpoint (a readable row is CONFLICT, an absent row is a
success). Explicit abort calls it on a CORRUPT_DATA read and reports
ORPHANED; the server session is left to expire because the row names no
session. upload() still fails closed on such a row. The port change is
additive (optional method); the architecture doc notes the exception.
Verified: RED tests "removes an unreadable checkpoint row on abort and
reports ORPHANED" (was CORRUPT_DATA) and "removes only an unreadable row
without a revision" (method missing) + all gates.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When a put failed before commit and the compensating ABORT_PUT or the
journal rollback did not complete, the coordinator returned a generic
CONFLICT / OBJECT_RECONCILE (or the rollback's own code). A user cancel or
a full disk reached the caller as a bare conflict.
compensatePreparedPut now takes the put's failure and returns it. If the
compensation completes, the failure is returned as before. If it does not,
the journal row is still left for reconciliation, and the failure keeps its
code, operation and retryable flag; only recovery becomes RECONCILE. The
architecture doc's compensation rule says the same.
Verified: new tests in tests/unit/opfs-byte-store.test.ts were RED (5
cases: failed cleanup, unknown cleanup effect, caller cancel, failed
rollback, FILES_READY failure) and are GREEN; the successful-compensation
case pins the unchanged path. All gates pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Decision D-13 keeps the storage schema as is: IndexedDB `remove` deletes
the row without a tombstone and an OPFS delete removes the logical object
row, so a recreated key starts again at revision 1 / generation 1.
The IndexedDB write receipt's `revision` and the durable object
descriptor's `generation` now say so in the port comments, and the storage
architecture doc says it in the IndexedDB record section and the OPFS
journal rules: callers must not treat `(key, revision)` or
`(objectId, generation)` as unique across the key's lifetime, and should
compare a value they own (or the integrity root digest) when it matters.
Documentation only. verify:documentation and all gates pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The runtime and maintenance each carried their own Stored* row types,
isStored* validators, record size formula, countBucket and failureOf, and
the dataset binding check had a third, hand-written budget validator. A
field added to one copy would make the other judge a healthy row corrupt.
indexeddb-records.ts now holds the row types, the validators, the budget
key and measureRecordBytes (payload + 512-byte envelope + UTF-16 key). Each
call site keeps its own failure code for a bad measurement (runtime
INVALID_INPUT, maintenance MIGRATION_FAILED), and only the binding check
still bounds a stored budget by hardBudgetBytes. The one validator
difference (maintenance's retention check did not re-validate the key it
compared against) is unobservable: it always passes a validated record key.
Verified: characterization tests added first in
tests/unit/indexeddb-maintenance.test.ts pin the size formula in both
writers, the per-site failure codes for NaN/negative/oversized sizes, and
the hardBudgetBytes bound at open (runtime and maintenance fail with
POLICY_REJECTED one byte over, open at the limit). They passed before and
after the refactor. INVENTORY.md (137/137) and the storage detail table
list the new file. All gates pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
6f6c48e added src/adapters/http/platform-error-mapping.ts and
src/adapters/telemetry/feature-telemetry.ts without ledger rows, so
check:adapter-inventory failed on the base branch. Add both rows, renumber,
update the total to 136/136 and add the matching detail-review rows.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Prepared objects were validated in three places with different rules. The
worker required integrity.chunkSizeBytes, chunk sizes, chunk count and
object size to match the current runtime policy; the journal checked the
object against itself; the page only checked the shape. Changing
chunkSizeBytes (allowed by opfs-policy) made every existing object fail:
open returned INTEGRITY_FAILED, FILES_READY reconcile failed CORRUPT_DATA
(and, had cleanup succeeded, would have rolled back a valid object), and
COMMITTED reconcile failed INVALID_INPUT at FINALIZE_PUT.
The journal's policy-free rules move to opfs-prepared-object.ts, the one
definition of isPreparedObject (and of the physical schema check). The
worker's VERIFY_OBJECT, READ_CHUNK, FINALIZE_PUT and FILES_READY receipt
paths and the page's FINISH_PUT parse use it, so a stored object is
checked against its own manifest. The current policy still governs new
writes only: validateObjectWriteInput, BEGIN_PUT's chunk size check and
APPEND_CHUNK's size and count limits are unchanged. stableJson keeps its
two copies; they differ in how a non-finite number fails and unifying
them would change error mapping.
Verified: new test "R-5.5 stored objects are checked against their own
chunk size" writes an object with 64 KiB chunks, then reconciles and opens
it through a 128 KiB runtime. Before the fix reconcile failed CORRUPT_DATA
and open failed INTEGRITY_FAILED; now reconcile commits without rollback,
the bytes read back, and a new put uses 128 KiB chunks. A new journal test
pins that a 4 MiB-chunk object round-trips and an inconsistent one is
still rejected (passes before and after). Inventory and the storage
detail review list the new file.
Gates: check:architecture, check:types:app/test/web-worker, lint,
test:component pass; test:unit passes except removal-fixture.test.ts
(needs gitignored release artifacts absent from a fresh worktree);
check:adapter-inventory accepts the new row but still reports two rows
already missing at f0d3953 (http/platform-error-mapping.ts,
telemetry/feature-telemetry.ts).
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>
Record the whole-src review findings by area with severity, location,
failure scenario, fix direction and test coverage.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>