Repository navigation
Read an Oversized Finding Count as Unknown in the Copilot Adapter - #3421
Conversation
stated() read a section count longer than COUNT_DIGITS as zero, so a body saying 99999 open findings read as a clean round. It returns None, the reader notes the count it cannot believe, and the round's open count reads unknown. The host-setup gates-and-tests row says uv installs the test requirements rather than that there are no packages to install.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
|
A recorded local strict-review pass covers head |
There was a problem hiding this comment.
🔵 Needs a closer look
A moderate unresolved issue causes collapsed sections with unknown counts to be treated as empty in the verdict gate.
No open issues 🎉
What changed in this PR
This pull request makes oversized Copilot finding counts read as unknown instead of zero, preventing misleading clean-round results. It also updates documentation for test dependency installation.
Changes:
- Adds bounded count parsing and propagates unknown totals as
None. - Displays unknown finding counts as
?and holds affected rounds. - Adds regression tests for oversized open, suppressed, and previously missed counts.
- Updates usage, README, and host setup documentation.
| File | Summary |
|---|---|
tests/test_pr_review.py |
Tests digest output and gate behavior for unknown counts. |
tests/test_pr_review_copilot.py |
Tests oversized open, suppressed, and previously missed counts. |
scripts/README.md |
Documents unknown finding-count output. |
scripts/pr_review.py |
Aggregates and displays unknown finding totals. |
scripts/pr_review_copilot.py |
Parses oversized counts as unknown and propagates them. |
docs/host-setup.md |
Clarifies that uv installs test requirements. |
Review effort: Lite
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #3421 +/- ##
===========================================
+ Coverage 80.78% 80.81% +0.02%
===========================================
Files 23 23
Lines 8848 8859 +11
===========================================
+ Hits 7148 7159 +11
Misses 1700 1700
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Answer to the headline of the Copilot round on 743010e6, "A moderate unresolved issue causes collapsed sections with unknown counts to be treated as empty in the verdict gate." No change needed. |
…#3417) ## Summary Promotes the pull requests merged into develop since release 2.0.1148. Each carries a maintainer decision of 2026-10-23 recorded on #3391. - [#3407](#3407): rewrites the write guard as a small lexer of 1,653 lines. It fails open under its stated threat model and fails closed only on requirement 4. A test holds it at 2,500 lines or fewer (item 1). - [#3409](#3409): adds CODESTYLE rules. Tests live in `tests/`, and a maintained parser replaces a hand-written one. A script declares its dependencies in PEP 723 metadata and runs as `uv run --no-project --script`. It switches the callers to that spelling and adds a managed allow rule to the agent-safety installer (item 1 follow-ups). - [#3410](#3410): splits `pr_review.py` into the gate, a Copilot adapter reading its vocabulary from JSON, and `pr_cleanup.py`. It collapses the exit codes and adds `tests/requirements.txt` and the CI runners. - [#3411](#3411): rebuilds the prose gate on Pygments and markdown-it-py, with its vocabulary and exemptions in `prose-gate.json` and a repo-local override. - [#3415](#3415): holds the Merge Gate on a part of a Copilot review body the tooling cannot place. The hold lasts until an owner acknowledges it with outcomes (item 4 follow-up). - [#3416](#3416): moves the audit self-test to `tests/` and reads YAML and Markdown with PyYAML and markdown-it-py. It adds the check registry `spec/checks.json` and splits out `spec/audit_markdown.py`. It shares `spec/carried_text.py` with carry, `build_dist`, and `canonical_review`. - [#3418](#3418): fixes the findings this promotion's first review round raised on the content above. It aligns the drive-pr escalation line with pr-review-conduct and names `tests/requirements.txt` where the prose said the tests need nothing installed. It also restores the `uvx` launcher in a release-guard assertion. - [#3419](#3419): fixes the finding the second review round raised. The Copilot adapter's prose path reads a coverage count longer than `COUNT_DIGITS` as `unknown`, sharing `count_state` with the marker path. - [#3420](#3420): fixes the finding the third review round raised, under the maintainer's ruling. `hub_fetch_run.py` falls back to `git ls-remote` where the API lookup of `main` fails, so the prose gate and its data are fetched at one commit. Where neither lookup resolves, the documented fail-open against `main` stays. - [#3421](#3421): fixes the findings the fourth review round raised. The Copilot adapter reads a finding count longer than `COUNT_DIGITS` as unknown rather than zero, through one length check and one None-aware sum. The host-setup gates-and-tests row says `uv` installs the test requirements. Closes #3408 ## Constituent coverage The Copilot rounds on this promotion ran at Lite effort and state no full coverage, so Merge Gate item 2 rests on the promotion case. Each change this promotion carries had full coverage on its own pull request into develop, at its merged head: | Pull request | Merged head | Coverage | | --- | --- | --- | | [#3407](#3407) | `9efc1002` | attested local pass, `coverage=local` | | [#3409](#3409) | `bcc7a9e1` | attested local pass, `coverage=local` | | [#3410](#3410) | `00cec726` | attested local pass, `coverage=local` | | [#3411](#3411) | `bd128136` | attested local pass, `coverage=local` | | [#3415](#3415) | `5be9db87` | attested local pass, `coverage=local` | | [#3416](#3416) | `b914f083` | attested local pass, `coverage=local` | | [#3418](#3418) | `3a86cb51` | attested local pass, and a Copilot table naming exactly the changed files, `coverage=table` | | [#3419](#3419) | `6e7b868d` | attested local pass, and a Copilot table naming exactly the changed files, `coverage=table` | | [#3420](#3420) | `9b492290` | attested local pass, and a Copilot table naming exactly the changed files, `coverage=table` | | [#3421](#3421) | `743010e6` | attested local pass, and a Copilot table naming exactly the changed files, `coverage=table` | 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Summary
Fixes the two findings the fourth Copilot round on the develop -> main promotion #3417 raised.
stated()inscripts/pr_review_copilot.pyread a section count longer thanCOUNT_DIGITSas zero. A body saying99999 open findingstherefore read as a clean round.believed(digits)is the one length check, used bycount_stateandstated. That completes the class Read an Oversized Prose Coverage Count as Unknown in the Copilot Adapter #3419 began.statedreturnsNonefor such a count, and the reader notes "a finding count this reader cannot believe".Section.findingsisint | None.total(counts)is the one None-aware sum, used byReading.held, by the open count in_read, and bycollected()inscripts/pr_review.py.overview=?, which leaves Merge Gate item 3 unsatisfied. A flagging round stating only such a count exits50. Anysuppressed=,previously_missed=, orcr_outside_diff=tally holding one prints?.scripts/README.mddescribe the?reading.docs/host-setup.mdsaysuvinstallstests/requirements.txtfor the tests, rather than that there are no packages to install.Tests
test_an_oversized_count_reads_as_none_and_is_notedcovers an open section labeled99999 open findings, the same count as a bold line, and a believable section beside an oversized line. Each expectsopen is Noneand the note. On develop's code all three fail, reading0or1.test_an_unbelievable_section_count_is_none_beside_a_believed_open_countcovers suppressed and previously-missed sections.test_an_unbelievable_previously_missed_count_tallies_as_unknownassertspreviously_missed=? (on_head=0 earlier=?)and exit0.test_an_unbelievable_open_count_reads_unknown_and_holds_the_roundassertsoverview=?/0, the note, and exit50.Local review
Four recorded passes at the
frontiertier.?. The None-aware sum lived twice, and the new digest test asserted no exit code.counts["threaded"]staysself.open or 0, since its one consumer reads 0 and None alike and fails closed. TheVERDICT WITH NO COUNTED FINDINGtext reads "counts no finding" for a round stating only an unbelievable count. That fails closed too, withoverview=?and the note printed beside it.total. Two sentences the change extended ran past 25 words.Open findings from the last pass
scripts/README.md:229andscripts/pr_review.py:90,introduced: in "A count it cannot believe reads?too.", "it" can be read as the round rather than the reader. Declined asstyle. The paragraph defines?for "a count the reader cannot believe" earlier, and the field gates nothing.scripts/pr_review.py:91andscripts/pr_review_copilot.py:110,style: the rewrap left one 131-column usage line and one short docstring line. Declined, since ruff does not select E501 here and the base already holds such lines.Pre-existing findings, not filed
scripts/pr_review.pydigest notes,pre-existing:cr_outside_diff=?prints with no note naming the section, because the digest collects reader notes only from Copilot's rounds. The base read the same count as 0.Verification
uv run --no-project --with-requirements tests/requirements.txt python -m unittest discover -s tests->Ran 2864 tests,OK (skipped=7).uvx ruff@latest check,uvx ruff@latest format --check, anduvx mypy@latest-> clean.test_an_oversized_count_reads_as_none_and_is_notedagainst develop's adapter ->FAILED (failures=3).🤖 Generated with Claude Code