Repository navigation
review: mark a blocking verdict on the PR, not only in firstmate's chat - #46
Merged
Merged
Conversation
PR #44 merged carrying seven confirmed defects while its crew was still fixing them. The review had found all seven and firstmate had said not to merge, but that verdict existed only in the firstmate session's chat, so whoever clicked merge never saw it. AGENTS.md section 6 step 3 now requires the verdict to land on the PR when one is already open: draft a firstmate-authored PR with `gh pr ready --undo`, which blocks the merge button mechanically instead of merely advising, plus a comment carrying the reason; never draft a bot's PR, where a comment and a `do-not-merge` label are used instead. docs/pr-block-signal.md owns the commands, the per-repo label setup, and the verification record - including the check that drafting does NOT suppress this repo's PR CI, which is what makes the draft path safe for the fix loop.
…evidence The event reference does not document whether workflows run on draft PRs, so the claim now rests on a live draft PR in a public repo whose workflow has the same bare `pull_request:` trigger shape as ours (cli/cli#14013, 15 completed check runs while isDraft). Also records that GitHub's current stage-change docs carry no plan or visibility restriction on drafts at all, which makes gh's "If supported by your plan" caveat conservative rather than a live constraint.
…check Verified on live PRs of both kinds that .author.is_bot separates the two mechanisms, and stated the two commands that close the one gap left in the record - the live draft conversion - on any open firstmate PR.
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 incident
On 2026-07-30, PR #44 in this repo merged carrying seven confirmed defects, while its crew was actively fixing them.
An independent review had found all seven, and firstmate had told the user not to merge. The verdict existed only in that firstmate session's chat, so the person clicking merge acted without it. One of the seven bricks a worktree pool slot on every warm - on Linux as well as macOS, so not a platform edge case.
The review was neither late nor wrong. What failed is that a review verdict living only in chat does not reach the person who merges - including a collaborator who never sees that session at all. Firstmate's normal review sits before the PR exists, which keeps this rare, but once a PR is open the chat is no longer where the merge decision happens.
That is what makes this a rule rather than a habit, and it is why firstmate is now allowed to draft a PR it authored.
The change
AGENTS.mdsection 6, step 3 gains four lines: when firstmate's review of an already-open PR finds a merge-stopping defect, the verdict is marked on the PR, and cleared when the defect is fixed. Two mechanisms, and the distinction is the substance:gh pr ready --undoconverts the PR to draft, which mechanically blocks merging ("No one can merge the pull request until you mark the pull request as ready for review again"), plus a PR comment carrying the verdict so the reason travels with the PR.gh pr readyrestores it once the fix lands.do-not-mergelabel instead.A title prefix or a comment on its own is advisory - it informs a reader who looks, and leaves the merge button live for one who does not. That is exactly what already failed, so the blocking mechanism is preferred wherever the goal is to prevent a merge.
docs/pr-block-signal.mdowns the commands, the per-repo label setup, and the verification record, behind a one-line pointer.AGENTS.mdis injected into every session and every brief, so the four lines carry the rule and nothing else.What this does NOT change
Merge authority is untouched. Firstmate still never merges without the user's explicit word; the pre-PR review gate, the review sequence, and
bin/fm-pr-check.sh/bin/fm-pr-merge.share all unchanged. This change only makes a blocking verdict visible where the decision actually happens. The one interaction worth naming: a drafted PR also makesbin/fm-pr-merge.shfail closed, because GitHub refuses to merge a draft. That is defense in depth - mark the PR ready first, then merge on the user's word.These are GitHub mutations, so they run on plain
gh, per section 6's existing read/mutate split.Verifications
Written only after checking, because a wrong instruction in
AGENTS.mdis worse than none - every future firstmate follows it. Full record with commands and output indocs/pr-block-signal.md.1.
gh pr ready --undois plan-dependent - what happens when it is not supported?gh's own help says "If supported by your plan". This repo is public,convertPullRequestToDraftis present in the GraphQL schema, the token haspush, and GitHub's current stage-change documentation states no plan or visibility restriction on drafts at all - so the caveat reads as conservative rather than a live constraint here.More importantly, the failure is loud, verified:
gh pr ready --undo 99999prints a GraphQL error and exits 1. It cannot silently do nothing. The instruction therefore keys its fallback to the comment-plus-label path on the non-zero exit, not on an assumption about the plan, which makes it correct on either plan instead of correct-on-mine.Not exercised live: the draft conversion itself. That needs an open PR, and a crewmate may not open one before firstmate approves its branch. The doc records the gap and the two commands that close it on any open firstmate PR.
2. Does drafting suppress this repo's PR CI? No - and this was the check with the power to kill the design.
If drafting stopped CI, the fix loop would lose its gate and this change would do net harm. Our
.github/workflows/ci.ymltriggers on a barepull_request:with notypes:filter and no draft conditional - but GitHub's event reference is silent on draft behavior, so grepping our own workflow is only half an answer.The other half, on a live draft PR in a public repo with the same trigger shape:
cli/cli'sgo.ymluses a barepull_request:trigger, and draft PRcli/cli#14013(isDraft: true) carries 15 completed check runs,build (ubuntu-latest)among them. So Lint shell scripts, Behavior tests, and Repo invariants all keep running on every fix push while a PR sits drafted.One nuance:
converted_to_draftandready_for_revieware not default activity types, so neither drafting nor un-drafting spawns a run by itself. CI runs on the fix push, which is when the gate matters.3. Does a
do-not-mergelabel exist? No - it must be created.gh label listreturns only the nine stock labels. An instruction that silently assumed the label would have failed on first use, in the exact moment someone is trying to stop a bad merge. It is created once per repo, on first use:gh label create do-not-merge --color B60205 --description "Blocking review defect - do not merge" --force--forceupdates an existing label instead of failing, so the command is safe to re-run. Not pre-created in this repo - that is a mutation to make at first use.4. Does the bot-versus-firstmate discriminator hold on real data? Yes:
#44->is_bot=false-> draft+comment;home-assistant/core#177523(app/dependabot) ->is_bot=true-> comment+label. Authorship and draft state are already visible in thegh-axi pr viewfirstmate reads.Shape
No new
bin/script. This is twoghinvocations plus a judgment about PR authorship; a helper would add a contract to maintain for logic that fits in prose, and the fallback is a single exit-status check.tests/fm-pr-block-signal.test.shfollows the prose-contract pattern oftests/fm-stow-contract.test.sh, and adds a guard thatci.ymlnever gains apull_request.draftconditional or aready_for_reviewtypes filter - either would silently invalidate the rule this PR adds.Test run
bin/fm-lint.shclean. Full suite run once: 119 ok, 7 not, none caused by this diff - no failing test reads any file it touches (grep-verified), and the diff is Markdown plus one new test file.This machine has no coreutils
timeout, whichbin/fm-test.shrequires, so the suite ran under a scratch GNU-semantics shim.fm-wake-queue,fm-watch-checkpoint,fm-watcher-lockandfm-pool-warmall pass standalone (shim/runner artifacts;fm-pool-warmjust exceeds the runner's 300s cap on this box).fm-graphandfm-fleet-syncfail on an absent codebase-memory CLI, takingfm-graph-reindex.sh's documented skip path.Separately surfaced, not fixed here:
bin/fm-mission.sh set-criteriais broken on macOS - BSD awk rejects the multiline body (awk: newline in string) and it errors withfailed to rewrite .../missions/<id>.md. Ubuntu CI does not catch it.