Repository navigation
fix(first-pr): --check fails closed on a current packet that records a blocked state (#7373) - #8380
Conversation
…a blocked state (#7373) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014M4CxVpkPfCECBREENzvjf
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
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. View limit details
Comment |
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014M4CxVpkPfCECBREENzvjf
|
In-session evidence: Generated by Claude Code |
There was a problem hiding this comment.
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.
Before:
ripr first-pr --checkexited 0 on a current packet whose state waswrong_rootormissing_artifacts, so a freshness gate could not tell a broken packet from a healthy one, andripr help first-prstated no exit contract.After:
--checkexits 2 when the validated packet hasstatus: 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-prnow has an explicit Exit status section describing both.How: gate added at the end of
check_first_princrates/ripr/src/output/first_pr.rs; help text infirst_pr/options.rs. New cli_smoke testfirst_pr_check_exits_2_for_a_blocked_packet_but_write_mode_exits_0pins write 0 / check 2 on a non-workspace root; the existing healthy-packet--checktest (exit 0, "packet ok") is the negative control. Two cli_smoke tests and eleven unit tests that used--checkto validate blocked recovery packets now assert the packet is current and blocked. Changelog fragment included.Option chosen from the issue's two: only
--checkcarries the typed gate. Making write mode exit 2 would fail the very firstripr first-pra new user runs.Evidence:
cargo xtask precommitexit 0; focusedfirst_pr/start_herecli_smoke, hostile_repos, help_hierarchy, printed_command_paste, generated_review_workflow and libfirst_prtests pass (the two lib failures are root-permission tests that also fail on main in this container).Closes #7373
Generated by Claude Code