The ADR index is generated from the ADR files, not committed
Date: 2026-11-30
Area: docs, process, website
Related: ADR 0203,
ADR index: Records, #2435
Context
docs/adr/README.md listed every ADR, and each new ADR added its entry after the same last line. Two pull requests
that each added an ADR therefore conflicted in that file. ADR 0203
gave the file Git's union merge driver in .gitattributes, so git merge and git merge-tree kept both entries,
but GitHub's merge ignores merge drivers: once one of the two merged, GitHub reported the other as conflicting and
gh pr merge refused it until the branch merged main again. Each such merge gave the branch a new head and a fresh
full CI run. scripts/adr.ts check also had to verify that the committed list named every ADR exactly once.
Decision
The list of ADRs is not committed. It is generated from the files in docs/adr: every file named NNNN-slug.md,
in number order, titled by its first level-1 heading without a leading NNNN -. scripts/lib/adr-index.ts
generates it, and two places read it:
npx tsx scripts/adr.ts indexprints it as a Markdown list.- The docs site adds it to the end of the ADR index page's "Records" section when it builds the page, through a
remark plugin in
website/source.config.ts, so the HTML page and its Markdown version both carry it.
docs/adr/README.md keeps the numbering rules and links to the generated list. scripts/adr.ts new reserves a
number and writes the ADR's file only, and scripts/adr.ts check keeps the numbering checks of ADR 0203 (one file
per number, and a reservation naming the file for every ADR after 0202). The index checks are gone: a generated list
names every ADR once by construction. .gitattributes no longer sets a merge driver for the README.
This amends ADR 0203 where it says that new adds the index entry, that check verifies the index, and that the
index merges with the union driver.
Considered and not taken:
- A committed list laid out so that additions never touch the same lines, such as blank lines between entries or one file per entry. Git's three-way merge still conflicts when two insertions land at the same place, which is where every new ADR goes, and the check would still be needed.
Consequences
Two pull requests that each add an ADR change only their own files under docs/adr, so neither conflicts with the
other on GitHub. A reader of docs/adr/README.md on GitHub sees no list there; the page links to the docs site's
list, and GitHub's listing of the directory shows the files in number order. An ADR's title in the list is its
heading, so a title is changed in the ADR itself. During next dev, a new ADR file shows on the index page once the
README is recompiled; a full build always lists every file.