Skip to content

Add contrastive-comma pattern for the "X, not Y" aphorism#2

Open
aaazzam wants to merge 1 commit into
mainfrom
adam/contrastive-comma
Open

Add contrastive-comma pattern for the "X, not Y" aphorism#2
aaazzam wants to merge 1 commit into
mainfrom
adam/contrastive-comma

Conversation

@aaazzam

@aaazzam aaazzam commented Apr 16, 2026

Copy link
Copy Markdown
Owner

What

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 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):

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.
Ship verbs, not nouns -- the model handles the rest.

Not flagged (clause continues after Y, so it's a real qualifier):

I bought milk, not cream, from the store.
He said, not without reason, that we should leave.
The tests pass, not because of luck but because of design.
We need water, not soda or juice or tea.
If you want bread, not toast, ask the baker.

Guardrail

The regex requires the construction to terminate the clause:

  • ., !, ?, ;
  • em-dash (U+2014) or ASCII --
  • end-of-line

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:

File contrastive-comma hits Verdict
architecture-of-agency blog post 3 All true positives ("jobs, not schemas," "complements, not substitutes," "verbs, not nouns")
mcp-oauth resource (~2k words) 0 Clean — long-form technical prose doesn't trip the rule
best-mcp-deployment-platforms resource (~6k words) 0 Clean

Default: true (matches contrastive). Can be disabled per-repo via dslop.toml if FPs surface in different domains.

Files

  • src/patterns.rs — new CONTRASTIVE_COMMA pattern + detect_contrastive_comma function, registered in active_patterns
  • src/config.rs — new contrastive_comma: bool in PatternConfig + RawPatterns, default true
  • evals/conftest.py — new contrastive-comma EvalCase, exercises the harness's "can a model fix it given the error" check
  • README.md — updated description and config example

🤖 Generated with Claude Code

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.
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