Repository navigation
Registration: store absolute prefix, interpreter and pythonpath paths - #102
Merged
Merged
Conversation
…#49) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y2SN8SuEakTdiWy3F2WUqN
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y2SN8SuEakTdiWy3F2WUqN
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
registry.register()now converts--prefix, the interpreter path, every--pythonpathentry and--dirto absolute paths (os.path.abspath, deliberately notresolve(), because a venv'spythonis a symlink and the trust check compares paths without following links) before probing the interpreter, generating the schema and writing the entry. The registry JSON no longer depends on the caller's working directory. Absolute registrations and shared/system registries are unchanged;unregister --prefixalready comparesabspathof both sides, so equivalent paths still match.How verified
tests/test_roundtrip_registration_paths.py: registers through the real command line from folder A with a relative--prefixand relative--pythonpath, asserts the stored JSON paths are absolute, then from an unrelated folder B runslist,doctorandrun(the tool inA/srcreally runs), and finallyunregister --prefixwith the relative spelling.registry.pychange reverted the test fails (stored '../../usr' depends on the working directory).test_hardening...test_foreign_owned_or_group_writable_shared_entry_is_skipped, which fails identically on unmodifiedorigin/mainin my root sandbox (the test is root-only and skips on CI); coverage 86.44% (floor 85).docs/REGRESSION_LEDGER.md(PR number follows in a second commit).Fixes #49
🤖 Generated with Claude Code
https://claude.ai/code/session_01Y2SN8SuEakTdiWy3F2WUqN
Generated by Claude Code