Add copilot calibration measurement - #21
Merged
Merged
Conversation
Competitive research turned up the WOLF benchmark (arXiv:2512.09187), whose metrics suite scores werewolf-suspicion calibration with the Brier score. deepwolf is the only surveyed werewolf project with an explainable probabilistic copilot — so it is the only one that can report its own advisor's calibration back to the human relying on it. - new deepwolf/copilot/calibration.py: evaluate_copilot plays seeded games, collects the copilot's suspicions from every villager's viewpoint at each daybreak, pairs them with ground truth, and scores them. - CalibrationReport: exact Brier score, Brier skill score, the Murphy decomposition (reliability / resolution / uncertainty) and a reliability diagram; render() and to_markdown(). - new `deepwolf calibrate` CLI command with a --markdown export. - 14 new tests; calibration helpers exported from the package root. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Owner
Author
|
Code review (post-merge record).
The sample run is genuinely informative — it shows the copilot is well-calibrated mid-range but overconfident above 60%, which is a real, actionable finding. Merged via squash. |
2 tasks
JuneQQQ
added a commit
that referenced
this pull request
May 19, 2026
Follow-ups from a review of the copilot-calibration code (#21): - the reliability diagram now shows each bin's calibration gap (predicted minus observed) in render(), to_markdown() and the CLI table — it is the most informative number per bin and CalibrationBin.gap already computed it but nothing displayed it. - _score now builds the CalibrationReport in one place: n_games / n_players are threaded in rather than patched onto the object by the caller. - evaluate_copilot's docstring notes that calibration is measured against games played by agent_factory, so results depend on the agents used. Co-authored-by: JuneQQQ <june1243134432@gmail.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
This cycle's competitive research → innovative increment.
Research. The WOLF benchmark (arXiv:2512.09187, Dec 2025) scores
werewolf-suspicion calibration with the Brier score. deepwolf is — in the
surveyed literature — the only werewolf project with an explainable
probabilistic copilot. So it is uniquely able to do something no competitor
can: report its own advisor's calibration back to the human who relies on it.
Shipped. A
deepwolf calibratecommand anddeepwolf.copilot.calibration:surviving villager's seat — for its suspicions, and pairs each with ground
truth (was that player really a werewolf);
base-rate forecaster), the Murphy decomposition (reliability / resolution
/ uncertainty) and a reliability diagram.
Sample run (60 games, 7 players): Brier 0.206 vs baseline 0.226 — skill 0.087;
reliability 0.001 (the copilot is well-calibrated in the mid-range: it says 33%
and 34% turn out wolves, says 50% and 50% do) but slightly overconfident above
60%. The tool surfaces exactly that kind of finding.
Checklist
ruff/mypy/pytest(81 tests, 14 new) all passNotes for reviewers
Predictions are collected via the engine's
observerhook atDAY_BREAKS— noengine change needed. Only village-aligned viewpoints are scored (the copilot's
deductive job is a villager's job). The Murphy decomposition is the binned
approximation; the headline Brier score is computed exactly from the raw pairs.