From 1b9fa5778619cfd3c4c006d500270dea901eb188 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 12 Nov 2026 19:07:03 +0000 Subject: [PATCH 1/2] Mirror the withdrawn-claims guard fixes from ad-res-j7 #5134 Wrapped corrections and negated verbs are no longer flagged; 'written off' is caught again; box rows in fenced diagrams are joined only when one continues the other, with borders dropped; the prefilter treats box borders as spacing and leaves spaces inside character classes alone. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01RDB1UaJwokY8cw2E1M2fvp --- docs/strategic/WITHDRAWN_CLAIMS_REGISTER.json | 18 ++++++---- scripts/check_withdrawn_claims.py | 35 ++++++++++++++++--- 2 files changed, 41 insertions(+), 12 deletions(-) diff --git a/docs/strategic/WITHDRAWN_CLAIMS_REGISTER.json b/docs/strategic/WITHDRAWN_CLAIMS_REGISTER.json index 4a80c37..a520c7a 100644 --- a/docs/strategic/WITHDRAWN_CLAIMS_REGISTER.json +++ b/docs/strategic/WITHDRAWN_CLAIMS_REGISTER.json @@ -1,7 +1,7 @@ { "description": "Claims that were withdrawn or refuted after verification. scripts/check_withdrawn_claims.py fails any pull request that adds a line repeating one of them. A line is allowed when it cites the claim as withdrawn or corrected (see allow_line_markers), or sits on a verbatim or archive path (see allow_paths). Each claim carries must_match and must_not_match. The script refuses to run when a pattern misses a must_match form or matches a must_not_match correction. Add a claim here the day it is withdrawn, with both lists.", - "updated": "2026-11-03", - "mirror_of": "cogpy/ad-res-j7 docs/strategic/WITHDRAWN_CLAIMS_REGISTER.json (2026-11-03). ad-res-j7 is canonical: add claims there first, then copy.", + "updated": "2026-11-12", + "mirror_of": "cogpy/ad-res-j7 docs/strategic/WITHDRAWN_CLAIMS_REGISTER.json (2026-11-12). ad-res-j7 is canonical: add claims there first, then copy.", "allow_line_markers": "(?i)withdrawn|refuted|\\bfalse\\b|corrected|correction|superseded|do not plead|don.t plead|do not cite|do not repeat|not established|\\bnot a director|struck|~~|⛔|if .{0,20}does(n.t| not) use|not (?:shown to be )?an extraction", "exemption_must_not_match": [ "The R10.6M extraction was restated by counsel." @@ -390,14 +390,16 @@ }, { "id": "rwd-7700-2887676-aje", - "pattern": "(?i)2,887,676\\.80[^\\n]{0,60}(written|to zero|to nil|→ ?0|to R0)|\\bwritten (?:down )?to (?:zero|nil|R0)\\b(?:(?!\\d{1,3}(?:,\\d{3})+\\.\\d{2})[^\\n]){0,120}2,887,676\\.80", + "pattern": "(?i)2,887,676\\.80[^\\n]{0,60}(written|to zero|to nil|→ ?0|to R0)|\\bwritten (?:off|(?:down )?to (?:zero|nil|R0))\\b(?:(?!\\d{1,3}(?:,\\d{3})+\\.\\d{2})[^\\n]){0,120}2,887,676\\.80", "must_match": [ "| RWD finished goods written to zero (FY2020 AJE — different year, genuinely additive) | R2,887,676.80 | Strong (this audit, Appendix C) |", - "RWD 7700/000 Finished Goods: R2,887,676.80 written down to R0" + "RWD 7700/000 Finished Goods: R2,887,676.80 written down to R0", + "RWD finished goods were written off: R2,887,676.80." ], "must_not_match": [ "The AJE wrote RWD finished goods of R141,163.95 to nil; R2,887,676.80 is in the first column pair.", - "written to zero: R141,163.95 (the R2,887,676.80 sits in the first column)" + "written to zero: R141,163.95 (the R2,887,676.80 sits in the first column)", + "Finished goods written off: R141,163.95; the R2,887,676.80 is the opening balance." ], "correction": "RWD's FY2020 AJE wrote 7700/000 Finished Goods of R141,163.95 to nil; R2,887,676.80 is in the workbook's first column pair.", "withdrawn": "2026-10-27", @@ -448,7 +450,7 @@ }, { "id": "r10-6m-extraction", - "pattern": "(?i)(?:extract\\w*|seiz\\w*|strip\\w*|stole|stolen|theft|loot\\w*|siphon\\w*|misappropriat\\w*|plunder\\w*|embezzl\\w*|divert\\w*|diversion)[^.\\n|]{0,80}R\\s?10(?:\\.6\\d*\\s?(?:M\\b|m\\b|million)|[ ,]624[ ,]131(?:\\.18)?)\\+?|R\\s?10(?:\\.6\\d*\\s?(?:M\\b|m\\b|million)|[ ,]624[ ,]131(?:\\.18)?)\\+?[^.\\n|]{0,80}(?:extract\\w*|seiz\\w*|strip\\w*|stole|stolen|theft|loot\\w*|siphon\\w*|misappropriat\\w*|plunder\\w*|embezzl\\w*|divert\\w*|diversion)", + "pattern": "(?i)(? Date: Fri, 13 Nov 2026 11:52:59 +0000 Subject: [PATCH 2/2] Withdrawn-claims guard: stop the prefilter's class scan backtracking CodeQL flagged the character-class branch: a backslash could match both '\\.' and '[^\]]', so '[' followed by many backslashes backtracked exponentially. Backslash is now excluded from the second branch (from cogpy/ad-res-j7). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01RDB1UaJwokY8cw2E1M2fvp --- scripts/check_withdrawn_claims.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/check_withdrawn_claims.py b/scripts/check_withdrawn_claims.py index 84bf650..1f10bdf 100644 --- a/scripts/check_withdrawn_claims.py +++ b/scripts/check_withdrawn_claims.py @@ -282,7 +282,7 @@ def prefilter_pattern(pattern): # the checks strip indentation before joining lines, so allow for it in bounded gaps pattern = re.sub(r"\{(\d+),(\d+)\}", lambda m: "{%s,%d}" % (m.group(1), int(m.group(2)) + 200), pattern) pattern = pattern.replace("(?i)", "").replace("[^.\\n|]", "[^.|]").replace("[^.\\n]", "[^.]").replace("[^\\n]", "[\\s\\S]") - return re.sub(r"\\.|\[(?:\\.|[^\]])*\]| ", lambda m: "[\\s│┃║]*" if m.group() == " " else m.group(), pattern) + return re.sub(r"\\.|\[(?:\\.|[^\]\\])*\]| ", lambda m: "[\\s│┃║]*" if m.group() == " " else m.group(), pattern) def candidate_files(reg, claims):