Commit Graph
9 Commits
Author SHA1 Message Date
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 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 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 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 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 4e0745c569 fix(telemetry): redact credentials anywhere in a string, URL secrets and emails (R-9.3)
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>
2026-09-24 12:18:23 +09:00
DongHyeonkaandClaude Opus 5.5 6f2e97d482 fix(telemetry): deliver deduplicated occurrences to the collector (R-9.2)
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>
2026-09-24 12:18:23 +09:00
DongHyeonkaandClaude Opus 5.5 0983742b6b fix(release): allow one boot reload per session regardless of mismatch key (R-9.1)
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>
2026-09-24 12:18:23 +09:00
donghyeon-ka 6f6c48ebb7 refactor: 도메인이 100개 1000개씩 늘어나도 유지보수 쉬운 구조로 변경 2026-09-24 00:42:21 +09:00