Skip to content

fix(sdk): isolate cache write failures and settle cache telemetry contracts - #1665

Merged
rickylabs merged 14 commits into
mainfrom
fix/sdk-cache-surface-and-telemetry
Aug 15, 2026
Merged

fix(sdk): isolate cache write failures and settle cache telemetry contracts#1665
rickylabs merged 14 commits into
mainfrom
fix/sdk-cache-surface-and-telemetry

Conversation

@rickylabs

@rickylabs rickylabs commented Aug 15, 2026

Copy link
Copy Markdown
Owner

Summary

Implements the approved SDK cache failure-isolation and telemetry-contract plan across three reviewed slices. S1 makes malformed cache evidence fail-safe and bounds namespace cardinality; S2 isolates a real Deno KV oversized cache-write failure after successful data resolution; S3 adds the module-identity diagnostic, mechanically synchronizes its published Query Bridge quotation, and repairs CacheStore mandatory-evidence JSDoc. All three slices passed fresh Tier-A review and the separate-session IMPL-EVAL returned PASS at evaluator commit 0fed4d7ff; the PR is entering exact-head readiness CI.

Scope

Contracts selected and implemented

Approved D2 contract inversion: the test formerly named “cache telemetry rejects incomplete or unbounded provider evidence” used assertRejects. It now proves that the loader runs and its data returns while the active span records outcome=error and topology_complete=false. This is the approved fail-safe observability contract, documented in packages/sdk/README.md, not a silently weakened guard.

The per-action no-store idea, branded operation IDs, and duplicate-module ownership changes remain deferred.

Slices

  • S0 research + Design checkpoint + concrete plan — 89be8da76; terminal PLAN-EVAL artifact cd5193b66
  • S1 fail-safe telemetry validation and bounded namespaces — 0e4e26c51, Tier-A PASS
  • S2 real Deno KV cache-write failure isolation — 1cf76c6dd, Tier-A PASS
  • S3 module diagnostic, synchronized Query Bridge quotation, CacheStore JSDoc, and final gate receipt — 9a26c107a, Tier-A PASS

Validation

  • SDK structured check — PASS: 84 files, 1 batch, 0 failed batches, 0 diagnostics
  • Focused D4 provider/docs proof — PASS: 1 passed, 0 failed
  • Full SDK structured test — PASS: 66 passed, 0 failed
  • SDK structured lint / format — PASS: 84 files, 0 findings
  • Repo-root structured check — PASS: 2,925 files, 25 batches, 0 failed batches, 0 diagnostics
  • Repo-root structured test — PASS: 4,203 passed, 0 failed, 19 ignored; known queue DLQ flake not observed
  • deno task quality:scan — PASS: no findings, 7 existing allowances
  • deno task arch:check — PASS with existing warnings: exit 0, every package/plugin has FAIL=0
  • deno task check:netscript-jsr-specifiers — PASS: scanned=2361 allowances=1 ranges=0 failures=0
  • deno task publish:dry-run — PASS: exit 0, including all 12 SDK entrypoints
  • SDK JSR audit — PASS with two known warnings: source-directory cardinality and slow-type banner
  • Raw deno doc --lint over all 12 SDK entrypoints and separately ./src/cache/mod.ts — both expected exit 1 with the exact six named baseline diagnostics and zero new; neither is represented as green
  • deno task surface:diffRED against the known stale repository baseline: exit 1, 517 undeclared major changes, with the sorted MAJOR set byte-identical at base and head across untouched packages. S3 changes no export map, barrel, TypeScript declaration, dependency, or signature; this red gate is not misrepresented as patch-level.
  • Aspire, Docker, and e2e:cli — prohibited and not run

Harness

  • Run dir: .llm/runs/fix-sdk-cache-surface-and-telemetry--0.0.7-wave3/
  • Phase: implementation complete — S1, S2, and S3 Tier-A passed; separate-session IMPL-EVAL PASS
  • PLAN-EVAL: terminal PASS at evaluated head ee1b44c6d, artifact cd5193b66
  • Scope: implementation stayed within each coordinator-authorized slice; S3 changed exactly the provider message, CacheStore JSDoc, adjacent provider test, authorized Query Bridge page, and run artifacts
  • Merge only after required exact-head readiness CI is terminal and truthful.

Drift / Debt

  • The brief uses the stricter Archetype 3 proof profile while the current doctrine inventory classifies SDK as Archetype 2 / Keep.
  • Full SDK/cache raw doc lint remains pre-existing red with the accepted exact six-diagnostic, zero-new baseline.
  • Repository-wide surface:diff remains unusable as a leaf patch-level verdict because its checked-in baseline reports 517 undeclared major changes with an identical sorted MAJOR set at base and head across untouched packages; this is recorded as a red limitation, not hidden.
  • The Query Bridge quotation is synchronized in place and mechanically protected; no documentation debt remains for D4.

Definition of Done

  • Topic orchestrator authorized exactly the five named additional paths and accepted the exact six-diagnostic doc-lint baseline.
  • Separate PLAN-EVAL returns PASS before any product implementation.
  • The real Deno KV oversized-value test is demonstrated RED on the pre-fix behavior and GREEN after isolation.
  • All five issue contracts are implemented without widening the public TypeScript surface.
  • Repo-root structured check/test plus SDK lint/fmt, JSR, publish, quality, architecture, exact-pin, and surface gates satisfy the approved bar.
  • Separate-session IMPL-EVAL returns PASS.

