Expand description
The merge-time stamp (increment-allocation track, Slice 1).
On merge, plan reads the pending files, assigns the next version(s) in
merge order and the next ADR number(s), and apply materialises them:
it runs scripts/bump-version.sh, inserts the changelog row(s), writes each
design/decisions/NNNN-<slug>.md and its index row, and deletes the consumed
pending files. Deleting what it consumes is what makes a re-run a no-op —
which is why version assignment and ADR materialisation are one atomic pass
(the entangled-by-delete finding, proposal #689 DECISION A).
The version bump is injected (see apply) so the whole flow is testable on
a fixture tree without running the real, side-effect-heavy bump script.
Structs§
- Plan
- The full stamp plan for the pending files present.
- Stamped
- One pending increment stamped with the version it will ship as.
- Version
- A semantic version
MAJOR.MINOR.PATCH.
Functions§
- adr_
file_ contents - The
design/decisions/NNNN-<slug>.mdfile contents: a# NNNN — <title>heading, a status line carrying the version, then the body verbatim. - apply
- Apply
plantoroot: write ADR files + index rows, insert changelog rows, runbumpfor the final version, then delete the consumed pending files. - changelog_
row - The changelog table row for a stamped increment.
- index_
row - The
design/decisions/README.mdindex row for a materialised ADR. - insert_
after_ table_ separator - Insert
rows(already newest-first) immediately after the separator line of the table whose header row containsheader_anchor(e.g."| Version |"). Anchoring on the header — rather than the first separator in the file — keeps the insert correct if another table (a legend, say) is ever added above. - next_
adr_ number - The next free ADR number: one past the highest
NNNN-*.mdindesign/decisions. Errors if the directory can’t be read — a swallowed failure would silently default to1and restart the ADR series. - parse_
workspace_ version - The
[workspace.package] version = "X.Y.Z"from aCargo.toml. Scoped to the[workspace.package]section: the first line-anchoredversion = "..."within that table, not aversionunder some other section (e.g. a stray top-level[package]) nor the inlineversion = "..."inside a dependency spec — the same valuebump-version.shrewrites. - plan
- Build the plan for
root: read the workspace version and the pending files, and assign each pending file (in filename order — a deterministic proxy for merge order) its own next version. Returns validation errors verbatim. - rule_
ledger_ rows - One
design/greenfield-status-rules.mdrow per rule idinccloses — empty ifinc.closes_ruleis empty.prrenders as#NNNN, or the empty string when it couldn’t be recovered (kept as an empty cell, not a placeholder like"unknown", so the table stays a clean Markdown grid either way).