feat: add canonical changelog section extractor #29
No reviewers
Labels
No labels
attention
blocked
blocker:ci-red
blocker:conflict
blocker:drill-pending
blocker:unrequested
bug
claimed
documentation
enhancement
epic
merge-next
needs-ruling
needs-triage
offsite
post-merge
ready
release
scope:docs
scope:guards
scope:labels
scope:release-flow
stale
state:addressing
state:bots-reviewing
state:building
state:needs-human
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: heavy-duty/ceremony#29
Loading…
Reference in a new issue
No description provided.
Delete branch "build/4-changelog-section"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #4
Summary
changelog_sectionimplementation<version> [<changelog>]Acceptance criteria
CHANGELOG.mdis intentionally omitted per the issue clarification: #11 owns its bootstrap and will backfill pre-#11 component entries.Verification
bash test/run.shbash .github/scripts/shellcheck-all.shbash .github/scripts/actionlint-all.shgit diff --check🔎 reviewing head
8b27cf61db🔎 reviewing head
8b27cf61dbVerdict: approve
Reviewed head
8b27cf61dbe22c266623704fd110e7c041540052against issue #4.Acceptance criteria
lib/changelog.shimplements$2 == versection matching;bin/changelog-sectionis a thin fail-loud wrapper that sources it and reorders args. #5 / #9 can import the function.bash test/run.sh→ changelog suite 16/16 (plus the other two suites on this branch, all green)bash .github/scripts/shellcheck-all.sh→ clean (includes the new scripts)testcheck SUCCESS on this headawkis mawk 1.3.4; awk body is identical to rig's found/body shape (no gawk-isms, no\x)Spec semantics (spot-checked)
0.7.0≠0.7.0-rc1, both directions)### Added\n\n- …changelog-section <version> [<changelog>], defaultCHANGELOG.mdCHANGELOG.mdomitted (pre-#11 waiver)Implementation notes (non-blocking)
changelog_section; the wrapper preserves box/cast's CLI contract with the new binary name in messages — right split for the dual entry points #4 asked for.(#83)from the refusal string is appropriate here; the teaching clause about stamping Unreleased before the tag is intact.No blockers. Ready for the rest of the panel.
Verdict: Approve — I agree with this as-is.
Reviewed tip
8b27cf61dbe22c266623704fd110e7c041540052against issue #4 (full contract after the 2026-07-22 CLI/CHANGELOG clarifications).Why this lands
lib/changelog.shmatches rig’s found/body shape at the pinned SHA: whole-field$2 == ver(so0.7.0≠0.7.0-rc1), heading not printed, leading blanks dropped, empty/absent both refuse as empty output.changelog-section <version> [<changelog>], defaultCHANGELOG.md, usage→2, missing file→1, empty/absent section teaching refusal. Sourced API stayschangelog_section <file> <version>for #5/#9.testis green.No blockers. No material nits that would change the design.
Approve — head
8b27cf61db.Verified, not eyeballed:
bash test/run.shunder mawk 1.3.4 — changelog suite 16/16. Whole-field match (0.7.0vs0.7.0-rc1, both directions), adjacent-section bleed, Unreleased isolation, em-dash and date-less headings, stamped-empty and absent-section refusal (exit 1 + teaching message), usage exit 2, missing-file exit 1, defaultCHANGELOG.mdpath, and the production-shaped fixture — all present and actually asserting failure modes, not just happy paths.release-notes.sh@a17903f: usage/no-such-file/refusal exit codes and messages preserved literally, modulo the program rename and dropping box's(#83)— correct, that number means nothing in this repo. Arg reorder (CLI<version> [<file>]→ function<file> <version>) is in the wrapper as specified.release-lib.sh@7f8a0e0: the awk program is byte-for-byte rig's found/body shape — nosedpass, per the issue.^##section logic outside tests finds onlylib/changelog.sh:18.CHANGELOG.mdin the diff, per the issue's 2026-07-22 clarification (#11 owns bootstrap).Local note:
test/labels-reconcile.test.shfails on my box withjq: command not found— missing local tool, unrelated to this diff; CI is green.Non-blocking nit: the wrapper's no-args check only validates
$1, same as box's original — fine as contract preservation, just noting it stays deliberately lenient about extra args.🔎 reviewing head
8b27cf61dbVerdict: approve — head
8b27cf61dbe22c266623704fd110e7c041540052, reviewed against issue #4's full contract (including the 2026-07-22 CLI-shape and CHANGELOG clarifications).I verified rather than eyeballed — independently of the other two reviews:
Against the pinned sources (fetched both at their SHAs):
lib/changelog.sh's awk program is byte-identical to rig'srelease-lib.shfound/body shape at7f8a0e0— early exit at the next heading, leading blanks dropped in awk (nosedpass),$2 == verwhole-field string compare.bin/changelog-sectionpreserves box'srelease-notes.shexecutable contract ata17903fliterally:<version> [<changelog>]arg order,CHANGELOG.mddefault, usage → exit 2, no-such-file → exit 1, and the teaching refusal message intact. The only deltas are the program rename in messages and dropping box's local(#83)— both correct for this repo. The wrapper reorders args intochangelog_section <file> <version>, so #5/#9 import the explicit-file signature as specified.Ran, on this checkout (mawk 1.3.4, same flavor as CI runners):
bash test/run.sh— changelog suite 16/16 (all three suites green: 96 checks total).shellcheck-all.sh,actionlint-all.sh,git diff --check— all clean.0.7.0-rc1requested when only0.7.0exists → refusal), trailing-space heading (## 0.7.0still parses,$2unaffected), last-section-at-EOF (body prints, no next-heading needed)./^## /+$2 ==) outside tests hits onlylib/changelog.sh:18.Acceptance criteria: (1) single implementation, importable by #5/#9 — met; (2) all specified cases pass in CI (CI
testis SUCCESS on this head), shellcheck-clean, mawk-compatible — met; (3) header comment links both histories at their pinned SHAs and states the convergence — met.CHANGELOG.mdcorrectly absent per the #11 waiver. Conventions hold:set -euo pipefailin the executable,set -uin the test file, comments carry the why.No blockers, no nits worth the builder's time. With this, all three panel verdicts approve the current head.
Review round summary
All three eligible bench reviewers approved current head
8b27cf61dbe22c266623704fd110e7c041540052; no changes were requested in this round.Verified across the round:
bash test/run.sh, shellcheck, actionlint, and CI pass under mawk-compatible behaviorHanding off to the human for the merge decision.