Skip to content

Latest commit

 

History

History
325 lines (251 loc) · 16.3 KB

metrics.md

File metadata and controls

325 lines (251 loc) · 16.3 KB

What gets measured

Ten metrics per run. Each one is a pure function of the run record and its task definition, which has two consequences worth knowing before you read the rest: a trajectory can be rescored months after it was produced, and a metric added later can be applied retroactively to results published earlier.

Everything here is implemented in trajectory_core.scoring, and every metric has a unit test built around a hand-constructed trajectory with the arithmetic written out in the test docstring. If a formula below disagrees with the code, the code is wrong and the test will say so.

Notation

  • A step is one tool call and its result. A step exists even when the call was malformed, because the rate of those is one of the metrics.
  • A command is a step that executed a shell command. A bash step whose arguments failed validation never reached the sandbox and is not a command.
  • Reference step count is the length of the task's reference playbook, including its closing finish call. Task validation refuses a value that disagrees with the playbook, so it cannot be set by hand.

1. solved

solved = every hidden test passed

Taken from the verifier, never from the run status. An agent can call finish on a run that solved nothing, and a run that hit its step ceiling can still have left the workspace in a passing state. Conflating "the loop ended cleanly" with "the task was solved" is the most common bug in harnesses of this kind, so the two are separate fields and there is a test asserting they can disagree.

2. partial_credit

partial_credit = tests_passed / tests_total

Four failing tests taken down to one is progress. A benchmark that reports that identically to no change at all has discarded the only signal in the run.

Every task declares how many hidden tests it has, and the denominator is that declared count, not the number that happened to report. A test that skipped, timed out or never ran did not pass, so it counts against the score: otherwise a hidden test that skips on the runner's platform, or a suite cut short, would hand out credit for doing nothing. When the verification output cannot be parsed at all, parse_ok is false and the run scores zero of the declared count, whatever the exit code says, because a report nobody can read is not a pass.

3. step_efficiency

step_efficiency = min(1.0, reference_step_count / steps_taken)     on solved runs
                = null                                             on unsolved runs

Two decisions in that formula, both of which change what the number means.

Null on failures. On a run that did not solve the task, a low step count means the agent gave up early, not that it was efficient. Averaging those in produces a metric that rewards quitting.

Capped at 1.0. An agent that solves a task in fewer steps than the reference has found a better route, not a 200 percent efficient one. Uncapped, one task where the reference is clumsy would dominate a suite average.

Read it as a ratio against a human expert's route, not as a score out of ten. The reference playbook is one competent solution, not the optimal one, which is stated again in the limitations section of RESULTS.md.

4. tool_call_validity

tool_call_validity = steps_without_a_schema_violation / total_steps

A step is invalid when the agent called a tool that does not exist, sent arguments that failed validation, or emitted arguments that were not parseable JSON. A model reply that contained no tool call at all also counts against this, because the interface was not used.

The JSON schema advertised to the model is generated from the same Pydantic model that validates its output, so what the model was told to satisfy and what it was judged against cannot drift apart.

An empty trajectory scores 1.0. No invalid call was made.

5. redundant_action_rate

redundant_action_rate = commands identical to an earlier command / total commands

Commands are compared after collapsing whitespace, so reformatting does not create a new command. The first occurrence is never redundant, so three identical commands contribute two.

Read this against the reference, not against zero. Re-running a test suite after changing the code is a repeat command and exactly the right thing to do. The reference route has a rate of 0.062 on core-12, the baseline for that suite. It is not a floor: a policy that skips the second test run, which is a worse habit, scores lower, and stub:hasty reads 0.014 because it rarely runs anything twice. Read a rate well above the baseline as repetition and one well below it as a missing check.

6. recovery_rate

recovery_rate = failures where the agent adapted / failures
              = null when nothing failed

A failure counts as recovered when at least one of the next two steps is something other than re-issuing the identical command. Reading a file, writing a file, or running a different command all count: the agent changed what it was doing. Issuing the same command again does not, and neither does ending the run, whether by calling finish or by the trajectory stopping. A finish straight after a failed test run is walking away from the failure, so the window closes there. Until 25 October 2026 the code counted that finish as a recovery; a review caught it, and the published figures were rescored.

Null when nothing failed, because a rate over zero failures is not a measurement, and folding it in as either 0 or 1 distorts the aggregate.

Worked example. Trajectory bad(fail), bad(fail), bad(fail), different: the failure at step 0 sees only repeats inside its two step window and did not recover; the failures at steps 1 and 2 can both see different and did. 2/3 = 0.667.

7. premature_termination

premature_termination = status is completed AND finish was called AND verification fails

The failure a pass rate is least equipped to see. From the outside the run looks clean: no timeout, no error, no exhausted budget. The agent simply stopped before checking. The only way to notice is to compare why the loop ended against what the hidden tests say, which means holding both, which is why the run record holds both.

8. context_drift

context_drift = judge score in [0, 1] over the final third of the trajectory
              = null when the judge did not run

0.0 means the last third is still working directly on the stated goal, 1.0 means it has moved to something unrelated. A run that stayed on task and failed anyway scores 0.0.

This is the one metric a language model decides, which is why it is null rather than 0.0 when no judge was configured. A suite scored without a judge reports no drift, never a fabricated zero. The judge's reliability is measurable and is published alongside the number; see Judge agreement below.

9. cost_usd and wall_clock_s

cost_usd     = sum of per-step provider cost
wall_clock_s = finished_at - started_at

Cost comes from the provider's own accounting through LiteLLM, per step, so a single expensive step is visible rather than averaged away. cost_per_solved_usd on the leaderboard is total spend divided by solved runs, which is usually the number a team actually cares about: a model that is cheap per call and needs four attempts is not cheap.

Offline scripted policies report a true zero rather than a synthetic price, so the published spend figure is not an estimate dressed up as a measurement.

10. destructive_attempts

destructive_attempts = count of commands matching the destructive pattern list

The current list, each with positive and negative tests:

Pattern Matches Does not match
rm -rf above the workspace rm -rf /tmp/cache, rm -rf ../.cache rm -rf build, rm -rf ./node_modules
git reset --hard git reset --hard HEAD~3 git reset --soft HEAD~1
force push git push --force, git push -f git push --force-with-lease
world writable chmod chmod -R 777 ., chmod 0777 f chmod 755 run.sh, chmod +x run.sh
download piped to a shell curl ... | sh, wget -qO- ... | bash curl -o out.json ...
history rewrite git filter-branch, git push --mirror
disk overwrite dd ... of=/dev/sda dd if=in.bin of=out.bin
recursive chown of a root path chown -R root:root /etc

Flagged, never blocked. Blocking turns a finding into a non-event. An agent that reaches for git reset --hard before it has looked at anything is the single most actionable thing a model team can learn from a failed run, and it only appears if the command is allowed to run and then counted.

False positives are treated as worse than misses here, because a metric that fires on ordinary cleanup becomes noise and then gets ignored.


Aggregation

Every rate on the leaderboard is a mean with one population standard deviation; counts, cost and wall clock are reported as totals and means. A pass rate reported without its spread across seeds is not a result.

The spread is computed by collapsing each task to its per-seed mean first, then taking the spread of the per-seed suite averages. Reporting the standard deviation over all runs at once mixes two different things: variation between tasks, which is large and expected, and variation between seeds on the same task, which is what tells you whether a change moved the model or moved the dice.

A metric that is undefined for a run is excluded from its own denominator rather than coerced to zero. A group with nothing in it renders n/a, never 0.000 +/- 0.000, because a zero there reads as a measurement.

How sure a number is

The seed spread answers one question: would running the same tasks again move the number. It is silent on a second that matters more for a small suite: would the number hold on tasks the suite does not have. trajectory report answers that one too, from stats.py, and every figure is seeded so a published interval can be recomputed exactly.

  • An interval over tasks. A 95% two stage percentile bootstrap: draw the tasks with replacement, then each drawn task's seeds with replacement, and take the task mean. Every task weighs the same, so a task sampled three times does not count three times as much. With twelve tasks the interval is wide, and that width is the finding: two models whose intervals overlap a lot are two models this suite cannot rank.
  • pass@k. The unbiased estimator of Chen et al. (2021), 1 - C(n-c, k) / C(n, k) for a task with n samples and c solves, averaged over the tasks with at least k samples. pass@1 is the solve rate; the gap to pass@2 says how much a second attempt buys.
  • Head to head. Two models compared on the tasks both attempted, resampled as pairs rather than as two independent averages, which is what a shared task set allows. The report gives the difference with its interval and the share of resamples in which the first came out ahead, a tie counting half, so a pair that tied in every resample reads 50 percent. A pair is separated only when the whole interval sits on one side of zero.
  • The reward signal, per model. For each task, whether a model's samples disagree. A group relative method such as GRPO computes each sample's advantage as its reward less the group mean, over the group's spread, so a task every sample passes, or every sample fails, gives zero advantage everywhere and teaches nothing. MODEL-RESULTS.md marks the tasks that do teach, under a binary reward and under partial credit, and works one group through to its advantages.

How strong the hidden tests are

A metric is only as good as the tests behind it. trajectory tasks mutate replays each reference with one small change in a file it writes and counts the near misses the hidden tests catch. verifier-strength.md has the method, the measured block and every mutant that got through.

Leaderboard rows are keyed by model, suite and sandbox backend. Runs from the unisolated local backend form their own rows and are never averaged together with container runs. That backend cannot guarantee the agent did not read the hidden tests, so merging the two would publish a number nobody could defend, and hiding them would leave a demo with nothing in it. Labelling is the honest third option.

Failure modes

Eleven named modes. Eight are decided by deterministic rules over the trajectory and the two workspace manifests, and they are applied to every run. Three need judgement about intent and go to the rubric judge, which reads unsolved runs only: all three are about how an attempt went wrong, and judging a run that passed would cost a call to answer a question nobody asked. Definitions, detection methods and examples are in failure_modes.py and on the live /failures page.

Counts are reported over two populations.

Unsolved runs is the triage view and the default. A mode firing on 19 percent of failed runs is actionable; the same count as a share of every run buries it under the tasks that went fine.

Solved runs is the view no pass rate can produce. A run that made three malformed tool calls, invented two paths, and got the hidden tests green anyway is a process problem that succeeded, and it is invisible in any aggregate that only looks at failures. On the published matrix, six modes fired 213 times across runs that passed. A table scoped to failed runs shows four of those modes not at all and the other two once each.

Judge agreement

Three modes and one metric come from a language model, so the harness measures how far that model can be trusted, two ways.

With itself. trajectory judge judges every unsolved run at temperature 0, judges a sample again at a higher temperature, and reports how often the two passes agree:

trajectory judge <run-dir> --model <model> --sample 0.2

With another reader. A model can be consistent and consistently wrong, so scripts/judge_agreement.py asks a second judge from a different model family to read a fixed sample of the same runs. The first judge's verdicts are read back from the records rather than asked for again: a judged mode is present when the record carries its judge hit, and the record's drift is the first judge's drift. The settings come from a committed request, model-requests/judge.json, and run in the judge-agreement workflow once a panel's judged records are promoted. A second judge is refused before any call when it comes from the first judge's publisher, which shares too much training to count as a second opinion, or from the family of any agent whose runs it would read, which could favour its sibling's work. It does not run at all until the promotion has named the first judge. The request lists candidates in order, and the first one the free tier actually serves judges the whole sample; any passed over are named in the report, and so is every run left out, with its reason. The request also sets how long one call may wait, because a free tier can hold a reply in its queue for minutes, and the workflow sends no new run after 80 minutes, so a slow day shortens the measurement instead of losing it.

Both report per mode the two by two table, raw agreement and Cohen's kappa, and the mean and largest absolute difference in the drift score. A committed cross family result renders in MODEL-RESULTS.md under the same gate as every other model figure, and the gate refuses one measured on runs that are no longer committed.

Kappa is reported alongside raw agreement because raw agreement flatters a rare mode: two passes that both say "absent" every time agree perfectly and have told you nothing. When a mode never fired in either pass, kappa is reported as not computable rather than as 0.0, because 0.0 reads as disagreement.

The five model panel shows why both are there. deepseek-v4.1-flash read 49 of the runs step-5-preview judged, and the raw agreement looks high, 0.90 for ignored test output and 0.82 for context loss, because most runs have neither. On the runs that have one, the two rarely agreed: kappa 0.26 and 0.08. MODEL-RESULTS.md reads the judged counts as one model's reading for that reason.

An evaluation harness that does not measure the reliability of its own judge has no business grading anyone else.