Pattern
- Create one repository per generated app, site, package, or user project.
- Mount the repository when an agent needs to change it.
- Let autosave protect work during the run; snapshot deliberate milestones as Git commits.
- Promote accepted changes back to the project branch.
- Use repository activity to see what agents created, updated, merged, or published.
Create Repositories at Product Scale
Create repositories from your control plane when users start new projects:- Python
- TypeScript
Why This Scales
A repository is the durable unit for a user project. A mount is the ephemeral file-system path for one sandbox. A workspace is the isolated snapshot history for one agent run. That separation keeps high-volume platforms simple: your control plane can create, list, fork, archive, and update repositories through the SDKs, while agents work through writable mounts. Mounting does not copy the whole repository into the sandbox. File content is fetched as processes read it, autosave persists changed content into private workspace WAL, and snapshots materialize deliberate Git commits without forcing every run to become one large final commit. Use branches for product states such asmain, preview, or release. Use workspaces for in-progress agent attempts.
Store Generated Files
When a backend process already has a generated worktree, push it directly:- Python
- TypeScript
push_worktree and pushWorktree create one commit from a local directory. They skip .git, honor .gitignore, preserve symlinks, and preserve executable bits on regular files.
Use this for generated code, app assets, docs, migrations, configuration, and deployment metadata:
Let Agents Work in a Mounted Workspace
When an agent is editing an existing project, mount the repository into the sandbox:/work like a normal directory. Autosave protects the changing state in private workspace WAL. Create snapshots when the run reaches meaningful Git history boundaries:
app-7f3c2a1b, build systems that clone it, and developers who fetch it get the published version.
Update Existing Repositories Safely
Generated applications keep changing after the first version. Users ask agents to add pages, fix bugs, change copy, update dependencies, or regenerate docs. For backend pushes, passexpect_oid in Python or expectOid in TypeScript when the update should fail if the branch moved:
- Python
- TypeScript
Visibility for Agent Fleets
Every repository and workspace has activity you can inspect through the API and dashboard:- Which repositories exist for user projects.
- Which branches changed.
- Which workspaces are live, detached, or resumable.
- Which durable WAL checkpoints and snapshots each agent created.
- Which paths changed in a snapshot.
- Which principal pushed, promoted, merged, or reconciled changes.
Scale Model
Next Steps
Repository SDKs
Create repositories, push worktrees, merge branches, and inspect refs from application code.
Repository Mounts
Mount, snapshot, and promote code generated by agents.
Merging Changes
Handle branches that moved while an agent was working.
Architecture
Understand snapshots, lazy content delivery, merge behavior, and observability.