Repository navigation
Description
Epic. Audit of the lexicon contract at 4b5d35a3, and the work to pull everything it currently leaves to convention into the contract itself.
The contract today
| Layer | Size | Enforced |
|---|---|---|
LexiconPlugin (packages/core/src/lexicon.ts) |
6 required members, ~30 optional | typecheck only; isLexiconPlugin() checks 6 |
chant dev check-lexicon |
41 checks — 18 tier-1, 14 tier-2, 9 tier-3 | tier 1 gated in CI; tiers 2/3 advisory |
docs/src/content/docs/lexicon-authoring/ |
18 pages | not at all |
The organising finding: 38 of the 41 checks assert that a file exists. None assert that the plugin wires it up. Only four checks evaluate behavior — "every shipped example builds", the three intrinsics checks — plus the docs-reachability check added in #1325. Everything below follows from that, or from a capability that grew in the lexicons without a contract member to grow into.
Work breakdown
| # | Gap | What goes into the contract |
|---|---|---|
| #1341 | MCP tool names are double-prefixed in production (gitlab:gitlab:diff, aws:aws:diff) |
idempotent namespacing owned by core; the :diff / :resource-catalog / read-only-context naming convention written down; a check |
| #1342 | check-lexicon tests for files, not wiring — helm's LSP is unreachable and passes both tiers |
capability presence means the plugin exposes it; rewrite the existence checks as registration checks |
| #1343 | The completeness checklist documents seven checks that do not exist, and omits two that do | doc and tool agree, verified by a drift guard rather than by review |
| #1344 | Per-lexicon config namespaces (k8s, temporal, forgejo) are undeclared, unvalidated, and untypeable |
a lexicon declares the namespace it owns; core validates it; the documented examples compile |
| #1345 | azure, gcp and fly ship emulators without declaring EmulatorCapability |
all four emulators declared; image pinning has one home; the capability gets authoring docs |
| #1346 | auditCatalog is unchecked and undocumented; its drift guard hardcodes nine lexicon names |
checks contribute metadata or fail; the guard enumerates; fly and temporal get catalogs |
| #1347 | Eight members have no authoring docs; lexicon.ts misattributes two of its own docblocks |
complete the optional-methods table; reattach the docblocks; guard against future drift |
| #1348 | The ownership marker channel is an obligation with no declaration and no check | declare the channel; verify total verdicts behaviorally |
| #1349 | declarativeRules, init, codeActionProvider have zero adopters; rulePrefix is declared but unchecked |
no advertised member without an adopter; rule ids verified against the declared prefix |
The through-line
Each item is the same shape: something load-bearing is agreed by convention among the lexicons, and nothing in core knows about it. A convention holds until the twelfth lexicon, or the second author, or a refactor — gitlab:gitlab:diff is what that looks like when it stops holding, and it has been shipping.
The fix in every case is the same: name the thing in the contract, validate it once in core, document it where an author will look, and gate it.
Order
- Lexicon contract: MCP tool names are double-prefixed in production #1341 — a live user-facing bug
- Lexicon contract: the completeness checklist documents seven checks that don't exist #1343 — the docs currently mislead about what is verified
- Lexicon contract: check-lexicon tests for files, not for wiring #1342 — the structural fix; makes several of the others checkable
- Lexicon contract: three lexicons ship an emulator without declaring the emulator capability #1345, Lexicon contract: auditCatalog is unchecked, undocumented, and its drift guard is hardcoded #1346, Lexicon contract: three members have zero adopters; rulePrefix is declared but unchecked #1349 — capability adoption, mechanical once Lexicon contract: check-lexicon tests for files, not for wiring #1342 lands
- Lexicon contract: per-lexicon config namespaces are undeclared, unvalidated, and untypeable #1344, Lexicon contract: ownership marker channel is an obligation with no declaration and no check #1348 — new contract surface, needs design
- Lexicon contract: eight members have no authoring docs, and lexicon.ts misattributes two docblocks #1347 — documentation, last so it describes the finished contract
Activity
[-]Lexicon contract: audit of what it enforces, what the docs claim, and what lexicons do outside it[/-][+]Epic: pull the lexicon contract's conventions into the contract[/+]fix(mcp): register each lexicon contribution under one namespace (#1341…
docs: make the completeness checklist match the tool, and keep it tha…
docs: make the completeness checklist match the tool, and keep it tha…
feat(check-lexicon): check what a plugin registers, not what files ex…
feat(audit): every lexicon's checks carry catalog metadata (#1346)
feat(audit): every lexicon's checks carry catalog metadata (#1346) (#…
feat(contract): exercise the unused plugin seams, and check rule pref…
feat(contract): exercise the unused plugin seams, and check rule pref…
feat(emulator): declare every emulator the repo ships (#1345) (#1368)
docs: document every optional contract member, and keep it that way (#…
docs: document every optional contract member, and keep it that way (#…
feat(ownership): declare where a lexicon can read the marker, and hol…
feat(ownership): declare where a lexicon can read the marker, and hol…
feat(config): a lexicon declares the config namespace it owns (#1344)
feat(config): a lexicon declares the config namespace it owns (#1344)
feat(config): a lexicon declares the config namespace it owns (#1344) (…
lex00 commentedon Aug 3, 2026
All nine children are closed and merged.
What went in
gitlab:gitlab:diff,aws:aws:diff)docs()configSchemavalidated at load, and the same schema derives theChantConfigaugmentationemulatortakes one or many; all five declared; images pinned; freshness generalizedauditCatalogunchecked and undocumentedownershipChannelper read path, enforced behaviorally by the conformance suite and statically by check-lexiconrulePrefixdeclared but uncheckedTier 1 went from 18 checks to 21, all twelve lexicons passing.
Bugs this surfaced that were not the point of the audit
chant serve mcpwas handing agentsgitlab:gitlab:diffandaws:aws:diff, with every doc naming the single-prefixed form--live --env <local>against azure silently read real Azure — core's endpoint map asserted azure had no ambient variable whiledescribe-resources.tsreadAZURE_ENDPOINT_URLon every callforgejoconfig typo left the dialect on its defaults, silentlychant auditwith no metadataThe through-line
Each item was the same shape: something load-bearing agreed by convention among the lexicons, with nothing in core that knew about it.
gitlab:gitlab:diffis what that looks like when a convention stops holding, and it had been shipping.Four of the fixes are guards rather than corrections, so these classes cannot silently return.
Follow-ups filed
#1388 (CI typechecks neither lexicon tests nor examples — gating half merged, 85-file backlog remains), #1390 (aws spec pinning, merged), #1400, #1417, #1418.