Repository navigation
fix(gate): refuse a closing directive that names a merged pull request - #699
Conversation
The umbrella's push-time gates judged the body's FORM and its FIDELITY TO THE DIFF, and none of them asked what KIND of thing a closing directive names. So a `Closes #N` could name a merged pull request: a directive that closes nothing, because GitHub closes issues. The instance is this repo's own record `CHANGELOG/2026.299.0229.md`, written at merge time from the body of #697. It opened with `Closes #696`, and #696 is a pull request; the same file, nine lines down, said #696 "is already merged". The fresh `charly/pr-validator` raised the contradiction on #697. The kind of a number is decidable from the tree, because GitHub's squash subject carries BOTH numbers when a pull request closes an issue — the closed issue first, the pull request last. #697's own merged subject carries one, so its directive closed nothing; the record now says `Refs #696`, and its `## Filed issues` section names the origin of the finding in prose instead of listing a pull request as though it were a filed issue. The missed control lands in the same cutover: `scripts/check-pr-body-diff.mjs` gains an arm that asks a closing directive what it names. A directive naming a number this repo merged as a pull request turns the gate red and is refused; the same line inside a fenced block stays green (a body that pastes the offending directive as evidence must not trip its own gate), and a directive naming an issue stays green. Refs #698 Assisted-by: Claude Code minimax/minimax-m3.1-flash:cloud (fully tested and validated)
Review — PASSI re-derived every claim in the body against the two diffs and the single commit, and checked the new arm's logic line by line. Diffstat / head — honest. I counted the hunks: The gate arm — correct. Self-test — genuine coverage. The fixture base commit is now Changelog correction — consistent. Comments: none (0), and no maintainer sign-off configured — so the change is judged solely on its own evidence, which stands. Non-blocking observations
Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
#703) The arm landed in #699 read THREE of the NINE closing keywords GitHub accepts — `Closes`, `Fixes`, `Resolves`, capitalised — and its fence reader could not tell a four-backtick fence from a three-backtick one. Both were raised by the fresh `charly/pr-validator` on #699 itself, so the arm's claim — "every closing directive names something the directive CAN close" — was false for six of the nine forms and for every case GitHub accepts. GitHub's "Linking a pull request to an issue" names the whole set (`close`, `closes`, `closed`, `fix`, `fixes`, `fixed`, `resolve`, `resolves`, `resolved`) and adds: "The keywords can be followed by colons or in uppercase." The arm read none of those forms. This repo's own 447 merged bodies carry 52 line-starting bare `#N` directives, and the three forms the arm read were exactly the three it read. The fence reader was TWO readers of one thing: `proseLines` toggled on a backtick or a tilde fence, `fencedBlocks` toggled on a backtick fence only, and both ignored CommonMark's fence rules. So a body could paste evidence in a tilde block and the evidence arm never saw it; a four-backtick fence closed early at the three-backtick line inside it; a directive after a nested fence escaped the arm entirely; and a run followed by text closed a fence that CommonMark says is still open. ONE scanner now serves both readers, and it implements CommonMark's fence rules: the length rule, and the closing fence's rule that only whitespace may follow the run (an info string belongs to the OPENING fence alone). The keyword grammar reads all nine forms, case-insensitively, with the optional colon, and the finding quotes the directive as it was written. The boundary the widening does NOT cross is the arm's POSITION — a directive is read only when the body OPENS a line with it — and that boundary is measured and filed rather than asserted: 8 mid-line directives in this repo's 447 merged bodies, 3 of them naming a pull request and 2 of them legitimate prose ("the auto-closed #348", "the channel bootstrap fix #43's gitlink") that a full-parity grammar would block. The self-test's fixture table was spelled out in twelve arms and is now one constant, so no arm can spell the table differently from another. R7: the self-test grows to 30 live arms — one per keyword form, the uppercase form, the colon form, a directive after a nested fence, a tilde-fenced evidence block, a directive inside a nested fence, a mid-line directive, and a fence whose closing line carries text. On four bodies the OLD gate is green and the NEW gate is red, and on two the OLD gate is red and the NEW gate is green; the ONE difference between the two runs is this change. Closes #702 Refs #700 Refs #701 Assisted-by: Claude Code minimax/minimax-m3.1-flash:cloud (fully tested and validated)
Closes #698
Summary
Head
35d2521994f9f3349fb6112dd67aa824f7817615— 2 files changed, 184 insertions(+), 8 deletions(-).The umbrella's push-time gates judged the body's FORM and its FIDELITY TO THE DIFF, and neither asked what KIND of thing a closing directive names. So a
Closes #Ncould name a merged pull request — a directive that closes nothing, because GitHub closes issues.The instance is this repo's own record,
CHANGELOG/2026.299.0229.md, written at merge time from the body of #697. It opened withCloses #696, and #696 is a pull request; 148 lines further down, the same file's## Filed issuessection said #696 "is already merged". The freshcharly/pr-validatorraised the contradiction on #697.The kind of a number is decidable from the tree, because GitHub's squash subject carries BOTH numbers when a pull request closes an issue — the closed issue first, the pull request last:
The first two lines are this record's own pull request and the pull request it names, and each carries a single parenthesised number: neither closed an issue. The third is a pull request that DID close one, and GitHub wrote both numbers. A directive closes an issue, so the one that record opened was a no-op.
Two changes, one cutover. The record is corrected in place —
Closes #696becomesRefs #696, and its## Filed issuessection names the origin of the finding in prose instead of listing a pull request as though it were a filed issue. And the missed control lands in the same cutover:scripts/check-pr-body-diff.mjsgains an arm that asks a closing directive what it names, so a directive naming a number this repo merged as a pull request turns the gate red and is refused.CHANGELOG/2026.299.0229.mdscripts/check-pr-body-diff.mjsHow tested
The head this body describes
The change-class gate, on the committed tree this body describes. The diff touches no submodule, no gitlink and no pin — it is one gate script and one record — so the gate that owns it is the umbrella's own
verifytask (which runs that script's self-test) and the script's own self-test, both on the committed tree with the worktree-local, CalVer-stamped build (R9):The changed script's own self-test — thirteen arms live, the three new ones among them:
The arm's discrimination, on a fixture repo (R7 — the coverage fails without the change). The OLD gate is this repo's own
origin/maincopy, the NEW gate is this branch's copy, and the SAME body is judged by both. The fixture's base commit isbase (#7), so #7 is a number this repo merged as a pull request, and the body's first line is the directive under test:The OLD gate is green on the same body and the NEW gate is red on it, and the ONE difference between the two runs is the new arm.
The class this arm closes, measured. The numbers this repo's records' closing directives name, and the numbers this repo merged as PULL REQUESTS — read from the tree itself, because GitHub's squash subject carries the pull request last:
Fifty-one closing directives sit in this repo's records, naming forty-six distinct numbers, and the intersection of those targets with the numbers this repo merged as pull requests is EMPTY — every one of them names an issue. Before this change the same intersection held exactly one number:
#696 is the pull request this PR's record named, and the correction takes it out of the class. The retired directive has no surviving occurrence:
The two mechanical gates that judge this body against this diff, run on the committed tree and on this file:
Rulebook compliance
/charly-internals:git-workflow(the git/ghworkflow, the PR body's form, the pre-push gates) and/charly-internals:strict-policy(the discipline the arms encode) were loaded before the first action of this change, and this repo's ownAGENTS.mdwas read for it.charly/pr-validatorraised the contradiction on fix(gate): make the self-test's pasted command and its output name the same files #697; the RCA is aCloses #Ncan name a merged PULL REQUEST — the directive closes nothing, and the body contradicts itself #698, and it carries the mechanism, the blast radius and the missed control — no gate asked a closing directive what kind of thing it names. The finding is FIXED here, in the record it names and in the control that would have caught it; the measurement is pasted above. Nothing is filed away.Refs #696, the form this repo's other records already use. The record's Filed issues section no longer presents a pull request as a filed issue..worktrees/corpus579/opencharly) onfeat/closes-pr-kind-698, branched from this repo's freshorigin/main; the tree was clean before the change, no submodule was edited, and no other session's branch, worktree or file was touched.verifyplus the changed script's own self-test, run on the committed tree after the commit: every step, zero failures, zero warnings. This change touches nodisposable: truetarget.Closes #Ncan name a merged PULL REQUEST — the directive closes nothing, and the body contradicts itself #698, filed and claimed before the branch was cut; this PR is its fix.STATUSis posted on aCloses #Ncan name a merged PULL REQUEST — the directive closes nothing, and the body contradicts itself #698 at each milestone.Change classification
./charly/bin/charly task verifyon the committed tree — every step, zero failures, zero warnings;node scripts/check-pr-body-diff.mjs --self-testfor the changed script; the OLD-gate-versus-NEW-gate differential on a fixture repo; plus the umbrella's own body/diff reconciliation and the org's body linter, both pasted above.fully tested and validated— the change-class gate passed on the final tree and the changed path (the reconciler and its self-test) executed live.Filed issues
Closes #Ncan name a merged PULL REQUEST — the directive closes nothing, and the body contradicts itself #698 — the class: a closing directive that names a merged pull request. Filed and claimed; this PR IS its fix, and the issue is closed by this merge.No other issue is filed by this PR. The finding this change exists for was raised on #697 and is FIXED here, in the record it names and in the control that would have caught it. A finding raised on a PR is never filed away.
Agent: umbrella-prose-truth
Assisted-by: Claude Code minimax/minimax-m3.1-flash:cloud (fully tested and validated)