Repository navigation
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS No design-level concerns: the change only affects one PR-body length gate, and whenever the scanner is unsure it counts the text, so the gate never gets looser. Notes
[DESIGN-REVIEWED] db00cdc Description read[DESCRIPTION-READ] 215024ca93cad60c3e0aa7692a8446481feb4c0992733a6ff87220e44e59d61f That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Linked issue #22112, aimed at the cause (a regex that knew one fence form); the riders only push toward counting more. Notes
What this change shipsInventory (6 items) — 4 justifiedIntent: stop
[FIRST-PRINCIPLES-REVIEWED] db00cdc Description read[DESCRIPTION-READ] 2b9f01aea527d0a2169710f9deaf8af055c66035e223547e7109b15d34903daf That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Review detailsNo findings. Notes:
[OPUS-REVIEWED] db00cdc Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findings (all downgraded on adjudication)GPT 6.1 flagged blocking issues on This comment is updated in place on each push. Review detailsBLOCKING -- src/kiro_crew/builtin_skills/kirocrew-dev/kirocrew-prepare-pr/scripts/diff_signals.py:260 -- List-prefix matching strips rendered paragraph text
Adjudication (Opus 5.5) — is blocking on each finding proportionate?F1 — LOW. If this goes wrong, a PR description longer than the advisory 500-word limit gets through a local prepare-pr style check without warning. The script's exit 21 just says "too long"; nothing gets corrupted and no security boundary is involved. False positive or not applicable? A repository writer can comment: |
a287fbf to
e21a498
Compare
|
🤖 Kiro Crew Auto-Pipeline [operator: buluoray#ce473fca]: review dispositions for
|
|
🤖 Kiro Crew Auto-Pipeline [operator: buluoray#ce473fca]: disposition for the downgraded GPT 6.1 finding on
|
bolichen97
left a comment
There was a problem hiding this comment.
HOLD
Two issues need fixing before merge.
- The new fence scanner can fail open. In valid GitHub Markdown list and HTML cases, it treats rendered prose as an unclosed code block and removes it. A body over the limit can then pass with only a few counted words. Please count an ambiguous unclosed fence as prose instead of stripping it.
_FENCE_OPENhas exponential backtracking. A roughly 70-character marker line can hold--check-bodyfor several seconds. Please make the repeated groups possessive or replace the expression with a linear parser, then add a bounded-time regression test.
Please also add tests that make the backtick-info and closing-indent mutations fail.
e21a498 to
34dd854
Compare
|
🤖 Kiro Crew Auto-Pipeline [operator: buluoray#ce473fca]: @bolichen97 thanks, both points held. Head is now 1. Unclosed fence fails open: fixed. Confirmed at 2. Mutations you asked for: both now fail.
Each mutation was applied alone and restored. With the fix, |
|
🤖 Kiro Crew Auto-Pipeline [operator: buluoray#ce473fca]: disposition for the two downgraded GPT 6.1 findings on
A third case in the same class turned up while probing: a fence on a list item's continuation line, followed by text after the item. markdown-it-py in CommonMark mode renders that text as a paragraph, and the scanner hid it. Rather than patch more cases, the scanner now follows one fail-closed rule: when unsure, count it as prose. A non-blank line left of the opener's fence column ends the block unclosed, and an unclosed block is counted. Test: This overcounts one valid form: a fence indented one to three spaces whose content starts at column 0. CommonMark renders that as code. Each fix was reverted alone and restored. Every revert fails the named tests; the full table is in the PR body. With the fixes, |
bolichen97
left a comment
There was a problem hiding this comment.
Looks good to ship. Head reviewed: 34dd854.
My earlier change request is resolved on this head: an unclosed fence is now counted as prose, the list prefix in the opener is possessive with a linear time regression test, and new tests fail if the info string lookahead or the closer item indent is removed. I ran the test file locally on this head (60 passed) and timed the opener on a 64000 character marker line (about 1.5 ms).
One advisory, not blocking: a tab indented line inside a list item fence still ends the item early, so a later fence line can hide prose. I reproduced the GPT lane case: 60 words are counted with spaces, 5 with a tab. Expanding tabs before measuring the indent fixes it and keeps every test green. Details inline.
Verified: the linked issue is tier T1, no security path is touched, base is main, and no AI lane has a blocking finding on this head. Every CI check on this head is green after the shard 1 rerun (the first attempt failed on an unrelated test that passes locally). Remaining before approval: PR Readiness is still evaluating this head; I will approve once it reports passed.
| width = 0 | ||
| for line in text.splitlines(): | ||
| if close is not None: | ||
| if line.strip() and len(line) - len(line.lstrip(" ")) < width: |
There was a problem hiding this comment.
🟡 A tab indent ends a list item fence early, so a later fence can hide prose
The item end test counts only leading spaces. A list item fence whose content is indented with a tab measures as indent 0, so the item ends unclosed on that line. The real closer two lines down is then read as a new top level opener and swallows everything up to the next fence line. This is the one case left where an ambiguous body still passes instead of failing closed.
if line.strip() and len(line) - len(line.lstrip(" ")) < width:
Why it matters: with - ~~~, a tab indented code line, ~~~, then 60 words of prose and a later ~~~ example, what_changed_prose counts 5 words instead of 60, so an over limit body passes --check-body.
Suggestion: expand tabs once at the top of the loop, line = line.expandtabs(4), so the indent test and the closer regex both see columns. With that line added the case counts 60 words and the test file still passes (60 passed). A parametrized case with a tab indented item line would pin it.
Our earlier findings are addressed at the current head; see the latest review.
… their indent A list-item fence closes only at the item's content indent. When unsure, the scanner counts the block as prose instead of stripping it, since stripping rendered prose lets an over-limit body pass --check-body: - a fence that never meets its closer is counted, opener included; - a non-blank line left of the opener's fence column ends the block unclosed, which covers a fence on a list item's continuation line followed by text after the item; - no fence opens inside an HTML block (a line starting with "<" after any list markers, to the next blank line or a raw block's end marker); - indent is measured with tabs expanded to four-column stops. This overcounts one valid form: a fence indented one to three spaces whose content starts at column 0. The list-prefix quantifiers are possessive. A marker's trailing spaces and the next marker's indent share the space character, so a 65-character "- - ..." line took about 10 s to reject; the guard ramps that pump.
34dd854 to
db00cdc
Compare
bolichen97
left a comment
There was a problem hiding this comment.
Looks good to ship. Head reviewed: db00cdc.
The tab indent point from my last review is fixed on this head. Lines are now measured with tabs expanded to four column stops, and test_a_tab_indented_line_stays_inside_its_list_fence pins it. I ran that case against the old and new code: the previous head counted 5 words, this head counts all 50.
Also checked: the module test file passes locally (67 passed), and the new rule that ends a block at a line left of the fence column, plus the HTML block guard, only ever count more than before, never less.
One remaining check before approval: the readiness label and PR Readiness are still pending on this head, with backend test shards running. I will come back once they finish.
|
🤖 Kiro Crew Auto-Pipeline [operator: buluoray#ce473fca]: parking this PR. It is not merged, auto-merge is off, and it is back in draft at Why. Each review round found a new body that
A case found while probing between 2 and 4 is also fixed: Case 4 renders as one paragraph in CommonMark, because a list starting at a number other than 1 cannot interrupt a paragraph. The scanner reads Root cause. A line scanner cannot know CommonMark's paragraph or list-container state, and each new case is another spelling of that gap. Another patch for case 4 would be the fifth of these, so none will be made. Next step. Replace the scanner with a real block parser: a stdlib port of the CommonMark block phase, or a vendored parser. The script runs in user repos and is stdlib-only today, so it should not gain a pip dependency. |
|
🤖 Kiro Crew Auto-Pipeline [operator: buluoray#ce473fca]: @bolichen97 an update on your HOLD: this PR is now parked, not merged. Auto-merge is off and it is back in draft. Both of your points are fixed at |
Problem / Motivation
Goal:
diff_signals.py --check-bodyskips every CommonMark code fence in## What changed, not only a backtick fence at column 0.The fence regex in
_what_changed_unfencedwas^```.*?^```[ \t]*$. A~~~block, a backtick block indented one to three spaces, or a four-backtick block stayed in the text. Its words counted towardWORD_LIMIT, and since #22089 its table rows counted toward the eight-row limit, so a code example holding nine table rows gave a false exit 21.Why it matters
An author who writes a valid tilde-fenced or indented example in a PR body gets a "too long" or "too many rows" refusal for code the reader never scans as prose. The failure is loud and easy to clear by switching to a column-0 backtick fence, so the cost is friction, not a silent pass.
Not a goal
## What changedsection ends. It is still cut at the first##line before fences are stripped, so a##line inside a fence ends the section; a test pins today's answer.WORD_LIMIT,TABLE_ROW_LIMITor any other check.What changed (motivation → approach → change)
Symptom: tilde and indented fences counted as prose and table rows. Cause: a regex that only knew one fence form. Change:
diff_signals.pygets a small line-based_strip_fences, which follows the CommonMark rule. A fence opens with three or more backticks or tildes, indented up to three spaces; a backtick opener's info string holds no backtick. It closes on a line of the same character, at least as long, with only blanks after it. A fence behind list markers (- ~~~,1. ```py) closes at its item's content indent and ends with its item, so one item's indented closer cannot open a block that hides the prose up to the next item. When unsure, the scanner counts a block as prose, since stripping rendered prose would let an over-limit body pass. A fence that never meets its closer is counted, opener included. A non-blank line left of the opener's fence column ends the block unclosed, so text after a list item is never hidden by a fence on the item's continuation line. No fence opens inside an HTML block (a line starting with<, after any list markers, up to the next blank line or a raw block's end marker such as</pre>). Indent is measured with tabs expanded to four-column stops. One valid form is now overcounted: a fence indented one to three spaces whose content starts at column 0 (CommonMark renders it as code; here it counts). The list-prefix quantifiers in_FENCE_OPENare possessive, so a long- - -line is rejected in linear time. A fence inside a blockquote (> ~~~) is still counted, as before.~~~/ longer tildeBackwards compatibility
Compatible: no flag, exit code or message changes. A body counts more than today only where main hid text GitHub renders outside a fence: a column-0 block closed by an indented or longer closer, or a backtick opener with a backtick in its info string.
Removes nothing: the change narrows what is counted inside one section; no key, flag, exit code or function is removed or renamed.
Tests
In
test/test_prepare_pr_diff_signals.py:test_fence_forms_skip_both_word_and_row_counts: tilde, longer tilde, indented backtick, indented with info string, four backticks. Each block holds 20 table rows and 4 words, indented to the fence column; rows must be 0 and only the outside prose counts.test_a_closed_fence_pair_inside_html_is_counted(<div>,- <div>,<pre>past a blank line) andtest_a_fence_after_an_html_block_ends_still_strips.test_a_tab_indented_line_stays_inside_its_list_fence.test_a_line_left_of_the_fence_ends_it_and_is_counted: a fence on a list item's continuation line, then 50 words after the item.test_an_indented_fence_with_column_zero_content_is_counted: pins the one overcounted form.test_a_non_closing_line_stays_inside_the_fence: the other character, a shorter run, and a closer with an info string do not close.test_four_space_indent_is_not_a_fence_and_an_unclosed_fence_is_counted.test_an_unclosed_fence_counts_as_prose_so_a_long_body_fails(<details>,<div>,- ````,1. ~~~): 50 words after an opener that never closes;--check-body` exits 21.test_a_backtick_in_the_info_string_is_not_an_opener:```a`bstays prose, so a later fence line cannot hide the rows between.test_a_deep_list_closer_must_reach_the_item_content_indent: a four-wide item closes at four to seven spaces; at three the item ends unclosed and its rows count.test_a_long_list_marker_line_is_scanned_in_linear_time:conftest.assert_rejected_without_backtrackingramps a-pump; before the fix 16 units (65 characters) took 10.7 s.test_a_list_item_fence_closes_at_its_own_indent_and_keeps_the_prose_between(tilde and backtick): two list-item examples with 30 words between; all 30 count.test_list_fences_nest_and_end_with_their_item: ordered and nested items, and an unclosed item fence that ends with its item and stays counted.test_a_blockquote_fence_is_still_counted: pins today's answer for> ~~~.test_a_heading_inside_a_fence_still_ends_the_section: pins the residual named under Not a goal.Revert check, one mutation at a time, each restored after:
list-div<pre>ends at blank linepre-past-blankWith the fix the whole file passes (67 passed, three runs).
Manual verification
N/A — the function is pure text processing and the unit tests drive it directly through
what_changed_table_rowsandwhat_changed_prose, the two callers--check-bodyuses.Related Issues
Closes #22112
Related: #22089, #11006
Pattern harvest
Not generalizable: the repo has other backtick-only fence regexes (for example
preview_text.py,card_lifecycle.py), but they parse model or chat output; this one gates a human-written PR body, where every CommonMark fence form is valid input, andclaim_preflight.pyanddocs_lint.pyalready accept tilde fences.pr_status.pyhas its own_fence_opening/_is_closing_fence; they do not know list items, so reusing them would bring back the list case.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license.
Decision for the owner
The decision is whether
--check-bodyshould count every fence it is unsure of as prose, at the cost of overcounting a fence indented one to three spaces whose content starts at column 0. This PR does, because overcounting only makes the length gate stricter, while stripping rendered prose lets a long body pass.