Repository navigation
Conversation
why: Symlinking ~/.vcspull.yaml or ~/.config/vcspull into a dotfiles checkout caused resolve_sources() to re-discover the target file as an untrusted project config when running inside the dotfiles directory, and classify_scope() followed leaf symlinks before checking $HOME while omitting VCSPULL_CONFIGDIR and ~/.vcspull (#600). what: - Add expand_home(), resolve_home(), and user_config_dirs() in vcspull.util, ignoring blank VCSPULL_CONFIGDIR and XDG_CONFIG_HOME - Deduplicate resolved real paths across system, user, and project scopes in resolve_sources() - Match lexical candidates against symlink chains of user and system config roots in classify_scope() while keeping rogue project symlinks classified as project - Collapse symlinked $HOME realpaths in PrivatePath and cover dotfiles and rogue-symlink topologies in tests and docs
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #620 +/- ##
==========================================
- Coverage 85.25% 85.11% -0.14%
==========================================
Files 38 38
Lines 7663 7762 +99
Branches 1567 1599 +32
==========================================
+ Hits 6533 6607 +74
- Misses 751 765 +14
- Partials 379 390 +11 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This was referenced Dec 6, 2026
This branch has not been deployed
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.
Closes #600
Summary
system,user, andprojectscopes inresolve_sources().~/.vcspull.yaml,~/.config/vcspull,VCSPULL_CONFIGDIR,~/.vcspull) inclassify_scope().project.VCSPULL_CONFIGDIRandXDG_CONFIG_HOMEvalues inuser_config_dirs().$HOMErealpaths inPrivatePath.1. Owner and boundary
src/vcspull/_internal/scopes.py, user config directory resolution insrc/vcspull/util.py, and home prefix display normalization insrc/vcspull/_internal/private_path.py.sync/async, CLI/API, single/batch, orN/A): Checkedresolve_sources(),classify_scope(),load_scoped_configs(),ensure_config_trusted(),vcspull config ls, andget_config_dir()callers acrossadd,discover,fmt,migrate,import,list,status,search, andsync.scopes.pyandutil.pyare the single owners of configuration scope discovery and classification; keeping interactive trust simplification separate (Replacevcspull trustwith structural project containment #619) isolates the symlink deduplication defect to its owning resolver.2. Failure before the fix (
N/Afor docs, lockfile bumps, or pure refactors)<base>commit, or<pre_fix_head>SHA if fixing a defect introduced in this PR):8419df6(v1.72.0)~/.vcspull.yamlto~/.dot-config/.vcspull.yamland runningvcspull config lsorvcspull sync --dry-run libtmux </dev/nullfrom~/.dot-configemitted bothuser ~/.vcspull.yamlandproject ~/.dot-config/.vcspull.yaml (untrusted)and aborted withVCSPullErroron non-TTYstdin.3. Verification and tool disclosure
N/A):uv run ruff format . --check,uv run ruff check .,uv run ty check --error-on-warning --python-version 3.11 .,uv run ty check --error-on-warning --python-version 3.15 .,uv run py.test src/vcspull/util.py src/vcspull/_internal/scopes.py src/vcspull/_internal/private_path.py tests/test_utils.py tests/test_scopes.py tests/cli/test_config.py tests/docs/test_markdown_conventions.py, and the disposable-worktree production revert bite check ontests/test_scopes.py::test_symlinked_home_dotfile_in_dotfiles_repo_loads_once_as_user..github/workarounds.tomlupdates (Noneif none):None~/.vcspull.yamltriggers unbounded project trust prompt #600 onv1.72.0, ran a two-round spike ratchet (.git/spike/vcspull-600-symlink-dedup.md), implemented thescopes.py/util.py/private_path.pyfix and regression suite, and ran lint,ty, pytest, and test-bite gates.Test plan
~/.vcspull.yaml,~/.config/vcspull,VCSPULL_CONFIGDIR,~/.vcspull, and chained dotfiles symlinks resolve once inuserscope inside~/.dot-config(tests/test_scopes.py,tests/cli/test_config.py)project(tests/test_scopes.py)VCSPULL_CONFIGDIR/XDG_CONFIG_HOMEvalues and symlinked$HOMErealpaths resolve cleanly (tests/test_utils.py)