Skip to content

Promote the Shared Heading Reduction and the Line-Suffix Pairing to Main - #3183

Merged
ptr727 merged 2 commits into
mainfrom
develop
Oct 17, 2026
Merged

ptr727 merged 2 commits into
mainfrom
develop

Conversation

@ptr727

@ptr727 ptr727 commented Oct 17, 2026

Copy link
Copy Markdown
Owner

The change is to scripts and tests only, so no installed Skill changes at release.

Closes #3173
Closes #3174
Closes #3176

🤖 Generated with Claude Code

ptr727 and others added 2 commits October 17, 2026 08:31
## Summary

Resolves #3174 and #3173. Both decide what counts as a section heading
in `pr_review.py`, so they land together.

- **One reduction, one leading-count rule (#3174).** `normal`, `unwrap`,
and `heading_count` now share `reduced`, which turns a badge into its
word and drops emphasis. `normal` and `heading_count` also share
`spaced` and one `LEADING_COUNT`. As a result, the role a summary is
vetted with and the count read from it cannot disagree. Before,
`<strong>2\fopen findings</strong>` was vetted as the open-findings
section while its count read as none.
- **Which summaries, not how many (#3174).** `unrecognized_in` now
checks which vetted previously-missed summaries appear inside the blocks
it read. A bare `(N)` line read in one region can no longer stand in for
a summary that no reader found in another.
- **One block per section.** A section ends at the next counted heading
of either kind, its own kind included. So two previously-missed sections
in one wrapper are two blocks, each counted by its own heading. Past a
region's first section, only the sibling heading that section ends at
can open another one, so prose after a section boundary never opens a
section.
- **A finding entry is never a section (#3173).** An entry whose summary
opens on a severity badge is never read as a section heading and never
ends a section, whatever its title says.

## Verification

- `python3 -m unittest test_pr_review`: 855 tests pass. All 850 existing
tests pass unchanged.
- Each of the 5 new tests fails against the code it fixes. The four
first-commit tests fail on `develop`, and
`test_prose_past_a_bound_opens_no_second_section` fails on the previous
branch head.
- `ruff format --check`, `ruff check`, `mypy`, `spec/validate.py`, and
the commit hooks' prose and EOL gates are clean.
- One report string changes, on a shape that was already unrecognized: a
count-first Markdown heading such as `### 2 foo` now reports as `### (N)
foo`.

## Local review findings still open

The edit budget for the local strict review was spent over three
recorded passes. These remain for this PR's review loop:

- **introduced:** the `sibling_heading` docstring says "A second section
of the same kind bounds too, so each is its own block with its own
count". That holds only when the two sections are adjacent. With
sections interleaved in one region (suppressed, then previously missed,
then suppressed again), the third section is read by nobody. The gap
itself is **pre-existing**, since `develop` read only the first section
per region, and no observed body interleaves this way.
- **style:** the docstring of
`test_prose_past_a_bound_opens_no_second_section` holds one 26-word
sentence that only the opt-in `--check sentence-length` flags. The
default prose gate passes.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…pr_review.py (#3181)

## Summary

Resolves #3176.

`entry_paths` now drops a trailing `:LINE` or `:START-END` from a path a
list entry names in a code span. So `` `src/a.py:340` `` pairs with a
thread on `src/a.py`. Before, a `Review findings:` entry in that shape
never paired, and the digest reported every such entry under `FINDINGS
WITH NO THREAD`, including the ones that had opened a thread.

The narrative `Open findings remain:` reader shares `entry_paths`, so it
gets the same pairing. A test pins it there too.

## Verification

- `python3 -m unittest test_pr_review`: all pass.
- Both new cases fail on `develop` at f4eb405: the prose subtest naming
`lib/reader.py:340` and `writer.py:12-18`, and the narrative test naming
`pkg/guard.py:12`.
- `ruff format --check`, `ruff check`, `mypy`, and the commit hooks'
prose and EOL gates are clean.
- Two recorded local strict-review passes. The first raised 3 findings,
all fixed. The second raised none.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings October 17, 2026 16:01
@coderabbitai

coderabbitai Bot commented Oct 17, 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: cdc73307-3a5e-45c6-9743-b4301a3b1fe5
  • Autofix · 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.

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

Minor test nits remain, and automated approval confidence is insufficient.

No open issues 🎉

What changed in this PR

Promotes heading-parsing and line-suffix pairing fixes, with regression coverage.

Changes:

  • Unifies heading reduction and count parsing.
  • Improves section and finding detection.
  • Pairs line-suffixed findings with threads.
  • Adds parser regression tests.
File Summary
tests/​test_pr_review.py Adds regression coverage for parser fixes.
scripts/​pr_review.py Updates parsing, section detection, and path pairing.

Review effort: Lite

@ptr727

ptr727 commented Oct 17, 2026

Copy link
Copy Markdown
Owner Author

Answering this round's headline, "Minor test nits remain, and automated approval confidence is insufficient". The round names no specific nit, opens no thread, and states no open finding ("No open issues"), so there is nothing concrete to fix. It is a caution rather than a finding. The tests it covers were each checked against the code they fix: every new test in #3179 and #3181 fails on the code before its fix and passes after, except one guard assertion that holds on both. Each feature PR also carried recorded local strict-review passes, all findings disposed of there. Any nit raised later as a thread or a named finding gets its own outcome.

@codecov

codecov Bot commented Oct 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.14%. Comparing base (8198ee0) to head (1a511c8).
⚠️ Report is 392 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3183      +/-   ##
==========================================
+ Coverage   64.08%   64.14%   +0.05%     
==========================================
  Files          17       17              
  Lines        9183     9198      +15     
==========================================
+ Hits         5885     5900      +15     
  Misses       3298     3298              
Flag Coverage Δ
python-3.13 64.14% <100.00%> (+0.05%) ⬆️

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.

@ptr727
ptr727 merged commit efaeeee into main Oct 17, 2026
14 checks passed
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