Skip to content

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

Closed
atrawog wants to merge 2 commits into
mainfrom
feat/fix-finalize-guard
Closed

atrawog wants to merge 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.2117.md (H1 rewritten to # 2026.232.2117). 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

Review — PASS

Head SHA: 8c8045dfb811697bc4a8b6fd7fe7d1097db7cbe3 (branch: fix/ci-auto-merge-finalize-guard / current head on PR)

Security screen: PASS — no scope mismatch (workflow tag_ver + finalize-guard fix, harness, runblock export, CHANGELOG all accounted for in the body), no secrets/exfiltration, no supply-chain change, no guardrail weakening. The auto-merge workflow edits preserve every existing gate (wait-all-checks → finalize → API validator re-run → re-validate → auto-merge → tag) and strengthen the already-finalized guard (marker must carry its own basename stamp; prose collision regression S24 shipped). The sdk v0. tag scheme is inert on non-sdk repos, matching the body's claim.

Checklist: All applicable rules PASS or NA. Verified from the CURRENT diff: single atomic commit; CHANGELOG 2026.232.0003.md present with CalVer filename + matching # 2026.232.0003 — <title> H1 (flagged: placeholder — engine renames it to the merge stamp at merge, non-blocking); paste counts are internally consistent (108 assert calls in the harness = pasted 108 passed, 0 failed; negative run 105+3 consistent with S24); tag_ver logic correct for the three stamped scenarios (S21 v0.2026232.733, S22 v0.2026231.1234, non-sdk v2026.231.1234); workflow ↔ de-templated runblock are byte-consistent where they overlap; <repo> runblock + harness placement in .github/scripts/` is layout-correct (placement: CORRECT); ci/config change class — no runtime/candy/disposable bed applies, and the self-gated live landing (this PR's own engine run) unob-servable pre-merge is covered by the deterministic stub harness + canary narrative, so nothing blocks on that absent proof.

Verdict: PASS


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

View action run

@github-actions

Copy link
Copy Markdown

Review — BLOCK

Head SHA: 5d72bf36a2f1cd94475153a5baa142dcf52bb611

Change class: ci/config — auto-merge workflow (auto-merge.yml), stub-gh harness + de-templated runblock (.github/scripts/), CHANGELOG entry.

Blocks

  1. A1 — the PR body does not end with the Assisted-by: attribution footer; the engine's body-append (shipped in this PR's runblock) is the cause. The current body ends with the ## Auto-merge finalization note, which the engine appends AFTER the Assisted-by: line (.github/scripts/auto-merge-runblock.sh, the gh pr edit --body-file - append block). A1 requires the body to END with the *Assisted-by: <Harness> <Provider Full Model Name> (<confidence>)* line. The engine's append must insert the note BEFORE the attribution footer (or otherwise preserve the footer as the last line) — in both the workflow's run block and the runblock — so every finalized PR body still ends with the footer. This PR's own body is the live demonstration of the defect: the engine ran on this PR, appended the note, and the resulting body no longer satisfies A1.

  2. A1 — compliance section incomplete. The body's Project-rulebook compliance section answers R1–R6 but does not state N/A — <reason> for R8 (no generation changes) / R9 (no binary) for this ci/config change class, as A1 requires every applicable rule to be answered.

Comment intake: the single prior github-actions[bot] review (PASS on head 8c8045dfb811) is verified-non-blocking — its substance (108-assert count, tag_ver logic, placement, placeholder-rename prediction) re-derives correctly against the CURRENT diff; its head-SHA reference is superseded by the engine's finalize commit, which the review itself predicted.

Verdict: BLOCK


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

View action run

@atrawog

atrawog commented Aug 22, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by the final org-wide architecture (bot-token Contents-API rename + workflow_run tag sweep).

@atrawog atrawog closed this Aug 22, 2026
github-actions Bot pushed a commit that referenced this pull request Nov 14, 2026
* feat(vm)!: delete the authored body from the contract

#304 unit 8, the contract leg. The vm body lives in the plugin that serves
the kind (plugin-substrate#42/#46), its tests moved there first (#43/#45), the resolve arm
decodes straight into the envelope (#44) and loaderkit names the envelope (sdk#514) - so
this contract stops declaring the body.

Deleted: #Vm's seventy-three-line body, the #VmValue twin in node.cue, the four
vocabulary tables only the body cited (_backend, _machine, _vmFirmware, _vmKind) with
their four public re-exports, and the spec-side copies of the tests that moved
(TestVmBackendKrunCrossRules, TestVmKrunDefaultsMaterialize, TestVm_MCPProvideSchemaParse,
TestVm_MCPProvideYAMLRoundTrip).

KEPT, deliberately and measured: the resolve envelope #ResolvedVm and every def it cites
(#VmSource, #VmNetwork, #VmSsh, #VmCloudInit family, the sixty #Libvirt* defs, #VmKrun,
#VmSnapshot), #VmBackend/#VmBackendName (cited by #Deploy and the spec.VmBackends
generator), and the tables the keepers cite. VmSpec repoints to ResolvedVm.

Proven by the ASSEMBLED build: charly + this contract + sdk + all 63 plugins at their
merged mains builds clean (rc=0), where it failed on spec.Vm before the consumers landed.

Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)

* fix: drop the helpers and imports the moved tests left behind

The go CI job's golangci-lint named two unused functions (allErrors in the engine-vocab
test, loadSchema in the mcp-provide test) and the compiler then named the imports those
deletions orphaned. All removed; the suite is green and the generation reproducible.

Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)

---------

Co-authored-by: aitrawog <[email protected]>
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