Repository navigation
docs(adr): add MADR front matter, a Status History and the ADR rules - #5270
Conversation
Plan #5225 as an OpenSpec change, and add the tests first: the reader of the alternatives check reads the front matter of an ADR, the docs module gives the body hash, the index and the problems of each record, and an invariant test holds the records of the repository to the rules.
adr.py reads the MADR 4 front matter with the front_matter plugin of mdit-py-plugins and yaml.safe_load, and the three prose patterns go. An ADR is in force when it is accepted, or has no status, and no ADR supersedes it. Its entry names the ADRs that amend it. docs/adr_records.py gives the body hash with no link target, the index that devops docs generate writes into docs/adr/README.md, and the problems of each record. mdit-py-plugins becomes a runtime dependency.
Each record 0001 to 0025 gets its front matter. Its notes at the top and its Status section move word for word into a last Status History section, and dated lines record the facts that are out of date. ADR 0003 becomes superseded by ADR 0017 and ADR 0021. docs/adr/README.md gives the rules, the template and the generated index. The scope adr is declared for the labels and the title check. The docs site gives each record status a title and an icon.
|
Measurements and test runs of this pull request. Tokens of the decisions that the alternatives check reads (
ADR 0003 is now superseded by ADR 0017 and ADR 0021, so it is no longer in force. ADR 0001 is in the request again. The margin under the cap is 837 tokens. The budget test of #5049 is not in the tree yet, and #5049 stays open. Words of the 25 records: 66,340 before. The bodies now hold 63,542 words, and the Status History sections hold the other 2,798 words word for word (the moved notes and Status sections). The new dated lines add 250 words. A script compared each moved note with the original text. fail-to-pass ( Scoped checks on the head: 588 covering tests pass ( Folded items: #4918 (the index) is the generated table of |
31e7961 to
a8f2d6c
Compare
docs/TESTING.md lists tests/invariants/test_adr_records.py, which the source tree test asks for. The constant of the front matter token type is _FRONT_MATTER_TYPE, a more exact name that bandit B105 does not read as a password.
Archive 5225-adr-front-matter-and-rules: the roadmap-alternatives spec reads the status of an ADR from its front matter.
a8f2d6c to
9ae81d8
Compare
Give each decision record 0001 to 0025 a MADR 4 front matter: status, date, roles, issue, links and body-hash. The notes at the top and the Status sections move word for word into a last
## Status Historysection, with dated lines for facts that are out of date. ADR 0003 is superseded by ADR 0017 and ADR 0021. No decision changes.docs/adr/README.mdgives the rules, the template and an index thatdevops docs generatewrites.adr.pyreads the front matter with mdit-py-plugins and PyYAML, and its three status patterns go, so the alternatives check keeps every record in force. A test fails on a missing status, a one-way link, an edit of an accepted body and a stale index. The scopeadris declared.Folds #4918 and #4617.
Closes #5225
Change:
openspec/changes/archive/2026-11-12-5225-adr-front-matter-and-rules/