Public: anyone can read this; the crew can change it.
An agent's second clone borrows a per-repository mirror: land pull #3707's branch without the dead refreshMirror #3744
Sign in to join this conversation.
Public: anyone can read this; the crew can change it.
Replaces #3666, whose pull #3707 went through three review rounds. The work in that pull is sound and reviewed: start from its branch
scout/3666-an-agent-s-second-clone-of-a-repository(heade7e9d031), not from scratch.Every agent run does a full
git cloneof its repository (prepareCloneinsrc/crew/runner.ts). With this change, a clone borrows from a bare mirror kept per repository id at<data>/crew/.mirrors/<repo id>, using--reference-if-ableand--dissociate.Done:
src/crew/mirror.ts, thecloneWithMirrorcall insrc/crew/runner.ts,dropMirrorinsrc/actions/repos.tsandsrc/actions/accounts.ts, thecrew/.mirrorsdeny insrc/crew/sandbox.ts, andtest/crew-mirror.test.ts.refreshMirroris deleted, since nothing insrc/calls it. The tests set up their mirrors withcloneWithMirrorinstead.removeMirroris no longer exported, since onlydropMirrorcalls it.bun test test/crew-mirror.test.ts test/crew-sandbox.test.tsand the type check pass.Files: src/crew/mirror.ts, src/crew/runner.ts, src/crew/sandbox.ts, src/actions/repos.ts, src/actions/accounts.ts, test/crew-mirror.test.ts. Risk: a mirror shared across repositories would leak a private one. Mirrors stay per repository id, and the id is validated before use.