@rickylabs rickylabs added this to the 0.0.7 milestone Aug 15, 2026 — with ChatGPT Codex Connector
@rickylabs rickylabs added type:fix ci:skip-e2e status:plan Harness plan phase priority:p1 High area:sdk packages/sdk ci:skip-scaffold Skip the scaffold-static (deno-only) scaffold gate labels Aug 15, 2026 — with ChatGPT Codex Connector

Copy link
Copy Markdown
Owner Author

[PHASE: RESEARCH]

Re-baselined the five issues against main@baf1cdf67.

Findings

  1. fetchAndCache() awaits store.set() after the service payload resolves and rethrows persistence failure, so the current data-path defect is confirmed.
  2. Lookup, write, and invalidation can all reach the shared typed-never malformed-evidence throw.
  3. Descriptor validation is evaluated as a withSpan argument, so an invalid descriptor currently throws before any span exists.
  4. Static generated resource.action and composite namespaces are pinned by tests; public direct operationId remains free text.
  5. Whole-repo census found SDK internal consumers, Fresh public consumers, the KV backend edge, CLI generated-import assertions, MCP generated docs, and release/docs tooling. The gate plan therefore uses repo-root test.
  6. Ports JSDoc sweep found only CacheStore get/set/delete drift.
  7. SDK publish dry run and exact-specifier guard pass; full-export doc lint is pre-existing red and is recorded as a scope ruling.

Artifacts

  • research.md
  • scope-boundary.md
  • drift.md

Next

Topic orchestrator reviews the scope boundary and sends the plan to a separate PLAN-EVAL session. No implementation has started.

rickylabs commented Aug 15, 2026

Copy link
Copy Markdown
Owner Author

[PHASE: PLAN]

Tier-A plan repairs are committed through ee1b44c6d; implementation remains blocked pending coordinator-owned PLAN-EVAL.

Final repairs

  1. T-1 — overflow deferral: CacheQuery and provider-boundary calls carry an invocation-local admission decision into a first-statement span prologue. The prologue emits the pending overflow event and validates the descriptor inside the span. composite-query.ts:42 syntax-normalizes only; admission and emission wait for its first real spanned operation.
  2. T-2 — invalidation rollback: each report is staged and merged only after complete validation. A rejected report emits none of its earlier partial entries; valid reports may remain, while the final span stays incomplete. The plan requires a third-entry failure test.
  3. T-3 — named doc baseline: raw combined-12-entrypoint and cache-entrypoint deno doc --lint commands both remain expected exit 1 with exactly six named diagnostics and zero new. Neither is a PASS.
  4. T-4 — synchronized published quote: the coordinator superseded the prior scope treatment. docs/site/web-layer/query-bridge.md is the fifth authorized path. Its single-line quotation uses <resolved import.meta.url> for the install-specific segment; cache-provider_test.ts normalizes only that segment and byte-compares the full stable message—including [NetScript SDK] —against runtime.

Exact additional surface

  1. packages/sdk/README.md
  2. packages/sdk/src/cache/cache-provider_test.ts
  3. packages/sdk/tests/cache/cache-telemetry_test.ts
  4. packages/sdk/tests/cache/cache-query-kv-limit_test.ts (new)
  5. docs/site/web-layer/query-bridge.md

No other path is authorized. No other site documentation will be swept or edited.

Evidence

  • Latest commit: ee1b44c6d401a9edb9c8690870ea2d9151f8f504
  • Only six run artifacts changed in this plan repair; no product/site implementation was performed.
  • git diff --check passed.
  • Draft state and sole status:plan lifecycle state are retained.

Next

Coordinator-owned PLAN-EVAL only. Do not begin implementation, dispatch an evaluator, or move the PR out of draft.

rickylabs added a commit that referenced this pull request Aug 15, 2026
Three blocking findings: D3 overflow span event has no span at any of
the 12 normalizeCacheNamespace call sites; D2 invalidation short-circuit
leaves partial unvalidated entries in the emit map; step-9 doc:lint
command cannot produce a named no-regression baseline.

Named six-diagnostic doc-lint baseline captured via raw deno doc --lint
and pinned. D1 vocabulary verified exact; D1 real-KV RED empirically
reproduced (80011-byte payload throws the real Value too large TypeError,
subsequent get is a miss).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014pCd2QWkCscgZpVdjcUPST
rickylabs added a commit that referenced this pull request Aug 15, 2026
T-1 overflow deferral seam, T-2 per-report staging with partway-failure
test, T-3 raw doc-lint with six pinned diagnostics, T-4 five-path ruling
with superseded debt entry removed and dynamic-URL quotation proven by
normalized byte comparison. Plan-only diff confirmed. Requesting
PLAN-EVAL grant.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014pCd2QWkCscgZpVdjcUPST
rickylabs added a commit that referenced this pull request Aug 15, 2026
Job 0287ccbe, PID 803215, bridge session_01GaNTjv6oY6MaxnKHH1ZfrB, cwd
leaf worktree, source head ee1b44c clean. Requested/observed route
claude-fable-5 / medium / remote-control - matched. Brief attachment
proven from the first user transcript record.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014pCd2QWkCscgZpVdjcUPST
@rickylabs

