Skip to content

Promote the Second Review-Body Format Reader to Main - #1691

Merged
ptr727 merged 1 commit into
mainfrom
develop
Sep 19, 2026
Merged

ptr727 merged 1 commit into
mainfrom
develop

Conversation

@ptr727

@ptr727 ptr727 commented Sep 19, 2026 •

Copy link
Copy Markdown
Owner

Promotes one change: the reader for Copilot's second review-body format.

What lands

scripts/pr_review.py now reads the <!-- ccr-overview-v2 --> format. Before this, its three unvetted markers exited 43 on every Copilot-reviewed pull request, so no review loop could close on the digest.

  • The three blocked markers are vetted, plus Resolved since last review (N), which a later round introduced. Emphasis tags around a marker are dropped before comparison rather than vetted with it.
  • effort= reads both spellings. Reading only the first format's bullet printed effort=unknown over a body stating the level outright.
  • overview=T/M is new. T is the finding total the round states in its overview preamble, ? where none is found, and None reads as zero since a round raising nothing states it in words. M is the number of review threads that round opened, read from the API. A total larger than the thread count prints a FINDINGS WITH NO THREAD block. No exit code rides on it.

Why M comes from the API rather than the review body

Six readings took it from the body's own enumeration and four shipped a false green: a shortfall of zero over a body that withheld findings, because something that was not an enumeration entry got counted. A prose back-reference, a change-summary link, a nested sub-bullet, a back-reference on the entry line, a list inside an entry's collapsed detail. Telling those apart needs each list marker's own content column and each HTML block's own extent, which is a Markdown parser rather than a line scan.

The count was never in the prose. Each entry's anchor is the database id of that thread's own comment, so the threads the round opened are the same set the enumeration names, already structured. Q_FULL gained a review id and each thread's opening review to link them. That round deleted more than it added.

What is recorded as unmeasured

The equivalence above holds while a round's enumeration lists what that round raised. A round on the feature pull request carried a Resolved since last review (N) section, so the format tracks a finding's state across rounds rather than describing one round, and an Open (N) carrying what an earlier round left open would state a total whose threads belong to that round. No round read here has shown it. Until one does, a shortfall and a ? both send the reader to the review body rather than standing in for it, which the digest and every reader-facing surface say.

Whether a stated total includes a suppressed section's findings is unmeasured the same way, so suppressed=2 beside a shortfall of 2 is either two findings or four.

Coverage, and why this merged without it

Four rounds in this format have been read across two pull requests, and only the first stated its file coverage. The three on the feature pull request carried neither the fleet-review marker the carried code-review instructions ask for nor a Files reviewed line, on a head carrying those instructions, so two re-requests did not clear it. status exits 45, COVERAGE_IS_UNSTATED, on each. The maintainer took that decision explicitly with every other Merge Gate item satisfied: one finding found, fixed and resolved, two later rounds raising nothing, and checks green.

That inconsistency is recorded in the module docstring rather than left as a surprise, and it is worth its own issue against the instructions or the reader.

Verification

Against the live round that raised the original issue, status moves from shapes=UNRECOGNIZED with three listed markers and effort=unknown to shapes=ok, effort=lite effort_source=explicit, overview=2/2. Five first-format pull requests read identically before and after, carrying no overview= field. The reader then read three live rounds of its own pull request, one of which raised exit 43 on a shape it did not know, which is the contract working on the change that adds it.

Mutations across every guard on this change, each killed by the case whose name claims it. Ten adversarial local review passes and three hosted rounds, and every commit after the first two answers one of them.

Closes #1688

Copilot's reviews here now arrive in a second body format, identified by
the `<!-- ccr-overview-v2 -->` marker it opens with. The first review in
it named three markers `scripts/pr_review.py` had no spelling for, so
`status` exited 43 and no Copilot-reviewed pull request could close its
review loop. That exit is the contract working, and the remedy it names
is this reader.

## What the format changes

Its overview heading is `## Copilot review overview` rather than `##
Pull request overview`. It wraps each `<summary>` in `<strong>`, where
the first format wrapped none. It states its effort level and its
finding total on bare bold lines rather than as `Review details`
bullets, and it has no `Review details` section at all. It enumerates
each finding it opened a thread for as a link to that thread's own
comment anchor, under an `Open (N)` summary, and it carries a change
summary beside that.

## What this reads

The three blocked markers are vetted. Emphasis tags around a marker are
dropped before comparison rather than vetted with it, on the reasoning
the verdict headings already drop their colored circle: markup that
changes under an unchanged section is the cheapest drift there is.

`effort=` reads either spelling. Reading only the bullet left every
round in the new format printing `effort=unknown` over a body that
states the level outright, which is a reading lost rather than one
refused.

`overview=T/M` is new. `T` is the finding total the round states in its
overview preamble, `?` where no total is found there. `M` is the number
of review threads that round opened. A total larger than the thread
count is findings raised where polling threads cannot see them, and a
`FINDINGS WITH NO THREAD` block follows naming the shortfall. That is
what `suppressed=` reads in the first format, and the one body read in
this format carries no `Suppressed comments` heading for it to find. No
exit code rides on it, the same as `suppressed=` and `cr_outside_diff=`.

## Why `M` comes from the API

This is the part worth reviewing hardest, because six earlier attempts
read `M` out of the review body's own enumeration and four of them
shipped a false green: a shortfall of zero over a body that withheld
findings, because something that was not an enumeration entry got
counted as one. In order, those readings counted every anchor in the
body, then anchors inside the `Open (N)` region, then anchors on any
list item, then anchors on top-level list items, then entries grouped by
indent with the section ended by tag depth. Each was locally correct and
each moved the defect: a prose back-reference, a change-summary link, a
nested sub-bullet, a back-reference on the entry line, a list inside an
entry's collapsed detail.

Telling those apart needs each list marker's own content column and each
HTML block's own extent, which is a Markdown parser rather than a line
scan.

The count was never in the prose. The anchor each entry links is the
database id of that thread's own comment, so the threads the round
opened are the same set the enumeration names, already structured.
Confirmed against the live round that raised this: its two anchors are
exactly the two thread comment ids the API returns. `Q_FULL` gained a
review id and each thread's opening review to link them.

## What is stated as unmeasured, and why

The equivalence above holds while the round's enumeration lists what
that round raised. A format listing findings still open from earlier
rounds would state a total the thread count undercounts, printing a
standing shortfall on every round after the first. One round of one body
cannot settle that, and the code says so rather than asserting it. A
shortfall is therefore confirmed against the review body rather than
acted on from the number, and so is a `?`.

A thread past the hundred `reviewThreads` reads would also have counted
in `M`, which overstates the shortfall. `threads=` already carries the
trailing `+` saying the page was cut.

## What this deliberately does not do

The anchors are not used to select a thread. `reply --match` selects on
the finding's own words because that is what a caller has to hand, and
mapping an anchor back to a thread would need the thread query to carry
comment ids for that purpose. Nothing measured says the anchor would
select better.

The metadata bullet pattern stays bullet-anchored. Dropping the bullet
reads this format's own `**Changes:**` prose label as metadata and
blocks on it, so the two bare lines that carry a reading have their own
patterns instead.

That format states its file coverage inconsistently, which this pull
request's own review demonstrated: the round on #1687 carried the
`fleet-review` marker the fleet's carried `code-review` instructions ask
for, and the round on this pull request, whose head carries those same
instructions, carried no coverage statement at all and read as exit 45,
`COVERAGE_IS_UNSTATED`. That is the honest reading of a round that
stated none rather than a gap introduced here.

## Verification

Against the live pull request that raised this, `status` moves from
`shapes=UNRECOGNIZED` with three listed markers and `effort=unknown
effort_source=unknown` to `shapes=ok`, `effort=lite
effort_source=explicit` and `overview=2/2`. Five first-format pull
requests read identically before and after, carrying no `overview=`
field.

370 tests. Twenty mutations across every guard on this branch, all
killed, each by the case whose name claims it. Every commit after the
first two answers a review pass, local or hosted: the same reader was
rebuilt five times because the first four mechanisms each hid a finding.

The `comments` label is on this pull request because the prose gate
reports a `comment-added` line for every rationale line this change adds
or edits, this file's convention being a rationale block per constant.

Fixes #1688
Copilot AI lite review requested due to automatic review settings September 19, 2026 02:40
@ptr727 ptr727 added the comments Permits the comment lines the pull request adds or edits, which the prose gate otherwise refuses label Sep 19, 2026
@coderabbitai

coderabbitai Bot commented Sep 19, 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: fe80d0eb-0f26-485e-8103-8b9687d34d57


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 new reader logic is internally consistent with the existing parsing model, backed by extensive tests, and updates documentation and carried skill guidance to match the new digest behavior.

Review effort: Lite
Findings: None

What changed in this PR

Promotes support for Copilot’s second review-body format (<!-- ccr-overview-v2 -->) into scripts/pr_review.py, so status/digest can recognize the format, extract effort and stated finding totals, and avoid exit-43 failures on otherwise actionable Copilot reviews.

Changes:

  • Extend pr_review.py’s vetted-shape inventory and normalization to cover the ccr-overview-v2 headings/summaries and tolerate emphasis tags around markers.
  • Add overview=T/M reporting by reading the stated findings total from the review body preamble (T) and the round’s opened-thread count from the API (M), plus a “FINDINGS WITH NO THREAD” diagnostic block when T > M.
  • Update GraphQL query shape and expand the test suite with realistic ccr-overview-v2 fixtures and adversarial cases.
File Description
scripts/​pr_review.py Adds the second-format reader, thread-count manifest logic, updated GraphQL fields, and digest reporting for overview=T/M.
scripts/​tests/​test_pr_review.py Adds comprehensive test coverage for the new format parsing, manifest counting, and selection/tie-breaking behavior.
scripts/​README.md Documents overview=T/M, why M is sourced from the API, and how to interpret shortfalls and ?.
.agents/​skills/​pr-review-conduct/​SKILL.md Updates the review-conduct guidance to treat overview shortfalls/unknown totals as requiring body review and disposition.
.github/​skills/​pr-review-conduct/​SKILL.md Generated distribution update reflecting the pr-review-conduct skill change.
.claude-plugin/​fleet-skills/​skills/​pr-review-conduct/​SKILL.md Generated plugin distribution update reflecting the pr-review-conduct skill change.
.claude-plugin/​fleet-skills/​.source-digests/​pr-review-conduct Updates the source digest for the carried skill distribution.

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

@ptr727
ptr727 merged commit 9129f41 into main Sep 19, 2026
9 checks passed
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.

pr_review.py Has No Reader for Copilot's ccr-overview-v2 Review Format

2 participants