Skip to content

Mirror the withdrawn-claims guard fixes from ad-res-j7 - #17

Merged
drzo merged 2 commits into
mainfrom
claude/review-bom-docs-uMY6H
Nov 13, 2026
Merged

drzo merged 2 commits into
mainfrom
claude/review-bom-docs-uMY6H

Conversation

@drzo

@drzo drzo commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Copies scripts/check_withdrawn_claims.py and docs/strategic/WITHDRAWN_CLAIMS_REGISTER.json (updated 2026-11-12) from cogpy/ad-res-j7#5134, which fixed the five gaps Copilot found on cogpy/discosys#9:

  • a correction wrapped across lines is no longer flagged;
  • a negated verb ("not stolen", "never extracted") is no longer flagged;
  • "written off: R2,887,676.80" is caught again;
  • in fenced diagrams, box borders are dropped before rows are joined, and a row joins the one above only when it continues it;
  • the prefilter treats box borders as spacing and leaves spaces inside character classes alone.

This repository's own allow_paths are kept. No claim was added, so no banners change. The withdrawn-claims guard passes on the diff.


Generated by Claude Code

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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RDB1UaJwokY8cw2E1M2fvp
Comment thread scripts/check_withdrawn_claims.py Fixed
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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RDB1UaJwokY8cw2E1M2fvp
@drzo
drzo marked this pull request as ready for review November 13, 2026 12:05
Copilot AI balanced review requested due to automatic review settings November 13, 2026 12:05
@drzo
drzo merged commit 9bf366a into main Nov 13, 2026
6 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The checker can silently miss wrapped allegations due to overly narrow prefiltering and incorrect continuation handling, while also falsely flagging a valid multiline correction.

3 open issues
What changed in this PR

Mirrors upstream withdrawn-claims guard fixes into ChainLex while preserving repository-specific path exemptions. The changes refine claim detection without adding new claim IDs.

Changes:

  • Updates wrapped-correction handling and fenced-diagram row grouping.
  • Adjusts prefilter whitespace handling for box borders and character classes.
  • Expands write-off matching and adds negated-verb exclusions with regression examples.
File Description
scripts/​check_withdrawn_claims.py Refines wrapped-text exemptions, diagram grouping, and prefilter patterns.
docs/​strategic/​WITHDRAWN_CLAIMS_REGISTER.json Updates mirror metadata, claim patterns, and matching examples.

Review effort: Balanced

# Rows of a box are separate labels ("│ Salco: Cape Town │" / "│ SOLO: UK │")
# unless a row continues the sentence above it, which starts in lower case.
content = row.group(1)
if not (content[:1].islower() and sub):
pattern = re.sub(r"\{(\d+),(\d+)\}", lambda m: "{%s,%d}" % (m.group(1), int(m.group(2)) + 200), pattern)
return pattern.replace("(?i)", "").replace("[^.\\n|]", "[^.|]").replace("[^.\\n]", "[^.]").replace("[^\\n]", "[\\s\\S]").replace(" ", "\\s*")
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)
Comment on lines +249 to +250
if allow.search(" ".join(t for _, t in touched)):
continue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants