Problem
internal/mission/repo.go's CopyRepo copies the repo-library repo into each mission's agent/ directory with plain rsync -a (no --link-dest, no clonefile). This produces a full, independent copy of the working tree, including .git. Nothing is shared between missions, even when many missions clone the exact same repo.
Impact (real numbers from one user's machine)
- Each mission that uses a repo carries a complete copy. Example: every Exobrain mission has a ~600 MB
.git pack and totals ~1.1 GB.
- Across 442 missions this reached ~161 GB, the large majority of it redundant (a handful of repos cloned hundreds of times). Verified independent copies: no
alternates, link count 1, distinct physical blocks.
Request
Make the mission agent/ copy space-efficient. Options, best-first on macOS:
- APFS
clonefile / cp -c — copy-on-write clone from the repo-library copy. Instant, shares physical blocks, and diverges only on write. Ideal on APFS.
git clone --local — hardlinks .git/objects from the source repo.
rsync --link-dest=<repo-library-copy> — hardlinks unchanged files.
Since ~/.agenc/repos/<repo> already holds the canonical copy, the mission agent/ could be a COW clone / hardlink of it rather than a fresh rsync.
Caveat to acknowledge
In-mission git repack / gc will diverge hardlinked packs over time (so git clone --local savings erode as missions age). APFS clonefile handles this gracefully via copy-on-write, which makes it the most robust choice on APFS. Even the initial savings are large.
Secondary suggestion
Add a first-class agenc mission gc / prune command that deletes old missions' agent/ directories while keeping the mission record + session transcript (for provenance). Today the manual method is deleting the agent/ dir inside each old mission; a built-in command (e.g. "delete agent/ for missions older than N days") would make reclaiming existing bloat easy.
Filed via Adjutant
Problem
internal/mission/repo.go'sCopyRepocopies the repo-library repo into each mission'sagent/directory with plainrsync -a(no--link-dest, no clonefile). This produces a full, independent copy of the working tree, including.git. Nothing is shared between missions, even when many missions clone the exact same repo.Impact (real numbers from one user's machine)
.gitpack and totals ~1.1 GB.alternates, link count 1, distinct physical blocks.Request
Make the mission
agent/copy space-efficient. Options, best-first on macOS:clonefile/cp -c— copy-on-write clone from the repo-library copy. Instant, shares physical blocks, and diverges only on write. Ideal on APFS.git clone --local— hardlinks.git/objectsfrom the source repo.rsync --link-dest=<repo-library-copy>— hardlinks unchanged files.Since
~/.agenc/repos/<repo>already holds the canonical copy, the missionagent/could be a COW clone / hardlink of it rather than a freshrsync.Caveat to acknowledge
In-mission
git repack/gcwill diverge hardlinked packs over time (sogit clone --localsavings erode as missions age). APFSclonefilehandles this gracefully via copy-on-write, which makes it the most robust choice on APFS. Even the initial savings are large.Secondary suggestion
Add a first-class
agenc mission gc/ prune command that deletes old missions'agent/directories while keeping the mission record + session transcript (for provenance). Today the manual method is deleting theagent/dir inside each old mission; a built-in command (e.g. "deleteagent/for missions older than N days") would make reclaiming existing bloat easy.Filed via Adjutant