Skip to content

Find Table Cell Boundaries Before Blanking Code Spans and Quotations - #3660

Merged
ptr727 merged 4 commits into
developfrom
feature/auto-3657
Oct 30, 2026
Merged

ptr727 merged 4 commits into
developfrom
feature/auto-3657

Conversation

@ptr727

@ptr727 ptr727 commented Oct 30, 2026 •

Copy link
Copy Markdown
Owner

Summary

The prose gate's Markdown rules blanked code spans and quotations across a whole table row before any cell split. So a cell boundary inside either one was lost.

  • markdown-it-py ends a cell at an unescaped pipe inside a code span. Blanking the span first merged those two cells, and a comma in the first then excused a semicolon list in the second.
  • An unpaired " in one cell, such as an inch mark, paired with a quote in a later cell. Every cell between them was blanked, so no rule read them.

The semicolon rule is the one the issue names. A local review pass found the same defect class in the dash, dupword, spelling, and dead-path rules, all in the same file, so every site moves onto one helper here.

Changes

  • .github/actions/prose-gate/prose_lint.py:
    • TABLE_ROW and row_cells split a row opening with a pipe, blockquoted or not, at each pipe no backslash escapes.
    • by_cell applies a blanker one cell at a time and rejoins the cells, so every pipe that ends a cell stays where it was.
    • prose_lines, unit_texts, and the dead-path code-span and link scans each go through it. rule_semicolon reads the blanked row from prose_lines as before.
  • tests/test_prose_lint.py: both of the issue's cases for the semicolon rule, a quotation inside one cell still blanked, the unpaired-quote case for dash, dupword, and spelling, a code span across cells for dash, and two dead-path cases.
  • scripts/README.md: states that a row opening with a pipe is blanked a cell at a time, and why.

Verification

  • The issue's repro now reports four semicolon violations, two on each body row, and reported none before. The issue says five. Counting the cells it names gives four: e; f; g holds two semicolons and a; b; c holds two.
  • The prose gate suite passes, 640 tests. Every new test fails against the base rule_semicolon and blanking code.
  • A whole-tree prose gate run is unchanged, with no violations before or after.

Local Review

Three recorded local-strict-review passes.

  • The first raised that the fix covered only the semicolon rule while the other rules shared the defect. Fixed by the shared helper.
  • The second raised a second row check in rule_semicolon, a code-span token scan in dead-path still reading the whole row, and docs wider than the code for rows with no leading pipe. All three were fixed.
  • The third raised one finding, that rule_semicolon still split a row itself beside row_cells. That push's edit budget was spent, so it went out listed as open and was fixed on the next push, which now calls row_cells.
  • The fourth, over that push, raised nothing.

Closes on promotion: #3657

🤖 Generated with Claude Code

ptr727 and others added 3 commits October 30, 2026 04:19
The semicolon rule split a table row into cells only after its code
spans and quotations were blanked, so a cell boundary inside either one
was lost. A pipe inside a code span, which markdown-it-py reads as a cell
boundary, let a comma in one cell excuse a semicolon list in the next. An
unpaired quote paired with one in a later cell and hid every cell between.

The row is now split first, and each cell's code spans and quotations are
blanked on their own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The dash, dupword, spelling, and dead-path rules blanked code spans and
quotations across a whole table row too, so the same lost cell boundary
hid a later cell from each of them. One helper now blanks a row a cell
at a time, and every rule reading Markdown text goes through it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The dead-path rule still read code-span tokens over the whole row, so a
lone backtick in one cell paired with a later cell's span and hid it.
The semicolon rule also kept its own row check beside the blanking one.
A single helper now names a row's cells for both, and the docs say the
rule applies to a row opening with a pipe.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings October 30, 2026 11:37
@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • 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.

@ptr727

ptr727 commented Oct 30, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 3c2e2ad44c653f02725f1a37237ea406be2324bf, the content this pull request carries at that commit against develop, and it recorded 1 finding.

The semicolon rule split a row itself beside row_cells, so two places
defined a cell. It now reads the cells row_cells returns.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

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.

🟡 Changes recommended

A moderate active finding remains because the semicolon parsing path duplicates shared cell-boundary logic and handles edge pipes inconsistently instead of reusing row_cells.

1 open issue
What changed in this PR

This pull request fixes Markdown table-cell boundary handling in the prose gate by splitting rows before blanking code spans and quotations. The correction is applied across related prose and dead-path rules, with regression tests and documentation updates.

Changes:

  • Adds shared row_cells and by_cell helpers for cell-aware processing.
  • Updates semicolon, dash, duplicate-word, spelling, and dead-path checks.
  • Adds regression coverage for table boundaries, quotations, code spans, and deleted paths.
  • Documents cell-by-cell blanking behavior.
File Summary
tests/​test_prose_lint.py Adds regression coverage for affected table-cell, quotation, code-span, and dead-path cases.
scripts/​README.md Documents cell-aware processing for pipe-opening Markdown table rows.
.github/​actions/​prose-gate/​prose_lint.py Adds shared table-cell processing and applies it across affected rules. Open findings: reuse row_cells in rule_semicolon (P2, 4 votes) and clarify the row_cells docstring (P3, 1 vote).

This pull request requires changes.

Review effort: Lite

@codecov

codecov Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.70%. Comparing base (b38e084) to head (d0f758c).
⚠️ Report is 28 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3660      +/-   ##
===========================================
+ Coverage    81.60%   81.70%   +0.09%     
===========================================
  Files           26       26              
  Lines         9070     9119      +49     
===========================================
+ Hits          7402     7451      +49     
  Misses        1668     1668              
Flag Coverage Δ
python-3.13 81.70% <ø> (+0.09%) ⬆️

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 commented Oct 30, 2026

Copy link
Copy Markdown
Owner Author

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

@ptr727
ptr727 merged commit f55ca93 into develop Oct 30, 2026
13 checks passed
@ptr727
ptr727 deleted the feature/auto-3657 branch October 30, 2026 11:54
ptr727 added a commit that referenced this pull request Oct 30, 2026
…Session Prompt Rules (#3667)

Promotes the changes merged into `develop` since promotion #3636 to
`main`.

- [#3640](#3640) Pins the
validator's `uvx ruff` to a Dependabot-managed manifest.
- [#3642](#3642) Counts
Copilot findings under the unresolved bullet and the file table.
- [#3644](#3644) Aligns
the split comment copies and drops the stale counts.
- [#3646](#3646) Sends a
command meant for the session's input line in a plain message, never in
a blocking prompt.
- [#3648](#3648) Opens the
attended session by cloning a hub checkout of the session's own.
- [#3650](#3650) Reads a
held package as installed in both Linux host scripts.
- [#3652](#3652) States
the PowerShell `-Help` and `-h` form in the command-line argument rules.
- [#3654](#3654) Counts
sentences in Markdown table cells for the sentence-length check.
- [#3658](#3658) Splits a
table row only at an unescaped pipe in the semicolon rule.
- [#3660](#3660) Finds
table cell boundaries before blanking code spans and quotations.
- [#3662](#3662) Names a
stale job record on a completed run in `pr_review.py`.
- [#3665](#3665) Keeps a
line holding code after a block comment's closer out of `comment-added`.
Its squash commit on `develop` carries the pull request's original
title, which names a heredoc reading. That reading was withdrawn before
the merge on decision #3666, so a workflow `run:` heredoc body still
reads as code.
- [#3669](#3669) Counts
each `[Pn]` marker in a Copilot Findings cell, so a second finding in
one cell is no longer dropped from triage. It answers one of the two
findings Copilot raised on this promotion. The other is declined with a
parser probe in its thread.

Closes #3616
Closes #3610
Closes #3622
Closes #3638
Closes #3604
Closes #3511
Closes #3602
Closes #3456
Closes #3655
Closes #3657
Closes #3362
Closes #1664

🤖 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