Repository navigation
fix(lsp): one path-identity owner; no Unix backslash aliasing or non-UTF-8 URI collapse (#9504) - #9622
Conversation
… non-UTF-8 URI collapse (#9504) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ukjh8o9wyxm7PSKcCNNX6Q
…9504) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ukjh8o9wyxm7PSKcCNNX6Q
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 5 minutes. View limit details
Comment |
There was a problem hiding this comment.
Confirmed findings
- Gap-artifact path identity differs from hover on macOS for ASCII case variants, despite the PR claiming one shared identity owner.
- Unix encoded backslashes remain literal filename data rather than becoming directory separators.
- Non-UTF-8 Unix paths are emitted from exact bytes and cannot collapse through lossy U+FFFD conversion.
Verification questions
- Confirm the strongest remaining uncertainty is platform and automated-sensor corroboration rather than a demonstrated source defect.
- Confirm the non-UTF-8 test directly distinguishes both URI spelling and identity, but only exercises Unix and does not prove the non-Unix refusal branch.
- Confirm non-UTF-8 Unix paths are encoded from raw bytes and distinct bytes produce distinct URI strings, but decoding remains fail-closed.
- Confirm the owner cannot supply byte-exact identity for non-UTF-8 URI text: normalized_file_uri_path admits UTF-8 only, then file_uris_match_on reconstructs Paths and asks the owner for a key.
- Confirm windows separator preservation is claimed for Windows and UNC spellings, but the added cross-host test only covers a drive path and does not exercise UNC spelling.
- Confirm the packet demonstrates several changed routes but does not prove no unscanned sibling comparators retain local normalization or lossy path handling.
- Confirm a repository-wide inventory of sibling path comparators was not supplied, so completeness beyond the named LSP/output routes is unproven.
Refuted
- Lossy conversion causes arbitrary non-UTF-8 files to share one URI and expose or alias file contents.; refuted because: Emission and shared identity keys retain exact bytes; decoding intentionally returns None, so distinct paths fail closed rather than map to a file.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
EffortlessSteven
left a comment
There was a problem hiding this comment.
Bounded independent #9504 counterexample review at e6fffc6. The publication ownership refresh found this existing candidate, so I did not push or open a rival PR and left this branch untouched.
Residual Unix alias requiring owner disposition — lsp/uri.rs:67,93-94,299-302. On Linux, the shared native owner distinguishes the relative paths C:\a\b.rs (one literal filename) and C:/a/b.rs (three components), but file_uri_for_path emits file:///C:/a/b.rs for both. Likewise, file:///C:/a%5Cb.rs and file:///C:/a/b.rs decode to the same path and match. The new cross-host drive compatibility test explicitly retains this exception; it does not prove native Unix filename identity for drive-shaped names. Please distinguish native Path emission from Windows wire compatibility, or explicitly fail closed for ambiguous native spellings, and pin the chosen boundary with a discriminating test. Do not present the ordinary /w/a%5Cb.rs control as proving this case.
Minimal reproduction inside the URI module on Unix:
let literal = ["C:", "a", "b.rs"].join("\\");
let nested = ["C:", "a", "b.rs"].join("/");
assert_ne!(
crate::output::path::path_identity_key(Path::new(&literal)),
crate::output::path::path_identity_key(Path::new(&nested)),
);
assert_eq!(
file_uri_for_path(Path::new(&literal))?,
file_uri_for_path(Path::new(&nested))?,
); // observed aliasNative Windows proof remains missing. The normal merge-ready Windows advisory subset selects cargo test -p ripr --lib lsp::gap_artifacts (workflow line 784); it does not execute the new URI/output test names. Compilation/Clippy and cross-host boolean tests cannot establish the issue's Windows-runtime acceptance. Place a real Windows consumer regression in an already selected route or obtain the appropriate supported native run, then inspect the named test's actual execution. I have not requested CI or changed readiness/labels on this owned candidate.
Controls and limits. A bounded Linux executable including unchanged copies of this exact head's production URI and output/path modules passed the ordinary Unix backslash negative/control and distinct FF/FE URI control; the FF/FE emissions return Ok and both decodes return None, as disclosed by the PR. No full Cargo suite or Windows run was performed for this head. The source still promises every Ok emission round-trips (uri.rs:77-82), which should be reconciled with that intentional non-UTF-8 behavior. The existing automated review's macOS gap/hover split claim is refuted at this head: both delegate to the same path_identity_key -> host_paths_case_insensitive predicate; this is source inspection, not native macOS execution. Provider quota comments are missing review, not clearance.
Reviewed head: e6fffc6, re-read unchanged immediately before submission preparation.
Current fetched main: ad83c6b.
Probe executable SHA-256: d6a1f42abf959e3f2e6e9b7125b829eb68f71ee513788ab482ce2034b1e69248; standalone native exit 0.
Disposition: REPAIR_REQUIRED for the demonstrated identity exception pending explicit acceptance/repair, and REVIEW_INCOMPLETE for native Windows/hosted/current integration proof. This is a bounded counterexample handoff, not cumulative merge clearance. Please continue through this existing candidate.
…, fail closed on Windows spellings on Unix (#9504) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ukjh8o9wyxm7PSKcCNNX6Q
…sion narrowing (#9504) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ukjh8o9wyxm7PSKcCNNX6Q
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Review of record, head 505871f Angles: (1) correctness/edge cases and spec parity, (2) tests/regressions/consumers at e6fffc6, then a delta review of the repair at 7f27879, plus an independent counterexample review that found the Findings and resolutions: incomplete owner migration (input_identity fingerprint, state.rs, backend.rs, edit_cage) fixed with a collision negative test; non-UTF-8 URIs now round-trip on Unix; drive/UNC-shaped backslash spellings are refused at emission on Unix with an assert_ne regression; Windows consumer test added in Gap: Windows branches rely on hosted advisory CI. Merging when routed CI is green on this head. Generated by Claude Code |
|
Head 505871f: Generated by Claude Code |
EffortlessSteven
left a comment
There was a problem hiding this comment.
Independent bounded review for #9698 at 505871f (tree 9fc146e854ce72de3819633691646f5bb7f488fe, merge-base f0397266d11e87fa38c8f846305f0d86eb99f338). The existing #9622 writer remains responsible for the candidate; no candidate edits, competing implementation, CI request, label/readiness change, or merge was performed.
Two existing #9698 P2 findings are verified on this exact candidate.
non_utf8_path_from_file_uriomits the UTF-8 drive admission/normalization atnormalize_decoded_uri_path:file:///C:/a%FFyields raw bytes2f 43 3a 2f 61 ffrather than43 3a 2f 61 ff;file:///C:x%FFis admitted as2f 43 3a 78 ff, whereas the UTF-8file:///C:xis refused. The empty-authority, localhost, and file:/ forms all reproduce this asymmetry. A repair should share the ASCII structural drive rules without lossy conversion or case-folding non-UTF-8 bytes.is_foreign_windows_spellingfalsely refuses the legitimate Unix relative filenamea:b\c.rs. A real owned filesystem fixture with exactly those filename bytes was created/read successfully. Narrowing that guard alone is insufficient:file:///a:b%5Cc.rsis still refused by the drive-relative decoder. The current encoder also returns that wire spelling for/a:b\c.rs, followed by aNonedecode. The explicitfile:///./a:b%5Cc.rscontrol is admitted; an absolute fixture under a normal workspace prefix also round-trips. Reconcile emission and decoder disambiguation together while preserving refusal of actual drive-relative and foreign drive/UNC forms. This does not establish a Windows filesystem access vulnerability.
Observed local proof (native Linux x86_64, Rust 1.95.0):
- Unchanged candidate:
cargo test --locked -p ripr --lib lsp::uri::tests -- --nocapture— native exit 0, 32 passed, 0 failed, 12,704 filtered out. - Unchanged candidate:
cargo test --locked -p ripr --lib output::path::tests::path_identity_key -- --nocapture— native exit 0, 2 passed, 0 failed, 12,734 filtered out. - A separate executable compiled unchanged complete production
lsp/uri.rs,output/path.rs, andbounded_input.rssnapshots, with the verbatim display-helper excerpt needed by output/path and the candidate's locked dependency artifacts. It called production methods directly, reproduced both findings, and passed 17 byte-identity/refusal controls (distinct FF/FE and A/a+FF remain distinct even with the host-fold flag, ordinary Unix backslashes remain distinct from separators, exact byte round trips, and traversal/NUL/foreign-authority/query/fragment refusal). Its exit 0 means the counterexamples were reproduced, not that #9698 is repaired. Probe SHA-256:60c450bae7732b665c256a950269f860d08ac9886096c151845c5b2526f3c3b4; JSON observations SHA-256:2ce3e7d196c503fce1a3b8b08abf44e0ed2c274e67a44b1f768d6fe6b6b4a92f. Native test executable SHA-256:64a55007746d7854c1b9a784ae1459ac7496bb6b6ea86409edfa34908c5db0ee.
Native Windows evidence, now observed rather than inferred: job 119833822390 checks out this PR head for the production subset and logs lsp::gap_artifacts::tests::windows_uri_identity_uses_backslash_separator_and_ascii_fold ... ok, 85 passed, 0 failed, and subset-gap-artifacts: PASS. This closes the earlier missing evidence for that named drive/separator/ASCII-fold consumer control. It does not execute the non-UTF-8 Unix branch or prove all Windows behavior.
Integration evidence and continuation: the old required run 39781555293 compiled synthetic merge 39742c8f2b5219339e2a6353f57a53fbe9afe08c and failed with E0425 subject at artifact.rs:719; its Schema producer sweep was skipped. This is historical combined-tree failure, not candidate-source attribution or current qualification. The repair of record #9701 has since merged as 7ed8a4af6df05a45dea9a19da36c65ca8b457af6 (13:34:28 UTC); refreshed main has repaired artifact blob 3b1d5e733d6c6f709020db14f8da155c428c79d4. The existing #9622 owner can now integrate that accepted prerequisite as already planned, review affected composition, and request the installed qualification route once. A fresh applicable Schema sweep must actually execute before qualification is claimed.
Inspected: complete PR diff; URI codec/admission/containment; shared path-key owner; diagnostic URI emission, workspace-root intake, saved-file digest and path-match consumers; existing tests/changelog; Windows selected workflow and actual logs; reviews, threads and Conversation ownership. No new public schema shape, workflow, release, or analyzer-classification change was proposed.
Disposition: #9698 acceptance remains unrepaired; these are the already tracked P2 residuals, not a new blanket blocker claim for #9622. REVIEW_INCOMPLETE for merge clearance, pending the existing owner's current composition/proof and final published-head judgment. No repair-candidate, release, source-sync, or full-platform qualification claim. All other scoped holds remain intact.
…nd trip (#9504) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ukjh8o9wyxm7PSKcCNNX6Q
|
Review of record, head b3c3749 Angles: delta review of 505871f..b3c3749 (uri.rs drive admission on the byte route, Findings and resolutions: both P2s (#9698) are repaired and pinned by Gap: Windows branches rely on hosted advisory CI, which observed Generated by Claude Code |
There was a problem hiding this comment.
Confirmed findings
- Lane topic is JS worker handoff / async capture / GC / detach / transfer. The diff is synchronous Rust path-identity ownership (crates/ripr/src/output/path.rs and lsp/uri.rs et al.). No JS, Worker, postMessage, SharedArrayBuffer, transferable, or wasm-bindgen surface is touched, so this lane has no actionable findings. The non_utf8_file_uri_for_path byte route is local std::path mapping, not a worker boundary.
- Percent-decoded NUL and parent segments are rejected before URI paths reach path matching or workspace projection.
Verification questions
- Confirm non-UTF-8 Unix URI decoding preserves exact bytes without conflating them through U+FFFD or ASCII case folding.
- Confirm windows-specific behavior is asserted by cfg(windows) tests but remains dependent on hosted Windows execution.
- Confirm windows branches (file_uris_match_on, paths_equal_or_below_on, file_uri_for_path Windows
\rewrite, andwindows_uri_identity_uses_backslash_separator_and_ascii_fold) rely on the hosted Windows advisory subset; no new sibling path on Unix, but Windows proof is observation-only here.
Refuted
- Non-UTF-8 paths may be exposed through lossy display or matching, creating an alias/info-disclosure primitive.; refuted because: Identity and URI decoding retain exact bytes; lossy conversion is restricted to explicitly display/glob text, and distinct raw-byte paths have distinct URI spellings and do not match.
- ub-worker-handoff is a category mismatch: the entire diff is synchronous Rust path/URI identity ownership, with no Worker/postMessage/SharedArrayBuffer/wasm-bindgen or async capture touched.
- Box/Vec allocation failure inside path_identity_key_on's non-UTF-8 hex-key loop could collapse distinct byte paths under OOM and constitute an active-view aliasing hazard.; refuted because: path_identity_key_on is infallible (returns String, not Option), so an allocation failure aborts the process rather than returning a shorter key; the NUL prefix and per-byte format! also make partial/empty output structurally impossible. Calibrated as refuted false-premise per lane instructions.
Box::from(slice)allocation failure does not returnNone; recoverable fallback claims are dropped.
Evidence gaps
- Windows-specific identity semantics are asserted by cfg(windows) tests but not executed by the available evidence.
- Windows execution is not corroborated in the available packet despite platform-specific assertions being added.
- Model proof intent was rejected by deterministic validation.
Requested by Steven · project thread
Governing issue or accepted claim: #9504
Acceptance delta (one sentence): LSP URI, hover, gap-artifact, input-fingerprint and adapter-path comparators share one
output::path::path_identity_keyowner, so Unixa%5Cb.rsno longer aliasesa/b.rsand distinct non-UTF-8 paths stay distinct and round-trip through file URIs.Scope
output/path.rs:path_identity_key_on/path_identity_key(separator rule, one ASCII fold, byte-exact non-UTF-8 key) andpath_display_lossy(display-only).lsp/uri.rs:\is a separator only on Windows hosts; non-UTF-8 Unix paths encode and decode byte-exactly (round trip); a drive/UNC-shaped text containing\is refused at emission on non-Windows hosts; comparisons use the shared key.input_identity.rsroot fingerprint,state.rsunavailable-adapter paths,backend.rsroot-relative components,hover.rs/gap_artifacts.rsnormalize_path,edit_cagecase-collision key.uri::display_path,hover::display_hover_path, backend glob root.output/baseline*.rs, stored-string compatibility; follow-up Baseline keys: decide path-identity compatibility with output::path::path_identity_key #9666),config/*,app/*, edit-cage inline-test-region (outside the LSP scope).Proof
cargo xtask precommitpasses at head; focusedlsp/output::path/edit_cagetests: 1221 passed.\rewrite andto_string_lossyfails the%5Calias and non-UTF-8 tests; new tests also pinC:\a\b.rsvsC:/a/b.rs,/w/a\bvs/w/a/binput fingerprints, non-UTF-8 root pairs, UNC refusal, and that a Windows-produced report root/w\sub\projfails closed on Unix.cfg!(windows)still rewrites\). Acfg(windows)regression test lives inlsp::gap_artifacts::tests, which the existing Windows advisory subset already runs; no workflow change. Windows%5CURIs from Windows clients still separate on Windows only.Claim Boundary
Not claimed: NFC/NFD or Unicode case equivalence (#9623); baseline-key compatibility (#9666). A Windows-produced
%5CURI or backslash report root read on Unix now fails to match instead of aliasing.🤖 Generated with Claude Code
https://claude.ai/code/session_01Ukjh8o9wyxm7PSKcCNNX6Q