Skip to content

fix(adapter): close the review findings against the Claude Code capture - #42

Merged
JumpTechCode merged 1 commit into
mainfrom
fix/adapter-review-findings
Jul 27, 2026
Merged

fix(adapter): close the review findings against the Claude Code capture#42
JumpTechCode merged 1 commit into
mainfrom
fix/adapter-review-findings

Conversation

@JumpTechCode

Copy link
Copy Markdown
Collaborator

Twelve of the thirteen issues filed against the first capture adapter after it
shipped. Each was reproduced before it was fixed, and the effect of every fix is
measured against a local store of 733 project-root transcripts.

Measured, before and after

before after
input tokens across the store 3,888,052 12,470,443,100
transcripts with a negative Wall 2 0
working directories a Dir query finds 66 of 300 sampled 185 of 185, 0 missed
transcripts that fail to load 0 0
sessions withholding the order claim 87 88

The last row is the orphan-result rule finding one file the compaction markers
did not.

Wrong numbers reaching a verdict

Sentinels and claims

Structure

Left open

#39 — the conformance kit catches an adapter reporting what it cannot see,
and cannot catch one declaring a capability it never fills. The comment claiming
otherwise is corrected in coverage.go and verify.go. The check itself needs
a fixture per capability known to carry the evidence for it, which does not
exist yet, so the issue stays open rather than being closed by a comment.

Tests

Fifteen new cases, each written first and watched fail. All fixtures are
synthetic; no transcript is committed. make verify passes: race tests,
coverage 88.9%, lint 0 issues, govulncheck clean.

Closes #26, #28, #29, #30, #31, #32, #33, #34, #35, #36, #37, #38

🤖 Generated with Claude Code

https://claude.ai/code/session_01Ew64uotJqtvVDN3twMAVEQ

Twelve defects found by the adversarial review of the first capture adapter,
each filed as its own issue after that adapter shipped. Measured against a
local store of 733 project-root transcripts, before and after.

Wrong numbers reaching a verdict:

  - Input tokens counted one of three fields. The two cache fields carry
    99.97% of the input on the measured store, so the figure a token-band
    assertion ran against was 3.9M where the harness billed for 12.47B.
  - Wall duration was last minus first with no guard: negative on two
    transcripts, and saturated to 292 years when a timestamp was missing.
    Now the span between the timestamps that exist.
  - Model.Provider was filled with a constant no record states, asserting a
    backend that was never observed.
  - Discover with a Dir query matched almost nothing: the store replaces
    every character outside [A-Za-z0-9-] in a path and this replaced only
    the separator. 185 of the store's directories now answer, 0 miss.
    The comparison was also a substring test and is now equality.

Sentinels and claims:

  - An over-long line reported ErrMalformed for an intact source; it is
    ErrUnsupported, which is this adapter's own limit rather than damage.
  - An empty or bookkeeping-only file loaded as a complete zero-turn
    session, claiming to know the complete order of nothing.
  - A null or type-less line was refused as an unknown record type "".
  - CanSeeWorkspace was declared whole while four of its six governed
    fields are never filled; it is now partial.
  - Fidelity.Version joined several releases into one string, which the
    equality check it exists for can never match. It names one release.

Structure:

  - Delegated work never had its results paired or its tokens counted: the
    sidechain branch returned before both. Sub-agent usage now lands on the
    delegation it belongs to rather than being dropped.
  - Tool-call pairing keyed by pointer into a turn's tool slice, which any
    later change appending a call to a stored turn would orphan silently.
    Keyed by position and resolved after the file is read.
  - A result whose call the transcript does not hold now withdraws the
    order claim instead of being discarded in silence.
  - Each message body was unmarshalled twice, on lines reaching 4.2 MiB.
  - Usage is kept from records that produce no turn; the harness billed for
    them either way.

The conformance kit's claim to make a capability declaration binding is
corrected: it binds against reporting the unobservable, and a capability
declared whole and never filled still passes. That is the finding in #39,
which stays open for the fixture work it needs.

Closes #26, #28, #29, #30, #31, #32, #33, #34, #35, #36, #37, #38

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ew64uotJqtvVDN3twMAVEQ
@codecov

codecov Bot commented Jul 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.70130% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/adapter/claudecode/capture/parse.go 98.57% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

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.

capture(claudecode): CanSeeTokens is declared whole while most input tokens go unread

1 participant