Skip to content

test(escalation): Wilson intervals, exact McNemar and bootstrap Spearman in the aggregate - #41

Merged
rudi193-cmd merged 2 commits into
masterfrom
feat/escalation-intervals
Sep 30, 2026
Merged

rudi193-cmd merged 2 commits into
masterfrom
feat/escalation-intervals

Conversation

@willows-bot

@willows-bot willows-bot Bot commented Sep 30, 2026

Copy link
Copy Markdown

Bite

The escalation aggregate reports every rate with its Wilson 95% interval and gains the two statistics the pre-registered grading rule grades on: exact McNemar for paired models and a bootstrap Spearman over models. Stdlib only; no existing number changes.

What was done

  • benchmarks/escalation/aggregate.py: *_ci (Wilson, z = 1.96) beside task score, false-confidence, over-escalation and unparseable rates, in both md and json output.
  • --pair A B: exact two-sided McNemar on discordant items only, restricted to unanswerable items both models parsed without error. Reports b, c and p.
  • --rank: Spearman between task score and false-confidence rate across models (average-rank ties). Bootstrap 95% interval, 10,000 resamples, --seed default 0. Needs at least 3 non-constant models, otherwise it reports none.
  • _stats appears only when --pair or --rank is passed; existing fields are unchanged.
  • tests/test_escalation_runner.py: Wilson against textbook values, McNemar against hand-computed b/c, a seeded bootstrap, and a mixed-fixture test pinning the unanswerable-only filter.

Evidence

Out of scope

  • Any existing score or its definition; fixtures; runner.

Next bite

Real runs of step 2b across the local ladder once the models are pulled (willow-mcp #693), graded under the sealed rule.

Decision

  • Graded under the pre-registration sealed before any real run (pair 0addc7f9): each forecast resolves HIT, MISS or UNRESOLVED on its interval. P1 uses the Wilson lower bound, P2 McNemar at p < 0.05, P3 the bootstrap upper bound.
  • Origin: a reader's comment on the DEV post about interval width, paired tests and bootstrap over models.

Ratified-by: sean-campbell — "ratify all"

🤖 Generated with Claude Code

https://claude.ai/code/session_01Vcntd3qgAxd6gnPEvVukVm

rudi193-cmd and others added 2 commits September 30, 2026 11:53
…man in the aggregate

Each rate (task score, false-confidence, over-escalation, unparseable) now
carries its Wilson 95% interval (z = 1.96) in the JSON cell and as extra
trailing table columns. --pair A B runs an exact two-sided McNemar on the
discordant shared unanswerable items and reports b, c and p. --rank reports
Spearman between task score and false-confidence rate across models with a
10,000-resample bootstrap interval over models (--seed, default 0). Stdlib
only; no existing field or score changes.

Persona: hanuman
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vcntd3qgAxd6gnPEvVukVm
The two McNemar tests used unanswerable-only fixtures, so dropping the
answerable filter in _unanswerable_outcomes left them green. Add a pair
fixture mixing answerable items on which the models split: counting them
would move b 5->8, c 1->2, n_shared 12->16 and p 14/64 -> 112/1024.

Persona: hanuman
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vcntd3qgAxd6gnPEvVukVm
@rudi193-cmd
rudi193-cmd merged commit 0646a85 into master Sep 30, 2026
17 checks passed
@rudi193-cmd
rudi193-cmd deleted the feat/escalation-intervals branch September 30, 2026 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant