Skip to content

fix(first-pr): --check fails closed on a current packet that records a blocked state (#7373) - #8380

Merged
EffortlessSteven merged 3 commits into
mainfrom
fix/7373-first-pr-exit-codes
Oct 17, 2026
Merged

EffortlessSteven merged 3 commits into
mainfrom
fix/7373-first-pr-exit-codes

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Before: ripr first-pr --check exited 0 on a current packet whose state was wrong_root or missing_artifacts, so a freshness gate could not tell a broken packet from a healthy one, and ripr help first-pr stated no exit contract.

After: --check exits 2 when the validated packet has status: blocked (wrong root, missing, stale-recovery or malformed artifacts), prints the packet summary first, and omits the "packet ok" line. Write mode keeps exiting 0 after composing a packet, including a recovery packet, so first-run onboarding is not turned into a failure. ripr help first-pr now has an explicit Exit status section describing both.

How: gate added at the end of check_first_pr in crates/ripr/src/output/first_pr.rs; help text in first_pr/options.rs. New cli_smoke test first_pr_check_exits_2_for_a_blocked_packet_but_write_mode_exits_0 pins write 0 / check 2 on a non-workspace root; the existing healthy-packet --check test (exit 0, "packet ok") is the negative control. Two cli_smoke tests and eleven unit tests that used --check to validate blocked recovery packets now assert the packet is current and blocked. Changelog fragment included.

Option chosen from the issue's two: only --check carries the typed gate. Making write mode exit 2 would fail the very first ripr first-pr a new user runs.

Evidence: cargo xtask precommit exit 0; focused first_pr/start_here cli_smoke, hostile_repos, help_hierarchy, printed_command_paste, generated_review_workflow and lib first_pr tests pass (the two lib failures are root-permission tests that also fail on main in this container).

Closes #7373


Generated by Claude Code

…a blocked state (#7373)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014M4CxVpkPfCECBREENzvjf
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@EffortlessSteven
EffortlessSteven marked this pull request as ready for review October 17, 2026 05:18
@EffortlessSteven EffortlessSteven self-assigned this Oct 17, 2026
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Next included review available in 51 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 61 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: 80233a7f-1b41-41c5-8fa5-fb4e0a605e84
📥 Commits

Reviewing files that changed from the base of the PR and between e2cb5a9 and e802fe3.

📒 Files selected for processing: 4
  • changelog.d/7373-first-pr-check-blocked-exit.md
  • crates/ripr/src/output/first_pr.rs
  • crates/ripr/src/output/first_pr/options.rs
  • crates/ripr/tests/cli_smoke.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

Copy link
Copy Markdown
Member Author

In-session evidence: cargo xtask precommit exit 0; focused first_pr/start_here cli_smoke, hostile_repos, help_hierarchy, printed_command_paste, generated_review_workflow and lib first_pr tests pass. Independent subagent review of the exact diff found no blocking findings; its one low item (assert the exit code is exactly 2) is fixed in the latest commit, and it found no workflow, script or doc relying on --check exiting 0 on a blocked packet.


Generated by Claude Code

@github-actions github-actions Bot 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.

Decision

  • Needs reviewer attention before upstream: findings remain.

Confirmed findings

  • crates/ripr/tests/cli_smoke.rs:5294 — The two flipped --check tests only assert assert_failure + a stderr substring; add an explicit exit-code check (Some(2)) like the new test does, so they fail loudly if the gate ever maps to a different non-zero code.

Verification questions

  • Confirm lib unit tests use check_blocked_packet_is_current which matches ONLY the new gate's stderr substring; any future drift in the gate message would silently flip them back to green without proving the gate still fires.

Refuted

  • Helper introduces duplication because Err(err) if cond / Err(unconditional) duplicates the gate's boolean logic and could drift.; refuted because: Helper matches on the literal error substring produced by the single gate site; coupling to that one string is tighter than a separate boolean flag and the only drift vector is the exact phrasing, which helper and gate share by construction.

Evidence gaps

  • Model proof intent was rejected by deterministic validation.

@EffortlessSteven
EffortlessSteven merged commit ee81863 into main Oct 17, 2026
25 checks passed
@EffortlessSteven
EffortlessSteven deleted the fix/7373-first-pr-exit-codes branch October 17, 2026 06:05
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.

ux(first-pr): every composition failure state exits 0, and --check exits 0 on wrong_root but 2 on missing_artifacts

2 participants