Repository navigation
auto-merge: the bee-gated merge autopilot for trinity PRs (closes #12145's trinity half) - #1742
Merged
Merged
Conversation
…ort dispatch half live, merge half dormant until the reviewer bee reaches trinity (refs Trinity-S-AI-DNA/t27#12145)
Contributor
X Brain Health CheckScore: 100.0/100 X Brain is above merge threshold |
Contributor
🧪 Brain Stress Test ResultsTests: 261/261 passed, 0 leaked |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The TRINITY merge autopilot (Trinity-S-AI-DNA/t27#12145, trinity half):
.github/workflows/auto-merge.yml, the cross-repo subset of t27'sAuto Merge Ready PRsgate, for pull requests on trinity main. Its pair PR is the cron card Trinity-S-AI-DNA/t27#12169 (specs/crons/trinity-auto-merge.t27); the card lands only together with this workflow, per the crons registry honesty rule.Owner approval (owner-approved-foreign label)
On 2026-10-25, in the agent session driving the T27F live lane (OpenCode, t27/trinity repos), the owner said, verbatim: "сам!! одобряю тебе сделать все owner-approved-foreign" -- approving the owner-approved-foreign label for the pull requests of this lane. This PR adds a GitHub Actions workflow (YAML), which is foreign code under the only-t27 rule; the label is applied for that reason.
The gate
Schedule every 10 minutes (
*/10 * * * *) plusworkflow_dispatch(with adry_runinput). For each OPEN pull request on trinity main:t27-work-reportblock and the head SHA has noT27 work reportcommit status (missing, or stale after a push -- a pushed head is a new SHA that carries none), dispatch the existingPR work report and blogworkflow (pr-blog-report.yml) withpr=N. A FAILURE status is not re-dispatched: that means the report block itself is missing or stale, which only the author fixes.T27 work reportcommit status issuccesson the head SHA;bee-reviewedlabel is present, was applied by the reviewer bee's own login (vars.BEE_REVIEWER_LOGIN, defaultt27-bees[bot]), and post-dates the head -- the head's time is the latest of its committer date, the first check run started on it, and the last force-push (the same rule t27's gate reads; every read fails closed);bee-reviewedlabel.The merge half is DORMANT by design
Owner's rule, 2026-10-02: "the Queen must not merge by herself!! the Queen only manages!" No reviewer bee runs on trinity yet, so the bee's login can have applied no
bee-reviewedlabel here, so the gate fails closed for every pull request and merges NOTHING until the reviewer bee reaches trinity. That is deliberate. The work-report recovery half is the part that works today. Not carried over from t27 (they live with the bee): the bee's own APPROVED review of the head and the discounted-check master look-back -- when the bee reaches trinity, those come with it.The workflow checks out nothing (no PR head is ever executed), uses only
contents: write,pull-requests: write,actions: write(the last for the dispatch), pins every merge with--match-head-commit, and treats a batch that merged nothing as a failure, as t27's gate does.{ "version": 1, "head_sha": "590eafd458692f294bef1fb98ab688434b569424", "summary": "The trinity merge autopilot: a scheduled workflow that recovers missing work-report statuses by dispatch and squash-merges only what a reviewer bee labelled after the head push.", "changes": [ ".github/workflows/auto-merge.yml: the Auto Merge Ready PRs sweep for trinity main, scheduled every ten minutes plus workflow_dispatch, mirroring t27's gate in the cross-repo subset", "dispatch half: every open PR on main whose body carries a t27-work-report block gets pr-blog-report.yml dispatched when its head carries no T27 work report commit status", "merge half, dormant by design: squash-merge only with a success T27 work report status, a bee-reviewed label the bee's own login applied after the head arrived, no failing required base check, and a mergeable PR", "no checkout anywhere: the workflow reads the API only, never executes pull request head code, and pins every merge with match-head-commit" ], "tests": [ {"command": "python3 yaml.safe_load on auto-merge.yml", "result": "the workflow YAML parses with the intended shape", "status": "passed", "evidence": "Loaded name, cron */10 * * * *, permissions and the five steps locally before the push."}, {"command": "bash -n on every run block", "result": "all five step scripts pass bash syntax checking", "status": "passed", "evidence": "Extracted each run block through the YAML parser and ran bash -n per block; every exit code was 0."}, {"command": "mirror read against t27 auto-merge-ready-prs.yml", "result": "head-arrival timing, label identity and fail-closed reads copied into the subset", "status": "passed", "evidence": "Fetched the t27 workflow via the API and compared each gate rule; the dormant mechanism is the LABELED_BY identity check."} ], "limitations": [ "The merge half merges nothing until the reviewer bee reaches trinity; that is deliberate, per the owner's rule of 2026-10-02.", "The bee's APPROVED-review identity gate and the discounted-check master look-back stay in t27; they arrive here with the bee.", "No live run yet: validated by local YAML and bash parsing plus the mirror read, not by a scheduled execution on GitHub." ], "tags": ["t27f", "autopilot"], "blog": { "title": "The bee-gated merge autopilot arrives on trinity", "summary": "A ten-minute sweep now guards trinity pull requests: it recovers missing work-report statuses by dispatch, and holds every squash merge behind the reviewer bee's own label arriving after the head.", "outline": [ "Trinity pull requests now have their own merge autopilot: a scheduled sweep every ten minutes that reads each open PR through the GitHub API and judges it against the same gate t27 built for its own lane.", "The live half is work-report recovery: a head whose T27 work report status is missing gets the existing PR work report and blog workflow dispatched automatically, so a failed run never leaves a pull request ungated.", "The merge half is dormant by design: it demands a bee-reviewed label applied by the reviewer bee's own bot login after the head push, and no reviewer bee runs on trinity yet, so nothing merges until it arrives.", "The gate mirrors t27's auto-merge-ready-prs.yml: label after head arrival, required checks green, a mergeable state, match-head-commit pinning, and a hard refusal to merge anything the bee has not reviewed." ] } }