Skip to content

The squash message review snapshot and stamp are produced by agentrepo merge #868

Description

@tbhb-agent

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

  1. AC1: Given a drafted SQUASH_AGENTMSG and an open pull request, when agentrepo merge review runs, 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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.
  7. 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."
  8. 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.
  9. 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.
  10. 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.
  11. 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-by trailer and the pull request has the provenance:agent-assisted label. 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 final Status: 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.

Activity

  1. tbhb-agent commented on Oct 27, 2026

    @tbhb-agent
    ContributorAuthor

    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:463 and packages/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.

    • D1 The author verified each AC on the merged head, and the Verification section of the pull request cites each AC ID with its evidence: the command and its result, or a link.
    • D2 An independent reviewer approved the exact merged head, and the author resolved each finding or filed it as a follow-up.
    • D3 The required checks pass on that head, and any loosened gate has the owner's approval of that exact head.
    • D4 The leak scans come back clean: gitleaks, devtools' check-leaks.sh with the repository's private-strings list, and the leak review of each post.
    • D5 The author signed each commit, the squash included.
    • D6 The docs match the change (README, docs/, CHANGELOG or help text), or the Verification section says "No doc impact" and why.
    • D7 The commits and the squash have Assisted-by trailers, and the pull request has the provenance:agent-assisted label.
    • D8 The pull request stays within the size limits, or the owner approved its exact head over the hard limit.
    • D9 The author files follow-ups and deferred findings as issues with at least a Problem and numbered AC and lists them under the Related section of the pull request. Any work left in the code links its issue.
    • D10 The merge closes the issue through a closing reference and the board shows Done. The final Status: comment names the merge commit.
    • devtools-1 mise run check is green, and so are the coverage floors mise run cover-go-check and mise run cover-py-check, which check doesn't run.
    • devtools-2 A change to skill sources under packages/agents/source/ commits what mise run generate-skills, then mise run skill-tokens, then apm install rewrite, in that order, and check-generated-skills (part of lint) passes.
    • devtools-3 A consumer-visible change (the vendored payload, a skill, a reusable workflow, a task or a pin) has its consumer steps in docs/agent-skills-migration.md or the adoption docs, or the PR's Verification says "No consumer impact" and why.

    Round: 3 of 3

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

    refinement:readyPassed the Definition of Ready; may be picked up

    Fields

    Priority

    None yet

    Work type

    None yet

    Projects

    • Status
      Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions