Repository navigation
feat: vm_sync / boxery sync push a local git checkout into a VM - #207
Merged
Merged
Conversation
Commits go as a git bundle over vm_copy's streaming transport; neither side contacts a git remote. The VM checks out local HEAD (detached) and switches its working directory to a snapshot of HEAD plus staged, unstaged and untracked changes, keeping ignored files. Refuses (changing nothing) on VM-side edits since the last sync (refs/boxery/synced) and on credential files. Staged swap with a pending record, rollback and crash recovery. Reports a tree hash computed on both sides and lockfile changes.
… ignored-file clobbering - Refuse credentials anywhere in the commits the bundle sends, not just the tree. - Confined (--copy-root): no repo discovery above the root, git dir/objects/alternates must be inside it, and no fsmonitor, hooks or filter drivers run. - Crash recovery refuses rather than overwrite files edited since the crash. - Refuse when the new tree would overwrite or delete ignored VM files, or when new ignore rules expose VM files (rolled back, nothing recorded). - Refuse a VM target inside another checkout; clear errors for shallow clones. - Case-insensitive, broader deny list; pipefail; mkdir lock without flock; two-tree read-tree -m so a file changed mid-swap aborts before any write; no LFS smudge or lazy fetch; Ctrl-C waits for an in-progress apply.
git push over the VM's own ssh_config streams only the objects the VM lacks (negotiated against all its refs) into receive-pack, to a hidden refs/boxery/incoming/<id> ref. No bundle file, tar or staging directory; receive-pack's quarantine makes a cancelled push leave nothing. No hooks run on either side. The history credential check now excludes everything reachable from the VM's ref tips. The VM repo is created (in a missing or empty dir only) after the checks, just before the push. Result fields: transferred_bytes -> pushed, objects_sent.
…ig isolation - Copy the index with its mtime (both sides): a newer copy hid same-second, same-size edits, so local changes went unsynced and VM edits were missed. - History scan uses rev-list --objects (what the push sends), so merge commits and roots count; deny-dir check covers history too. - The push and its scratch repo read no user/system config and no GIT_* env: url.(push)insteadOf can't redirect it to another VM. - Push ssh uses ControlMaster=no; receive.autogc=false; cancel escalates TERM to KILL and doesn't wait forever on stderr. - Guest: no hooks or fsmonitor from the VM repo's config. - Undo init when the push into a new dir fails; drop only this sync's incoming ref plus abandoned ones over an hour old. - core.splitIndex=false for scratch-index ops; refuse partial clones.
benvinegar
force-pushed
the
feat/vm-sync
branch
from
November 9, 2026 02:04
9a71b22 to
2a7bf48
Compare
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.
Adds
vm_sync(agent tool) andboxery sync(CLI): push a local git checkout into a VM so the VM's tree matches it exactly. Push only.How it works
git pushover the VM's own ssh connection into a hidden ref. Only missing objects are sent, with no hooks on either side, no user git config, and no contact with any remote.node_modules, builds) stay. A failed swap rolls back, and an interrupted one is finished or undone by the next sync.lockfile_changed.Refuses, changing nothing
.env*,.npmrc, keys, …) in the tree or in any commit being pushed. The error points to vm_grant.Where
core/sync.mjsandcore/sync-guest.sh. The tool is in the shared table, andboxery syncruns the same entry, ascpdoes.local:. Refused over HTTP without--copy-root, and confined to that directory with it.docs/sync.md, plus links fromcli.md,mcp.md,copy.mdandpi-extension.md.Verified
lint,typecheck,npm test(457) andtest:shell(47) pass.test/sync.test.mjs: 32 offline cases using realgit receive-packin a fake VM, covering the brief's list plus fixes from two subagent reviews. I reverted each review fix and confirmed its test fails without it.Not verified / limits
This PR description was generated by Pi using Claude Opus 5.5