Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions dokimi/docs/evaluating-treatments.md
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,56 @@ The same rules hold for skills, MCP tools and plain function tools.
[Tool preference](tool-preference.md)). Use the proxy to find and rank changes,
then confirm the ones you ship on the real harness with a pinned listing budget.

### Measure invocation before the effect

In these runs a skill helped only when the agent loaded it. Report how often it was invoked, and
split the outcome by invoked and not invoked: the arm mean hides the split. "Done
right" means the verifier passed and the task's required steps were kept (in the
toy task: the check ran, the changelog entry was written, nothing was committed).
In the toy skill-selection series with haiku-4-5, all 11 runs that invoked the skill
were done right, and none of the 25 that did not invoke it were. On two real tasks
the split was 5 of 9 against 0 of 9 (Fisher p = 0.03). A skill removes uncertainty
about the procedure; what it leaves is whether it gets selected. In the toy repeat
series haiku invoked the skill in 0 to 3 of 6 runs per arm, and sonnet in 6 of 6 runs,
so the gap showed up with haiku only.

Where the pointer lives decides whether it is seen. A one-line pointer to the skill
in the repo's `CLAUDE.md`, which the harness loads at the start of every session,
took invocation from 2 of 12 to 12 of 12 (toy task, p = 0.0001). The same line in
`README.md` had no effect, but that test was nearly empty: the agents opened
`README.md` in at most 1 of 12 runs and never reached the line. A file the harness
loads at session start is in context every time; a document the agent has to choose
to open may not be opened at all. Check the trace for the read before counting a
pointer as a treatment.

The wording of the skill's description matters too. A trigger-heavy description
("MUST use for ANY change, bug fix, or edit in this repo") raised invocation from 2
of 12 to 7 of 12 (p = 0.087), and done right by the same count (p = 0.096). That is
directional at this size.

A gate does not depend on invocation. A Stop hook that blocks the stop until the
repo's procedure is met gave haiku 5 of 6 done right in the repeat series, against
0 of 6 with a script-only skill (permutation p = 0.015); across the three toy series
14 of 18 hook runs were done right. On the rename task the hook was done right in 5
of 12 runs, against 0 of 12 with no guidance (p = 0.037). In the degrade rerun with the hook path fixed, it was
5 of 6 against 0 of 7 (p = 0.005). Pooling the rename runs with that rerun gives 10 of 18 against 0 of 19
(p < 0.001). Against the prose skill the hook was not clearly better: rename 5 of 12
against 2 of 12 (p = 0.37), degrade 5 of 6 against 3 of 6 (p = 0.55), pooled 10 of 18
against 5 of 18 (p = 0.18). So the hook beats no guidance on both real tasks, and a
Comment on lines +739 to +743

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current PR description identifies both runs. The initial hook failed silently in four of six runs. The fixed-path rerun supplied 5/6 versus 0/7 and contributed those counts to the pooled 10/18 versus 0/19.

prose skill vs the hook is not shown either way.

Before you credit a gate, check that it fired. A hook that passes leaves no trace.
`trace consistency` records `Stop hook feedback` as a failed `Hook:Stop` step
([run-consistency.md](run-consistency.md)). A standalone `stop-hook-error` notification appears as a failed
`Hook:Stop-error` step. Use the step kind to distinguish a hook error from a blocked stop. Write hook commands with `"$CLAUDE_PROJECT_DIR"` in the path so
they work after the agent changes directory. In the first degrade run a relative
path failed silently (exit 127, not blocking) in 4 of 6 runs after the agent
changed directory.

All of this is haiku-4-5 on one toy task and two real tasks, with 6 runs per toy
cell and at most 12 per real cell. The comparisons are not corrected for multiple
tests. Treat the numbers as directional.

## Comparing cells across runs

One treatment measured over several models is many artifacts, one per cell. Two tools read
Expand Down
26 changes: 26 additions & 0 deletions dokimi/docs/run-consistency.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,17 @@ timed out or was cut off) counts as failed without `--outcomes`, so it cannot dr
out of the pass rate; the table shows `runs` and `judged`. A key may spell the trace's path any way that resolves to the same file: as given on the command line, as an absolute path, or through a symlink or `..`. A file name or stem that two traces share (`base/1.jsonl`, `skill/1.jsonl`)
is refused: key those by full path. Two keys that spell one trace's path with different verdicts are refused.

The harness result is not a verdict. In the toy series the harness reported
`success` in all 96 runs, yet only 40 of 96 were done right, so a result-only score
could not tell the arms apart. On the real tasks, the verifier recorded 33 runs that failed
the procedure. In 25 of those runs, the agent reported that the procedure passed. Agents also report a check as passed after
running a weaker one: in the haiku toy series, 10 of 36 non-hook answers said the
tests passed after `pytest` alone, never the repo's `make check`. In the haiku
fault series, after a transient pytest failure, 5 of the 18 runs without a hook
switched to ad-hoc `python -c` checks and reported success, and none of the 24 runs
(all arms) said the test run had failed. Write the verdict
with a script that runs the repo's checks itself, and pass it with `--outcomes`.

## Strategies

A task with two valid routes would read as unstable if every pair of runs were
Expand Down Expand Up @@ -181,6 +192,21 @@ removed: the tool choice (`mix_jsd`), the order (`order_distance`), the targets
(`action_distance`), the failure handling (`last_ok`, failed calls) or the
final check (`after_last`).

Path distances can be noisy in small samples. In the toy repeat series, the
haiku cell with a script skill had an `order_distance` of 0.18 and a bootstrap
95% interval of 0.06 to 0.29 over six runs. To compare cells, estimate their
difference in `order_distance` with an interval or a test that follows the
experimental design. Each run contributes to several distances, so resample
whole runs for independent cells and resample matched run pairs together for a
paired design. Recompute each cell's distance and their difference in each draw.

Paraphrasing the prompt raised the order distance on the toy task (haiku: 0.18
to 0.40 in the repeat series, 0.53 to 0.62 paraphrased, p = 0.0002). The effect
did not replicate on the two real tasks (−0.04, p = 0.18). The toy cell with the
lowest order distance (0.18) had 0 of 6 runs done right. For small pass-rate
samples, report a Wilson interval. The 95% intervals for 0 of 6 and 6 of 6 are
0% to 39% and 61% to 100%, respectively.

Background: *Towards a Science of AI Agent Reliability*
(arXiv:2602.16666) for the outcome / trajectory-distribution /
trajectory-sequence / resource split; *Consistency as a Testable Property*
Expand Down
Loading