Copy link
Copy Markdown
Owner Author

PLAN-EVAL — PASS

Evaluator: native Claude claude-fable-5 · effort medium · Remote Control (session_01GaNTjv6oY6MaxnKHH1ZfrB) · job 0287ccbe · route matched (respawnFlags) · separate session from Codex author 01a00516….
Evaluated head: ee1b44c6d401a9edb9c8690870ea2d9151f8f504 · base baf1cdf67.
Artifact: .llm/runs/fix-sdk-cache-surface-and-telemetry--0.0.7-wave3/plan-eval.md @ cd5193b66.

Item Result Evidence
Phase invariant holds git diff --name-only base..HEAD → 8 paths, all .llm/runs/
T-1 overflow deferral confirmed repaired 11 calls + def censused (cache-query.ts:85,305,329,361,389, cache-provider.ts:125,141,159,169,176, composite-query.ts:42); every executable site has a withSpan callback; composite factory intentionally not admitted; single prologue (flush → validate) makes ordering coherent
T-2 non-throwing recorder confirmed hole; plan closes it recordCacheWrite falls through into loops; recordCacheInvalidation banks entries pre-throw and ends with unconditional topologyComplete:true (cache-telemetry.ts:339-401); per-report staging + third-entry-failure test is a real proof
T-3 doc-lint baseline confirmed ran 9a/9b at head: exit 1 / exit 1, exactly the six pinned private-type-ref diagnostics by symbol+location; nowhere described as pass; named comparison, no count verdict
T-4 Query Bridge fifth path confirmed FOLLOWUP-DOC-QUERY-BRIDGE-DIAGNOSTIC removed in ee1b44c6d, no residue; single-token normalization is unambiguous; test-only docs read
Scope exact 4+5, no sixth query-options.ts untouched; every D1–D5 mechanism fits
D1–D5 feasible getKv({provider,path,skipServiceDiscovery}) keys exist and singleton is reused by KvCacheStore; RED drives real Deno.openKv(':memory:') value-size rejection; D2 amend preserves the span guard; D3 bounded 256+bool; D4 ownership unchanged; D5 JSDoc-only
Validation honesty ok root test/check cover asserting packages (Fresh, CLI, KV, MCP, surface baseline); no Aspire/Docker/e2e

Non-blocking advisories: (1) try/finally around the D3 registry reset; (2) resetKv()/closeKv() teardown in the KV-limit test; (3) keep the single-line docs block unwrapped; (4) keep internal test-reset/admission helpers off cache/mod.ts.

Implementation may begin per the slice table; IMPL-EVAL remains a separate mandatory session.

rickylabs added a commit that referenced this pull request Aug 15, 2026
Evaluated immutable head ee1b44c, artifact-only commit cd5193b,
pushed and PR comment posted; no product mutation. All four Tier-A
findings independently confirmed repaired.

Corrects this topic's own Tier-A call-site count from 12 to 11 per the
evaluator's independent census; finding and repair unaffected. Four
non-blocking advisories carried forward, including process-global KV
and namespace-registry test teardown.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014pCd2QWkCscgZpVdjcUPST

Copy link
Copy Markdown
Owner Author

IMPL — S1 progress

Implemented the coordinator-authorized S1 only at 0e4e26c51: fail-safe cache evidence validation (D2) and bounded namespace admission/span prologue (D3).

Scope

Changed only the authorized S1 product/test/doc files plus run artifacts:

  • packages/sdk/src/cache/cache-telemetry.ts
  • packages/sdk/src/cache/cache-query.ts
  • packages/sdk/src/cache/cache-provider.ts
  • packages/sdk/tests/cache/cache-telemetry_test.ts
  • packages/sdk/README.md
  • .llm/runs/fix-sdk-cache-surface-and-telemetry--0.0.7-wave3/{context-pack.md,worklog.md}

S2 and S3 are untouched. In particular, there is no KV-limit test, no CacheStore/provider-diagnostic change, and no Query Bridge edit.

Behavioral proofs

All six required proofs live in packages/sdk/tests/cache/cache-telemetry_test.ts:

  1. Partway invalidation rollback — the rejected report banks valid L1/L2 entries, fails on its third invalidation, emits neither staged tier, preserves a separate valid durable report, and ends incomplete/error.
  2. Normal data return with malformed evidence — malformed lookup and write reports preserve the loader payload; malformed invalidation completes normally while recording incomplete/error.
  3. Request-local first overflow — after 256 admitted ids, the 257th collapses to fixed overflow, names the normalized offender exactly once in a span event, later ids collapse without raw-id retention/emission, and console.warn is never called.
  4. Composite construction then operation — construction creates no span and consumes no budget; its first real operation performs admission and emits the pending overflow event.
  5. try/finally reset — both budget-filling tests reset the process-global namespace registry in finally; the composite test also resets the cache provider.
  6. Descriptor validation in-span — an invalid descriptor still returns loader data; the recorded event order proves overflow flush happens before descriptor validation.

Invalidation aggregation now stages each report in a private map and merges it only after the complete report validates. Internal admission/reset/prologue helpers remain off packages/sdk/src/cache/mod.ts and packages/sdk/mod.ts; their barrel diff is empty.

Validation

  • SDK structured check: PASS — 83 files, 0 failed batches, 0 diagnostics.
  • Telemetry focused test wrapper: PASS — 21 passed, 0 failed.
  • Expanded focused cache/query wrapper: PASS — 32 passed, 0 failed.
  • SDK structured lint: PASS — 83 files, 0 findings.
  • SDK structured format: PASS — 83 files, 0 findings.
  • deno task quality:scan: PASS — no findings; 7 existing allowances.
  • deno task arch:check: PASS with existing warnings — 0 failures. Both changed cache sources are below the 500-line cap; the existing SDK source-directory cardinality warning remains.
  • Supplemental repository-wide surface:diff: FAIL / not an S1 verdict — exit 1 against a stale workspace baseline, reporting widespread signature drift in untouched packages. This is not represented as a pass. The S1-specific export proof is the empty cache/root barrel diff.

Raw deno doc --lint was not rerun in this focused slice. No root test, Aspire, Docker, or CLI E2E gate was run.

Carried advisories

  • S2 must use resetKv() / closeKv() teardown for the process-global @netscript/kv singleton.
  • S3's single-line Query Bridge fenced quotation must remain unwrapped.
  • The namespace admission/reset/prologue helpers must remain off all published barrels.

The PR remains draft with its sole status:plan label. No evaluator was launched or arranged; implementation stops here pending the coordinator's fresh Tier-A review.

rickylabs added a commit that referenced this pull request Aug 15, 2026
Scope exact (5 authorized + 2 artifacts, no S2/S3 leakage). All six
proofs verified by assertion, incl. genuine third-entry rollback with
explicit negative assertion and fail-safe data return with span.status
unset. Gates re-executed: check/lint/fmt clean, sdk 65/0, cache 26/0,
doc-lint exactly the six pinned diagnostics.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014pCd2QWkCscgZpVdjcUPST

rickylabs commented Aug 15, 2026

Copy link
Copy Markdown
Owner Author

[PHASE: IMPL]

S2 is committed and pushed at 1cf76c6dd691378eddbbd9cd3c8a82d50c30fa2f. This slice implements D1 only.

Scope

Changed exactly:

  • packages/sdk/src/cache/cache-query.ts
  • packages/sdk/tests/cache/cache-query-kv-limit_test.ts (new)
  • S2 run artifacts under .llm/runs/fix-sdk-cache-surface-and-telemetry--0.0.7-wave3/

No S1 or S3 file changed.

D1 behavior

Only the post-loader store.set() rejection seam is isolated. It records recordCacheProviderError(span, CacheOperations.READ, namespace, descriptor, CacheEvents.WRITE) and returns the already-resolved data. Cache lookup failures, loader failures, background refresh behavior, and explicit setCachedData() remain fail-loud.

The proof uses a real :memory: Deno KV and real KvCacheStore, not a synthetic throwing store. It asserts:

  1. the caller receives the identical resolved payload;
  2. the loader runs once;
  3. the read span contains a cache.write event with outcome=error and topology_complete=false;
  4. a follow-up cache lookup misses;
  5. explicit setCachedData() still throws the real KV size error;
  6. finally awaits both closeKv() and resetKv().

RED / GREEN

RED before the product edit:

{"schemaVersion":1,"command":["deno","test","--reporter=tap","--allow-all","packages/sdk/tests/cache/cache-query-kv-limit_test.ts"],"cwd":"/home/codex/repos/netscript-007-leaf-sdk-cache","exitCode":1,"durationMs":4511,"summary":{"passed":0,"failed":1,"ignored":0,"totalResults":1,"uniqueFailures":1},"failures":[{"message":"TypeError: Value too large (max 65536 bytes) ... at async KvCacheStore.set ... at async CacheQuery.fetchAndCache","count":1,"tests":[{"name":"CacheQuery returns loaded data when real Deno KV rejects an oversized cache write","file":"./packages/sdk/tests/cache/cache-query-kv-limit_test.ts","line":50}]}]}

GREEN on the pushed implementation:

{"schemaVersion":1,"command":["deno","test","--reporter=tap","--allow-all","packages/sdk/tests/cache/cache-query-kv-limit_test.ts"],"cwd":"/home/codex/repos/netscript-007-leaf-sdk-cache","exitCode":0,"durationMs":1663,"summary":{"passed":1,"failed":0,"ignored":0,"totalResults":1,"uniqueFailures":0},"failures":[]}

The unabridged structured RED and GREEN are committed in s2-report.md.

Final gate verdicts

  • Focused SDK check: PASS — 84 files, 1 batch, 0 failed batches, 0 diagnostics.
  • Real-KV focused test: PASS — 1 passed, 0 failed.
  • Full SDK test: PASS — 66 passed, 0 failed.
  • SDK lint: PASS — 84 files, 0 findings.
  • SDK format: first run FAIL with one new-test import-format finding; corrected and final run PASS — 84 files, 0 findings.
  • Repo-root deno task check: PASS — 2,925 files, 25 batches, 0 failed batches, 0 diagnostics.
  • Repo-root deno task test: PASS — 4,203 passed, 0 failed, 19 ignored, 4,222 total.
  • deno task quality:gate: PASS with existing warnings — quality scan has no findings; architecture check has zero failures.
  • Raw deno doc --lint: not run in S2.
  • Aspire, Docker, and e2e:cli: not run, as prohibited.

The PR body now explicitly explains S1's approved D2 assertRejects contract inversion. No checkbox was ticked, and the PR remains draft with its sole status:plan label.

S2 stops here pending the coordinator's fresh Tier-A review. No evaluator or review was launched or arranged.

rickylabs added a commit that referenced this pull request Aug 15, 2026
RED reproduced independently in a detached pre-fix worktree (real
Kv.set/DenoKvAdapter/KvCacheStore stack); GREEN 1/0 focused, sdk 66/0.
Fail-loud setCachedData proven behaviourally; teardown awaits closeKv
and resetKv.

First root run was red on packages/queue typed-queue_test DLQ timing;
established as a pre-existing non-deterministic flake (queue untouched
by this branch, passes alone and paired, second root run at the same
head returns 4203/0/19). Recommend a tracked issue; not filed here.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014pCd2QWkCscgZpVdjcUPST

Copy link
Copy Markdown
Owner Author

[PHASE: IMPL] [SLICE: S3]

S3 is implemented and pushed at 9a26c107afa75bf1f38b78fe96c6df533b156c36. The PR remains draft and awaits fresh Tier-A review.

Scope

Changed exactly the S3-authorized product/test/docs paths plus run artifacts:

  • packages/sdk/src/cache/cache-provider.ts — message wording only
  • packages/sdk/src/ports/cache-store.ts — JSDoc only
  • packages/sdk/src/cache/cache-provider_test.ts
  • docs/site/web-layer/query-bridge.md
  • .llm/runs/fix-sdk-cache-surface-and-telemetry--0.0.7-wave3/{context-pack.md,worklog.md,s3-report.md}

S1/S2 files remain byte-identical. _provider remains module-local; runtime code adds no file/asset read.

Behavioral/documentation proof

  • D4 focused wrapper: 1 passed, 0 failed. The test captures the real error, proves its URL equals new URL('./cache-provider.ts', import.meta.url).href, normalizes only that URL to <resolved import.meta.url>, and byte-compares the complete single-line Query Bridge fence.
  • D5 whole-ports executed sweep found no evidence-contract drift outside cache-store.ts; the three repaired comments document read, ordered write/promotion, and invalidation topology evidence.

Gates

  • SDK check: PASS, 84 files / 0 diagnostics
  • SDK tests: PASS, 66/0
  • SDK lint/fmt: PASS, 84 files / 0 findings
  • Root check: PASS, 2,925 files / 0 diagnostics
  • Root test: PASS, 4,203 passed / 0 failed / 19 ignored; known queue flake not observed
  • Quality scan: PASS, no findings
  • Architecture check: PASS with existing warnings, exit 0 and all FAIL=0
  • Exact NetScript specifiers: PASS, scanned=2361 allowances=1 ranges=0 failures=0
  • Publish dry run: PASS, exit 0 including all SDK entrypoints
  • SDK JSR audit: PASS with the two known warnings (source cardinality and slow-type banner)
  • Raw doc lint: expected RED, both exit 1 with exactly the six pinned named diagnostics and zero new; neither is called a pass
  • Surface diff: RED, exit 1 against the known stale repo baseline (524 undeclared major changes across untouched packages). S3 itself changes no export map, barrel, declaration, dependency, or signature.

Full evidence: .llm/runs/fix-sdk-cache-surface-and-telemetry--0.0.7-wave3/s3-report.md.

Next

Coordinator-owned fresh Tier-A review. This implementation session did not launch or arrange an evaluator, did not run Aspire/Docker/e2e:cli, and did not change readiness, labels, milestone, or issue state.

rickylabs added a commit that referenced this pull request Aug 15, 2026
D4 preserves the browser clause and module-local _provider; docs proof is
a normalized byte comparison whose single-line regex goes red on rewrap.
D5 sweep independently corroborated. Root test 4203/0/19; root check
re-run uncached (2925 files, 0 diagnostics) rather than trusting the
task cache line.

surface:diff (517) and JSR F-DOCT-5 proven pre-existing by running at
base baf1cdf; base == head, zero net findings from this leaf.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014pCd2QWkCscgZpVdjcUPST
rickylabs added a commit that referenced this pull request Aug 15, 2026
… rival

Pre-launch sweep found job 1fbb1c07 already active for this leaf at the
leaf worktree. Verified identity, route (claude-fable-5/medium/remote-
control, matched) and head binding to 9a26c10 from its own transcript,
then adopted it rather than starting a second evaluator.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014pCd2QWkCscgZpVdjcUPST
@rickylabs

Copy link
Copy Markdown
Owner Author

Delta IMPL-EVAL — generated-asset repair 7549d9fc0PASS

Evaluator: fresh native Claude session (claude-fable-5 · medium · Remote Control) — job 08eb7184, session_01Jc8aRcLQFVyVWKogq6SaFC; separate from the Codex author and the Tier-A orchestrator. Route matched. Evaluated head 7549d9fc0 (== PR head at eval time).

Scope: source→generated fidelity + confinement of 0fed4d7ff..7549d9fc0 only. Prior product IMPL-EVAL PASS at 9a26c107a preserved (git diff 9a26c107a..7549d9fc0 -- packages/ plugins/ docs/ tools/ deno.json deno.lock is empty).

