Merge Main and Resolve Transcript Conflicts

Merge complete. Summary:
Merged origin/main into push-compact-for-v1
Pulled 367 commits from main into your 1-commit branch. The auto-merge handled all code files cleanly; two doc files conflicted, both for the same underlying reason.
Key finding
Main has removed the v1.1 checkpoint read-mirror feature entirely — the merge deleted cmd/entire/cli/strategy/v1_custom_ref_mirror.go (+test), and the new checkpoint store IgnoresCheckpointsVersion. Main also deleted all v1.1 mirror documentation. Your branch's base still carried it.
Conflicts resolved
Both conflicts mixed two independent things; I split them by what the merged code actually contains:
| Content | Decision | Why |
|---|---|---|
Compact transcript (transcript.jsonl) docs — your commit's feature | Kept | The code (writeCompactTranscript etc.) survived the merge into the refactored committed.go intact |
| v1.1 local read-mirror docs — pre-existing context | Dropped | Feature was removed from main's code; keeping the docs would describe behavior that no longer exists |
CLAUDE.md— kept compact-transcript bullet, dropped v1.1 bulletdocs/architecture/sessions-and-checkpoints.md— kept compact-transcript paragraph, dropped#### v1.1 local read mirrorsection
Verification
go build ./...— cleancheckpoint,strategy,pathspackage tests — all pass- No conflict markers or stray v1.1 references remain (the remaining "mirror" mentions are the unrelated
repo mirror listcommand)
Merge commit d7e855b1d created on push-compact-for-v1. Not pushed.
One thing worth flagging: your compact-transcript work was the v1 counterpart to a versioning scheme that main has since reworked (the v1.1 mirror is gone, and the checkpoint store now ignores checkpoints_version). The code merged and compiles, but you may want to confirm the compact-transcript feature still fits main's new checkpoint-store design before pushing.
For now, we just want to make sure compact transcripts are pushed simultaneously as the full.jsonl transcripts: don't point metadata.json to it yet as part of this PR. Make those changes and adjust the PR title and description accordingly when ready (and push the changes up too of course)
Done. Summary of what changed and shipped:
Behavior change
transcript.jsonl (the compact transcript) is still generated and written into the checkpoint tree on every committed write and during finalization, so it's pushed alongside full.jsonl with the entire/checkpoints/v1 branch. The metadata.json sessions[].transcript pointer now stays on full.jsonl — pointing it at the compact transcript is deferred.
Code
committed.go:writeTranscriptkeeps callingwriteCompactTranscriptbut always returnsfull.jsonlas the pointer.writeCompactTranscriptno longer returns the now-unusedbool(fixed theunparamlint hit). Updated the doc comments inwriteTranscript,replaceTranscript, and the directory-tree diagram.committed_compact_transcript_test.go: the one assertion that expected the pointer to target the compact file now expectsfull.jsonl; the tests that the compact file is written, scoped, and regenerated stay as-is.- Docs (
CLAUDE.md,sessions-and-checkpoints.md): pointer now documented as staying onfull.jsonl, compact pushed but not yet referenced.
Verification
mise run fmt+mise run lint→ 0 issuesmise run test:ci(unit + integration + e2e canary) → exit 0, all green
Git / PR
- Committed
2b5c661e8onpush-compact-for-v1and pushed. - PR #1419 retitled to "Store and push compact transcript.jsonl in v1 checkpoints (metadata pointer unchanged)" and the description rewritten: scope narrowed to write-and-push only, pointer-flip called out as a follow-up, and the stale v1.1 mirror references removed (main deleted that feature).
One note for awareness: this branch's merge commit (d7e855b1d) pulled 367 commits from main, and the prior turn's conflict resolution dropped the v1.1 mirror docs because main removed that feature from the code. That's all part of what's now on the PR.
Now let me add a focused test. First, let me look at existing Codex test fixtures/helpers to build a minimal transcript with content that sanitization strips.
if it's already sanitized, we don't want to sanitize it again. it's a very expensive process
Both threads addressed and resolved.
Final summary
| Thread | Reviewer | Finding | Status | Reply | Resolved |
|---|---|---|---|---|---|
PRRT_…SpQ | cursor (Bugbot) | Codex sanitize skipped on finalize | Fixed in 847d4754a | Yes | Yes |
PRRT_…SpL | cursor (Bugbot) | Summary pointer not updated | Not applicable (pointer always full.jsonl by design) | Yes | Yes |
What changed (847d4754a):
replaceTranscriptnow sanitizes Codex transcripts (codex.SanitizePortableTranscript) before generating the compacttranscript.jsonl, matching the initial-write path. Sanitization runs once per path — per your note, the already-sanitized initial-write input is not re-sanitized (writeCompactTranscript's doc now states callers pass pre-sanitized bytes).- Added
TestUpdateCommitted_CodexCompactSanitizedLikeInitialWrite— verified it fails on raw bytes and passes with the fix.
Verification: mise run lint (0 issues), go test ./cmd/entire/cli/checkpoint/... (ok), revert-test confirmed the new test is a real regression guard.
Pushed to push-compact-for-v1; both review threads replied to and resolved on PR #1419.
Summary
Ran 4 parallel cleanup agents (reuse, simplification, efficiency, altitude) over the compact-transcript diff (origin/main...HEAD: committed.go, checkpoint.go, paths.go, and the new test file).
Fixed: nothing — the code was already clean on three of four angles.
Skipped (1 finding): Altitude flagged the two inline if agentType == AgentTypeCodex { SanitizePortableTranscript } sites and proposed a TranscriptNormalizer agent interface. Skipped because:
- The fix lands well outside the reviewed diff (new interface + codex-agent implementation in the
agentpackage). - One of the two sites is pre-existing code from
main, not introduced here. - The two sites apply sanitization to different downstream scopes (initial write: chunks + hash + compact; finalize: compact only). A shared helper would hide that deliberate boundary — which is why the reuse and simplification agents independently judged the inline form acceptable.
No code changes were applied. The branch is unchanged from the pushed state (847d4754a).
why are the changes in cmd/entire/cli/checkpoint/committed_compact_transcript_test.go in this PR? theoretically we already have tests for compact transcripts in the code already
Here's what I found.
The file is new to this PR, and it tests a different layer
committed_compact_transcript_test.gowas added by this PR (commitafd94281e); it does not exist onorigin/main(git diffshows statusA).- The "existing compact-transcript tests" are in
cmd/entire/cli/transcript/compact/*_test.go(compact_test.go,codex_test.go, etc.). Those test theCompact()transformation in isolation — given raw agent JSONL, does it produce the right compact format. - This new file tests the checkpoint-store integration — that
GitStore.WriteCommitted/UpdateCommittedactually generatetranscript.jsonl, write it into the branch tree, scope it to the checkpoint start, set the metadata pointer tofull.jsonl, and regenerate/sanitize on finalize. That behavior is exactly what this PR introduces, and nothing onmaincovered it (checkpoint_test.go's onlytranscript.jsonlhits are the unrelated on-diskagent-transcript.jsonl).
So the file belongs here — it's the unit coverage for the new store-layer code. It's complementary to, not a duplicate of, the compact-package tests.
But you're partly right — some assertions over-reach
One test re-validates the compact format, which is the compact package's job, not the store's. In TestWriteCommitted_WritesCompactTranscript:
The v, agent, and per-line type shape are already asserted in transcript/compact/codex_test.go etc. The store test only needs to prove it wrote and scoped the file (exists in tree, non-empty, pointer correct, scoped content present) — which the other tests already do. This matches your own guidance ([[feedback_test_scope_to_unit.md]]: don't re-test a dependency's output from a consumer's tests).
The store-specific behavior in the file (writes into tree, scoping by start line, pointer = full.jsonl, non-compactable fallback, finalize regen, Codex sanitize-on-finalize) is not redundant and should stay.
Want me to trim the format-level assertions down to the store-layer ones? That'd tighten the file to its actual unit without losing real coverage.
Trimmed and pushed (c4b837ba6).
What changed
Removed the assertions that re-tested the compact format (already covered by transcript/compact/*_test.go):
v == 1,agent == "claude-code", per-linetype, and exact line count- the now-unused
parseCompactLineshelper +compactTranscriptLinetype - the now-unused
encoding/jsonimport and the two blank agent imports (only needed for the slug assertion)
Net: −44 / +3 lines.
What stayed (the store's own behavior)
full.jsonlandtranscript.jsonlare written into the checkpoint tree- the compact holds real derived content (
"reply two"present) - scoping to
CheckpointTranscriptStart(excludes pre-start content) - non-compactable transcript → no
transcript.jsonl, pointer falls back - metadata pointer stays on
full.jsonl - finalize regeneration + Codex sanitize-on-finalize
Verification
- Removed the imports and confirmed tests still pass → proved they were vestigial (compaction keys off content; Codex sanitization uses the production package import, not the test registry)
mise run lint(0 issues),go test ./cmd/entire/cli/checkpoint/...(ok)
The tests now cover only the checkpoint-store unit, with format validation left to the package that owns it.
it seems undesired to me that cmd/entire/cli/checkpoint/committed.go we went from returning true or false to returning ""
Done — pushed as aeb61502e.
You were right: that was a regression with no upside. On main, writeTranscript returned (bool, error) meaning "was a transcript written." The compact-transcript change had switched it to (string, error) — the pointer filename, with "" as the "nothing written" sentinel — only so the pointer could one day point at transcript.jsonl. Since that pointer move was deferred and the metadata pointer is always full.jsonl now, the string return carried exactly the same information as the old bool, just dressed up as an empty-string sentinel.
Reverted to match main:
writeTranscriptreturns(bool, error)again; all error paths returnfalse.- Caller uses
wroteTranscript+paths.TranscriptFileNamedirectly (as on main). - Dropped the now-pointless
pointerFilelocal and the constanttranscript_pointerdebug-log field.
The only remaining change to writeTranscript vs main is the actual feature: the writeCompactTranscript call (+ comment). Verified with mise run lint (clean) and the full checkpoint package tests (pass).