Skip to content

Read the Coverage Marker Inside a Sentence, and the Two Copilot Finding Shapes - #1726

Merged
ptr727 merged 12 commits into
developfrom
feature/pr-review-marker-and-shape-readers
Sep 21, 2026
Merged

ptr727 merged 12 commits into
developfrom
feature/pr-review-marker-and-shape-readers

Conversation

@ptr727

@ptr727 ptr727 commented Sep 21, 2026

Copy link
Copy Markdown
Owner

Fixes #1722. Fixes #1701.

Two digest-reader defects in scripts/pr_review.py, each of which blocks a Merge Gate over a review the script could not read rather than over anything wrong with the pull request. They land together because they are the same class of defect in the same file, and one review round over both costs less than two.

The coverage marker is read within its line, #1722

is_coverage_line and read_coverage both matched the fleet-review marker with fullmatch, so it counted only where it occupied its whole line. One of Copilot's two overview formats ends a prose sentence with it instead, and there the digest reported coverage=unstated about a round that stated full coverage in plain sight. Requesting another review does not clear it, the next round stating coverage the same way.

Both sites are widened, and that matters rather than being belt and braces: is_coverage_line is the collector, coverage_statements returns only the lines it accepted, and read_coverage therefore never saw the line at all.

The anchor was doing one more job than the issue credits it with. An HTML comment renders invisibly, so a body that wants a marker seen has to quote it, and coverage_statements already strips a fenced block and an inline code span ahead of every reader. A blockquote is the third such convention, and the line anchor was excluding one for free, because > is not whitespace. That exclusion is now explicit, and it runs to the blank line that closes the quotation rather than to the end of the line opening it, since a line carrying no > under one that does is still inside it. Continuation carries paragraph text only, so a line opening its own block ends the quotation above it, which of the three coverage spellings leaves only the reviewer's own sentence quotable.

A line carrying both a prose count and a disagreeing marker is refused. Two readings that disagree leave unanswered which one the round meant, which is the case read_coverage already returns None for, and refusing it blocks rather than passing.

The two unread Copilot summary shapes, #1701

Previously missed (N) and a severity badge rendered as an inline picture element were both reported as unrecognized, and an unrecognized shape blocks the gate on its own.

The issue's open question is settled. It could not tell whether (N) was Copilot's placeholder or the script's substitution, and said a second repository's review would be needed. It is the script's: the live body carries Previously missed (1), and normal reduces every count to (N) exactly as it does for the suppressed heading beside it.

The badge carries its severity only in the img alt. Every other part is a versioned icon URL, and the set has already been bumped once, so normal reduces a badge to that text and nothing keys on the markup. A finding entry cannot be vetted the way a section heading is, its title differing on every finding, so the badge identifies the shape and a stated count separates a section heading from a finding's title.

Vetting the heading alone would have been the wrong fix. It would have silenced the section while hiding the findings inside it, which is the reverse hazard the issue names. Those entries raise no inline thread, which is a suppressed finding's exact shape, so the section is read the same way: counted across every round, split by head, and printed whole with its severity as a word. It is kept apart from suppressed= because the two take different answers, one a finding the reviewer withheld and one it raised outright against code the branch never touched. No exit code rides on it.

pr-review-conduct's Merge Gate item 3 enumerates the no-thread finding classes by digest field and now names this one, since an agent working that gate otherwise has no instruction covering a field the digest prints. scripts/README.md documents it beside suppressed=.

Review record

Five adversarial passes ran before this opened, raising 24 findings between them. The two fixes above were sound from the first pass; every round after it was repairing the machinery built around them. Of note, because the branch's own theme is this defect class:

  • A badge whose img had lost its alt, which icon-set drift produces, paired with the next entry's badge and deleted a finding's title and text from the only place those findings appear.
  • Reading a quoted heading as a raised section, which is reachable from this pull request's own test bodies.
  • A section anchor that matched anywhere in a line, so the sentence restores a guard previously missed (2) rounds ago fabricated a section on a clean round.
  • Spelling that anchor's whitespace as \s, which is Unicode-aware and so overlapped the non-ASCII alternative beside it, making the leading run ambiguous and the parse exponential in it. Twenty-six non-breaking spaces took six seconds.
  • Two fail-opens on quoted content, a lone closing tag and a tab indent, each letting a quoted coverage line read as the round's own.
  • FLEET_REVIEW's own leading \s*, which the whole-line spelling needed and a search does not, quadratic in the whitespace run it sits in.

Each is held by a case that fails without its fix.

Known residual

The section anchor still admits non-ASCII punctuation, so an em dash opening a sentence can read as the section heading. It is narrower than every earlier spelling, which admitted ASCII punctuation too, and closing it means a class of non-ASCII symbols rather than the whole of non-ASCII. A sibling section heading stating no count does not bound a block, which is recorded in sibling_heading's own docstring: the requirement is strictly narrowing, and every vetted heading states a count, so a body reaching it also reports shapes=UNRECOGNIZED and tells its reader not to believe the fields beside it.

Out of scope and filed separately: #1725, FLEET_REVIEW opening on \s* means a four-space-indented marker, which is a Markdown code block and so a quotation, reads as a stated coverage line.

Verification

1641 tests pass. Ruff, mypy, prose_lint.py, repo_gate.py --check eol, spec/validate.py and build_dist.py --check are green. Checked against the live review bodies the issues name: the round that was blocking reads unrecognized=0 coverage=full with its previously-missed finding surfaced, and the one round still reading unstated genuinely carries no coverage statement of any kind.

The comments label is set because the change adds comment lines deliberately, this file recording the reasoning for each reader beside it rather than in a commit nobody reads next to the code.

🤖 Generated with Claude Code

…ng Shapes

Two digest-reader defects, both in scripts/pr_review.py, each of which
blocks a Merge Gate over a review the script could not read rather than
over anything wrong with the pull request.

## The marker is read within its line, #1722

`is_coverage_line` and `read_coverage` both matched the `fleet-review`
marker with `fullmatch`, so the marker counted only where it occupied
its whole line. One of Copilot's two overview formats ends a prose
sentence with it instead, and there the digest reported
`coverage=unstated` about a round that stated full coverage in plain
sight. Requesting another review does not clear it, the next round
stating coverage the same way, so every promotion pull request taking
that format blocked on a satisfied item.

Both sites are widened, which matters: `is_coverage_line` is the
collector and `read_coverage` never sees a line it rejected, so widening
only the second changes nothing.

The line anchor was never what made the marker trustworthy. An HTML
comment renders invisibly, so a body that wants one seen has to quote
it, and `coverage_statements` strips a fenced block and an inline code
span before any reader is consulted. A blockquote is the third such
convention, and the anchor used to exclude one for free because `>` is
not whitespace. That exclusion is now made explicit beside the other
two, so a review quoting a marker still does not read as one stating
coverage. The prose readers beside it stay anchored deliberately.

## The two unread Copilot summary shapes, #1701

`Previously missed (N)` and a severity badge rendered as an inline
`picture` element were both reported as unrecognized, and an
unrecognized shape blocks the gate on its own.

The issue could not tell whether `(N)` was Copilot's placeholder or the
script's own substitution. It is the script's: the live body carries
`Previously missed (1)`, and `normal` reduces every count to `(N)`
exactly as it already does for the suppressed heading. The counted
spelling is vetted, and a countless one still blocks, matching the bound
the suppressed heading already keeps.

The badge carries its severity only in `img` `alt`, every other part
being a versioned icon URL that has already been bumped once, so
`normal` reduces a badge to that text and nothing keys on the markup.
A finding entry cannot be vetted the way a section heading is, its title
differing on every finding, so the badge is what identifies the shape.

Vetting the heading alone would have hidden the findings under it, which
is the reverse hazard the shape check exists to prevent. The section is
therefore read the way the suppressed section is: it raises no inline
thread, so it has no resolved state, and the digest is the only place a
reader meets it. It is counted across every round, split by head, and
printed with its severity as a word. It is kept apart from `suppressed=`
because the two take different answers, and no exit code rides on it.

Verified against the live review bodies the issues name: the round that
blocked now reads `unrecognized=0 coverage=full` with its
previously-missed finding surfaced. Each part of the fix is pinned by a
test that fails without it.
…a Contradiction

Ten findings from the pre-push adversarial pass, each reproduced against
the tree before it was fixed and each now pinned by a test.

Four were silent data loss rather than a blocked gate, which is the
worse direction for a reader who meets these findings nowhere else.

- `SEVERITY_BADGE`'s two gaps were unbounded under `DOTALL` and could
  cross `</picture>`. An entry whose own `img` carries no `alt`, which
  the icon set drifting is exactly how to produce, paired with the next
  entry's, deleting the first entry's title and its whole finding text.
  Both gaps now refuse to cross a `picture` tag.
- `finding_entry` gated on a leading severity word alone, so a section
  heading such as `High severity findings (2)` was vetted although
  nothing has a reader for it, and its findings reached no digest. Every
  section heading here states a count and a finding's title does not, so
  the absence of one is now the other half of the test. The count is
  read in the `(N)` spelling `normal` leaves rather than in digits,
  which is the form the predicate actually receives.
- `PREVIOUSLY_MISSED` matched anywhere in a line, and `marker_blocks`
  accepts a line on a count alone, so the sentence `restores a guard
  previously missed (2) rounds ago` fabricated a section on a clean
  round. The marker is now anchored to the opening of its line, past
  whatever markup a heading wears.
- `marker_blocks` read the raw body while every other reader here masks
  quotations first, so a quoted heading counted as a section raised.
  That is reachable on this pull request rather than hypothetically,
  since the test bodies here quote these headings. Detection now runs
  over a length-preserving mask and the block is still taken from the
  body, which is what `details_spans` is for.

Three were wrong output that a reader would have acted on.

- Two sections sharing one wrapper, which the corpus carries as a
  Markdown heading each, sliced each block to the end of the shared
  region, so the first contained the second whole and the digest printed
  those findings twice, the second time under a banner asserting the
  opposite triage. A block now ends at its sibling's heading.
- One line carrying both a prose count and a disagreeing marker read as
  the marker, so the same two claims read `full` on one line and
  `partial` on two, and a round whose own prose says it read 2 of 3
  files cleared the gate. `coverage_of` takes the worst reading across
  lines, and a contradiction within one is the case `read_coverage`
  already returns None for.
- The blockquote guard tested each line's own `>`, which Markdown's lazy
  continuation defeats: the line after a quotation's first is still
  inside it. The quotation now runs to the blank line that closes it.

Three were narrower.

- `int` over `FLEET_REVIEW`'s unbounded digit runs raised above 4300
  digits, crashing the digest rather than reporting a line it could not
  believe. Reading the marker within its line is what made that
  reachable from any line carrying one. Bounded to four digits, which
  `COUNT_LOOSE` already holds its own runs to.
- The badge reduction reached only the newer render, leaving the
  suppressed render printing two icon URLs per finding, which is the
  defect the reduction exists for. All three no-thread renders now share
  one `unwrap`, which also drops the emphasis none of them was dropping.
- The Merge Gate enumerates the no-thread finding classes by digest
  field and did not name this one, so an agent working that gate had no
  instruction covering a field the digest now prints. `pr-review-conduct`
  names it, with the note that "the branch did not touch that code" is a
  reason to decline a finding with evidence rather than to leave it
  unanswered. `scripts/README.md` documents the field beside `suppressed=`.

Three test defects from the same pass: a boundary test whose fixture
could not cross the boundary it was named for, an assertion the line
above it entailed, and a count pair not bound to the field under test,
which `suppressed=` prints the same shape for. The test asserting that
the marker outranks a prose count on one line is deleted rather than
adjusted, that behavior being what the contradiction finding overturned.
Seven findings from a second adversarial pass, every one of them against
a fix from the first round rather than against the original change.

Four of the first round's fixes were wrong in the direction that matters,
turning a blocked gate into a silent pass or the reverse.

- `sibling_heading` bounded a block at any heading matching another
  section's marker. In this format every finding entry is its own
  `<summary>`, so a heading test is satisfied by all of them, and the
  suppressed marker is ordinary English a title carries as readily as a
  heading does. A section whose second entry read `Low confidence
  fallback swallows the error` ended at that entry, and the entries after
  it printed under the other section's banner, which asserts the opposite
  triage, with both counts wrong. It also truncated CodeRabbit blocks,
  which nothing bounded before. A stated count now separates a sibling
  heading from a finding entry, which is the signal `finding_entry`
  already reads.
- The quotation mask preserved character offsets but not line structure.
  `splitlines` breaks on a form feed, a vertical tab, a lone carriage
  return and three more, all of which the mask turned into spaces, so a
  quoted snippet carrying one left the masked copy a line shorter than
  the body and the block started a line early and lost its finding text.
  That is the defect spans exist to prevent, arriving through the mask
  instead. The class now names every character `splitlines` breaks on.
- The section anchor was spelled as the list of openers seen so far, so a
  heading wearing anything else matched nothing. An emoji is the live
  case, this format already putting one on its verdict headings, and the
  failure is silent rather than loud: the heading is vetted and `normal`
  drops the emoji before the comparison, so the digest reports every
  shape read while the findings reach nobody. The anchor now admits any
  run of tags and non-word characters, a word character being the whole
  of what separates a heading from a sentence naming one.
- Lazy continuation was applied to every line under a quotation, but
  Markdown continues paragraph text only. Of the three coverage
  spellings, the bullet and the marker each open a block, so a round
  stating full coverage under a quoted note reported none at all, which
  blocks a merge on a satisfied item. A line opening its own block now
  ends the quotation above it.

Two were fixes whose stated reason was not the property the code had.

- Bounding the marker's digit runs in the pattern meant an over-long run
  stopped matching, so the line left the gate silently and a round
  carrying one read as full on whatever else its body said. The comment
  claimed it would "report a line it could not believe" and it reported
  nothing. The runs match unbounded again and the length is judged in the
  reader, which is the seat that can answer `unvetted`.
- The contradiction rule returned None and the comment beside it claimed
  this stopped the verdict turning on whether the reviewer pressed
  return. It did not: one line read `unvetted` and two read `partial`.
  The worse of the two readings is now taken, which is what
  `coverage_of` already does between lines, so the two agree.

One was dead code the refactor left: `details_regions` had no caller
after `details_spans` replaced it, and a docstring still routed a reader
to it. Both are gone.

`scripts/README.md` claimed the new field prints only where a round
raised a finding, where the code also prints it on a truncated reviews
window, which is the condition that earns the trailing `+`.

