Scope whole-memo claim-quote exemptions to the claims table - #13
Conversation
A hand-edited casefile could whitelist banned words in narrative on render-only reruns. The backstop now applies claim quotes only inside the claims-table region. Co-authored-by: Cursor <cursoragent@cursor.com>
|
| Filename | Overview |
|---|---|
| src/coldscreen/language.py | Introduces region-scoped memo scanning, but content-derived heading boundaries can truncate or shift the claims region. |
| src/coldscreen/pipeline.py | Correctly routes the whole-memo backstop through the new region-aware helper. |
| tests/test_language.py | Covers missing, unclosed, repeated, and ordinary table boundaries but not headings injected through rendered fields. |
| tests/test_exemption_attacks.py | Adds useful render-only tampering regressions for memo-wide claim exemption attacks. |
| tests/test_golden.py | Confirms both the committed and freshly rendered golden memos pass the scoped backstop. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Load casefile] --> B[Render memo]
B --> C[Find first Claims vs evidence heading]
C --> D[Find next line beginning with ##]
D --> E[Apply claim and identity exemptions inside region]
E --> F[Apply identity exemptions outside region]
F --> G{Banned terms found?}
G -->|Yes| H[Reject memo write]
G -->|No| I[Write memo]
Prompt To Fix All With AI
### Issue 1
src/coldscreen/language.py:212-216
**Content corrupts table boundaries**
When a render-only casefile includes an embedded `## ` line in a claim-table field, or an exact `## Claims vs evidence` line in earlier prose, `_claims_table_region` treats that content as a structural delimiter. This excludes legitimate claim rows from the exemption region and causes the language backstop to reject the rendered memo.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "Scope whole-memo claim-quote exemptions ..." | Re-trigger Greptile
| if start is None: | ||
| if content == _CLAIMS_TABLE_HEADING: | ||
| start = offset | ||
| elif content.startswith("## "): | ||
| return start, offset |
There was a problem hiding this comment.
Content corrupts table boundaries
When a render-only casefile includes an embedded ## line in a claim-table field, or an exact ## Claims vs evidence line in earlier prose, _claims_table_region treats that content as a structural delimiter. This excludes legitimate claim rows from the exemption region and causes the language backstop to reject the rendered memo.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/coldscreen/language.py
Line: 212-216
Comment:
**Content corrupts table boundaries**
When a render-only casefile includes an embedded `## ` line in a claim-table field, or an exact `## Claims vs evidence` line in earlier prose, `_claims_table_region` treats that content as a structural delimiter. This excludes legitimate claim rows from the exemption region and causes the language backstop to reject the rendered memo.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Summary
## Claims vs evidencethrough the next##heading).Test plan
fraudplus narrativefraudonrerun --render-onlyexits 1 and writes no memofraudwith clean prose still renders in the table