Repository navigation
fix(init): name the commit-first step when the repository has no commits (#14253) - #14258
Conversation
…its (#14253) `ripr init` right after `git init` closed by recommending `ripr check`, which has no base in a repository without commits and exits 2. The closing Next line now uses the shared HEAD probe: an established unborn HEAD gets the commit-first step; a resolved, damaged or unanswered HEAD keeps the ordinary line and leaves diagnosis to `ripr doctor`. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016EQRViwqsrFf5k7JsKZUff
|
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 50 minutes. View limit details
|
There was a problem hiding this comment.
Code Review
This pull request improves the user experience of ripr init when run in a newly initialized Git repository that does not have any commits yet. Instead of recommending the user to run ripr check (which fails with exit code 2 when there are no commits), it detects the unborn HEAD state and instructs the user to make an initial commit first. This is implemented by introducing an InitNextStep enum, updating the initialization flow, and adding corresponding unit tests. There are no review comments, so I have no feedback to provide.
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY
reviewed_head_sha: 0d5eed5
integration_basis: main abf2c72 (branch cut from it; no conflict reported)
claim_boundary: #14253. In a work tree with an established unborn HEAD, the closing Next line of ripr init names the commit-first step before a runnable ripr check. No change to check, doctor, config contents or exit codes.
changed_surfaces_and_semantic_owners_inspected:
- crates/ripr/src/cli/commands/init.rs apply_init_plan: the closing line is the only consumer of the new InitNextStep. HEAD state comes from the shared analysis::probe_head_ref_state, the same owner doctor and the default-base error use, so init adds no second detector.
- crates/ripr/src/output/doctor.rs: DOCTOR_TOOL_TIMEOUT visibility only (pub(crate)); no behavior change.
- Whole diff read (4 files). No doc, golden, schema or editor surface quotes the changed line (git grep of the old sentence finds only init.rs and the new test).
blocking_findings: none
non_blocking_suggestions: none
challenge:
- Old behavior against the new oracle: before the change the binary printed the branch-vs-default sentence in an unborn repository (captured in #14253), and the smoke test requires "no commits yet" plus "commit once" on the Next line and the absence of that sentence, so the old output cannot satisfy it.
- Fixture construction is asserted: the test checks git rev-parse --verify HEAD is unsuccessful and that ripr check exits 2 there before reading init output; the alternate case (one commit, init --force) must print the ordinary line.
- Unknown and unreadable HEAD states map to the ordinary line on purpose, so init never claims "no commits" without git establishing it.
proof_and_ci_observed:
- Local on this head: cargo fmt --check; cli_smoke init_ filter 34 passed; lib cli::commands::init 72 passed; xtask check-static-language, check-no-panic-family, check-process-policy, check-file-policy, check-allow-attributes each pass.
- Rendered behavior: built binary run by hand in unborn, committed and non-Git roots, with and without --root; three expected lines.
proof_or_review_missing:
- Hosted qualification on this head has not run yet. Workspace Clippy, the full test suite and cargo xtask precommit were not run locally (cloud container memory limit).
- Windows and macOS execution of the new smoke test is unobserved; it uses only git and the binary through existing helpers.
- External review providers: CodeRabbit reported neutral, ub-review still running at review time.
affected_currentness_dimensions: production implementation, test stimulus, test oracle, public claim (CLI human text), candidate head identity.
residual_assumptions_and_non_claims: static wording change only; no analysis result changes. This is the source and oracle pass; the final merge pass follows hosted results.
Generated by Claude Code
|
Generated by Claude Code |
ripr static exposure checkCommit Took 63s. |
EffortlessSteven
left a comment
There was a problem hiding this comment.
VERDICT: APPROVE 0d5eed5 — no blocking findings on this head.
Exact head 0d5eed5d07bfc3bff6791c46f87b40b3cc52bf19; merge-tree with current main 867fb088 is clean (364c1ddf).
Inspected the complete diff (4 files, +150/-13):
init.rs: the closing advice now comes fromprobe_head_ref_state.Unbornis returned only whenrev-parse --verify --quiet HEADfails with code 1 and empty output andsymbolic-ref HEADnames a non-emptyrefs/heads/*;Unknown/Unreadablekeep the ordinary route, so a damaged or unanswered probe is not misreported as a first-commit repository.- The three wordings are split into
init_next_step_line; theReadyandNoGitstrings are the previous text verbatim, and the command list still offersdoctor+checkforNoCommits(the check is the step after the commit). DOCTOR_TOOL_TIMEOUTis widened topub(crate)only; no behavior change.- Tests: the unit test pins all three wordings and the commit-before-check ordering; the
cli_smoketest builds a real unborn repository, assertsripr checkexits 2 there, assertsinitnames the commit-first step, then commits and asserts the ordinary line returns.
Qualification this head still lacks: cargo-deny is red (run 42993355316) on RUSTSEC-2026-0486 (xattr unsound advisory), a workspace dependency advisory unrelated to this diff. The hosted Rust gates and shards are green. No unresolved review threads.
|
Native merge-group result handoff for the existing owner, not a new source review or approval. Head remains Actual current-head carriers:
These are the observed carrier texts and failure, not a reproduced parser diagnosis. No newer response to this failure was visible when checked. This receipt does not authorize a bypass or replace source review. No code, review disposition, CI rerun or requeue changed. |
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY
VERDICT: APPROVE 0d5eed5
Exact head 0d5eed5d07bfc3bff6791c46f87b40b3cc52bf19; merge-tree with current main 867fb088 is clean (364c1ddf).
Inspected the complete diff (4 files, +150/-13):
init.rs: the closing advice now comes fromprobe_head_ref_state.Unbornis returned only whenrev-parse --verify --quiet HEADfails with code 1 and empty output andsymbolic-ref HEADnames a non-emptyrefs/heads/*;Unknown/Unreadablekeep the ordinary route, so a damaged or unanswered probe is not misreported as a first-commit repository.- The three wordings are split into
init_next_step_line; theReadyandNoGitstrings are the previous text verbatim, and the command list still offersdoctor+checkforNoCommits(the check is the step after the commit). DOCTOR_TOOL_TIMEOUTis widened topub(crate)only; no behavior change.- Tests: the unit test pins all three wordings and the commit-before-check ordering; the
cli_smoketest builds a real unborn repository, assertsripr checkexits 2 there, assertsinitnames the commit-first step, then commits and asserts the ordinary line returns.
Qualification this head still lacks: cargo-deny is red (run 42993355316) on RUSTSEC-2026-0486 (xattr unsound advisory), a workspace dependency advisory unrelated to this diff. The hosted Rust gates and shards are green. No unresolved review threads.
Campaign disposition: held behind the shared cargo-deny gate repairThis PR carries
Disposition: no per-PR repair. Held behind the repository-wide Governing issue: #14253. |
Disposition corrected: enqueued, not held behind a shared gateThe 2026-11-16T15:23Z disposition said this PR was held behind a repository-wide
Every landing condition holds at the exact head, so this is not a waiting state. Enqueued through the native merge queue (position 43). The queue restacks and re-runs the full gate; a merge_group failure would be a real signal, not a stale-lock artifact. Governing issue: #14253. |
Requested by Steven Zimmerman · project thread
Summary
ripr initright aftergit init(no commits yet) closed with "thenripr checkto analyze your branch against its default branch". That check has no base in such a repository and exits 2, so the very first suggested step failed.Next:line now reads the sharedprobe_head_ref_state. An established unbornHEADgets: "This repository has no commits yet, soripr checkhas no base to compare: commit once, then edit a tracked source file and runripr check."Swarm / Source Boundary
ripr-swarmSource-of-truth Links
Governing issue or accepted claim: #14253
Acceptance delta (one sentence): in a work tree with an established unborn
HEAD,ripr init's closing line names the commit-first step before a runnableripr check; all other states keep their lines.Candidate Relationships
Candidate branch (GitHub PR head is authoritative after publication):
claude/project-thread-gblhscStack parent or prerequisite PR (if any): none
Proposed replacement of PR (if any; not yet accepted): none. #14123 covers the related
ripr doctorrecommendation and does not touchinit.Scope
crates/ripr/src/cli/commands/init.rs:InitNextStep+init_next_step_line, split from the probes.crates/ripr/src/output/doctor.rs:DOCTOR_TOOL_TIMEOUTbecomespub(crate)soinitbounds the HEAD probe the same way doctor does.Scope Classification
Production delta:
ripr init's closing line; one extra boundedgit rev-parse(andsymbolic-refonly when it fails) after files are written.Evidence/support delta:
cli_smoke::init_next_step_names_commit_first_in_a_repository_without_commits: real binary, real unborn repository (fixture's unborn state asserted, the failingripr checkexit 2 asserted), then the ordinary line returns after one commit.Single acceptance criterion:
Non-goals:
ripr check,ripr doctor, config contents or exit codes. A damaged or unanswered HEAD probe is not diagnosed byinit.Support-tier Impact
ripr initonly)Policy Impact
Proof
Result, failures, or skipped proof:
0d5eed5d. Manual run of the built binary in unborn, committed and non-Git roots printed the three expected lines.cargo xtask precommit, workspace Clippy and the full test suite (the 15 GB cloud container OOMs on them). Hosted qualification is the proof for those.Claim Boundary
ripr initno longer recommends aripr checkthat cannot run in a repository without commits. Must not claim: any change in analysis results.Rollback
Spec-Test-Code Traceability
crates/ripr/tests/cli_smoke.rs,crates/ripr/src/cli/commands/init.rs(unit)crates/ripr/src/cli/commands/init.rsStatic Language Check
killed,survived,untested,proven, andadequate.CI Economics
n/a
Engineering Check
panic,unwrap,expect,todo, orunimplementedin production code.panic,unwrap,expect,todo, orunimplementedin tests.Gates
cargo fmt --checkcargo xtask check-static-languagecargo xtask check-no-panic-familycargo xtask check-allow-attributescargo xtask check-file-policyGenerated by Claude Code