Skip to content

Scan tool-authored casefile statements in the language check - #11

Merged
samrusani merged 1 commit into
mainfrom
casefile-language-check
Aug 19, 2026
Merged

Scan tool-authored casefile statements in the language check#11
samrusani merged 1 commit into
mainfrom
casefile-language-check

Conversation

@samrusani

@samrusani samrusani commented Aug 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • CI language check now parses casefile.json and scans tool-authored fields (finding statements, record notes, rationale, questions, narrative, enforcement notes, skipped reasons).
  • Claim texts and media titles are not scanned. Identity exemptions still require sibling registry evidence; claim-quote exemptions do not apply to those fields.
  • Corrupt casefile targets fail closed. Fixture memos and casefiles are unchanged.

Test plan

  • Five gates green locally: 759 tests, ruff, mypy, language check (29 files)
  • CI on this PR (pytest matrix, wheel install, pip-audit)

CI only gated memos and templates, so a hand-edited finding statement or verdict rationale could carry banned vocabulary in a committed casefile. Parse casefile.json and scan those fields; leave claim texts and media titles out.

Co-authored-by: Cursor <cursoragent@cursor.com>
@samrusani
samrusani merged commit fe87d7b into main Aug 19, 2026
5 checks passed
@greptile-apps

greptile-apps Bot commented Aug 19, 2026

Copy link
Copy Markdown

Greptile Summary

The PR extends the CI language checker to parse casefiles and scan selected tool-authored prose while preserving narrow evidence-backed identity exemptions and excluding quoted claims and media inputs.

  • Adds casefile discovery, JSON parsing, field extraction, and fail-closed handling for unreadable or malformed JSON.
  • Adds tests for scanned fields, excluded quoted inputs, identity verification, and corrupt targets.
  • Updates architecture, decisions, future-work, and handoff documentation to describe the expanded gate.

Confidence Score: 4/5

The PR appears safe to merge after the non-blocking cleanup of person-like names from the changed test descriptions.

The casefile scanner covers the intended generated-prose fields and preserves the documented exemptions; the only accepted concern is a repository-policy violation in test docstrings.

Files Needing Attention: tests/test_language.py

Important Files Changed

Filename Overview
scripts/check_language.py Adds casefile target discovery, selective extraction of tool-authored fields, evidence-backed identity exemptions, and malformed-JSON failure handling.
tests/test_language.py Adds broad casefile-scan coverage, but changed test descriptions use person-like names contrary to the repository’s description/comment policy.
src/coldscreen/language.py Updates shared language-policy documentation to distinguish memo claim exemptions from casefile field scanning.
DECISIONS.md Records the selected casefile fields, exemption behavior, excluded quoted inputs, and failure policy.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Language-check target] --> B{casefile.json?}
  B -- No --> C[Scan memo or template text]
  B -- Yes --> D[Parse JSON]
  D --> E{Readable and valid JSON?}
  E -- No --> F[Fail language check]
  E -- Yes --> G[Extract selected tool-authored fields]
  G --> H[Verify identity exemptions against registry evidence]
  H --> I[Scan each field for banned terms]
  C --> J{Banned term found?}
  I --> J
  J -- Yes --> F
  J -- No --> K[Pass target]
Loading
Prompt To Fix All With AI
### Issue 1
tests/test_language.py:589-590
**Remove names from test descriptions**

The changed docstrings include person-like full names despite the repository rule prohibiting personally identifiable information in descriptions and comments. Replace these references, including the adjacent identity-test description, with explicitly synthetic placeholders.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (1): Last reviewed commit: "Scan tool-authored casefile statements i..." | Re-trigger Greptile

Comment thread tests/test_language.py
Comment on lines +589 to +590
"""A finding statement that names CROOK, Cuthbert passes only when
sibling registry evidence carries that name."""

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Remove names from test descriptions

The changed docstrings include person-like full names despite the repository rule prohibiting personally identifiable information in descriptions and comments. Replace these references, including the adjacent identity-test description, with explicitly synthetic placeholders.

Rule Used: Make sure no personally identifiable information i... (source)

Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/test_language.py
Line: 589-590

Comment:
**Remove names from test descriptions**

The changed docstrings include person-like full names despite the repository rule prohibiting personally identifiable information in descriptions and comments. Replace these references, including the adjacent identity-test description, with explicitly synthetic placeholders.

**Rule Used:** Make sure no personally identifiable information i... ([source](https://app.greptile.com/900-labs/-/custom-context?memory=930389e5-d152-4d6b-9814-6e9c4f9b209c))

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

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