Skip to content

docs(adr): add MADR front matter, a Status History and the ADR rules #5225

Closed

Description

@dan-petty

Problem or Motivation

The architecture decision records in docs/adr/ have no structure for their status, and no rule controls their life:

  • The 25 records hold 66,287 words. Only 8 have 1,000 words or fewer.
  • Records 0001 to 0017 have no status section.
  • 38 of the 49 commits that changed docs/adr/ since 2026-10-25 edited an accepted record in place.
  • The records in force give the alternatives check 8,464 tokens against its cap of 8,192 tokens, so the check leaves out ADR 0001 and ADR 0003. Status prose is 1,121 of those tokens.
  • src/devops_cli/roadmap/adr.py reads the status from prose with three regexes (_STATUS_VERB, _SUPERSEDED_BY and _SUPERSEDES, lines 37-43).

This pull request changes no decision.

Proposed Solution & Architectural Design

Bookkeeping only. The pull request holds the status keys, the existing notes moved word for word into a Status History, dated lines for facts that are out of date, the mark on ADR 0003 (superseded by ADR 0017 and ADR 0021), the README with its index, and the parser. It folds #4918 (the ADR index) and #4617 (the link from ADR 0021 to ADR 0022).

  1. Add docs/adr/README.md. It holds:
    • The scope rule: a record is for a choice of structure, a quality attribute, a dependency or tool, an interface, or a process that is difficult to reverse. A value, a permission, a row, a timeout or a rename goes to the spec and the issue.
    • The MADR 4 template and the status values: proposed, accepted, rejected, deprecated, superseded.
    • The approval rule: an agent writes proposed, and the owner's merge accepts (decision-makers: [owner]).
    • An index that a program generates from the front matter.
    • CONTRIBUTING.md:26 and :205 link the README and do not copy it.
  2. Give each record 0001 to 0025 MADR 4 front matter: status, date, decision-makers, issue, supersedes, superseded-by, amends, amended-by, tracker and a body hash. Move the existing top notes and Status sections word for word to ## Status History.
  3. Freeze accepted bodies. After acceptance, a pull request can only change the status keys, add one dated Status History line or fix a broken link. The index test computes the body hash again, so an edit in place fails.
  4. One form for a Status History line, 30 words at most: YYYY-MM-DD: Amended by ADR NNNN, section S | Amended by the owner decision in #N, section S | Superseded by ADR NNNN | Fact out of date: <what> (#N) | Living detail moved to <path> (#PR). The pull request that makes a fact of a record wrong adds the line (AGENTS.md rule 8). An agent never edits the body of an accepted record.
  5. Add these Status History lines: 0001 (ROADMAP.md, board fields, milestones), 0006 (where the living detail is; githubkit 0.17.0 prefers httpx2), 0007 (rule edit by fix(tests): repair the bwrap contract suite and gate it #5110), 0008 (go on feat(k8s): the argo workflows controller runs in its own namespace under argo cd and deploy-stack, and a --version workflow measures start-up and api-server load for the go/no-go on moving the roadmap jobs onto it #1535; pins and replicas live in the manifests), 0009 (issues only since feat(release): release-please makes every release from main #1952; replicas), 0015 (permission sets in constants.py and the github-app-identity spec; replicas), 0017 (triage lane; 5-minute sweep), 0021 (edits by docs(adr): add the resolve, group, split and step rows #4792, docs(adr): start the watch row in mode on #5056 and feat(roadmap): a fix-plan step repairs a plan PR with open findings #5061; the order is in feat(roadmap): move Service work to Workflows and Valkey #4517; new rows go in their OpenSpec change), 0022 (link to 0021), 0023 (tracker feat(roadmap): track the project brain #4624), 0024 and 0025 (Zensical, feat(docs): move the docs site to Zensical with a full nav and version #5183).
  6. Supersession: the new record sets supersedes, and the same pull request sets status and superseded-by on the old record. A link that goes only one way fails the test. The new record restates each rule and each rejected option that still holds, because the alternatives check drops superseded records. A superseded record is never amended. After a third amendment, or when a body contradicts the code, the next change is a supersession.
  7. Length: the body of a new record has 1,000 words or fewer, its title 10 words or fewer and its slug 60 characters or fewer. Designs, catalogues, row tables, cutover plans, caps and measurements go to OpenSpec changes and specs, to settings or to docs, with a link under More Information.
  8. One Considered Options section. Each bullet ends with chosen., rejected, because <reason>. or deferred until <condition>.. Each record has a Confirmation section that names its test, CI row or metric.
  9. src/devops_cli/roadmap/adr.py reads the front matter with the front_matter plugin of mdit-py-plugins (pinned in pyproject.toml and uv.lock) and yaml.safe_load, and drops _STATUS_VERB, _SUPERSEDED_BY and _SUPERSEDES. Update tests/roadmap/test_roadmap_adr.py. An OpenSpec change updates openspec/specs/roadmap-alternatives/spec.md:393-401.
  10. Add a tests/invariants test: the index, the links in both directions, the body hash and the length of new records.
  11. Add the status entries to zensical.toml.
  12. Declare the scope adr: add the label scope/adr to .github/labels.yml and adr to the scopes list of .github/workflows/pr-title.yml (CONTRIBUTING.md section 4), because the titles of the ADR items use it.
  13. Merge ADR changes in batches. Each change of the ADR set changes adr_hash (alternatives.py:634-644, 1006) and makes every checked item due again. So all pure status changes go in this pull request, and the record pull requests merge one at a time in the planned order.

Cost to build (estimate, AGENTS.md rule 3): the parser change and the invariant test are small, about 0.5 M tokens and 3 hours elapsed. Keep: the test runs in the static rows in less than 1 second. No open tool keeps a body hash of a MADR record and checks links in both directions.

Target Subsystem

docs/adr/, src/devops_cli/roadmap/adr.py, tests/roadmap/test_roadmap_adr.py, tests/invariants/, openspec/specs/roadmap-alternatives/spec.md, zensical.toml, CONTRIBUTING.md, .github/labels.yml, .github/workflows/pr-title.yml.

Existing Tool Considered

MADR 4 (the template and the front matter keys), the front_matter plugin of mdit-py-plugins and PyYAML, which the project uses now. No new dependency.

Acceptance Criteria

  • A test fails on a record with no status, on a supersession link that goes only one way, and on a missing link.
  • A test fails when the generated index differs from docs/adr/README.md.
  • A test fails on an edit of the body of an accepted record, through the body hash.
  • A test fails on a new record with more than 1,000 words.
  • uv run pytest tests/roadmap/test_roadmap_adr.py passes, and adr.py holds no status regex.
  • Measured: the alternatives check fits every record in force under its cap of 8,192 tokens (fit_to_budget keeps each one, ADR 0001 and ADR 0003 included). The pull request comment gives the token count before and after.
  • uv run devops ci --check --only docs passes.
  • This pull request changes no decision.

Dependencies

None. Each other pull request that changes docs/adr/ waits for this one.

Related

Source: https://github.com/dan-petty/devops-cli/tree/main/docs/adr

Activity

  1. added
    source/agent
    type/docs
    status/new
    value/medium
    effort/high
    on Nov 12, 2026
  2. dan-petty commented on Nov 12, 2026

    @dan-petty
    OwnerAuthor
    • Scope: none. The title has the scope adr, and .github/labels.yml declares no scope/adr label. Add the label to the file to give the scope to this item.
    • Related: feat(docs): generate the ADR index with the status of each ADR #4918, which asks for a different change. Both work on the ADR index in docs/adr/README.md, but #4918 asks only for the generated index while the candidate adds the full MADR structure, Status History, rules, and parser changes around it.
  3. added
    priority/p2-medium
    on Nov 12, 2026
  4. added
    owner/agent
    status/in-progress
    and removed
    status/new
    on Nov 12, 2026
  5. added
    status/in-review
    and removed
    status/in-progress
    on Nov 12, 2026
  6. removed
    status/in-review
    owner/agent
    on Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/highpriority/p2-mediumsource/agenttype/docsvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions