feat: calibrate.py — audit saturation meter + CI guardrail - #11
Merged
Conversation
Adds a distribution/saturation report over the plugin SOURCE inventory so 'not saturated' becomes a measurable, monitored property of the audit score. Reports overall stats (N/min/max/mean/median/stdev), a score histogram, band distribution, and the per-dimension max-out (saturation) rate. --check exits 1 when the scoring re-saturates (any dimension maxes out for >max-maxout-frac of plugins, or total-score stdev < min-stdev). Reuses score.py's stable schema and portfolio.py's source discovery; stdlib-only with a hermetic selftest. Wires the selftest into CI. Co-Authored-By: Claude Opus 4.8 <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.
What
Adds
scripts/calibrate.py, a saturation meter that makes "the audit is not saturated" a measurable, monitored property, and wires its selftest into CI.python3 scripts/calibrate.py [roots...]scores a set of plugin SOURCE roots (default: the same local inventoryportfolio.pysweeps; never read-onlycache/installs) and reports the score DISTRIBUTION:auto) scores.--check: exits 1 if the scoring looks re-saturated — any dimension maxes out for more than--max-maxout-frac(default 0.60) of plugins, or total-score stdev falls below--min-stdev(default 5.0). Prints which check failed.--json/--mdoutput modes; robust to a plugin that fails to score (skip + note).selftestsubcommand: hermetic temp-dir fixtures spanning the quality range; asserts the distribution stats and that--checkpasses on a healthy spread and fails on a degenerate all-max spread.Relies only on
score.py's stable schema (total.auto/total.max,dimensions[k].auto/.max) and reusesportfolio.py's source discovery. Stdlib-only.CI
Adds a
Calibrate selftest (saturation meter)step to.github/workflows/ci.yml. Existing steps (including thescore.py . --minfloor) are unchanged.Baseline reproduction
Over the current (unrecalibrated) scorer against
~/plugins/*(13 plugins):hooks_healthmaxes out for 92% of plugins,skill_quality0%, total-score stdev 6.78 — reproducing the measured saturation, and--checkcorrectly fails naminghooks_healthas the culprit.🤖 Generated with Claude Code