Repository navigation
refactor(repos): one link-text helper, and link-walk helpers public - #1402
Conversation
overlay_paths and links each had a _link_target with the same name and different guards: links strips the \\?\ long-path prefix on Windows only, overlay_paths on every OS. A POSIX symlink to \\?\x therefore named the file x for the overlay arm and the held-guidance accounting, and the file \\?\x for the walk. Keep the links one, now public as link_text() and guarded by os.name; overlay_paths and held_guidance call it. Promote the helpers that cross modules to public names in their owning module: links.walk_links, names_dir, require_dir, LinkLoop; overlay_paths.overlay_targets, path_hits, supplies_a_file; manifest.is_within. The workspace re-exports of the overlay helpers go with the rename. Behaviour changes only for a POSIX link whose text starts with \\?\ (now read as written, the file an agent in the workspace reaches); see the changelog fragment. Test-narrowed: the two overlay tests that read a Windows link text by patching os.readlink (the long-path prefix and the UNC share) are removed; the same helper is now pinned at the links level by test_a_windows_extended_prefix_is_dropped_from_a_link_text and test_an_extended_unc_link_text_is_the_share. Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
|
✅ OpenCodeReview: Review complete: 0 finding(s) across 2 selected item(s). CI at Review details
|
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1402 +/- ##
==========================================
- Coverage 96.28% 96.27% -0.02%
==========================================
Files 513 513
Lines 68470 68467 -3
Branches 11884 11883 -1
==========================================
- Hits 65924 65914 -10
- Misses 1566 1569 +3
- Partials 980 984 +4
🚀 New features to boost your workflow:
|
Mutation of changed lines71 mutants of the lines this PR changes, at f7f2263: 9 killed, 0 survived, 0 waived, 4 inconclusive, 1 timed out, 0 errors, 57 not run. The check was incomplete: 0 candidate tests fail without a mutant and were left out, 7 candidate test files were not run, and 1 changed lines were not mutated, 57 mutants were not run before the time budget ended; this is not a clean result. Warn-only: a survivor does not fail the job yet. Updated on every push; the full report is in the ci run summary. |
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com> # Conflicts: # dokimi/dokimi/repos/links.py
Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
…thing Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
vlad-perevezentsev
left a comment
There was a problem hiding this comment.
🟢 LGTM · checked f7f2263 · nothing required from @napetrov
🔀 Merge: safe now · merges cleanly into current main, 0 commits behind · after it, #1424 needs a rebase (repos/links.py, repos/source.py)
✅ make ci-local --offline: 31,393 passed, 0 failed, mutation step passes · ✅ the new path_hits and held-guidance tests fail on the base · ✅ Windows (Server 2025, Python 3.13): test_repo_overlay.py, test_repo_source_links.py, test_repo_run_guidance.py 126 passed, the same 5 failures as on the base
The rename is complete, and overlay and held-guidance code now read link text like the walk does.
Fixed in this branch, up to f7f2263:
Summary
Two
_link_targethelpers with one name and different guards.linksstrips the\\?\prefix on Windows only;overlay_pathsstripped it on every OS.Cross-module helpers made public in their owning module:
links.walk_links,names_dir,require_dir,LinkLoop;overlay_paths.overlay_targets,path_hits,supplies_a_file;manifest.is_within. The# noqa: F401re-exports of overlay helpers inworkspace.pyare gone.Evidence
test_a_posix_link_text_that_starts_with_the_long_path_prefix_names_that_filefails on base: a POSIXAGENTS.claude.md -> \\?\xmakespath_hits(..., {x})return True.After: the same test passes on head (False; the link names the file
\\?\x).tests/test_repo*.pyandtest_tree_digest.py,test_catalog_path_missing.py: 7763 passed, 7 skipped.make ci-local --offline --jobs static,typecheck: 0 failed.Merge Danger
Door: two-way. The only behaviour change is a POSIX link whose literal text starts with
\\?\: the overlay arm andheld_guidancenow read it as written (the file an agent in the workspace reaches). Windows is unchanged. Changelog fragment included.Blast radius: internal. Renames of private helpers in
dokimi/repos; no__init__export, CLI flag, persisted format or ABI changes.Merge order: open intel/dokimi #1396 edits
links._names_dirand monkeypatcheslinks._link_targetintest_repo_source_links.py; this PR renames both. Whichever lands second rebases (mechanical).🤖 Generated with Claude Code