fix(release): align correction sections, retries, and merged ledger semantics

Codex review + test findings on the pipeline convergence:
- candidate changelog provenance now validates the same section the
  renderer publishes (correction tags may carry their own heading) via a
  shared correctionVersionForTag helper
- guard_existing_public_release accepts a canonical proofless body with
  intact dependency evidence, matching the renderer's documented
  proof-omitted-at-limit state; retries re-append the proof
- ledgerFor regains main's noteReferences threading so prose-cited PRs
  keep their contribution-record rows, and the ledger/verify tests pin
  the merged entry shape (externalReferences) and highlight gate
This commit is contained in:
Peter Steinberger
2026-07-10 01:43:38 -07:00
parent 336e43c314
commit c2b4ac02da
7 changed files with 76 additions and 19 deletions

View File

@@ -230,15 +230,22 @@ function compactReleaseNotes(section, repository, tag) {
].join("\n");
}
export function releaseNotesSectionForTag(changelog, version, tag) {
// Numeric-correction tags (vX-N) prefer their own exact heading when the
// changelog carries one; otherwise they fall back to the base version.
export function correctionVersionForTag(tag) {
// Numeric-correction tags (vX-N) may carry their own changelog heading;
// alpha/beta prerelease tags never do.
const taggedVersion = tag.replace(/^v/u, "");
const isCorrection =
/-[1-9][0-9]*$/u.test(taggedVersion) && !/-(?:alpha|beta)\.[1-9][0-9]*$/u.test(taggedVersion);
if (isCorrection && taggedVersion !== version) {
return isCorrection ? taggedVersion : undefined;
}
export function releaseNotesSectionForTag(changelog, version, tag) {
// Correction tags prefer their own exact heading when the changelog carries
// one; otherwise they fall back to the base version.
const correctionVersion = correctionVersionForTag(tag);
if (correctionVersion && correctionVersion !== version) {
try {
return extractChangelogSection(changelog, taggedVersion);
return extractChangelogSection(changelog, correctionVersion);
} catch {
// The correction has no dedicated section; use the base version below.
}