Repository navigation
fix(first-pr): answer a missing --check packet before resolving the base (#4285) - #4290
Conversation
…ase (#4285) #4260 resolved an omitted --base ahead of check_first_pr, so `first-pr --check` with no packet failed with "could not resolve a default base" in any repository without origin/main, origin/master, main or master -- the Windows Advisory lane's shallow PR checkout, which holds the suite's temp root -- instead of printing the rooted recovery (#3869). Check mode now reports a missing packet first; an existing packet is still validated against the resolved base. The suggested write command renders --base only when the user passed one, so the write resolves the same default instead of being handed a guessed origin/main. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ui933un54X4MJRygfjwdjW
|
Warning Review limit reachedNext included review available in 39 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (6)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…rt cleanup A git fixture's read-only object files can fail remove_dir_all on Windows; ignore_remove_dir_all is the file's convention for repositories. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ui933un54X4MJRygfjwdjW
EffortlessSteven
left a comment
There was a problem hiding this comment.
Exact-head review (review-pr), author self-review, so this is a COMMENT.
reviewed_head_sha: bc3dac392e6786ab2e2a920104f9c2b5b8304aab
integration_basis: main 66d4af585 (branch point); PR merge ref as tested by hosted CI
claim_boundary: #4285: `first-pr --check` with no packet prints the rooted missing-packet recovery even where no default base resolves; the suggested write renders --base only when explicit
Blocking findings: none.
Changed surfaces and semantic owners inspected
output/first_pr.rs,first_pr(): in check mode,check_packet_pathsruns beforeresolve_omitted_base. The prologue changes only when the base is resolved. With a packet present,check_first_prstill sees the resolved base, so #4260's intent holds.check_packet_pathsis now the single rule for where--checklooks for the packet: under--root, or under the invocation directory when the root preflight fails. This is the same rulewrite_first_pruses.check_first_prkeeps its order (root preflight, packet paths, git preflight, validate). The only difference is that the git preflight no longer runs when the packet is missing, and its result was unused on that path anyway.first_pr_write_command:--baseis emitted only whenbase_explicit, the same rule as--gap-ledger. This function has one consumer,first_pr_missing_packet_recovery_error. A repo-wide grep finds no other parser or consumer of the recovery text (docs, editors, fixtures).tests/cli_smoke.rs: two new CLI tests; the existing rooted test now prints stderr when it fails.
Oracle challenge (mutation / removal, run locally on Linux)
- Restore #4260's ordering (delete the check prologue) and
first_pr_check_missing_packet_recovers_without_a_resolvable_basefails withripr: first-pr: could not resolve a default base (no origin/main, origin/master, or local main/master found).... That is the exact stderr behind the #4285 Windows failure. - Render
--baseunconditionally and the same test fails on!stderr.contains("--base"). - Skip base resolution in check mode and
first_pr_check_recovery_write_resolves_the_default_basefails withfirst-pr start-here packet is stale ... --base origin/main. This shows the omitted-base write resolvesmasterat run time and the later--checkvalidates against the same resolution. - Fixture construction is asserted, not assumed. The no-base workspace is its own repo with a detached HEAD, no origin and no main/master, so the result does not depend on the checkout the suite runs in (TEMP points into the checkout via
.cargo/config.toml).
Platform relevance
The defect is host-independent. It surfaced on Windows only because that lane's shallow PR checkout has no default base and holds the suite's temp root. Native proof: Windows Advisory run 36311685113 on this head reports "No test failed in either run" (8552 pass ×2). The previous repeated_failure first_pr_check_missing_packet_suggests_rooted_out_dir passes, and the new tests run on Windows. nofeatures-test: FAIL is the pre-existing Rust-only lane failure (#4252, #4278); it also appears in runs without this change.
Exact-head CI observed
Routed Rust Small (Rust gates), PR Plan, Security (cargo-deny, dependency-review), ub-review, GitGuardian and windows-advisory are all success on bc3dac3. Local cargo xtask precommit: exit 0 before each push.
Refuted or stale findings: Gemini's remove_dir_all cleanup finding was valid. It was repaired in bc3dac3 (ignore_remove_dir_all), answered and resolved.
Missing review/proof: Droid Auto Review is pending or not observed; Devin is out of credits. That review is missing, not clean.
Relationships: crosses #4287 in first_pr_write_command, an adjacent hunk on the --root line. Keep both sides when resolving.
Residual assumptions / non-claims: The stale-packet message in validate_current_preflight_recovery still renders --base unconditionally. That is out of scope here, and on that path the base has already been resolved, so it is not a guess.
Currentness dimensions: production, stimulus, oracle and head identity are all current at bc3dac3.
disposition: REVIEW_READY (no blockers; external review from Droid/Devin is missing)
Generated by Claude Code
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bc3dac392e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Decision
- Needs reviewer attention before upstream: findings remain.
Confirmed findings
- Lane scope (JS worker/async/GC/detach/transfer boundaries) does not intersect this diff. The two changed files are pure single-threaded Rust CLI control flow; there is no JavaScript, no wasm-bindgen, no SharedArrayBuffer, no postMessage, no transferable handle, and no Drop-time async cleanup to review. Any worker-handoff finding here would be fabricated. Lane reports null strongest-rejected hypothesis because the assigned surface was not exercised by this PR.
Verification questions
- Confirm
--headis now appended after the conditional--baseblock; previously the order was--root --base --head. With shell_arg quoting this is equivalent at parse time, but any downstream tool or doc that pins positional indices of the rendered command could regress. - Confirm the PR body claims the failing Windows run is host-independent because the .cargo/config.toml routes TEMP into the checkout. The new positive test relies on
no_origin_master_repo(...,"master"), which is itself a host-sensitive fixture; if that helper is not gated on Unix or is not Windows-safe (path separators, .git read-only files), the proof will flake on the same Windows lane that originally surfaced #4285.
Refuted
- Active-view UB (resizable buffer / stale length / ArrayBuffer transfer) could be lurking in this PR; refuted because: PR is a Rust CLI output path; no JS typed-memory surface exists. Lane is out-of-scope by construction.
- A sibling write-command helper (e.g. report/plan) renders a guessed default --base unconditionally and would regress with this PR's pattern.; refuted because: Only first_pr_write_command is in this PR's lane; the diff does not touch other write-command builders, and check-mode missing-packet recovery is unique to first_pr --check. No counterexample found in changed surfaces.
- Command-injection via newly rendered --base value when options.base_explicit becomes true and base contains shell metacharacters.; refuted because: shell_arg is the same function used for --root/--head pre-PR; no new sink introduced. Test pins that omitted bases render no --base at all, narrowing the surface, not widening it.
Parked follow-ups
- No parked follow-up: --base conditional is local to first_pr_write_command; --root binding change is owned by #4287 and explicitly out of scope here.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
… resolves (#4285) Where no default base resolves, the recovery suggested a write without --base, and that write failed in base resolution without creating the packet: a recovery that could not recover. Check mode now resolves the omitted base through the same owner without failing on it; when nothing resolves, the suggested write carries `--base <ref>` and the loader's named reason, never a guessed origin/main. When it resolves, the write still omits --base and resolves the same default at run time. The no-base test now fills the placeholder and runs the suggested write (packet written); the default-base test runs the printed write verbatim. Both new CLI tests map to RIPR-SPEC-0084 and RIPR-SPEC-0122. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ui933un54X4MJRygfjwdjW
EffortlessSteven
left a comment
There was a problem hiding this comment.
Exact-head review (review-pr) after the Devin and Codex repair. Author self-review, so this is a COMMENT.
reviewed_head_sha: 922c23782fb3f5cde7ca4cd2f22d75c89cf5300c
integration_basis: main 66d4af585 (branch point); hosted CI tested the PR merge ref
claim_boundary: #4285. `first-pr --check` with no packet prints the rooted recovery even where no default base resolves, and that recovery's suggested write can create the packet (omit --base when the default resolves; demand `--base <ref>` with the loader's reason when it does not)
Blocking findings: none.
Repair inspected (dimensions changed since bc3dac3: production, stimulus, oracle, public claim, generated relationships)
first_pr()now resolves the omitted base once, throughomitted_base_resolution. This is the formerresolve_omitted_base, reshaped to return its result instead of failing, so there is still one resolver.- Check mode passes the failure, if any, to
check_packet_pathsbefore acting on it. - Then
Some(Ok)sets the base,Some(Err)fails as #4260 did (first-pr: <loader error>), andNone(explicit base, or a root the preflights handle) leaves it unchanged. - Write mode behaves exactly as before.
- Check mode passes the failure, if any, to
first_pr_missing_packet_recovery_errorandfirst_pr_write_command:- an explicit base renders as given;
- an omitted base that resolves is not rendered, and the write resolves the same default when it runs;
- an omitted base that fails renders
--base <ref>(the repo's placeholder convention; 10 other rendered commands use it) plusReplace <ref> with the branch or commit this PR is based on: <loader's named error>. origin/mainis never guessed.check_first_prpassesNone, because by then the base is explicit or resolved.
- Traceability:
.ripr/traceability.tomland the Test Mapping sections of RIPR-SPEC-0084 and RIPR-SPEC-0122 map the new tests;first_pr.rsis added as 0084 code.
Oracle challenge (run locally)
first_pr_check_missing_packet_recovers_without_a_resolvable_baseruns in its own repo: detached HEAD, no origin, no main/master. It asserts:- the recovery prints, not the base failure;
- the suggested write carries
--base <ref>and the reason line; - once
<ref>is filled with a real ref, running the suggested command writesstart-here.json.
- Against bc3dac3's production file it fails at the
Replace <ref>assertion: that head handed out a command with no--base, which could not create the packet. Against main's it fails withcould not resolve a default base. first_pr_check_recovery_write_resolves_the_default_baseruns the printed command verbatim in a repo whose only base is localmaster. It asserts the packet recordsmasterand that--checkpasses. If check mode skips base resolution, it fails with a stale-packet error.- Unit test
first_pr_write_command_renders_only_an_explicit_basepins the explicit, omitted and required-placeholder forms. - Literally pasting
--base <ref>without replacing it fails closed: a shell syntax error, or ripr writes a blocked recovery packet saying the base does not resolve. The test does not assert this because the behaviour depends on the shell.
Verification questions from the github-actions review (bc3dac3)
- Argument order: unchanged. The command is still
--root,--base,--head,--check-output,--gap-ledger,--out-dir. The only change is that--baseis conditional. A repo-wide grep finds no consumer that parses this recovery text. no_origin_master_repoon Windows: the Windows Advisory lane on this head reports no failures, and #4260's own test uses the same helper. Cleanup usesignore_remove_dir_all.
Exact-head CI observed on 922c237
- Success: CI, Routed Rust Small, PR Plan, Security, Source of Truth, ub-review.
- Windows Advisory run 36315078065: "No test failed in either run" (8564 pass ×2); nofeatures-check, nofeatures-test and allfeatures-check all PASS.
- Local runs:
cargo xtask precommitexit 0;cargo xtask check-traceabilitypass (::symbolsuffixes are advisory only, #2345);check-spec-formatpass.
Findings dispositions: Gemini (cleanup), Devin (unusable recovery; traceability) and Codex P1 (same recovery bug) were all valid. Each was repaired, answered and resolved.
Missing review/proof: Droid Auto Review is pending or not observed, so external review of this head is missing. Devin and Codex have not re-reviewed 922c237.
Relationships: crosses #4287 in first_pr_write_command, an adjacent hunk on the --root line. Keep #4287's command_root() and this PR's base branch.
Non-claims: the stale-packet message in validate_current_preflight_recovery still renders --base <resolved>. On that path the base is already resolved or explicit, so it is not a guess.
disposition: REVIEW_READY (no blockers; external review is missing, not clean)
Generated by Claude Code
Main carried an earlier #4288 candidate (via the #4266 squash): an early require_start_here_packet check and a recovery that always omits an unresolved --base. Conflicts in first_pr.rs keep this branch's single omitted_base_resolution owner and check_packet_paths, which also demand `--base <ref>` when no default base resolves. Main's duplicate first_pr_check_missing_packet_recovers_without_a_resolvable_base smoke test and first_pr_write_command_renders_base_only_when_explicit unit test are dropped: the first pinned the advertised write that fails without a base, and the second is covered by first_pr_write_command_renders_only_an_explicit_base. Folded in from #4288: the no-base smoke test now requires the resolution error in the recovery and re-runs `--check` with the filled-in base, and RIPR-SPEC-0122 prose states the resolved/unresolved --base rule. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UyH6Ya3zZA8atiNCVFyUub
|
Merged What main already had. The #4266 squash ( Conflict resolution (
Folded in from #4288.
Proof on
All review threads on this PR were already resolved with fixes in Generated by Claude Code |
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UyH6Ya3zZA8atiNCVFyUub
Resolves the CHANGELOG Fixed-section conflict by keeping both entries. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UyH6Ya3zZA8atiNCVFyUub
Resolves the CHANGELOG Fixed-section conflict by keeping both entries. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UyH6Ya3zZA8atiNCVFyUub
Resolves the CHANGELOG conflict by taking main's file and moving this PR's Fixed entry to the end of the section, where later top-of-section insertions from other PRs no longer collide with it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UyH6Ya3zZA8atiNCVFyUub
EffortlessSteven
left a comment
There was a problem hiding this comment.
Exact-head review, e33230c: REVIEW_READY.
Inspected: the full three-dot diff against main 69769d9 (6 files); the owner in output/first_pr.rs, where omitted_base_resolution runs once and feeds check_packet_paths with base_error; the write path unchanged; root-preflight and non-git cases; an existing packet with no resolvable base still failing with the named error; the merge resolution (main's require_start_here_packet and its smoke test, which asserted the broken no---base command, replaced; main's explicit-base unit case kept in first_pr_write_command_renders_only_an_explicit_base); RIPR-SPEC-0084 and -0122 text; traceability; and the rendered binary output in a detached repo (recovery with --base <ref> plus the resolution error, exit 2).
Since 0805502 the head adds only a CHANGELOG Fixed entry (8621c58) and three base merges (312dac0, f0a98cd, e33230c). The last one places the entry at the end of Fixed so later top-of-section inserts don't collide with it.
Proof:
- The discriminator mutations (recovery
base_errorforced to None; #4260 resolve-first ordering restored) each failfirst_pr_check_missing_packet_recovers_without_a_resolvable_base. cargo test -p ripr --test cli_smoke first_pr: 4 passed on e33230c.cargo xtask precommit: exit 0 on e33230c.- CI on e33230c: 13 success, 10 skipped, 0 failed, including windows-advisory (the #4285 Windows acceptance).
- Review threads: 0 unresolved.
- mergeable_state: clean.
Not blocking: the --base <ref> placeholder is printed unquoted; the next line tells the user to replace it.
Missing external review, not clean: CodeRabbit is rate-limited on this head.
Generated by Claude Code
Keep #4290's first-pr --check base handling (omitted_base_resolution, check_packet_paths, `--base <ref>` recovery naming the resolution error) alongside #4287's bound absolute --root. #4290's smoke tests now assert the suggested write binds --root to the absolute scratch repository (the no-base case runs from the repo with `--root .`), decoding shell words with decode_shell_token. The #4287 Fixed entry moves to the end of the Unreleased Fixed section. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UyH6Ya3zZA8atiNCVFyUub
Summary
first-pr --checkmissing-packet recovery message regressed on main after c989c30 (cli_smoke repeated failure) #4285.ripr first-pr --checkwith no packet printed the base failure instead of the rooted missing-packet recovery (fix(cli): anchor first-pr missing-packet recovery to the resolved out-dir #3869) whenever no default base resolved.1ee35781c). It was not ux(0.11): end five first-hour dead ends (#4216 rows 1-4, #4224) #4226 or fix(first-pr): keep out-of-diff cards and blocked-ledger retries from looping new users #4253. fix(base): resolve an omitted --base for diff, first-pr and pr-evidence (#3952, #3886) #4260 addedresolve_omitted_baseahead ofcheck_first_pr, so check mode resolved a base before looking for the packet.7c166b60e, which contains ux(0.11): end five first-hour dead ends (#4216 rows 1-4, #4224) #4226, fix(first-pr): keep out-of-diff cards and blocked-ledger retries from looping new users #4253 and fix(receipt): stop telling the agent to keep a test ripr never ran (#4234) #4242, merged with main up toc6f9fd01d) was clean.1ee35781c..cargo/config.tomlpointsTEMP/TMP/TMPDIRat the checkout'starget/, so the test workspace sits inside the CI checkout. The Windows lane's shallow PR checkout has noorigin/main,origin/master,mainormaster, so--checkfailed withfirst-pr: could not resolve a default base .... Linux CI hasorigin/main, so it passed there. The defect is host-independent: it reproduces on Linux in any repository where no default base resolves.Change (semantic owner:
output/first_pr.rs)--checknever diffs.check_packet_pathsis the one place that computes the packet location for--check.--baseonly when the user passed one. This follows the existing--gap-ledgerrule.--baseresolves the same default when it runs (fix(base): resolve an omitted --base for diff, first-pr and pr-evidence (#3952, #3886) #4260 / RIPR-SPEC-0084). The positive test pins this: the write recordsbase = masterin a repo whose only base is localmaster, and the following--checkpasses.origin/mainwould hand the user a guessed base, which fix(base): resolve an omitted --base for diff, first-pr and pr-evidence (#3952, #3886) #4260 removed.Evidence
first_pr_check_missing_packet_recovers_without_a_resolvable_base(new, host-independent): a workspace with its own repo, detached HEAD and no base refs (the CI merge-ref shape). With no packet,--checkmust print the recovery with no--baseand not the base failure.ripr: first-pr: could not resolve a default base (no origin/main, origin/master, or local main/master found)...--basealways rendered it fails on the!stderr.contains("--base")assertion.first_pr_check_recovery_write_resolves_the_default_base(new, positive): in a repo with only localmaster, the flow is--check(recovery, no--base) → write (recordsmaster) →--check(ok).first-pr start-here packet is stale for current root/git preflight; rerun ... --base origin/main ...first_pr_write_command_renders_only_an_explicit_base(unit): an omitted base is not rendered; an explicit base is.first_pr_check_missing_packet_suggests_rooted_out_dirnow prints stderr when it fails. The Windows lane log did not show the actual stderr, which slowed this diagnosis.cargo xtask precommit: see the review comment.windows-cilabel; run linked in the review.Candidate Relationships
claude/win-firstpr-4285.first_pr_write_command: fix(0.11): bind generated commands to the selected repository root (#3999, #4001, #4000 partial) #4287 changes the--rootline tooptions.command_root(), and this PR moves the--base/--headlines just below it. The conflict is a trivial adjacent hunk for whichever lands second: keep fix(0.11): bind generated commands to the selected repository root (#3999, #4001, #4000 partial) #4287'scommand_root()and this PR's conditional--base. The two claims are otherwise independent, since fix(0.11): bind generated commands to the selected repository root (#3999, #4001, #4000 partial) #4287 does not touchfn first_prorcheck_first_pr. This PR merges alongside fix(0.11): bind generated commands to the selected repository root (#3999, #4001, #4000 partial) #4287.first-pr --checkmissing-packet recovery message regressed on main after c989c30 (cli_smoke repeated failure) #4285.Scope Classification
--checkmissing-packet recovery.Non-goals: rooted command binding (#4287); the TEMP-inside-checkout test trap in general.
Support-tier Impact
🤖 Generated with Claude Code
https://claude.ai/code/session_01Ui933un54X4MJRygfjwdjW
Generated by Claude Code