Skip to content

fix(claude): recognize native request-replay metadata - #113

Merged
lukemaj merged 1 commit into
mainfrom
fix/87-claude-request-replay
Oct 18, 2026
Merged

lukemaj merged 1 commit into
mainfrom
fix/87-claude-request-replay

Conversation

@lukemaj

@lukemaj lukemaj commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

What: Recognize Claude's three native request-replay record types as known metadata.
Why: They currently fall through the Claude adapter dispatch and create unsupported-schema import errors.
So what: The coordinator can review and merge this fix, then include it in the separate release PR.

Closes #87

Changes

  • Add only api-request, api-request-blob and api-request-shape to IGNORED_METADATA_TYPES.
  • Exercise the real file importer with synthetic records for all three types and api-request-future as an unknown type.
  • Assert no import errors for known types, no synthetic payload markers anywhere in the ledger or captured output, unchanged response/event rows, and quarantine of the unknown type.

Proof

Candidate: 1d2bf5f7a90b215e6a127fa082aa3e36a3bdbb4b, base: 71bcb597a3ec8a15f3c595d043fc07d0e2271b59.

  • Failing before: the new focused regression failed for each of the three known types with malformed=1 instead of 0.
  • python3 -m unittest tests.test_claude: PASS, 11 tests on this head.
  • python3 -m unittest discover -s tests: PASS, 787 tests in 174.088 seconds on this head.
  • python3 -m compileall -q agent_observer tests scripts: PASS on this head.
  • git diff --check HEAD: PASS; worktree clean.
  • Independent exact-head review: PASS, no blockers or optional findings; review and independently executed metadata tests. review/independent=success verified on this head.

Limits

Synthetic import proof only; no live recording activation, deployment or native mock-API transcript corroboration. Existing unsupported-schema errors in previously imported ledgers are not migrated. Version, manifests and changelog intentionally deferred to the coordinator's release PR per task instructions. Website impact: none, internal adapter metadata compatibility only. Full-suite output includes ResourceWarnings for unclosed resources in fleet and publish tests; no unrelated changes made. Cost publication with the installed Agent Observer plugin against a disposable read-only-sourced ledger copy exited 2: nothing to publish: no sessions in scope. No live ledger writes or sync were performed.

Elon record

Requirements and who asked: Issue #87 and the implementation brief require explicit recognition of three native metadata types, private payload handling, unchanged accounting and quarantine of unknown types; this supports trustworthy native coverage in the Objective.
Deleted: Payload parsing/storage, blanket ignoring of future types, recording activation, release/version changes and cross-project work.
Bottleneck: Three missing allowlist entries cause known native metadata to enter unsupported-schema quarantine.
Checked myself: Read Issue #87 and adapter dispatch; reproduced all three failures before the three-entry fix; inspected full-ledger privacy and unchanged accounting assertions with synthetic records.

Implemented with Codex (GPT-6.1).

@lukemaj

lukemaj commented Oct 18, 2026

Copy link
Copy Markdown
Contributor Author

What: Independent review passes for exact head 1d2bf5f7a90b215e6a127fa082aa3e36a3bdbb4b; no blocking findings or optional changes.
Why: The three explicit metadata entries use the existing discard path, and the regression exercises privacy, stable accounting and unknown-type quarantine through the real importer.
So what: The coordinator can accept this review for this SHA; complete proof and human merge approval remain separate gates.

Reviewed base 71bcb597a3ec8a15f3c595d043fc07d0e2271b59 against head 1d2bf5f7a90b215e6a127fa082aa3e36a3bdbb4b, Issue #87 including its acceptance criteria, the full two-file diff, Claude import/dispatch, source offset and error persistence, privacy filtering, and test setup. The implementation adds only api-request, api-request-blob and api-request-shape to IGNORED_METADATA_TYPES. Request payloads reach no usage/event handler; api-request-future still raises _UnsupportedSchema. The test checks every response/event column against the baseline and searches the entire SQL dump plus captured stdout/stderr for all synthetic payload sentinels. No VERSION, manifest or CHANGELOG changes are present.

Independently executed on this exact head:

  • python3 -B -m unittest -v tests.test_claude.ClaudeMetadataTest: PASS, 2 tests, including the new replay regression and existing cost-state/unknown-type quarantine coverage.
  • git diff --check 71bcb597a3ec8a15f3c595d043fc07d0e2271b59 1d2bf5f7a90b215e6a127fa082aa3e36a3bdbb4b: PASS.
  • Verified the workspace stayed clean and the live PR base/head matched the requested review candidate.

Proof limits: the author's PR record reports 787 full-suite tests passing and compileall passing on this head. I inspected that record, not the underlying full-suite/compileall output, and did not duplicate those checks. Failing-before results for all three known types are author-supplied, not independently rerun. My runtime proof uses synthetic records and disposable test ledgers only; no native mock-API transcript, recording activation, live-ledger mutation or deployment was exercised. Previously stored quarantine errors are not migrated, as already documented in this PR. This verdict covers the inspected implementation, not completion of CI or permission to merge.

@lukemaj

lukemaj commented Oct 18, 2026

Copy link
Copy Markdown
Contributor Author

Luna review r1 of 1d2bf5f: APPROVE

No blocking or optional findings.

Verified the exact head and base. The diff adds exactly the three requested metadata types; other unknown types still reach unsupported_schema. The new importer test checks payload sentinels are absent from the ledger and captured output, and checks response/tool-event rows remain unchanged. In _ingest, the allowlisted types return before any usage, event, or user-turn handlers, so mid-session lines do not change usage/tool counts or turn assignment; file ordinals continue to count physical records as before. No VERSION, manifest, or CHANGELOG files changed.

Proof: python3 -m unittest discover -s tests passed (787 tests). With the three allowlist entries removed in the disposable clone, the new focused regression failed for all three known types, as expected. Existing unrelated ResourceWarnings appeared in fleet and publish tests.

@lukemaj
lukemaj merged commit 4f02638 into main Oct 18, 2026
2 checks passed
@lukemaj
lukemaj deleted the fix/87-claude-request-replay branch October 18, 2026 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(claude): recognize native request-replay metadata

1 participant