Skip to content

MANIFEST.md inventory drifts silently: generate it from the corpus instead of hand-maintaining it #131

Description

@mbeacom

What happened

While ratifying the pending ADR queue (#129), MANIFEST.md was found publishing contradictory governance state. It was not slightly stale — it had drifted independently for six records:

MANIFEST claimed Actual
19 records, ids 0001–0019 25 records, ids 0001–0025
13 accepted, 6 proposed 23 accepted, 1 proposed, 1 superseded
0003, 0006–0009 proposed all five accepted
"Six records remain proposed" one does (0005)

It was corrected by hand in fe4363a. That fixes the symptom, not the cause: the inventory is a hand-maintained mirror of state the corpus already defines, so it can drift silently again the moment a record is added.

Why a check is only half a fix

A guard that fails on divergence still leaves a human to hand-edit the table — which is exactly how it drifted. This repo already has the better pattern, twice:

  • Generate, then assert no diffbun run schema:emit && git diff --exit-code schema/adr.schema.json in clean-clone-builds. Same shape for the committed Action bundle (git diff --exit-code packages/ci/dist).
  • Read-only CLI, redirected"site:queue": "adr queue --format json > site/public/queue.json".

The data already exists

No new CLI surface is needed. adr graph --format json already emits exactly what the inventory needs:

{ "nodes": [ { "id": "0001", "title": "...", "status": "accepted" } ] }

So this is a renderer plus a gate, not a feature:

  1. scripts/emit-manifest.ts renders the inventory block and the counts from adr graph --format json, writing between stable markers in MANIFEST.md.
  2. bun run emit:manifest && git diff --exit-code MANIFEST.md joins the existing guards in clean-clone-builds (already a required check, so it cannot reach main stale).

This keeps it a repo-local guard, consistent with the reasoning scripts/check-doc-cli-versions.ts states in its own docblock for living in scripts/ rather than becoming CLI surface. The general question — whether adopters get a supported way to keep their own docs in lockstep — is scoped separately.

One wrinkle worth deciding

MANIFEST's table uses short hand-written labels (git-native markdown records) rather than record titles (Record architecture decisions as versioned markdown in git). Either the generated table switches to real titles (simpler, self-maintaining, slightly more verbose), or the script keeps a label map that itself needs a completeness check. Prefer real titles unless the width is genuinely a problem.

Done when

  • The MANIFEST inventory and counts are generated, not hand-written
  • A divergence gate runs in clean-clone-builds
  • Observed failing against a deliberately stale MANIFEST before it counts as coverage (ADR-0016)
  • The "Known-open, deliberately" prose stays hand-written — it is judgment, not derived state

Found in #129. Broader scoping in the companion issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions