Repository navigation
feat: offline trace replay scorer + redacted trace archive (#107) - #108
Merged
Merged
Conversation
Adopt the Dream-RSI replay-evaluation pattern (arXiv:2609.14858) inside the existing eval harness. Tier 2 runs can now archive a redacted copy of each mission trace (evals/traces/<model>/<mission>/, secret-shaped tokens dropped, host paths scrubbed) via run.py --archive, and a new operator-built scorer bin (tole-replay) walks those traces under a candidate prompt at zero tool executions — recorded outcomes settle every tool call. The incumbent default prompt is always evaluated in the same run (extracted from the CLI source, never a drifting copy) and a revision only ships when strictly better on the corpus (monotone selection). Divergent/errored walks score zero: replay is exact only inside the recorded world. results.json gains the model field and the runner accepts TOLE_EVAL_BINARY. Live-validated end-to-end on glm-5.1: 3/3 missions archived, replay scored, a degraded no-tools candidate rejected (0.783 vs 0.842 incumbent avg).
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
This was referenced Sep 22, 2026
ajianaz
added a commit
that referenced
this pull request
Sep 22, 2026
Every [[bin]] target builds unconditionally, so the eval scorer shipped in plain builds and cargo install tole-cli — contradicting the documented operator-only contract (cora full-scan #12, my error from #108). required-features = ["replay"] with a non-default replay = [] feature: default builds/installations never produce it, eval sessions opt in via --features replay. Build commands in evals/README.md + run.py docstring updated. Verified: default build produces no tole-replay, --features replay builds it, package list excludes replay.rs. Co-authored-by: ajianaz <[email protected]>
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.
What (description of the change)
Adopts the Dream-RSI replay-evaluation pattern (arXiv:2609.14858) inside the existing eval harness. Three pieces:
evals/tier2/run.py --archivekeeps a REDACTED copy of each mission's session JSONL underevals/traces/<model>/<mission>/(+meta.json). Secret-shaped tokens (sk-,rk-,ghp_,github_pat_,xoxb-/xoxp-,AIza…) are dropped — only the token family stub is kept — and host session paths are replaced with<HOSTPATH>. Prose is untouched; the archived file stays valid JSONL. Also:results.jsongains amodelfield (closes the documented operator-trust gap indiff.py), andTOLE_EVAL_BINARYoverrides the binary path.tole_core::replayparses archived session JSONL (single AND batched-array lines, torn-tail safe — same contractdurable_metricsalready follows), pairsintent→settlement, and walks the trace under a candidate prompt with ZERO tool executions: recorded outcomes settle every call (exact(tool, input)match first, oldest-same-tool fallback); calling a tool the recorded run never called ends the walk as an explicit path divergence.tole-replay(operator-built fromevals/replay/, NOT part of the shipped tole binary): scores candidates over the trace corpus. A COMPLETED walk scores0.7 × path_agreement + 0.3 × final_match; an errored/diverged walk scores 0 — replay is exact only inside the recorded world. The incumbent default prompt is always evaluated in the same run (extracted from the CLI source, never a drifting copy) and a revision is only reportedSHIP: revisedwhen strictly better on the corpus (monotone selection, Dream-RSI §3).--model/--missionfilters,--jsonoutput, one transient retry on provider errors (feat: usage ledger wiring, 429 retry classification, no per-step transcript clone #66 pattern).evals/README.mdgains the Tier 2.5 — offline trace replay section: replay is an advisory pre-check for prompt/policy revisions; live Tier-2 missions remain the release gate. 7 new unit tests cover parsing (incl. batched array lines), wire-equivalence of the synthetic intent/result pairs, scoring, and divergence surfacing.Why (the problem you're solving)
Closes #107. A prompt/policy revision could previously only be validated by ANOTHER live run (cost + noise), and the decision+outcome data each mission had already paid for — what Dream-RSI calls a replay simulator — was deleted after a single scoring pass. Offline replay turns recorded traces into a reusable feedback corpus: cheap, execution-free evaluation for prompt/tool-discipline changes before they ever touch the deployed default.
Testing (how you verified this works)
cargo test -p tole-core --lib replay→ 7/7 pass; full workspace suites green;--no-default-features(mobile) profile green; clippy 0 warnings on touched bins; run.pypy_compileclean.run.py --all --archive→ 3/3 missions PASS; 3 traces archived; redaction verified both on the real traces (0 secrets, 0 host paths, JSONL parses) and via a synthetic test assertingsk-/ghp_tokens dropped, family stubs kept, prose intact.read_and_reportandecho_chain(replay ≈ live agreement); a deliberately degraded no-tools candidate (evals/replay/prompts/answer-only.txt) is REJECTED —SHIP: incumbent(0.783 vs 0.842 avg; crash_resume incumbent 0.525 vs 0.350). A transient provider 502 recovered via the one-retry path.--jsonsmoke: valid JSON,ship: incumbent,traces: 1on scoped run.