Tooltip injects `aria-describedby` into its focusable child (merged with
any existing value) instead of a non-focusable wrapper span, and Escape
hides the tooltip until the next hover or focus (WCAG 1.4.13). The
listener is on the document so a hovered, unfocused trigger closes too.
Verified with tests/component/tooltip.test.tsx (RED: 3 of 3 failed before
the change) and the lane gates.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Route-level loading (Suspense fallback, context gateway, chunk check) now
renders LoadingSurface, which gains optional visible copy; route-level
auth-required, integration-required, invalid-address, disabled-feature,
failure and 404 screens render StatusPage, which gains an optional
`surface` marker and children slot. Visible copy, h1 headings, data-surface
markers and alerts are unchanged; the 404 home link is a router link.
The unlabelled context gateway loading now has an accessible name.
Session buttons in the shell, the auth-required screen and the auth example
share useSessionAction: one pending/failed state and sign-in returns to the
current URL including its hash (the auth example dropped the hash).
PageActionBar keys actions by position so a pending label does not remount
the pressed button.
The home and platform overview release loaders now handle a rejected
summary instead of showing "checking" forever.
Pinned first with tests/component/route-status-surfaces.test.tsx (RED: auth
example hash and both loaders; loading, auth-required, shell session and
404 link characterized before the change), plus the lane gates.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
LinkButton, Breadcrumbs items and page link actions accept an additive
`to` target rendered as a router Link, so in-app links keep the router
basename and navigate without a document reload. `href` still renders a
plain anchor. Pagination builds its page links from the current search
(router location, or the document URL outside a router) and only replaces
`page`, so other search parameters survive.
Verified with tests/component/design-system-links.test.tsx (RED: 5 of 6
failed before the change) and the lane gates.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
V2 checked the content type and decoded the body before looking at the
status. An nginx 502 with an HTML page became CONTENT_TYPE_MISMATCH and
an empty or broken 503/504 JSON body became MALFORMED_JSON: both
non-retryable and shown as a contract breach. For a 5xx/408/425 status
these branches, and the invalid-envelope branch, now return
SERVER_FAILURE with the httpStatus, the same R-3.3 rule V3 uses.
Retry follows V2's existing SERVER_FAILURE rule in retry-policy.ts, so
502/503/504 retry and 408/425/500 do not; SERVER_FAILURE was already in
retryKinds, so retry-policy.ts is unchanged.
The existing "non-JSON response" test used a 502 and pinned the old
CONTENT_TYPE_MISMATCH classification; it now uses a 200, which still
covers the non-JSON rejection and body redaction.
Verified: four new http-client cases (502 HTML, 503 empty JSON, 504
broken JSON, 408 text) failed RED with CONTENT_TYPE_MISMATCH /
MALFORMED_JSON and now pass with the expected fetch counts. All lane
gates pass except the known removal-fixture test; test:reference-feature
timed out once under load and passed on rerun.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- cursor pagination re-serialized every accumulated item on each page
(O(pages x total)) and used items.push(...page.items), which throws
RangeError for a large page, so loadAll rejected instead of returning
a Result. Each page is now measured once and summed (errs high by at
most one byte per page), the item count is checked before copying,
and items are appended one by one.
- conditional-validator-store accepted `W/"` as a weak ETag because its
opening quote also satisfied endsWith('"'). The closing quote must now
come after the opening one.
- browser-rpc-runtime's validTransportFailure had no callers, duplicated
decodeTransportFailure and read properties directly, which RPC-RR-04
forbids. Deleted (approved for this template).
Verified: new tests failed RED (18 serialized items instead of 6 because
the accumulated array was passed each time, RangeError for a 1,000,000
item page, `W/"` installed) and pass now. All lane gates pass except the
known removal-fixture test.
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>
Three gaps in the unary/stream runtime:
- A KEYED_COMMAND/NON_REPLAYABLE unary that failed after the transport
was invoked (timeout, throw, UNAVAILABLE, ...) came back retryable
with action "retry", although the server may have applied it. Every
failure of a COMMAND after send now carries effect MAYBE_APPLIED
(retryable false, contact-support). Pre-send rejections and queries
are unchanged.
- A retry did not re-check the scope generation, so after a logout the
previous user's command could be sent again. Each retry now checks
safeIsCurrent first and ends with SCOPE_GENERATION_CHANGED.
- A stream whose consumer aborted but never called return() stayed
suspended at a yield; its finally never ran and the operation stayed
RPC_STREAM_DRAINING for good. The lease is now released (cancel +
positive-close subscription) from the stream's own abort listener;
finally triggers the same path through its abort.
Verified: five new tests failed RED (no effect, second attempt sent,
cancel never called) and pass now; a pin that pre-send command failures
and query failures stay effect-free passes before and after. All lane
gates pass except the known removal-fixture test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TanStack 5 invalidateQueries resolves only after the active refetches
finish. The coordinator awaited each namespace in a for loop, so one
invalidation (and lease.release(), which waits on it) took the sum of
every namespace's refetch time. The namespaces now run through
Promise.allSettled; each rejected one is still reported once as
"invalidate".
Verified: new test holds the first namespace's refetch open and failed
RED (second invalidateQueries never started); it now passes and checks
that a failure is reported once. All lane gates pass except the known
removal-fixture test; provider-guardian-transaction timed out once under
load and passed on rerun.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A retried command reported only its last attempt's effect. An IDEMPOTENT
command whose first attempt was lost (network error or 429) and whose
retry got a NOT_APPLIED problem ended as "not applied, retry", although
the first attempt may have applied. A 5xx with an HTML or empty body is
MAYBE_APPLIED for a command, yet the executor still replayed it.
The executor now records what each retried attempt settled on and joins
it into the final outcome's effect. An admission whose own certainty is
MAYBE_APPLIED (or APPLIED_CONFIRMED) is not retried; a 429 still is,
because its admission reason is RATE_LIMITED rather than an effect
verdict. The logical accumulator is not reused because it is raised at
dispatch and cannot tell a rejected attempt from a lost one.
Verified: three new tests (lost response then 400, 429 then 400, 504
empty body) failed RED with NOT_APPLIED / a second attempt and now pass.
All lane gates pass except the known removal-fixture test; two component
tests timed out once under load and passed on rerun.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The executor decided the terminal outcome of an ended wait in six places
(credentials, lease, dispatch, transport backoff, admission, retry
backoff). The two backoff copies only checked the caller, so a scope
fence during a retry sleep ended as TRANSPORT_FAILURE{TIMEOUT} and the
user saw "timed out, retry" after logging out.
All six sites now call one terminalOutcomeFor(phase) helper: the caller
cancels, the deadline times out, a scope fence during a wait is
ABORTED_BY_SCOPE and during admission stays the SCOPE_FENCED violation.
Verified: a new owner x phase table in http-execution-v3.test.ts pins
the 16 existing combinations and failed RED only for the two backoff
scope-fence cases (TIMEOUT instead of ABORTED_BY_SCOPE). All lane gates
pass except the known removal-fixture test (missing artifacts/).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The exact media-type regex lived in object-url-lease.ts,
browser-file-policy-registry.ts and the download validation;
safeOpaqueValue (vault) and safeGeneratedToken (download) were the same
regex; and five modules each defined their own positive-safe-integer check
(isPositiveByteLimit included). file-policy.ts now exports one copy of each:
EXACT_MEDIA_TYPE, isSafeGeneratedToken, isPositiveSafeInteger.
ObjectUrlLeaseRegistry.create also loses an inner revoke branch that could
never run (it required a non-empty string inside a "not a non-empty string"
guard).
cache-storage/public-cache-policy.ts keeps its private positiveSafeInteger:
adapters may not import another adapter's module.
Verified: a characterization test (unsafe reference -> UNAVAILABLE, 128-char
token accepted, empty object URL -> no revoke, fractional/zero limits and a
wildcard download media type rejected) passes on the code before and after.
Lane gates pass.
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>
sanitizeSuggestedFileName dropped one code point at a time and re-encoded the
whole name each round, so a 100k-character server-supplied name took ~10^10
steps. truncateUtf8 now walks the code points once, counting UTF-8 bytes, and
cuts at the longest fitting prefix (trailing whitespace trimmed, as before).
The fallback base name uses the same helper. deliver() also sanitized the
name twice (validation, then again for use); validateDownloadInput now
returns the sanitized name and deliverActive uses it.
Verified: new unit test pins results for ASCII, Hangul, emoji and the
whitespace-trim case, and asserts a 5k-character name needs <10
TextEncoder.encode calls (RED before: 4827). Lane gates 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>
NativeInputFilePicker installed the window-focus fallback on every select,
even in engines that dispatch a native `cancel`. A provider that returns
focus first and dispatches `change` only after fetching the file (Android
cloud providers) was reported as DISMISSED after the grace window. The picker
now remembers that it observed a native `cancel` and stops installing the
focus fallback for later selections.
Verified: new unit test (cancel seen, then focus + fallback timer + late
change) returned DISMISSED before and SELECTED now. Lane gates pass
(tests/component/router.test.tsx timed out once under full-gate load and
passed on rerun).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
download-delivery-adapter and browser-file-vault each carried their own
combineAbortSignals/awaitWithSignal copies. Two gaps followed:
- a presigned lease that resolved after the abort but before the delivery's
finally was seen by neither compensateLateSource (holder not yet closed) nor
closeHeldSource (lease never adopted), so it leaked;
- a writable from handle.createWritable() that arrived after the abort was
never aborted (Chrome keeps a .crswap file).
Each delivery and each vault stream now owns a createAbortableOperation joined
to the caller signal; dispose() closes the live owners. Every await goes
through owner.race, and late leases/writables are compensated by the race.
The hand-rolled abort ratchet drops 21 -> 19.
Verified: two new download tests (same-turn late lease, late writable) failed
before (close 0 times, no abort) and pass now; a new vault characterization
test (caller abort / dispose during a pending read) passes before and after.
All lane gates pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
matchActiveExact re-read, re-normalized and re-hashed the whole release
marker (up to maxEntriesPerRelease assets) on every lookup, then scanned the
asset list linearly. The adapter now keeps the last verified marker keyed by
candidate cache name + manifest digest (the digest binds every asset field)
with a Map of assets by key. Eviction is still detected through keys(), and
every served body is still hashed. Control JSON is read by collecting chunks
instead of preallocating the 2 MiB budget.
Verified: new unit test pins lookup results across two releases and eviction,
and asserts the second lookup does no marker read and no marker digest (RED
before: 3 marker reads). Cache unit tests and all lane gates 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>
The page and the worker both used clientDrainMs (30s). A tab that drained at
29.999s let the worker call skipWaiting() and commit after the page had
already resolved CLIENT_DRAIN_TIMEOUT, so the requesting tab never reloaded.
The page now waits clientDrainMs + activationReplySlackMs (new additive
SERVICE_WORKER_BOUNDS field, 5s).
Verified: RED first with the real page/worker seam (last drain at 29.999s,
skipWaiting 50ms): page resolved CLIENT_DRAIN_TIMEOUT; green after.
Gates: check:architecture, types app/test/service-worker, lint, test:unit
(only pre-existing removal-fixture failure), test:component.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
onActivate wrote the activation marker first, so a quota failure on
currentCache.put threw before the stale-cache delete loop and space never came
back. Stale owned caches are now deleted first (each delete failure is counted
as not deleted instead of aborting the loop), and a failed marker write is
swallowed: activation stands, the only loss is that the next release cannot
use this cache as its previous-release fallback.
Verified: RED first (onActivate rejected with QuotaExceededError and deleted
nothing), then green with order [delete stale, marker]. Gates:
check:architecture, types app/test/service-worker, lint, test:unit (only
pre-existing removal-fixture failure), test:component.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The static cache name is the asset-set digest, so a worker built with the same
assets (same VITE_BUILD_ID, new worker code) installs into the cache the active
worker serves from. A failed install then deleted that serving cache and its
activation marker. installStaticAssets now checks caches.keys() first and rolls
back (including the deferred post-deadline delete) only a cache this install
created. Rewriting an existing cache only puts identical sha256-verified bytes.
InstallDependencies.caches gains an optional keys(); without it the old
behavior (always roll back) is kept.
Verified: RED first (existing-candidate test saw one delete), then green; a
second test pins that a newly created candidate is still deleted. Gates:
check:architecture, types app/test/service-worker, lint, test:unit (only
pre-existing removal-fixture failure), test:component.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The fetch listener only called respondWith for URLs in the current manifest,
so the previous-cache fallback (T29) never ran for the one case it exists for:
a tab of the previous build lazy-loading a chunk the new release no longer
lists. classifyFetch now returns PREVIOUS_RELEASE_FALLBACK for a same-origin,
non-navigate GET whose path is a content-hashed name (HASHED_STATIC_ASSET_NAME)
and that is not in the manifest; the runtime answers it only from the marked
previous release cache, otherwise the entry falls back to the network. The
decision is a synchronous runtime.intercepts() so respondWith is still called
only for requests the worker may answer. Runtime config and release manifest
stay network-only even though `-manifest.json` matches the hash pattern.
Verified: RED first (3 new tests failed: runtime onFetch returned null, entry
did not call respondWith), then green. New entry tests cover old chunk from
previous cache, previous miss -> network, and no interception for navigate,
POST, API, cross-origin, unhashed same-origin and release-manifest.json.
Gates: check:architecture, types app/test/service-worker, lint, test:unit
(only pre-existing removal-fixture failure), test:component.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
register() took one owned snapshot and stored it, but its duplicate
receipt check read registration.capabilityReceipt from the issuer's object
three more times. A stateful object could show the check a receipt the
vault never stored while the snapshot carried one it already held, so the
same receipt was registered twice. The check now reads the snapshot once.
Verified: RED test "checks a duplicate receipt against the snapshot, not
the issuer's object" (a Proxy registration was accepted) + all gates.
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 multipart-to-presigned bridge copied every part with Uint8Array.from
and the presigned executor then snapshotted the same bytes with slice()
before any await. The executor's snapshot is the one the public port
needs, so the bridge now forwards the part buffer as is. The executor
still re-digests its own copy against the part checksum, so a port that
mutated the buffer would fail closed rather than upload other bytes.
partBufferCopyFactor is left at 4; changing a policy default is a
contract migration.
Verified: the bridge test now asserts the port receives the part buffer
itself (failed before: it got a copy) + 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 header parser reads pre-rotation dimensions, but the default
createImageBitmap call applied EXIF/irot orientation, so an orientation
5-8 JPEG or a rotated AVIF decoded with width and height swapped and was
rejected. The default bitmap factory now passes
{ imageOrientation: "none" }. An injected createBitmap is unchanged.
Verified: RED test "decodes with the default bitmap factory without
applying orientation" (options were missing) + all gates. Real-browser
decode of a rotated image is not exercised here.
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>
A failing range worker only set firstFailure, which the other workers read
on their next loop. An in-flight sibling kept retrying its part until its
own attempt deadline, so the caller got the failure minutes late. The
workers now share a transfer-scoped abort combined with the request signal;
the first failure aborts it, and a sibling's resulting ABORTED never
replaces the failure that won.
Verified: new RED test "aborts in-flight sibling workers as soon as one
part fails" (sibling signal was never aborted before the fix) + all gates.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two small holes in the IndexedDB kernel (src/adapters/platform/):
- runIndexedDbTransaction: a `fail(x)` after `succeed()` kept the success
candidate, so the abort it triggered was reported as an anonymous
NATIVE_EXCEPTION and `x` was lost. `fail` now replaces a success
candidate; an earlier failure still wins.
- openIndexedDbDatabase: when the open had already settled (caller abort,
terminal BLOCKED, blocked deadline, close) before `onupgradeneeded`
fired, the upgrade still ran and committed the migration. The handler now
aborts the versionchange transaction when the open is already settled.
Tests that encoded the old behavior were updated in this commit:
tests/unit/indexeddb-transaction.test.ts ("an abort after succeed...")
expected NATIVE_EXCEPTION and now expects the caller's failure, and
tests/unit/indexeddb-runtime.test.ts ("times out a blocked upgrade...")
expected the late upgrade to commit and its connection to be closed; it now
expects no schema commit. Both fail without the fix.
Verified: new tests (fail after succeed on a real fake DB does not commit,
first failure still wins, late upgrade after caller abort and after
BLOCKED is aborted without running the upgrade callback) were RED and are
GREEN. All gates pass.
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>
openObject used to send VERIFY_OBJECT, which read and hashed every chunk,
and then streamed the object with READ_CHUNK, which read and hashed every
chunk again. A large object did twice the I/O before the first byte and
could exceed the RPC timeout during the pre-check.
VERIFY_OBJECT now takes an optional `manifestOnly` flag. openObject sends
it, so the pre-check only compares the stored manifest with the caller's
copy. Integrity is kept on the stream: READ_CHUNK still hashes each chunk,
and at the last chunk it also checks the chunk list against the root digest
before releasing the bytes, so a stream never ends as a success on an
unverified object. An empty object has no chunk to read, so its root digest
is still checked at open. verifyObject (reconcile) keeps the full check.
Verified: new tests in tests/unit/opfs-worker-runtime.test.ts were RED
(open read each chunk; a corrupted chunk or forged root failed at open) and
are GREEN (open reads no chunk bytes, each chunk is read once, a corrupted
chunk and a forged root digest fail the stream, empty objects are checked
at open, verifyObject still detects a corrupted chunk). All gates pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add Q-requirements for every recommended/minor review finding plus the
round-1 follow-ups (SW fetch scope, bundle budget), decisions D-11..D-16,
and tasks T51-T115 across the same nine lanes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fix the critical and required findings of the 2026-09-24 src review
(SPEC.md R-0..R-9.3, 50 tasks). See tasks/plan.md for results and open items.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Mark all 50 tasks done, record the fresh-checkout gate results, the two
out-of-plan fixes (R-0 follow-up, inventory rows) and the decisions left
for the user (bundle budgets, SW fallback scope, session subject, disabled
query state, SSE multibyte speedup, V2 5xx).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The first R-0 pass prefixed only the tsc/vite/test entry points. 36 more
package scripts run node entry files that import src and therefore the
gitignored index, including ci:gate (the CI runner) and check:ci, so they
still failed on a fresh checkout.
- prefix those scripts with the index generator
- update the CI contract's canonical check:artifact-schemas command
- the guard test now walks relative imports from every node entry and
fails if a script reaches src/.generated without rendering it first
Verified from a fresh state: check:registries, check:ci, check:i18n,
check:design-system, check:diagnostics, check:realtime-boundaries,
check:artifact-schemas, verify:compatibility, ci:gate FE-GATE-001 pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(a) ContextRouteGateway had no key, so React Router reused one instance
across sibling contexts. On a context A -> B move the first render still
held A's routes, matched B's URL against them and mounted NOT_FOUND, which
reported route.changed(NOT_FOUND) and moved title/focus once. The gateway
element is now keyed by the context id.
(b) A rejected loadRoutes() always showed RouteFailureSurface, so a
routes module missing after a deploy never reached recoverChunk. A chunk
load failure is now rethrown inside a ChunkRecoveryBoundary keyed on the
chunk of the registered route the URL names (the routes module has no
manifest entry of its own; recoverChunk needs one to decide
reload-once). Other load errors still show RouteFailureSurface.
Verified: new tests/component/context-route-gateway.test.tsx mocks the
app with contexts cut from the real reference routes. RED "never matches
a new context's URL against the previous context's routes" (NOT_FOUND
reported) and "sends a failed routes-module download through chunk
recovery" (navigation.reload never called after a release change) failed
before and pass after. check:architecture, check:types:app,
check:types:test, lint, test:component, test:reference-feature pass;
test:unit passes except the pre-existing removal-fixture test (needs
generated artifacts/ files absent from a fresh worktree).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
LocaleProvider and ThemeProvider lived inside AppRouter, below the
server-state scope fence (and below QueryClientProvider keyed by
generation). A session change (FENCED -> READY) unmounted and remounted
them, so their live state was thrown away and re-read from storage. The
browser router was created in useMemo and never disposed, so every
remount (and StrictMode's double useMemo) left a popstate listener behind.
- New presentation/providers/preference-providers.tsx: persisted
LocaleProvider + ThemeProvider (the wiring T45 added to AppRouter).
- bootstrap/runtime-application.tsx: ApplicationProvider >
PreferenceProviders > ServerStateGenerationProvider > AppRouter, so the
fence only remounts session-scoped UI.
- AppRouter no longer mounts Locale/Theme. It creates the router in the
effect that disposes it: a disposed router never listens to history
again, so useMemo + cleanup would break back/forward under StrictMode's
replayed mount.
- Tests that mount AppRouter directly now wrap it in PreferenceProviders
(router, chunk-recovery-boundary, app-shell, product-feature-switch,
locale-platform, reference-feature reference-page).
Verified: RED "keeps locale state across a session scope fence and
disposes routers" (RuntimeApplication, demo sign-in, storage cleared after
choosing en-US) came back in Korean before and passes after; with the
providers hoisted but no dispose it fails on popstate listeners (4 added,
0 removed). check:architecture, check:types:app, check:types:test, lint,
test:component, test:reference-feature pass; test:unit passes except the
pre-existing removal-fixture test (needs generated artifacts/ files absent
from a fresh worktree).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The locale lived only in LocaleProvider state, so every remount (reload,
or the scope fence after a session change) started again from ko-KR.
The theme already persisted through preferences.setColorScheme; the
locale now uses the same path (D-5):
- contracts/storage-keys.ts: LOCALE key next to COLOR_SCHEME
(localStorage, public-preference, opaque-string-v1).
- application preferences port: additive getLocale()/setLocale(). The
application treats the tag as opaque; presentation owns the locale
list and normalizes what it reads back.
- LocaleProvider: optional onLocaleChange; the provider stays
storage-free so standalone uses and tests are unchanged.
- AppRouter mounts LocaleProvider from the stored locale and persists
changes (T46 moves this above the scope fence).
Verified: RED "stores the chosen locale and starts the next mount from
it" failed before (nothing written to LOCALE) and passes after.
check:architecture, check:types:app, check:types:test, lint,
test:component pass; check:registries PASS (compatibility unchanged from
baseline); test:unit passes except the pre-existing removal-fixture test
(needs generated artifacts/ files absent from a fresh worktree).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Navigating from the mobile drawer left focus on the menu button. The
route's main.focus() ran while the modal drawer was still open (the page
is inert then, so the call is ignored), the shell closed the drawer one
commit later, and the Dialog's deferred restore moved focus to the menu
button.
- app-shell.tsx: drawer links close the drawer on click, so the modal is
closed before the route commits and the route can take focus.
- core.tsx (Dialog): the deferred restore only runs while focus is still
unclaimed (body/null or inside the dialog). React usually commits the
navigation before setTimeout(0) fires in a browser; without this the
restore would take focus back from the new page. Escape still returns
focus to the trigger, because focus is inside the dialog then.
Verified: new tests/component/app-shell.test.tsx emulates modal
inertness (jsdom has no showModal/inert). RED "hands focus to the new
page when a drawer link navigates" ended on the menu button before and
passes after; "still returns focus to the menu button when Escape closes
the drawer" passes. New Dialog test "does not pull back focus that moved
out of a closed drawer" fails without the core.tsx guard. check:architecture,
check:types:app, check:types:test, lint, test:component pass; test:unit
passes except the pre-existing removal-fixture test (needs generated
artifacts/ files absent from a fresh worktree).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RouteLifecycle lived inside the route content, which ProtectedRoute,
InvalidRouteSurface and DisabledFeatureSurface never render. On those
screens document.title kept the previous page's title, focus stayed on the
link the user left (screen readers got no page-change cue), and no
route.changed diagnostic was recorded.
RegisteredRoute is now a thin wrapper that renders RouteLifecycle first and
the former body (renamed RouteSurface) after it, so every branch gets title,
main focus and telemetry, and the lifecycle effect still runs before the
page heading's focus effect.
Verified: RED "runs the route lifecycle on the {authentication-required,
invalid-route, disabled-feature} surface" (focus left on a nav link, then a
history navigation) all failed before with the home title still set and
pass after. check:architecture, check:types:app, check:types:test, lint,
test:component, test:reference-feature pass; test:unit passes except the
pre-existing removal-fixture test (needs generated artifacts/ files absent
from a fresh worktree).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RouteLifecycle ran title, main focus, scroll-to-top and reportRouteChanged
in one effect that depended on message/resolve, which the LocaleProvider
recreates on every locale change. Changing the language therefore moved
focus off the language select (main, then the h1), scrolled to the top
and reported a route change, against the routing doc's "locale change
re-renders the title and copy only" contract.
The title now has its own effect (locale-dependent). Focus, scroll and
telemetry run on pathname/search only; location.key is dropped, so a
hash-only move (skip link, error summary #field) no longer re-runs them.
Verified: RED "changes only the title and copy when the locale changes"
failed before (focus moved off the locale select) and passes after; it
also checks document.title and the route.changed count. check:architecture,
check:types:app, check:types:test, lint, test:component pass; test:unit
passes except the pre-existing removal-fixture test (needs generated
artifacts/ files absent from a fresh worktree).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
useApplicationQuery passed TanStack's isPending as isInitialLoading. A
disabled query without data is pending (fetchStatus "idle"), so dependent
queries waiting on a prerequisite showed a skeleton and aria-busy forever.
Two changes were needed:
- application-query.ts passes isPending && fetchStatus !== "idle". The
review suggested isLoading, but with the default networkMode "online" an
offline first load is "paused" (isFetching false), and isLoading would
stop showing it as loading.
- deriveAsyncState fell back to "initial-loading" whenever there was no
data, no failure and no load, so the signal fix alone still produced
initial-loading (checked). The fallback is now "empty". This also stops a
query that resolves to null from looking like it loads forever.
Verified: RED "does not report a disabled query without data as loading"
failed with base "initial-loading" before and passes after; "still
reports a real first load as loading, including a paused offline one"
guards the other direction. check:architecture, check:types:app,
check:types:test, lint, test:component pass; test:unit passes except the
pre-existing removal-fixture test (needs generated artifacts/ files absent
from a fresh worktree). test:reference-feature also passes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
isChunkLoadFailure only knew the Chromium/Firefox wording, so Safari's
"Importing a module script failed." and Vite's "Unable to preload CSS for …"
were treated as ordinary render defects and never reached recoverChunk.
Both strings are now recognized.
Vite dispatches vite:preloadError and, unless a listener calls
preventDefault(), rethrows the same error into the dynamic import. That
rejection reaches the route's ChunkRecoveryBoundary, so no listener in
bootstrap/main.tsx was added: a listener that reloads would bypass the
reload-once guard, and one that prevents the default would swallow the
error.
Verified: RED "recognizes the WebKit module failure and the Vite CSS
preload failure" (false) and "recovers when Vite rethrows a
vite:preloadError into the lazy import" (recover not called, no failure
surface) failed before and pass after. check:architecture,
check:types:app, check:types:test, lint, test:component pass; test:unit
passes except the pre-existing removal-fixture test (needs generated
artifacts/ files absent from a fresh worktree).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
React Router 7 reuses the rendered-route instance between sibling routes,
so ChunkRecoveryBoundary kept its error/support state after the user left
the failed route and every later page showed "화면 자산을 복구하지 못했습니다"
until a manual browser reload. The boundary is now keyed by routeId, and
the support surface has a user-started "한 번 새로고침" button.
Verified: RED "clears a failed route chunk when the user moves to a sibling
route" (failure surface still rendered after navigating to /examples/ui)
and "offers a user-started reload on the failure surface" (no button) both
failed before the fix and pass after. check:architecture, check:types:app,
check:types:test, lint, test:component pass; test:unit passes except the
pre-existing removal-fixture test, which needs generated artifacts/ files
absent from a fresh worktree.
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>