Skip to content

Phase 1: read Claude Code transcripts into the neutral representation - #40

Merged
JumpTechCode merged 1 commit into
mainfrom
phase1/claudecode-capture
Jul 27, 2026
Merged

Phase 1: read Claude Code transcripts into the neutral representation#40
JumpTechCode merged 1 commit into
mainfrom
phase1/claudecode-capture

Conversation

@JumpTechCode

Copy link
Copy Markdown
Collaborator

The first implementation of the capture port, and the first thing to put the
neutral representation under real load. Claude Code is the reference adapter,
not the substrate: nothing outside this package learns a harness name, and the
architecture test that enforces that stays green.

Two corrections to the representation fell out of building it, both measured
rather than argued:

  • No transcript record in any sampled version carries a price — 401 files and
    135,001 records, zero occurrences. Even the reference harness cannot supply
    money from a transcript, so CanSeeCost is not claimed.
  • A tool result records that a call errored and never the code it returned,
    so ExitCode became a pointer. Filling it with zero would have reported
    success beside an outcome saying the call failed, and zero is itself a
    meaningful code.

The capability declaration is measured. Cost, the workspace patch, file
mutations and their content are not claimed. Model identity is partial because a
transcript records what served a message and never the alias asked for. Tool
results are partial because large ones are shortened in place. Delegation is
partial because a scan of 601 project-root transcripts found no inline
delegation at all — every one keeps it in sidecar files this adapter does not
read, so an assertion about delegated work resolves to an error rather than to a
false negative.

Against the real store: 300 of 300 transcripts parsed, no refusals, 15,022
turns, 5,112 tool calls matched to 5,112 results — the same pairing the earlier
survey measured. Every committed fixture is synthetic; no transcript content is
committed.

Known defects, filed before merge

An adversarial review after this commit landed found fifteen issues, six of
which are severe enough to name here. They are filed rather than fixed in this
branch, so that the review's evidence is on the record before any of it is
touched:

#25 harness-injected records become human turns — 48.3% turn inflation
#26 CanSeeTokens declared whole while cache token fields go unread
#27 OrderComplete stays true on a compacted session, so the flag is dead
#28 Discover with a Dir query silently matches almost nothing
#29 Model.Provider is filled with a value no transcript states
#30 CanSeeWorkspace declared whole while Revision and Origin are unset

The rest — #31 through #39 — cover wall-clock duration, inline delegation,
sentinel selection, version joining, empty transcripts, two hardening items, a
group of small parser gaps, and one structural gap in the conformance kit
itself: it catches an adapter claiming too little and not one claiming too much.

Four of these are the same class of mistake, and it is worth naming: a
capability declared whole while the fields it governs go unfilled. The
declaration is what decides whether a missing value reads as ERROR or as
FAIL, so an overclaim here manufactures exactly the regression the
representation exists to prevent. #39 is why the kit did not catch them.

The distiller reads this output, so #25 and #27 want fixing before anything is
blessed from it.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Ew64uotJqtvVDN3twMAVEQ

…tation

The first real implementation of the capture port, and the first thing to put
the neutral representation under load. Two corrections to it fell out of
building this, both measured rather than argued:

  - no transcript record in any sampled version carries a price. 401 files and
    135,001 records, zero occurrences. Even the reference harness cannot supply
    money from a transcript, so the golden session's cost profile cannot be
    read from the thing being blessed.
  - a tool result records whether the call errored and never the code it
    returned, so ExitCode becomes a pointer. Filling it with zero would have
    reported success beside an outcome saying the call failed, and zero is
    itself a meaningful code.

The capability declaration is measured, not assumed. Cost, the workspace patch,
file mutations and their content are not claimed. Model identity is partial
because a transcript records what served a message and never the alias asked
for. Tool results are partial because large ones are shortened in place.

Delegation is partial, and that was nearly an overclaim: it read correctly from
the synthetic fixture and produced nothing at all from 300 real transcripts. A
scan of 601 project-root files found no inline delegation — every one keeps it
in sidecar files this adapter does not read. Declared because the inline form
is handled, marked partial because on the real store the answer is always
empty, so an assertion resolves to an error rather than to a false negative.

Verified against the real store: 300 of 300 transcripts parsed, no refusals,
15,022 turns, and 5,112 tool calls matched to 5,112 results — the exact pairing
the earlier survey measured. Every committed fixture is synthetic; no
transcript content is committed, and the redaction pass that would make an
export safe is not trustworthy yet.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ew64uotJqtvVDN3twMAVEQ
@JumpTechCode
JumpTechCode merged commit 82ee9c6 into main Jul 27, 2026
5 checks passed
@JumpTechCode
JumpTechCode deleted the phase1/claudecode-capture branch July 27, 2026 01:17
@codecov

codecov Bot commented Jul 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.51815% with 56 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/adapter/claudecode/capture/parse.go 83.33% 21 Missing and 12 partials ⚠️
internal/adapter/claudecode/capture/capture.go 77.00% 13 Missing and 10 partials ⚠️

📢 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.

1 participant