Skip to content

Replace vcspull trust with structural project containment #619

Backlog

Description

@tony

Summary

vcspull 1.70.0 (#564) added an interactive project-trust subsystem (vcspull trust, --trust-project, VCSPULL_YES, $XDG_STATE_HOME/vcspull/trusted, _authorize_config, and ensure_config_trusted) so upward-walked .vcspull.{yaml,yml,json} files could check out repositories outside their own directory after prompting. Replacing that stateful trust subsystem with structural project containment keeps system, user, and explicit -f/--file manifests unrestricted while scoping upward-walked project .vcspull.* files to their own directory tree, warning and skipping escaping project files without prompts, state files, or non-TTY VCSPullError aborts, documented in an Architecture Decision Record (docs/project/adr/).

Motivation

Unlike mise (configuration trust), vcspull installs no shell cd hook and evaluates no templates, scripts, or environment mutations in YAML. Its configuration files declare repository URLs and checkout destinations, closer to uv, where project manifests act within the project tree and require no trust subcommand or persistent trust database.

Keeping interactive trust authorization in src/vcspull/config.py and _authorize_config creates friction disproportionate to the one risk upward cwd discovery introduces (a cloned repository's .vcspull.yaml writing outside its checkout or overriding a user entry via nearest-wins):

  • Read-only commands (vcspull list, vcspull status, vcspull search, and preview runs of vcspull fmt and vcspull migrate) invoke load_scoped_configs or ensure_config_trusted, prompting [y/N/always] on terminals and raising VCSPullError (exit status 1) in non-TTY shells, CI jobs, and --json/--ndjson automation whenever an ancestor .vcspull.* file targets paths outside its directory.
  • _authorize_config prints every escaping destination uncapped on stderr and prompts via input(...) on stdout, pushing the config filename off-screen on large manifests and spuriously motivating 700+ lines of interactive tree-rollup UI in scopes(fix): deduplicate symlinked configs and bound CLI previews #601 (separate from symlinked user-scope deduplication in Symlinked ~/.vcspull.yaml triggers unbounded project trust prompt #600).
  • Ten CLI subcommands (sync, list, status, search, worktree, config, add, discover, fmt, migrate), docs/cli/trust.md, and $XDG_STATE_HOME/vcspull/trusted (trust_state_file, read_trusted, write_trusted, trust_directory, untrust_directory in src/vcspull/_internal/scopes.py) carry ~450 lines of surface area solely to let an upward-walked .vcspull.* file act outside its own directory without -f or a user config link.

Proposal

  • Remove vcspull trust, docs/cli/trust.md, --trust-project, VCSPULL_YES, $XDG_STATE_HOME/vcspull/trusted (trust_state_file, read_trusted, write_trusted, trust_directory, untrust_directory, requires_trust), ensure_config_trusted, and _authorize_config, with a MIGRATION entry covering 1.70.0–1.72.0 callers.
  • Enforce structural containment on upward-walked project .vcspull.{yaml,yml,json} files using escaping_destinations:
    • system (/etc/vcspull/*), user ($VCSPULL_CONFIGDIR, $XDG_CONFIG_HOME/vcspull/*, ~/.config/vcspull/*, ~/.vcspull/*, ~/.vcspull.{yaml,yml,json}, including symlinked dotfiles from Symlinked ~/.vcspull.yaml triggers unbounded project trust prompt #600), and explicit -f/--file manifests may place checkouts anywhere on disk.
    • project .vcspull.* files whose destinations resolve at or beneath their containing directory (~/work/.vcspull.yaml targeting ~/work/**, repo/.vcspull.yaml targeting ./vendor/**) load automatically.
    • project .vcspull.* files declaring destinations outside their containing directory are skipped with a one-line warning naming the file, directory, and remedies (-f/--file or linking into user configuration), so list, status, search, and sync never block on stdin or abort user-scope commands in non-TTY environments.
  • Update vcspull config ls (src/vcspull/cli/config.py) to mark escaping project files as skipped ((outside directory, skipped)) without --trust-project.
  • Record the threat model, uv/mise comparison, scope rules, and trade-offs in docs/project/adr/0002-structural-project-containment.md.

Alternatives

  • Keep vcspull trust, --trust-project, and interactive [y/N/always] prompts while capping listed escaping paths: retains the persistent $XDG_STATE_HOME/vcspull/trusted state file, --trust-project flags across ten subcommands, interactive stdin prompts, and non-TTY VCSPullError aborts on read-only commands (list, status, search) for a workflow (-f or user scope) that already exists without state.
  • Drop escaping_destinations and load every upward-walked .vcspull.* file without containment: removes escaping_destinations (~30 additional lines), at the cost of allowing a .vcspull.yaml inside an untrusted cloned repository to clone outside that checkout or override a user repository's remote URL via nearest-wins when vcspull sync runs from inside that directory.

References

Activity

  1. added
    refactor
    on Dec 6, 2026
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

    enhancementrefactor

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions