Repository navigation
Description
Problem
review.sh (154 lines) gathers the independent review of the squash message: it checks the draft names the pull request, snapshots the draft, the pull request, the description, every commit and the complete pinned diff as reviewer evidence, binds an optional operator note, runs the unattended gates and lint, then hands the evidence to the shared reviewer and writes the stamp that binds the draft, pull request, head, base, base commit and note. The review must run against pinned objects and must stop if the live pull request moved. It is under the shell freeze in #588.
Part of #324, within #588. Child 09 in #324's Children list. Replaces packages/agents/source/skills/merge-pr/shared/scripts/review.sh. The shared stamp, reviewer execution and trusted-policy reading are owned by #769, #771 and #763; this child consumes the contracts those establish, including their intentional corrections to the frozen behavior (for example how a trusted-policy read failure and freshness are handled), and does not require the old behavior byte for byte there.
Acceptance criteria
- AC1: Given a drafted
SQUASH_AGENTMSGand an open pull request, whenagentrepo merge reviewruns, then the reviewer is given the draft, the pull request summary with title, branches, head and base commit, the description, the full commit messages since the merge base and the complete pinned diff, and on approval a stamp is written that binds the draft digest, pull request number, head, base name, base commit and note digest. - AC2: Given a missing or empty draft, a subject without
(#<number>), a draft for another pull request, or a non-numeric argument, when the command runs, then it exits 1 with the shell script's message and no stamp. - AC3: Given
--note <file>, when the command runs, then the note content as copied when the review began is given to the reviewer, its digest is bound into the stamp, and a non-file path exits 1. - AC4: Given the pull request is not OPEN, or requires approval, when the command runs, then it exits 1, or exits 75 with
WAITING_REVIEW, before the reviewer starts. - AC5: Given, while the reviewer runs, the head, the base name, the base commit, the copied note, the draft, the draft's review copy or the repository configuration changes, when the review ends, then no stamp is written and the command fails.
- AC6: Given a required approval is withdrawn while the reviewer runs, when the review ends, then no stamp is written and the command exits 75 with
WAITING_REVIEW. - AC7: Given reviewer findings, when the review ends, then it exits 2 and prints "Fix every finding in SQUASH_AGENTMSG, then run review.sh again."
- AC8: Given the repository review policy file at the trusted default branch, when the review runs, then the policy is applied under the contract of refactor(agents): port trusted review policy and prompt assembly to Go #763 and the stamp records its digest.
- AC9: Given unattended mode, when the command runs, then it lints against the head and runs the unattended gates before the reviewer starts, and a refusal by either writes no stamp; given attended mode, then neither runs.
- AC10: Given a reviewer that times out or fails to run, or a hold from the bounded-review limits, when the command ends, then it preserves the status the shared reviewer gives, leaves no usable stamp and prints that nothing was stamped.
- AC11: Non-functional: the reviewer is chosen from machine configuration only, never from repository configuration; the read-only invocation of default reviewers and the deadline are the inherited contract of refactor(agents): port reviewer execution and verdict integration to Go #771 (a machine-configured custom reviewer command controls its own invocation, as in the frozen runner), and this command uses that shared runner; the command runs on macOS, Linux and Windows in CI.
Scope and non-goals
Scope: agentrepo merge review, the merge-specific evidence builder, freshness conditions and stamp bindings, and the review cases of merge-workflow.bats and workflow.bats.
Non-goal: the stamp and reviewer library itself, owned by #769 and #771; and the trusted-policy reading, owned by #763. Non-goal: the review criteria in review-squash-message. Non-goal: editing the shell script before child 14.
Approach
Meet AC1 to AC11 with failing cases first: reproduce the reviewer evidence on fixtures and compare the stamp bindings with the shell stamp, then exercise each freshness condition. Mechanism is the implementer's choice.
Dependencies
Blocked by: #862, #864, #865, #863, #333, #763, #769, #771.
Prerequisites: #769, #771 and #763 merged (the stamp, reviewer and trusted-policy contracts), #321 and #333.
Size
M. One pull request.
Verify plan
- AC1, AC3: reviewer-evidence comparison with the shell evidence on fixtures and a stamp content check.
- AC2, AC4, AC7: table-driven refusals and statuses with a stub reviewer.
- AC5, AC6: a stub reviewer that changes, in turn, the head, the base, the base commit, the copied note, the draft, the draft's review copy and the repository configuration, and one that withdraws the approval.
- AC8: a fixture repository with and without the policy file, and with the policy changed on the branch.
- AC9: unattended fixture with faked gates, including the integration of the shared lint behavior from child 06 into this command.
- AC10: a stub reviewer that times out, one that fails, and a bounded-review hold, asserting status and absence of a stamp.
- AC11: a test that supplies a reviewer from the repository file and sees it ignored; an integration test that the merge review reaches the shared runner and that the runner's own invocation check for the default reviewers (refactor(agents): port reviewer execution and verdict integration to Go #771 AC5) passes through this command; the CI matrix run.
- Definition of done: D1 each AC is verified at the merged head, with the commands and results cited in the pull request's Verification. D2 an independent review approves the exact merged head, and every finding has a recorded disposition. D3 required checks pass with no gate loosened. D4 the leak scans the repository specifies are clean, and every post made for this work passes the per-post leak review before it is posted. D5 every commit is signed. D6 the documentation matches the change or the Verification says why there is no impact. D7 every commit has an
Assisted-bytrailer and the pull request has theprovenance:agent-assistedlabel. D8 the pull request stays within the size limits. D9 follow-ups are filed as issues and listed under Related. D10 the merge closes the issue through a closing reference, the board shows Done, and the finalStatus:comment names the merge commit.
Risks
A stamp that binds less than the shell stamp lets a merge go out under a review of different content. AC1, AC5 and AC6 hold the bindings. Undo: revert; the shell script is untouched.
Operator authority
None.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Work type
Projects
- StatusShow more project fieldsBacklog
Activity
tbhb-agent commentedon Oct 27, 2026
Refinement: READY — The squash message review snapshot and stamp are produced by agentrepo merge
Model: gpt-6-astra
Child 09 The squash message review snapshot and stamp are produced by agentrepo merge
Verdict: READY
Checked: AC11 now accurately distinguishes default reviewers’ read-only invocation from a machine-configured custom command, matching
packages/agents/source/lib/lib.sh:463andpackages/agents/source/lib/lib.sh:467. Its integration check references #771’s invocation contract. Draft, copied-note and approval freshness are covered; shared policy, stamp and runner behavior remain with their existing owners.Gaps: None.
Split: None needed.
Definition of done
The definition of done for this issue (Feature). Tick each item and give its evidence.
check-leaks.shwith the repository's private-strings list, and the leak review of each post.docs/, CHANGELOG or help text), or the Verification section says "No doc impact" and why.provenance:agent-assistedlabel.Status:comment names the merge commit.mise run checkis green, and so are the coverage floorsmise run cover-go-checkandmise run cover-py-check, whichcheckdoesn't run.packages/agents/source/commits whatmise run generate-skills, thenmise run skill-tokens, thenapm installrewrite, in that order, andcheck-generated-skills(part oflint) passes.docs/agent-skills-migration.mdor the adoption docs, or the PR's Verification says "No consumer impact" and why.Round: 3 of 3