Skip to content

fix(init): name the commit-first step when the repository has no commits (#14253) - #14258

Merged
EffortlessSteven merged 1 commit into
mainfrom
claude/project-thread-gblhsc
Nov 17, 2026
Merged

EffortlessSteven merged 1 commit into
mainfrom
claude/project-thread-gblhsc

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Requested by Steven Zimmerman · project thread

Summary

  • ripr init right after git init (no commits yet) closed with "then ripr check to 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.
  • The closing Next: line now reads the shared probe_head_ref_state. An established unborn HEAD gets: "This repository has no commits yet, so ripr check has no base to compare: commit once, then edit a tracked source file and run ripr check."

Swarm / Source Boundary

  • ordinary feature, analyzer, editor, docs, spec, fixture, badge, dependency, or repo-ops development for ripr-swarm

Source-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 runnable ripr check; all other states keep their lines.

Candidate Relationships

Candidate branch (GitHub PR head is authoritative after publication): claude/project-thread-gblhsc
Stack parent or prerequisite PR (if any): none
Proposed replacement of PR (if any; not yet accepted): none. #14123 covers the related ripr doctor recommendation and does not touch init.

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_TIMEOUT becomes pub(crate) so init bounds the HEAD probe the same way doctor does.
  • Tests and a changelog fragment.

Scope Classification

  • One production behavior

Production delta:

  • One new wording branch in ripr init's closing line; one extra bounded git rev-parse (and symbolic-ref only 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 failing ripr check exit 2 asserted), then the ordinary line returns after one commit.
  • Unit test pinning all three wordings and the commit-before-check order.

Single acceptance criterion:

  • See the acceptance delta above.

Non-goals:

  • No change to ripr check, ripr doctor, config contents or exit codes. A damaged or unanswered HEAD probe is not diagnosed by init.

Support-tier Impact

  • changes a README, release, docs, CLI, JSON, editor, CI, or package claim (CLI human text of ripr init only)

Policy Impact

  • none

Proof

cargo fmt --check
CARGO_INCREMENTAL=0 CARGO_PROFILE_DEV_DEBUG=0 CARGO_PROFILE_TEST_DEBUG=0 cargo test -j2 -p ripr --test cli_smoke init_      # 34 passed
CARGO_INCREMENTAL=0 CARGO_PROFILE_DEV_DEBUG=0 CARGO_PROFILE_TEST_DEBUG=0 cargo test -j2 -p ripr --lib cli::commands::init   # 72 passed
cargo xtask check-static-language | check-no-panic-family | check-process-policy | check-file-policy | check-allow-attributes   # each pass

Result, failures, or skipped proof:

  • All of the above passed on 0d5eed5d. Manual run of the built binary in unborn, committed and non-Git roots printed the three expected lines.
  • Not run locally: 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

  • May claim: ripr init no longer recommends a ripr check that cannot run in a repository without commits. Must not claim: any change in analysis results.

Rollback

  • Revert the squash commit; no data or schema is involved.

Spec-Test-Code Traceability

  • Tests: crates/ripr/tests/cli_smoke.rs, crates/ripr/src/cli/commands/init.rs (unit)
  • Code: crates/ripr/src/cli/commands/init.rs

Static Language Check

  • Static output avoids killed, survived, untested, proven, and adequate.

CI Economics

n/a

Engineering Check

  • No new panic, unwrap, expect, todo, or unimplemented in production code.
  • No new panic, unwrap, expect, todo, or unimplemented in tests.
  • Errors are reported with actionable context.

Gates

  • cargo fmt --check
  • cargo xtask check-static-language
  • cargo xtask check-no-panic-family
  • cargo xtask check-allow-attributes
  • cargo xtask check-file-policy
  • remaining gates: hosted qualification

Generated by Claude Code

…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
@EffortlessSteven EffortlessSteven self-assigned this Nov 11, 2026
@coderabbitai

coderabbitai Bot commented Nov 11, 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 50 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 145 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

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: 468e0896-e86e-49a7-82f7-d37ca415d058
Commits

Reviewing files that changed from the base of the PR and between abf2c72 and 0d5eed5.

Files selected for processing: 4

  • changelog.d/14253-init-next-step-no-commits.md
  • crates/ripr/src/cli/commands/init.rs
  • crates/ripr/src/output/doctor.rs
  • crates/ripr/tests/cli_smoke.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Member Author

Security / cargo-deny is red on head 0d5eed5d (run 42993355316) and is not caused by this PR: it reports RUSTSEC-2026-0486 for rustix 1.1.5, the same failure every PR branch got in the last minutes, and this diff touches no manifest or lockfile. It is tracked in #14239 with the fix in #14240. Decision: the lockfile bump is not ported here, since a copy in each open PR would only conflict with #14240; this PR picks it up from main once that lands. The other lanes on this head are still running.


Generated by Claude Code

@devin-ai-integration devin-ai-integration 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.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@github-actions

Copy link
Copy Markdown
Contributor

ripr static exposure check

Commit 0d5eed5d07bf · run · advisory, static evidence only (not a mutation run).

#ripr agent static-advisory base=abf2c72db29b8717348596d9034d18af66479b10 findings=27 gaps=5 infection_unknown=1 propagation_unknown=4 reachable_unrevealed=1 static_unknown=11 weakly_exposed=10
weakly_exposed|crates/ripr/src/cli/commands/init.rs:805|match next|missing=No strong discriminator was detected|test=t1|id=probe:crates_ripr_src_cli_commands_init.rs:match_arm:0a9c5358
stages=reach:yes,infect:yes,propagate:yes,observe:yes,discriminate:weak
reachable_unrevealed|crates/ripr/src/cli/commands/init.rs:765|crate::analysis::probe_head_ref_state( root, Some(output::doctor::DOCTOR_TOOL_TI…|missing=No statically established oracle: assertion execution or macro binding is unesta…|test=t2|id=probe:crates_ripr_src_cli_commands_init.rs:return_value:88180ca3
stages=reach:yes,infect:yes,propagate:weak,observe:no,discriminate:no
weakly_exposed|crates/ripr/src/cli/commands/init.rs:806|InitNextStep::Ready =>|missing=No strong discriminator was detected|test=t1|id=probe:crates_ripr_src_cli_commands_init.rs:match_arm:c5ed521d
stages=reach:yes,infect:yes,propagate:yes,observe:yes,discriminate:weak
weakly_exposed|crates/ripr/src/cli/commands/init.rs:809|InitNextStep::NoCommits =>|missing=No strong discriminator was detected|test=t1|id=probe:crates_ripr_src_cli_commands_init.rs:match_arm:6f210f50
stages=reach:yes,infect:yes,propagate:yes,observe:yes,discriminate:weak
weakly_exposed|crates/ripr/src/cli/commands/init.rs:812|InitNextStep::NoGit =>|missing=No strong discriminator was detected|test=t1|id=probe:crates_ripr_src_cli_commands_init.rs:match_arm:37910f9a
stages=reach:yes,infect:yes,propagate:yes,observe:yes,discriminate:weak
t1=crates/ripr/src/cli/commands/init.rs:1499 next_step_line_names_commit_first_only_for_a_repository_without_commits unknown miss=assertion_admission_unproven
t2=crates/ripr/src/cli/commands/init.rs:1686 mcp_apply_merges_on_disk_and_is_idempotent unknown miss=assertion_inert
limits=infection_unknown:1,propagation_unknown:4,static_unknown:11,weakly_exposed:6
next=ripr explain --root . --base abf2c72db29b8717348596d9034d18af66479b10 --committed --mode draft --format agent probe:crates_ripr_src_cli_commands_init.rs:match_arm:0a9c5358
verify=refused|outcome=complete_with_findings|findings=27|exposed=0|reason=gaps_remain

Took 63s.

@EffortlessSteven
EffortlessSteven added this pull request to the merge queue Nov 13, 2026

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 from probe_head_ref_state. Unborn is returned only when rev-parse --verify --quiet HEAD fails with code 1 and empty output and symbolic-ref HEAD names a non-empty refs/heads/*; Unknown/Unreadable keep 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; the Ready and NoGit strings are the previous text verbatim, and the command list still offers doctor+check for NoCommits (the check is the step after the commit).
  • DOCTOR_TOOL_TIMEOUT is widened to pub(crate) only; no behavior change.
  • Tests: the unit test pins all three wordings and the commit-before-check ordering; the cli_smoke test builds a real unborn repository, asserts ripr check exits 2 there, asserts init names 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.

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 13, 2026

Copy link
Copy Markdown
Member Author

Native merge-group result handoff for the existing owner, not a new source review or approval.

Head remains 0d5eed5d07bfc3bff6791c46f87b40b3cc52bf19. Run 43521967142, group 2966bd097fe93c749c80586aac1c807a099b9b9c, completed with Rust gates, all four test shards and the shard verifier successful, but Ripr Rust Small Result failed its “Recheck source review disposition for the admitted head” step at 23:35:28 UTC. The log says source review attestation refused, using trusted admission source 111c7809aff7e2ddc1cd65bad3e18f084df16116. GitHub removed the queue entry at 23:35:53 UTC.

Actual current-head carriers:

  • 5856375576: COMMENTED, first line SOURCE_REVIEW_READY, Nov 11 09:12:58 UTC.
  • 5889684456: later COMMENTED review from the same login, first line VERDICT: APPROVE 0d5eed5d…, Nov 13 10:50:19 UTC; no first-line readiness marker.

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 EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 from probe_head_ref_state. Unborn is returned only when rev-parse --verify --quiet HEAD fails with code 1 and empty output and symbolic-ref HEAD names a non-empty refs/heads/*; Unknown/Unreadable keep 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; the Ready and NoGit strings are the previous text verbatim, and the command list still offers doctor+check for NoCommits (the check is the step after the commit).
  • DOCTOR_TOOL_TIMEOUT is widened to pub(crate) only; no behavior change.
  • Tests: the unit test pins all three wordings and the commit-before-check ordering; the cli_smoke test builds a real unborn repository, asserts ripr check exits 2 there, asserts init names 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.

@EffortlessSteven

Copy link
Copy Markdown
Member Author

Campaign disposition: held behind the shared cargo-deny gate repair

This PR carries merge-ready and does not meet the landing conditions on its exact head 0d5eed5d07bfc3bff6791c46f87b40b3cc52bf19. Two separate gaps, neither of them this PR's own diff:

  1. cargo-deny is red on the shared advisory, not on this change. Run 42993355316 fails with error[unsound] / RUSTSEC-2026-0486 on xattr v1.6.1 (rustix getxattr family). origin/main still pins xattr 1.6.1, so every open PR is red on the same check. One gate repair is in flight for the whole repository (owner: coding ripr-swarm, tracked on Pre-0.11 dependency and security audit (cargo-deny, npm audit, input-path review) #11475); this PR is not to be repaired in isolation.
  2. The last merge-group ejection was a carrier-grammar refusal, not a code refusal. Run 43521967142 had Rust gates, all four shards and the shard verifier green, then Ripr Rust Small Result refused at "Recheck source review disposition for the admitted head" (source review attestation refused). The current-head carriers are 5856375576 (SOURCE_REVIEW_READY first line, Nov 11) and 5889684456 (VERDICT: APPROVE 0d5eed5d… first line, Nov 13). The gate needs the dual form the fix(stub): reuse classified placement for --at --kind (#13383) #13401 repair established: SOURCE_REVIEW_READY on line 1 and the verdict bound to the exact head.

Disposition: no per-PR repair. Held behind the repository-wide xattr gate repair; once that lands and this head re-runs green, a proper dual-form carrier is posted at the then-current head and the PR is requeued. merge-ready stays; the admission gate already refuses a red head, so it cannot land as-is.

Governing issue: #14253.

@EffortlessSteven
EffortlessSteven added this pull request to the merge queue Nov 16, 2026
@EffortlessSteven

Copy link
Copy Markdown
Member Author

Disposition corrected: enqueued, not held behind a shared gate

The 2026-11-16T15:23Z disposition said this PR was held behind a repository-wide xattr gate repair. That reading was wrong, and the evidence is now specific:

  • RUSTSEC-2026-0486 is filed against rustix, patched >=1.1.6. origin/main resolves rustix 1.1.6; this branch's Cargo.lock still resolves rustix 1.1.5. The xattr 1.6.1 crate is the same on both.
  • This branch does not modify Cargo.lock (changed files: init.rs, doctor.rs, cli_smoke.rs, one changelog fragment), so the merge result keeps main's patched rustix 1.1.6. Merging does not regress the advisory.
  • cargo-deny is not a required check. The only required context is Ripr Rust Small Result, which is SUCCESS at 0d5eed5d07bfc3bff6791c46f87b40b3cc52bf19 (run 42993355512).
  • Current-head review: VERDICT: APPROVE 0d5eed5d… (2026-11-13) plus the dual-form SOURCE_REVIEW_READY VERDICT: APPROVE carrier (2026-11-14). Zero unresolved threads.

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.

Merged via the queue into main with commit 6ec6846 Nov 17, 2026
79 of 81 checks passed
@EffortlessSteven
EffortlessSteven deleted the claude/project-thread-gblhsc branch November 17, 2026 03:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants