Skip to content

feat(contract): exercise the unused plugin seams, and check rule prefixes (#1349) - #1364

Merged
lex00 merged 1 commit into
mainfrom
feat/dead-surface-and-ruleprefix
Aug 3, 2026
Merged

lex00 merged 1 commit into
mainfrom
feat/dead-surface-and-ruleprefix

Conversation

@lex00

@lex00 lex00 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Closes #1349. Part of #1340. Stacked on #1362.

Three members with no adopters

declarativeRules, init, and codeActionProvider have 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:

Member Dispatch site
declarativeRules() cli/commands/lint.ts:132
init() cli/plugins.ts:51
codeActionProvider() cli/lsp/server.ts:319

So 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. declarativeRules is 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.

rulePrefix was declared 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. Nothing verified it, and k8s shipped five ARGO0xx checks outside its declared WK8:

k8s   prefix=WK8   ids=34   offPrefix=5   ARGO001…ARGO005
aws   prefix=WAW   ids=50   offPrefix=2   COR020, EXT001   (core's own, exempt)

Renaming them would break every chant-disable ARGO001 already written, and Argo CD is a genuinely distinct product surface the k8s lexicon covers. So Serializer.extraRulePrefixes lets 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

  • 12/12 lexicons at 21/21 tier-1
  • 10334 tests pass
  • 9 new seam tests; the declarativeRules adopter check enumerates lexicons/ so it cannot go stale

🤖 Generated with Claude Code

https://claude.ai/code/session_01Jp6SP7ZiavhoEB1AFuwwoJ

…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
lex00 force-pushed the feat/dead-surface-and-ruleprefix branch from 74c3c15 to c79af1e Compare August 3, 2026 01:05
@lex00
lex00 changed the base branch from feat/audit-catalog-contract to main August 3, 2026 01:05
@lex00
lex00 merged commit 6acac74 into main Aug 3, 2026
7 checks passed
@lex00
lex00 deleted the feat/dead-surface-and-ruleprefix branch August 3, 2026 19:21
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.

Lexicon contract: three members have zero adopters; rulePrefix is declared but unchecked

1 participant