Three tests are rewritten rather than adjusted, each having asserted the
behavior one of these findings overturned.
A third pass found four regressions, every one of them introduced by the
second round of fixes rather than by the change itself. Three are
reverts: the previous state was correct and only the reason written
beside it was wrong, which is what the second round should have fixed.

- `read_coverage` took the worse of two disagreeing readings on one
  line. An impossible pair carries a negative shortfall and so is never
  the larger, which meant `reviewed=4 changed=3` beside a prose `4/4`
  read as full coverage and exited 0, where the line had blocked before.
  That is a fail-open on the one gate item nothing else can check, and
  worse than the state this change started from. Refusing the line is
  restored, and the comment beside it now states the property the code
  has rather than one it does not.
- The section anchor was widened to any non-word character, which is
  what prose opens with as readily as markup. `- Previously missed (2)
  findings were re-raised this round.` became the section, printing the
  prose around it as the finding. The class is heading markup again,
  plus anything outside ASCII, which is the one opener the narrow
  spelling actually lacked and the emoji case that prompted widening it.
- `STARTS_BLOCK` ended a quotation on any line opening with `<`. An
  inline tag leaves its line paragraph text and a four-space indent
  makes it a code block, and neither interrupts a paragraph, so a quoted
  marker in either shape read as this round's own statement. The opener
  is a comment or a tag standing alone, and the caller holds the indent
  bound.

The fourth is kept rather than reverted, with its cost written down. A
sibling heading stating no count does not bound a block, so one runs
into it. Requiring the count is what stopped a block being cut at a
finding entry titled `Low confidence fallback swallows the error`, which
printed the entries after it under the opposite triage with both counts
wrong. The requirement is strictly narrowing, it can only lose a bound
and never invent one, and every vetted heading states a count, so the
shape that reaches it also reports `shapes=UNRECOGNIZED` in the same
digest and tells its reader not to believe the fields beside it.

Two tests are added where a green suite missed a regression: the prose
cases the section anchor must refuse, whose existing fixture happened to
open on a word and so held while these did not, and the two blockquote
shapes above. The contradiction test asserts refusal again and carries
the impossible pair, which is the case whose absence let the fail-open
through a passing suite.
…olumns

One hang and two fail-opens, all three in what the previous commit
touched.

The re-narrowed anchor spelled its whitespace as `\s`, which is
Unicode-aware and so overlapped the non-ASCII alternative beside it on
every non-ASCII space. Two alternatives able to consume one character
make the run ambiguous, and the parse then doubles per character of it
on a line that does not go on to say `Previously missed`. A body
carrying 26 non-breaking spaces took six seconds and 40 would have taken
hours, and `marker_blocks` runs this over every line of every review
body, so one such line hangs `status` and `wait` with nothing said about
why. The whitespace is spelled out as ASCII, every alternative now opens
on a character the others cannot, and 40 of them parse in no measurable
time.

`STARTS_BLOCK` accepted any tag standing alone on its line as a block
opener. Only some tag names open a block that can interrupt a paragraph,
and a lone `</span>` is not among them, so a quoted coverage sentence
under one read as this round's own statement and satisfied the coverage
item on a quotation. No coverage spelling opens with a tag in any case,
the bullet opening on its marker and the sentence on the reviewer's own
name, so the alternative bought nothing and is dropped rather than
narrowed to a list of tag names.

The four-space bound beside it counted characters rather than columns. A
tab is four columns and so an indented code block on its own, which
cannot interrupt a paragraph either, and counted as one character it
cleared the quotation and let a tab-indented marker read as this round's
own. Indentation is measured with tabs expanded.

What the anchor still admits is non-ASCII punctuation: an em dash or a
typographic quote opening a sentence reads that sentence as the section.
The comment beside it said the class was the markup and no longer claims
that. It is narrower than the spelling before it, which admitted ASCII
punctuation as well, and closing the rest means a class of non-ASCII
symbols rather than the whole of non-ASCII.

Each of the three is held by a case, the hang by one asserting the read
finishes rather than that it is fast, and the blockquote cases now carry
a coverage sentence after the quoted line so a body that lets one
through fails on the reading rather than only on the collection.
`FLEET_REVIEW` opened and closed on `\s*`, which the spelling that
matched a whole line needed and a search does not. An unanchored run of
it is quadratic in the whitespace run it sits in, so reading a body
carrying a long one cost seconds: 16000 spaces took half a second and
65000 took nine, against milliseconds before this branch changed the
match. The marker itself is the only thing a search looks for, so both
runs are dropped and the same body reads in under two milliseconds.

No reading changes. Every consumer of the pattern is a search, so
leading and trailing whitespace was never part of what either one
matched, and the marker still reads alone on its line, inside a
sentence, indented, and through a trailing tab or a CRLF.

This is the one defect the change set introduced that no round of review
caught, the `fullmatch` to `search` widening having carried the runs
across unexamined.
Copilot AI lite review requested due to automatic review settings September 21, 2026 03:43
@ptr727 ptr727 added the comments Permits the comment lines the pull request adds or edits, which the prose gate otherwise refuses label Sep 21, 2026
@coderabbitai

coderabbitai Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Repository: ptr727/ProjectTemplate/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: e6ac3c2f-e101-4c24-9cdd-483408752122


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The changes look correct and well-tested; only a small performance/cleanup nit remains in coverage_statements (duplicate expandtabs(4) calls).

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

This pull request fixes two digest-reader gaps in scripts/pr_review.py that could incorrectly block the Merge Gate: (1) reading the <!-- fleet-review: ... --> coverage marker only when it occupied a whole line, and (2) treating Copilot’s “Previously missed (N)” section + severity-badge finding entries as unrecognized shapes.

Changes:

  • Parse the fleet-review coverage marker via search (not full-line match) and explicitly refuse quoted/ambiguous coverage statements.
  • Add recognition + digest rendering for Copilot’s “Previously missed (N)” no-thread findings, including severity badge normalization.
  • Extend tests and docs to cover the new parsing rules and the new previously_missed= digest field.
File Description
scripts/​tests/​test_pr_review.py Adds fixtures and tests for inline coverage markers, blockquote/quotation exclusions, and the “Previously missed” section parsing + rendering.
scripts/​README.md Documents previously_missed= semantics and how severity badges are reduced for readable digest output.
scripts/​pr_review.py Implements inline marker coverage parsing, blockquote-aware coverage collection, “Previously missed” section extraction, badge normalization, and digest reporting.
.github/​skills/​pr-review-conduct/​SKILL.md Generated skill copy updated to mention previously_missed triage (do not edit directly).
.claude-plugin/​fleet-skills/​skills/​pr-review-conduct/​SKILL.md Generated plugin skill copy updated to match source (do not edit directly).
.claude-plugin/​fleet-skills/​.source-digests/​pr-review-conduct Updates the source digest for the generated plugin skill content.
.agents/​skills/​pr-review-conduct/​SKILL.md Source skill updated to include “Previously missed” as a no-thread finding class requiring explicit triage.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread scripts/pr_review.py Resolved
`coverage_statements` called `expandtabs(4)` twice on the same line, once
for the expanded length and once for the expanded length after stripping,
inside the loop that scans every line of every review body. The result is
bound to a name and both lengths read from it.

No reading changes, which the tab-indented, four-space, mixed-indent,
bare-marker and bullet cases each confirm.
Copilot AI review requested due to automatic review settings September 21, 2026 04:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

The new PREVIOUSLY_MISSED anchor can still mis-detect common Markdown * bullet prose as a section heading, risking false “previously missed” blocks in the digest.

Review effort: Lite
Findings: None

Resolved since last review (1)
Previously missed (2)

In code that hasn't changed since last review

Medium severity Bullet list prose can be misparsed as a Previously missed section

scripts/​pr_review.py:285

