Repository navigation
Stop the grounding gate rejecting drafts for saying "I'd" - #41
Merged
Merged
Conversation
The approvals queue answered every request to write an email with "No draft: the wording kept asserting things nothing supports — I'd". The draft was fine. The checker was wrong, in three ways that all trace back to reading an apostrophe as punctuation it is not. `extractClaims` treats a capitalised mid-sentence word as a name worth grounding. "I'd" is capitalised mid-sentence, so it was extracted as one, and nothing could ever support it: `normalize` turns the apostrophe into a space, so the claim became the token "i d", which appears in no evidence. Any draft written in the first person failed, retried, failed again, and was withheld — the composer's second attempt is told to "remove these entirely: I'd", which it cannot sensibly do. The same code rejected correctly grounded names. "Stripe's" normalised to "stripe s" and did not match stored evidence reading "Stripe", so citing the prospect's own words counted as inventing them. And the quoted-phrase extractor listed the straight apostrophe as a quote delimiter, so two contractions bracketed the prose between them into a quotation: "I've seen this. Curious what you'd try" yielded the claim "ve seen this. Curious what you". So: strip contraction and possessive endings before a capitalised word is read as a name, and delimit quotations with double quotes only. Single quotes stay out — they are indistinguishable from the apostrophe in "I'd". The gate still does its job. An invented product name, an invented figure and a real quoted phrase are all still caught, including inside first-person prose; there are tests for each. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was broken
Asking for a draft on https://outreachgraph.com/approvals?channel=email&filter=needs_draft returned:
The draft was fine.
extractClaimsinpackages/ai/src/checks.tswas wrong, in three ways that all trace back to reading an apostrophe as punctuation it is not.I'dis capitalised mid-sentence, and nothing can ever support it —normalizeturns the apostrophe into a space, so the claim becomes the tokeni d. Every draft written in the first person failed, retried (told to "remove these entirely: I'd", which it cannot sensibly do), failed again, and was withheld asfailed_checks.Stripe'snormalised tostripe s, which does not match stored evidence readingStripe. Citing the prospect's own words counted as inventing them.'as a quote mark, so two contractions bracketed the prose between them into a quotation:I've seen this. Curious what you'd tryyielded the claimve seen this. Curious what you.Reproduced against the real checker before changing anything — case 1 returns exactly
["I'd"], which is the string the approvals card renders.The fix
's 'd 'm 't 'll 've 're, straight and curly) before a capitalised word is read as a name.I'dreduces toIand falls under the length floor;Stripe'sreduces toStripeand matches the evidence.I'd.The gate still does its job
Verified an invented product name, an invented figure, and a genuine double-quoted phrase are all still flagged, including inside first-person prose. Tests cover each.
bun run checkis green: format, typecheck, 874 tests across 55 files, 0 failures.🤖 Generated with Claude Code