Skip to content

Symlinked ~/.vcspull.yaml triggers unbounded project trust prompt #600

In review

Description

@tony

Summary

Running vcspull sync from inside a dotfiles checkout (such as ~/.dot-config) when ~/.vcspull.yaml symlinks to ~/.dot-config/.vcspull.yaml prompts to trust ~/.dot-config/.vcspull.yaml as an untrusted project configuration and prints every escaping checkout destination (~950 lines) to stderr, scrolling the filename header off-screen before Trust this config? [y/N/always]. resolve_sources() loads ~/.vcspull.yaml in the user scope and then re-discovers the same physical file during the upward project walk without deduplicating resolved paths, while classify_scope() resolves leaf symlinks before checking $HOME and $XDG_CONFIG_HOME/vcspull (and omits $VCSPULL_CONFIGDIR and ~/.vcspull/), misclassifying symlinked user configs as project or external across fmt --all, migrate --all, discover, and add. Separately, _authorize_config() prints every escaping destination uncapped in both interactive TTY prompts and non-TTY VCSPullError messages, and sibling CLI prompts and diagnostics (discover, import --prune-untracked, add, fmt --style concise, migrate, load_configs(), and sync timeout recipes) have no shared preview cap for multi-hundred-repository manifests.

Reproduction

Steps as reported; not re-run.

  1. Store a user manifest in ~/.dot-config/.vcspull.yaml declaring repositories outside ~/.dot-config (such as ~/study/ and ~/work/) and symlink ~/.vcspull.yaml to ~/.dot-config/.vcspull.yaml:

    $ ln -s ~/.dot-config/.vcspull.yaml ~/.vcspull.yaml
  2. Change into ~/.dot-config:

    $ cd ~/.dot-config
  3. Sync a single repository:

    $ vcspull sync libtmux

Expected

  • resolve_sources() skips project candidates whose real path is already present in the system or user scope, and classify_scope() classifies ~/.vcspull.{yaml,yml,json}, ~/.config/vcspull/*, $VCSPULL_CONFIGDIR/*, and ~/.vcspull/* (including symlinked files and symlinked config directories) as user scope rather than project or external.
  • Running vcspull sync libtmux (or config ls, fmt --all, migrate --all, discover, add) inside ~/.dot-config loads ~/.vcspull.yaml once as a user config without prompting for project trust.
  • When a genuine project config does escape its directory on a large manifest, _authorize_config() bounds the escaping-destination preview in both interactive prompts and non-TTY errors so the config path header, total count, and trust prompt or vcspull trust remedy remain visible on screen.

Actual

  • resolve_sources() emits both ConfigSource("user", ~/.vcspull.yaml, ~) and ConfigSource("project", ~/.dot-config/.vcspull.yaml, ~/.dot-config) for the same underlying file.
  • _authorize_config() prints ! ~/.dot-config/.vcspull.yaml would check repositories out outside its directory: followed by all ~950 repository paths on individual lines to stderr before Trust this config? [y/N/always] (and in non-TTY mode joins all ~950 paths onto a single VCSPullError line).

Environment

Versions
  • vcspull: 1.70.1
  • libvcs: 0.48.0
  • Python: 3.14
  • OS: Linux

Evidence

Trimmed terminal output
$ vcspull sync libtmux
! ~/.dot-config/.vcspull.yaml would check repositories out outside its directory:
    ~/study/ai-agents/agent-governance-toolkit
    ~/study/ai-agents/aider
    ~/study/ai-agents/atropos
    ~/study/ai-agents/autonovel
    ~/study/ai-agents/buzz
    ~/study/ai-agents/claude-code
    ~/study/ai-agents/codex
    ~/study/ai-agents/continue
    ~/study/ai-agents/copilot-cli
    ~/study/ai-agents/crush
    [... ~935 additional ~/study/* and ~/work/* paths omitted ...]
    ~/work/learn/learning-rust
    ~/work/learn/learning-rust-nodejs
    ~/work/learn/learning-rust-python
  Trust this config? [y/N/always]

References

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions