From aa10288ddc39d502869b87bd8fed1a15b94467dc Mon Sep 17 00:00:00 2001 From: le king fu Date: Sat, 24 Oct 2026 17:20:35 -0400 Subject: [PATCH] test(scripts): pin the Release row with two offline probes in --check (#462) The review of #498 left mutation M4 green: the same typo in the Haut table and in HIGH_ALWAYS (`.claude/skills/release/script/**`) passed --check, and the replay could not see it, since every PR of the range that touches verify-release.sh also touches release.yml. --check now also runs PROBES, a path and its expected level: verify-release.sh must come out haut and SKILL.md normal. M4 fails on the first probe, the old pattern restored on both sides fails on the second, and the same M4 with PROBES emptied passes again. REVIEW.md says what --check verifies. A probe per pattern of the table goes to #476 (decision of Max, /pr-brief 498). Co-Authored-By: Claude Opus 5.5 --- REVIEW.md | 2 +- scripts/review-levels.py | 26 +++++++++++++++++++++----- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/REVIEW.md b/REVIEW.md index 0bbd5ed..2084ef6 100644 --- a/REVIEW.md +++ b/REVIEW.md @@ -68,7 +68,7 @@ Tout le reste : code applicatif et tests, traductions (`src/i18n/locales/*.json` | 39 PR de référence, ces motifs | 3 | 28 | 8 (21 %, pour une cible de 20 %) | | 52 PR de la plage, ces motifs | 6 | 34 | 12 (23 %) | -Niveau haut sur les 52 : licence (#359, #364, #366, #368, #386, #387, #388), migrations et profils (#394, #436), release (#414, #416, #418) ; parmi les 39 de référence, #386, #387, #388, #394, #414, #416, #418 et #436. L'écart à la cible est justifié dans la PR qui ferme #456, qui consigne aussi le niveau de chaque PR. Le script qui les calcule est `scripts/review-levels.py` (API Forgejo, lecture seule) ; `python3 scripts/review-levels.py --check` vérifie, sans réseau, que ses motifs sont ceux du tableau Haut. +Niveau haut sur les 52 : licence (#359, #364, #366, #368, #386, #387, #388), migrations et profils (#394, #436), release (#414, #416, #418) ; parmi les 39 de référence, #386, #387, #388, #394, #414, #416, #418 et #436. L'écart à la cible est justifié dans la PR qui ferme #456, qui consigne aussi le niveau de chaque PR. Le script qui les calcule est `scripts/review-levels.py` (API Forgejo, lecture seule) ; `python3 scripts/review-levels.py --check` vérifie, sans réseau, que ses motifs sont ceux du tableau Haut et que ses sondes donnent le niveau attendu : `.claude/skills/release/scripts/verify-release.sh` haut, `.claude/skills/release/SKILL.md` normal. Une même faute de frappe dans le tableau et dans le script passerait la comparaison, et le rejeu ne la verrait pas sur la ligne Release : chaque PR de la plage qui touche `verify-release.sh` touche aussi `release.yml`. Deux lignes du tableau Haut sont assouplies par #462, après deux niveaux que le pilote #458 a jugés trop hauts. La ligne Release ne désigne plus que `.claude/skills/release/scripts/**` : #450, qui ne touchait que `SKILL.md`, est la seule PR de la plage qui change de niveau (haute, puis normale), et les 51 autres gardent le leur (6/33/12, comme au 2026-10-17). La ligne Vie privée ne compte plus le texte d'une ligne du Journal dans ce qu'un appel envoie : #491, jugée haute à sa revue pour ce seul motif, est hors de la plage, et le script, qui ne modélise pas cette condition, la classait déjà normale. Comme toute règle de ce fichier, les deux valent pour les PR relues après leur merge : le relevé du pilote garde le niveau calculé à la revue de #450 et de #491. diff --git a/scripts/review-levels.py b/scripts/review-levels.py index 940b1be..470ee1b 100755 --- a/scripts/review-levels.py +++ b/scripts/review-levels.py @@ -11,8 +11,9 @@ with its trial level (pilot document, section 4.3) and its REVIEW.md level, then the distributions for the 39 reference PRs and for the whole range (a set with no PR in the range is skipped). --check compares the patterns of this script with the first column of the -Haut table of REVIEW.md and exits 1 if they differ: a PR that changes the -Niveaux section updates this script in the same diff. +Haut table of REVIEW.md, runs the offline PROBES (a path and its expected +level), and exits 1 on any difference: a PR that changes the Niveaux +section updates this script in the same diff. The content conditions of the Haut table are approximated from the diff: lib.rs (only generate_handler![] entries are exempt), Tauri configuration @@ -333,9 +334,18 @@ CONDITIONAL = { ".forgejo/workflows/{check-rust,check-frontend}.yml", "REVIEW.md", } +# Offline probes run by --check. A typo shared by the Haut table and the +# script passes the pattern comparison, and the replay cannot see it on the +# Release row: every PR of the range that touches verify-release.sh also +# touches release.yml (review of #498, mutation M4). +PROBES = [ + (".claude/skills/release/scripts/verify-release.sh", "haut"), + (".claude/skills/release/SKILL.md", "normal"), +] + def check(): - """Compare this script's patterns with the first column of the Haut table.""" + """Compare this script's patterns with the first column of the Haut table, then run PROBES.""" text = open(REVIEW_MD, encoding="utf-8").read() table = text.split("### Haut", 1)[1].split("\n\n", 2)[1] documented = set() @@ -347,9 +357,15 @@ def check(): for label, extra in (("REVIEW.md only", documented - coded), ("script only", coded - documented)): for pattern in sorted(extra): print(f"{label}: {pattern}") - if documented != coded: + failed = documented != coded + for path, want in PROBES: + got = review_level(0, [{"filename": path, "status": "changed"}], "", None)[0] + if got != want: + print(f"probe: {path} is {got}, expected {want}") + failed = True + if failed: return 1 - print(f"ok: {len(coded)} patterns, identical to the Haut table of REVIEW.md") + print(f"ok: {len(coded)} patterns, identical to the Haut table of REVIEW.md; {len(PROBES)} probes") return 0