Repository navigation
feat(contract): exercise the unused plugin seams, and check rule prefixes (#1349) - #1364
Merged
Merged
Conversation
…ixes (#1349) Three LexiconPlugin members have zero adopters across all twelve lexicons: `declarativeRules`, `init`, and `codeActionProvider`. All three are live — core dispatches through each (cli/commands/lint.ts, cli/plugins.ts, cli/lsp/server.ts) — so they are working extension points, not dead code. What was missing is that nothing exercised them, which made them claims about supported surface that no test could back. `declarativeRules` is the sharpest: the authoring overview presents it as a supported way to write lint rules, and an author following that advice would have been the first person to try it. Deleting them would remove seams that work. They are exercised with a mock plugin instead, including a test that fails the moment a lexicon adopts `declarativeRules` so the docs stop saying nobody does. The overview table and the lint-rules guide now say plainly that it is untrodden. `Serializer.rulePrefix` was declared on every serializer and checked by nothing. It exists so ids do not collide when several lexicons load together — forgejo wraps github's rules as `WFJ-GHA0xx` for exactly that reason — and k8s quietly shipped five `ARGO0xx` checks outside its declared `WK8`. Renaming those would break every `chant-disable ARGO001` already written, and Argo CD is a genuinely distinct product surface the k8s lexicon covers. So a serializer can declare further id families it owns via `extraRulePrefixes`, and a tier-1 check requires every rule and post-synth id to fall under a declared prefix. Core's cross-cutting ids (COR*, EXT*) are exempt — they belong to core, not to whichever lexicon surfaces them. 12/12 pass at 21/21. Refs #1340. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Jp6SP7ZiavhoEB1AFuwwoJ
lex00
force-pushed
the
feat/dead-surface-and-ruleprefix
branch
from
August 3, 2026 01:05
74c3c15 to
c79af1e
Compare
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.
Closes #1349. Part of #1340. Stacked on #1362.
Three members with no adopters
declarativeRules,init, andcodeActionProviderhave zero implementations across all twelve lexicons. The audit framed this as dead surface; reading core changed the conclusion. All three are live — core dispatches through each of them:declarativeRules()cli/commands/lint.ts:132init()cli/plugins.ts:51codeActionProvider()cli/lsp/server.ts:319So they are working extension points rather than dead code. What was missing is that nothing exercised them — claims about supported surface that no test could back.
declarativeRulesis the sharpest case: the authoring overview presents it as a supported way to write lint rules, so an author following that advice would have been the first person to find out whether it works.Deleting them would remove seams that work. They are exercised with a mock plugin instead, including a test that fails the moment a lexicon adopts
declarativeRules— so the docs cannot keep saying nobody does once someone does. The overview table and the lint-rules guide now say plainly that it is untrodden.rulePrefixwas declared and checked by nothingIt exists so ids do not collide when several lexicons load together — forgejo wraps github's rules as
WFJ-GHA0xxfor exactly that reason. Nothing verified it, and k8s shipped fiveARGO0xxchecks outside its declaredWK8:Renaming them would break every
chant-disable ARGO001already written, and Argo CD is a genuinely distinct product surface the k8s lexicon covers. SoSerializer.extraRulePrefixeslets a serializer declare further id families it owns, and a tier-1 check requires every rule and post-synth id to fall under a declared prefix. An undeclared family is now a failure; a declared second family is fine.Core's cross-cutting ids (
COR*,EXT*) are exempt — they belong to core, not to whichever lexicon surfaces them.Verification
declarativeRulesadopter check enumerateslexicons/so it cannot go stale🤖 Generated with Claude Code
https://claude.ai/code/session_01Jp6SP7ZiavhoEB1AFuwwoJ