Add contrastive-comma pattern for the "X, not Y" aphorism#2
Open
aaazzam wants to merge 1 commit into
Open
Conversation
Sibling to the existing `contrastive` pattern. Catches the standalone "X, not Y" construction — same rhetorical move as "it's not X, it's Y" but structurally distinct, so the existing pronoun-led regex misses it. Examples flagged: Design your tools as verbs, not nouns. They are complements, not substitutes. We built a schema, not a product. It's a feature, not a bug. Examples deliberately not flagged (clause continues after Y): I bought milk, not cream, from the store. He said, not without reason, that we should leave. We need water, not soda or juice or tea. False-positive guardrail: the construction must terminate the clause (period, ?, !, ;, em-dash, " -- ", or end-of-line). Aphoristic uses land in that envelope; legitimate mid-sentence uses don't. Smoke-tested on a real prose sample (a long-form Prefect MCP post): 3 hits, all true positives matching the slop instances flagged by hand. Tested on two longer reference docs (mcp-oauth.mdx, deployment-platforms resource): zero contrastive-comma hits — the rule is focused enough not to fire on dense technical prose. Shipped as `true` by default (matches `contrastive`). Added to README config example and an eval case in evals/conftest.py.
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
Sibling to the existing
contrastivepattern. Catches the standalone "X, not Y" construction — same rhetorical move as "it's not X, it's Y" but structurally distinct, so the existing pronoun-led regex misses it entirely.Why
This is the most common form of contrastive parallelism in modern AI prose. A recent in-house blog post draft had five instances and dslop fired on zero of them. The construction is highly diagnostic when it terminates a clause — that's where it's working as a slop-shaped aphorism rather than as a legitimate qualifier.
Examples
Flagged (clause-terminating aphorisms):
Not flagged (clause continues after Y, so it's a real qualifier):
Guardrail
The regex requires the construction to terminate the clause:
.,!,?,;--That envelope catches aphoristic uses and excludes the legitimate "I want X, not Y, but rather Z" mid-sentence pattern.
Validation
Smoke-tested against three real Prefect prose docs:
architecture-of-agencyblog postmcp-oauthresource (~2k words)best-mcp-deployment-platformsresource (~6k words)Default:
true(matchescontrastive). Can be disabled per-repo viadslop.tomlif FPs surface in different domains.Files
src/patterns.rs— newCONTRASTIVE_COMMApattern +detect_contrastive_commafunction, registered inactive_patternssrc/config.rs— newcontrastive_comma: boolinPatternConfig+RawPatterns, defaulttrueevals/conftest.py— newcontrastive-commaEvalCase, exercises the harness's "can a model fix it given the error" checkREADME.md— updated description and config example🤖 Generated with Claude Code