reconnectable() in the reconnect coordinator returned false for
PROVIDER_UNAVAILABLE/RATE_LIMITED whenever serverNotBeforeMs was null, even
with retryable:true. The transports send exactly that for WS NETWORK_LOST /
RESTART (1006/1001/1012, error event) and SSE 502/504, and WS can never carry
a hint, so those streams ended instead of reconnecting. The bounded poll
coordinator had the same rule for retryAfterMs.
Both now decide on retryable + kind only; a missing hint falls back to policy
backoff. Transports that require a hint and lack one already report
retryable:false (SSE 429/503 without Retry-After, WS OVERLOADED), which stays
terminal.
Tests: the reconnect and poll tests that pinned the old behavior ("does not
reconnect/retry ... without a server hint") encoded the bug and are rewritten
to expect a policy-backoff retry. New seam tests wire the real
createWebSocketConnection / createFetchSseConnection into the reconnect
coordinator. RED before the fix: "reconnects a WebSocket NETWORK_LOST|RESTART
close that carries no server hint" (1 socket, expected 2), "reconnects SSE
HTTP 502|504 that carries no server hint" (got PROVIDER_UNAVAILABLE
retryable:true instead of the second attempt's FORBIDDEN), "retries retryable
RATE_LIMITED|PROVIDER_UNAVAILABLE without a server hint on policy backoff"
(execute called once). The WS test also closes with OVERLOADED to show
retryable:false stays terminal.
Gates: check:architecture, check:types:app, check:types:test, lint,
test:component pass. test:unit passes except removal-fixture.test.ts, which
needs generated artifacts/release evidence absent from this fresh worktree
(unrelated).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The value check was anchored with ^, so "request failed: Authorization:
Bearer abc" passed through, as did ?access_token=... in a URL and email
addresses. The key deny-list also missed pwd/pass/auth/otp/pin.
Changes in src/platform/telemetry/redact-telemetry.ts:
- Bearer/Basic credentials and JWTs are masked wherever they occur; only
the match is replaced with [redacted], the rest of the message stays.
A JWT cut short still matches.
- URL query/fragment parameters (?, &, #) are masked when the name is a
secret key (isSecretTelemetryKey) or one of the URL-only names code,
key, sig. Non-secret parameters (limit, cursor, state) are kept.
- Email addresses are masked, including one cut in half by truncation.
- Keys: pwd, pass, auth, otp, pin match as whole key tokens (camelCase,
snake, kebab, PINCode split), so spinner/author/compass/isPinned are
kept; passcode and passphrase are added as fragments.
- Strings are truncated before the patterns run, so the scan is bounded
by maxStringLength. No regex lookbehind (Vite's default target includes
Safari 16.0).
Public exports and signatures are unchanged.
Pinned first (passed before and after): "keeps legitimate telemetry values
and innocent keys untouched" (enum codes, ULID/UUID/hex ids, route ids,
numbers, booleans, BASIC_PLAN, react@19.1.0, a URL without secrets,
code=... in prose, keys spinner/author/code/key).
RED before fix:
- "redacts the short secret key %s as a whole key token" (11 cases, key
kept)
- "redacts credentials in the middle of a string" (values unchanged)
- "masks secret URL query and fragment parameters" (tokens kept)
- "masks email addresses" (email kept)
- "does not leak a secret cut in half by truncation" (partial secrets kept)
Gates: check:architecture, check:types:app, check:types:test, lint,
test:component, check:release-coherence, test:platform pass. test:unit
passes except tests/unit/removal-fixture.test.ts, which needs generated
release evidence under artifacts/ that a fresh worktree does not have
(unrelated to this change).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the default queueMicrotask scheduler the first event of a burst was
sent at once with occurrences=1, and every duplicate inside the 60s dedup
window only bumped counters.deduplicated, so 1000 identical errors reached
the collector as occurrences=1. An event dropped from the buffer also left
its fingerprint in the dedup table, suppressing that event for 60s.
Per D-6 the pipeline now holds duplicate counts per fingerprint. Held
counts are folded into a buffered item of the same fingerprint or ride as
summary items in the next batch; they get a batch of their own only on an
explicit flush() or when the dedup window closes (one window timer), so a
duplicate never triggers a send by itself. The held table is bounded by
maxFingerprints. A rejected or evicted event (new buffer onEvict hook) and
a sampled-out event forget their fingerprint (new
TelemetryDeduplicator.forget), so the next occurrence is admitted again
and a sampled-out event is never reported through a summary. Existing
signatures are unchanged; onEvict and forget are additive.
Test changes:
- tests/features/reference-feature/reference-telemetry.test.ts expected
exactly one send for a 500-failure storm, which encoded the lost count;
it now expects 2 sends whose occurrences sum to 500.
- telemetry-pipeline.test.ts:93 (auto flush off, 25 in one item) is kept
as is and still passes.
RED before fix:
- "delivers every duplicate as occurrences with the default microtask
scheduler" (sum was 1, expected 1000)
- "reports held duplicates when the dedup window closes without another
flush" (no window timer armed)
- "does not let a rejected or evicted event suppress its fingerprint"
(re-emitted event was deduplicated, not buffered)
- "never reports a sampled-out event through a duplicate summary"
(sampledOut 1, expected 3)
Gates: check:architecture, check:types:app, check:types:test, lint,
test:component, check:release-coherence, test:platform pass; also
tests/scale/telemetry, tests/scale/session, tests/features/reference-feature
pass. test:unit passes except tests/unit/removal-fixture.test.ts, which
needs generated release evidence under artifacts/ that a fresh worktree
does not have (unrelated to this change).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reload-once marker only blocked a repeat of the same mismatch key. The
key is buildId:code:releaseId, so a load balancer alternating R10/R11
replicas produced a new key on every boot and each one reloaded again
(A->B->A->... looped). decide() now returns show-failure whenever a marker
younger than the TTL exists, whatever its key. markCoherentBoot() still
clears the marker and an expired marker still allows recovery.
The platform test "keeps a single bounded marker and scopes it to the
mismatch key" encoded the bug (R10->R11 then R11->R12 both reload-once);
it is rewritten to check only the bounded marker, and the key-independent
rule gets its own tests.
RED before fix:
- "allows one automatic reload per session within the TTL whatever the key"
(A->B returned reload-once)
- "cannot loop when a load balancer alternates the mismatch key"
(20 of 20 alternating boots reloaded)
- mixed-replica "cannot reload-loop when replicas alternate between two
different mismatches" (runBootSession threw "reload loop")
Gates: check:architecture, check:types:app, check:types:test, lint,
test:component, check:release-coherence, test:platform pass. test:unit
passes except tests/unit/removal-fixture.test.ts, which needs generated
release evidence under artifacts/ that a fresh worktree does not have
(unrelated to this change).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The default policy has allowedVaryHeaderNames: [], so any Vary header was
POLICY_REJECTED. nginx `gzip_vary` and most CDNs send
`Vary: Accept-Encoding` on JS and CSS, so the default policy could not
stage real assets. Accept-Encoding is a forbidden request header, so a
policy could not allowlist it as a request header either.
validateVary now skips `accept-encoding`. No script-built Request carries
that header, so the stored and lookup requests both lack it and Cache.match
still matches exactly. Every other Vary name keeps the existing checks.
A policy whose allowedResponseHeaderNames lacked `content-type` passed
assertPublicCachePolicy, but activation re-validates the stored
Content-Type, so every activation failed as INTEGRITY_FAILED. The policy
check now rejects it. The ops runbook lists both rules.
Verified: "stages, activates and looks up a Vary: Accept-Encoding response
with the default policy" (stage returned ok:false) and "rejects a policy
that strips Content-Type from stored responses" (no throw) failed before
the fix and pass now. check:architecture, check:types:app,
check:types:test, lint, test:component, verify:documentation pass.
test:unit passes except removal-fixture, which needs generated
artifacts/release files that a fresh worktree lacks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
EnhancedFilePicker and the download adapter captured showOpenFilePicker
and showSaveFilePicker with `.bind(options)`. A Window operation throws
TypeError("Illegal invocation") when `this` is not the Window, so passing
`window.showOpenFilePicker` / `window.showSaveFilePicker` as-is failed on
every call.
Both are now captured with `.bind(undefined)`. They are still captured at
construction, and Web IDL maps an undefined receiver to the global object,
so the native functions can be injected directly.
Verified: "calls an injected window picker without rebinding its
receiver" and "calls an injected window save picker without rebinding its
receiver" use a fake picker that throws "Illegal invocation" unless `this`
is undefined or globalThis. Both failed before the fix (ok:false) and pass
now. check:architecture, check:types:app, check:types:test, lint,
test:component pass. test:unit passes except removal-fixture, which needs
generated artifacts/release files that a fresh worktree lacks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A tab whose BroadcastChannel postMessage failed once called
closeBroadcast(), which also removed its receive listener. Publishers
that broadcast successfully never write a storage pulse, so from then on
the tab missed every other tab's event while reporting
ACTIVE_STORAGE_FALLBACK. A tab whose BroadcastChannel failed to open had
the same blind spot and the same healthy-looking status.
Per D-4 there is no dual broadcast+storage publishing. Instead:
- A publish failure only sets broadcastPublishFailed. Later publishes go
to storage, and the channel stays open for receiving.
- BROADCAST_OPEN_FAILED now yields the additive status
DEGRADED_STORAGE_FALLBACK (the union lives in the adapter and is only
passed through by bootstrap). A browser without BroadcastChannel at all
keeps ACTIVE_STORAGE_FALLBACK, because every tab there uses storage.
- A successful storage publish recomputes the status instead of forcing
ACTIVE_STORAGE_FALLBACK, so it cannot hide the degraded state.
Existing tests fixed: "falls back when BroadcastChannel open or publish
fails" and "enters explicit local-only degradation when every transport
fails" expected ACTIVE_STORAGE_FALLBACK for a tab whose channel failed to
open. The ops runbook lists the new status.
Verified: "keeps receiving broadcasts after its own broadcast publish
fails" (received [] instead of [BROADCAST]) and the open-failure status
assertion (ACTIVE_STORAGE_FALLBACK) failed before the fix and pass now.
check:architecture, check:types:app, check:types:test, lint,
test:component, verify:documentation pass. test:unit passes except
removal-fixture, which needs generated artifacts/release files that a
fresh worktree lacks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The per-source high watermark was stored with the event's expiresAt and
pruned with it. After a source was quiet for longer than the 60 s event
TTL, its next event had no previous watermark and `sequence > 1`, so it
was delivered as GAP, and the query-cache coordinator then invalidated
every topic.
The watermark now carries only the sequence. It is removed only by the
existing sourceCapacity LRU. Event dedupe entries still expire with the
event TTL.
The existing test "bounds TTL and LRU tracking instead of growing with
remote sources" expected a same-source replay of seq 1 to be delivered
again after the TTL, which only worked because the watermark expired.
It now expects that replay to be dropped as STALE.
Verified: "keeps the per-source sequence watermark past the event TTL"
failed before the fix (seq 2 after 61 s was GAP) and passes now.
check:architecture, check:types:app, check:types:test, lint,
test:component pass. test:unit passes except removal-fixture, which needs
generated artifacts/release files that a fresh worktree lacks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
boundedObjectUrlHandoff called resolveByteSource outside its try/finally.
When the authorized source open threw or was aborted, deliver() rejected
with an AbortError instead of returning {ok:false, ABORTED}, the observer
saw nothing, and the holder was never latched closed, so a lease that
arrived later was never closed by compensateLateSource.
Source resolution now runs inside the existing try/catch/finally, the same
shape promptAndStream already uses. The explicit closeHeldSource calls on
the early-return paths are covered by the finally.
Verified: "resolves ABORTED and closes a late lease when a bounded source
open is aborted" failed before the fix (promise rejected with AbortError)
and passes now. check:architecture, check:types:app, check:types:test,
lint, test:component pass. test:unit passes except removal-fixture, which
needs generated artifacts/release files that a fresh worktree lacks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Policy validation only checked partSize × copyFactor against
maxInFlightBytes. With the defaults (5 MiB × 4 into 20 MiB) the runtime
silently clamped workers to 1 while createSession still asked the server
for maxConcurrency 3, contrary to the documented rule that
partSize × concurrency × copyFactor over the budget is refused up front.
Per D-2 the default maxConcurrency is now 1 (the value that actually ran)
and maxInFlightBytes stays 20 MiB. Validation multiplies by maxConcurrency,
so a resolved policy always fits its workers in memory; the now-dead
memory clamp in the range-reader worker count is removed and createSession
requests the concurrency the runtime can run.
Verified: RED in tests/unit/resumable-upload-runtime.test.ts --
"has a valid production default policy" (maxConcurrency 4 over a 48-byte
budget did not throw) and "requests the concurrency the default policy can
actually run" (createSession got requestedMaxConcurrency 3) failed before
the fix and pass after. Existing test and browser-spec policy overrides
already satisfy the rule. Gates: check:architecture, check:types:app,
check:types:test, lint, test:component pass; test:unit passes except
removal-fixture.test.ts, which needs untracked artifacts/release/* absent
from a fresh worktree (unrelated).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The control plane accepts base64url IDs (/^[A-Za-z0-9_-]{8,512}$/), but the
presigned provider and executor each re-checked session, resource and
idempotency IDs with their own /^[a-z0-9][a-z0-9._:-]{0,255}$/i. IDs that
start with '-'/'_' (about 3% of random base64url IDs) or exceed 256
characters passed session creation and checkpointing, then every part issue
and the final download issue failed as INVALID_INPUT.
checkpoint-schema.ts now defines SAFE_TRANSFER_ID next to SAFE_OPAQUE_ID as
a superset of it; the provider and executor import it instead of keeping
their own regexes. IDs the presigned layer accepted before are still
accepted (no narrowing for non-upload download resource IDs).
Verified: RED "presigned layer accepts every control-plane opaque ID"
(tests/unit/presigned-transfer-upload.test.ts; leading '-', leading '_',
512 chars, for issueUploadPart + PUT and for issueDownload) returned
INVALID_INPUT before the fix and passes after. Gates: check:architecture,
check:types:app, check:types:test, lint, test:component pass; test:unit
passes except removal-fixture.test.ts, which needs untracked
artifacts/release/* absent from a fresh worktree (unrelated).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
snapshotRequest() threw a TypeError when the source exceeded maxFileBytes
or maxPartCount, and upload() mapped every snapshot error to INVALID_INPUT.
The LIMIT_EXCEEDED branch in executeUpload() re-checked the same policy
and could never run, so a 6 GB file was reported as invalid input.
snapshotRequest() now validates only request shape; executeUpload() owns
the size check and returns LIMIT_EXCEEDED before any control-plane call.
Verified: RED "reports a source over maxFileBytes as LIMIT_EXCEEDED"
(tests/unit/resumable-upload-runtime.test.ts) received INVALID_INPUT before
the fix and passes after. A valid policy already bounds the part count by
maxFileBytes, so the maxPartCount branch is covered by the same check.
Gates: check:architecture, check:types:app, check:types:test, lint,
test:component pass; test:unit passes except removal-fixture.test.ts, which
needs untracked artifacts/release/* absent from a fresh worktree (unrelated).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dispose() cached its drain promise. When the cleanup deadline expired it
returned UNAVAILABLE/retryable but kept that promise, so a later dispose()
replayed the same failure even after all work had settled: the checkpoint
store was never closed and lifecycle stayed CLOSING.
The one-shot admission close and the quiescence promise now live in
beginTeardown(); each dispose() races that shared quiescence against a new
deadline, and an expired drain resets so the next call can close the store.
Verified: RED "closes on a later dispose() once work that outlived the
deadline settles" (tests/unit/resumable-upload-runtime-teardown.test.ts)
failed with { ok: false } on the second dispose before the fix and passes
after. Gates: check:architecture, check:types:app, check:types:test, lint,
test:component pass; test:unit passes except removal-fixture.test.ts, which
needs untracked artifacts/release/* absent from a fresh worktree (unrelated).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
src/.generated is gitignored, but no entry point rendered it, so a fresh
checkout failed check:architecture, check:types:app/node/test, unit and
component tests, verify:documentation, dev and build.
- run-vitest renders the index before starting Vitest (all vitest suites)
- package scripts that load src (dev, build, storybook, architecture,
app/node/test type checks, the five fixtures that reach the index,
verify:documentation) render it first; CI runs these scripts by name
- tests/unit/product-index-entrypoints.test.ts guards the wiring
Verified from a fresh state (src/.generated removed before each gate):
architecture, types app/node/test, lint, unit 1781/1781, component 132/132,
verify:documentation, build, dev (HTTP 200), check:ci all pass;
fixture route-runtime still fails with its expected TS2740.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SPEC.md lists the 47 requirements (R-0, R-1.1..R-9.3) and decisions D-1..D-7.
tasks/plan.md and tasks/todo.md break them into 50 tasks across 9 lanes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Record the whole-src review findings by area with severity, location,
failure scenario, fix direction and test coverage.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The refactor commit was built from origin/main (ebea300) but recorded on top
of the initial commit, so the histories shared no ancestor beyond it. Resolve
all 46 add/add conflicts with the refactored version, and keep the remote-only
task-5 report and full README.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The supply-chain builder id and the two verifier ids each hardcoded the
repository name, in three source files plus a copy in the test fixture.
A project derived from this template had to edit all four, and all four
then became permanent conflict points for every merge back from here.
They now read the `name` this repository already declares in
package.json, so deriving a project is one line. The name is read once
at module load from a URL relative to the module itself, not from the
working directory, because these ids end up in signed provenance and
must not depend on where a script was invoked from. A missing or empty
name throws rather than falling back, for the same reason.
The value is hosted in scripts/lib/supply-chain.ts because all three
consumers already import it and it is already registered in
LOCAL_EVIDENCE_VERIFIER_SOURCE_PATHS. A new module would have needed to
join that list, which is itself part of the evidence surface.
This repository's own name is unchanged, so every emitted id is
byte-identical to before.
Also registers the three adapter files that 5cc4146 added without
updating the inventory ledger, which had left check:adapter-inventory
failing on develop.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Records the approved approach for standing up memento-frontend: merge
this template's history into it and keep the template as an `upstream`
remote so later improvements can be merged in.
Two decisions drive the rest of the design. The derived project tracks
`upstream/main`, so this repository's `main` has to be fast-forwarded to
`develop` first. And the derived project keeps the reference feature and
the example routes, so upstream merges stay conflict-free.
The design also covers one change to this repository that is not about
memento: the supply-chain builder and verifier IDs currently hardcode the
repository name in four files, which would make all four permanent
conflict points for every derived project. Deriving them from the
`name` in `package.json` reduces that surface to one line. This
repository's own name does not change, so the emitted ID strings stay
byte-identical.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
사양 추정이 전부 빗나갔다. 4벌 감소는 -693이 아니라 -322이고 커널은 470이
아니라 1132줄이라, 소스 순증감이 -223이 아니라 +810이다. 원인은 사양이
translate/실패 헬퍼 비용을 안 셌고 이행된 파일의 주석이 크게 늘었기
때문이다. 작업의 근거는 처음부터 줄 수가 아니었지만, 줄 수가 준다는 기대가
틀렸다는 것은 기록해 둔다.
사양이 틀린 것으로 판명된 항목 3건과, 보존하지 못한 동작 1건(RT-2)을
복원하지 않기로 한 근거, 테스트로 덮지 못한 경로 1건을 남긴다.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2902 -> 2744줄 (코드 2807 -> 2563, 주석 12 -> 111). 네 번째이자 마지막
사본이다. 손수 abort 리스너가 0이 되어 래칫을 22에서 21로 조인다.
RT-1을 보존했다: 번역기가 CLOSED -> unavailable을 명시 매핑한다. 빠뜨리면
close() 중 진행 중이던 open이 ABORTED로 보고된다.
RT-2는 보존하지 못했다. 사양은 "의미 동일"이라고 썼지만 실제로는 blocked
데드라인 이후 재시도가 새 factory.open()을 띄운다(이행 전에는 안 띄웠다).
커널에 "settle 이후에도 살아 있는 요청"을 알려줄 훅이 없어서 커널을 고치지
않고는 불가능하다. 연결 누수나 데이터 위험은 없고 낭비되는 요청만 는다.
다음 커밋에서 커널에 onSettled를 추가해 복원한다.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
IndexedDB enforce unique indexes
저널은 이제 트랜잭션 안 요청 28곳이 각자 오류를 보고한다. 코드 줄은
1744 -> 1724로 줄었고 전체 줄이 1817 -> 1881로 는 것은 주석이다. 이행 전
이 파일의 주석은 6줄이었다.
사양의 OP-1 전제는 틀렸다. "중복 put의 답이 달라진다"고 봤으나 이행 전후
모두 CONFLICT / retryable:false / recovery:NONE이다. 요청 오류를 아무도
처리하지 않으면 스토어가 바로 그 에러로 abort해서 transaction.error가
request.error와 같기 때문이다. 바뀐 것은 답이 아니라 출처다.
그 과정에서 가짜 IndexedDB가 unique 인덱스를 전혀 강제하지 않는 것을
찾았다. 보강 전에는 중복 begin이 ok:true로 성공했다 — 브라우저가 거부할
상태를 테스트가 조용히 허용하고 있었다. put/add에 검사를 넣었다.
unique:true 인덱스는 레포 전체에서 이 저널의 2개뿐이라 반경이 좁고, 전체
test:unit으로 파급이 없음을 확인했다.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1558 -> 1430줄. 손수 abort 리스너가 0이 되어 래칫을 23에서 22로 조인다.
보존한 동작 셋:
- blockedTimeoutMs를 넘기지 않는다. blocked 이벤트는 유지보수에게 종단이다
— 배치는 opt-in 백그라운드 패스라 다른 컨텍스트가 사라지길 기대하며
데드라인만큼 매다는 비용이 BLOCKED를 보고하고 재시도시키는 것보다 크다
- upgrade 콜백을 생략한다. 커널은 생략을 "어떤 upgrade든 예상 밖"으로 읽고
거절하는데, 그게 유지보수가 늘 해온 동작이다. 빈 APPLIED를 넣으면 잘못된
스키마로 열린다
- onversionchange는 admit 안, 바인딩 검증 앞에 등록한다
계획이 blocked 회귀 테스트로 지목한 indexeddb-maintenance.test.ts:289-290은
실제로는 onblocked 경로가 아니라 drain 검사였다. MT의 진짜 blocked 경로에는
테스트가 없었으므로 새로 썼다.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
712 -> 612줄. 연결 수명주기와 트랜잭션 상태기계가 커널로 갔고 CP의 손수
abort 리스너가 0이 됐다. 그래서 abort 래칫을 24에서 23으로 조인다.
보존한 동작 다섯 가지:
- 값 없는 완료는 CORRUPT_DATA/RECONCILE (translate에 NO_VALUE_PRODUCED를
명시 매핑). 빠뜨리면 UNAVAILABLE로 바뀐다
- durability는 undefined를 명시적으로 넘긴다. 커널 기본이나 strict를 쓰면
체크포인트 쓰기가 조용히 느려진다
- nativeFailure 6곳 전부 context.fail. requestFailed로 바꾸면 요청이
실패했는데도 뒤 요청이 커밋된다
- abort()가 throw하면 caller-abort 주장을 철회한다 (커널이 이미 구현)
- blocked 타이머는 주입형 timers
사양이 빠뜨린 함정 하나를 추가로 막았다. bindScope는 succeed()에 해당하는
것이 없어 그대로 옮기면 정상 바인딩이 NO_VALUE_PRODUCED로 보고된다.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
사양은 커널을 470줄로 추정했으나 실제 구현은 1,132줄이다. 그래서 레포
순증감이 -223에서 약 +439로 뒤집힌다. 이 작업은 줄 수를 줄이지 않는다.
근거는 상태기계 4개가 1개가 되는 것 하나뿐이라는 점을 명시하고, 이행을
멈추면 쓰이지 않는 커널이 남아 최악이라는 점도 적는다.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
네 어댑터가 각자 구현한 open/blocked/upgrade/트랜잭션 메커니즘을 커널로
모은다. 사본은 아직 이행하지 않았으므로 런타임 동작은 그대로다.
실패 분류는 커널에 넣지 않고 translate 콜백으로 주입한다. RT/MT/OP의
mapIndexedDbException과 CP의 mapBrowserDataException이 같은 에러에 다른
답을 내며, 그 차이를 통일하는 것은 별건이기 때문이다.
IndexedDbFailureCause는 translate의 입력과 호출자가 주는 admit FAIL에만
나오고 공개 반환 타입에는 나오지 않는다. 기존 커널 abortable-operation.ts는
AbortTerminalReason 3멤버를 반환 타입에 박아서 5종이 필요한 http v3가 아예
쓰지 못했는데, 그 함정을 피하기 위한 설계다. 사양 3.4의 네 호출부를 실제
코드로 써서 tsc --strict로 컴파일해 수용을 확인했다.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
telemetry가 platform/bounded-capacity.ts의 assertBoundedCapacity를 다시
내보내고 있었다. 같은 파일이 이미 그 심볼을 직접 import해서 쓰고 있고 이
재수출의 소비자는 없었다. 남겨두면 커널로 가는 두 번째 문이 되고, 어댑터가
어댑터를 통해 커널에 닿는 경로를 정당화하게 된다.
같이 담긴 IndexedDB 커널 이행 계획은 커널 -> CP -> MT -> OP -> RT 순서와
각 사본의 동작 변화 지점을 줄 번호로 특정한다. LOC 절감은 -223으로 작고,
이 작업의 근거는 줄 수가 아니라 트랜잭션 상태기계를 4개에서 1개로 만드는
것이라는 점을 명시했다.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
커널이 있는데도 어댑터 24개 파일이 addEventListener("abort")로 같은
race/cleanup을 각자 짠다. 전수 이행은 abort 의미론을 바꾸는 별도 작업이라
한 번에 하지 않고, 개수를 게이트에 고정해 되돌아가지 못하게 한다.
파일을 하나 더 늘려 실제로 막히는 것을 확인했다.
REQUIRED_ABORT_CONSUMERS 주석도 고친다. 그 목록은 재검토가 이름으로 지목한
네 파일만 덮는데, 주석은 Image와 Resumable을 지목하면서 정작 그 두 그룹의
런타임 파일(image-cdn-runtime.ts, resumable-upload-runtime.ts)은 목록에 없어
게이트가 초록불인 채로 사본이 유지되고 있었다.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
RuntimeHttpContract는 슬롯 네 개를 명시한 주입 지점인데, 그 슬롯이 비어
있다는 사실과 비운 채 되돌리면 모든 요청이 실패한다는 사실이 코드 어디에도
없었다. V3는 설치된 feature 계약에서 오퍼레이션을 받으므로 이 슬롯과
무관하다는 것도 함께 적는다.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
계획과 달랐던 2건(워커 realm tsconfig 제외, spec 정규식이 unsafe로 거부됨)과
측정 결과(번들 영향 0바이트, 회귀 검사 12->14)를 남긴다. 이 샌드박스에서
판정 불가한 게이트 3종과 그 이유도 적는다.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
그룹 바깥에서 어댑터 내부 파일을 직접 import하면 check:architecture가
거부한다. 회귀 fixture 2개가 거부와 허용을 각각 고정한다 — 규칙 이름을
바꿔 보면 fixture 검사가 먼저 깨지는 것을 확인했다.
도착점 정규식은 중첩 수량자 대신 교대를 쓴다. dependency-cruiser의 안전
정규식 검사가 (?:[^/]+/)? 안의 + 를 unsafe로 거부하기 때문이다.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
bootstrap과 feature 어댑터가 어댑터 내부 파일을 직접 겨누던 15곳을 그룹
배럴로 바꾼다. 커널(platform/**) 간선과 그룹 내부 import는 파일 경로를
유지한다 — check:adapter-inventory가 그 경로를 직접 검증한다.
번들 영향 없음: 초기 JS가 도입 전후 모두 181114 gzip bytes로 동일하다.
sideEffects 선언 없이도 재수출이 트리셰이킹된다.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
각 어댑터 그룹의 공개 표면을 index.ts로 선언한다. 소비자는 아직 바꾸지
않았으므로 런타임 동작은 그대로다.
storage 배럴은 서브배럴을 재수출하지 않는다 — 제거 드릴이 indexeddb/와
opfs/만 삭제하기 때문이다. service-worker 배럴은 tsconfig.service-worker.json
에서 제외한다. 그 설정이 그룹 폴더를 통째로 WebWorker lib로 컴파일하면서
페이지 realm 파일만 빼는 구조라, 배럴이 그 파일을 다시 끌어들이면 document를
찾지 못한다. 타입 커버리지는 tsconfig.app.json이 배럴을 포함하므로 유지된다.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
모듈별 구조 리뷰에서 나온 두 설계를 spec으로 남기고, 그중 배럴 경계
작업의 실행 계획을 쓴다. 배럴 규칙은 실제 import 그래프에 돌려 위반
15건이 치환 대상 15줄과 일치함을 확인했고, 재수출할 심볼 82개는 실제
export와 대조했다.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The release-evidence test asserted that every artifact a candidate is assembled
from survives the copy, which quietly assumed the checkout had already run the
release chain. It holds in this repository and fails in a product repository
that has not, where `artifacts/performance/bundle.json` simply does not exist
yet — a fact about the checkout, not about the copier. It now asserts that
whatever release evidence is present is preserved, and that at least one thing
was, so it cannot pass by finding nothing to check.
Vitest also walked `.worktrees/`. A git worktree inside the repository is a
different checkout of a different branch; running its tests against this
checkout's config produces failures that belong to neither and cost real time
to attribute.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The cgroup test read the live process tree with one `ps` per pid and asserted
while the provider was running. That was a race it used to win only because the
sandbox was slow; now a whole run finishes in a few hundred milliseconds and
`systemctl show` alone costs longer than the thing it describes. It records the
tree from `/proc` every 5ms and asserts on the recording once the run is over,
because the assertions were always about what the run contained.
That restructuring immediately paid for itself: the supervisor had been failing
to launch the sandbox at all, and the test was dying on the observation before
it ever checked the exit code.
It could not say why, because the supervisor consumed the child's output solely
to enforce a byte cap and then discarded it — `exit=1` and nothing else. It now
keeps the lines the sandbox tooling itself emits (`bwrap:`, `prlimit:`,
`systemd-run:`, `systemctl:`), which cannot carry provider credentials because
the provider command and its secrets travel in the args file. The failure now
reads:
sandboxed external provider failed: exit=1; sandbox reported:
bwrap: loopback: Failed RTM_NEWADDR: Operation not permitted
which is a host restriction — `kernel.apparmor_restrict_unprivileged_userns=1`
— reproducible in two lines of shell containing none of this repository's code,
and recorded in the ledger as such rather than carried as a product defect.
Suites that spawn processes, build archives and sign evidence were given a 30s
budget. The 10s default is sized for pure-JS unit tests; raising it globally
would hide a genuinely hung test.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Which features a build contains was not a decision anybody could express. The
reference feature was spread directly into the route, API, schema, codec and
adapter registries, so shipping without it meant editing five files by hand and
hoping nothing still referred to it — and there was no way at all to take it out
of service on a running deployment. The removability gate proved the editing
worked; nothing made it a choice.
There is now one manifest. `VITE_PRODUCT_FEATURES` narrows it at build time and
`FEATURE_OVERRIDES` in the runtime document takes an installed feature out of
service without a rebuild. Every registry composes from the manifest, and a test
fails if a new one forgets to.
Both inputs are subtractive, and the vocabulary is what enforces it rather than
a check somewhere downstream: the override enum has no `ENABLED`, and a
build-time selection naming something the source tree does not declare is
refused instead of ignored. A configuration document that could name a feature
into existence would be a configuration document choosing which code runs.
Disabling is not just hiding. Withdrawing a route from navigation would leave a
typed deep link that still mounts the feature, so the router refuses it too and
answers with a surface that says the deployment switched it off. The platform
overview now distinguishes the three states an operator actually needs: serving,
switched off, and not in this build.
What this is not: an env var does not shrink the bundle. A static import cannot
be undone by a value, and making the import graph itself depend on a
configuration string is the thing §3.5 exists to prevent — measured, `none`
changes the output by 58 bytes. Physical removal remains FE-GATE-020's job, and
the code comments say so rather than implying otherwise.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The inventory gate caught its own case: a new file under `src/adapters` that no
ledger row named. `assertBoundedCapacity` moved out of the telemetry adapter so
diagnostics could stop importing it across a boundary, and the kernel now has a
row of its own.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Nineteen findings across release admission, the provider sandbox, removability,
browser and visual evidence, architecture boundaries and documentation, each
named by defect rather than symptom, with the four removal fixtures' before and
after counts.
Three tests stay red and are recorded as such rather than claimed: the live
process-tree observation of a running sandbox, which now loses a race it used to
win only because the sandbox was slow, and two that time out at their 10s budget
under parallel load while passing in isolation. Lab performance produces
evidence for the first time and that evidence misses its budget; no budget was
moved to hide it.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
FE-GATE-020 proves a capability can be removed by rebuilding the whole project
without it. The fixture it built could not get that far, and the failures all
came from the fixture rather than from anything about removability.
It was not a repository. The supply-chain inventory is defined as the tracked
file set, so it asks `git ls-files` what the project contains; with no
repository to ask, generation failed and took every provider suite down with
it. It is now initialised on preparation and committed after the removal — not
before, or the index would still list the files the removal deleted.
It had no `.gitignore`, so once it did have a repository, every generated
artifact and every linked module landed in the index and the inventory refused
the fixture for tracked and generated paths colliding. It carries the ignore
rules now, and therefore records the same tracked set as the repository it was
copied from.
Each removal script kept its own copy-target list and they had drifted: the
reference-feature fixture omitted `playwright.capabilities.config.ts`, which the
inventory requires. There is one list now. It also gained the install and
workspace identity — `.npmrc`, the lockfile, the workspace file — without which
the fixture is a different project, and the release evidence a candidate is
assembled from, without which no candidate can be built at all.
A tracked root the removal deletes is no longer required of the result: the
optional-recipe fixture deletes `recipes/`, and the inventory policy demanded
it back. Roots that are gone are pruned from the fixture's policy.
Two smaller causes. A platform integration file asserted the reference feature's
own route ids, so removing the feature left it importing a deleted module —
typecheck, the test run, coverage and the residue scan all failed on that one
misplaced assertion, which now lives in the feature's test tree. And the
canonical exact-count authority was re-imposed on a contract the fixture
deliberately reduces, failing the fixture for the reduction it exists to prove;
`CI_CONTRACT_MODE` already marked those runs and is now honoured by default.
The reference-feature fixture goes from failing before its first assertion to
1,612 passing with one failure, and that one is the live process-tree
observation test already red on the main tree.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Three boundaries the layer contract declares had no executable rule behind
them, so the code drifted across all three while every gate stayed green.
`src/contracts` reached back up into `src/application` for the shared `Result`
carrier and the compatibility predicate. Neither package owned the shared
vocabulary and the dependency pointed both ways. Both now live in contracts —
the lower package — and application re-exports them, so no caller moves.
A concrete adapter was not supposed to depend on another concrete adapter, but
only adapter-to-presentation was enforced, and `diagnostics` imported a guard
out of `telemetry`. The guard belongs to neither, so it moved to the adapter
kernel. Stating the rule needed the checker to resolve `$1` in a `to` pattern
against the importing module's own directory; the alternative is one rule per
adapter group, which silently stops covering a group the moment one is added.
Product assembly leaks out of bootstrap: generic presentation reads the
installed-feature registries. That is a real refactor, so the rule freezes the
exact set of modules doing it today rather than pretending it is fixed — a new
edge fails. The two remaining open edges are named in the config, not silent.
Each rule was verified by introducing the violation it forbids and confirming
the gate rejects it.
The documentation drifted the same way. README and the manual accessibility
checklist both said six routes while ten were registered, which left the
platform overview and three reference-resource screens outside the declared
manual review scope without anyone deciding they should be. The scope is now
derived from the route registry by `verify:documentation`, so the sentence
cannot outlive the registry again. The review ledger also named a canonical
path that does not exist in this tree; it is upstream provenance, and it now
says so instead of looking like a broken repository reference.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Four browser-capability specs never reached the code they were named for. The
`PRESIGNED_TRANSFER_V1` envelope gained a top-level `protocol` field, and the
fixtures kept answering without it, so every capability was refused before any
object request was made: the download and part-upload success paths were
asserting against an empty transcript rather than exercising a real GET or PUT.
The fixtures now speak the protocol they claim to, and the part-deletion
expectation carries the physical effect the adapter reports.
A refused capability document also answered `recovery: NONE`, telling the
caller there was nothing to be done. The design record fixes this class of
refusal as re-issuable and the vault already answers `REISSUE_CAPABILITY` for
it, so the HTTP decoder disagreed with both. It now agrees.
Lab performance produced no evidence at all. Playwright matches accessible
names by substring, so the navigation entry "플랫폼 구성" also matched the home
page's "플랫폼 구성 보기" call to action; the locator resolved to two links and
the run died on a strict-mode violation before the first measurement. With an
exact match the metrics are collected, and they show the named-interaction
budget is missed on this machine — a real signal that was previously invisible.
The platform overview baseline was captured before the reference routes moved
from `integration-defined` to `session-required` and was never regenerated, so
the only visual gate that could catch a regression on that page was failing for
its own staleness. Regenerated after confirming the diff is exactly that label.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The provider sandbox never ran. bubblewrap 0.9.0 stops parsing an `--args`
file at the first non-option and never hands the remainder back, so the
command written into that file was silently dropped: bwrap printed its usage
text, exited 1, and the provider produced no evidence at all. The options
still travel in the args file — that is what keeps host paths and credentials
out of `/proc/<pid>/cmdline` — but the command now rides on real argv, and
`encodeProviderBwrapInput` refuses a `--` so the drop cannot come back.
The scope wrapper then could not exit. It read the supervisor's liveness pipe
through `fs`, which runs a blocking `read(2)` on a threadpool thread; the
supervisor holds that pipe open for the scope's whole life, so the read never
returned and closing the descriptor did not interrupt it. Once bubblewrap
finished the wrapper deadlocked in `process.exit`, the scope outlived the
provider, and a completed run was reported as a timeout kill. The channel is
now read through the event loop, so teardown is observable and terminal.
Creation modes were left to the ambient umask. `mkdir(mode)` and `open(mode)`
are requests the kernel subtracts the umask from, so a runner exporting a
restrictive umask produced directories it could not enter and handed `tar` a
file it could not re-open. Private modes are pinned instead of inherited.
Promotion cleanup deleted before it checked. Removals run through a pinned
descriptor, so a leaf substituted after validation had this promotion's exact
five destroyed first and the substitution reported afterwards, leaving a
half-emptied directory a retry could not tell from a completed one. The name
is re-bound to the inode before anything is removed, so the failure is total.
Separately, release coherence proved the artifacts agreed with each other but
never that they belonged where they were going: a build whose runtime document
said `APP_ENV: local`, `AUTH_MODE: demo` and a loopback API is coherent with
itself and passed every gate. `public/` is copied verbatim into `dist/`, so
that local document shipped with every build regardless of what the build was
for. Runtime configuration now comes from a declared profile, and FE-GATE-027
refuses to admit an artifact to an environment it does not match — including
refusing an undeclared destination, so nothing is admitted by omission.
`REQUEST_TIMEOUT_MS` and `VITE_ROUTER_BASE_PATH` were validated and then
dropped: the V3 executor ran every operation on its contract's own deadline,
and Vite emitted root-absolute assets for a sub-path deployment. The timeout is
now a ceiling that may tighten a contract but never loosen one, and one base
path feeds the router, the Service Worker scope and the asset base together.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>