Reduce the rules to the ones that serve the decision record, and stop prescribing the commits inside a PR

Open
#54 8 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@c-w-z is already working on this.

Since Dec 1, 2026.

Assessment

This issue has not been assessed yet.

Description

type/feature
Problem to solve

Many open issues come from one premise: each commit inside a PR is the unit of the decision record, so the commits of a PR must be correct when the PR merges. The premise comes from CONTRIBUTING.md line 14 (merge commits keep the commits of a PR) and line 20 (one decision per commit). From it follow rules about how contributors commit and merge: rewrites of PR branches, separate move commits, empty commits, the rejection of squash merge and rebase merge, and a merge method that each user of the template must accept (README.md line 62). Each of these rules then made its own issues:

  • #42 and #50: a rewrite can lose a commit, and the rewrite procedure of #46 needs tests. #46 took 24 reviews.
  • #19 and #35: checks and tracing for move commits.
  • #49: the choice of merge method, and the stacks, forks, labels and recovery from a wrong merge method that follow from it.
  • #52: an empty commit for a decision to change nothing. No commit in the history uses this rule.
  • #53: a revert of a merge commit needs -m 1, and the same branch cannot merge again after it.
  • #36: 25 subjects for 12 final decisions, and 10 rewrites (https://github.com/c-w-z/commit-decision-record/issues/49#issuecomment-7300419325).

#38 separates the goal of a choice from its means. With that test, "one decision per commit" and "each PR has a reason" are means. The goal is one level higher: before a person or an agent changes something, they can find why it is as it is and which options were rejected. A means that the maintainer accepts breaks "one decision per commit": a squash merge with a good PR description. So that statement is too low to be the goal.

The current reasons already live in the docs. The Design row of Where to write in docs/doc-rules.md asks for "decisions, current reasons, accepted costs, rejected options". Git history holds why a decision changed, and the reasons of decisions too small for a doc. The rules about the structure of commits spend the most work on that last and smallest part.

When to write in docs/doc-rules.md gives the test for each rule: "The problem that it prevents is real." The rules below that fail it are the rules about the structure of commits. Their own costs occurred. The problems that they prevent did not.

Proposal

Make the unit of the record the commit that lands on the first-parent line of main. The template requires that this commit has the decision fields of Message format. It does not prescribe how contributors commit inside a PR, or which merge method a project uses:

  • With a squash merge, the landing commit is the squash commit. Its message is the PR description (squash_merge_commit_message=PR_BODY).
  • With a merge commit, the landing commit is the merge commit, with merge_commit_message=PR_BODY. A reader uses git blame --first-parent.

Then go through each rule. Goals, inferred and for the maintainer to confirm:

  • G1: before a person or an agent changes something, they can find why it is as it is and which options were rejected.
  • G2: an agent does not act on an overturned decision.
  • G3: a reader who did not see the conversation understands the text.
  • G4: an agent that follows a skill does not misjudge a result.
  • G5: main does not break by accident.

Constraint on every means:

  • C1: the work to maintain a means is less than the damage that it prevents. When to write in docs/doc-rules.md (condition 3) states it. README.md (The problem) gives it as one problem of records in separate files: "A record is one more step after the change. People skip it, or the record gets out of step with the code."

"Occurred" asks if the problem that the rule prevents occurred. It does not ask about the cost of the rule.

# Rule Serves Occurred Cost Proposal
1 main changes only through a PR (CONTRIBUTING.md line 12, the ruleset, .githooks/pre-push) G5 General protection Low Keep
2 One PR holds one group of decisions that a reviewer can judge alone (line 13) G1, review Yes. #36 moved a decision to #43 Low Keep
3 Merge with a merge commit (line 14, README.md line 62, allowed_merge_methods in the ruleset) Rule 6 No. It prevents reasons that a squash merge joins, and this repo never used squash merge #36, #42, #46, #49, #53 Remove. Each project chooses. The record is the landing commit
4 Rewrite the commits of a PR branch before the merge (line 15, commit skill lines 32 and 33) Rules 3, 6, 7 — A lost commit and cited hashes that left the branch in #36. #42, #50 Remove, with rule 3
5 Do not merge main into a PR branch, and the no-merge-commits job (line 16, ci.yml line 114) Rule 3: a merge commit brings the PR commits into main as they are — One CI job and rebases Remove. With a squash merge it does not apply. With a merge commit, the first-parent line does not show it
6 One decision per commit (line 20) One means for G1 No. The rule is in 752f048, the first commit, with no incident 25 subjects and 10 rewrites in #36 Make it a suggestion. The rule requires a reason in the landing commit
7 Moves and rewrites in different commits (line 21, PR template line 15) G1 through a move Yes, #4 had a mixed commit. The reason names git log -L, which does not follow a section to a different file (https://github.com/c-w-z/commit-decision-record/issues/19#issuecomment-7299443484) #19, #35, rewrites Make it a suggestion. The message names the old and the new place (the Moves: field in https://github.com/c-w-z/commit-decision-record/issues/19#issuecomment-7278379627)
8 Write the reason when you make the decision (line 22) G1 Yes. #38 lists four reasons that the maintainer stated days later Low Keep
9 A decision to change nothing gets an empty commit (line 23) G1 No. No commit uses it (#52) #52. git blame cannot find such a commit Remove. A row in Rejected options holds such a decision
10 Message format: Why, Rejected, Cost, Evidence, Supersedes (lines 25 to 45) G1, G2 Yes. The README example answers from the Rejected line of 80dc651 Medium Keep, on the landing commit
11 Text for outside readers (lines 47 to 53, the cold-read check of the pull-request skill) G3 Yes. #36 cited the conversation and hashes that were not in the branch Low Keep
12 PR template: Why and Summary (lines 57 to 62) G1, G3 — Low Keep. With a squash merge, they are the commit message
13 PR template: Validations (line 64, template lines 17 to 19) Evidence for the review Yes, #34 Low Simplify (#34)
14 PR template: the reason of each smaller decision goes in the Why of its commit, and To reviewer names the commits that only move (template lines 5 and 15, CONTRIBUTING.md line 63) Rules 6, 7 — Low Remove, with rules 6 and 7
15 Before you commit (lines 70 to 77) G1, G2, G3 Yes Low Keep
16 History: docs give only the current state, and history is read on demand (lines 81 to 85, Current state only in docs/doc-rules.md) G2 The problem of the README Low Keep
17 Rejected approaches rows: Squash merge, Rebase merge, Merge main into a PR branch, Never rewrite pushed commits (lines 91 to 94) Rule 3 — — Rewrite: remove them, or give the reasons of the new rules
18 Rejected approaches rows: Design: line, Do not repeat a reason that a doc gives (lines 95 and 96) G1 Yes (9c27000, abb7ff28) Low Keep
19 docs/doc-rules.md: When to write, Where to write, the layers of AI text, Precedence G1, G2, cost Yes Low Keep. When to write is the test of this issue
20 docs/doc-rules.md: a command in a skill fails on wrong input (Commands in Writing style) G4 Yes (fcba19d) Low Keep
21 docs/doc-rules.md: ASD-STE100 sentences (Sentences in Writing style) G3, G4 No incident found Applies to every text The maintainer decides
22 trace-decision: "Do not use git log --first-parent" (SKILL.md line 41) Rules 3, 6 — — Rewrite: read the first-parent line first, and also read the history before this change
23 review-pr, review-design, review-architecture Review quality Yes (#45) Read only when used Keep. They do not prescribe how contributors work
24 commit skill: check the branch, commit only your changes, no --no-verify, no force-push of main G5 Yes Low Keep. Lines 32 and 33 about rewrites go with rule 4
25 CI jobs changes, markdown-links, trace-decision-tool G3, G4 Yes Low Keep
26 AGENTS.md: languages, the commit skill for each commit, ask before a push G3, G5 Yes Low Keep

Count: 16 keep, 7 remove (rules 3, 4, 5, 9, 14, 17, and the CI job and ruleset setting with them), 4 rewrite or make a suggestion (rules 6, 7, 13, 22), 1 for the maintainer (rule 21).

If the maintainer accepts the proposal:

  • #49 is answered. #42, #50 and #52 are no longer needed.
  • #19 shrinks to a warning when a PR moves content and its description names no old place.
  • #53 shrinks to the format of a revert message.
  • #35 and #45 get smaller.
  • #34 is answered by the change to Validations.

Costs:

  • The record has the size of a PR, not of a commit. A PR with two decisions gives one commit with two reasons, and the reader decides which reason applies to a line.
  • The history before this change has its reasons in the commits inside PRs, with empty merge commit messages. trace-decision must read both forms.
  • With a merge commit, a reader must use git blame --first-parent. A reader who forgets it lands on a commit inside the PR, which has no rule for its message.

Decisions for the maintainer:

  • Confirm or correct G1 to G5.
  • Accept the landing commit as the unit of the record. This overturns the Squash merge row of Rejected approaches in CONTRIBUTING.md (line 91) and the condition in README.md line 62.
  • Decide each row. Rule 21 has no proposal.
  • Does the template keep one merge method as the default, or leave the choice to each project?
Version

beeabab

More information
Dominant language
Shell
Stars
1
Forks
0
Avg merge
6h 59m
Merged PRs (30d)
26

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from c-w-z/commit-decision-record

All issues in c-w-z/commit-decision-record

Similar issues

More Shell/Bash issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.