Skip to content

fix(xtask): resolve the built ripr binary from cargo's artifact report (#14762) - #14766

Merged
EffortlessSteven merged 2 commits into
mainfrom
ripr-coding/14762-user-text-target-dir
Nov 15, 2026
Merged

EffortlessSteven merged 2 commits into
mainfrom
ripr-coding/14762-user-text-target-dir

Conversation

@EffortlessSteven

@EffortlessSteven EffortlessSteven commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

Governing issue or accepted claim: #14762
Acceptance delta (one sentence): cargo xtask check-user-text resolves the built ripr binary from cargo's own artifact report, so it runs from the relocated driver copy on Windows instead of failing with "built ripr binary not found".

Summary

check-user-text runs through the driver harness, which copies the running xtask image into <target-root>/ripr/drivers. resolve_ripr_binary joined that directory with ripr.exe, so on Windows the check failed before running any check:

xtask: built ripr binary not found at ...\target\ripr\drivers\ripr.exe

cargo build -p ripr --bin ripr had written target/debug/ripr.exe. The fix builds with --message-format=json-render-diagnostics and takes the executable cargo reports for the ripr bin, so the executable path and any --target layout come from cargo's answer rather than the running image's directory. --ripr remains the explicit bypass, and a failed build now reports the rendered compiler diagnostic rather than only cargo's summary line.

The profile is not taken from cargo's answer: --release has to be chosen before the build runs, so it is still inferred from current_exe().parent(). Under the relocated driver copy that is always false and the check builds debug. That is harmless for this check, whose runs are help/usage/check/pilot/doctor/status/repair/continue/explain/context/agent, and the code comment says so.

Swarm / Source Boundary

  • ordinary feature, analyzer, editor, docs, spec, fixture, badge, dependency, or repo-ops development for ripr-swarm
  • repair or follow-up for a same-repo swarm PR

This is ordinary repo-ops tooling for ripr-swarm; it does not change release or publication surfaces.

Source-of-truth Links

Proposal: #14762.
Spec: n/a; the check's contract is unchanged.
ADR: n/a.
Plan item: #14762 Windows ci-policy follow-up.
Governing issue or accepted claim: #14762.
Acceptance delta (one sentence): as above.

Candidate Relationships

Candidate branch (GitHub PR head is authoritative after publication): ripr-coding/14762-user-text-target-dir.
Stack parent or prerequisite PR (if any): none; branched from main 09ccb6d683.
Proposed replacement of PR (if any; not yet accepted): none.
Acceptance retained from a replaced candidate (if any): n/a.
Accepted winner and losing candidate disposition (when decided): this is the only candidate for the bounded tooling repair.

Scope

  • Resolve the built ripr executable from cargo build --message-format=json-render-diagnostics.
  • Keep --ripr as the explicit bypass and report the rendered diagnostic on a failed build.
  • Unit-test the artifact selection and the missing/foreign cases.

Scope Classification

  • One public contract

Production delta:

  • resolve_ripr_binary no longer joins current_exe().parent() with the binary name; it reads the compiler-artifact executable for the ripr bin.
  • built_ripr_executable parses the artifact report and requires the reported path to be a file.

Evidence/support delta:

  • Two unit tests in xtask/src/policy/user_text.rs, both fallible (Result<(), String>) so the no-panic policy holds.
  • Changelog fragment changelog.d/14762-user-text-target-dir.md.

Single acceptance criterion:

  • cargo xtask check-user-text runs to completion on Windows from the relocated driver copy.

Non-goals:

  • No change to the check's banned-term policy, its baseline or its report.
  • No claim that the bootstrap itself is wrong; the bootstrap was not measured.
  • The scratch-directory requirement (RIPR_USER_TEXT_SCRATCH outside the checkout) is an environment setup, not this defect, and is left as is.
  • The build profile is not re-derived from cargo's answer; see Summary.

Support-tier Impact

  • changes a README, release, docs, CLI, JSON, editor, CI, or package claim

Claim/proof notes:

  • This changes a maintainer tooling path and its changelog; no support-tier status changes.

Policy Impact

  • doc artifacts

Ledger or exception notes:

  • Only the changelog fragment changed; no allowlist or generated artifact changed. The repair removes the two expect calls instead of adding allowlist entries.

Proof

cargo xtask check-no-panic-family
cargo test -p xtask --bin xtask artifact
cargo xtask check-user-text
cargo fmt -p xtask --check
cargo xtask check-changelog-fragments
cargo xtask markdown-links
git diff --check

