Skip to content

fix(prepare-pr): bound the table rows in --check-body's What changed - #22089

Merged
chenmingwei23 merged 1 commit into
mainfrom
fix/11006-what-changed-gate
Oct 19, 2026
Merged

chenmingwei23 merged 1 commit into
mainfrom
fix/11006-what-changed-gate

Conversation

@iamwhatever

@iamwhatever iamwhatever commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: The prepare-pr body check stops a PR body whose What changed it cannot judge, instead of letting it through with exit 0.

diff_signals.py --check-body made the What changed word count a hard gate in #10992, but two routes still pass it with exit 0. A body with no ## What changed section only gets a WARN. Table rows are left out of the word count, so a per-file walkthrough moved into a table stays under the limit.

Why it matters

The skill tells agents to lead with a table, and the word limit puts them under exit-21 pressure. Without a row bound, the cheapest way past the gate is to turn the recital into rows. A same-repo body with the section missing is never stopped by anything server-side either; only fork PRs have that check.

Not a goal

  • No new readability measure. The row bound reuses the picture's existing "eight rows is the ceiling" from references/body-picture.md.
  • No change to the accounting (exit 20) or template (exit 22) checks.

What changed (motivation → approach → change)

body Before After
no ## What changed exit 22 exit 22 (now tested)
9 table rows exit 0 exit 21
8 table rows exit 0 exit 0

The missing-section route was already closed after this issue was filed: #14401 runs CI's template check inside --check-body, and it fails that body with exit 22. This PR adds an end-to-end test that pins it rather than a second gate. The table route is new: rows in What changed are summed over every table there, not counting headers, separators or fenced blocks, and more than eight is exit 21. The limit is a constant, TABLE_ROW_LIMIT = 8, and a test keeps it equal to the eight rows references/body-picture.md already sets for a picture. The Two checks, two strengths table and the Phase 1 reconcile step in the prepare-pr SKILL.md now say exit 21 covers table rows.

Backwards compatibility

Breaking: a --check-body run on a body with more than eight table rows in What changed now exits 21 instead of 0. Writer sweep on origin/main @ d8ff9e7: the only caller is the prepare-pr skill itself (SKILL.md Phase 1 step 5, Phase 2 step 3, Phase 3 step 2), which tells the agent to fix the body on 21. docs/system-specs/common/take-away-changes.md and references/rationale.md only mention the flag.

Reader: src/kiro_crew/builtin_skills/kirocrew-dev/kirocrew-prepare-pr/SKILL.md:Phase 1 step 5 -- chat|subagent -- the step now names table rows as an exit-21 cause; test_skill_wires_the_check_at_every_body_write_and_gates_both_checks

Tests

test/test_prepare_pr_diff_signals.py:

  • nine table rows exit 21, eight exit 0;
  • row counting skips headers, separators, fenced tables and tables in other sections;
  • TABLE_ROW_LIMIT matches the eight rows in references/body-picture.md;
  • end to end, a body with no What changed exits 22 from the template check.

All 39 tests in the file pass on this head.

Manual verification

N/A — unit coverage sufficient: the change is a pure function over the body text, tested directly and end to end.

Related Issues

Closes #11006

Follow-ups:

Pattern harvest

Not generalizable: the gap was a length gate that excluded a content type the same skill recommends; the fix bounds that type with the number the skill already uses.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@iamwhatever
iamwhatever requested review from a team and KiroCrewCaptain as code owners October 19, 2026 05:52
@iamwhatever
iamwhatever requested a review from buluoray October 19, 2026 05:52
@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision b4c02b69fba0eff38f697c6a9e2f58b76827cbee touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Advisory — does not block merge.

@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 19, 2026
@iamwhatever
iamwhatever force-pushed the fix/11006-what-changed-gate branch from 6dfc9f8 to 647194f Compare October 19, 2026 05:53
@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of b4c02b69fba0eff38f697c6a9e2f58b76827cbee — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Nothing to check.

[DESIGN-REVIEWED] b4c02b6

Description read

[DESCRIPTION-READ] 251e1655b4f2d27da72a837eedbca386e4894724b75bac8f45dce987d84d13e0

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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of b4c02b69fba0eff38f697c6a9e2f58b76827cbee and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] b4c02b6

False positive or not applicable? A repository writer can comment:
/ai-review override gpt b4c02b69fba0eff38f697c6a9e2f58b76827cbee: <one-sentence reason>

@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of b4c02b69fba0eff38f697c6a9e2f58b76827cbee — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

First-Principles-Verdict: PASS

Check one thing: the limit adds up rows across every table in What changed, but body-picture.md sets eight rows for a single picture.

What this change ships

Inventory (6 items) — 6 justified

Intent: stop prepare-pr's --check-body from passing a What changed section that dodges the word limit by putting the walkthrough in table rows. This is a FIX (#11006).

  1. A body with more than eight table rows in What changed now exits 21 instead of 0 — justified
  2. The TABLE_ROW_LIMIT = 8 constant, with a test that keeps it equal to the number in body-picture.md — justified
  3. The row count skips headers, separators, fenced blocks and tables in other sections — justified
  4. A new end-to-end test checks that a body with no What changed exits 22 through the existing template check — justified
  5. The SKILL.md Phase 1 step 5 and the Two checks table now say exit 21 also covers table rows — justified
  6. The parsing of the What changed section is pulled into one helper shared by the prose and row counts — justified

[FIRST-PRINCIPLES-REVIEWED] b4c02b6

Description read

[DESCRIPTION-READ] daf387a0429a61285fccf8b122eebe73f0a0d636364939fc9bff6609c95fe1ec

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed b4c02b69fba0eff38f697c6a9e2f58b76827cbee — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] b4c02b6

Verdict parsed from the review's SHA-scoped output markers for commit b4c02b69fba0eff38f697c6a9e2f58b76827cbee.

False positive or not applicable? A repository writer can comment:
/ai-review override fable b4c02b69fba0eff38f697c6a9e2f58b76827cbee: <one-sentence reason>

@iamwhatever iamwhatever changed the title fix(prepare-pr): fail --check-body on a missing What changed section or an over-long table fix(prepare-pr): bound the table rows in --check-body's What changed Oct 19, 2026
@iamwhatever
iamwhatever force-pushed the fix/11006-what-changed-gate branch from 647194f to b4c02b6 Compare October 19, 2026 06:27
@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • Item 1 — missing section duplicates the template check span=8b4a4f1efd9e -- fixed in b4c02b6

Fixed by removal. Confirmed: template_check already returns 22 for a body with no ## What changed, so the exit-21 branch only renamed the code. The branch is gone and the WARN is back. A new end-to-end test, test_end_to_end_body_missing_what_changed_exits_twenty_two, pins the exit-22 route, and the PR body now says the route was closed by #14401.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • Item 4 — unused row_limit parameter span=50884ac2fe4c -- fixed in b4c02b6

Fixed by removal. check_body no longer takes row_limit=; it reads TABLE_ROW_LIMIT directly.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • The missing-section gate already exists span=7f6082443bd9 -- fixed in b4c02b6

Fixed: item 1 is removed (branch, the SKILL.md "missing" wording, and the rewritten test, which is restored to its main form). Only the table-row bound remains as new behaviour.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

Answered by removal: the old pin is no longer reversed. A body with no ## What changed still gets the WARN from the length check and exit 22 from the template check, as on main. The only behaviour change left is the eight-row table bound (exit 21).

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • Tilde and indented fences are not stripped before counting rows span=39ce0c73d50a -- rebutted, deferred

The fence-stripping regex is unchanged from main: this PR only moves it into _what_changed_unfenced so the row count and the existing word count share it. Main's word count has the same gap today (a tilde-fenced block counts as prose). The skill's bodies use backtick fences, and the failure mode is a loud exit 21 that the author fixes by using a backtick fence, not a silent pass. Widening fence detection changes the word count too, so it belongs in its own change rather than this one.

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Oct 19, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Summing is deliberate. A per-table bound would let a walkthrough split into several eight-row tables and pass, which is the route this issue closes. references/body-picture.md asks for one Before/After picture of the delta, so a body within that rule has one table and the per-picture and per-section bounds agree. The constant's comment says "summed over every table there".

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: passed Eligible automated validation passed for the current revision readiness: checking Automated validation is still running labels Oct 19, 2026
@chenmingwei23
chenmingwei23 merged commit 7787848 into main Oct 19, 2026
113 of 114 checks passed
@chenmingwei23
chenmingwei23 deleted the fix/11006-what-changed-gate branch October 19, 2026 14:09
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 19, 2026
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.

prepare-pr: close the two exit-0 routes past the What changed length gate (missing section, table rows)

2 participants