Skip to content

0002: Record only lasting rules, with their options and code ​

Status: accepted

Date: 2026-12-05

PR: #18

Context ​

PR Prep asks the human why each commit matters, and writes the answer into the commit body. Decision record 0001 also sends each "why" to a decision record. With both, the same reason could be in two places, and nothing said which reasons need a record. A record also did not give its date, the options that lost, or the code that implements it.

Options considered ​

  • Every why gets a record: the same reason would be in a commit body and in a record.
  • A record only when a human asks: docs-check would stop asking for records.
  • The commit body is the home of the reason: a record would become an index of commits.
  • Commit bodies and records both keep the reason: the copies could disagree.
  • The human writes the reason, or writes the record before the code: the agent would not draft it.
  • A workflow adds the pull request number after the merge: a workflow cannot push to main. The ruleset on main requires a pull request for every change.
  • Code links that point at a commit: the links would be harder to write.
  • A check of the code links in every record: old records would need edits when their code no longer exists.

Decision ​

Only a lasting rule gets a decision record. A lasting rule is a rule that changes a file that matches decisions.triggers in docs-map.yml. The reason for a one-off change stays in its commit body.

The record is the one home of the reason for its rule. A commit that follows the rule names the record with a Decision: NNNN trailer, and does not repeat the reason.

Each record has Status:, Date: and PR: lines, then the sections Context, Options considered, Decision, Consequences and Code. The knowledge-manager agent drafts the record, and PR Prep asks the human for the reason. The options that the human did not pick become the options considered. After PR Prep opens the pull request, it replaces PR: pending with a link in a new commit.

Consequences ​

Each reason is in one place, and a reader can find which options lost and why. docs-check fails a record that still says PR: pending. For this reason, the first run on a pull request with a new record reports a missing link, until PR Prep adds it. docs-check checks the code links of accepted records, so a record cannot point at code that is gone. A superseded record keeps its links as history. commitlint fails a Decision trailer that names no record.

Code ​