Skip to content

Strip a Tilde or Unclosed Fence Before Reading Review Coverage - #1825

Merged
ptr727 merged 3 commits into
developfrom
feature/auto-1821
Sep 25, 2026
Merged

ptr727 merged 3 commits into
developfrom
feature/auto-1821

Conversation

@ptr727

@ptr727 ptr727 commented Sep 25, 2026 •

Copy link
Copy Markdown
Owner

FENCE in scripts/pr_review.py stripped only a closed backtick fence, so a coverage marker quoted inside a ~~~ fence, or after a backtick fence that never closes, was read as the round's stated coverage, which fails open.

FENCE now accepts either fence character and closes only on a run of the opener's own character at least as long as the opener. Every former FENCE.sub caller goes through a new strip_fences helper. The coverage reader runs an unclosed fence to the end of the body, where masking reads as no coverage and so blocks. Every other reader keeps reading past an unclosed fence as before, since masking the rest of the body there hid a suppressed section, which reads as clean. A closed backtick fence and a marker outside any fence read as before, including under CRLF line endings.

Regression tests cover each quoting case, each case still read, and a suppressed section after a stray fence. Each fails with its part of the fix reverted.

Closes on promotion: #1821

🤖 Generated with Claude Code

FENCE now accepts either fence character, closes only on a run of the
opener's character at least as long as the opener, and runs an unclosed
fence to the end of the body, so a coverage marker quoted in a tilde
fence or after an unclosed backtick fence is no longer read as stated
coverage.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 25, 2026 19:21
@coderabbitai

coderabbitai Bot commented Sep 25, 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: 7188b4a6-14d9-4689-9e34-de65fab1dd28


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.

Copilot review overview

🟢 Approval recommended

The behavioral change is narrowly scoped to fence stripping, is consistent with Markdown rules, and is covered by targeted regression tests (only a minor docstring wording nit remains).

Review effort: Lite
Findings: 1 Low severity

Open (1)
What changed in this PR

This change hardens scripts/pr_review.py coverage parsing by ensuring coverage markers inside Markdown fenced code blocks (including ~~~ fences and unclosed fences) are treated as quoted text and therefore not counted as the round's stated coverage.

Changes:

  • Expand the FENCE stripper to handle both backtick and tilde fences, require a closer that matches the opener character and length, and treat unclosed fences as running to end-of-body.
  • Add regression tests covering quoted-marker cases (tilde fences, unclosed fences, mismatched closers) plus still-valid cases (closed fences, CRLF).
File Description
scripts/​pr_review.py Updates the fenced-block stripping regex used before reading coverage markers from review bodies.
scripts/​tests/​test_pr_review.py Adds regression tests to ensure quoted markers inside fences are not treated as stated coverage.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread scripts/tests/test_pr_review.py Outdated
ptr727 and others added 2 commits September 25, 2026 12:26
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Masking the rest of the body after an unclosed fence hid a suppressed
section from its reader, which reads as clean. Every other reader keeps
reading past an unclosed fence as it did before, while the coverage
reader, where masking reads as no coverage and so blocks, still runs it
to the end.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings September 25, 2026 19:34

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.

Copilot review overview

🟡 Changes recommended

The new fence regex still allows a coverage-marker bypass when the backtick fence info string contains a backtick (e.g., ```text`), so quoted markers can still be misread as stated coverage.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity · 1 Low severity

Open (2)
Resolved since last review (1)

Comment thread scripts/pr_review.py
Comment thread scripts/tests/test_pr_review.py
@ptr727
ptr727 merged commit 0098467 into develop Sep 25, 2026
9 checks passed
@ptr727
ptr727 deleted the feature/auto-1821 branch September 25, 2026 19:41
ptr727 added a commit that referenced this pull request Sep 25, 2026
…rship to Main (#1827)

Promotes `develop` to `main`.

## Carried

- #1806: adds the unattended handoff loop and the attended resume
procedure.
- #1807: renames three skills and states which skill wins each shared
trigger.
- #1809: names a pin by its mechanism rather than its value, and audits
for copies.
- #1808: leads every choice with a recommendation and closes every
session in order.
- #1813: bans every version literal in the four instruction documents
and catches abbreviated SHAs, following #1809.
- #1820: refuses a coverage marker indented into a code block, per
#1725.
- #1823: states that the hub commits audit reports and that a downstream
session resyncs itself. This covers the Fleet Bootstrap section, the
host fleet block, `RESYNC.md`, `AUDIT.md`, `check-this-repo`, and
`resync-a-repo`, and settles #1822. The Fleet Bootstrap section is
byte-locked, so every carrier reports drift on it until its next resync.
- #1825: strips a tilde or unclosed fence before reading review
coverage, per #1821.

Closes #1725
Closes #1821
Closes #1822

🤖 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