Skip to content

fix(tests): gate unix-only recovery_texts helper behind cfg(unix) - #5403

Merged
EffortlessSteven merged 1 commit into
mainfrom
fix/win-clippy-cfg-unix-helper
Oct 4, 2026
Merged

EffortlessSteven merged 1 commit into
mainfrom
fix/win-clippy-cfg-unix-helper

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

What

One-line inherited repair: recovery_texts in
crates/ripr/tests/generated_review_workflow.rs is used only by the
#[cfg(unix)] preflight-quoting test from #5188, so on Windows it is dead
code and fails clippy -D warnings, breaking local cargo xtask precommit
on 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

  • Before (main 434d7243a, Windows): cargo clippy -p ripr --all-targets -- -D warnings fails with function recovery_texts is never used
    (generated_review_workflow.rs:1243).
  • After: cargo clippy -p ripr --test generated_review_workflow -- -D warnings → exit 0.
  • No behavior change on any platform: the helper still compiles wherever its
    caller does.

Non-goals

No product-code change; no test-logic change.

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.

@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 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.

@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

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
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 5749b2c9-a4ba-49f8-a99b-273877511a7b
📥 Commits

Reviewing files that changed from the base of the PR and between 2274ebb and cd1db83.

📒 Files selected for processing (1)
  • crates/ripr/tests/generated_review_workflow.rs
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

Limit details: You’ve used all 10 included reviews currently available.


Summary by CodeRabbit

  • Tests
    • Updated platform-specific test setup so Unix-only recovery checks are compiled only on Unix systems, avoiding compilation of that test code on Windows.
    • This change affects test builds only; it does not change user-facing behavior or application features.

Walkthrough

The test-only recovery_texts helper now has a Unix-only compilation condition, matching its Unix-gated caller.

Changes

Test portability

Layer / File(s) Summary
Gate the recovery helper
crates/ripr/tests/generated_review_workflow.rs
The recovery_texts helper is compiled only on Unix. Its behavior is unchanged.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~2 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to cd1db

The platform gates match, so this change introduces no identified merge-blocking risk.

Architecture Summary

Architecture risk: 🔵 Low · up to cd1db

The change affects 1 system.

Changed systems: crates

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — crates (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in crates/ripr/tests/generated_review_workflow.rs: Added a Unix-only compilation attribute to recovery_texts; its behavior is unchanged.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the change, reported proof, and non-goals, but it omits most sections required by the repository template. 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 Tr…
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the Unix-only cfg change to the recovery_texts helper.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 1 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Resolution

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.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Usage-based review receipt

  • Mode: Continue automatically
  • Reviewed files: 1
  • Waived: $0.25 (charged $0.00)
  • View usage details

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
“Unix,” said the helper, “is where I’ll wait.”
The caller was gated, so the match is complete
No Windows compile brings this helper to meet
Then the rabbit hopped off on quiet feet

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions 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.

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 warnings exit 0 on the post-fix tree, but --all-targets is not run; ripr sensor failed (exit 2) leaving the broader clippy witness unverified.

@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.

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

@EffortlessSteven
EffortlessSteven merged commit 3c4c72c into main Oct 4, 2026
40 of 41 checks passed
@EffortlessSteven
EffortlessSteven deleted the fix/win-clippy-cfg-unix-helper branch October 4, 2026 08:21
EffortlessSteven added a commit that referenced this pull request Oct 4, 2026
EffortlessSteven added a commit that referenced this pull request Oct 4, 2026
…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.
EffortlessSteven added a commit that referenced this pull request Oct 4, 2026
…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.
EffortlessSteven added a commit that referenced this pull request Oct 4, 2026
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.
EffortlessSteven added a commit that referenced this pull request Oct 4, 2026
* 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant