Gate: the newest period's reach rows must be what rule_reach.csv says now - #25
Merged
Merged
Conversation
… now rule_reach_history.csv is written by --append-history, an optional flag, and the file is committed — so a scan run without it leaves the previous run's rows present under the current period's label. rule_reach.csv moves, the history does not, and every reader of the history (the trend chart, the narrative claims) is happy with the stale row (#21). Both files are written from the same counts, so check_reach_history holds the newest period's rows to rule_reach.csv per rule (both columns, both directions), its corpus_size to snapshot.json's n_lectures, and share_pct to reach / corpus_size. Six mutations tested, all caught, including the real shape: scan re-run, --append-history not. Runbook and pass-measure now say the gate enforces the flag rather than asking people to remember it. The prevention half — making the flags mandatory in the scan — moves the checker digest and is bundled for the next detector change in #24. Closes #21 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds a new consistency-gate check to prevent publishing a stale rule_reach_history.csv “latest period” row when a scan is run without --append-history, and updates the runbook/skill docs to reflect that the gate now enforces this invariant (reach half of #21).
Changes:
- Add
check_reach_historytotools/qestyle_check.pyto hold the newest period’s history rows torule_reach.csvandsnapshot.json. - Update
UPDATE.mdandpass-measureskill text to document that--append-historyis effectively mandatory because the gate now fails on stale reach history rows.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
tools/qestyle_check.py |
Introduces the new reach-history gate check and wires it into main(). |
UPDATE.md |
Updates the runbook narrative + adds a new “Reach history” row to the consistency checks table. |
.claude/skills/pass-measure/SKILL.md |
Aligns the measurement skill instructions with the new enforced reach-history invariant. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
… and the message Co-Authored-By: Claude Fable 5 <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.
Closes #21 — the reach half; the score half landed in #23.
rule_reach_history.csvis written byqestyle_scan.py --append-history, an optional flag, and the file is committed. So a scan run without it does not leave the file absent — it leaves the previous run's rows present under the current period's label.rule_reach.csvmoves, the history does not, and everything that reads the history (the trend chart,check_narrative, the front page's trend sentence) is happy with the stale row.What changes
New
check_reach_historyin the gate. Both files are written from the same counts, so the newest period's history rows must equalrule_reach.csvper rule —lectures_affectedandtotal_occurrences, rule sets equal in both directions — itscorpus_sizemust besnapshot.json'sn_lectures, andshare_pctmust bereach / corpus_size. Green onmaintoday (35 of 35 rules agree). Runbook andpass-measurenow say the gate enforces--append-historyinstead of asking people to remember it.Verified
--append-historywas not run"rule_reach.csvcorpus_size≠n_lecturesrule_reach.csvabsentNot in this PR
Making
--period/--append-historymandatory in the scan (the prevention half) touchesqestyle_scan.py, which moves the checker digest and forces a re-measure of both periods. It is bundled with the other two scan-side changes in #24, to be taken with the next detector change. Checker digest unchanged here (aef064f3b260).🤖 Generated with Claude Code