You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(xtask): recommendation_calibration test reads ./fixtures relative to cwd — races parallel with_temp_cwd tests since the #2132 RwLock change #2186
Observed during #2119 slice-2 verification (twice reproducible as scheduling-dependent): reports::recommendation::tests::recommendation_calibration_report_counts_fixture_expectations failed with read ./fixtures/boundary_gap/expected/recommendation-calibration/outcome-receipts/already-covered.json failed: No such file or directory on one full-suite run and passed on the next with an identical tree. Main's full suite passes in isolation and as a suite.
#2132 changed CWD_LOCK to RwLock so spawning tests run in parallel. Any test that reads repo files via a cwd-relative path (like this one reading ./fixtures/...) can now race another test that changed cwd via with_temp_cwd and restored it late — the read lands in the wrong directory depending on scheduling.
A suite that passes or fails by scheduling luck is a false discriminator in both directions: a PR can go red on an unrelated flake, and a real regression in this test could be masked by a lucky pass.
Evidence
Branch run 1: 1212 passed / 1 failed (this test, ENOENT on ./fixtures/boundary_gap/...).
Branch run 2 (identical tree): 1213 passed / 0 failed.
Main full suite: 1205 passed / 0 failed (same test included).
Fix (pick one)
Anchor the read at CARGO_MANIFEST_DIR/.. (crate-root-relative) instead of ./, matching how other tests resolve repo fixtures.
Have the test take the write guard (acquire_test_cwd_write_guard) so it cannot overlap a cwd mutation.
Option 1 is the durable fix; there may be sibling tests with the same cwd-relative reads — worth a grep for other \./fixtures or Path::new(\"fixtures\") in xtask tests.
#1714 - audit(goals): add fail-closed authority audit framework [merged] #1845 - fix(ci): unblock authority and policy gates [open] #2132 - perf(xtask): use RwLock for CWD_LOCK so spawning tests run in parallel (#2124) [merged] #2174 - security(analysis): reject path traversal in diff parser (#2099) [open] #2176 - perf(xtask): build ripr once and invoke the binary directly in fixtures and dogfood (#2110) [merged]
📝 Issue Planner
Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.
Create Plan
🧪 Issue enrichment is currently in open beta.
You can configure auto-planning by selecting labels in the issue_enrichment configuration.
To disable automatic issue enrichment, add the following to your .coderabbit.yaml:
issue_enrichment:
auto_enrich:
enabled: false
💬 Have feedback or questions? Drop into our discord!
Implemented in PR #2196 at exact head 550a322. The test now uses the absolute compile-time workspace root, so fixture reads cannot follow ambient cwd changes from parallel with_temp_cwd tests. Proof: focused test passes from repo root and xtask/; recommendation suite 8/8; xtask check and Clippy pass; cargo xtask precommit passes. cargo xtask check-pr is blocked by six inherited TypeScript rerun failures, reproduced unchanged on an untouched origin/main worktree.
Correction to the earlier lane note: PR #2196 was superseded and closed without merge. The issue was resolved by merged PR #2194 at 27c71f9, which serializes both recommendation-calibration fixture readers with the existing CWD write guard. Main contains that fix.
Confirmed live on CI: rust_repair_trust_report_is_reachable_from_dispatch failed in two unrelated PR branches (CX53 and GitHub-hosted runners) while passing locally — it calls set_current_dir(repository_root) with no guard and the executed report reads repo-relative paths, so it races any parallel cwd-sensitive test since #2132. Tiny unblock PR up: the test now holds acquire_test_cwd_write_guard() for the whole window. The broader #2186 fix (crate-root-anchored reads + sibling sweep) is still open; the failing-CI instance is covered by the unblock.
One genuinely unguarded site remained:recommendation_calibration_json_and_markdown_are_structured (xtask/src/reports/recommendation.rs) — passing only via the resolve_root_path → workspace_root() fallback, which a concurrent with_temp_cwd test could trick into the wrong tree. Fix + panic-safe with_repo_cwd hardening in #2204.
Verdict: after #2204 the suite is fully hardened against the cwd race per this audit. Recommend closing #2186 when #2204 merges; the durable prevention is the established pattern (guard any cwd-dependent test; prefer CARGO_MANIFEST_DIR-anchored paths for new helpers).
Activity
coderabbitai commentedon Jul 22, 2026
🔗 Related PRs
#1714 - audit(goals): add fail-closed authority audit framework [merged]
#1845 - fix(ci): unblock authority and policy gates [open]
#2132 - perf(xtask): use RwLock for CWD_LOCK so spawning tests run in parallel (
#2124) [merged]#2174 - security(analysis): reject path traversal in diff parser (
#2099) [open]#2176 - perf(xtask): build ripr once and invoke the binary directly in fixtures and dogfood (
#2110) [merged]📝 Issue Planner
Check the box below or use the
@coderabbitai plancommand to generate an implementation plan and prompts that you can use with your favorite coding assistant.🧪 Issue enrichment is currently in open beta.
You can configure auto-planning by selecting labels in the issue_enrichment configuration.
To disable automatic issue enrichment, add the following to your
.coderabbit.yaml:💬 Have feedback or questions? Drop into our discord!
refactor(xtask): extract the no-panic family from main.rs (#2119) (#2187
EffortlessSteven commentedon Jul 22, 2026
Implemented in PR #2196 at exact head 550a322. The test now uses the absolute compile-time workspace root, so fixture reads cannot follow ambient cwd changes from parallel with_temp_cwd tests. Proof: focused test passes from repo root and xtask/; recommendation suite 8/8; xtask check and Clippy pass; cargo xtask precommit passes. cargo xtask check-pr is blocked by six inherited TypeScript rerun failures, reproduced unchanged on an untouched origin/main worktree.
test(xtask): serialize recommendation fixture cwd access (#2194)
EffortlessSteven commentedon Jul 22, 2026
Correction to the earlier lane note: PR #2196 was superseded and closed without merge. The issue was resolved by merged PR #2194 at 27c71f9, which serializes both recommendation-calibration fixture readers with the existing CWD write guard. Main contains that fix.
EffortlessSteven commentedon Jul 22, 2026
Confirmed live on CI:
rust_repair_trust_report_is_reachable_from_dispatchfailed in two unrelated PR branches (CX53 and GitHub-hosted runners) while passing locally — it callsset_current_dir(repository_root)with no guard and the executed report reads repo-relative paths, so it races any parallel cwd-sensitive test since #2132. Tiny unblock PR up: the test now holdsacquire_test_cwd_write_guard()for the whole window. The broader #2186 fix (crate-root-anchored reads + sibling sweep) is still open; the failing-CI instance is covered by the unblock.fix(xtask): hold the cwd write guard in the dispatch report test (#2201)
EffortlessSteven commentedon Jul 22, 2026
Status update — residual audit after #2194 + #2201:
Suite-wide inventory (1185 test fns in
xtask/src, plus the compiled 1213-test binary run green from a foreign cwd):with_repo_cwd/with_temp_cwd).set_current_dirsites in test code: only the two guard helpers themselves plus the dispatch test fixed in fix(xtask): hold the cwd write guard in the dispatch report test (#2186) #2201.One genuinely unguarded site remained:
recommendation_calibration_json_and_markdown_are_structured(xtask/src/reports/recommendation.rs) — passing only via theresolve_root_path→workspace_root()fallback, which a concurrentwith_temp_cwdtest could trick into the wrong tree. Fix + panic-safewith_repo_cwdhardening in #2204.Verdict: after #2204 the suite is fully hardened against the cwd race per this audit. Recommend closing #2186 when #2204 merges; the durable prevention is the established pattern (guard any cwd-dependent test; prefer
CARGO_MANIFEST_DIR-anchored paths for new helpers).test(xtask): close the last unguarded cwd-relative read and make with…