Documentation
¶
Overview ¶
Command mergedcheck refuses a reply that tells the user a pull request is merged when no tool call of that turn read the pull request's state from GitHub and found it MERGED.
⛔ A MERGE IS SAID FROM MEMORY MORE OFTEN THAN IT IS READ. On 2026-11-22 at 19:40 a session told the user a pull request was merged without having read it; the lesson was written and the recur ledger records the recurrence. A written lesson is not a gate, so this is the gate: a Stop hook, modelled on replystamp --hook and statecheck --hook, that reads the transcript and answers the hook protocol.
What it judges ¶
The text of the turn (every assistant text block after the user's last message). A sentence is a CLAIM when it carries "merged", "mergé(e)(s)" or "fusionné(e)(s)", unless it is a question, sits in code, a quotation or a block quote, is negated or hypothetical ("not merged yet", "pas encore fusionnée", "once merged", "sera fusionnée"), or uses the word as an adjective ("the merged result").
The claim is bound to the pull request it NAMES: owner/repo#N, "PR 12", "pull request #12", ".../pull/12", or a bare #12 that is not an issue being closed. A claim naming no number is accepted only when the turn read exactly one pull request as MERGED.
What counts as a read ¶
A Bash call of the turn whose OUTPUT shows the state of THAT number: `gh pr view N --json state` (or `number,state`, `-q .state`, the text form), `gh pr list --json number,state`, `gh api repos/o/r/pulls/N`, and the output of ghmerge or ghrelease reporting the merge. `prwait` is NOT a read of the merge state. The latest read of a pull request wins: an OPEN read followed by a ghmerge that reports "merged" is a MERGED read.
Why it allows whenever it cannot read ¶
Same rule as the other hooks: a refusal is not a verdict. An unreadable transcript, a payload that names none, a subagent's payload, a session it cannot keep a count for: it says so on stderr and allows. A reply is refused once (by its last text's uuid), a Stop that follows a block stands down, and the exit status under --hook is always 0.