Item Result
1. Confinement ✅ only prose.json.gz, provenance.json, run artifacts
2. Fidelity deno task check:agent-docs-prose exit 0, fresh:true, stalePaths:[]; --check byte-compares fresh corpus vs asset; mutating regen at HEAD left tree clean (byte-identical). files manifest unchanged (181). Committed payload 4753909 B / sha 6df99eb8…853fe; gz 1363396 B. Entry-level diff vs old corpus: only pages/web-layer/query-bridge/index.md + llms-full.txt changed
3. Diagnostic text <resolved import.meta.url> 0→4 occurrences; single-line template present in the query-bridge entry
4. Product preservation ✅ empty diff
5. Baseline reds ✅ still red, unchanged: F-DOCT-5 13 children; surface:diff exit 1 (517 undeclared); doc-lint 9a exit 1 (3 diagnostics), 9b exit 1 (3 diagnostics), exact names/locations match

Supervisor claims: all CONFIRMED (incl. lint 0 / fmt 0 over 84 files).

Blocking: none. Advisories (non-blocking): provenance.sourceCommit = rendered tree commit 0fed4d7ff, not the asset commit — by generator design.

Artifact: .llm/runs/fix-sdk-cache-surface-and-telemetry--0.0.7-wave3/delta-eval-generated-assets.md @ 72d57229f.

rickylabs added a commit that referenced this pull request Aug 15, 2026
Delta verdict PASS at 7549d9f, artifact-only commit 72d5722.
Evaluator regenerated the corpus itself and byte-compared, diffed the
files arrays (181 entries, none added/removed), and identified the only
two changed entries as query-bridge/index.md and llms-full.txt --
fidelity proven at content level, not checksum level.

PR is now non-draft; check-test and quality pending at 72d5722, the
first non-skipped CI this branch has had.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014pCd2QWkCscgZpVdjcUPST
rickylabs added a commit that referenced this pull request Aug 15, 2026
quality is terminal FAILURE at 72d5722 (run 31893659579, job
95033583015): check:assets-barrel red because
packages/cli/src/kernel/assets/agent-docs.generated.ts still embeds the
old corpus. Reproduced in a detached worktree; exactly one tracked path
changes.

Corrects two of my own claims: I reported quality as pending when it was
failing, and I read an empty product diff at 72d5722 as preservation
when emptiness was the defect signal.

Strengthens the rule to a transitive closure: docs/site edits imply both
check:agent-docs-prose and check:assets-barrel.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014pCd2QWkCscgZpVdjcUPST
rickylabs added a commit that referenced this pull request Aug 15, 2026
check:publish-assets fails at 72d5722 naming only
packages/mcp/src/publish-assets.generated.ts and PASSES at base
baf1cdf, so link 4 is branch-caused. generate-publish-assets.ts:34-37
declares the CLI barrel as an input, so link 4 must regenerate after
link 3.

Fifth-mirror question answered by execution: check:mcp-export-corpus is
stale at base too (pre-existing, not ours) and check:emitted-samples
passes. Branch-caused closure is exactly links 2-4.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014pCd2QWkCscgZpVdjcUPST
rickylabs added a commit that referenced this pull request Aug 15, 2026
Verified derivedAssetCascadePaths from two independent sources: central
milestone-cluster-state.json:512-517 and the shipped PR #1652 diff, whose
only generated paths are exactly those four. Matches this run's
independently derived closure.

Records the process miss: the cascade was persisted before #1665 touched
Query Bridge docs and was not consulted. Standing correction added.

Fifth-link determination stated explicitly: check:mcp-export-corpus is
not in the prior cascade and is stale at base, so it is a pre-existing
unrelated red, not a new branch-caused mirror.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014pCd2QWkCscgZpVdjcUPST

Copy link
Copy Markdown
Owner Author

[PHASE: IMPL]

Second post-eval generated-asset repair pushed at 27a64ea4c122312e46ffc9602509c191bcd0dd71.

This closes the third tracked link in the chain:

docs/site/web-layer/query-bridge.md
  -> .llm/assets/agent-docs/**
  -> packages/cli/src/kernel/assets/agent-docs.generated.ts

The barrel was regenerated only through deno task gen:assets-barrel. Immediate confinement proof:

 M packages/cli/src/kernel/assets/agent-docs.generated.ts

The commit contains that one generated file plus three artifacts in the existing harness run directory. The other six barrel outputs, canonical prose assets, site sources, hand-written package/plugin files, and lockfiles did not change.

Validation

  • deno task check:assets-barrel: PASS, exit 0; all seven targets reproduce and the generated-file diff is clean.
  • deno task check:agent-docs-prose: PASS, exit 0; fresh=true, stalePaths=[].
  • CLI structured check: PASS, exit 0; 883 files, 8 batches, 0 diagnostics.
  • CLI lint wrapper: NOT A PASS, exit 2; Deno excludes the relevant CLI targets. The wrapper reports 0 lint occurrences but correctly refuses a false green. An explicit touched-file run is also excluded.
  • CLI format wrapper: NOT A PASS, exit 2 for the same exclusion; 0 format findings, but no valid formatter verdict. The canonical generator formats through deno fmt --ext ts -, and asset regeneration is byte-stable.
  • Combined/cache raw doc-lint: EXPECTED BASELINE RED, exit 1 each, exactly the pinned three-plus-three diagnostics and zero new.

Further generated link found

The downstream audit found a fourth stale generated link outside this repair's authorization:

{"gate":"deno task check:publish-assets","exitCode":1,"stalePaths":["packages/mcp/src/publish-assets.generated.ts"]}

That file is a sibling consumer of .llm/assets/agent-docs/provenance.json: it still embeds sourceCommit: 504de3f67 while the canonical provenance is 0fed4d7ff. It was checked read-only and left untouched. Whole-repo generator/consumer searches found no fifth checked-in generated artifact after the MCP file.

Detailed evidence: .llm/runs/fix-sdk-cache-surface-and-telemetry--0.0.7-wave3/assets-barrel-repair-report.md.

No root suite, Aspire, Docker, CLI E2E, evaluator, or review dispatch was run. Stopping for the coordinator's scope ruling, fresh Tier-A, and asset-chain delta evaluation.

rickylabs added a commit that referenced this pull request Aug 15, 2026
Barrel repair 27a64ea verified: one product path, six provenance
fields flipped to the current corpus, matching the pre-repair probe
prediction exactly.

Link 4 dispatched to the same author thread for canonical
gen:publish-assets, scoped to packages/mcp/src/publish-assets.generated.ts
plus artifacts, gated on author idle to avoid a writer conflict. Brief
requires all three cascade gates green together on the final head.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014pCd2QWkCscgZpVdjcUPST

Copy link
Copy Markdown
Owner Author

Generated-asset repair receipt — link 4/4

Pushed 9a2c74c41990c1e2a56c9714834fff97feb63466. This closes the fourth and final checked-in link of the authorized cascade:

docs/site/web-layer/query-bridge.md
  → .llm/assets/agent-docs/**
    → packages/cli/src/kernel/assets/agent-docs.generated.ts
      → packages/mcp/src/publish-assets.generated.ts

The canonical deno task gen:publish-assets task changed exactly one product path, packages/mcp/src/publish-assets.generated.ts, plus run artifacts. Its one-line generated delta advances MCP_EMBEDDED_DOCS_PROVENANCE.sourceCommit from 504de3f67 to 0fed4d7ff; the selected twelve-document payload and digest are unchanged.

Final-head cascade gates:

  • check:publish-assets: PASS (exit 0)
  • check:assets-barrel: PASS (exit 0)
  • check:agent-docs-prose: PASS (exit 0, fresh: true, stalePaths: [])
  • MCP check wrapper: PASS (115 files, 0 diagnostics)

The unfiltered MCP lint/fmt wrappers are honestly red at config discovery (exit 1, zero findings) because the root selection enters deliberately invalid doctor fixture workspaces. The same structured wrappers excluding only packages/mcp/tests/fixtures/doctor/** pass 110 files with zero lint or format findings. Both raw SDK doc-lint commands remain exit 1 with exactly the pinned three-plus-three baseline diagnostics and zero new diagnostics.

An executed generator/consumer search found no generator downstream of the MCP generated file; no fifth checked-in mirror was found. No evaluator or review was launched or arranged.

rickylabs added a commit that referenced this pull request Aug 15, 2026
All three cascade gates pass simultaneously on one content head and the
tree is clean after running all three generators -- the closure proof,
since gen:publish-assets consumes the CLI barrel.

Link 3 was 6/6 provenance fields exactly as predicted pre-repair; link 4
was a single sourceCommit line. No hand-written source drifted across the
whole PR.

Records honest coverage: the mcp lint wrapper errored without a verdict
(linted directly instead), and the CLI barrel is excluded from lint/fmt
by repo config, its correctness resting on check:assets-barrel.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014pCd2QWkCscgZpVdjcUPST
@rickylabs

Copy link
Copy Markdown
Owner Author

Delta IMPL-EVAL — generated-asset chain: PASS

Field Value
Evaluated head 9a2c74c41990c1e2a56c9714834fff97feb63466 (merge base baf1cdf67)
Evaluator fresh native Claude session claude-fable-5 · effort medium · Remote Control (session_01E3QfD1wkvb1naZKS6m7bp2), separate from Codex author 01a00516-… and the Tier-A orchestrator
Artifact .llm/runs/fix-sdk-cache-surface-and-telemetry--0.0.7-wave3/delta-eval-asset-chain.md @ ac274a464
Scope four-link chain only (query-bridge.md.llm/assets/agent-docs/*agent-docs.generated.tspublish-assets.generated.ts); product PASS 9a26c107a and corpus PASS 7549d9fc0 preserved

Findings (all executed independently in a detached worktree at 9a2c74c41):

  1. Simultaneous freshness — check:agent-docs-prose EXIT 0 (fresh:true, stalePaths:[], sha 6df99eb8…), check:assets-barrel EXIT 0, check:publish-assets EXIT 0, git status --porcelain empty afterwards. Confirmed.
  2. Convergence — barrel payload decoded independently: 4 753 909 bytes, sha256 6df99eb856eb…853fe = provenance.json = live check output; sourceCommit 0fed4d7ff identical across links 2/3/4; link 3 diff 6+/6−, link 4 diff 1+/1− (sourceCommit). Confirmed.
  3. Content fidelity — Cache provider not initialized in module <resolved import.meta.url> present ×2 in prose.json.gz and in the decoded CLI barrel (0 at base); absent from the MCP file because MCP_EMBEDDED_DOC_PATHS excludes query-bridge. Confirmed.
  4. No fifth mirror — every gen:*/check:* run at both heads: check:mcp-export-corpus EXIT 1 at both heads with an identical 5+/5− regeneration diff (pre-existing); emitted-samples, streams-types, scaffold-versions, netscript-jsr-specifiers, aspire-host-ports EXIT 0 at both. No new link.
  5. Source movement — baf1cdf67..HEAD touches exactly the eight S1–S3 files + query-bridge.md + four chain links. Confirmed.
  6. Pre-existing reds still red — surface:diff EXIT 1 (965 lines, same at base), F-DOCT-5 13 children in packages/sdk/src, check:mcp-export-corpus EXIT 1, six deno doc --lint private-type-ref diagnostics. None silently fixed.

Coverage limits confirmed: run-deno-lint.ts --root packages/mcp errors without a verdict (direct deno lint on the generated file: clean); agent-docs.generated.ts is lint/fmt-excluded, so it rests on check:assets-barrel byte-equality (green). #1652's derivedAssetCascadePaths = the same four paths (milestone-cluster-state.json:512-517, PR files) — precedent confirmed.

Blocking items: none. Advisories (non-blocking): stale mcp-export-corpus on main (separate chore); run-deno-lint.ts per-package workspace-config gap.

rickylabs added a commit that referenced this pull request Aug 15, 2026
Terminal PASS at evaluated head 9a2c74c, artifact-only commit
ac274a4, comment 5303120561. Every supervisor claim independently
confirmed, including the two self-reported coverage limits (mcp lint
wrapper parse error; CLI barrel excluded from lint/fmt).

Records a metric difference on surface:diff (965 output lines vs 517
undeclared majors) with identical base==head conclusion.

Product and docs tree byte-identical to 9a26c10, so all four PASS
verdicts bind to the tree now under CI.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014pCd2QWkCscgZpVdjcUPST
@rickylabs
rickylabs merged commit 3e8e146 into main Aug 15, 2026
32 checks passed
rickylabs added a commit that referenced this pull request Aug 15, 2026
#1665 squash-merged as main 3e8e146 from exact head ac274a4; all five
issues closed. Flags the lifecycle-label gap (PR ready-merge, issues
triage, none shipped) as coordinator-only.

Next leaf selected by computing dependency readiness across all remaining
fixes leaves and verifying each blocker is genuinely open: waves 1-5 are
blocked, so sdk-cached-entry-swr (#1461, wave 5) is the lowest-wave
dependency-ready leaf.

Carries the #1665 four-link docs cascade into its proving set up front.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014pCd2QWkCscgZpVdjcUPST
rickylabs added a commit that referenced this pull request Aug 15, 2026
#1665 merged as main 3e8e146; all five issues closed at status:shipped.

Advance the serial queue to sdk-cached-entry-swr (#1461, PR #1669) on
preserved author thread 01a00646. Verified the coordinator's claim that
tutorial line 100 repeats the false background-refresh statement before
acting; the plan had already reported it and correctly declined to
self-widen. Plan-only amendment dispatched.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014pCd2QWkCscgZpVdjcUPST
rickylabs added a commit that referenced this pull request Aug 15, 2026
Plan-only confirmed. The #1665 cascade lesson transferred: D7 accepts the
four-file cascade and S2 carries all three check gates from slice 1.
D2 rejects queryEntry with a real argument; D5 requires two overlapping
readers with a blocked fetcher.

Records a defect in this orchestrator's own brief: the doc-lint bar was
compressed from two invocations (3+3) into "six". Author flagged it as
drift rather than reconciling; corrected via plan rows 14a/14b.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014pCd2QWkCscgZpVdjcUPST
rickylabs added a commit that referenced this pull request Aug 15, 2026
Strip stale pre-merge blocker text from the shipped #1665 row and refresh
the #1461 row with PR #1669 at 7e5be15 and the scope widening.

Record that codex-resume exited 0 while the #1669 amendment was rejected
with an active-writer conflict, so the message never reached the author.
Delivery is now proven by rollout grep, idle checks run in a separate
command, and steering retries on conflict.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014pCd2QWkCscgZpVdjcUPST
rickylabs added a commit that referenced this pull request Aug 15, 2026
T-1 resolved beyond the finding: a nine-line published-claim disposition
table (my independent re-sweep returns the identical line set), retained
lines carry mandatory nearby scoping text, and line 107 rewrites the
demonstrated loader into a policy-aware composition. A one-sentence
page-level acceptance now exists and is gated by docs-accuracy.

Doc-lint pin, #1665 preservation, inflight and determinism commitments
all unchanged. Proceeding to PLAN-EVAL.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014pCd2QWkCscgZpVdjcUPST
rickylabs added a commit that referenced this pull request Aug 15, 2026
Records before dispatch: main advanced to 0ef48c2 via #1665 on the same
cascade; merge-tree confirms the conflict set is exactly the four generated
publication outputs with zero source conflicts, so regeneration over merged
inputs is the honest resolution rather than side-selection.

Refs #1296

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DkCGyCU4GvfDs3Kk1yEUty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment