Skip to content

feat(audit): every lexicon's checks carry catalog metadata (#1346) - #1362

Merged
lex00 merged 1 commit into
mainfrom
feat/audit-catalog-contract
Aug 3, 2026
Merged

lex00 merged 1 commit into
mainfrom
feat/audit-catalog-contract

Conversation

@lex00

@lex00 lex00 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Closes #1346. Part of #1340. Stacked on #1361.

The gap

auditCatalog() supplies the metadata chant audit reports — title, tier, fix kind, authority, category. resolveAuditCatalog merges whatever plugins contribute and returns. A lexicon that omits the method contributes nothing, silently, so its findings surface bare.

fly and temporal omitted it. Six checks have been reaching the report with no metadata:

fly       checks=2   catalog=0   missing=FLY010, FLY011
temporal  checks=4   catalog=0   missing=TMP001, TMP002, TMP010, TMP011

The drift guard that exists to catch exactly this listed its own lexicon names:

const AUDIT_LEXICONS = ["github", "gitlab", "forgejo", "k8s", "docker", "aws", "azure", "gcp", "helm"];

Nine of twelve. It missed fountain, which does contribute a catalog, and could not notice fly and temporal, which did not.

The fix

  • fly and temporal get catalogs. Constructed directly rather than through auditRule(), because five of the six checks read the chant model rather than the emitted output and so carry yamlBased: false — the same reasoning as fountain's catalog.
  • The guard enumerates lexicons/. A thirteenth lexicon is covered on arrival rather than by someone remembering to add a string.
  • A tier-2 check in check-lexicon, so an out-of-tree lexicon gets the same warning. Tier 2 rather than 1: the lexicon builds and lints correctly without a catalog; what suffers is one command's output.
  • Authoring docs. auditCatalog had zero hits across docs/ — post-synth-checks.mdx now covers it, including the yamlBased trap and the core-id exclusion.

One thing widening the guard surfaced

Its "no stale entries" test treated only post-synth ids as real, which would have failed fountain for documenting FTN001 — a lint rule. An entry for a lint rule is not stale; a reader who hits it wants the same metadata. So the stale test now accepts any rule the lexicon ships, while the coverage test still requires every post-synth check. Requiring an entry for every lint rule in every lexicon would be a much larger claim than the audit makes.

Verification

  • 12/12 lexicons at 20/20 tier-1, and every one now passes the new tier-2 row
  • 10322 tests pass

🤖 Generated with Claude Code

https://claude.ai/code/session_01Jp6SP7ZiavhoEB1AFuwwoJ

`auditCatalog()` supplies the per-check metadata `chant audit` reports —
title, tier, fix kind, authority, category. `resolveAuditCatalog` merges
whatever the plugins contribute and returns; a lexicon that omits the method
contributes nothing, silently, so its findings surface with no metadata at all.

fly and temporal omitted it. Their six post-synth checks — FLY010, FLY011,
TMP001, TMP002, TMP010, TMP011 — have been reaching the report bare. Both now
have catalogs, constructed directly rather than through `auditRule()` because
five of the six read the chant model rather than the emitted output and so
carry `yamlBased: false`.

The drift guard meant to catch exactly this listed its own nine lexicon names.
It missed fountain, which does contribute a catalog, and could not notice fly
and temporal, which did not. It now enumerates `lexicons/`, so a thirteenth
lexicon is covered on arrival rather than by someone remembering.

Widening it surfaced a second thing: its "no stale entries" test treated only
post-synth ids as real, which would have failed fountain for documenting
FTN001, a lint rule. A catalog entry for a lint rule is not stale — a reader
who hits it wants the same metadata — so the stale test now accepts any rule
the lexicon ships, while the coverage test still requires every post-synth
check. Requiring an entry for every lint rule in every lexicon would be a much
larger claim than the audit makes.

`chant dev check-lexicon` warns at tier 2 on a check with no entry: the lexicon
builds and lints correctly without one, what suffers is a command's output.
Core's cross-cutting ids (COR*, EXT*) are excluded from both, since they are
not any lexicon's to catalog.

`auditCatalog` had no authoring documentation at all; post-synth-checks.mdx now
covers it.

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/audit-catalog-contract branch from e288e1e to 9f75a4b Compare August 3, 2026 00:55
@lex00
lex00 changed the base branch from feat/wiring-checks to main August 3, 2026 00:55
@lex00
lex00 merged commit 733a964 into main Aug 3, 2026
7 checks passed
@lex00
lex00 deleted the feat/audit-catalog-contract 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: auditCatalog is unchecked, undocumented, and its drift guard is hardcoded

1 participant