Repository navigation
Description
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 ofvcspull fmtandvcspull migrate) invokeload_scoped_configsorensure_config_trusted, prompting[y/N/always]on terminals and raisingVCSPullError(exit status1) in non-TTY shells, CI jobs, and--json/--ndjsonautomation whenever an ancestor.vcspull.*file targets paths outside its directory. _authorize_configprints every escaping destination uncapped onstderrand prompts viainput(...)onstdout, 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.yamltriggers 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_directoryinsrc/vcspull/_internal/scopes.py) carry ~450 lines of surface area solely to let an upward-walked.vcspull.*file act outside its own directory without-for auserconfig 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 aMIGRATIONentry covering1.70.0–1.72.0callers. - Enforce structural containment on upward-walked
project.vcspull.{yaml,yml,json}files usingescaping_destinations:system(/etc/vcspull/*),user($VCSPULL_CONFIGDIR,$XDG_CONFIG_HOME/vcspull/*,~/.config/vcspull/*,~/.vcspull/*,~/.vcspull.{yaml,yml,json}, including symlinked dotfiles from Symlinked~/.vcspull.yamltriggers unbounded project trust prompt #600), and explicit-f/--filemanifests may place checkouts anywhere on disk.project.vcspull.*files whose destinations resolve at or beneath their containing directory (~/work/.vcspull.yamltargeting~/work/**,repo/.vcspull.yamltargeting./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/--fileor linking intouserconfiguration), solist,status,search, andsyncnever block onstdinor abort user-scope commands in non-TTY environments.
- Update
vcspull config ls(src/vcspull/cli/config.py) to mark escapingprojectfiles as skipped ((outside directory, skipped)) without--trust-project. - Record the threat model,
uv/misecomparison, scope rules, and trade-offs indocs/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/trustedstate file,--trust-projectflags across ten subcommands, interactivestdinprompts, and non-TTYVCSPullErroraborts on read-only commands (list,status,search) for a workflow (-foruserscope) that already exists without state. - Drop
escaping_destinationsand load every upward-walked.vcspull.*file without containment: removesescaping_destinations(~30 additional lines), at the cost of allowing a.vcspull.yamlinside an untrusted cloned repository to clone outside that checkout or override a user repository's remote URL vianearest-winswhenvcspull syncruns from inside that directory.
References
- Separate symlinked user-scope deduplication bug: Symlinked
~/.vcspull.yamltriggers unbounded project trust prompt #600 (and scopes(fix): deduplicate symlinked configs and bound CLI previews #601) - Original scopes and project-trust introduction (
1.70.0, 012e67b): Configuration scopes: system, user, and project config resolution #564 - Trust state and gating in
v1.72.0(8419df6):src/vcspull/_internal/scopes.py,src/vcspull/config.py,src/vcspull/config.py(ensure_config_trusted/_authorize_config),docs/configuration/scopes.md,docs/cli/trust.md - Prior ADR format (
v1.72.0):docs/project/adr/0001-repository-aliases.md - Roadmap:
1.68.xand beyond Roadmap #592
Activity