Skip to content

fix(prepare-pr): print each whole-design lane's punchline - #17128

Closed
unstablebrainiac wants to merge 1 commit into
kirodotdev:mainfrom
unstablebrainiac:fix/prepare-pr-lane-headlines
Closed

unstablebrainiac wants to merge 1 commit into
kirodotdev:mainfrom
unstablebrainiac:fix/prepare-pr-lane-headlines

Conversation

@unstablebrainiac

@unstablebrainiac unstablebrainiac commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: An agent driving kirocrew-prepare-pr sees each whole-design lane's punchline, so a PASS lane's one ask reaches it instead of reading as nothing to do.

The Design, First Principles and UX lanes write one bold punchline right under their verdict line. On a PASS it is the one thing a human should still verify before merge, or Nothing to check.. No item section carries it, and neither pr_findings.py nor pr_status.py printed it, so a PASS lane read as having nothing to say. On #16661 and #16905 the approving maintainer had to ask for the PASS punchline in the approval (#17103).

Why it matters

SKILL.md says a PASS must still be answered, but the loop never saw the ask. The point then reached the author only through a maintainer, after the PR was otherwise done.

Not a goal

  • Gating on a punchline: no exit code changes, and readiness is untouched.
  • Giving the punchline a span= id or adding it to the disposition universe.
  • Changing which lanes a --reviewers pin lists among the marker rows.

What changed (motivation → approach → change)

Both scripts now print the punchline of every whole-design lane stamped for the current head, and skip Nothing to check..

Script Before After
pr_findings.py DESIGN: verdict=PASS, then the "no items" line the same, plus punchline: <sentence> under the verdict, and a line saying a PASS punchline still needs an answer
pr_status.py the verdict on the marker row, and no whole-design row at all under --reviewers gpt,opus a Whole-design punchlines block printed every cycle: one line per lane with its verdict, or (none to check on this head) when no lane has a punchline

lane_punchline in _review_contract.py reads the punchline the way the lane workflows' own CONCERNS digest does: the first text after the verdict line. It takes the whole paragraph, so a wrapped punchline survives, and strips one enclosing bold pair. A heading or a stamp in that place means the lane wrote none. design_lane_punchlines applies it to the lanes _fresh_design_bodies already selects, so freshness and lane identity follow design_lane_verdicts exactly.

pr_status.py reads the lane bodies itself rather than the marker rows, because a pinned fleet lists no whole-design lane there. It prints the text through the same redact and sanitize as pr_findings.py, and labels the block untrusted. For that, redact and its patterns move byte for byte from pr_findings.py into _review_contract.py, both scripts bind that one definition, and test/test_redaction_mirror_parity.py pins the patterns in their new home. SKILL.md names the printed punchline where it says a PASS must still be answered, and its two exit-0 steps now say to answer the punchlines before Phase 4. docs/ci/ci-and-reviews.md records the reader beside the lane output contract.

src/kiro_crew/security_posture.py lists _review_contract.py and pr_status.py beside pr_findings.py in NON_EGRESS_REDACTION_MODULES, because its omission test requires every module that calls a redactor to be classified. That file is on #16862's sensitive-path list, so the Sensitive Change Review check cannot pass from this fork.

Backwards compatibility

Compatible: both scripts only add output lines. On #16034, #16039, #16661, #16905 and #16952 both scripts exit with the same code as on main, and no existing line changes.

Reader: src/kiro_crew/builtin_skills/kirocrew-dev/kirocrew-prepare-pr/scripts/pr_findings.py:redact -- chat -- the definition moves to _review_contract.py byte for byte and pr_findings.py binds redact = _review_contract.redact, so its call sites are unchanged; test_prepare_pr_findings.py::TestCredentialRedaction. No other code on main imports pr_findings.py.

Tests

  • test_lane_punchline_reads_the_paragraph_under_the_verdict (8 cases) in test/test_prepare_pr_findings.py: a bold line, an unbolded line, a wrapped paragraph, the rest of the verdict line skipped, inner bold kept as written, a heading, a stamp, and nothing at all.
  • test_a_pass_lane_prints_its_punchline_as_its_one_ask, test_a_concerns_punchline_prints_without_the_pass_hint and test_nothing_to_check_prints_no_punchline: what pr_findings.py prints in each case.
  • test_only_a_lane_stamped_for_the_head_contributes_a_punchline: a stale stamp contributes nothing.
  • test_a_pinned_fleet_still_prints_the_whole_design_punchlines in test/test_prepare_pr_status.py: under --reviewers GPT,OPUS the block shows the Design PASS punchline and the exit code stays 0.
  • test_a_pinned_fleet_redacts_a_token_in_a_whole_design_punchline and test_a_token_in_a_punchline_is_redacted: a GitHub token in a punchline prints as [REDACTED] in each script.
  • The shared-contract parity pin covers design_lane_punchlines and redact in both entry points, and test/test_redaction_mirror_parity.py reads the patterns from _review_contract.py.
  • test/test_security_posture.py::TestOmissionDetection passes with the two new entries and fails, naming the module, when either is removed.

Each of 17 single breaks of the change turns at least one of these red: an empty reader, the Nothing to check. filter dropped, bold never stripped, one line instead of the paragraph, a heading or a stamp read as the punchline, the verdict line's own tail read, the inner-bold guard dropped, a blank line ending the paragraph early, pr_findings.py printing nothing, the PASS hint on every lane or on none, pr_status.py reading only the pinned marker rows, the block removed, either script printing the punchline unredacted, and pr_status.py binding a no-op redactor.

Manual verification

Ran both scripts from this branch and from main against #16034, #16039, #16661, #16905 and #16952. pr_findings.py 16905 now prints the Design and First Principles PASS punchlines the #16905 approval asked about. pr_status.py 16034 --reviewers gpt,opus prints the Design PASS and First Principles CONCERNS punchlines. Exit codes matched main on all five, and the only output difference was the added lines.

Related Issues

Closes #17103

Pattern harvest

Not generalizable: the verdict line, the punchline and the item sections are the whole lane output contract, and with this change each one has a reader in _review_contract.py.

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

@unstablebrainiac
unstablebrainiac requested a review from a team as a code owner October 5, 2026 20:01
@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: checking Automated validation is still running labels Oct 5, 2026
@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5, fork) — ✅ PASS

Design-level review of 0405bccae6aedad26c58293afd332a89b22ecc1a via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

A maintainer must clear Sensitive Change Review for the two new NON_EGRESS_REDACTION_MODULES entries, since pr_status.py now prints model text into the PR Readiness job log.

[DESIGN-REVIEWED] 0405bcc

Description read

[DESCRIPTION-READ] 035f9568b3ac3ff0550a1b66915802f28489323c48274bc6ef6fb11f38612140

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 5, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5, fork) — ✅ PASS

Premise-level review of 0405bccae6aedad26c58293afd332a89b22ecc1a via the fork AI-review pipeline — 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 that the exit‑0 path really skips pr_findings.py. That is the only reason pr_status.py keeps its own copy of the punchline block and the redact move.

What this change ships

Inventory (7 items) — 7 justified

Intent: a FIX. An agent running kirocrew-prepare-pr should see each whole-design lane's punchline, including the one ask a PASS carries, without a maintainer passing it on (#17103).

  1. pr_findings.py prints punchline: <sentence> under each lane stamped for the current head and skips Nothing to check. — justified
  2. pr_findings.py adds a hint line when a PASS lane has a punchline, saying it still needs an answer — justified
  3. pr_status.py prints a Whole-design punchlines block every cycle, including under --reviewers gpt,opus — justified
  4. redact and its patterns move from pr_findings.py into _review_contract.py, and both scripts use that one definition — justified
  5. security_posture.NON_EGRESS_REDACTION_MODULES now lists _review_contract.py and pr_status.py — justified
  6. SKILL.md's exit‑0 steps now say to answer the punchlines before Phase 4 — justified
  7. ci-and-reviews.md records where the punchline is read — justified

[FIRST-PRINCIPLES-REVIEWED] 0405bcc

Description read

[DESCRIPTION-READ] d903b209fbac8add86d429343a6d4d1dc863f2d10d9c5aa274f23ada5ea59ff0

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 5, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review (fork) — ✅ no blocking findings

Reviewed 0405bccae6aedad26c58293afd332a89b22ecc1a via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 0405bcc

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 5, 2026
@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review (fork) — ✅ no blocking findings

Reviewed 0405bccae6aedad26c58293afd332a89b22ecc1a via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 0405bcc

@unstablebrainiac
unstablebrainiac force-pushed the fix/prepare-pr-lane-headlines branch from 24261e8 to b7a00c2 Compare October 5, 2026 23:12
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 5, 2026
@unstablebrainiac
unstablebrainiac force-pushed the fix/prepare-pr-lane-headlines branch from b7a00c2 to c15c3db Compare October 6, 2026 00:37
The Design, First Principles and UX lanes write one bold punchline under their verdict line. On a PASS it is the one thing a human should still verify before merge, and no item section carries it, so pr_findings.py and pr_status.py never showed it. Both now print it, skipping 'Nothing to check.'. Exit codes do not change.

Closes kirodotdev#17103
@unstablebrainiac
unstablebrainiac force-pushed the fix/prepare-pr-lane-headlines branch from c15c3db to 0405bcc Compare October 6, 2026 01:16
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention labels Oct 6, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor

Reviewed, not approving (crew-pr-reviewer). This touches src/kiro_crew/security_posture.py (redaction mirror parity), and Sensitive Change Review is red on this head, so it needs a reasoned human approval. The prepare-pr script changes look like output formatting, but a security owner should sign off on the posture file.

@unstablebrainiac

Copy link
Copy Markdown
Contributor Author

@iamwhatever No file in the repo names a security owner: GOVERNANCE.md leaves decisions to maintainers, and CODEOWNERS routes every path to @kirodotdev/kirocrew-pr-review. @bolichen97 @CrysisDeu, a security sign-off on security_posture.py is what this PR waits on.

The posture change adds two entries to NON_EGRESS_REDACTION_MODULES, beside the existing pr_findings.py entry, and rewords the comment above them. It removes nothing and changes no sink. _review_contract.py now holds the redactor, moved line for line out of pr_findings.py, and test_redaction_mirror_parity.py reads the patterns from there. pr_status.py calls that redactor to print each whole-design lane's punchline. That print is the one new output. It goes to the terminal and to the PR Readiness job log, and each punchline is redacted before it is cut to 280 characters. The text comes from the lanes' own comments on this public PR, so the log carries a redacted copy of text that is already public.

@bolichen97

Copy link
Copy Markdown
Contributor

Reviewed on the maintainers' behalf (sweep 2026-10-06): diff read in full, no regression (redact moved verbatim, exit codes unchanged, CI consumer path unaffected). Because this fork PR touches src/kiro_crew/security_posture.py, the Sensitive Change Review gate cannot be cleared on a fork, so per that policy I have taken it over on an in-repo branch: #17278 carries your head 0405bcc verbatim with you as co-author. I will close this PR once #17278 merges.

@unstablebrainiac

Copy link
Copy Markdown
Contributor Author

Superseded by #17278. This branch will not move again, so #17278 stays the one copy of the change.

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Oct 6, 2026
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor) merge conflict Branch has merge conflicts with its base — author must resolve before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

prepare-pr: pr_findings.py and pr_status.py never show a whole-design lane's punchline

3 participants