Skip to content

Bind a PR's review PASS to its tip SHA (agent-merge gate) #215

Closed

Description

@hsliuustc0106

Goal (one observable behavior)

A merged pull request can be checked, mechanically, against the review it claims: a Verdict: PASS report that names the current PR head SHA. Before: "reviewed tip" is a rule in AGENTS.md and a skill's honesty contract, and nothing verifies it at merge time. After: a read-only, report-only workflow prints, for every PR, whether the tip has an independent PASS, and says why not when it does not.

This is the mechanism that makes standing auto-merge delegation for T0/T1 safe: an agent may enable auto-merge only when the gate can show a PASS at the tip being merged.

Acceptance criteria

  • .github/scripts/review-gate.mjs with pure, exported functions (parse a report, pick the deciding review, bind it to the head SHA), a --pr N by-hand mode and a --sha override, following risk-gate.mjs's shape.
  • Unit tests (node --test .github/scripts/review-gate.test.mjs, already swept by npm run verify) that fail without the change: stale SHA, self-review by the PR author, FAIL after PASS, non-reviewer author, missing tip, missing Ran:.
  • .github/workflows/review-gate.yml: pull_request, read-only token, base-branch code, base-missing fallback like risk-tier.yml, continue-on-error: true, not a required check and not in tests-ok's needs.
  • docs/autonomous-dev.md describes the record; AGENTS.md step 6 states the standing T0/T1 delegation and that the gate is its evidence.

Where it sits (file:line pointers)

  • .github/scripts/risk-gate.mjs (shape to follow), .github/workflows/risk-tier.yml (workflow shape)
  • .claude/skills/review-pr/SKILL.md (the report format the gate parses — unchanged)
  • AGENTS.md step 6, docs/autonomous-dev.md phases

Out of scope / do not touch

  • No LLM in Actions; no secrets; no new credentials (that is the delegation slice).
  • Do not make it a required check yet, and do not touch tests-ok, branch protection, or test.yml.
  • No posting, approving, merging or labeling from this workflow.

Activity

  1. added
    agent-taskWritten with the agent-task form; not approval for agents (that is agent-ready)
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Oct 17, 2026
  2. hsliuustc0106 commented on Oct 17, 2026

    @hsliuustc0106
    CollaboratorAuthor

    Claimed by the implementing agent. Branch feat/215-review-gate, worktree /tmp/flybot-215, cut from origin/main. One PR; .github/** keeps this T3, so a human merges it.

  3. added a commit that references this issue on Oct 17, 2026
    56b0538
  4. removed
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    on Oct 20, 2026
  5. removed
    agent-taskWritten with the agent-task form; not approval for agents (that is agent-ready)
    on Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions