Pass 1 of 4 · intuition · about 45 min
Visual intuition
Nine pictures, no formulas. Predict first, then watch.
0 of 20 concepts in this pass seen
This pass builds on concepts you have not opened yet: The four primitives, Hashes and content addressing, Directed acyclic graphs, Truth tables and Boolean logic, Bernoulli trials and pass rates. Everything below is readable anyway.
A replay is a sealed past
S2S3S4E1E2
Here is a real-shaped episode. Opus works on a retry-backoff bug in session 1 and commits C1. A day later Neon picks it up in session 2, finds the real cause and commits the fix, C2.
Same Again stores each turn as a small node in index.sqlite, with a pointer to the raw transcript bytes it came from. The node's id is the hash of where those bytes live and what they are. The heavy text stays in the original JSONL until something asks for it.
A cut is the past, sealed by its fingerprint
| cut_id | 79a08bb5aa60 | |
|---|---|---|
| cut node | 3 · 15c04f75f76a | |
| prefix turns (agent sees) | 2 | |
| held-out witnesses | 10 | |
| node 7 id | 2f431d5cbd8a | clean |
| node 8 id | cdd7f614a428 | clean |
| workspace ref | checkpoints.first() → base | cut-time commit base |
| isolation_verified | true | shipped check: no .git, no held-out id hex |
| leaked files | none | |
| ancestor check | skipped | proposal, not in same-again |
How to use this
Drag across the map (or click a node, or use the slider) to move the hindsight barrier. Everything left of it is the agent's past; everything right is held out for the grader. Deep link: ?preset=tamper&cut=9 or ?preset=leak.
The cut role says why you cut where you did. Prevention cuts just before the bad commit and asks: would policy B have avoided it? Detection and repair cuts at the start of session 2 and asks: would B have found the cause faster? Handover cuts at a session boundary and asks: did the handoff carry what the next agent needed?
Now tamper with node 7's payload. Node 7 gets a new id. So does every cut whose prefix contains node 7. Node 8 does not change.
Someone edits node 7's line in the JSONL transcript and Same Again re-imports it. Which ids change?
A cut is taken at cut_seq = 40. Which of these may reach the agent's side?
What a check is
E3S5E4
At the end of session 1, Opus wrote a handoff.json that says covers_current_state: true. It also edited two files after its last test run. The claim is stale.
Same Again's real check for this is called handover-no-stale-claim. It reads the handoff and the session's tool calls and answers one of three things: Pass, Fail or Unknown. Unknown is what it says when answer.md is missing or the grader timed out. It is not a polite Fail.
Unknown is a third value, and graders must earn the right to judge
Part A: Kleene K3 gate bench
Fail AND Unknown = Fail
Fail AND Unknown = Fail. Fail dominates AND: whatever the Unknown resolves to, the result is Fail. A's witness is kept and the Unknown reason is dropped, because it cannot change the answer.
| A \ B | Pass | Fail | Unknown |
|---|---|---|---|
| Pass | Pass | Fail | Unknown |
| Fail | Fail | Fail | Fail |
| Unknown | Unknown | Fail | Unknown |
| A \ B | Pass | Fail | Unknown |
|---|---|---|---|
| Pass | Pass | Pass | Pass |
| Fail | Pass | Fail | Unknown |
| Unknown | Pass | Unknown | Unknown |
| A | NOT A |
|---|---|
| Pass | Fail |
| Fail | Pass |
| Unknown | Unknown |
Part B: witness calibrator
file-exists grader passes whenever answer.md exists. You calibrate it with one bad witness (stale claim, answer.md missing) and one good witness. Does calibrate_all accept it?| What it does | a command grader that always exits 0 |
|---|---|
| Witnesses used | 2 bad, 2 good, 1 unknown |
| calibrate_all | Err(BadWitnessNotRejected) |
| Mutation score | 0/20 (0%) |
How to use this
Part A is the gate bench: click the A and B tokens and the operator. Part B: pick a grader and tick witnesses. Try file-exists with only bad-2 and good-1. Deep link: ?preset=file-exists or ?a=Pass&b=Unknown&op=OR.
A grader must earn the right to score anything. Before Same Again lets it near a trial, it shows the grader a known-bad handoff (stale claim) and a known-good one (fresh verification). Reject the bad, accept the good, or no deal.
Here is the catch. A lazy grader that only checks whether answer.md exists can pass that test, if the bad witness happened to be missing its file. It rejected the bad handoff for the wrong reason.
A grader checks 'build passed AND the named test ran'. The build passed. The test log is missing. What does Same Again record?
Spot the lie: "Our file-exists grader passed calibration on one bad and one good handover, so it detects stale claims."
One run is not a rate
E8
Your agent fixes the flaky-test bug 60% of the time. Is that good? It depends on the question you are asking.
- Can it ever do this? Give it k tries and keep the best. That chance climbs towards 1.
- Does it do this every time? Run it k times unattended and need all k. That chance falls towards 0.
pass@k climbs, pass^k decays
In this sample, the first 5 runs: at least one passed = yes, all passed = no.
| pass@5 | 99.0% | at least one of k passes |
|---|---|---|
| pass^5 | 7.8% | all k pass |
| flakiness gap | 91.2% |
How to use this
Drag p and k. pass@k asks whether any of k runs passes; pass^k asks whether all of them do. The Gap 4 view compares the estimator sa-core ships with an unbiased one. Deep link: ?preset=gap4&n=5&c=3&kEst=3.
An agent passes a task 60% of the time. It will run unattended every night for a week. Which number tells you how often the whole week goes cleanly?
Compare on the same task
F4E7
Some tasks are hard for every policy. If A gets the hard tasks and B gets the easy ones, B looks better for reasons that have nothing to do with B.
The fix is old: run both policies on the same cut and compare them pair by pair. A hard task drags both scores down together, so its difficulty cancels in the difference. Statisticians call the shared wobble covariance.
But pairing has a mirror-image trap. Eight retries on one task share that task's quirks. They agree with each other more than eight different tasks would, so they carry less information than eight.
Pairing helps, retries do not
sa diff with one --cut-dir. Policy B wins all 10 retries of that single task. What does sa diff say?Pairing: Var(A − B) = Var(A) + Var(B) − 2 Cov(A, B)
Only discordant pairs (shaded) carry evidence about A vs B. As ρ rises they thin out and the paired variance falls: the same precision needs 2.00× fewer pairs than an unpaired comparison.
| Var(A) + Var(B) | 0.480 | |
|---|---|---|
| 2 Cov(A, B) | 0.240 | |
| Var(A − B) | 0.240 | |
| sa diff E (naive) | veiled | |
| Cluster-level E | veiled | proposal |
| Effective n (lower bound) | veiled | distinct cuts |
| Cluster-robust SE | veiled |
How to use this
Scrub ρ to see covariance cancel variance. Then switch the Gap 1 design: the same 10 B-wins either come from one task retried or from 10 different tasks. Deep link: ?preset=fix&design=one-cut.
You have budget for 8 runs of each policy. Which plan tells you most about the policies?
When may you stop?
F5E5S6
Flip two identical coins, A and B, and keep score of which wins. After every flip, run a standard 5% test. Stop the moment it says 'B is better'.
A standard test promises a 5% false-alarm rate if you look once, at a sample size you fixed in advance. Every extra look is another ticket in the lottery.
Peeking breaks a p-value, not an e-process
Bars run from 0% to 50%; the tick marks α = 5%.
| Pairs observed | 0 | |
|---|---|---|
| Naive false positives so far | veiled | |
| E-process false positives so far | veiled | |
| Naive FPR at 150 | veiled | |
| E-process FPR at 150 | veiled | |
| Rejection threshold | E ≥ 20 | |
| Straight B-wins needed | 8 | E(7,0) = 16.00, E(8,0) = 28.44 |
How to use this
Every line is an A/A experiment where nothing changed. Press play or drag the scrubber. A line that crosses its rejection line freezes there: that is a false “Better”. Deep link: ?preset=cs&n=5869 or ?seed=7&steps=500.
This is why sa diff can re-analyse after every pair and stop at the first clear verdict. Its evidence is a running bet against 'no difference' that, under the null, never grows on average. To say Better at α = 0.05 the bet must multiply your stake twenty-fold.
That same machinery gives sa diff four possible answers: Better, Worse, Equivalent, or Inconclusive. Inconclusive is the honest answer more often than you would like.
The runs that never finished
E6
Some replays time out. Some graders cannot find answer.md. Those trials come back Unknown. What should a comparison do with a pair where B is Unknown?
Same Again drops it from the evidence, as long as no more than 20% of either arm is Unknown. That is safe if the timeouts are random. Now suppose B times out exactly on the hard tasks, the ones it would have failed.
Selective timeouts and the Manski bounds
sa diff says Better (E = 24.93). Could B really be no better than A?Effect Δ = p_B − p_A
sa diff verdict
{"verdict":"better"}E = 24.93 vs threshold 20.00 · Unknown rate B 15.0% · cap 20.0%
| Naive Δ̂ (decisive pairs only) | +0.165 | |
|---|---|---|
| E-value | 24.93 | threshold 20.00 |
| sa diff verdict | Better | |
| Unknown rate B | 15.0% | cap 20.0% |
| Manski lower (worst for B) | veiled | |
| Manski upper (best for B) | veiled | |
| Interval contains 0 | veiled |
How to use this
Each tile is one matched pair: Policy A in the top-left half, Policy B in the bottom-right. Unknown: runner timed out marks a timeout. Drag “Resolve the fog” from worst to best for B and watch the imputed Δ slide between the Manski bounds. Deep link: ?preset=selective or ?preset=none.
Policy B times out on 15 of 100 tasks, all of them hard ones that A passed. The diff drops those 15 pairs. What happens to B's apparent advantage?
Which change broke it?
S7E10
Your AGENTS.md has 16 revisions. Revision 0 passes the handoff check. Revision 15 fails it. Somewhere in between, a change broke it. sa bisect finds it by halving, like git bisect.
Halving works when every probe tells the truth. An agent is not a compiler. A good revision may pass only 90% of the time and a bad one 30%.
One flaky probe, two searches
| probe | bisect rev | verdict | PBA rev | verdict | PBA MAP |
|---|---|---|---|---|---|
| 1 | rev-0 | Pass | rev-7 | Pass | rev-8 |
| 2 | rev-15 | Fail | rev-10 | Pass | rev-11 |
| 3 | rev-7 | Pass | rev-12 | Pass | rev-13 |
| 4 | rev-11 | Pass | rev-13 | Fail | rev-13 |
| 5 | rev-13 | Fail | rev-12 | Fail | rev-11 ↺ |
| 6 | rev-12 | Pass | rev-10 | Pass | rev-11 ↺ |
| 7 | rev-11 | Fail | rev-11 ↺ | ||
| 8 | rev-10 | Pass | rev-11 ↺ | ||
| 9 | rev-11 | Fail | rev-11 ↺ | ||
| 10 | rev-10 | Pass | rev-11 ↺ | ||
| 11 | rev-10 | Pass | rev-11 ↺ | ||
| 12 | rev-11 | Pass | rev-11 ↺ | ||
| 13 | rev-11 | Fail | rev-11 ↺ |
| Bisect bracket | [12, 13] | |
|---|---|---|
| Bisect result | Found { good_index: 12, first_bad_index: 13 } | |
| PBA most likely first bad | rev-11 (96.6%) | |
| PBA backtracks so far | 9 | |
| PBA result | Found rev-11 at 96.6% posterior | |
| PBA assumes | P(Pass | good) 90%, P(Pass | bad) 30% | |
| Bisect correct (1,000 replays) | 33.4% | confidently wrong 31.9% |
| PBA correct (1,000 replays) | 91.9% | mean 14.9 probes |
How to use this
Step through the probes. The calipers are the deterministic bracket: once a flaky verdict moves them past the regression, the true revision is outside for good. The bars are the probabilistic search's belief about where the regression is; a flip only shifts mass. Deep link: ?preset=flip or ?flake=0.15&qBad=0.3&seed=4.
Bisect probes the middle revision once. The revision is actually good, but the flaky agent fails it. What happens next?
Which rule matters?
S8E9
Take a bloated AGENTS.md with four sections: ## Git, ## Tools, ## Style, ## Testing. Suppose only Git and Testing actually help with this task. Try to find them by hand with the fewest runs. This is a hand-worked toy, not a real run.
- Run with all four. It passes, so there is something to shrink.
- Keep only the first half, Git and Tools. It fails: something needed is in the other half.
- Keep only Style and Testing. It fails too: the needed rules are split across both halves.
- Remove one quarter at a time. Without Tools: passes, so drop Tools. Without Style: passes, drop Style.
- Git and Testing remain, and removing either fails. That is 1-minimal: no single removal still passes.
That is Zeller's delta debugging, and sa shrink runs it over the units of your policy tree. It trusts every Pass. Now imagine step 4 passed by luck while Tools was actually needed.
Which rules in AGENTS.md actually matter?
ddmin (sa-core)
- 0AGENTS.md#GitACTIVE
- 1AGENTS.md#ToolsACTIVE
- 2AGENTS.md#StyleACTIVE
- 3AGENTS.md#TestingACTIVE
- 4AGENTS.md#PlansDEAD WEIGHT
- 5AGENTS.md#VoiceDEAD WEIGHT
- 6skill:rust-feedbackACTIVE
- 7skill:handoffACTIVE
Probe 24: kept {6} → Fail
ProbDD proposal, not in sa-core
- 0AGENTS.md#Git1.00
- 1AGENTS.md#Tools0.00
- 2AGENTS.md#Style0.00
- 3AGENTS.md#Testing1.00
- 4AGENTS.md#Plans0.00
- 5AGENTS.md#Voice0.00
- 6skill:rust-feedback1.00
- 7skill:handoff0.00
Probe 12: removed {3} → Fail
| step | kept_indices | verdict |
|---|---|---|
| 1 | {0, 1, 2, 3, 4, 5, 6, 7} | Pass |
| 2 | {} | Fail |
| 3 | {0, 1, 2, 3} | Fail |
| 4 | {4, 5, 6, 7} | Fail |
| 5 | {4, 5, 6, 7} | Fail |
| 6 | {0, 1, 2, 3} | Fail |
| 7 | {0, 1} | Fail |
| 8 | {2, 3} | Fail |
| 9 | {4, 5} | Fail |
| 10 | {6, 7} | Fail |
| 11 | {2, 3, 4, 5, 6, 7} | Fail |
| 12 | {0, 1, 4, 5, 6, 7} | Fail |
| 13 | {0, 1, 2, 3, 6, 7} | Pass |
| 14 | {0, 1} | Fail |
| 15 | {2, 3} | Fail |
| 16 | {6, 7} | Fail |
| 17 | {2, 3, 6, 7} | Fail |
| 18 | {0, 1, 6, 7} | Fail |
| 19 | {0, 1, 2, 3} | Fail |
| 20 | {0} | Fail |
| 21 | {1} | Fail |
| 22 | {2} | Fail |
| 23 | {3} | Fail |
| 24 | {6} | Fail |
| ddmin probes (this run) | 24 / 24 | budget_exhausted |
|---|---|---|
| ddmin probes for a full deterministic run | 48 | |
| ddmin result | {0, 1, 2, 3, 6, 7} | |
| ProbDD probes (this run) | 12 | |
| ProbDD result | {0, 3, 6} | |
| ddmin deleted a needed rule (200 runs) | 0.0% | baseline aborted 0.0% |
| ProbDD deleted a needed rule (200 runs) | 0.0% | exact set 100.0% |
How to use this
Each plate is one ablatable unit of the policy (six AGENTS.md sections, two skills). A probe runs the agent with only the bright plates. Raise the flake rate to see what one lucky Pass does. Lucky-pass rate is twice the flake rate here, so 15% gives the spec's 85% / 30% oracle. Deep link: ?preset=flake&budget=24.
Shrink removes the Testing section and the agent passes once. With a flaky agent, which mistake is more dangerous here?
How often may you ask?
E11
You wrote a grader, ran a diff, got Inconclusive. You tweak the grader's threshold and run again. And again. On the twentieth tweak, Better.
Each run was a fair 5% test on its own. Together they were twenty tickets in the same lottery, drawn on the same cuts. The data you tuned on cannot also be the data you prove on.
Tweak the grader twenty times
sa diff on the same cuts after each tweak, each at α = 0.05. Policies A and B are identical. If the tweaks were independent tests, how likely is at least one false Better or Worse?First replicate: one branch per tweak
| tweak | b / a | p | E | verdict |
|---|---|---|---|---|
| v1 | 9 / 15 | 0.307 | 0.51 | Inconclusive |
| Bound 1 − (1 − α)^m | 5.00% | upper bound under independence |
|---|---|---|
| Simulated naive FWER | veiled | 400 replicates |
| Fresh-α e-value FWER | veiled | sa diff per tweak |
| Bonferroni FWER | veiled | |
| e-BH FWER (= FDR under the null) | veiled | proposal |
| Dev winner confirmed on holdout | veiled | proposal |
How to use this
Every tweak re-scores the same 40 cuts under a true null, so any Better or Worse is false. Click “Run another tweak” or drag m. Then split the cuts: tune on dev, confirm once on the holdout vault, and control the family with e-BH. Deep link: ?m=20&protect=1.
You tweak a grader 20 times and run a 5% diff after each tweak, on the same cuts, when nothing really changed. Under independence, what is the upper bound on the chance of at least one false Better?