Skip to content

Bound a Section Whose Summary Shares Its Details Line in pr_review.py - #3204

Merged
ptr727 merged 5 commits into
developfrom
fix/cross-kind-over-run
Oct 18, 2026
Merged

ptr727 merged 5 commits into
developfrom
fix/cross-kind-over-run

Conversation

@ptr727

@ptr727 ptr727 commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner

Summary

A section whose <summary> shares its line with the <details> that opens it was not a heading line to sibling_heading, so a sibling opened that way never bounded the block before it. A suppressed block then ran on into a following previously-missed section and printed its findings twice, under the suppressed banner. Each kind's reader still found its own section, so the vetted-but-unread check had nothing to report.

  • HEADING admits a <details> opener ahead of <summary> on the same line, through a shared DETAILS_OPENER pattern.
  • heading_of reads past that opener where a summary follows it on the line. Without that, a count opening such a heading (<strong>2 previously missed issues</strong>) went unread: the section counted as one finding and its sibling never bounded, where the base had reported the body as unrecognized. The local strict review found this regression in the first cut.

Tests

  • test_a_section_opening_on_its_details_line_bounds_the_one_before runs a count-closing and a count-opening previously-missed heading after a one-line suppressed section. Both subtests fail on the base. With only the heading_of change reverted, the count-opening one fails.
  • Full suite: 2969 tests OK, 7 skipped. Ruff, mypy, and the prose gate in both modes are clean.

Local review

Three recorded passes at the frontier tier. The first two raised findings that were fixed in this branch, and the third raised none.

Refs #3201

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved parsing of headings inside HTML <details> sections, including headings that share a line with the opening tag.
    • Updated tag matching to handle standard HTML whitespace consistently.

A <summary> on the line of the <details> opening it was not a heading line, so
a sibling section opened that way never bounded the block before it. A
suppressed block then ran on into a following previously-missed section and
printed its findings twice, while each reader still found its own section and
nothing reported the shape. HEADING now admits a <details> opener ahead of the
summary.

Fixes #3201
HEADING admitted a <details> opener ahead of the summary while heading_of
kept it, so a count opening such a heading went unread. The section then
read as one finding and its sibling never bounded, where the base reported
the body as unrecognized. Both now share one DETAILS_OPENER pattern.
DETAILS_OPENER ended in \s*, so heading_of read past an opener standing on
its own line too. It now stops at the line, and heading_of reads past it only
where a summary follows, so every other first line reads as it did before.
Copilot AI lite review requested due to automatic review settings October 18, 2026 17:59
@ptr727

ptr727 commented Oct 18, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 2c7f7b32859854fd4948b16de129f6ca825c5839, the content this pull request carries at that commit against develop, and it recorded 0 findings.

@coderabbitai

coderabbitai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: ptr727/ProjectTemplate/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 15ae8ec7-fabc-4dff-a616-202beced0235
📥 Commits

Reviewing files that changed from the base of the PR and between 3b1fe04 and 6c65dd0.

📒 Files selected for processing: 2
  • scripts/pr_review.py
  • tests/test_pr_review.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

The parser recognizes <summary> tags with explicit ASCII whitespace and supports a <details> opener before a summary on the same line. Regression tests cover section boundaries, finding counts, and whitespace matching.

Changes: Summary heading parsing

Layer / File(s) Summary
Tag patterns and whitespace
scripts/pr_review.py, tests/test_pr_review.py
Summary, details, and fold patterns use explicit ASCII whitespace. Tests check that tabs match and non-breaking spaces do not.
Heading extraction and section boundaries
scripts/pr_review.py, tests/test_pr_review.py
heading_of skips a leading <details> opener before <summary>. Tests cover section boundaries and count ordering.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 6c65d

The section-boundary change has no identified merge-blocking issue. It is ready for normal validation.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: binding a section when its shares a line with the opening
Details tag.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 1 files. (1 skipped: 1 …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 1 files. (1 skipped: 1 too large.)

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • 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

Restrict the shared opener pattern to the parser’s valid whitespace.

No open issues 🎉

What changed in this PR

Fixes parsing for <details><summary> sections that share a line, preventing duplicated findings and incorrect section boundaries.

Changes:

  • Shares opener detection between heading parsing and extraction.
  • Updates heading extraction for same-line sections.
  • Adds regression tests for count formats and sibling boundaries.
File Description
tests/​test_pr_review.py Adds regression coverage for one-line details sections.
scripts/​pr_review.py Handles same-line details headings and section bounds.

Review effort: Lite

@codecov

codecov Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.49%. Comparing base (3b1fe04) to head (6c65dd0).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3204      +/-   ##
===========================================
+ Coverage    65.48%   65.49%   +0.01%     
===========================================
  Files           17       17              
  Lines         9754     9758       +4     
===========================================
+ Hits          6387     6391       +4     
  Misses        3367     3367              
Flag Coverage Δ
python-3.13 65.49% <100.00%> (+0.01%) ⬆️

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.

DETAILS_OPENER, SUMMARY, FOLD_OPENER, and FOLD_STOP took Python's \s after a
tag name, which admits a no-break space and the other Unicode spaces that do
not separate an HTML tag's attributes. Each now uses [ \t\n\f\r], the set
DETAILS_OPEN already uses.
The test covered HEADING and SUMMARY only, so reverting FOLD_OPENER and
FOLD_STOP to \s passed it. It now asserts a tab after <summary folds and a
no-break space does not, for both.
@ptr727

ptr727 commented Oct 18, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 6c65dd04a81841ddc93eea5b949c9aa6500c9a01, the content this pull request carries at that commit against develop, and it recorded 0 findings.

@ptr727

ptr727 commented Oct 18, 2026

Copy link
Copy Markdown
Owner Author

Answering the headline of Copilot's round on 2c7f7b32, which opened no thread and counted 0 findings (### Needs a closer look, "Restrict the shared opener pattern to the parser's valid whitespace."), at scripts/pr_review.py DETAILS_OPENER.

Fixed in b84ce5d, with the test extended in 6c65dd0. The separator after the tag name was Python's \s, which admits a no-break space and the other Unicode spaces that do not separate an HTML tag's attributes. It is now [ \t\n\f\r], the set DETAILS_OPEN already uses. The same class was swept in this file: SUMMARY, FOLD_OPENER, and FOLD_STOP used \s the same way and now use the same set. test_a_tag_opener_separates_attributes_on_html_whitespace_alone pins all four patterns, and it fails with any of them reverted.

@ptr727

ptr727 commented Oct 18, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@ptr727
ptr727 merged commit 213ac08 into develop Oct 18, 2026
13 checks passed
@ptr727
ptr727 deleted the fix/cross-kind-over-run branch October 18, 2026 18:35
ptr727 added a commit that referenced this pull request Oct 18, 2026
)

- #3204 makes `pr_review.py` bound a section whose `<summary>` shares
its line with the `<details>` that opens it. A suppressed block used to
run on into a following previously-missed section opened that way and
print its findings twice, with nothing reporting the shape. `heading_of`
reads past the same opener, so a count opening such a heading is read.
The attribute separator after a tag name in `DETAILS_OPENER`, `SUMMARY`,
`FOLD_OPENER`, and `FOLD_STOP` is now HTML whitespace rather than
Python's `\s`.

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

Closes #3201

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants