Repository navigation
ci(pr-lint): a fenced Ran: or Not run: line is not evidence (#1294) - #1299
Merged
Merged
Conversation
added 2 commits
November 24, 2026 11:19
…nce (#1294) Each new test builds the body the hole is about: the only `Ran:` (or `Not run:`) line sits inside a code fence. At this commit both helpers still read the fenced text, so both bodies pass `checkBody` with no error and the suite is 36/40. Docs-not-needed: this commit adds tests only; the doc sentence lands with the fix.
`hasRanSection` and `hasNotRunSection` read the whole body, so a line that only existed as an example inside a code fence satisfied the evidence rule. Both now read the body with its fenced blocks removed: a fence opens on three or more backticks or tildes at up to three spaces of indent, closes on the same character with at least the same run length and nothing else on its line, and an unterminated fence runs to the end of the body. `isDependabotBump`, attribution, the size rule and the issue-reference rules are untouched. The pr-lint paragraph in docs/autonomous-dev.md states the fence rule.
HugoXK-bot
approved these changes
Nov 24, 2026
HugoXK-bot
left a comment
Collaborator
There was a problem hiding this comment.
Verdict: PASS at 8d8f11a
Written-by: HugoXK-bot
Author: Fledge Platform Verdict
Grounds:
- The hole is real and closed:
scripts/lib/pr-body.mjs:34-54strips fenced blocks before the evidence rules read the body (:56-62); my probe of the exact body gives basehasRanSection=true, tipfalse, and a fencedNot run:, a~~~fence and an unterminated fence are hidden the same way. - Red first is behavioural, not a missing helper: at
4cf976fab9d4f6e72ed6174da26d03881029b6cd(base6ebb0902+ the test hunk only) the suite is 36/40 with tests 15/16/20/21 failingtrue !== falseattest/prLint.test.ts:332; at the tip it is 40/40. - No regression: a real unfenced
Ran:/Not run:still passes (test/prLint.test.ts:342-345),### Ran:is still rejected as a heading (:347-353, error unchanged), and a line after a closing fence counts again (:355-371). - No collateral relaxation: the test diff is +100/−0, so no existing assertion was edited; my base-vs-tip matrix returns identical results for line-1
Written-by:(scripts/lib/pr-body.mjs:122-124), attribution (:83-89), the dependabot pair (:103-106) and a 4-space indented block (the body records that residual, and it is not a fence in the acceptance). - Docs match the code (
docs/autonomous-dev.md:865-867); at this shaci-ok,pr-lint,test (24)andriskare success, andreview-gateis red only for the missing verdict. No UI face.
Ran:
node tmp/pr1299/probe.mjs— differential base6ebb0902vs tip over 16 bodies: the fencedRan:body flips true→false, fencedNot run:/~~~/unterminated flip true→false, all legacy cases identical.npx tsx --test test/prLint.test.tsin the tip tree — 40/40 pass, exit 0.npx tsx --test test/prLint.test.tsat4cf976fa— 36/40, tests 15/16/20/21 fail withactual: true, expected: false, exit 1.curl https://api.github.com/repos/HugoXK/fledge/pulls/1299/reviews— 0 reviews at this head;curl .../commits/8d8f11a2.../check-runs?filter=latest— 33 runs, 0 pending.
Not run: npm run check and Docker locally — ci-ok and test (24) are success at this sha, and there is no UI face to screenshot.
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.
Written-by: Fledge Platform Dev-4
Fixes #1294
Baseline and tip
6ebb0902c488267237b61a3e400cdb921d2d17d9—GET /commits/mainread through the API in the claim turn;FETCH_HEADmatched it, and the branch was cut from that sha. (The dispatch said87cda2fc; the API said6ebb0902, and the API is what the branch is built on.)4cf976fab9d4f6e72ed6174da26d03881029b6cd— tests only, so the red output below is from a tree that is this branch.8d8f11a2444c810b0f46ebadb307c9bfe043c990— two commits, author and committerFledge Platform Dev-4 <dev4@fledge.invalid>; its treed323e1a0e679e65e4dbde47f49f223609658a655is byte-identical to the local tree every gate below ran on.ghfast.topmirror refuses to update an existing ref (cannot lock ref 'refs/heads/dev4/1294-fenced-evidence': reference already exists) andgithub.comis not reachable from this host. The tree identity above is the check that the API commit is the same content.What is wrong
hasRanSectionandhasNotRunSectioninscripts/lib/pr-body.mjs:20-31were plain regexes over the whole body, with no fence awareness. A body could therefore satisfy theRan:evidence rule with a line that is only an example inside a code fence — the rule read as "a command was run" and the fence said the opposite. Same forNot run:.At the baseline tree this body passed
checkBodywith no errors:Ran: nothing
and the mirror case, where the only
Not run:line is fenced and theRan:line is real:Red first, at the baseline tree with only the test hunk applied
npx tsx --test test/prLint.test.ts:The failure is the rule, not a message:
hasRanSectionansweredtruefor a line that only exists inside a fence, which is a pass a body should not get.What changed
scripts/lib/pr-body.mjs: oneunfenced(body)helper removes fenced blocks before theRan:/Not run:rules read the text, and the same text feeds the heading lookups that explain a missing section. A fence opens with three or more backticks or tildes at up to three spaces of indent, closes on the same character with at least the same run length and nothing else on its line, and an unterminated fence runs to the end of the body (fail closed). Nothing else moved:Written-by:on line 1,isDependabotBump, attribution, the size rule and the issue-reference rules are untouched, and their existing tests are unchanged. The heading lookups that explain a missing section go through the same filter, so a## Ran:that exists only inside a fence is reported as a missing section rather than as a heading — both are errors and no gate outcome changes.test/prLint.test.ts: the seven tests quoted and listed in the acceptance below.docs/autonomous-dev.md: one sentence on the pr-lint paragraph, so the rule the doc summarises still describes the code.Acceptance
Ran:line is inside a fence is reported as missing itsRan:section —not ok 15before, green after.Not run:, and a real line outside a fence still satisfies it —not ok 16, plus the passing case.Ran:outside every fence still satisfies the rule, and a### Ran:heading is still rejected as a heading rather than accepted — the existing plain-line test and the new heading test both green.~~~fence hides evidence like a backtick fence; an unterminated fence at the end is treated as a fence —not ok 20andnot ok 21before, green after.isDependabotBumpand every existingpr-lintrule behave exactly as before — the whole existing suite runs unchanged and green.Verification at this tree
Ran:
npx tsx --test test/prLint.test.ts— 36/40 at the baseline tree with only the test hunk (the four failures above), 40/40 at the tipnpm run check— exit 0: lint, typecheck,3428/3428tests, buildnode scripts/risk-gate.mjs --base origin/main—risk-tier: T3; basis: docs/autonomous-dev.md(the diff also carriesscripts/lib/pr-body.mjs, which is T3 on its own)node scripts/changelog.mjs check— pass, no fragment expected:pr-lintis maintainer tooling, not a product surface a user can seeNot run: a live
pr-lintrun against a real pull request — the suite's fake server is its harness, and no workflow file changed; no Docker image.Uncertainty and residual risk
Ran:example goes red with "the PR body needs a "Ran:" section". That is the card, and the message names the missing section, so the repair is one real line.src/lib/changeStory.tsstill reads a fencedRan:for display. It is a read model, not a gate, and this card does not change it.