Result, failures, or skipped proof:

  • cargo xtask check-no-panic-family: red at 9c0ec3fd with exactly the two findings the review named (xtask/src/policy/user_text.rs:2010:9 and :2021:21, unallowed expect), exit 1; green at this head, exit 0, "Unallowed findings: none". Same instrument, same tree, only the repair differs.
  • cargo test -p xtask --bin xtask artifact: 143 passed, 0 failed, including cargo_artifact_json_names_the_ripr_executable and a_missing_or_foreign_artifact_is_not_the_ripr_binary.
  • cargo xtask check-user-text at this head: exit 0 on Windows with RIPR_USER_TEXT_SCRATCH set outside the checkout. Before the fix the same command failed with "built ripr binary not found at .../target/ripr/drivers/ripr.exe"; after the fix it reaches the report and passes.
  • cargo fmt -p xtask --check, check-changelog-fragments, markdown-links and git diff --check pass.
  • cargo xtask ci-policy did not complete on this host within 30 minutes, so it is not claimed; the focused command is the behavioural evidence.
  • Hosted workspace checks have not run on this branch and are not claimed locally.

Coverage limit: the two unit tests exercise built_ripr_executable, not resolve_ripr_binary; a regression that reverted the resolution to dir.join("ripr.exe") would still pass them. The behavioural cargo xtask check-user-text run is the evidence for the resolution path.

Claim Boundary

What may be claimed after this PR? What must not be claimed yet?

  • Claim only that the built-binary lookup no longer depends on the running image's directory. Do not claim the whole Windows ci-policy lane is green, that the bootstrap is wrong, or that the scratch-directory requirement is fixed.

Rollback

How can this PR be reverted safely?

  • Revert this single commit to restore the previous lookup; no data, generated artifact or migration is involved.

Spec-Test-Code Traceability

  • Spec: n/a.
  • Tests: cargo_artifact_json_names_the_ripr_executable, a_missing_or_foreign_artifact_is_not_the_ripr_binary.
  • Code: resolve_ripr_binary, built_ripr_executable in xtask/src/policy/user_text.rs.
  • Golden outputs: none affected.
  • Metrics: n/a.
  • ADR/learning: n/a.

Static Language Check

  • Static output avoids killed, survived, untested, proven, and adequate.
  • Unknowns include stop reasons where applicable.

CI Economics

  • LEM impact: n/a; no CI behavior changes.
  • Workflows touched: none.
  • Branch protection impact: none.
  • Failure mode caught: a relocated driver copy resolving the built binary beside itself.
  • Cheaper signal considered: the focused check-user-text command precedes the full ci-policy lane.
  • Required lanes affected: none.
  • Advisory lanes affected: none.
  • On-demand/release lanes affected: none.
  • Labels that alter behavior: none.
  • Artifact families affected: maintainer tooling only.
  • Rollback path: ordinary single-commit revert.

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 xtask check-static-language
  • cargo xtask check-spec-format

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary by CodeRabbit

  • Bug Fixes
    • Improved reliability of the user-text check when run from a relocated driver copy on Windows.
    • The check now uses the executable produced by the build and reports clearer errors when the build fails or the executable cannot be found.

Walkthrough

The user-text check now locates the built ripr executable from Cargo’s artifact output instead of deriving its path from the running xtask executable. The resolver reports build failures with stderr and returns an error when no usable ripr artifact exists.

Changes

ripr Binary Resolution

Layer / File(s) Summary
Parse and validate Cargo artifacts
xtask/src/policy/user_text.rs
built_ripr_executable selects an existing executable from a ripr compiler-artifact record. Tests cover valid records and cases with no usable executable.
Use Cargo artifacts in binary resolution
xtask/src/policy/user_text.rs, changelog.d/14762-user-text-target-dir.md
resolve_ripr_binary requests Cargo JSON artifact output and uses the selected path. Build failures include stderr, and missing usable artifacts return an error. The changelog states that the change allows the check to run from a relocated driver copy on Windows.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related issues

Merge Risk: Minimal · up to 44650

This changes how the user-text check locates the built ripr binary so it works from a relocated driver copy on Windows. It only affects a developer tooling check, and no concrete defect was found. Merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: xtask now resolves the built ripr binary from cargo's artifact report. It also carries the fix(xtask) prefix and the PR number. The title is specific and matches the c…
Description check Passed The description follows the repository template's main sections: Summary, Swarm / Source Boundary, Source-of-truth Links, Candidate Relationships, Scope, Scope Classification, Support-tier Impact, Pol…
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: Title check

Explanation

The title names the main change: xtask now resolves the built ripr binary from cargo's artifact report. It also carries the fix(xtask) prefix and the PR number. The title is specific and matches the changeset summary. The PR objectives cite a different PR number (#14766) than the title (#14762), but that does not make the title unrelated.

Full details: Description check

Explanation

The description follows the repository template's main sections: Summary, Swarm / Source Boundary, Source-of-truth Links, Candidate Relationships, Scope, Scope Classification, Support-tier Impact, Policy Impact, Proof, Claim Boundary, Rollback, Spec-Test-Code Traceability, Static Language Check, CI Economics, and Engineering Check. It explains the defect, the fix, the non-goals, and the proof. Some template items are missing. The Gates section lists only two of the many checkboxes. The Extension changes block is absent. The Support-tier Impact section ticks the 'changes a README, release, docs, CLI, JSON, editor, CI, or package claim' box, but the claim notes say no support-tier status changes, so the marking is inconsistent. The Policy Impact section ticks only 'doc artifacts', yet the change touches xtask Rust code and removes expect calls. The Proof section reports a red-then-green result for check-no-panic-family, but the coverage limit states that the unit tests do not exercise resolve_ripr_binary. The description is mostly complete. Minor fixes are still needed.

Resolution

Reconcile the Support-tier Impact and Policy Impact checkboxes with the actual change. Tick 'lint / Clippy' or 'no-panic' under Policy Impact if they apply, since the change removes expect calls. Leave the unrun gate boxes unchecked, or note which were run. Remove or mark the Extension changes block as n/a. Consider adding a test that exercises resolve_ripr_binary directly.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit reads Cargo’s trail,
To find ripr without fail.
Build records point the way,
Tests check paths that stay.
The user-text check hops on,
Then bounds through Windows dawn.

Recent review info

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: bc29fee6-2a4b-4b2d-a29f-e44135ce644f
Commits

Reviewing files that changed from the base of the PR and between 87ce2a5 and 44650f4.

Files selected for processing: 1

  • xtask/src/policy/user_text.rs

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

@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 found 2 potential issues.

Devin Review

Comment thread xtask/src/policy/user_text.rs Resolved
Comment thread xtask/src/policy/user_text.rs Resolved

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

REPAIR_REQUIRED — head 9c0ec3f

