Skip to content

fix(release): CHANGELOG.md renderer splice contract + 44 k-line drift sweep (ADR-0913) - #406

Merged
lusoris merged 1 commit into
masterfrom
fix/changelog-renderer-and-drift
May 31, 2026
Merged

lusoris merged 1 commit into
masterfrom
fix/changelog-renderer-and-drift

Conversation

@lusoris

@lusoris lusoris commented May 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

scripts/release/concat-changelog-fragments.sh used ^## [^[] as the "end of Unreleased block" sentinel. 84 of 102 in-tree fragments contained ## headers in their bodies (the redundant section name ## Fixed or a per-PR descriptive title like ## Vulkan submit-pool migration); each tripped the sentinel and the next --write preserved the post-trip tail as if it were release history. Each cycle inflated CHANGELOG.md by ~3 kB. Master tip 544299fae1 had drifted to 59 757 lines (~95 % duplicated). PR #332 / #383 / #401 all flagged "pre-existing drift" without rooting it; PR #384 / ADR-0892 identified the section-hygiene angle but explicitly deferred the regeneration.

Root cause: the awk pattern in the splice passes used ^## [^[] as the boundary, which matched any ## Foo except ## [Foo]. Fragment bodies legitimately contained ## Foo shapes; the regex was lying about its invariant.

Fix: boundary regex anchored on ^## \[ — release-please's only header shape (## [vX.Y.Z] - YYYY-MM-DD and ## [Unreleased]).

Per-issue fix count

Issue Count
Renderer awk-boundary regex 1 (both passes share BOUNDARY_REGEX)
Fragments with stray ## headers normalised 84
Fragments with redundant ### Section first-line stripped 18
Fragment dirs outside Keep-a-Changelog set relocated 2 (perf/, performance/)
Fragments renamed perf-<topic>.md under changed/ 32
Renderer edge cases added 3 (empty-skip + unknown-dir-warn + h1/h2 demoter)

CHANGELOG.md diff size

Metric Pre-fix Post-fix Delta
CHANGELOG.md lines 59 757 15 050 −44 707
^## headers in file 155 1 −154
--write idempotency broken clean —

ADR-0108 deliverables

  • Research digest — docs/research/0913-changelog-renderer-and-drift-2026-05-31.md
  • Decision matrix — docs/adr/0913-changelog-renderer-splice-contract.md §Alternatives considered
  • AGENTS.md invariant note — scripts/AGENTS.md: splice contract plus fragment hygiene
  • Reproducer / smoke-test command — Research-0913 §Reproducer plus test plan below
  • CHANGELOG fragment — changelog.d/fixed/changelog-renderer-and-drift.md
  • Rebase note — docs/rebase-notes.md (in-flight-branch impact plus resolution)
  • state.md row — Recently closed § T-CHANGELOG-RENDERER-SPLICE-AND-DRIFT-2026-05-31

Test plan

  • bash scripts/release/concat-changelog-fragments.sh --check → exit 0 (no drift)
  • bash scripts/release/concat-changelog-fragments.sh --write && bash scripts/release/concat-changelog-fragments.sh --check → idempotent
  • Inject fake ## [3.0.0-lusoris.1] - 2026-06-01 after Unreleased + re-run --write → release-section preserved unchanged
  • pre-commit run --files <touched> → all checks pass
  • Required Checks Aggregator (will run after gh pr ready)

Relation to PR #384 / ADR-0892

PR #384 introduced the changelog.d/perf/ → changelog.d/changed/perf-*.md migration and the revert/security/style Conventional-Commits additions to release-please-config.json. It explicitly deferred the CHANGELOG.md regeneration sweep. This PR completes the deferred work + roots the actual renderer bug PR #384 missed. If PR #384 lands first, this branch's perf/ renames become a no-op on rebase. If this PR lands first, PR #384's renames become a no-op.

Out of scope

  • A --lint mode that fails on stray ## in fragment bodies (render-time demoter is enough; lint is incremental polish).
  • The pre-existing docs/adr/README.md drift (201 rows have no fragment-file backing under _index_fragments/; that's a separate back-fill PR).

🤖 Generated with Claude Code

@lusoris
lusoris marked this pull request as ready for review May 31, 2026 12:49
@lusoris
lusoris force-pushed the fix/changelog-renderer-and-drift branch from b0ff3bc to 4671bcf Compare May 31, 2026 12:49
@lusoris
lusoris merged commit 06bfd0a into master May 31, 2026
30 of 32 checks passed
@lusoris
lusoris deleted the fix/changelog-renderer-and-drift branch May 31, 2026 12:49
@lusoris lusoris added this to the 1.0.0 — First release milestone Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant