Repository navigation
refset: a target under a symlinked directory names its directory once - #377
Conversation
There was a problem hiding this comment.
Verdict: CLEAN: Canonical parent comparison removes duplicate sidecar paths while preserving lookup beside a target resolved into another directory.
Checked
Duplicates: 2 new test functions checked by Grep; they cover distinct directory-link and empty-parent cases.
Complexity: the change adds parent resolution inside the existing lookup owner.
Silent failure: 2 canonicalization .ok() sites followed through selection and diagnostics. Failure to resolve the target preserves the original-directory and family candidates; failure to resolve its parent retains the resolved-directory candidate.
Tests: static mutation analysis at crates/refset/src/arch/draft.rs:242: restoring the raw-parent comparison fails the directory-link assertion; removing join(".") fails the bare-name assertion. Adding a duplicate candidate fails the changed plain-target assertion.
Gates: no thresholds or pins moved; no tests or cases removed.
Escape catalog: no C1–C4 patterns matched.
Adversarial checks: distinct-directory file links retain their fallback; same-directory links and bare names retain the original spelling. The change runs at load time.
Notes
Validation was static; Rust tests were not run.
🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)
|
The review is done and the contribution check passed, so I'm merging this. |
What and why
cargo test -p bloomery-refsetfails on macOS atarch::draft::tests::a_plain_target_with_no_draft_beside_is_the_family_path. The temporary directory lives under/var, which is a symlink to/private/var, sobeside_pathscompares the target's parent as spelled with the parent of the canonical target, finds them unequal, and lists the same directory twice. Theload draft=offline would then name one sidecar path twice for any model opened through a symlinked directory, on any OS (for example~/modelslinked to a data disk).beside_pathsnow compares the canonical form of both parents, so a second path appears only when the target really resolves into another directory. A bare file name has the empty parent, so the parent is resolved asdir/., which names the working directory. The existing test spells the beside path as the target's directory. Two new tests cover a shard opened through a symlinked directory (Unix) and a bare file name.Release notes: Fixed: a model opened through a symlinked directory no longer lists its draft sidecar path twice on the
load draft=offline.Code shape
beside_paths, the one owner both the pick and the off line walk.cargo fmtandcargo clippyare clean on what I touched; the lint count did not go up.Duplication found or removed (
path:line), or "none": none.What I ran
On macOS (Apple M4 Pro),
cargo test -p bloomery-refset arch::draft:dir/.: the bare-file-name test failed.What I ran into
None of this blocks the PR. Nothing came up beyond the failure above.
Hardware (if the change is for a machine)
Not for a machine.
AI help
AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.