Repository navigation
fix(test-host): compare paths in one spelling at the shared owners (#7937) - #8030
Conversation
…7937) Fourteen lib tests failed deterministically on Windows at a Linux-green main, all one defect family: the same path spelled three host-dependent ways, leaking at four boundaries. - ManifestInventory::lookup_test_owners anchors through the shared plain-drive spelling, so canonicalized (verbatim) workspace roots compare against cargo's plain echoed keys and the test = false, required-features and harness = false metadata gates hold on every host. - gap_source_subject compares verbatim tokens in the plain family and plain-drives the strip roots, so a canonicalized gap-ledger root can derive a stamp whose absent files carry digest: null. - Diff-path confinement re-joins the segments git spelled with '/', so ChangedFile.path and every probe identity cloned from it keep the diff's own spelling on both hosts. - bound_snapshot_verify_spec rebuilds the display with the same root_display builder that produced it, so a rooted selected root no longer fails the producer's own byte-match on Windows. - The explain and LSP expectations call the same binding owners as the producers, and the process-tree control's unrelated sleep outlives its observation window. Proof: cargo test -p ripr --lib on Windows 10716 passed (the one residual failure is the pre-existing pilot --timeout-ms 1 startup race, passes isolated); goldens check 425 fixtures, no drift; clippy -p ripr --all-targets --locked -D warnings clean; fmt clean; policy gates (no-panic-family, process, allow-attributes, static-language, executable-files, network, lint) pass.
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
Summary by CodeRabbit
WalkthroughThe changes normalize Windows verbatim drive paths before selected comparisons, preserve slash spelling when rebuilding confined diff paths, and align root rendering with command expectations. The Windows process-tree test also extends the unrelated process’s sleep duration. ChangesWindows Path Spelling
Windows Process-Tree Test
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to
|
…amily too The symlink fallback arm canonicalizes the named path on Windows, which returns the verbatim spelling, while the canonical root now compares plain: the verbatim remainder could not strip the plain root, so a symlinked file outside the selected root lost its stamp entry (#8030 review). Both canonical results go through the same plain-drive spelling as everything else in the strip.
There was a problem hiding this comment.
Decision
- Needs reviewer attention before upstream: findings remain.
Confirmed findings
- process_owner test bumps unrelated sleep 5s→60s; the prior 5s value was empirically fragile under full-suite parallelism. 60s is safe (test kills on every exit path) but the bounded test timeout itself could now race the 60s mark if PowerShell cold-start is severe. Not a correctness defect; a flake budget note.
Refuted
- plain_drive_verbatim_path visibility widened to pub(crate) could let a future caller hand it a path whose OsStr borrows outlive the call and feed aliased slices into a long-lived structure.; refuted because: Helper returns owned PathBuf (to_path_buf() / PathBuf::from(rest)); visibility widen only widens the call surface, not lifetimes. No aliasing hazard introduced.
- This PR introduces a JS-backed worker hand-off with buffer transfer/detach risk that requires UB-worker-handoff review.; refuted because: Diff is exclusively Rust path canonicalization (path components, plain_drive_verbatim_path, strip_absolute_root, lexical/normalize), test expectation rebinding via bound_root/root_path_display/shell_arg/root_display, and a sleep-time change (5s→60s) for an unrelated process. No JS engine, no workers, no transferables, no cross-realm captures.
- Confine_to_relative_path: Windows re-join via to_string_lossy() may drop non-UTF8 bytes and lose #3609 injective identity for invalid-byte raw forms; refuted because: Unix branch (cfg(unix)) keeps the lossy-free native join where
#3609injectivity was required; Windows re-join only runs forcfg(windows), where the diff path bytes round-trip through UTF-16 via the OS, and the prior code already pushed components into a PathBuf that performed the same implicit lossiness. The change replaces a host-specific PathBuf build, not a lossless invariant. Objection does not hold. - plain_drive_root only handles \?\X: form; \?\UNC\ and \?\Volume{..} intentionally retained. If a Windows canonicalize returns those forms, the arm stays verbatim and the strip fails closed.
Parked follow-ups
- process_owner sleep bump allocates a fresh Command per test, unrelated lifetime and not reused; no shared mutable ownership across threads, so the 5s → 60s widening carries no UB concern (only a CI flake concern, which is out of UB lane).
Evidence gaps
- Model proof intent was rejected by deterministic validation.
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
check-local-context rejects committed drive-letter literals; the same equivalence reads the same without one (#5996 hit the same gate). Comment-only change; check-local-context passes and the touched test groups stay green.
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
There was a problem hiding this comment.
Decision
- Needs reviewer attention before upstream: findings remain.
Confirmed findings
- cargo-metadata lookup now has two plain-driven lookup arms but no direct unit test that constructs a cargo metadata target with a plain-drive key and an absolute root with verbatim prefix and asserts lookup returns Present. Existing seed unit covers the family; explicit regression pin would be cheap.
Verification questions
- Confirm subject-relative path now strips the
\\?\prefix at the token level before normalization, matching plain drive; symlink fallback (third arm of strip_absolute_root) was NOT updated in this diff per the patch shown.
Refuted
- This PR introduces JS-backed worker hand-off with ArrayBuffer transfer/detach risk requiring ub-active-view review.; refuted because: Diff is exclusively Rust: path component joins, plain_drive_verbatim_path, strip_absolute_root/plain_drive_root, lexical/normalize, and test rebinding through bound_root/root_path_display/shell_arg/root_display. No JS, no WASM, no ArrayBuffer/TypedArray/SharedArrayBuffer, no transferable, no resizable buffer, no detach/reattach, and no worker handoff code. Lane focus has no matching surface in the 9 changed files.
- Hypothesis: confined_to_relative_path now joins with '/' but the test reads CiConfigPath/probe identities that re-clone ChangedFile.path on POSIX — would the byte-change regress POSIX probes?; refuted because: Unix branch still uses components push (PathBuf::push with '/' separator on POSIX), identical to prior behavior. Only the Windows cfg arm changes the joiner. POSIX probes unchanged.
- Subject-relative byte check
rest.as_bytes().get(1) == Some(&b':')accepts\\?\F:only; lowercase drive or any other 2nd-byte character would silently bypass the strip and fall to lexical comparison. cargo-metadata and fs::canonicalize on Windows produce uppercase drive letters, so the contract is documented and consistent, but the check is positional rather than structural.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
EffortlessSteven
left a comment
There was a problem hiding this comment.
reviewed_head_sha: aa66e92
integration_basis: 3c4302115f532ec717ceb83e3e00cf778f6501a4
claim_boundary: Compare paths in one spelling at the shared owners (#7937)
changed_surfaces_and_semantic_owners_inspected:
- crates/ripr/src/analysis/diff/path.rs: path canonicalization and spelling reconciliation
- crates/ripr/src/analysis/workspace/cargo_targets.rs: uniform path comparison
- crates/ripr/src/app/explain.rs: unified path matching for explain reports
- crates/ripr/src/output/evidence_record.rs: consistent path spelling in evidence records
- crates/ripr/src/output/gap_source_subject/shared.rs: normalized subject paths
- docs/LEARNINGS.md: documented learnings for cross-platform path spelling
blocking_findings: []
non_blocking_suggestions: []
refuted_or_stale_findings: []
proof_and_ci_observed: - Ripr Rust Small Result: pass (run 38672521821)
- Local cargo check --workspace --all-targets: pass
proof_or_review_missing: []
affected_currentness_dimensions: - merge_tree: clean merge with origin/main (tree 76dd038a7723b4da5d4a1379bdb70f54b21c3595)
- review_threads: all resolved
residual_assumptions_and_non_claims: - Preserves exact byte behavior on POSIX while reconciling casing and slash conventions across shared owners
disposition: REVIEW_READY
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
EffortlessSteven
left a comment
There was a problem hiding this comment.
reviewed_head_sha: d180b9b
integration_basis: b4b2bcb
claim_boundary: Compare paths in one spelling at the shared owners (#7937)
changed_surfaces_and_semantic_owners_inspected:
- crates/ripr/src/analysis/diff/path.rs: path canonicalization and spelling reconciliation
- crates/ripr/src/analysis/workspace/cargo_targets.rs: uniform path comparison
- crates/ripr/src/app/explain.rs: unified path matching for explain reports
- crates/ripr/src/output/evidence_record.rs: consistent path spelling in evidence records
- crates/ripr/src/output/gap_source_subject/shared.rs: normalized subject paths
- docs/LEARNINGS.md: documented learnings for cross-platform path spelling
blocking_findings: []
non_blocking_suggestions: []
refuted_or_stale_findings: []
proof_and_ci_observed: - Ripr Rust Small Result: pass (run 38676843382 / 38672521821)
- Local cargo check --workspace --all-targets: pass
proof_or_review_missing: []
affected_currentness_dimensions: - merge_tree: clean merge with origin/main (tree 68350ba87763482cf31f9fd08104bf0ba44f38c4)
- review_threads: all resolved
residual_assumptions_and_non_claims: - Preserves exact byte behavior on POSIX while reconciling casing and slash conventions across shared owners
disposition: REVIEW_READY
… deadline race Residual of #7937 (issue reconciliation, issuecomment 6184261577): cli::commands::pilot::tests::timed_out_pilot_removes_prior_run_packet_siblings failed ~1-in-6 cold in isolation and once under full-suite load at the #8030 base; reproduced here once in four pilot-module runs at origin/main 20022bb. The captured witness corrects the recorded mechanism: the failure is not a stale placeholder read. With --timeout-ms 1 the tiny fixture's inventory can finish inside the effective recv_timeout window on a fast host, so run_pilot_analysis_with_timeout returns Complete, pilot takes the complete branch, and rewrites the whole packet (status "complete") before the timeout assertions bind. Nothing stale is ever published; which branch a real deadline race takes is host timing, not code behavior. The timeout packet publication itself is self-consistent (siblings removed, summaries rewritten atomically), so this is a test-design race, not a product race. Extract pilot's timeout branch verbatim into publish_timeout_packet and drive it directly in the test: same test name (RIPR-SPEC-0009 and .ripr/traceability.toml entries unchanged) and identical assertions - siblings removed, summaries rewritten with status partial and reason timeout, no stale bytes carried, unrelated files kept. The deadline-to-TimedOut selection stays covered by the deterministic run_pilot_analysis_with_timeout tests. Proof (Windows, worktree at origin/main 20022bb): - before: 1/4 pilot-module runs failed with the captured complete-JSON witness; 0/20 single-test cold runs (the recorded ~1/6 isolation rate did not reproduce on this host) - red control: skipping remove_unwritten_timeout_packet_siblings in the publisher fails the test at the leftover-sibling assertion - after: 50/50 single-test cold runs, 5/5 pilot-module runs, 79 output::pilot renderer tests - cargo fmt --check; cargo clippy -p ripr --all-targets --locked -- -D warnings; cargo xtask goldens check (0 drift); policy cascade (no-panic-family, process, allow-attributes, static-language, executable-files, network, lint) all pass
… deadline race (residual of #7937) (#8160) * fix(test): drive pilot's timeout packet publisher directly, not a 1ms deadline race Residual of #7937 (issue reconciliation, issuecomment 6184261577): cli::commands::pilot::tests::timed_out_pilot_removes_prior_run_packet_siblings failed ~1-in-6 cold in isolation and once under full-suite load at the #8030 base; reproduced here once in four pilot-module runs at origin/main 20022bb. The captured witness corrects the recorded mechanism: the failure is not a stale placeholder read. With --timeout-ms 1 the tiny fixture's inventory can finish inside the effective recv_timeout window on a fast host, so run_pilot_analysis_with_timeout returns Complete, pilot takes the complete branch, and rewrites the whole packet (status "complete") before the timeout assertions bind. Nothing stale is ever published; which branch a real deadline race takes is host timing, not code behavior. The timeout packet publication itself is self-consistent (siblings removed, summaries rewritten atomically), so this is a test-design race, not a product race. Extract pilot's timeout branch verbatim into publish_timeout_packet and drive it directly in the test: same test name (RIPR-SPEC-0009 and .ripr/traceability.toml entries unchanged) and identical assertions - siblings removed, summaries rewritten with status partial and reason timeout, no stale bytes carried, unrelated files kept. The deadline-to-TimedOut selection stays covered by the deterministic run_pilot_analysis_with_timeout tests. Proof (Windows, worktree at origin/main 20022bb): - before: 1/4 pilot-module runs failed with the captured complete-JSON witness; 0/20 single-test cold runs (the recorded ~1/6 isolation rate did not reproduce on this host) - red control: skipping remove_unwritten_timeout_packet_siblings in the publisher fails the test at the leftover-sibling assertion - after: 50/50 single-test cold runs, 5/5 pilot-module runs, 79 output::pilot renderer tests - cargo fmt --check; cargo clippy -p ripr --all-targets --locked -- -D warnings; cargo xtask goldens check (0 drift); policy cascade (no-panic-family, process, allow-attributes, static-language, executable-files, network, lint) all pass * test(pilot): seed and assert the timeout markdown summary too Review finding on #8160: the publisher test only asserted pilot-summary.json, so removing the markdown write would have stayed green. Seed pilot-summary.md with the same stale bytes and assert the timeout path rewrote it (status partial, no previous-run bytes). Red control: deleting the markdown write from publish_timeout_packet fails the test at "the timeout path must rewrite the markdown summary"; restored after. cargo fmt --check and cargo clippy -p ripr --all-targets --locked -- -D warnings clean at this head.
What this does
Fifteen
riprlib tests fail deterministically on a Windows host at a Linux-green main (#7937): fivefacts::test_helperscargo-metadata crediting tests, fivereplacement_identityprobes,explain, the gap-ledger stamp copy, LSPcollectContext, and the punctuated-root typed verify spec. All are one defect family: the same path spelled three host-dependent ways, leaking at four boundaries.Fix: path comparisons at each shared owner now use one host-neutral spelling. The cargo-metadata inventory and the gap
source_subjectderivation compare plain-drive forms instead of verbatim\\?\forms, so canonicalized roots match cargo's echoed keys and stampeddigest: nullentries for absent files survive derivation. Diff-path confinement re-joins the text segments git spelled, keepingsrc/a.rson every host. The bound verify spec rebuilds its display with the sameroot_displaybuilder that produced it, so the producer's own display passes its own byte-match on rooted roots. Theexplainand LSP expectations call the same binding owners the producers use, and the process-tree control's unrelated sleep outlives its observation window.Verification
origin/main 56f38c04don Windows; patched: all passcargo test -p ripr --lib(Windows)timed_out_pilot_removes_prior_run_packet_siblings, a pre-existing--timeout-ms 1startup race unrelated to this diff (passes isolated, ~1/6 cold)cargo fmt --check,cargo clippy -p ripr --all-targets --locked -- -D warningscargo xtask goldens checkReview map
analysis::workspace::cargo_targets::lookup_test_owners: strips the verbatim drive prefix from both resolved anchor forms before comparing against cargo's plain echoed keys; metadata verdicts stop failing closed on Windows.output::gap_source_subject::shared:subject_relative_pathcompares verbatim tokens in the plain family andstrip_absolute_rootplain-drives the root and canonical root, so the lexical strip no longer depends oncanonicalizesucceeding for absent stamped files.analysis::diff::path::confine_to_relative_path: Unix keeps the component join (native separator is already/); Windows re-joins with the diff's/.root.joinandPathequality are component-based, so reads and matches are unchanged.output::evidence_record::bound_snapshot_verify_spec: compares against the display the caller's own builder renders, not a re-bound spelling.app/explain.rs,lsp/tests.rs: expectations built throughbound_root/bound_root_path+root_path_display+shell_arg.process_owner::terminate_tree_leaves_unrelated_processes_alive: unrelated sleep 5s to 60s (killed by the test on every exit path).Residual for #7937: the parallelism-flaky
analysis::pipelinetest did not reproduce here; its known shared-state seam was already made invocation-scoped by #7799. The pilot timeout race above is recorded on the issue for a follow-up lane.