Skip to content

Close heading injection and exempt code-fetched rendered strings - #16

Merged
samrusani merged 1 commit into
mainfrom
heading-and-rendered-strings
Aug 20, 2026
Merged

Close heading injection and exempt code-fetched rendered strings#16
samrusani merged 1 commit into
mainfrom
heading-and-rendered-strings

Conversation

@samrusani

@samrusani samrusani commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • Collapse pre-table model fields and pin the claims-table start to a template opener so a rationale cannot steal the region (AUD-001).
  • Exempt code-fetched strings the memo already prints (office, network names, media domains, claim source labels). CI re-verifies each class against sibling evidence (AUD-002).
  • Invert the office-address CLI test: a registry address containing a banned word now screens honestly. Search terms in QUERY_CATEGORIES stay gated.

Test plan

  • 812 tests passed locally (was 786)
  • ruff check, ruff format --check, mypy, python scripts/check_language.py
  • CI 3.11 / 3.12 / 3.13, package, and audit
  • Confirm fixtures and snapshot memos are unchanged
  • Confirm 1 Scam Passage screens and model prose scam still fails

…hed strings the memo already prints.

Co-authored-by: Cursor <cursoragent@cursor.com>
@greptile-apps

greptile-apps Bot commented Aug 20, 2026

Copy link
Copy Markdown

Greptile Summary

The PR hardens claims-table boundary detection against heading injection and permits verified code-fetched strings to pass the language gate.

  • Collapses pre-table synthesis fields and requires a template-controlled opener after the claims-table heading.
  • Adds runtime and CI exemptions for verified office, network, media-domain, and claim-source strings.
  • Expands regression coverage for heading injection, evidence verification, and legitimate registered-office text.

Confidence Score: 5/5

The PR appears safe to merge, with no concrete changed-code failure established.

The new heading checks fail closed, all model-controlled fields rendered before the claims table are collapsed, and CI re-verifies the added fetched-string exemption classes against persisted evidence.

Important Files Changed

Filename Overview
src/coldscreen/language.py Adds whitespace collapse, widened code-fetched exemptions, and opener-pinned claims-table region detection without an accepted defect.
scripts/check_language.py Re-verifies new exemption classes against sibling evidence before applying them to memo and casefile scans.
src/coldscreen/render.py Collapses pre-table fields at render time, including stored casefiles used by rerender paths.
src/coldscreen/synthesis.py Applies widened fetched-string exemptions and stores heading-sensitive fields in collapsed form.
src/coldscreen/pipeline.py Passes the widened fetched-string set into the whole-memo language backstop.
tests/test_language.py Adds extensive regression coverage for heading boundaries and evidence-backed exemption classes.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Casefile and fetched evidence] --> B[Render memo]
    B --> C[Collapse pre-table fields]
    C --> D[Locate claims-table heading]
    D --> E{Template opener follows?}
    E -- Yes --> F[Apply claim exemptions inside table region]
    E -- No --> G[Apply no claim exemptions]
    A --> H[Build code-fetched exemption set]
    H --> I[Apply exact span exemptions]
    F --> J[Language backstop]
    G --> J
    I --> J
    J --> K{Banned terms remain?}
    K -- Yes --> L[Reject memo]
    K -- No --> M[Allow memo]
Loading

Reviews (1): Last reviewed commit: "Stop a rationale from stealing the claim..." | Re-trigger Greptile

@samrusani
samrusani merged commit 810f39a into main Aug 20, 2026
5 checks passed
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.

1 participant