Skip to content

docs(core): make the lexicon docs contract check what it claims (#1312) - #1325

Merged
lex00 merged 1 commit into
mainfrom
docs/lexicon-docs-contract
Aug 2, 2026
Merged

lex00 merged 1 commit into
mainfrom
docs/lexicon-docs-contract

Conversation

@lex00

@lex00 lex00 commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Closes the remaining items on #1312: the unreachable pages, the duplicate rule pages, and the enforcement gap that let both happen.

The gap

chant dev check-lexicon judged documentation by counting files — "At least 1 .mdx doc page" at tier 1, "At least 8 doc pages" at tier 2 — and never opened one. A lexicon could ship eight stale, unreachable, hand-edited pages and pass both tiers. That is the same gap behind every drifted At-a-Glance table in #1315.

The count check was, if anything, rewarded by the problem: azure cleared the ≥8 check comfortably while ten of its fifteen pages appeared in no sidebar, including its getting-started, resource reference and composites pages.

Five codegen gaps

Each of these surfaced by fixing the one before it, so they are listed in the order they appeared:

  1. Emitted pages carried no provenance marker. They sit in the same directory as hand-written pages and look identical, so they get edited directly and the next regen reverts it — which had already happened twice (the k8s sidebar group and the AWS feat(core): fold registered plain-call intrinsics (per-intrinsic opt-in) — DECIDED: yes #1044 claim, both in docs: say what the build actually does by default (#1312) #1315). Every generated page now carries a marker, in the {/* … */} form MDX accepts rather than <!-- -->, which MDX parses as JSX.
  2. A generated page silently overwrote an extraPages entry with the same slug. extraPages are written first, then the generated pages set over them. Helm declared its own "Intrinsics Reference" and a pre-synth rules page and has shipped neither for as long as the slugs collided. Explicit authorship now wins, and the collision is reported rather than resolved in silence.
  3. Suppressing a page left the previous copy on disk. writeDocsSite only removed files it was about to rewrite, so a page that stops being generated stays forever — unreferenced and indistinguishable from a hand-written one. The marker from (1) is what makes reaping safe: only a file this pipeline stamped is ever removed.
  4. buildSidebar declined to link a generated rules page when a lint-rules page existed, while the pipeline emitted it anyway — a guaranteed orphan by construction. That is exactly how gcp's rules.mdx came to exist.
  5. Nothing reported pages absent from the sidebar. Starlight has no auto-discovery (docs/README.md says so), so sidebar membership is the whole of reachability. The generator now warns, and the contract gates on it at tier 1.

Normalization

  • Helm's rescued page takes the intrinsics-guide slug that aws and gitlab already use; its dead rules declaration is removed.
  • azure, gcp and helm suppress the duplicate generated rules table in favour of their own lint-rules page, matching aws, k8s, gitlab and github.
  • azure, temporal, github, helm and aws declare their hand-written pages in sidebarExtra. Azure and temporal had never declared any.
  • Temporal deliberately keeps both rule pages: its lint-rules page links out to the generated table for the always-current version, the same overview/reference pairing aws uses for intrinsics-guide and intrinsics. Suppressing it there would have broken that link — worth checking before assuming the pair is always redundant.

Also finishes #1315's sweep: that PR fixed the Folded-vs-Run section but left the page intro, the unsupported-patterns preamble and the EVL page still describing running as the default.

Verification

  • All twelve lexicons regenerate with zero warnings; before the config changes the generator reported the orphans on azure, gcp and helm.
  • chant dev check-lexicon passes the new tier-1 check on all twelve, and fails correctly when a page is added without a sidebar entry (1 unreachable: zz-unwired) — verified rather than assumed, since a check that cannot fail is worthless.
  • 8 unit tests for the new module, including single-quoted and bare-key configs (a hand-edited config would otherwise report reachable pages as unreachable) and nested sidebar groups.
  • check-lexicon.test.ts and docs-sections.test.ts pass; main docs site builds at 149 pages; the fly lexicon site builds, confirming the MDX marker parses.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Jp6SP7ZiavhoEB1AFuwwoJ

The completeness contract judged documentation by counting files — "at least
1 .mdx page" at tier 1, "at least 8" at tier 2 — and never opened one. A
lexicon could ship eight stale, unreachable, hand-edited pages and pass both.
That is how every At-a-Glance table drifted, and how azure, temporal, helm and
github accumulated pages no sidebar points at. Counting even rewarded the
orphans: azure cleared the >=8 check with ten of its fifteen pages invisible.

Five codegen gaps, each found by fixing the one before it:

- Emitted pages carried no provenance marker, so they get edited directly and
  the next regen reverts the edit. Every generated page now carries one, in
  the `{/* ... */}` form MDX accepts.
- A generated page silently overwrote an `extraPages` entry claiming the same
  slug. Helm declared an "Intrinsics Reference" and a pre-synth rules page and
  shipped neither. Explicit authorship now wins and the collision is reported.
- Suppressing a page stopped it being written but left the previous copy on
  disk — unreferenced, and indistinguishable from a hand-written page. The
  marker makes reaping safe: only a file this pipeline stamped is removed.
- buildSidebar declined to link a generated `rules` page when a `lint-rules`
  page existed, while the pipeline emitted it anyway, guaranteeing an orphan.
- Nothing reported pages absent from the sidebar. Starlight has no
  auto-discovery, so those are reachable only by typing the URL. The generator
  warns and `chant dev check-lexicon` gates on it at tier 1.

Normalizing against the new check: helm's rescued page takes the
`intrinsics-guide` slug aws and gitlab already use, azure/gcp/helm suppress the
duplicate generated `rules` table in favour of their own `lint-rules` page, and
azure, temporal, github, helm and aws declare their hand-written pages in
`sidebarExtra`. Temporal deliberately keeps both: its `lint-rules` page links
out to the generated table, the same overview/reference pairing aws uses.

Also finishes #1315's sweep — its page intro, unsupported-patterns preamble and
the EVL page still described running as the default.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jp6SP7ZiavhoEB1AFuwwoJ
@lex00
lex00 merged commit ad57db3 into main Aug 2, 2026
6 checks passed
@lex00
lex00 deleted the docs/lexicon-docs-contract branch August 2, 2026 22:21
lex00 added a commit that referenced this pull request Aug 2, 2026
…#1333)

`chant emulator` is dispatched in cli/main.ts and had no reference page — the
only command in that position, and the reason it was also the only one missing
from the CLI overview. Documents the three subcommands, both flags, the `--json`
report other tools consume (behold's `serve --local` reads it), and the aws
Floci container it boots, all read off the handler and the capability rather
than inferred. Only aws declares an emulator today, so the page says that
instead of implying the others exist.

Writing it turned up the same orphan class on the main site that #1325 fixed
for the lexicons. Its sidebar is hand-maintained in docs/astro.config.mjs, and
two substantial pages were absent from it: the `chant migrate` reference and
the COMP001-007 composition lint rules. Both were reachable only by following
a link from another page. The main site now resolves in both directions — no
page without an entry, no entry without a page.

The tutorial sweep found one real path bug. fargate-lucene-efs-solr cited its
sources under `lexicons/aws/examples/fargate-lucene-efs/`, which is where the
example used to live; it has since moved to the root `examples/` tier that
contributing/examples.mdx documents for reference deployments. Twelve
references, all pointing at nothing.

Everything else checked out: every other `examples/<name>` path referenced
anywhere in the docs exists, every `npm run <script>` a tutorial tells you to
run is in that example's package.json, and every `just <recipe>` in a code
context is a real recipe.


Claude-Session: https://claude.ai/code/session_01Jp6SP7ZiavhoEB1AFuwwoJ

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.

1 participant