Skip to content

ci: add an advisory merge-decision script for one head - #3407

Merged
Birfy merged 6 commits into
mainfrom
dev/3393-merge-decision
Nov 27, 2026
Merged

Birfy merged 6 commits into
mainfrom
dev/3393-merge-decision

Conversation

@Birfy

@Birfy Birfy commented Nov 27, 2026

Copy link
Copy Markdown
Collaborator

Adds a read-only CLI that takes one head SHA plus the four gate readings and prints "recommend merge / hold" with reasons. It never merges, labels, comments or pushes; there is no fetch, writeFile or spawn in it.

Why: today the merge decision is assembled by reading four separate sources (required checks, risk label, QA evidence, review) and writing the reasoning by hand in a comment. This makes that reasoning reproducible and pinned to one exact head instead of remembered.

Slice (8 new files, +911, nothing else touched)

file role
merge-decision.mjs CLI
merge-decision-input.mjs input validation, risk label read
merge-decision-core.mjs verdict logic
merge-decision-render.mjs human-readable output
merge-decision-record.mjs paste-ready merge record
merge-decision-self-test.mjs self tests
merge-decision.test.mjs unit tests
fixtures/merge-decision-3406.json replay fixture for #3406

Decision rules

  • gate 1-3 fail -> hold, exit 1.
  • gate 4 missing label, or two labels -> hold, with the reason "record incomplete", not a tier statement.
  • gate head != input head, no run history, or malformed input -> invalid, exit 2: "green" alone cannot tell a clean green from a flake.
  • Tier T0-T3 never changes the verdict; it is printed as one advisory line (2026-11-26 decision).

Local, on this head

  • --self-test -> 10/10 cases as expected (incl. "T0 and T3 get the same verdict", "no history is invalid", "gate green but latest run not success -> hold").
  • node --test .github/scripts/merge-decision.test.mjs -> 15/15.
  • node --test .github/scripts/*.test.mjs -> 54/54.
  • Replay of ci: run the .github/scripts tests in the frontend job #3406 at 5072d22d -> RECOMMEND MERGE, with both flakes named: the required-gate rollup (04:28:04 failure -> 04:42:58 success) and runtime-image / Build and smoke under the manager contract (04:23:24 failure -> 04:37:06 success). No CI claim is made for this head here; the PR's own runs are what they are.

Since #3406 landed, .github/scripts/*.test.mjs runs in the frontend job, so the tests in this PR do run in CI.

Related #3393

@github-actions github-actions Bot added the risk:T3 Risk tier T3 (needs a human approval), set by the controller from the diff label Nov 27, 2026
@Birfy

Birfy commented Nov 27, 2026

Copy link
Copy Markdown
Collaborator Author

Review record — head 2eab81e5a31d90e5f318651691bf0a979150948e.

Decision: merge.

Slice: one advisory script (merge-decision) with its tests and fixtures, 8 new files, +911/-0, nothing else touched. It reads no network and performs no write; the six scripts contain no fetch / writeFile / spawn. That is the whole slice, and it is the stage-5 deliverable for "merge strategy scripted".

Tier: advisory only, per the 11-26 decision that the tier stops being a merge gate. The merge call is mine and it is recorded here.

Evidence, each bound to its tree:

  • Local on this head (ba77ee38): node --test .github/scripts/*.test.mjs 54/54; merge-decision.test.mjs 15/15; --self-test 10/10.
  • CI on head 2eab81e5: 17/17 success, suite 124302801160, updated 05:34:05Z, verified by QA Engineer. The merge ref c286c94d carries base 60e80980, so this reading covers this PR's own bytes but not coexistence with Guard comment writes against repeats, and audit orphan agent labels (report-only) #3395 or Add silent-revert and audit-merges report-only gates #3397. Landing-tree evidence is the merge_queue round; nothing here claims otherwise.
  • Not rebased on purpose: main moved to 6ce5a915, the two changes are disjoint, and rebasing would only invalidate a valid head.
  • Prose and commits are English, every commit carries Related #3393, no Fixes / Closes / Resolves.

This is a review of one head, not an acceptance or a parity claim.

@Birfy
Birfy added this pull request to the merge queue Nov 27, 2026
Merged via the queue into main with commit 4f280f0 Nov 27, 2026
17 checks passed
@Birfy
Birfy deleted the dev/3393-merge-decision branch November 27, 2026 05:49
@Birfy

Birfy commented Nov 27, 2026

Copy link
Copy Markdown
Collaborator Author

QA evidence (exact head) — posted by Lead on QA's behalf (QA has read-only access)

Head: 2eab81e5a31d90e5f318651691bf0a979150948e — tree ba77ee3823bde7a985e56f5f22dc9620be73a91a, single parent 606a431e. Diff vs base 60e80980: 8 files added, +911/−0, all under .github/scripts/.

Landed tree: 4f280f0f55eba192458a6464c34ab7425ea9293a — the merge-queue commit that main now points at, single parent 6ce5a915, tree aff52ffc.

Local runs — none of these is a CI reading. The test count depends on the base, so every number is stated with the ref it came from:

So a CI run reporting 54 on c286c94d is not a regression; it is the older base. The landing tree is 4f280f0f, not c286c94d, and refs/pull/3407/merge still points at the stale ref — anyone quoting it as green is quoting an old base.

CI — separate from every local number above. On 4f280f0f, FlyBot required checks completed with conclusion success at 2026-11-27T05:48:38Z (run 45947360958, job 140337001928). That job exits 1 unless all seven suites report success, so it is the aggregate gate on the landed tree, read from the check-runs API, not from a log line.

Not covered. The merge-queue round proves the landed tree passed the required gate; it does not re-prove the individual suite logs, and the upstream / and provenance / job names are unchanged from tests.yml (frontend, management, upstream, runtime-image, social-host, browser, provenance, required).

Refs #3393

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:T3 Risk tier T3 (needs a human approval), set by the controller from the diff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant