docs/rfc/README.md's per-lifecycle tables are now generated between gen-rfc-index marker comments from each RFC's path (lifecycle/class), H1 title (optional 'RFC: ' prefix stripped), and filename date, sorted by date then filename — the one docs region every proposal wave edits and every concurrent branch conflicts on becomes derived state. scripts/rfc-index.ts owns the shared walker (closed lifecycle/class sets, structure rules, parseable-H1 requirement) and the renderer; gen-rfc-index.ts is the writer CLI; verify-rfc-classification.ts keeps the structure check and asserts the committed regions byte-match a fresh render (freshness subsumes the index-completeness check, since a generated-from-disk table is definitionally complete and correctly headed). A malformed H1 is a hard error in both directions, so the H1 is now load-bearing as the title source — the one nonconforming H1 (a status suffix duplicating the path) is normalized. Implements docs/rfc/implemented/process/2026-07-04-generate-rfc-index-tables.md (moved from proposed/ and amended to the shipped mechanics); the classification RFC's verify-only stance carries the supersession cross-link per implemented/AGENTS.md.
5.2 KiB
RFC: Classify RFCs by kind via path-encoded subdirectories
Status: implemented (proposed 2026-06-20, accepted 2026-06-20)
Context
docs/rfc/ grouped RFCs by lifecycle only — proposed/ / implemented/ / rejected/. Nothing recorded what kind of decision each RFC was. The index was one flat list per lifecycle, with no way to scan "show me every simplification" or "every testing-strategy decision." A wave of simplification RFCs landing on the same day made the gap concrete: a reader skimming proposed/ could not tell a new capability from a removal from a tooling-policy change without opening each file.
The repo's standing bias is mechanical quality gates over prose guidelines: a convention that isn't machine-checked rots. So a classification scheme here had to be enforceable, not an honor-system header.
Decision
Add a second axis — the RFC's class — and encode it in the path: {lifecycle}/{class}/yyyy-mm-dd-topic.md. The folder is the label. A file's location declares its class, the closed set is "these folders and no others," and the existing verify-md-links gate already protects the path rewrites the move required.
The closed set of six classes
| Class | Covers |
|---|---|
feature |
A new user- or model-facing capability. |
bug-fix |
Corrects a defect or closes a gap a postmortem surfaced. |
simplification |
Removes code, behavior, or surface area without adding a capability. |
architecture |
A structural decision about the shipped source — how packages relate, what the runtime vocabulary is. |
process |
Tooling, policy, or workflow around the code, not runtime behavior. |
testing |
Test infrastructure and strategy. |
The architecture / process line: architecture is about the source we ship; process is the surrounding tooling and workflow. This RFC is itself a process decision — it changes how the repo is organized and gated, not what the harness does at runtime — so it lives under implemented/process/.
Two gates
Both are doc-sync members, in the verify-md-wrap style (tsx ESM, verify-don't-generate, exit non-zero on the first violation):
scripts/verify-rfc-classification.ts— the closed set and index freshness. It asserts every file under a lifecycle folder lives in a class folder from the canonical set (a loose.mdat a lifecycle root, or an unknown class folder, fails), and that the README's marker-delimited index regions byte-match a fresh render from the tree (see generate the RFC index tables). The canonical class set lives as aconstinscripts/rfc-index.ts— the machine source of truth shared with the generator — and the index documents it in prose; the README's class descriptions stay hand-written, its tables are generated.scripts/verify-doc-refs.ts— source comments that cite docs. RFC paths are referenced not only from Markdown but from TypeScript doc comments (root-relative prose likedocs/rfc/implemented/testing/2026-06-19-acp-snapshot-tests.md).verify-md-linksnever saw those, so the reorg could have silently orphaned them. This gate scans repo-authored.tsunderpackages/**andexamples/**(excluding builtlib/andvendor/) fordocs/….mdtokens, resolves each root-relative, and asserts it exists. It requires the.mdextension so extensionless prose (docs/postmortem/0001,docs/architecture.md § plugin checklist) is left alone.
Rejected alternatives
- A
Classification:prose line in each file (next toStatus:), parsed by the gate. Workable, but it duplicates into the file a fact the path can already carry, and a line can disagree with its folder. Path-encoding makes the label and its storage the same thing — there is nothing to keep in sync. - A
refactorclass. It overlapssimplificationalmost entirely; the only discriminator anyone reached for was "does observable behavior change?", whichsimplificationalready encodes (it does not). One class, not two. - Auto-generating the README index from the filesystem. Rejected here to keep the index hand-written; superseded by generate the RFC index tables once stacked proposal waves made the hand-written tables the repo's most conflict-prone docs region — the tables are now generated between markers while the surrounding prose stays curated.
Consequences
- Every RFC now sits under a class folder, and the index groups by class within each lifecycle. A reader scans one heading to see all simplifications, or all testing decisions.
- Two more fast tsx scripts in the
doc-syncchain; no new dependency (the mdast/GFM stack was already present forverify-md-wrap/verify-md-links). - Adding a class is a deliberate act: amend the
constinscripts/rfc-index.tsand the Classification section, not justmkdira folder. The gate rejects an unknown folder, so an ad-hoc class can't slip in. - Source-comment doc references are now gated too — a moved or renamed doc that a
.tscomment cites fails the pre-push hook, closing a drift classverify-md-linksstructurally could not see.