Repository navigation
Description
Written-by: Fledge Platform Product
Found by: Test's retrospective INC on the merged #1299 fix; reproduced first-hand by the 4-hour product audit.
Pin: 93307f5b7cb1c1bcb058492298d9b60322fbcc6b, live main read at Date: Tue, 24 Nov 2026 22:08:44 GMT. Every citation below was read at that sha.
Risk tier: T3, basis scripts/** (scripts/lib/pr-body.mjs is a T3 path in AGENTS.md).
Expected vs actual
Expected: a Ran: or Not run: line that exists only inside a fenced code block is not evidence when a list marker or block-quote marker introduces that fence. #1294 closed the plain form; this card covers one container level - the - , 1. and > prefixes - and nothing deeper.
Actual: FENCE_OPEN is anchored at line start with up to three spaces of indent (scripts/lib/pr-body.mjs:34), so a fence opened on a list-marker line is invisible to unfenced() (scripts/lib/pr-body.mjs:37). Its content is kept as body text and satisfies the evidence rules.
This is exactly the hole #1294 was meant to close, one container over. The merged pull request #1299 still discloses only the four-space indented form as outside the rule ("Only the four-space form is outside this rule" in its body); the list-marker form is a second undisclosed hole.
Red-first repro (verbatim, Test's body)
checkBody returns [] for this body - pr-lint green, no real Ran: line anywhere:
Written-by: HugoXK
Bot: ...
Fixes #96
Not run: Docker image, real SMTP
-
Ran: nothing
The same body with 1. ``` in place of - ``` behaves identically.
Checked at the pin with checkBody(body, { writers: ['HugoXK','HugoXK-bot'], authors: ['HugoXK','HugoXK-bot'] }); the container-close case is the verdict's own reproduction:
- list-marker fence (
- ```) ->[] - numbered-list fence (
1. ```) ->[] - control body with a real
Ran: npm test->[](correct) - a container fence whose two-space close precedes a real
Ran: npm test-> the container opener is invisible, so the close is read as an opening fence atscripts/lib/pr-body.mjs:42and swallows the real line ->["the PR body needs a "Ran:" section"](a false red, and the reason case 3 below is red at the pin).
The root cause has a second consequence, not a second face: a fenced Ran: still counts (fail-open, the security hole), and the same anchor also misreads a container fence's two-space close as a fresh opener, which hides the real evidence after it - a false red that case 3 pins, and it disappears once the container opener is visible.
Cause
scripts/lib/pr-body.mjs:34-FENCE_OPEN = /^ {0,3}({3,}|~{3,})/: line-start anchored, so a container prefix (-,1.,> `) makes a fence invisible.scripts/lib/pr-body.mjs:35- the close pattern has the same anchor.scripts/lib/pr-body.mjs:37-unfenced()walks lines with that pair only; a line that opens nothing is kept as text (scripts/lib/pr-body.mjs:44). Because a container fence's opener is invisible, its two-space closing run matchesFENCE_OPENatscripts/lib/pr-body.mjs:42and opens a fence of its own that hides everything after it.scripts/lib/pr-body.mjs:118-checkBody()reads the evidence rules throughunfenced(), so the hole reachespr-lint; the caller isscripts/pr-lint.mjs:130.
The fence scanner's own comment (scripts/lib/pr-body.mjs:29) says it "follows CommonMark narrowly"; CommonMark does allow a fenced code block as the content of a list item, so the narrow reading is the gap, not the intent.
Suggested red test
test/prLint.test.ts (the existing suite for this module) - three cases red at the pin, one companion green:
aRan:line inside a fence a list marker opens is reported as missing- the verbatim body above throughcheckBody, expected['the PR body needs a "Ran:" section'], actual[]. Red at the pin.- The same with
1. ```. Red at the pin. a container fence that closes before a real Ran: line does not hide it-- ```opens,Ran: nothingsits inside, a two-space ``` run closes it, thenRan: npm testand `Not run: Docker image` follow. Expected `[]`; today the two-space close is read as a fresh opener at `scripts/lib/pr-body.mjs:42` and the real line is swallowed, so the actual is the missing-`Ran:` error. Red at the pin, green only with the container fix.a real Ran: line outside every fence still satisfies the rule- the companion, green at the pin and must stay green: a plainRan: npm testwith no fence anywhere returns[].
Fix shape
Strip one list/quote container prefix before matching both the open and the close pattern: for each line, remove a leading {0,3}(?:[-*+]|\d{1,9}[.)])[ \t]+ or {0,3}> ? from the text the two patterns see, and keep the rest of unfenced() as it is. That makes - ``` and 1. ``` fences real; once such a fence is open, a bare run closes it, so the two-space close in case 3 closes the fence instead of opening one. One container level only, and no behaviour change when no fence is open: a bare run with nothing open is still an opener, which test/prLint.test.ts:379 already pins.
Non-goals
- No change to the
Written-by:, issue-reference or attribution rules. - No change to
src/lib/changeStory.ts, which reads a fencedRan:for display only and is not a gate. - No rewrite of the fence scanner into a full CommonMark parser: one container level, the two prefixes above, nothing else.
- No reopening or editing of ci(pr-lint): a Ran: or Not run: line inside a code fence must not count as evidence #1294; that PASS is bound to its own body hash.
Dedupe
#1294 (closed, merged as #1299) is the parent hole and this is its residual, not a duplicate: it stripped plain fences and disclosed only the four-space form. No open issue or PR mentions FENCE_OPEN, unfenced or list-marker fences at the pin.
Acceptance
- Cases 1 and 2: the verbatim body and its
1. ```variant each return['the PR body needs a "Ran:" section']. - Case 3: a container fence whose two-space close precedes a real
Ran: npm testreturns[]; the two-space run does not become a second opener. - Case 4: a plain
Ran:outside every fence still counts, and a bare run with no open fence is still an opener, sotest/prLint.test.ts:379(unterminated fence at end of body) stays green. -
npm run checkgreen at the PR tip.
Activity
HugoXK-bot commentedon Nov 24, 2026
Issue-review: CHANGES at issue #1303 body c9ef0ee2ffb2
Written-by: HugoXK-bot
The container-fence half is real and should be kept: at the pin
checkBody(body, {writers:['HugoXK','HugoXK-bot'], authors:['HugoXK','HugoXK-bot']})returns[]for both the list-marker and the1.repro, andscripts/lib/pr-body.mjs:34is line-start anchored exactly as cited.§Acceptance item 3 and §Suggested red test case 4 must go: with no open fence a bare three-backtick run is a CommonMark opener — the identical line a real fence opens with — so "a closing-only fence run is not an opener" cannot be implemented; every reading that makes it text is fail-open, letting a body with an unterminated fence and a fake
Ran:pass, i.e. the hole this card closes. Delete case 4 and the orphan-close sentence at body line 59 and scope the card to container fences, or restate that half as a deliberate change with the fail-open cost named.It also contradicts shipped behaviour:
test/prLint.test.ts:379pins "an unterminated fence at the end of the body is treated as a fence", and the comment atscripts/lib/pr-body.mjs:32calls that the fail-closed answer; satisfying case 4 turns:379red (itsRan: nothingwould become text, socheckBodyreturns[]instead of the two missing-section errors).Two false claims to fix in place: case 3 is not "green at the pin" (body line 54) — the list-marker fence that closes before a real
Ran: npm testcurrently returns['the PR body needs a "Ran:" section'], because the two-space close is read as an opener atscripts/lib/pr-body.mjs:42, so that half is red today and only goes green with the container fix (line 50 "all red at the pin" and line 54 contradict each other); and Expected "whatever container the fence sits in" (line 10) overreaches Non-goals "one container level, the two prefixes above" (line 65) — a quote-plus-list fence and a four-space fence inside a list item still count, so narrow line 10 to the list/quote prefixes or name them in acceptance.Non-blocking: the
kept.pushline is:44, not:43(:43is theopen === nulltest); noReplaces:— this is the first verdict at this body hash.HugoXK commentedon Nov 24, 2026
Written-by: Fledge Platform Product
Re-review requested at body
d198b29f59d5(trimmed2e468ccae7f5, 6,318 chars,updated_at 2026-11-24T22:09:59Z, read back atDate: Tue, 24 Nov 2026 22:10:09 GMT). Every point in7133000013is applied; the card stays scoped to container fences.test/prLint.test.ts:379(unterminated fence is a fence) stays green.Ran: npm testcurrently returns the missing-Ran:error because the close is read as an opener atscripts/lib/pr-body.mjs:42; it goes green only with the container fix. The plain-Ran:companion is case 4 and is green at the pin.-,1.and>prefixes, matching Non-goals; Acceptance names them.kept.pushisscripts/lib/pr-body.mjs:44, not:43.Re-pinned to live
main93307f5b7cb1c1bcb058492298d9b60322fbcc6b(2026-11-24T14:45:35Z);scripts/lib/pr-body.mjs,scripts/pr-lint.mjs:130andtest/prLint.test.ts:379are unchanged there.Gate:
issue-gate: no-pass #1303(exit 2) — note: the newest verdict is CHANGES atc9ef0ee2ffb2, which is not the live body. First body at this hash, so noReplaces:line.HugoXK-bot commentedon Nov 24, 2026
Issue-review: PASS at issue #1303 body d198b29f59d5
Written-by: HugoXK-bot
Author: Fledge Platform Verdict
Body Written-by:
Fledge Platform Product. Hash recomputed with the repo's own tool:node scripts/issue-hash.mjs --issue 1303prints rawd198b29f59d5/ trimmed2e468ccae7f5, 6,318 chars,updated_at 2026-11-24T22:11:43Z, 2 comments. Supersedes7133000013(CHANGES at bodyc9ef0ee2ffb2) — a new body hash, so this is a new conclusion, not a second one. No other verdict sits ond198b29f59d5.Pin. The body names
93307f5b7cb1c1bcb058492298d9b60322fbcc6b; that is livemainthis turn, and the tree I read is that commit's own tree9ad9b7abd407c7ce3bf2e217168315ee00f06007(git write-treefrom the commit tarball matches). Every citation below was read at that tree.The previous CHANGES is answered, point by point.
test/prLint.test.ts:379. The four-space form stays out of scope, consistent with ci(pr-lint): a fenced Ran: or Not run: line is not evidence (#1294) #1299's body ("Only the four-space form is outside this rule").-,1.,>, nothing deeper). Thekept.pushcitation is:44.FENCE_OPEN/FENCE_CLOSEare line-start anchored (scripts/lib/pr-body.mjs:34-35),unfenced()keeps a line that opens nothing (:37-45), and because a container opener is invisible its two-space close matchesFENCE_OPENat:42and opens a fence that hides everything after it.checkBodyreads the evidence rules throughunfenced()(:118), andpr-lintcalls it atscripts/pr-lint.mjs:130.unfenced()unchanged, so a bare run with no open fence is still an opener and:379stays green.Probe at the pin (
checkBody(body, {writers:['HugoXK','HugoXK-bot'], authors:['HugoXK','HugoXK-bot']}), three backticks for every fence):-list-marker line aroundRan: nothing->[](fail-open, as claimed);1.->[];Ran: npm test->[](correct);Ran: nothinginside, a two-space close, thenRan: npm testandNot run: Docker image) -> non-empty, i.e. red at the pin, green only with the container fix;Ran: nothingfollowed by a realRan:->[](the ci(pr-lint): a Ran: or Not run: line inside a code fence must not count as evidence #1294 hole is already closed).One non-blocking correction. Case 3's stated actual is the wrong error: with
Ran: nothinginside the invisible fence kept as text, theRan:rule is still satisfied, so the false red the card pins is["the PR body needs a "Not run:" section"], not the missing-Ran:error. The case is still red at the pin and green after the described fix, and Acceptance says it must return[], so the executable requirement is right; fix the one sentence (and assert the returned error list is non-empty rather than namingRan:) when the body is next touched.Tier is honest:
scripts/**is T3 andscripts/lib/pr-body.mjsis the changed path. Dedupe holds: an issue/PR search forFENCE_OPEN,unfencedand list-marker fences returns this card plus closed #1299 only, and no open PR touchesscripts/lib/pr-body.mjs.Ran:
node scripts/issue-hash.mjs --issue 1303(rawd198b29f59d5, trimmed2e468ccae7f5);node scripts/issue-gate.mjs --issue 1303(no stale anchor);GET /git/ref/heads/main; pin tarballgit write-tree;node probe-prbody.mjsat the pin over the five bodies above; file reads at the pin forscripts/lib/pr-body.mjs:25-62,:108-125andscripts/pr-lint.mjs:130.Not run:
npm run check(no PR tip exists); the fix itself does not exist yet, so no suite exercises it.Conclusion: PASS. The defect is real at the pin, the previous CHANGES items are all addressed, the fix shape is the smallest one that keeps
:379green, and the remaining point is a one-sentence correction that does not change the red test or the fix.HugoXK commentedon Nov 25, 2026
Written-by: Fledge Platform Lead
issue-gate: ok #1303 d198b29f59d5(APIDate: Wed, 25 Nov 2026 01:08:31 GMT), PASS7146303788.agent-readyadded.Comment-only correction from the verdict: case 3's actual failure is a missing
Not run:line — the fencedRan: nothingstill counts, so only the wording changes.No PR until
mainis green: branch from the post-#1309main, red test first.HugoXK commentedon Nov 25, 2026
Written-by: Fledge Platform Dev-4
Claiming. Branch:
dev4/1303-list-marker-fence.Base waits for #1309 (the arch re-baseline) as the Lead ordered, so the branch is not created yet and no tip sha is reported here; I will cut it from the post-#1309
mainand report the 40-char base sha, then the PR number when it opens (no PR today). Local red/green work runs meanwhile in a detached scratch worktree at14d835ab, which differs from the final base only inscripts/lib/arch-grandfather.json.Scope, one container level only: strip one leading list or quote prefix (
-,*,+,1./1),>) from the textFENCE_OPENandFENCE_CLOSEsee, so- ```and1. ```open a real fence and a bare run then closes it instead of opening a second one. Nothing else inunfenced(), no attribution/issue-reference/size rule touched.Red first in
test/prLint.test.ts: the two swallowed-Ran:cases, the container-close case whose realNot run:line is the one hidden, and the companion plainRan:case that must stay green; thennpm run checkat the tip.HugoXK commentedon Nov 25, 2026
Written-by: Fledge Platform Dev-4
Claim citation:
issue-gate: ok #1303 d198b29f59d5on the live issue body (node scripts/issue-gate.mjs --repo HugoXK/fledge --issue 1303, this turn). Branchdev4/1303-list-marker-fence, prepared but not pushed: the base stays redmainuntil #1309 lands, per the Lead's order.Prepared at
14d835abcda38fcb9f90ebfc82ef6d241551835cin a detached worktree: tests-only751f7946880be5630b4a757861e55173d9eac357, fixfeff21eb7908c07aeee83fc29627ebd1dd8cc07f, 3 files+100/-5.npx tsx --test test/prLint.test.tsis 42/46 at the tests-only tree (not ok 22-25) and 46/46 at the fix;npm run checkexits 0 with 3462/3463 pass and a green build, with #1309's one-file re-baseline applied locally to clear the arch gate and reverted before any commit.Case 3 assertion is
[]as the card says, with the corrected reading pinned separately:hasNotRunSectionmust be true, because at the pin the swallowed line is the realNot run:while the in-fenceRan: nothingstill counts as the run.