Commit Graph
398 Commits
Author SHA1 Message Date
DongHyeonkaandClaude Opus 5.5 e771e5e032 fix(scripts): copy pnpm state files into fixture node_modules (00-01)
Linking every top-level entry also linked .pnpm-workspace-state-v1.json,
so pnpm running inside a fixture rewrote the repository's own install
state. Top-level files are now copied; directories stay symlinks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-25 21:10:58 +09:00
DongHyeonkaandClaude Opus 5.5 23336f2300 test(removal-fixture): check the evidence copy against a temporary tree (10-01)
The test counted git-ignored artifacts/release/* files in the working
directory, so a fresh clone or CI runner had none and failed. It now
writes fake evidence and regenerated-tree files into a temp source root.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-25 21:08:31 +09:00
DongHyeonkaandClaude Opus 5.5 c5f379b82c docs: plan the 2026-09-25 maturity review fixes
SPEC maps all 138 findings to requirements and fixes the defaults for
the review's open choices (D-1..D-19). The plan runs gate/CI groundwork
first, then parallel area lanes, then integration.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-25 21:05:08 +09:00
DongHyeonkaandClaude Opus 5.5 412b3d1f1e docs: add the maturity review guide and the 2026-09-25 full review
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>
2026-09-25 21:05:08 +09:00
donghyeon.kang 4626b738e1 Merge pull request 'fix: 2026-09-24 src 리뷰 전 항목 반영 (1·2·3차)' (#2) from fix/src-review-round3 into main 2026-09-24 06:57:22 +00:00
DongHyeonkaandClaude Opus 5.5 38020da112 docs: mark round 3 push and PR task done
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 15:49:05 +09:00
DongHyeonkaandClaude Opus 5.5 d7fc464426 test(browser-capabilities): pin chunk-failure wording on all three engines (R3-7)
Run the app's isChunkLoadFailure (served by the dev server) against the real
error each engine raises for a missing dynamic-import chunk. Passes on
Chromium, Firefox and WebKit. Record the WebKit run (e2e 39, capabilities 17).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 15:48:57 +09:00
DongHyeonkaandClaude Opus 5.5 89fc4d4bd7 docs: record round 3 results
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 15:45:51 +09:00
DongHyeonkaandClaude Opus 5.5 ef8966e329 test(e2e): link fixture node_modules through the shared helper (R3-6)
check:adapter-inventory forbids a raw node_modules symlink in fixtures; use
linkFixtureNodeModules like the other fixture builders.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 15:45:34 +09:00
DongHyeonkaandClaude Opus 5.5 d1a57ae949 fix(build): let the hosting gate accept the selected ACTIVE worker (R3-6)
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>
2026-09-24 15:42:09 +09:00
DongHyeonkaandClaude Opus 5.5 19e8decf46 fix(build): resolve worker config generated inputs from the config file (R3-6)
vite.service-worker.config.ts loaded .generated/frontend-runtime/*.ts with a
bare relative import(). Vite's default `bundle` config loader runs the config
from node_modules/.vite-temp/, so with the ACTIVE selection
`corepack pnpm build` stopped at the worker step. Resolve the paths against
import.meta.url, which every loader keeps pointing at the config file.

The e2e helper no longer patches build-frontend.ts with
`--configLoader native`; the quarantined fixme is replaced by a check that
both unmodified ACTIVE builds emitted service-worker.js.

RED (throwaway copy, ACTIVE selection, unmodified scripts/build-frontend.ts):
  TypeError: Required generated module is unavailable:
    ./.generated/frontend-runtime/service-worker-assets.ts
  [cause]: Error [ERR_MODULE_NOT_FOUND]: Cannot find module
    '.../node_modules/.vite-temp/.generated/frontend-runtime/service-worker-assets.ts'
  build step failed: npx vite build --config vite.service-worker.config.ts
  build-frontend exit=1
GREEN: same copy after the fix -> build-frontend exit=0, dist/service-worker.js
  emitted; `pnpm test:e2e --project=chromium
  tests/e2e/service-worker-update.spec.ts` 5 passed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 15:42:09 +09:00
DongHyeonkaandClaude Opus 5.5 122a3a8b71 perf(browser-transfer): pass optional image-cdn operation inputs directly (R3-2)
The kernel already treats an undefined signal or timeoutMs as absent, so the
conditional spreads around them were dead weight.

file-transfer gzip: 54484 -> 54468

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 15:33:13 +09:00
DongHyeonkaandClaude Opus 5.5 cad1d9c58c perf(browser-transfer): move the upload two-signal combiner into the abort kernel (R3-2)
combineAbortSignals moves verbatim from resumable-upload-runtime.ts to
platform/abortable-operation.ts (AbortSignal.any is not available on the
Safari 16 target). Behavior is unchanged: either input aborts the combined
signal, and release only drops listeners. Adds kernel unit tests for it.

gzip: file-transfer 54499 -> 54484, offline-indexeddb 35854 -> 35856,
service-worker-pwa 9500 -> 9499, realtime 39685 unchanged (net -14).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 15:33:13 +09:00
DongHyeonkaandClaude Opus 5.5 a58197844b perf(browser-files): wait on picker aborts through the kernel operation (R3-2)
The native-input wait and the system-picker wait no longer add their own
abort listeners; both use createAbortableOperation, and dispose closes the
operation. Results stay ABORTED for caller abort and for dispose. Adds a
characterization test for dispose while the enhanced picker is pending.
Hand-rolled abort ratchet 16 -> 15.

file-transfer gzip: 54500 -> 54499

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 15:33:13 +09:00
DongHyeonkaandClaude Opus 5.5 ce03745b66 perf(browser-transfer): race presigned body reads on the kernel operation (R3-2)
readWithSignal now races reader.read() through createAbortableOperation
instead of its own abort listener, and createAbortScope takes the single
consumer signal its only caller passes instead of looping over an array.
Adds a characterization test for a consumer-only abort during a pending
read (ABORTED, owner signal untouched, body cancelled).

file-transfer gzip: 54546 -> 54500

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 15:33:13 +09:00
DongHyeonkaandClaude Opus 5.5 02fc2a384c test(e2e): service worker install headers and two-build update on real builds (R3-6)
Builds the app twice with the ACTIVE selection in a temp copy and serves
either dist from a per-test static server. Covers install with
application/javascript and gzip bodies, update-waiting/reload-required
through the host, and the previous-cache fallback for a removed chunk.

The unmodified ACTIVE build fails (vite.service-worker.config.ts resolves
.generated/ from node_modules/.vite-temp); that case is test.fixme and the
helper builds with --configLoader native.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 15:32:42 +09:00
DongHyeonkaandClaude Opus 5.5 407046407a test(browser-capabilities): real unbound showOpenFilePicker call and Vary: Accept-Encoding cache lookup (R3-6)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 15:32:42 +09:00
DongHyeonkaandClaude Opus 5.5 def38b5e36 test(e2e): check focus after a mobile drawer link navigation (R3-6)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 15:32:42 +09:00
DongHyeonkaandClaude Opus 5.5 aac7a32862 perf(realtime): split SSE lines on bytes and decode each line once (R3-5)
The parser now finds CR/LF with Uint8Array.indexOf before decoding, so a
line's UTF-8 byte count comes from byte offsets instead of re-encoding the
text. Each complete line is decoded once by a streaming fatal TextDecoder;
a line that continues into the next read is stream-decoded, and the bytes
of a character split across reads count once it completes, as before.

Behavior kept (the push() input was already Uint8Array; no seam change in
fetch-sse-connection.ts, public API unchanged):
- CR / LF / CRLF, CR and LF split across reads, multi-line data
- one leading BOM stripped (now done by the parser, decoder uses
  ignoreBOM: true, so a BOM at a later line start stays text)
- line / event / incomplete-buffer byte limits, same failure point
- drain() and the per-call item cap; kept bytes are copied
- a pending CR or the item cap waits while only part of a character is
  left, as the text-based parser did
- error codes (MALFORMED_EVENT / EVENT_TOO_LARGE / QUEUE_OVERFLOW / CLOSED)

Differences only on invalid UTF-8: the old parser decoded a whole chunk
first, so malformed bytes won over another error later in that chunk and
malformed bytes past the item cap failed in push(). Now the first
problem in stream order wins and those bytes fail in drain(). Both
still fail closed.

Fixed: Node's streaming TextDecoder (ignoreBOM: false) drops a U+FEFF
right after the stream's first character when that character is split
across reads, e.g. [EF] [BB BF EF BB BF] decoded to "" instead of
"". The old parser inherited that; the new one keeps the text.

Tests: existing parser and connection tests unchanged and passing. Added
a split-BOM case and a differential test against the round-2 parser
(tests/unit/realtime/sse-parser-reference.ts) over 2x1,500 seeded random
ASCII / multibyte streams with random read splits, random small limits,
truncated streams and skipped drains. 300,000 seeds also matched in a
manual run.

Benchmark (manual, not committed; Node v24.14.0, one push of one chunk,
best of 150 runs, host load average ~11-14 so absolute ms are noisy):

| input (one chunk)              | original e59994a | round 2 | new     | new vs original | new vs round 2 |
|--------------------------------|------------------|---------|---------|-----------------|----------------|
| ASCII, 249 KB, 209 events      | 103.72 ms        | 0.48 ms | 0.30 ms | 348x            | 1.6x           |
| Korean/emoji, 249 KB, 209 ev.  | 23.30 ms         | 0.85 ms | 0.44 ms | 53x             | 1.9x           |
| ASCII, 234 KB, 4 x 60 KB lines | 176.45 ms        | 0.61 ms | 0.34 ms | 513x            | 1.8x           |
| Korean/emoji, 234 KB, 4 x 60KB | 25.28 ms         | 1.10 ms | 0.65 ms | 39x             | 1.7x           |

Across five runs, multibyte new vs original stayed between 19x and 70x
(target: 10x or more).

Realtime bundle: 39903 / 40000 gzip bytes (baseline 39685, +218).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 15:31:29 +09:00
DongHyeonkaandClaude Opus 5.5 211b1ae36d fix(browser-transfer): parse upload Retry-After with the kernel parser (R3-2)
The resumable-upload fetch transport had its own parser that handed any
non-integer value to Date.parse, so "1.5", "2025-01-01" or an RFC 850 date
became a zero-delay retry. It now uses platform/retry-after.ts, which only
accepts delta-seconds or an IMF-fixdate.

file-transfer gzip: 54406 -> 54546

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 15:22:22 +09:00
DongHyeonkaandClaude Opus 5.5 874f4012ee perf(browser-transfer): run image-cdn abort wiring on the kernel operation (R3-2)
The capability-verification deadline, the probe wait and runtime close now
use createAbortableOperation/snapshotAbortTimers instead of three local
helpers and a default scheduler wrapper. Results, error codes and the
scheduler TypeError message are unchanged. Hand-rolled abort ratchet 17 -> 16.

file-transfer gzip: 54562 -> 54406

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 15:22:22 +09:00
DongHyeonkaandClaude Opus 5.5 108ac6a606 fix(http): classify 408/425 error envelopes as server failures and honor 503 Retry-After (R3-1)
- client: the final V2 classification step maps a 408/425 response with a
  valid error envelope to SERVER_FAILURE (via gatewayFailureOr), keeping
  the backend code and request/trace ids. contracts/errors.ts is unchanged.
- client: Retry-After is also parsed (kernel parser) on 503, so the retry
  waits at least that long and the 30s ceiling applies. 502/504 keep the
  local backoff.

RED (before the fix, 14 failing in tests/integration/http-client.test.ts):
- safe GET on a 408/425 error envelope: kind UNKNOWN_CLIENT_FAILURE,
  fetched once (expected SERVER_FAILURE, 3 fetches, code UPSTREAM_BUSY)
- none/keyed command on a 408/425 error envelope: kind
  UNKNOWN_CLIENT_FAILURE; keyed fetched once instead of 3 times
- 408/425 error envelope with Retry-After: 2: not retried
- 503 (gateway body and envelope) with Retry-After: 2: slept 125ms
  instead of 2000ms
- 408/425 envelope and 503 with Retry-After: 31: retryAfterMs missing
Pins that passed before and after: a non-idempotent command is sent once
on 408/425/503 gateway bodies and on a 503 envelope; 502/504 ignore
Retry-After (125ms).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 15:19:42 +09:00
DongHyeonkaandClaude Opus 5.5 db1bc1fc7e fix(http): retry 408/425 server failures and parse Retry-After with the kernel (R3-1)
- retry-policy: a SERVER_FAILURE with status 408/425 follows the
  502/503/504 rule (safe or keyed only; never idempotency "none" or
  retry "never"). Retry-After is honored and its 30s ceiling applies to
  any failure that carries it, not only RATE_LIMITED.
- client: Retry-After is parsed by platform/retry-after.ts for
  408/425/429, on every failure path (gateway bodies included).
  The local parseRetryAfterHeader is removed.

RED (before the fix, 15 failing):
- 408/425 gateway body on a safe GET: expected 3 fetches, got 1
- keyed command on 408/425: expected 3 fetches, got 1
- 408/425 with Retry-After: 2: expected ok after a 2000ms wait, got the
  first failure
- 408/425 with Retry-After: 31: retryAfterMs missing on the failure
- 429 Retry-After "1.5": slept 1500ms instead of the 125ms backoff;
  "Thursday, 01-Jan-70 00:00:05 GMT": slept 5000ms; "1e3", "0x10",
  "-1", "2099-01-01T00:00:00Z": accepted by the old parser, so the
  request was not retried with the 125ms backoff
- unit shouldRetry(safe, SERVER_FAILURE 408): false
Non-idempotent command on 408/425 stays 1 fetch (pinned, passed before
and after).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 15:16:56 +09:00
DongHyeonkaandClaude Opus 5.5 e0b20f50db docs(auth): document what readSubject must return and the fail-closed default (R3-3)
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>
2026-09-24 15:15:26 +09:00
DongHyeonkaandClaude Opus 5.5 55721f075a fix(auth): give the demo session a stable subject so a refresh keeps the cache (R3-3)
The demo adapter now reports "demo-user" as its subject while
authenticated (null otherwise), so an authenticated notification for the
same demo user no longer fences the server-state scope. Sign-out and any
state change still fence.

The scope runtime now treats an empty-string subject like a missing one
(fail-closed), so an owner that returns "" for everyone cannot disable
fencing between users.

Pinned: state change fences, subject change fences, an external owner
without readSubject fences on every authenticated notification.

RED (before the fix, tests/unit/server-state-scope-runtime.test.ts):
  x does not fence when the demo session re-announces the same user
    expected [ { kind: 'FENCED', ... } ] to deeply equal []
  x still fences when an authenticated session names an empty subject
    expected true to be false
  Tests 2 failed | 12 passed (14)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 15:15:26 +09:00
DongHyeonkaandClaude Opus 5.5 5848493580 fix(presentation): show a disabled query as idle instead of empty (R3-4)
A disabled query (no data, no error, not fetching) fell through
deriveAsyncState to "empty", so AsyncSurface rendered the
"no items" copy before the query had even started.

- AsyncState.base gains "idle" for "not started / waiting on a
  precondition". A completed empty result (`[]`, `""`, `null`) stays
  "empty"; a real first load stays "initial-loading".
- AsyncSurface renders an optional `idle` slot for idle, else nothing
  (no skeleton, no aria-busy, no empty copy, no children).

Consumer-facing: AsyncState["base"] union adds "idle" (additive);
AsyncSurface gains an optional `idle` prop. No in-repo exhaustive
switch over base needed changes.

RED (before the fix, node scripts/run-vitest.ts on the two files):
  application-query-bridge > disabled query: expected 'empty' to be 'idle'
  async-surface > derives base state 4 ({}): expected 'empty' to be 'idle'
  async-surface > idle renders neither loading nor empty:
    toBeEmptyDOMElement() received the empty-copy section
  Tests 3 failed | 25 passed (pins for first load, [] and null empty passed)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 15:14:11 +09:00
DongHyeonkaandClaude Opus 5.5 d66ae19ad0 docs: plan round 3 for the eight remaining review items
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 15:10:30 +09:00
DongHyeonkaandClaude Opus 5.5 79d10dae5a Merge branch 'fix/src-review-round2' into main
Round 2 of the 2026-09-24 src review fixes: every recommended/minor finding,
the SW fetch-scope follow-up and the bundle budget (T51-T115).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 14:53:23 +09:00
DongHyeonkaandClaude Opus 5.5 60900fe232 docs: record round 2 results
Mark T51-T115 done and record the fresh-checkout gate, bundle budget and
Playwright results plus the behaviour changes to know about.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 14:53:23 +09:00
DongHyeonkaandClaude Opus 5.5 dc223161d6 chore: lower the hand-rolled abort ratchet to 17
Round 2 moved more adapters onto the abort kernel; the ratchet comment asks
for the ceiling to follow the count down.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 14:50:30 +09:00
DongHyeonkaandClaude Opus 5.5 e96f78b8e0 perf(file-transfer): fold duplicated local helpers into one per module (Q-B)
- browser-file-picker: the native and enhanced pickers carried two copies of
  the same selection observation (#finishObservation / #observe); one
  module-level observeSelection replaces both.
- indexeddb-checkpoint-store: read / compareAndSwap / remove /
  removeUnreadable each repeated acquire -> transaction -> get -> onerror;
  withCheckpointRow does that once and hands the row to the operation, still
  inside the same transaction. deleteCheckpointRow shares the delete tail.
- resumable-upload-runtime: the four checkpoint removals that remap to
  UPLOAD_RECONCILE go through removeCheckpoint.
- image-cdn-runtime: the verification deadline reuses
  combineImageRuntimeAbortSignals instead of a second listener loop; the
  verifier-coverage check throws its TypeError from one place; the registry
  id pattern is one constant instead of three inline literals.
- presigned executor / capability provider: reuse checkpoint-schema's
  SHA256_HEX and isSafeUploadReceiptToken instead of equal local patterns.

file-transfer reference runtime: 54754 -> 54562 gzip bytes (budget 54600).
Other reference runtimes unchanged.

Verified: check:architecture, check:types:app, check:types:test, lint,
test:unit, test:component, check:adapter-inventory, build,
check:optional-recipes (file-transfer 54562/54600, offline-indexeddb
35854/36000, realtime 39685/40000, service-worker-pwa 9500/10000),
test:recipes, check:types:recipes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 14:49:19 +09:00
DongHyeonkaandClaude Opus 5.5 834308c29b perf(browser-transfer): remove guards that earlier checks already make unreachable (Q-B)
- image-header-metadata: `=== undefined` / `?? 0` / `?? null` guards on bytes
  and boxes whose index was bounds-checked a few lines earlier (PNG IHDR,
  JPEG marker, WebP VP8X/VP8L, AVIF ftyp/meta/iprp/ipma, ascii,
  readUint24LittleEndian). A differential fuzz of the old and new parser over
  720k valid and mutated PNG/JPEG/WebP/AVIF inputs found no difference.
- incremental-sha256: `?? 0` on in-range Uint32Array reads and `>>> 0` on
  Uint32Array stores, which already reduce modulo 2^32. Checked against
  node:crypto for 0..1 MiB inputs, one-shot and streamed.
- p256 verifier: the alphabet index can't be negative after the base64url
  pattern check, and the decoded signature is already an owned, exactly sized
  buffer, so it is no longer copied again.
- browser-image-probe: once the bitmap matches the header dimensions, which
  are positive and inside the decode budget, the repeated positivity and
  budget checks on the bitmap cannot fail.

file-transfer reference runtime: 54894 -> 54754 gzip bytes. Other reference
runtimes unchanged.

Verified: check:architecture, check:types:app, check:types:test, lint,
test:unit, test:component, check:adapter-inventory.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 14:49:19 +09:00
DongHyeonkaandClaude Opus 5.5 6c69df572b perf(file-transfer): use the abort kernel instead of local copies and wrappers (Q-B)
- cancelBody / cancelReader move from presigned/http-common.ts into
  platform/abortable-operation.ts next to compensateLateHandle; the probe's
  own cancelResponseBody/cancelReader copies are dropped and every caller
  imports the kernel pair.
- fetch-json-transport uses the kernel operation directly: the FetchAttempt
  projection only renamed terminal() (ABORT/TIMEOUT/CLOSED), and only the
  CALLER_ABORT case was ever read.
- browser-image-probe uses the kernel operation directly (awaitOwned /
  unanswered helpers replace the ProbeAbortScope object), and the body read
  goes through the same race instead of the hand-written readOrAbort.
- storage-manager-adapter's inspection wait is the kernel race: a caller
  abort ends the wait and a later settlement, including a rejection, is
  consumed, exactly as the hand-written listener did. The hand-rolled abort
  ratchet drops 19 -> 18 for this file.

file-transfer reference runtime: 55154 -> 54894 gzip bytes.
offline-indexeddb: 35951 -> 35854. service-worker-pwa: 9581 -> 9500.
realtime unchanged.

Verified: check:architecture, check:types:app, check:types:test, lint,
test:unit, test:component, check:adapter-inventory (hand-rolled abort
wiring 17/18).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 14:49:19 +09:00
DongHyeonkaandClaude Opus 5.5 09402478d6 perf(file-transfer): share byte-bucket, integer and control-character guards (Q-B)
Identical private copies lived in both file adapters and in five
browser-transfer modules. One copy each now lives next to isValidByteLength
in the browser-file-storage port (outside every reference-runtime source
root, so it adds no namespace export):
- byteBucket (browser-files/file-observer, presigned/http-common) ->
  browserDataByteBucket; both modules re-export it under the old name
- positiveSafeInteger / nonNegativeSafeInteger (checkpoint-schema,
  http-control-plane-adapter, runtime-policy, upload-byte-source,
  image-cdn-policy, browser-image-probe, file-policy's isPositiveSafeInteger)
  -> isPositiveSafeInteger / isNonNegativeSafeInteger
- hasControlCharacters (image-cdn-policy) and
  hasForbiddenHeaderValueCharacter (fetch-json-transport) -> hasControlCharacter

Same predicates, same results for every input.

file-transfer reference runtime: 55306 -> 55154 gzip bytes.
offline-indexeddb: 35957 -> 35951. realtime, service-worker-pwa unchanged.

Verified: check:architecture, check:types:app, check:types:test, lint,
test:unit, test:component, check:adapter-inventory.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 14:49:19 +09:00
DongHyeonkaandClaude Opus 5.5 7b6fc4796e perf(file-transfer): stop exporting helpers no other module imports (Q-B)
The reference-runtime measurement exposes every export of every catalog
module through a namespace object, so an export nobody imports still costs
bytes. Made module-private (only used inside their own file, not by src,
tests or scripts):
- download-input-validation.ts: SHA256, snapshotDownloadSource,
  validPresignedCapabilityForInput, safeOpaqueId
- checkpoint-schema.ts: RECEIPT_TOKEN, isUploadPartDescriptor,
  partMatchesFingerprint

Barrel (index.ts) exports are untouched.

file-transfer reference runtime: 55382 -> 55306 gzip bytes. Other reference
runtimes unchanged.

Verified: check:architecture, check:types:app, check:types:test, lint,
test:unit, test:component, check:adapter-inventory.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 14:49:19 +09:00
DongHyeonkaandClaude Opus 5.5 cc37f577e3 perf(browser-transfer): reuse one copy of duplicated upload helpers (Q-B)
The resumable-upload runtime and fetch transport carried private copies of
helpers that already exist once in the same adapter or its port:
- the 18-code failure list -> isBrowserDataFailureCode (same list, same order)
- observeTerminal/transferByteBucket -> observeTransferResult, moved from the
  presigned executor into presigned/http-common.ts and also used by the
  capability provider
- cancelResponseBody/cancelReader in the fetch transport -> http-common copies
- the loose isAbortSignal guard (transport + runtime) -> one export in
  checkpoint-schema.ts
- upload-response-validation's exactKeys -> checkpoint-schema's exactRecord

file-transfer reference runtime: 55704 -> 55382 gzip bytes. Other reference
runtimes unchanged.

Verified: check:architecture, check:types:app, check:types:test, lint,
test:unit, test:component, check:adapter-inventory.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 14:49:19 +09:00
DongHyeonkaandClaude Opus 5.5 07937fa59c fix(release): drop the never-called clear from the chunk reload marker (Q-6.9-9)
Follow-up to 215cc54. The chunk store passed to the shared reload-once
guard had a clear() that no path calls (chunk recovery has no coherent
boot to clear on; its marker only expires), which dropped
decide-chunk-recovery.ts to 75% function coverage against its 95% risk
threshold. RecoveryMarkerStore.clear is now optional and the chunk store
omits it; boot recovery still provides and uses it.

Verified: test:coverage risk gate PASS (363/363 modules, 72
thresholds; it failed on this module before); all gates PASS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 13:58:35 +09:00
DongHyeonkaandClaude Opus 5.5 1e93d30d1f refactor(platform): drop the .tsx re-export, move CI-only policies, derive message locales (Q-6.9-12)
- Delete src/features/reference-feature/presentation/reference-feature-runtime.tsx:
  it only re-exported the same-named .ts and nothing imported it by the
  .tsx path.
- Move promotion-readiness.ts and performance-budgets.ts from
  src/application/policies to scripts/lib: only scripts and their unit
  tests import them. Imports updated in 5 scripts and 2 tests.
  config/testing/risk-coverage.json lists only src modules, so their two
  criticalModules/highRiskPaths entries are removed; the synthetic
  14-file summary fixture now names two other existing src modules.
- installed-feature-messages.ts composes one catalog per locale the
  installed features declare (composeInstalledMessageCatalogs) instead
  of a fixed ko-KR/en-US list that silently dropped other catalogs. The
  exported type still maps each declared locale to its exact key set.

Verified: tests/unit/installed-feature-messages.test.ts (ko-KR/en-US
content pinned first; derived-locale and duplicate-key cases RED before);
app typecheck also passes with a zero-feature generated index; all gates
PASS; check:ci PASS; check-bundle resolves the moved module (stops later
on the absent artifacts/performance/bundle.json).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 13:58:35 +09:00
DongHyeonkaandClaude Opus 5.5 b2f37f05b0 fix(telemetry): evict buffered events only when that makes room (Q-6.9-11)
The buffer evicted lower-severity events one by one and only then found
the incoming event still did not fit, so both were lost (maxBytes 300,
info 50 + error 240, incoming warning 100: info evicted, warning
dropped). It now plans the evictions first (severity no higher than the
incoming one, lowest first, oldest first within a severity) and evicts
only if the plan frees enough room. The header comment now matches the
code: an event of the same severity is evicted, not only a lower one.

Verified: tests/platform/telemetry/telemetry-buffer.test.ts — the
review scenario RED before (info evicted), green after; same-severity
oldest-first eviction pinned. All gates PASS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 13:58:35 +09:00
DongHyeonkaandClaude Opus 5.5 924ef3891c fix(bootstrap): keep unvalidated config values out of the safe boot error (Q-6.9-10)
On CONFIG_SCHEMA_INVALID the loader copied the raw RELEASE_ID and
CONFIG_SCHEMA_VERSION strings (up to the 64 KB body limit) into the
"safe" error that BootErrorShell and diagnostics show, contradicting the
file's own contract. The error now carries the schema version only when
it passed the version gate (no validator issue at CONFIG_SCHEMA_VERSION)
and never the release id of a rejected document.

Verified: two cases in tests/runtime-schema/runtime-config.test.ts
(invalid field with a 10 KB RELEASE_ID; unsupported 10 KB version) RED
before, green after; test:runtime-schema and all gates PASS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 13:58:35 +09:00
DongHyeonkaandClaude Opus 5.5 40659de7ec fix(release): share one reload-once guard between chunk and boot recovery (Q-6.9-9)
Chunk recovery kept its own guard: marker keyed by the release pair, no
TTL, trusted write().ok. Round 1 fixed the boot guard (key-independent
marker within a TTL, read-back check) but the chunk copy still reloaded
on every failure when replicas alternated A->B, B->A.

platform/release gains createReloadOnceGuard (the round-1 boot rule,
now with a refusal reason); createReleaseMismatchRecovery wraps it with
unchanged boot semantics (marker within TTL blocks regardless of key,
markCoherentBoot clears), and decideChunkRecovery uses it over its own
CHUNK_RELOAD_GUARD key, keeping its reason vocabulary. Application ->
platform is allowed by .dependency-cruiser.json; platform may not import
application, so the guard lives in platform.

Behavior change (chunk only): a second reload within the TTL is refused
even for a different release pair, and a marker that does not read back
is guard-write-failed. tests/component/context-route-gateway.test.tsx
used a preferences stub that dropped writes; it now persists them.

Verified: tests/unit/chunk-recovery.test.ts characterization (read/write
failure, same pair, invariants) green before the change; alternating
pair test RED before, green after. Boot tests unchanged and green;
FE-RB-002 drill PASS; test:integration PASS; all gates PASS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 13:58:35 +09:00
DongHyeonkaandClaude Opus 5.5 e119eb667a fix(bootstrap): show a static boot shell until the first render (Q-6.9-8)
Boot awaits runtime config (5s budget), the release manifest (5s) and
contract-set checks before its first render, and #root was empty the
whole time with no busy state. index.html now ships a static loading
status (role="status", aria-busy="true", the existing state-surface
loading class) inside #root; createRoot's first render — the app or the
BootErrorShell — replaces it.

Verified: tests/component/bootstrap-shell.test.tsx reads index.html
(RED before: no busy status) and checks the first React render removes
the shell; `pnpm build` keeps the shell in dist/index.html with the
render-blocking CSS link. All gates pass; test:reference-feature's
production-vertical test timed out once on "로그인 시작" and passed on
rerun (timing flake, unrelated file).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 13:58:35 +09:00
DongHyeonkaandClaude Opus 5.5 911561985b fix(platform): let an interaction detach from its owner signal on completion (Q-6.9-7)
createExecutionContext forwarded an owner signal's abort and removed
that listener only when the interaction itself aborted. An interaction
that finished normally under a long-lived owner signal left its listener
and AbortController on the owner. ExecutionContext gains complete():
idempotent, detaches from the owner without aborting the interaction.
No caller passes an owner signal today, so this closes a latent leak.

Verified: new test in tests/platform/execution/execution-context.test.ts
(RED before: complete is not a function); all gates pass except the
known tests/unit/removal-fixture.test.ts (artifacts/ absent).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 13:58:35 +09:00
DongHyeonkaandClaude Opus 5.5 b7c4e380e2 fix(features): reject duplicate or mislabelled feature adapter contributions (Q-6.9-6)
composeFeatureAdapterInputs silently let a later contribution with the
same featureId overwrite the earlier one, and wrote an input under
whatever featureId createInput returned. A feature copied from
reference-feature without renaming its id replaced the original's API.
Composition now throws on a duplicate featureId and when
installed.featureId !== contribution.featureId, matching route codecs
and message catalogs.

Verified: two new tests in
tests/contract/reusable-capability/feature-adapter-composition.test.ts
(both RED before: no throw). test:contract passes; all gates pass
except the known tests/unit/removal-fixture.test.ts (artifacts/ absent).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 13:58:35 +09:00
DongHyeonkaandClaude Opus 5.5 76de74a0fa fix(features): withhold feature inputs switched off by FEATURE_OVERRIDES (Q-6.9-5)
createRuntimeAdapters computed activeFeatureIds and then composed feature
inputs for every installed feature, so a feature disabled by the kill
switch still got its API from application.features.get(); only the
router honoured the switch. createInstalledFeatureInputs now takes the
active ids (optional; the default stays "every installed feature" for
callers without runtime config) and the runtime passes them.

Verified: tests/unit/runtime-adapters.test.ts — disabled feature has no
features.has/get (RED before: has() was true); every installed feature
still resolves when nothing is switched off. All gates pass except the
known tests/unit/removal-fixture.test.ts (artifacts/ absent).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 13:58:35 +09:00
DongHyeonkaandClaude Opus 5.5 a328776bf2 fix(telemetry): send both telemetry ports through one collector transport (Q-6.9-4)
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>
2026-09-24 13:58:35 +09:00
DongHyeonkaandClaude Opus 5.5 b35304dd48 fix(realtime): retryable OFFLINE for a throwing poll, one BOM, single encodes (Q-6.4-11)
- bounded-poll: an executor that throws becomes OFFLINE retryable:true,
  but OFFLINE is not a poll-retryable kind, so the run ended through
  pollFailure(kind) with retryable:false. OFFLINE now keeps its
  retryable flag on that exit, like the lifecycle OFFLINE exits.
- sse-parser: TextDecoder(ignoreBOM: false) already strips the one
  leading BOM the stream grammar allows; the parser stripped a second one.
  The manual strip is removed.
- event-codec: the raw event was UTF-8 encoded twice; now once.
- fetch-sse-connection: one module TextEncoder instead of a new one per
  event and per cursor check.
- websocket-protocol: the R-05 admission JSDoc sat on utf8ByteLength; it
  now documents exceedsUtf8ByteLimit, and utf8ByteLength reuses one
  encoder.

RED: a throwing executor returned retryable:false; a stream starting with
two BOMs before "data: x" produced an event. Both pass now; the
encode/JSDoc items are covered by the existing codec, SSE and WS suites.
Gates: architecture, types app/test, lint, adapter-inventory, test:unit,
test:component pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 13:54:42 +09:00
DongHyeonkaandClaude Opus 5.5 13274f7f3a fix(realtime): bound the live probe buffer by what it still holds (Q-6.4-10)
bufferProbeValue compared the ceilings against acceptedEvents /
acceptedBytes, counters that only grew. Activation drains the buffer
while the probe keeps receiving, so once a probe had accepted
maxProbeBufferedEvents values in total, the next write during activation
failed closed and left the coordinator CLOSED even with an almost empty
buffer. The check now uses buffer.length and bufferedBytes, which the
drain already decrements; the two cumulative counters are removed.

RED: new test (limit 2, write two, activate, write a third while the
first drains) got QUEUE_OVERFLOW before the fix; it now buffers, and a
fourth write that really exceeds the current buffer still fails closed.
Gates: architecture, types app/test, lint, adapter-inventory, test:unit,
test:component pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 13:54:42 +09:00
DongHyeonkaandClaude Opus 5.5 c7b921f82f refactor(realtime): extract endAttempt() and drop the ignored _recovery argument (Q-6.4-9)
reconnect-coordinator run() repeated the same attempt teardown (settle
the barrier gate, close the opened session, clear `session`, abort and
dispose the phase) at about fifteen exits. It is now one endAttempt(gate,
session) closure; each exit keeps its original order (the one site that
closed a session before settling the gate still does so before calling
endAttempt). The interrupted-attempt exit also goes through endAttempt;
its extra phase abort is a no-op because the phase was already aborted.
Exits that drain before disposing, or that already closed the session,
are left as they were so no session is closed twice.

websocket-connection failure()/connectionFailure() ignored their 4th
`_recovery` argument, which 40 call sites passed. The parameter and the
arguments are removed; both helpers are module-private, not a port.

No behavior change, so the existing reconnect and WebSocket suites
are the safety net. Gates: architecture, types app/test, lint,
adapter-inventory, test:unit, test:component pass. Realtime bundle
39433 -> 39354 gzip.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 13:54:42 +09:00
DongHyeonkaandClaude Opus 5.5 ae2f006b6d refactor(realtime): merge snapshot and race helpers, move shared parsers to kernel (Q-6.4-8)
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>
2026-09-24 13:54:42 +09:00