Repository navigation
fix(tests): gate unix-only recovery_texts helper behind cfg(unix) - #5403
Conversation
The sole caller is the #[cfg(unix)] preflight-quoting test from #5188, so on Windows the helper is dead code and fails clippy -D warnings (dead_code), breaking local precommit on main. Linux CI never saw it because the test compiles there.
There was a problem hiding this comment.
Code Review
This pull request adds the #[cfg(unix)] attribute to the recovery_texts helper function in crates/ripr/tests/generated_review_workflow.rs. This change ensures that the helper is only compiled on Unix systems, preventing dead code warnings on Windows where its sole caller is gated. No review comments were provided.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (1)
🔗 Linked repositories identifiedCodeRabbit considers these linked repositories for cross-repo context during reviews:
Limit details: You’ve used all 10 included reviews currently available. Summary by CodeRabbit
WalkthroughThe test-only ChangesTest portability
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~2 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The platform gates match, so this change introduces no identified merge-blocking risk. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 1 system. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Description checkResolution Add the missing template sections and required details: Swarm / Source Boundary; Source-of-truth Links; Candidate Relationships; Scope and Scope Classification; Support-tier Impact; Policy Impact; Claim Boundary; Rollback; Spec-Test-Code Traceability; Static Language Check; CI Economics (or mark n/a); Engineering Check; and Gates. Mark applicable checkboxes and state results or n/a where relevant.
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Usage-based review receipt
Note This review exceeded your plan’s limits and used usage-based reviews—free during trial, billed after paid activation unless disabled. Manage usage-based reviews. A rabbit checked the test’s small gate Comment |
There was a problem hiding this comment.
Decision
- Needs verification checks before upstream.
Verification questions
- Confirm existing PR-body proof (Windows clippy -D warnings before/after) is the minimum cheap evidence that would change reviewer confidence; no extra proof needed.
- Confirm cfg(unix) attribute is added above fn recovery_texts at the same indentation as the fn signature (line ~1243); the helper body and signature are unchanged.
Refuted
- Red/green test proof is the strongest lens for this PR.; refuted because: No test code or assertion logic changed; only a compile-time cfg gate and doc comment were added. Clippy green proof is the appropriate witness, not test discrimination.
- This change weakens test oracle strength by making the helper conditionally absent.; refuted because: Helper is a test-local string-extraction utility, not an assertion; its presence/absence does not alter any expected output. Oracle discrimination lives in the calling test's assertions, which are untouched.
- Heavy sanitizer/mutation/coverage witness is needed to gain confidence in a single-line
#[cfg(unix)]attribute gate.; refuted because: gh-runner profile skips heavy witnesses; the change is mechanical and not UB-adjacent, so heavy proof adds no marginal confidence beyond the cheap clippy run on the touched test target.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
- Proof evidence is partial: PR body shows
cargo clippy -p ripr --test generated_review_workflow -- -D warningsexit 0 on the post-fix tree, but--all-targetsis not run; ripr sensor failed (exit 2) leaving the broader clippy witness unverified.
EffortlessSteven
left a comment
There was a problem hiding this comment.
Self-review (author COMMENT, not approval): one-line platform-gating fix.
reviewed_head_sha: cd1db839607dbc31dc10fc3dc4d931a6257ebdfb
integration_basis: origin/main 434d7243a
claim_boundary: gate the unix-only test helper behind cfg(unix) so Windows clippy stays green; no behavior change anywhere
changed_surfaces_and_semantic_owners_inspected: crates/ripr/tests/generated_review_workflow.rs (test helper recovery_texts, its caller test)
blocking_findings: none
non_blocking_suggestions: none
refuted_or_stale_findings: none
proof_and_ci_observed:
- caller audit: grep shows exactly one caller at line 1157 inside generated_first_pr_preflight_recovery_commands_quote_root_and_refs, which carries #[cfg(unix)] (line 1091); helper had no gate, so Windows compiled a dead function and failed -D warnings
- wrong-behavior challenge: if any non-unix caller existed, the Linux build would now fail (helper compiled out); both hosted Linux gate runs (37186511420, 37186504717) are green, and grep confirms a single caller
- local: cargo clippy -p ripr --test generated_review_workflow -- -D warnings exit 0 on Windows (was: dead_code error at 1243)
- required check Ripr Rust Small Result: success on the exact head (2 postings); zero review threads
proof_or_review_missing: none for this scope
affected_currentness_dimensions: production implementation (test-only), candidate head identity; no conflict, no generated output, no public claim
residual_assumptions_and_non_claims: none; the fix is behavior-neutral by construction (compiles the helper exactly where its caller compiles)
disposition: REVIEW_READY
…anded the same repair)
…erited repair) Same Windows-host clippy pattern as the recovery_texts gate main landed in #5403: the import's only caller is '#[cfg(unix)]', so on Windows hosts cargo clippy --workspace --all-targets -D warnings fails with unused import. File byte-identical to origin/main (landed in 9acf0b6) before this change; reproduced on the untouched base before attributing.
…r, doctor unborn-HEAD advisory (#5266 #5258 #5259) (#5398) * fix(cli): discoverable help --json catalog, real untracked-file repair, doctor unborn-HEAD advisory (#5266 #5258 #5259) - #5266: the ripr --help More: block names 'ripr help --json' (versioned machine command catalog), and the cmd:help catalog row reports json_support: true with --json named in its limitations, so the catalog cannot contradict the parser that accepts the route. - #5258: the uncommitted-changes note stops offering --worktree as the remedy for untracked files, which the flag never sees. The tracked case is qualified as 'staged and unstaged tracked edits' (matching check --help) in the human note, the triage safe-action line, and the GitHub warning; when untracked routed source/test files exist, the note names them and the real repair (git add, or git add -N intent-to-add, then --worktree, or --diff PATH). The untracked subset is typed end to end: porcelain parse -> overlay -> AnalysisResult -> CheckOutput, cleared with the flag for non-committed-history modes. GitHub goldens updated and added; QUICKSTART and RIPR-SPEC-0083 quotes reconciled. - #5259: inside a confirmed work tree, doctor probes one 'git rev-parse --verify HEAD' and records the advisory git_head check for an unborn HEAD, reusing the commit-first repair wording from the check-time default-base error; DoctorFirstCommand::UnbornHead reroutes the recommended first command to the commit-first guidance plus the repository-free full-repo scan instead of a ripr check that exits 2 there. Advisory never fails the run and is printed only when recorded. #5265 needs no code: a genuinely missing --root already exits 2 with a typed refusal via ensure_command_root; the issue transcript's path existed on disk as a leftover scratch directory. * fix(xtask): lint-clean synthetic exit-status widening (inherited repair) cargo clippy --workspace --all-targets (clippy 0.1.95, rust 1.95.0) failed on origin/main code this branch did not touch: pr_evidence.rs:1283 cast_sign_loss on 'code as u32'. Reproduced on the exact base before attributing; applied the lint's own cast_unsigned() spelling to unblock the check-fast clippy gate. * fix(tests): gate recovery_texts behind unix like its only caller (inherited repair) generated_review_workflow.rs is byte-identical to origin/main on this branch; its '#[cfg(unix)]' test is the sole caller of recovery_texts, so on Windows hosts clippy --workspace --all-targets -D warnings fails with dead_code. Reproduced on the untouched base file before attributing. * fix(output): address review: unborn verdict claims nothing on probe failure; escape repository-supplied paths (#5398 review) Three findings from the PR review, each verified against source: - unborn_head inverted its own fail-open: '!ok_and(success)' returned TRUE when the git probe never answered (spawn failure, deadline), adding a false git_head advisory and rerouting the first command in a healthy repository. Restructured into the pure three-arm probe_says_unborn (Some(false) is the only unborn arm) with a discriminating unit test. - The GitHub unanalyzed-working-tree warning now interpolates repository-supplied untracked path names, so the whole message passes through escape_data like the neighboring warnings; a hostile filename cannot start another workflow command. New test with a '%0A::warning' payload path; the plain-text goldens are unchanged bytes. - The human note escapes each named path with the shared escape_terminal_display, so an ESC-bearing filename cannot inject terminal control. New test with a control-byte path. * fix(xtask): gate ci_summary_first_run_missing import behind unix (inherited repair) Same Windows-host clippy pattern as the recovery_texts gate main landed in #5403: the import's only caller is '#[cfg(unix)]', so on Windows hosts cargo clippy --workspace --all-targets -D warnings fails with unused import. File byte-identical to origin/main (landed in 9acf0b6) before this change; reproduced on the untouched base before attributing. * merge origin/main: drop the duplicate gated import (main's #5426 is the canonical repair) Both sides gated the ci_summary_first_run_missing import at different lines, so the textual merge kept both and unix builds hit E0252 (caught by the hosted Rust gates run on ee0f214). Keep main's version.
Keep exact fixture path, condition and listed-ID acceptance. Add wrong-path/condition controls, owned staging cleanup evidence, disable Cargo-bin caching and checkout credential persistence, and record the behavior change. Adopt the exact cfg(unix) helper annotation already merged by #5403 (3c4c72c); this repairs inherited Windows branch parity, not selector behavior.
* fix(cli): explain malformed finding location selectors Add post-miss syntax guidance without changing selector matching, exit codes, JSON output, or fresh-workspace retry scope. Add unit and CLI controls for malformed locations, unknown IDs, unmatched valid locations, and valid retries. Refs #5252 (item 6 only) * test(cli): assert complete selector retry command Compare the complete advertised backticked listing command with the expected root, diff, and JSON flag, using the existing test quoting helper. Addresses #5581 review comment4178646846. * fix(cli): keep repo-probe selector IDs opaque Exempt the repository-probe namespace from location syntax hints. Add the retained producer ID and collision suffix to unit controls, and require the producer-shaped unmatched ID to keep ordinary explain/context lookup recovery. Refs #5252 item6; repairs the #5581 opaque-ID boundary. * ci: replay selector recovery with exact-head Windows CLI * ci: repair canonical selector replay and staging lifecycle Keep exact fixture path, condition and listed-ID acceptance. Add wrong-path/condition controls, owned staging cleanup evidence, disable Cargo-bin caching and checkout credential persistence, and record the behavior change. Adopt the exact cfg(unix) helper annotation already merged by #5403 (3c4c72c); this repairs inherited Windows branch parity, not selector behavior.
What
One-line inherited repair:
recovery_textsincrates/ripr/tests/generated_review_workflow.rsis used only by the#[cfg(unix)]preflight-quoting test from #5188, so on Windows it is deadcode and fails
clippy -D warnings, breaking localcargo xtask precommiton main. Gate it behind
#[cfg(unix)].Linux CI never saw this (the test compiles there); found while shaping PR
#5240, routed here separately per repo policy for untouched-code failures.
Proof
434d7243a, Windows):cargo clippy -p ripr --all-targets -- -D warningsfails withfunction recovery_texts is never used(
generated_review_workflow.rs:1243).cargo clippy -p ripr --test generated_review_workflow -- -D warnings→ exit 0.caller does.
Non-goals
No product-code change; no test-logic change.