Skip to content

fix(ci): align the auto-merge engine to the org-wide guarded canonical with the finalize-guard fix - #13

Merged
github-actions[bot] merged 2 commits into
mainfrom
feat/fix-finalize-guard
Aug 20, 2026
Merged

github-actions[bot] merged 2 commits into
mainfrom
feat/fix-finalize-guard

Conversation

@atrawog

@atrawog atrawog commented Aug 20, 2026 •

Copy link
Copy Markdown
Contributor

fix(ci): align the auto-merge engine to the org-wide guarded canonical with the finalize-guard fix

The change

The org-wide auto-merge engine (the sole merge executor: wait for ALL status
checks → CHANGELOG finalize at merge → API re-run of the validator → re-validate
→ native auto-merge → tag) is aligned to the guarded canonical with two
additions:

  1. The sdk tag-scheme guard (tag_ver()): sdk tags under its Go-module form
    v0.<YYYYDDD>.<HHMM with all leading zeros stripped> (a semver requirement,
    not an exemption). Inert on every non-sdk repo — this PR's repo included.
  2. The CHANGELOG already-finalized guard fix: the guard grepped the head's
    placeholder CHANGELOG file for the literal finalize-marker name. A
    placeholder whose prose legitimately described the merge-time finalize
    (naming that phrase) matched the guard, the finalize was silently
    skipped
    , and the release tag was minted at the author's placeholder stamp
    instead of the merge-time stamp — observed live on the org canary's previous
    cutover (tagged v2026.232.0001, the placeholder, instead of a merge-time
    CalVer). The guard now requires the marker to carry the file's own
    basename stamp — the exact form the finalize writes — which author prose
    cannot contain, so a genuine placeholder is always finalized to the
    merge-time CalVer and tagged with the merge stamp.

Change class

ci/config — the engine workflow (.github/workflows/auto-merge.yml), its
check-coverage (.github/scripts/auto-merge-harness.sh +
.github/scripts/auto-merge-runblock.sh), and the CHANGELOG entry. No code, no
candies, no runtime packaging.

How tested (pasted output, not a promise)

The check-coverage ships in this PR: the stub-gh harness drives the exact
(de-templated) engine run block against a stub gh + a real local git repo. 24
scenarios, 108 assertions. Scenario s24 is the regression for the guard defect —
a placeholder whose prose names the finalize marker must still be finalized to
the merge stamp and tagged with it. It is the check that fails without the
change
.

Fixed engine (bash .github/scripts/auto-merge-harness.sh):

PASS: S24 exit 0
PASS: S24 finalize fires (prose not read as marker)
PASS: S24 merged after finalize
PASS: S24 placeholder renamed
PASS: S24 H1 rewritten to stamp
PASS: S24 tag is the finalize stamp, not the placeholder
============================
TOTAL: 108 passed, 0 failed

The same harness against the old naive substring grep (the negative):

FAIL: S24 finalize fires (prose not read as marker)
FAIL: S24 placeholder renamed
FAIL: S24 tag is the finalize stamp, not the placeholder
TOTAL: 105 passed, 3 failed

How tested (live)

The canary for this batch (distro-arch PR #17) landed through the engine: the
placeholder was finalized to the merge-time CalVer, the re-run validator
re-approved the finalized head, the merge landed, and the tag was minted at the
merge stamp (v2026.232.2103 on the merged HEAD) — full narrative pasted in
that PR. This repo's engine run is the live proof here: it must finalize this
PR's placeholder to the merge-time CalVer and tag the merged HEAD with the
merge stamp. The engine is the only merge executor; the author does not
merge.

Project-rulebook compliance

  • R1/R10 — the mis-tag on the canary was root-caused (naive substring grep
    matching prose), not papered over; the failing-without-it regression scenario
    ships here with its negative proven above.
  • R2 — one coherent change: the engine alignment + its coverage.
  • R3 — no duplication: the harness is the single test for the runnable block
    (extracted from the workflow, committed once).
  • R4 — no workaround: the guard tests the actual invariant (the marker
    carries the file's own stamp) instead of a prose-colliding substring.
  • R5 — no stale references; historical mention of the old behavior lives
    only in the CHANGELOG.
  • R6 — no force-push, no direct push to main; the branch accumulates this
    author commit, then the validator squash-merges.

Attribution

Assisted-by: Claude Code deepseek-v4-flash:cloud (analysed on a live system) —
the stub harness ran deterministically; this PR's own engine landing is the live
proof that follows.

Auto-merge finalization

This run finalized the CHANGELOG at merge time: the placeholder was
renamed to CHANGELOG/2026.232.2116.md (H1 rewritten to # 2026.232.2116). The current diff
carries the finalized file.

…l with the finalize-guard fix

The org-wide auto-merge engine gains the sdk tag-scheme guard (tag_ver(), the
Go-module v0.<YYYYDDD>.<HHMM> form — inert on non-sdk repos) and the CHANGELOG
already-finalized guard fix: the check now requires the marker to carry the
file's OWN basename stamp (the stamp-suffixed form the finalize writes), which
author prose cannot contain — so a placeholder whose prose describes the
merge-time finalize is no longer mistaken for already-finalized, the finalize
always fires, and the release tag is minted at the merge-time CalVer instead of
the author's placeholder stamp.

Validated: the stub-gh harness (24 scenarios, 108 assertions, incl. the
prose-collision regression) passes; the same harness against the old naive
substring grep fails exactly that scenario. The check-coverage ships in
.github/scripts/.

Assisted-by: Claude Code deepseek-v4-flash:cloud (analysed on a live system)
@github-actions

Copy link
Copy Markdown
Contributor

Review — PASS

Head SHA: ecc4f64d56284e1eacecda61244a963d62ee8775 (PR #13, opencharly/.github)

Security screen: PASS — the sole engine change tightens the already-finalized guard (auto-merge-finalized → marker + the file's own basename stamp); no new endpoints, secrets, scope drift, or weakened guardrails. T2/T4 cleared.

Checklist: All applicable rules PASS or NA.

Verified from the CURRENT state:

  • A1/A3 — body accounts for all 4 diff items (workflow, harness, run-block fixture, CHANGELOG); pasted output for the positive and negative harness runs; attribution footer present at end, tier analysed on a live system honestly below fully tested.
  • Diff↔evidence internal consistency — 686+317+22+1 = 1026 additions, 1 deletion: matches meta. Assertion arithmetic cross-checks: the harness contains exactly 24 scenarios (s1…s24) and 108 assert calls; the negative run's 3 failures (108−3=105) are exactly the assertions that fail under the old substring grep (finalize fires / placeholder renamed / tag-is-stamp), while H1-matches-stamp and exit-0 correctly survive — the pasted output is coherent with the code.
  • A2/R10 bed-coverage — the change-class gate for a workflow change is the RDD harness; it ships in-tree with a regression that fails without the change (s24) and its negative is reproduced. RDD risk (prose colliding with the guard) named and proven by the bed result. The engine's run on this PR cannot precede this merge (self-gated); the harness cannot be re-run here, but nothing in the body/diff contradicts it.
  • B19 — CHANGELOG/2026.232.0003.md present, CalVer filename matches ^\d{4}\.\d{3}\.\d{4}\.md$, H1 # 2026.232.0003 — … matches, no placeholder/duplicate CalVer.
  • B13/R5/R6 — no generated-code drift (none touched), no candy (N/A ADE/SDD), one atomic commit, no escaped legacy/dead paths; old behavior referenced only historically in the CHANGELOG.
  • B16 — placement CORRECT: engine logic stays in .github/workflows/, fixture/test coverage in .github/scripts/; nothing belongs in core/sdk/candy.

Verdict: PASS


openrouter/deepseek/deepseek-v4-flash-0731 — pi-review-action.

View action run

@github-actions

Copy link
Copy Markdown
Contributor

Review — PASS

Head SHA: 735c68e0b1fa2bddcef65326ad5bbca9666141e2 (PR #13, opencharly/.github)

Security screen: PASS — the sole engine change tightens the already-finalized guard (auto-merge-finalized → marker + the file's own basename stamp); no new endpoints, secrets, scope drift, or weakened guardrails. T1/T2/T4 cleared.

Checklist: All applicable rules PASS or NA.

Verified from the CURRENT state:

  • Self-gated (rule 3) — the change under review IS the auto-merge engine; the head commit 735c68e0b1fa is the engine's own finalization commit (placeholder → CHANGELOG/2026.232.2116.md), i.e. the engine has already executed live on this PR. End-to-end green of the self-gated install is not observable pre-merge; the finalization commit + the in-progress validator re-review are the live proof.
  • Diff↔evidence internal consistency — 686+317+1+23 = 1027 additions, 1 deletion, 4 files: matches meta. Assertion arithmetic cross-checks: the harness contains exactly 108 assert calls across s1…s24 (+s3b/s4b/s10b variants); the negative run's 3 failures (108−3=105) are exactly the assertions that fail under the old substring grep (finalize fires / placeholder renamed / tag-is-stamp) while exit-0 and H1-matches-stamp survive — the pasted output is coherent with the code.
  • A2/R10 bed-coverage — the change-class gate for a workflow change is the RDD harness; it ships in-tree with a regression that fails without the change (s24) and its negative is reproduced. RDD risk (prose colliding with the guard) named and proven by the bed result.
  • B19 — CHANGELOG/2026.232.2116.md present, CalVer filename matches ^\d{4}\.\d{3}\.\d{4}\.md$, H1 # 2026.232.2116 — … matches the filename; already at the actual CalVer (no placeholder rename pending).
  • A1/A3 — body accounts for all 4 diff items; pasted positive/negative harness output; attribution footer present with tier analysed on a live system honestly below fully tested (the engine's live landing is the proof that follows). The engine's auto-merge finalization note is appended after the footer — a mechanical append by the change under review, not an authorship-disclosure failure.
  • B13/R5/R6 — no generated-code drift, no candy (ADE/SDD N/A), one atomic author commit + the engine's finalization commit, no escaped legacy/dead paths; old behavior referenced only historically in the CHANGELOG.
  • B16 — placement CORRECT: engine logic stays in .github/workflows/, fixture/test coverage in .github/scripts/; nothing belongs in core/sdk/candy.

Comment intake: the single prior github-actions[bot] review (PASS on head ecc4f64d5628) is stale-superseded on its B19 CalVer reference (2026.232.0003.md → now 2026.232.2116.md); its other conclusions independently re-verified against the current state.

Verdict: PASS


openrouter/deepseek/deepseek-v4-flash-0731 — pi-review-action.

View action run

@github-actions
github-actions Bot merged commit 4877eaf into main Aug 20, 2026
1 check passed
@aitrawog
aitrawog deleted the feat/fix-finalize-guard branch September 25, 2026 19:08
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.

2 participants