Skip to content

prose_checks: stop flagging "rather than" / "would rather" as weasel words - #82

Merged
rivassec merged 1 commit into
mainfrom
fix/prose-weasel-rather
Sep 27, 2026
Merged

rivassec merged 1 commit into
mainfrom
fix/prose-weasel-rather

Conversation

@rivassec

Copy link
Copy Markdown
Owner

The weasel-word list had a bare rather, so it flagged the comparison "rather than" and the preference "would / I'd rather". Neither is a hedge. rather hedges only as an intensifier, as in "rather large".

Evidence: in the 2026-09-20..23 blog-review Ralph runs, 16 of 22 weasel-word hits were these false positives. On the 8 affected posts, hits drop from 22 to 5:

post before after
claude-synthid-text-watermark-attack-surface 9 1
cryptominer-in-the-docker-layer 5 2
prompt-injection-supply-chain-evasion 2 0
every-alert-is-your-alert 2 1
208-day-kernel-bug-lessons 1 1
hardening-k8s / hiring-discovery-layer-broken / bluetooth-tethering 1 each 0

The 5 hits that remain are real or borderline hedges ("In some cases", "tend to" ×2, "could be" ×2).

Change: rather → (?<!would\s)(?<!'d\s)(?<!’d\s)rather(?!\s+than\b). Every other term is unchanged.

Tests: new tests/test_prose_checks_weasel.py uses corpus cases for "rather than", "would/I'd rather" (straight and curly apostrophes) and a line-wrapped "rather\nthan". It also asserts that intensifier "rather", "in some cases", "tend to" and "could be" are still flagged. python3 -m unittest discover tests: 42 tests OK.

🤖 Generated with Claude Code

…words

"rather" hedges only as an intensifier ("rather large"). As a bare term it
also matched the comparison "rather than" and the preference "would/I'd
rather": 16 of 22 weasel-word hits in the 2026-09-20..23 blog-review Ralph
runs were those false positives (8 posts: 22 -> 5 hits). The pattern now uses
a negative lookahead for "than" and lookbehinds for would/I'd. Intensifier
use is still flagged. Adds tests/test_prose_checks_weasel.py (corpus cases).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@rivassec
rivassec merged commit 3722b92 into main Sep 27, 2026
19 checks passed
@rivassec
rivassec deleted the fix/prose-weasel-rather branch September 27, 2026 18:16
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