Blocking: the new test adds two expect( calls in xtask/src/policy/user_text.rs — expect("write fixture") and expect("ripr artifact is the executable"). cargo xtask check-no-panic-family scans xtask/src including test modules, and policy/no-panic-allowlist.toml has no entry for user_text.rs, so both are unallowed panic-family findings. The PR body's Engineering Check ("No new panic, unwrap, expect, todo, or unimplemented in tests") is false. Repair: return Result<(), String> from the test and use ?/ok_or, or add exact allowlist entries with explanations.

Non-blocking:

  • The Summary says "the target directory, profile and any --target layout come from cargo's answer". The path does; the profile does not. let release = dir.file_name().is_some_and(|name| name == "release") still derives the profile from current_exe().parent(), so under the relocated driver it is always false and the check builds debug. For this text scan that is harmless (the runs are help/usage/check/pilot/doctor/status/repair/continue/explain/context/agent, and debug vs release does not change their text), but the claim should be corrected.
  • On a build failure, --message-format=json puts the compiler diagnostics on stdout as compiler-message records; output.stderr carries only the summary ("could not compile ... due to 1 previous error"). The new error path therefore reports the summary, not the diagnostic. --message-format=json-render-diagnostics would render the diagnostic to stderr as well.
  • The two unit tests exercise built_ripr_executable but not resolve_ripr_binary; a regression that reverts the resolution to dir.join("ripr.exe") would still pass both. The behavioral cargo xtask check-user-text run is the evidence for the resolution path.

What I checked:

  • Artifact parse: a real cargo build reports the lib and bin both named ripr; the lib artifact has an empty executable, so the non-empty filter selects the bin. A cached build still emits the artifact with the executable. The existing a_missing_or_foreign_artifact_is_not_the_ripr_binary test covers the lib case.
  • -q does not suppress --message-format=json; the JSON is on stdout.
  • The changelog fragment's <!-- section: Internal / CI --> is a valid section.

Not checked: no crate build or Rust test run; the no-panic finding is from the policy source and the diff, not a gate run.

#14762)

`check-user-text` ran through the driver harness, which copies the running
xtask image into `<target-root>/ripr/drivers`. `resolve_ripr_binary` joined
that directory with `ripr.exe`, so on Windows the check failed with
"built ripr binary not found at .../target/ripr/drivers/ripr.exe" even though
`cargo build -p ripr --bin ripr` had written `target/debug/ripr.exe`.

Build with `--message-format=json` and take the executable cargo reports for
the `ripr` bin. That resolves the target directory, profile and any
`--target` layout from cargo's own answer instead of the running image's
directory, and keeps `--ripr` as the explicit bypass. A failed build now
reports cargo's stderr instead of a bare status.

Unit tests cover the artifact selection and the missing/foreign cases.
`cargo xtask check-user-text` now runs to completion on Windows (exit 0 with
`RIPR_USER_TEXT_SCRATCH` set outside the checkout).
@EffortlessSteven
EffortlessSteven force-pushed the ripr-coding/14762-user-text-target-dir branch from 9c0ec3f to 87ce2a5 Compare November 15, 2026 05:48

@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 87ce2a5 (one commit on 09ccb6d). Source scope only; no hosted lane has run on this branch.

What I checked:

  • The no-panic repair: xtask/src/policy/user_text.rs at this head has no .expect(, .unwrap(, panic!, todo! or unimplemented!. The test is now -> Result<(), String>; the fixture write uses map_err(...)? and the artifact lookup uses ok_or_else(...)?, so the same failure the two expect calls produced is returned as Err and the test harness still fails. The assert_eq!(found, fixture) assertion is unchanged.
  • --message-format=json-render-diagnostics: I ran a probe crate. On success, stdout still carries the compiler-artifact record with the executable and stderr is empty, so built_ripr_executable parses the same shape. On failure, stdout carries no artifact and stderr carries the rendered diagnostic, so the error path now reports the diagnostic rather than only the summary. The unit test parses a synthetic JSON string, so the flag change does not affect it.
  • The profile claim is corrected: the Summary now says the profile is not taken from cargo's answer, and the code comment explains that the relocated driver builds debug and why that is harmless for these runs.
  • The coverage limit is honest: the two unit tests exercise built_ripr_executable, not resolve_ripr_binary; the behavioural cargo xtask check-user-text run is the evidence for the resolution path.

Not checked: no crate build or Rust test run; the check-no-panic-family gate result is the Orchestrator's (exit 0), and I verified the source has no panic-family calls. The behavioural run is the Coder's, not repeated here.

@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 87ce2a5 (one commit on 09ccb6d). Source scope only; no hosted lane has run on this branch.

What I checked:

  • The no-panic repair: xtask/src/policy/user_text.rs at this head has no .expect(, .unwrap(, panic!, todo! or unimplemented!. The test is now -> Result<(), String>; the fixture write uses map_err(...)? and the artifact lookup uses ok_or_else(...)?, so the same failure the two expect calls produced is returned as Err and the test harness still fails. The assert_eq!(found, fixture) assertion is unchanged.
  • --message-format=json-render-diagnostics: I ran a probe crate. On success, stdout still carries the compiler-artifact record with the executable and stderr is empty, so built_ripr_executable parses the same shape. On failure, stdout carries no artifact and stderr carries the rendered diagnostic, so the error path now reports the diagnostic rather than only the summary. The unit test parses a synthetic JSON string, so the flag change does not affect it.
  • The profile claim is corrected: the Summary now says the profile is not taken from cargo's answer, and the code comment explains that the relocated driver builds debug and why that is harmless for these runs.
  • The coverage limit is honest: the two unit tests exercise built_ripr_executable, not resolve_ripr_binary; the behavioural cargo xtask check-user-text run is the evidence for the resolution path.

Not checked: no crate build or Rust test run; the check-no-panic-family gate result is the Orchestrator's (exit 0), and I verified the source has no panic-family calls. The behavioural run is the Coder's, not repeated here.

unused_result_ok is denied in the workspace lints, so the test's remove_file cleanup must bind the result with let _ rather than .ok().

@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
44650f4

cargo clippy -p xtask --all-targets exits 0 at this head; the only warning is the pre-existing unused_mut at crates/ripr/src/output/doctor.rs:2182. The one-line change replaces .ok() with let _ = on the fixture cleanup, and unused_result_ok is deny in the workspace lints.

@EffortlessSteven
EffortlessSteven added this pull request to the merge queue Nov 15, 2026
Merged via the queue into main with commit 8d9a69f Nov 15, 2026
21 checks passed
@EffortlessSteven
EffortlessSteven deleted the ripr-coding/14762-user-text-target-dir branch November 15, 2026 18:54
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.

1 participant