Repository navigation
Description
Summary
--rescore is the suite's zero-session tier: it re-judges persisted transcripts with the current runner, so a rule change can be replayed against evidence that already exists. Its correctness rests on parse_transcript() in evals/run.py, which splits a transcript into turns by looking for any line that starts with $ :
for block in re.split(r"(?m)^(?=\$ )", text):That separator is in-band. A turn's own output can contain a line starting with $ — a test runner echoing the command it ran, a shell script printing its prompt, a git log message quoting a command — and when it does, the block is cut in half. The first half no longer matches TRANSCRIPT_BLOCK (it has no [stderr] marker), so it is silently discarded, and everything after the false boundary is discarded with it.
The same in-band assumption appears in two more places: delivery_spec() splits sessions with text.split("\n\n$ ") and the delivery scorer derives aux.intent_check from text.split("\n\n$ ")[-1]. The existing selftest for intent_check documents the assumption — its session bodies spell newlines as the two characters \n, "the way the harness JSON escapes them" — but nothing in the parser enforces it.
Reproduction
Against the current main, a two-turn transcript whose first turn printed a shell-style header is parsed as one turn:
text = """$ npm test
[exit 0]
$ npm test
boilerplate header from test runner
1 passing
[stderr]
$ npm run build
[exit 0]
ok
[stderr]
"""
parse_transcript(write_temp(text))
# => [{'cmd': 'npm run build', 'exit': 0, 'stdout': 'ok', 'stderr': ''}]The first turn is gone. If that turn carried the emitted spec, an evidence pointer, or the reply that a case asserts on, --rescore judges the run without it and can flip a pass to a fail (or the reverse) with no warning.
There is a second failure mode on the same path. A transcript in which no block parses (for example a truncated file, or one where every turn's output begins with $ ) makes parse_transcript() return an empty list, and rescore() then evaluates:
statuses.append(turns[-1]["status"])which raises IndexError: list index out of range. One malformed transcript aborts the entire report rewrite, and the message names neither the file nor the cause.
Why it matters
The runner's own design notes say a benchmark that cannot detect contamination measures nothing. The same logic applies to the audit trail: if the transcript is the evidence, then re-reading it must be deterministic and must never silently drop a turn. --rescore is specifically the tool used when the judging rules change, so a parser that can change the evidence depending on what the model printed undermines exactly the comparison the tier exists for.
This is currently latent for the three shipped harnesses because all three are invoked with JSON output formats, where embedded newlines are escaped as \n. It becomes real as soon as a harness emits plain text, a run dies mid-write, a transcript is hand-edited while investigating an anomaly, or a future harness is added — and the delivery-side separators have no escaping guarantee at all.
Proposed direction
- Treat a turn boundary as a header pair, not a lone
$line: a$ <cmd>line immediately followed by its[exit <code>]line. Command output almost never contains that pair; it routinely contains a prompt. - Put that rule in one shared splitter used by
parse_transcript(),delivery_spec(), and theintent_checkderivation, so the three copies cannot drift. - Make a transcript with zero parseable turns fail loudly and specifically (naming the file), instead of indexing
turns[-1]. - Add offline
--selftestcoverage: output containing$ npm testmust not split a turn; two sessions joined with\n\nmust still resolve the last one when an earlier one contains a$line in its body; a malformed transcript must produce the explicit error.
Acceptance
python evals/run.py --selftest,--check-frontmatter, and--check-docsall pass on Linux withpyyaml+jsonschema.- The new selftests fail on
mainand pass with the fix. - Parsing of existing
evals/reports/raw/**/*.txtis unchanged (all current boundaries already satisfy the header-pair rule).
Activity
angel291592 commentedon Nov 6, 2026
Fixed and merged as
c487e9c— thanks for both the diagnosis and the patch; both failure modes were exactly as described.What landed:
split_transcript_blocks()now splits only where a$ <cmd>line is immediately followed by its[exit N]line, andparse_transcript(),delivery_spec()and theintent_checkderivation all use it. A$line inside command output is no longer a boundary.[]and reachingturns[-1]. One extra commit (fecdad9) extended that to the zero-byte case: the guard only fired when the text was non-empty, so a transcript truncated to zero bytes still produced theIndexError.intent_checkfinding the final session when its body contains a$line.Verification on the merged tree:
--selftest,--check-frontmatterand--check-docsall pass (frontmatter 493 lines / 491 chars; docs 37 links). The new cases fail against the previous splitter and pass now. No live suite was run: this is offline parsing only, and no scoring semantics, case data or reports were touched.The residual ambiguity you called out stands: output that itself contains a complete
$ <cmd>+[exit N]pair is still indistinguishable from a genuine header in the current human-readable format. A length-prefixed or JSON-lines record would remove it, but that is a persistence-format change and out of scope here — if it ever bites, that is the fix to make.Nothing needed from your side.
chore: release v1.4.1