fix(gate): the plan-code guard catches decision codes, and the purge takes them

A plan's decision ids (`D1`, `D4`, `D6-A`) cited in 11 comments and test titles named a document
no reader of this repo has, and the guard had no pattern for them. It has now (mirrored in
audit_metrics), with cases for each form the citations took and for the look-alikes it must leave
alone (a JPEG marker, "3D"); the 11 lines say their why without the id. Case test seen red without
the pattern, the scan red on a planted `D9:`.
This commit is contained in:
2026-10-05 03:16:13 +02:00
parent 8c79590165
commit 2768ab5bdd
12 changed files with 27 additions and 21 deletions
+5 -4
View File
@@ -27,12 +27,13 @@ BIG_FILE = 800
BE_COMPLEXITY = 10 # ruff's C901 default
FE_COMPLEXITY = 20 # the frontend's line
# planCodes.contract.test.ts's definition, copied: an epic, roadmap item, sprint or phase code, or a
# review round; NOT_CODES are its named exceptions, cut first (TV episode notation, a fixture's
# season or episode title, ruff's default `E4/E7/E9`). ASCII, because JavaScript's `\b` is.
# planCodes.contract.test.ts's definition, copied: an epic, roadmap item, sprint, phase or decision
# code, or a review round; NOT_CODES are its named exceptions, cut first (TV episode notation, a
# fixture's season or episode title, ruff's default `E4/E7/E9`). ASCII, because JavaScript's `\b` is.
NOT_CODES = re.compile(r'\bS\d{1,2} ?·? ?E\d+|\btitle[=:] ?"[ES]\d{1,2}"|\bE4/E7/E9\b', re.ASCII)
PLAN_CODE = re.compile(
r"\b(?:E\d{1,2}(?:\.\d+)?|R\d{1,2}|S(?!3h\b)\d{1,2}(?:[a-z]\d?)?|P\d)\b|\b[Rr]ound[ -]\d|deep-review",
r"\b(?:E\d{1,2}(?:\.\d+)?|R\d{1,2}|S(?!3h\b)\d{1,2}(?:[a-z]\d?)?|P\d|D\d{1,2})\b"
r"|\b[Rr]ound[ -]\d|deep-review",
re.ASCII,
)
NARRATION = re.compile(r"\b(used to|no longer)\b", re.IGNORECASE)