Skip to content

Promote develop to main: Read Copilot's Overview Sections Through One Recognizer - #2568

Merged
ptr727 merged 4 commits into
mainfrom
develop
Oct 8, 2026
Merged

ptr727 merged 4 commits into
mainfrom
develop

Conversation

@ptr727

@ptr727 ptr727 commented Oct 8, 2026 •

Copy link
Copy Markdown
Owner

Summary

Promotes four changes from develop.

  • #2562: scripts/pr_review.py reads Copilot's second overview format through one recognizer, read_overview, whose rows live in one table, OVERVIEW_SECTIONS. It reads the verdict and headline, the count-first open-findings section in both numbers, both resolved spellings, and the collapsible Open (N) block, matching each open entry against the head's threads by fullDatabaseId. A round whose verdict flags findings while counting none now exits 50 rather than reading as clean. scripts/README.md, the module docstring, and pr-review-conduct describe the new readings, and the generated skills are rebuilt.
  • #2570 fixes a finding this promotion's first Copilot round raised. An Open (N) section is not read as a total, so an entry it counted with no recognized thread link dropped out of every count. Each entry the section counts beyond its linked entries now reaches FINDINGS WITH NO THREAD. A linked entry is a bullet at the section's margin carrying a recognized link, outside any block collapsed within it.
  • #2573 fixes the next finding this promotion's Copilot round raised. An open section's thread ids are now read from the same margin-bullet entries its linked count reads, so a back-reference inside a collapsed block is no longer counted as a second missing finding.
  • #2571, merged to develop by another lane, rides along. Both menus now judge a cached hub tree fresh against the commit the session's own ref resolves to, rather than against origin/main. It carries no Closes on promotion line, so this promotion closes no issue for it.

Fixes #2480
Fixes #2479
Fixes #2544
Fixes #1723

Verification

🤖 Generated with Claude Code

…py (#2562)

## Summary

`scripts/pr_review.py` now reads Copilot's second overview format
through one recognizer, `read_overview`, rather than one reader per
section. A table, `OVERVIEW_SECTIONS`, names each collapsible section's
spelling and its role, so vetting a spelling and reading its entries
come from the same row.

- **Open-findings section.** `<summary><strong>N open
finding(s)</strong></summary>`, singular and plural, is a vetted shape
rather than exit 43. Where the preamble states no total, its count is
the round's total, since the revision writes the bare `**0 open
findings**` line only for a zero.
- **Entries against threads.** Each `#discussion_r<id>` entry an open
section lists is checked against the threads' first-comment
`fullDatabaseId`, now part of the full query. An entry linking no thread
is counted under `FINDINGS WITH NO THREAD` whatever the totals say.
Where the count-first section supplied the total, the block is measured
against its linked entries rather than against the threads the round
opened, so an entry linking an earlier round's thread is not a finding
without one.
- **Resolved section.** Both spellings stay vetted, and their entries
are read as information, not findings.
- **Verdict headline.** A head round opening on a flagging verdict while
it states no open finding, opened no thread, collapsed no suppressed or
previously-missed finding, and no reviewer thread is open, now exits
`50` (`VERDICT_NAMES_UNCOUNTED_FINDINGS`) from `status` and `wait`, and
prints the headline under `VERDICT WITH NO COUNTED FINDING`. It ranks
under 42, 43, and 45. An open thread defers it, since the headline may
name that thread.

`Open (N)` is deliberately not read as a total. Over recent rounds on
this repository it listed an earlier round's thread in 2 of 41, where
the count-first section listed only that round's own threads in all 17.

## Measured against this repository's own recent rounds

The new readings were run over the ccr-overview-v2 bodies on the last
100 pull requests here. No body reports an unrecognized shape, so the 43
exits that parked three lanes no longer arise on those bodies. No
open-section entry links a missing thread. The verdict reading fires on
34 of 142 rounds. Roughly three in four of those headlines name a
finding, and the rest name a caution such as the size of the change.
Each one now needs an answer before a loop treats the head as clean,
which is the cost of closing this blind spot.

## Not implemented

The second arm of #2544's acceptance, "or whose headline sentence names
outstanding findings", is not read. A clean verdict carrying a headline
that names findings has no structural marker, and matching the prose for
words like "findings" would cry wolf on a clean "no findings" headline.
The flagging-verdict arm covers every instance in the measured rounds.

## Tests

`TestOverviewSections` builds each shape from constructed text: both
numbers of the open section, its total, an unvetted count-first summary,
an entry linking no thread where the totals balance, the resolved
section, and exit 50 from both `status` and `wait`, with a clean verdict
and a counted finding as the two negatives. The new behavior tests fail
against `develop`'s script. Existing fixtures gained a `verdict`
parameter and a thread `cid`, since the defaults were exactly the shape
exit 50 now reads.

Further cases pin the ranking, 42 over 50 and 50 over a stuck check in
`wait`, and a suppressed or previously-missed block cancelling the
reading. Each was confirmed to fail with the ordering or the guard
removed.

`pr-review-conduct` Merge Gate item 3 now names the unthreaded-entry
count and exit 50, and the generated skill trees are rebuilt from it.

The `comments` label is on this pull request because one edited comment
line states the vetted list sizes, which a test reads.

## Local review

Nine local strict-review passes ran across three pushes. The last one,
over the current head, raised nothing. One finding was declined rather
than fixed: a `#discussion_r` back-reference inside an entry's text
could inflate the linked-entry count. Every count-first open section
measured on this repository carried exactly one link per entry, so that
is unseen format drift under `GOVERNANCE.md` "Trust Boundaries and
Hardening Effort".

The issue #1723 shapes, `## Copilot review overview`, `Open (N)`, and
`What changed in this PR`, were already vetted on `develop`. This change
gives `Open (N)` its reader, so it closes that issue too. #2481, the
carried-over shortfall comparison, is left to its own lane.

Closes on promotion: #2480, #2479, #2544, #1723

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Copilot AI lite review requested due to automatic review settings October 8, 2026 18:31
@coderabbitai

coderabbitai Bot commented Oct 8, 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: 01ff8330-4aca-455e-a754-ab3ed8bcef3b
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@codecov

codecov Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.97959% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 58.85%. Comparing base (31c4bbd) to head (3013808).
⚠️ Report is 332 commits behind head on main.

Files with missing lines Patch % Lines
scripts/pr_review.py 98.97% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2568      +/-   ##
==========================================
+ Coverage   58.40%   58.85%   +0.45%     
==========================================
  Files          16       16              
  Lines        8090     8181      +91     
==========================================
+ Hits         4725     4815      +90     
- Misses       3365     3366       +1     
Flag Coverage Δ
python-3.13 58.85% <98.97%> (+0.45%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

🟡 Changes recommended

Unresolved critical and moderate findings remain in the tests and overview parsing logic.

2 open findings
What changed in this PR

Promotes the Copilot overview parser changes from develop to main.

Changes:

  • Adds unified overview parsing and thread matching.
  • Handles flagged verdicts with exit code 50.
  • Updates tests, documentation, and generated skills.
File Summary
tests/​test_pr_review.py Adds parser and verdict coverage; fixture handling and docstring findings remain.
scripts/​README.md Documents updated parser behavior.
scripts/​pr_review.py Implements overview parsing and finding detection; anchorless entries remain an issue.
.github/​skills/​pr-review-conduct/​SKILL.md Updates generated review guidance.
.claude-plugin/​fleet-skills/​skills/​pr-review-conduct/​SKILL.md Updates generated review guidance.
.claude-plugin/​fleet-skills/​.source-digests/​pr-review-conduct Refreshes the generated-source digest.
.agents/​skills/​pr-review-conduct/​SKILL.md Updates canonical review guidance.

🧠 Review effort: Lite


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

Comment thread tests/test_pr_review.py Resolved
Comment thread scripts/pr_review.py Resolved
…2571)

## Summary

Both menus decided a cached hub tree was fresh by comparing its `HEAD`
with `origin/main`, whatever `--ref` or `-Ref` the session was started
with. `ensure_hub_root` in `menu.sh` and `Confirm-HubRoot` in `menu.ps1`
both did this, which caused two failures:

- A session on another ref re-cloned the hub on every task, since its
own tree never matched `main`.
- Where another session sharing the cache had replaced the tree with a
`main` clone, the first session judged it fresh and ran its next task
from `main` without saying so.

The check now compares `HEAD` with the commit the session's own ref
resolves to on origin, through `hub_ref_commit` and `Get-HubRefCommit`.
The default ref keeps its existing `origin/main` comparison. Any other
ref is fetched into `refs/menu/<ref>` and resolved with `^{commit}`,
rather than read from `FETCH_HEAD`. In `menu.sh`, readers share the
lock, so a concurrent session's fetch into the same tree can overwrite
`FETCH_HEAD`. `menu.ps1`'s lock is exclusive, but it uses the same shape
so the two menus stay alike.

## Verification

- **Tests:** `HubRefFreshnessCases` adds five cases per menu. Each
drives the menu's real functions against a local origin, reached through
`insteadOf`, whose `main` and `develop` sit on different commits. The
cases cover: own ref reused, for both `main` and `develop`; a `develop`
tree replaced by `main`; a `develop` tree checked by a `main` session;
and `develop` moving on origin since the fetch. All 10 pass natively on
Windows (Git Bash and pwsh 7). The full `test_bootstrap` module passes
(110 tests, 32 skipped).
- **Mutation:** against the unfixed menus, exactly the own-ref and
mixed-ref cases fail for each menu (4 of 10).
- **Ref shapes:** the reviewer ran the new fetch and resolve against a
branch, a nested branch, annotated and lightweight tags,
`refs/pull/N/head`, `pull/N/head`, and a full SHA. Each resolved to the
commit `fetch_hub_locked` checks out. An abbreviated SHA fails in both
the fetch and the check, as it did before.
- **Checks:** ruff, mypy, shellcheck, shfmt, PSScriptAnalyzer,
editorconfig-checker and the prose gate are clean. The changed comment
lines need the `comments` label. Two local strict-review rounds ran: the
first raised two findings, both stale comments, fixed in dbbf5ed. The
second raised none.

Refs #2541

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
@ptr727

ptr727 commented Oct 8, 2026

Copy link
Copy Markdown
Owner Author

The windows lane merged #2571 into develop as 6bbc9ec. That moves this pull request's head off the commit its review covered, so the review on head needs a fresh round.

#2571 makes both menus compare a cached hub tree with the commit the session's own --ref resolves to, rather than with origin/main. Please add it to the summary along with Fixes #2541. The lane's merge carries only Refs #2541, so the issue closes only through this pull request's body.

The session driving this pull request keeps it. The windows lane does not drive it.

## Summary

Fixes a finding Copilot raised on promotion #2568 against #2562's `Open
(N)` reader. `Open (N)` is not read as a total, so an entry it counts
that carries no `#discussion_r` link, or one spelled in a form the
reader does not recognize, dropped out of every count and the digest
passed it.

- `read_overview` now also returns each section's linked entry count,
the bullets at its margin carrying a link the reader recognizes, outside
any block collapsed within it. A second link on one entry, an indented
back-reference, or a nested collapsed list does not cancel an unlinked
entry.
- `unthreaded_entries` adds each entry an `Open (N)` section counts
beyond those, so `FINDINGS WITH NO THREAD` names it. The digest says
such an entry carries no link this script reads, since it may not be
listed at all, or may link a thread in a form the reader does not
recognize.
- The module docstring and `scripts/README.md` describe the new count.
- Six tests: an unlinked entry, a second link on one entry, an indented
back-reference, a nested collapsed list, the zero floor, and the `*` and
`+` markers. Each fails with its part of the fix reverted.

The other finding on #2568, a `KeyError` claim against the test fixture,
was declined there with evidence.

Closes on promotion: #2480

## Local review

Eight recorded local strict-review passes ran over three pushes, and the
last, over b7d8172, recorded no finding. The findings this body listed
for the hosted review on c632fe8 were confirmed by Copilot's second
round and are fixed in ccb63d0 and b7d8172. One pre-existing finding
is filed as #2569: where the count-first `(N) open findings` section
supplies `T`, the shortfall subtracts distinct linked ids rather than
linked entries.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>

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.

🟡 Changes recommended

Unresolved cache-key issues in both menus and a finding-counting issue in the overview parser block approval.

1 open finding
2 resolved since last review

🧠 Review effort: Lite

Comment thread scripts/pr_review.py Resolved
## Summary

Fixes a finding Copilot raised on promotion #2568. `read_overview` read
an open section's linked entry count only from bullets at the section's
margin outside nested collapsed blocks, but read its thread ids from the
whole section. A back-reference inside a collapsed block naming an id no
thread carries was then counted as a missing finding beside the unlinked
entry near it, two for one. The ids now come from the same entries the
count reads.

- `read_overview` collects each section's ids from its margin-bullet
entries alone, and its docstring says a back-reference or a collapsed
list is read as neither an entry nor a link.
- A test feeds an unlinked entry beside a collapsed back-reference to an
absent thread and expects one finding. It reports two with the change
reverted.

Closes on promotion: #2480

## Local review

One recorded local strict-review pass ran over 073a4e9 and raised two
findings, listed here with the disposition proposed for the hosted
review:

1. **Within the chosen direction.** `uncounted_verdict`'s `listed` check
reads `count or ids`, so an `Open (0)` section whose only link sits off
the margin now lists nothing, and a flagging verdict with nothing else
counted exits `50` where it exited `0`. That reports rather than hides,
and an `Open (0)` section carrying a link is a shape no measured round
has shown.
2. **Unseen shape.** A body stating a `**Findings:**` preamble total and
also carrying a count-first `(N) open findings` section, with an entry
whose unknown-id link sits off the margin, such as a numbered item, no
longer counts that entry. The docstrings record the two format revisions
as never seen together, and in that mixed shape a margin bullet with no
link already went uncounted before this change, so it widens an existing
gap rather than opening one.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <[email protected]>

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.

🔵 Needs a closer look

Both menu implementations need collision-free cache ref names to avoid ref conflicts and unnecessary reclones.

0 open findings

1 resolved since last review

🧠 Review effort: Lite

@ptr727

ptr727 commented Oct 8, 2026

Copy link
Copy Markdown
Owner Author

Answering the headline of the round on 3013808, "Both menu implementations need collision-free cache ref names to avoid ref conflicts and unnecessary reclones", which opened no thread and counted no finding. Declined with evidence, per GOVERNANCE.md "Trust Boundaries and Hardening Effort". The names come from #2571's hub_ref_commit in menu.sh and Get-HubRefCommit in menu.ps1, which fetch a non-default ref into refs/menu/<ref>. Two names collide only when two sessions sharing one hub cache run on refs where one is a path prefix of the other, such as x and x/y. In that case git refuses the second fetch, the function returns non-zero, and ensure_hub_root drops the cached root and fetches a fresh hub. The cost is one extra clone, which is neither silent nor destructive, and the ref is one the maintainer types. So the case is declined rather than fixed or filed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants