Skip to content

feat: ban phrase groups by default - #58

Merged
webern merged 4 commits into
mainfrom
m/deslag-catalog
Sep 27, 2026
Merged

webern merged 4 commits into
mainfrom
m/deslag-catalog

Conversation

@webern

@webern webern commented Sep 27, 2026 •

Copy link
Copy Markdown
Owner

Summary

banned_phrases until now banned nothing by default: an adopter who wanted phrase lints wrote a list from memory, with nothing behind any entry. This PR gives it groups, like banned_chars has: signposts, insistence, metaphors and precision, each on by default and switched under [md.lints.banned_phrases.groups]. The report names the group beside the phrase so a user can switch one off by name.

Every entry carries the evidence that put it in. It was measured on the corpus image measured_on names: zero human files out of 11,873 (a rule-of-three upper bound of about 0.03%), and llm files in at least 40 repositories. CI no longer takes those numbers on faith: make test-blobs re-derives every count against the pinned image and fails on drift, and make fix-catalog rewrites the file when the image moves. A phrase whose evidence decays is removed and joins the refused list.

The matcher keeps its old semantics: a user's ban beats the catalogue's advice and never turns a load error, allow of a catalogue phrase stays legal (that is how a human switches one entry off), and no token is reported twice. Group checks apply only where the phrase matcher already applied.

Candidates considered and refused are recorded in tools/corpus/rejected.toml with reasons — words people write in 2026, prompt text rather than prose, rare words, and common English that sits at zero only because the corpus's human tier is older prose. The candidates tool skips both the catalogue and the refused list.

Testing

  • make ci: exit 0
  • make test-blobs: every recorded count re-derived on the pinned image, exact match
  • tree corpus: each group matches zero human fixtures and at least five llm fixtures
  • case tests: group hit, group off, ban beating the catalogue, allow of a catalogue phrase, overlap

References

banned_phrases now has groups, like banned_chars: signposts,
insistence, metaphors and precision, each on by default and switched
under lints.banned_phrases.groups. Their phrases live in
src/lint/banned_phrases.toml, parsed once. Each entry has no human
file on the big tier (v2) and llm files in at least 40 repositories.

A phrase in ban keeps the advice ban gives it, whatever the groups
say. A phrase in allow still suppresses by containment. The report
names the group of each phrase it lists.

config::Groups becomes CharGroups, beside the new PhraseGroups. The
repo's own config and tools/corpus/report.toml turn the lint on.
Case tests cover a group hit, a group switched off, ban beating a
group's advice, allow of a group phrase, and an overlap where no token
is reported twice. The tree corpus test holds every group at zero
human fixtures and at least five llm fixtures. The schema drift test
covers both lints' groups, and report.toml must hold the repo's own
lint settings.
make test-blobs counts each entry's llm files and repositories on the
pinned image and fails on drift or on any human file; make fix-catalog
rewrites the counts. tools/corpus/rejected.toml records each refused
phrase with its reason, and candidates leaves those and the catalogue's
phrases out. docs/design/catalog.md says what gets in and what CI
checks.
@webern webern added enhancement New feature or request ai Primarily authored by AI (whether PR, Issue, Whatever) area/config Has to do with deslag configuration (deslag.yaml, etc.) area/lint Deals with the linting algorithms themselves, how they work. labels Sep 27, 2026
@webern
webern marked this pull request as ready for review September 27, 2026 16:04
@webern
webern merged commit c5b3798 into main Sep 27, 2026
2 checks passed
@webern
webern deleted the m/deslag-catalog branch September 27, 2026 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai Primarily authored by AI (whether PR, Issue, Whatever) area/config Has to do with deslag configuration (deslag.yaml, etc.) area/lint Deals with the linting algorithms themselves, how they work. enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant