Files
deepseek-harness/docs/rfc/implemented/process/2026-07-04-generate-rfc-index-tables.md
T
Tianyi Cui e6fad266a6 docs(rfc): define and enforce a uniform RFC format; adopt it across the corpus
Define the in-file RFC contract in docs/rfc/README.md § The file format:
the header block (`# RFC: <title>` plus a dateless Status enum
cross-checked against the lifecycle folder), the per-lifecycle body
skeleton (a Problem opener everywhere; Proposal/Alternatives considered/
Acceptance criteria/Risks in proposed/; present-tense Decision/
Consequences with proposal-era headings banned in implemented/; the
frozen proposal shape in rejected/), and a mandatory Alternatives
considered section with a date-fenced grandfather comment for pre-format
RFCs whose alternatives are not reconstructible from the record.

Enforce it with a new doc-sync gate, scripts/verify-rfc-format.ts, and
normalize all 112 RFCs to it: ~15 Status-line spellings collapse to the
enum, 29 Context openers become Problem, the 39 legacy-format XXX debt
markers are resolved and banned from reappearing, proposal-era sections
in implemented RFCs are rewritten to shipped reality (including the
web/fs/subagent seam RFCs' migration plans and test checklists, closing
the doc-tiers deferred-work item on the web seam), every RFC gains an
Alternatives considered section or the grandfather comment, and the
bilingual pair is re-mirrored and re-recorded.

Move the generated index tables out of README.md into a fully generated
docs/rfc/INDEX.md — gen-rfc-index now writes the whole file, and
verify-rfc-classification checks its freshness and rejects index-shaped
rows in the curated README — which makes room for the format contract to
live in the README front door instead of a separate FORMAT.md.

The decision record, and the first RFC written in the new format, is
docs/rfc/implemented/process/2026-07-05-uniform-rfc-format.md.
2026-07-05 22:58:25 +08:00

3.8 KiB

RFC: Generate the RFC index tables

Status: implemented

Problem

The RFC index's per-lifecycle/per-class tables list facts that are fully derivable: an RFC's path encodes lifecycle and class, its filename encodes the first-proposed date, and its H1 carries the title. A hand-maintained copy of those facts is also the repo's highest-contention docs hotspot: every proposal wave appends rows to the same few lines, so concurrent RFC branches conflict precisely there while agreeing everywhere else, and each conflict is resolved by hand-merging rows whose content the filesystem already knows. The classification RFC originally kept the index hand-written for curation's sake — but the curated part of the README is the prose, and the prose never conflicts; only the mechanical tables do.

Decision

Keep the curated prose; generate the list. The tables live in docs/rfc/INDEX.md, a fully generated file — the curated prose stays in README.md, which carries no index rows at all. scripts/rfc-index.ts is the shared source of truth — the tree walker (owning the closed lifecycle/class sets and the structure rules, including a parseable-H1 requirement) and the renderer (rows from H1 title with any RFC: prefix stripped, plus the filename date, sorted by date then filename, grouped as ### {Class} sections in canonical class order). Two thin consumers share it:

  • scripts/gen-rfc-index.ts (pnpm run gen-rfc-index) rewrites INDEX.md in full from the tree.
  • scripts/verify-rfc-classification.ts (a doc-sync member) checks structure, asserts the committed INDEX.md byte-matches a fresh render — the gen-cordis-catalog/verify-cordis-catalog pattern — and rejects an index-shaped row in the curated README. Freshness subsumes the index-completeness check: a generated-from-disk table is definitionally complete and correctly headed.

Adding, moving, or deleting an RFC means editing only the RFC file and running the generator; the classification RFC's rejected-alternatives record carries the supersession cross-link.

Alternatives considered

Why not marker-delimited regions inside README.md?

The first landed shape: the generator spliced the tables into README.md between gen-rfc-index marker comments, under each ## {Lifecycle} heading. Superseded by the whole-file INDEX.md once the README also absorbed the in-file format contract (the uniform-format RFC): a front-door README hosting hundreds of generated rows dwarfed its curated prose, and splice mechanics (marker pairs, heading checks, outside-region row detection) exist only to protect curated text that a dedicated generated file simply doesn't contain.

Why not the verifier-only model?

It catches mistakes but still makes every proposal edit a shared hotspot in a hand-maintained table, and a failed verifier is strictly more annoying than a generator for a purely mechanical row: the author has already named and placed the file; the index copy adds no information. This is the same hand-list-versus-derivation judgment the package-inventory proposal applies to tsconfig references and knip stanzas — applied to the one list that demonstrably conflicts.

Consequences

  • The generated file is explicit: its banner names the generator, there is no curated region to protect inside it, and the generator refuses to run on a structurally invalid tree.
  • A malformed or missing H1 is a hard error in both the generator and the gate — the H1 is now load-bearing as the index title source.
  • Concurrent RFC branches resolve index conflicts by rerunning the generator, never by hand-merging rows.