PREVIOUSLY_MISSED currently allows a leading * via [ \t>#*_], which means a normal Markdown list item like * Previously missed (2) findings ... will match the section marker. Because marker_blocks() also accepts any line containing a numeric (N) (via COUNT.search), that bullet-form prose would be misread as the start of a Previously missed section and the digest could print unrelated prose as findings.

Medium severity Add star-bullet coverage for Previously missed heading detection

scripts/​tests/​test_pr_review.py:1145

The prose-guard test for PREVIOUSLY_MISSED covers - but not the other common Markdown bullet marker * . With the current regex, * Previously missed (2) ... matches and can be misread as the section heading when it includes a (2) count. Add * to the opener cases so this regression is exercised.

`PREVIOUSLY_MISSED` admitted `*` as heading markup, which it is in
`**Previously missed (1)**` and is not in the list item
`* Previously missed (2) findings were re-raised`. `marker_blocks`
accepts a line on a count alone, so that bullet read as the section and
the digest printed the prose around it as the findings, which is the
class of defect this branch exists to close rather than to add to.

A space is what separates the two, so an emphasis marker is admitted
only where none follows it. One character is taken per iteration rather
than a run of them, a repeated group able to split a run of stars more
than one way being ambiguous and parsing exponentially in it, which a
run of 40000 confirms it does not.

The prose cases now carry `* ` and `+ ` beside `- `, and the heading
cases carry the italic and bold-italic spellings, so the two sides of
the one character are both held.

Raised by the reviewer on this pull request through the collapsed
section this branch teaches the digest to read, which opens no thread
and would have reached nobody before it.
Copilot AI review requested due to automatic review settings September 21, 2026 04:50
@ptr727

ptr727 commented Sep 21, 2026

Copy link
Copy Markdown
Owner Author

Both findings in the Previously missed section are accepted and fixed in ce95c7b.

Bullet list prose can be misparsed as a Previously missed section. Correct, and it is the class this pull request exists to close rather than to add to. PREVIOUSLY_MISSED admitted a bare * because an emphasis marker is heading markup in **Previously missed (1)**, and marker_blocks accepts a line on a count alone, so the list item * Previously missed (2) findings were re-raised read as the section and the digest printed the prose around it as the findings. A space is what separates the two spellings, so an emphasis marker is now admitted only where none follows it. It is taken one character per iteration rather than as a run, since a repeated group able to split a run of stars more than one way is ambiguous and parses exponentially in it, which this same anchor has already done once on this branch. A run of 40000 stars confirms it does not.

Add star-bullet coverage for Previously missed heading detection. Also correct, and it is why the first finding survived a green suite: the prose guard held - and nothing else. The openers now carry * and + beside it, and the heading cases carry the italic and bold-italic spellings, so both sides of the one character are held.

Two admissions the anchor still has are named in its own comment rather than closed here: non-ASCII punctuation, which covers an em dash, a typographic quote and •, since closing those means a class of non-ASCII symbols rather than the whole of non-ASCII.

Worth recording that these two arrived through the collapsed section this pull request teaches the digest to read. They opened no thread, so the round carried unresolved=0 merge=CLEAN checks=8/8 while they stood, which is the false clean the change exists to prevent.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

The new severity-badge reducer only matches double-quoted alt="...", so a single-quoted alt='...' badge (valid HTML and already noted as plausible drift) would not be reduced and could reintroduce noisy/blocked parsing.

Review effort: Lite
Findings: None

Previously missed (1)

In code that hasn't changed since last review

Medium severity Single-quoted alt attributes are not handled by the badge matcher

scripts/​pr_review.py:356

SEVERITY_BADGE only matches alt attributes written with double quotes (alt="..."). Single-quoted attributes (alt='...'), which are valid HTML and are already treated as a plausible drift in the tests, will not be reduced, so the digest can regress to printing full markup (and potentially re-trigger unrecognized-shape blocking) if GitHub changes quoting style.

`SEVERITY_BADGE` matched `alt="..."` and nothing else, so a badge
written with single quotes, which is valid HTML, was not reduced at all.
The digest then prints two icon URLs per finding in place of the one
word they carry, and the entry can report as a shape nothing here knows,
which is the blocked gate this reader exists to clear.

The attribute's own quoting is presentation, and depending on it is what
this reader was written not to do: the icon URLs beside it carry a
version the set has already bumped once, and the quoting can change the
same way.

One group per quoting, since a single group cannot hold two
alternatives, and `badge_text` takes whichever matched. Both reduction
sites use it rather than a lambda reaching for a fixed group number.

The single-quoted case was already in the tests as a plausible drift,
asserting only that it did not reach past its own element, which held
while the badge was not matched at all. It now asserts the reduction,
which is the regression the case was meant to hold.
Copilot AI review requested due to automatic review settings September 21, 2026 05:08
@ptr727

ptr727 commented Sep 21, 2026

Copy link
Copy Markdown
Owner Author

Accepted and fixed in 0c2e4db.

Single-quoted alt attributes are not handled by the badge matcher. Correct. A single-quoted alt is valid HTML, and against one the badge was not reduced at all, so the digest prints two icon URLs per finding in place of the one word they carry and the entry can report as a shape nothing here knows, which is the blocked gate this reader exists to clear. Both quotings are read now, one capture group each, and badge_text takes whichever matched rather than a lambda reaching for a fixed group number. That helper is load-bearing rather than tidy: re.sub substitutes an empty string when its callable returns None instead of raising, so keeping the old lambda beside the new pattern would have dropped a single-quoted severity word silently.

The sharper half of the finding is that this shape was already in the tests as a plausible drift. It asserted only that such a badge did not reach past its own element, which held precisely because nothing matched it, so the case passed for the wrong reason. It now asserts the reduction, and it fails under a revert of the pattern, a revert of the helper, and a revert of both.

Measured rather than assumed, since the pattern carries two bounded gaps: the alternation makes the single-quoted worst case quadratic where it was linear, but at the same magnitude the double-quoted worst case already had, about half a second at the 65536-character ceiling GitHub imposes on a comment body. The complexity class and the absolute cost are unchanged, reached through a second character.

What the anchor still admits, non-ASCII punctuation, is named in its own comment rather than closed here.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

read_coverage() can still crash on oversized prose digit runs, and marker_blocks() can misread blockquoted quoted headings as real sections.

Review effort: Lite
Findings: None

Previously missed (1)

In code that hasn't changed since last review

Medium severity Unbounded int() on coverage counts can crash digest

scripts/​pr_review.py:1252

read_coverage() now guards overly long digit runs for the HTML marker, but it still calls int() on the prose coverage counts without any length bound. A crafted or accidental coverage sentence with >~4300 digits (Python's max int string digits) will raise ValueError and crash the digest rather than returning UNVETTED/blocking safely.

This issue also appears on line 2268 of the same file.

`read_coverage` guarded the marker's digit runs against `int` raising
above 4300 digits and left the prose counts beside them unguarded, so
the sentence and bullet spellings each crashed the digest on a run the
marker spelling refused. `finding_count` converted a heading's own `(N)`
the same way.

The bound is stated once as `COUNT_DIGITS` and applied through
`counted`, which returns the number or nothing, so every site converting
a matched run goes through it rather than straight to `int`. Four digits
is what `COUNT_LOOSE` already holds its own runs to, a review stating
tens of files and never thousands.

The two readers answer a refused run differently, each in its own safe
direction. A coverage line reads as unvetted, which blocks, since a line
this cannot believe is the case that reader already returns nothing for.
A collapsed block falls to the floor of one that `finding_count` already
carries, the block existing being what says there is a finding in it,
where zero would read as a clean pass.

The bound stays in the readers rather than moving into the patterns.
Bounding a pattern leaves the line unmatched, which reads as no
statement at all rather than as one this cannot believe, and that
distinction is the whole of why the marker's own bound sits where it
does.

Raised by the reviewer on this pull request through the collapsed
section this branch teaches the digest to read.
The cases for `COUNT_DIGITS` used a 4400-digit run, which every plausible
value of the bound refuses, so they pinned it downward and not upward: a
drift from four to six, or to 4299, left the whole suite green.

A five-digit run is the edge, and reading it beside the four-digit
positive control is what holds the bound where it is. Mutating the
constant to three, five, six or 4299 now adds three failures to a
baseline that has none.

Tests only. No reader changes.
Copilot AI review requested due to automatic review settings September 21, 2026 05:27
@ptr727

ptr727 commented Sep 21, 2026

Copy link
Copy Markdown
Owner Author

Accepted and fixed in 141ad4f.

Unbounded int() on coverage counts can crash digest. Correct, and it is a gap in the guard rather than a case it never had: the previous round bounded the marker's own digit runs and left the prose counts beside them converting straight through, so the sentence and bullet spellings each crashed the digest on exactly the input the marker spelling refused. finding_count converted a heading's (N) the same way. Both reproduce.

The bound is now stated once as COUNT_DIGITS and applied through counted, which returns the number or nothing, so every site converting a matched run goes through it rather than straight to int. Four digits is what COUNT_LOOSE already holds its own runs to.

The two readers answer a refused run differently, each in its own safe direction. A coverage line reads as unvetted, which blocks, since a line this cannot believe is the case that reader already returns nothing for. A collapsed block falls to the floor of one finding_count already carries, the block existing being what says there is a finding in it, where zero would read as a clean pass and on_head=0 is the signal that closes a loop.

The bound stays in the readers rather than moving into the patterns. Bounding a pattern leaves the line unmatched, which reads as no statement at all rather than as one this cannot believe, and that distinction is why the marker's own bound sits where it does.

Your pointer named line 2268, which is marker_blocks. The second conversion is finding_count, and the line has moved over the round, so the reading was right and the number was stale.

One thing the cases did not hold, found while checking them: they used a 4400-digit run, which every plausible value of the bound refuses, so they pinned it downward and not upward. Mutating the constant to six or to 4299 left the suite green. A five-digit run is the edge and is now read beside the four-digit positive control, so three, five, six and 4299 each add failures to a baseline that has none.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

The new coverage_statements() blockquote-state machine can misclassify indented code lines beginning with > as blockquote openers, incorrectly suppressing subsequent real coverage statements until a blank line.

Review effort: Lite
Findings: None

Previously missed (1)

In code that hasn't changed since last review

Medium severity Indented code lines are misread as blockquotes

scripts/​pr_review.py:1234

coverage_statements() treats any line that starts with > (after lstrip()) as the start of a blockquote. This incorrectly flags an indented code block line like > prompt as a blockquote opener, and then suppresses subsequent unindented paragraph lines (including real coverage statements) until a blank line appears. In Markdown, an indented code block ends as soon as the next unindented line starts, so this can cause false coverage=unstated reads.

`coverage_statements` opened a blockquote on any line whose first
non-space character is `>`, which an indented line's is not: four
columns of indentation make it a code block, and the `>` in it is text.
A body quoting a prompt that way opened a quotation that swallowed every
line to the next blank one, so a coverage statement among them read as
none stated at all, which blocks a merge on an item the round satisfied.

The bound is the one the block opener beside it already holds, hoisted
above both so the two read the same line the same way, in columns rather
than characters and so with a tab counting as four.

Every shape either side of it is unchanged: a marker carrying its own
`>`, a marker or a bullet opening a block under a lazy continuation, a
tab-indented marker inside one, and a quotation marker at one, two or
three columns, which is still a quotation.

What this does reach, named rather than claimed away, is a genuine
quotation whose marker sits at four columns or more because a container
holds it, a blockquote inside a numbered list being the shape. That is
read as a code block now and its content can be collected as this
round's own. The cause predates this change and is wider than it: the
reader measures indentation from the line start with no notion of a
container, so container-indented content was never excluded, and the
same sentence without any `>` reads the same way before and after. Four
non-breaking spaces do it too, `str.lstrip()` being wider than the
whitespace CommonMark counts. None of 2367 measured review bodies
carries an indented `>` at all.
Copilot AI review requested due to automatic review settings September 21, 2026 05:41
@ptr727

ptr727 commented Sep 21, 2026

Copy link
Copy Markdown
Owner Author

Accepted and fixed in 4458099.

Indented code lines are misread as blockquotes. Correct, and reproduced: Some prose. then > prompt then a coverage sentence read as unstated where the sentence states full coverage. The reading is exactly as described, and the direction is the one that blocks a merge on an item the round satisfied rather than passing one it did not.

The bound was already three lines below, guarding the block opener. I applied it there and not here, so the fix is hoisting it above both branches, which now read the same line the same way, in columns rather than characters and so with a tab counting as four. A quotation marker at one, two or three columns is still a quotation, and the shapes either side are unchanged: a marker carrying its own >, a marker or bullet opening a block under a lazy continuation, and a tab-indented marker inside one.

One correction to my own commit message, which first said a genuine quotation is unaffected. That is slightly overstated and the wording is now fixed. A quotation whose marker sits at four columns or more because a container holds it, a blockquote inside a numbered list being the shape, is read as a code block and its content can be collected as this round's own. The cause predates this change and is wider than it: the reader measures indentation from the line start with no notion of a container, so container-indented content was never excluded, and the same sentence without any > reads identically before and after. Four non-breaking spaces reach it too, str.lstrip() being wider than the whitespace CommonMark counts. None of 2367 measured review bodies on this repository carries an indented > at all, so nothing already merged changes reading.

Worth recording that this round's own marker line carries your summary of the two defects, which is the collapsed section and the coverage marker this pull request teaches the digest to read, both working on the pull request that adds them.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The changes are well-scoped to the digest readers, include focused regression tests for the reported failure modes, and preserve blocking behavior for genuinely ambiguous or unrecognized shapes.

Review effort: Lite
Findings: None

@ptr727
ptr727 merged commit f9b53ef into develop Sep 21, 2026
9 checks passed
@ptr727
ptr727 deleted the feature/pr-review-marker-and-shape-readers branch September 21, 2026 13:55
ptr727 added a commit that referenced this pull request Sep 21, 2026
…the two Copilot finding shapes (#1730)

Closes #1722. Closes #1701.

Promotes `develop` to `main`. Two commits.

## Read the Coverage Marker Inside a Sentence, and the Two Copilot
Finding Shapes (#1726)

Two digest-reader defects in `scripts/pr_review.py`, each of which
blocked a Merge Gate over a review the script could not read rather than
over anything wrong with the pull request under it.

**The coverage marker is read within its line, #1722.**
`is_coverage_line` and `read_coverage` matched the `fleet-review` marker
with `fullmatch`, so it counted only where it occupied its whole line.
One of Copilot's two overview formats ends a prose sentence with it, and
there the digest reported `coverage=unstated` about a round that stated
full coverage in plain sight, which requesting another review does not
clear. Both sites are widened, the collector as well as the reader. The
line anchor was also excluding a blockquoted marker for free, so that
exclusion is now explicit beside the fenced-block and code-span strips
that were always deliberate, and it runs to the blank line that closes
the quotation, carrying paragraph text only.

**The two unread Copilot summary shapes, #1701.** `Previously missed
(N)` and a severity badge rendered as an inline `picture` element were
both reported as unrecognized, and an unrecognized shape blocks the gate
on its own. The issue's open question is settled: the `(N)` is this
script's own normalization rather than Copilot's placeholder, the live
body carrying `Previously missed (1)`. The badge's severity is read from
its `img` `alt`, every other part being a versioned icon URL, and either
quoting of that attribute is accepted. Vetting the heading alone would
have silenced the section while hiding the findings inside it, so the
section is read the way a suppressed one is: counted across every round,
split by head, and printed whole, kept apart from `suppressed=` because
the two take different answers, with no exit code riding on it.

`pr-review-conduct`'s Merge Gate item 3 names the new field, since it
enumerates the no-thread finding classes and an agent working that gate
otherwise has no instruction covering one the digest prints.
`scripts/README.md` documents it beside `suppressed=`.

**The review loop found five further defects, every one through the
reader this change adds.** Each arrived in a collapsed section that
opens no thread, so each round reported `unresolved=0 merge=CLEAN` while
they stood. Two were crashes on unbounded digit runs, two were false
`unstated` reads that block a merge on a satisfied item, and one was a
badge left unreduced by a quoting change. Ten local passes ran across
the branch, disposing of 30 findings in total.

Known residuals, documented in the source rather than left to be
rediscovered: the section anchor admits non-ASCII punctuation, and a
sibling heading stating no count does not bound a block, a body reaching
that also reporting `shapes=UNRECOGNIZED`. #1725 covers the
indented-marker looseness separately.

## Bump codecov/codecov-action from 7.1.0 to 7.1.1 in the actions-deps
group (#1728)

Dependabot, already reviewed and merged on `develop`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comments Permits the comment lines the pull request adds or edits, which the prose gate otherwise refuses

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants