Skip to content

pr_review.py Lets an Extra Link Cancel an Unlinked Entry in the Open-Findings Section #2569

Closed

Description

@ptr727

Problem

Where a Copilot round's count-first (N) open findings section supplies the stated total T, scripts/pr_review.py's digest measures the FINDINGS WITH NO THREAD shortfall as T minus the distinct thread ids that round's open sections link. That subtracts links rather than entries, so an extra link to a thread already on the pull request cancels an unlinked entry, and the block does not print.

Constructed shape, with every linked id a thread on the pull request:

<details open>
<summary><strong>3 open findings</strong></summary>

- [Finding 1](#discussion_r4000000001) New
- [Finding 2](#discussion_r4000000002) New, see [earlier](#discussion_r4000000007)
- Finding 3 New
</details>

The digest reads overview=3/2 with no FINDINGS WITH NO THREAD block, hiding the third finding. The same happens where the back-reference sits on its own indented line under an entry.

The README paragraph on read_overview and the module docstring both say that block is measured against the section's entries, and that a finding the count names with no entry linking it is still counted, which this shape contradicts.

This predates the Open (N) fix that found it, which reads that section's linked entries as margin list items carrying a link, and read_overview already returns that count per section.

Done when

  • Where the open-findings section supplies T, the shortfall is measured against the entries it lists with a link rather than against the distinct ids it links.
  • A test feeds the constructed shape above, and one with the back-reference on its own indented line.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingscriptA defect in hub tooling

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions