Skip to content

Latest commit

 

History

History
50 lines (33 loc) · 5.98 KB

REVIEW.md

File metadata and controls

50 lines (33 loc) · 5.98 KB

Code and architecture review (vcs-python/vcspull)

Posture: stable (CLI and workspace synchronization orchestrator built on libvcs; repair asymmetric or leaky boundaries at the owning module and update callers, schema, docs, and CHANGES in the same diff; keep released configuration files and CLI behavior working, or ship a deprecation path).

Posture defines experimental, stable and private.

Review the complete change against <base>, including untracked files. Report all findings in one pass without editing files. Writing conventions · Contributing gates · AI policy.

1. Layer ownership

vcspull owns workspace manifest loading, path and glob filtering, multi-repository orchestration, and CLI reporting. libvcs owns VCS URL grammar, repository detection, remote and branch queries, sync primitives, and git/hg/svn subprocess execution.

Layer Modules Owns Must not own
CLI surface src/vcspull/cli/* Argument parsing (sync, add, discover, import, list, search, status, fmt, migrate, worktree), human/JSON formatting, exit codes, and dry-run output Config merging rules, direct git subprocesses, or libvcs._internal imports
Orchestration and config src/vcspull/config.py, validator.py, types.py, _internal/* YAML/JSON manifest discovery, path expansion, deduplication, schema validation, and worktree plan orchestration Re-implementing libvcs URL detection or calling subprocess.run(["git", ...]) directly
VCS substrate (libvcs) External vcs-python/libvcs public API Repository state, remotes, worktrees, rev-parse/status/fetch commands, and URL schemes vcspull manifest schemas or terminal progress rendering

Changing the map

Do not BLOCK against <base>:REVIEW.md's prior owner row when a pull request migrates an invariant cleanly to a single owner, updates callers, tests, and REVIEW.md in the same diff, and states the old and new owner in the pull request description.

Adapters and format leaks

  • Adapter versus duplicated rule: CLI subcommands (src/vcspull/cli/*) translate flags, dry-run previews, and output formatting over config.py, validator.py, and _internal/*. Block when CLI modules duplicate manifest normalization or URL validation, or when new code imports cross-package libvcs._internal symbols (same-package vcspull._internal imports remain valid).
  • Zero-import format leaks: Check dependency direction even when imports stay clean. Block config.py, validator.py, or _internal/* modules that parse syrupy .ambr snapshot syntax, branch on PYTEST_CURRENT_TEST, or store test-only state on config models.

Rejected here

  • Shelling out to git directly in vcspull (config.py, cli/{add,discover,status,sync}.py, _internal/{config_style,worktree_sync}.py): Add missing repository inspection or worktree methods to libvcs's public API instead of spawning new raw git subprocesses in vcspull.
  • Importing cross-package libvcs._internal symbols (types.py, validator.py, _internal/sync.py, cli/{status,sync}.py): Promote needed types or helpers to libvcs public exports first rather than expanding libvcs._internal migration debt.
  • Treating partial multi-step success as total failure (3f45908): When _create_worktree creates a usable worktree on disk and a subsequent git worktree lock step fails, preserve the created state and surface a structured warning rather than reporting the worktree creation itself as failed.
  • Unexpired URL-pattern shims: EXTRA_EXPLICIT_URL_PATTERNS in src/vcspull/validator.py is a temporary workaround for vcs-python/libvcs#546 and must remain tracked in .github/workarounds.toml (pypi:libvcs>=0.49.0) with vcspull-daemon-url-schemes cited in source until libvcs lands native daemon-scheme support.

2. Regression baseline and decision

  1. For bug fixes and behavioral changes, prove the test fails on <base> (or on <pre_fix_head> when fixing a defect introduced earlier in the same open pull request) through the public CLI or orchestrator API.
  2. Check partial failure on every multi-step filesystem or worktree operation: verify what persisted on disk if step N fails and what a retry does without discarding uncommitted work.
  3. Run the production-only revert check (for behavioral changes), uv run ruff check ., uv run ruff format . --check, uv run ty check --error-on-warning ., uv run py.test, and the shared libtmux/.github/actions/check-workarounds action, which CI runs.
  4. Emit BLOCK or NO FINDINGS (plus optional non-blocking NOTE items). Before emitting BLOCK on placement, weigh any boundary-adapter or ownership-transfer counter-case and name a concrete observation or command that would prove the finding wrong.

3. Verdict

These rules decide which findings block.

  • Base run: A finding that code misbehaves shows its check run on <base> and on the change, with one line of output from each.
  • Existing and separate: Behavior <base> already has does not block. Report it as a NOTE, unless the change adds a promise the behavior breaks; then the broken promise is the finding.
  • Unverified: A gate nobody ran is unverified. Name the command that would run it. It holds the merge until someone runs it, and it does not make the verdict BLOCK.
  • Behavior defects: A behavior defect blocks when a caller can reach it in a supported environment, or when it breaks a promise in the pull request description, a docstring, help text or the changelog. Otherwise it is a NOTE.
  • Checks and claims: A weakened check, a rule written in a second place and a behavior claimed as tested with no test that bites block whether or not a caller reaches them.