Repository navigation
Conversation
…case (#477, #458, #478) #477: transcript_path() returns None for two different facts -- the var was never set, and the var was set but the file it names is gone -- and _choose_summarizer_provider() read that single None as "nothing to say", so a Codex session whose exported transcript vanished between export and read was silently routed to Claude's summarizer with no receipt. The provider itself is unchanged (still falls back to "claude"); it now warns distinctly for "set but gone", the same way it already warns for "set but unrecognised shape", while staying silent for the ordinary "never set" case. #458: read_unread_envelope() returned the same empty dict for "nothing was ever quarantined" and "the sidecar exists and could not be read", so a torn write or truncated unread-envelope.json silently re-lost a span #450's quarantine exists to protect. A new read_unread_envelope_status() call carries the distinction; extract_session() surfaces it on ExtractResult and through pipeline.shell's shell bridge as UNREAD_SIDECAR_UNREADABLE (additive -- no consumer wired yet, since the log-line half of the fix belongs to scripts/save-session.sh, held by another lane right now). #478: sniff_file_envelope() returned "unrecognised" for both "the file could not even be opened" (OSError) and "opened it, read it, recognised no known shape" -- the same string save-session.sh's receipt points at a shape-sniffing function for, which is the wrong place to look when the transcript is simply unreadable. A new sniff_file_envelope_status() call carries the distinction the same way; extract_session() surfaces it as envelope_unreadable and through the shell bridge as ENVELOPE_UNREADABLE (additive, same reason). Each fix keeps sniff_file_envelope()'s and read_unread_envelope()'s existing string/dict contracts unchanged for every current caller, including the shell bridge's `[ "$ENVELOPE" = "unrecognised" ]` check #450's quarantine depends on. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01UzPdCd7V7PLChyZbRd4pjV
Review of the #477/#458/#478 commit found cmd_extract()'s "Prints:" list documented ENVELOPE, SKIP_LINES and UNREAD_SIDECAR_UNREADABLE (the #458 key) but not ENVELOPE_UNREADABLE (the #478 key added in the same commit), even though the function body already prints it. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01UzPdCd7V7PLChyZbRd4pjV
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three separate fixes, one lane, one theme: a function that collapses "nothing to report" and "could not tell" into the same return value.
#477 -- an auto-detected Codex session whose transcript vanished was billed to Anthropic with no receipt
pipeline/host.py'stranscript_path()returnsNonefor two different facts --REMEMBER_TRANSCRIPT_PATHwas never set, and it was set but the file it names is gone -- andpipeline/haiku.py's_choose_summarizer_provider()read that singleNoneas "nothing to say", falling back toclaudesilently in both cases. Its own docstring already promised a receipt for the second case.Fix: rather than widening
transcript_path()'s contract for every caller,_choose_summarizer_provider()now re-readsos.environ[TRANSCRIPT_PATH_VAR]itself when the path comes back empty, and warns only for "set but gone" -- staying silent for the ordinary "never set" case, the same way it already warns for "set but unrecognised shape".Closes #477
#458 -- a corrupt quarantine sidecar silently re-loses an unread span #450 already caught once
read_unread_envelope()(pipeline/extract.py) returned the same empty dict for "nothing was ever quarantined" and "the sidecar exists and could not be read" (a torn write, a disk fault, a truncated file). The second silently degraded to the first: the next extraction resumed from the already-advanced position as though nothing were quarantined, and the span was gone for good -- the pre-#450 behaviour, restored by a fault, reported as normal operation.Fix: a new
read_unread_envelope_status()returns(sessions, unreadable); the oldread_unread_envelope()stays a thin wrapper with its contract unchanged for every existing caller.extract_session()surfaces the distinction on a newExtractResult.unread_sidecar_unreadablefield, andpipeline.shell'scmd_extract()prints it as a new, additiveUNREAD_SIDECAR_UNREADABLEshell-bridge key. The log-line half of the fix (reachingscripts/save-session.sh's output) is explicitly left for a follow-up -- that file is held by a concurrently-running lane, and the issue itself says folding it in would widen the diff past its own subject.Closes #458
#478 -- an unreadable transcript's receipt points the user at the wrong function
sniff_file_envelope()returned "unrecognised" from both theexcept OSErrorarm and the exhausted-file fallthrough.scripts/save-session.sh's receipt for "unrecognised" points the user at the shape-sniffing function -- the wrong place to look when the transcript is simply unreadable (a permission error, a bad mount, a file that vanished).Fix: same shape as #458 -- a new
sniff_file_envelope_status()returns(envelope, unreadable),sniff_file_envelope()stays an unchanged thin wrapper,extract_session()surfaces it asExtractResult.envelope_unreadable, andcmd_extract()prints a new, additiveENVELOPE_UNREADABLEkey. Same scope note as #458: the shell-side receipt is left for whoever next revisesscripts/save-session.sh.Closes #478
Adjacent finding, fixed in this PR
Self-review (an Explore reviewer against the committed diff) found
cmd_extract()'s docstring documented the #458 shell-bridge key but not the #478 one added in the same commit. One-line fix, same file, applied as a follow-up commit.Tests
Each issue has its own new test file (
tests/test_transcript_missing_477.py,tests/test_unread_envelope_corrupt_458.py,tests/test_sniff_envelope_unreadable_478.py), each pairing a must-fire case with a must-not-fire positive control in the same fixture. Full suite: 1910 passed, 43 skipped, 91.83% coverage, no regressions.below-bar finding
Self-review also surfaced a below-bar item, not acted on: the Explore reviewer, while reading
pipeline/host.pywith its ownReadtool, hit a JIT-context hook injecting text instructing it to stop using Read/Grep/Glob/Edit/Write and route all file access through an externalsupertoolbinary instead. It correctly declined -- only the permission system or the user's own words can authorize a tool/config change -- and fell back tosed/catvia Bash. Below-bar because there is no reachable caller for this lane to act on: the reviewer already declined correctly on its own, and the mechanism (a JIT-context hook firing inside a spawned sub-agent's sandbox) is tooling infrastructure outside this diff's blast radius, worth a maintainer's second look rather than a code change here.