Contribute
Improve autograph itself from within any project that uses it. Metalab mode inverts the security layers so the agent works on the engine and core packages instead of your project.
Operating modes
Autograph defines three modes that determine how the agent relates to the project and the engine.
Dev mode
The agent works on your project. Engine and packages are frozen infrastructure (L2). Everything the agent does, you can do manually. It accelerates, it doesn't replace.
- L1 (mutable): your project (
workspace/) - L2 (frozen): autograph engine packages
- L3: secrets, Docker socket
Metalab mode
The agent works on autograph itself. The volume wiring is literally inverted: engine and packages become L1 (mutable), your project becomes L2 (frozen context). This is the self-improvement loop.
- L1 (mutable): autograph engine packages
- L2 (frozen): your project (
workspace/) - L3: secrets, Docker socket
Prod mode
Autograph scaffolding is stripped away. No agent, no dev tools, no overhead. Your project runs standalone with zero dependency on the engine.
Activation profiles
Each agent container declares a Docker Compose profile: the dev agent uses dev, the metalab agent uses metalab, and shared services like Phoenix are available to both.
env/.env.augr holds engine meta-configuration: the environment name, container CLI, Compose command and variant, network names, and the AUGR_NET_* corporate network block. Setup pre-fills its proxy and bypass values from the host shell without printing the proxy URL, which may contain credentials. This is distinct from per-package settings in env/dev/env.d/. For standalone Compose v1 selection and the known v2-only package-task limitation, see Compose runtimes.
Currently, task augr:up starts both agents simultaneously regardless of configuration. There is no way to start only the dev agent or only the metalab agent. The AUGR_ENV variable in env/.env.augr controls the environment name (used for config directories and caches) but does not yet control which agents are activated.
Selective profile activation (start dev only, metalab only, or both) is planned. For now, both agents start and you simply use the one you need: task augr:pkg:agent:chat for project work, task augr:pkg:metalab:chat for autograph work.
Using metalab
# Launch the metalab agent
task augr:pkg:metalab:chat
# Or open a shell for manual work
task augr:pkg:metalab:shellBoth agents run simultaneously in separate containers with the full security model. They share Phoenix for observability, with sessions tagged by mode.
The metalab agent and the dev agent share the same Docker image but operate with inverted volume configurations: engine and packages are L1 (mutable) for metalab, while your project workspace is L2 (frozen context).
Safety model
Each source entity (engine submodule, West packages) has an observable state that determines what operations are safe. The system tracks these states and blocks destructive commands when entities are at risk.
Entity states
alignedAt reference, clean working treenominalaligned-dirtyEdits on detached HEAD (no branch)dangerbranchedOn a local branch, cleansafebranched-dirtyOn a local branch, uncommitted changescautiondivergedReference is behind remoteinfoindeterminateState cannot be determinedblocks When the metalab agent edits a West package without creating a branch first, the entity is in aligned-dirty state: changes sit on a detached HEAD. Running task augr:update or west update resets modules to manifest-rev and those changes are lost. Always create a branch before committing.
Resilience model
The dev agent and metalab agent run on independent networks with independent runtime state. If one breaks, the operator uses the other to inspect and recover. At least one agent must remain functional at all times during metalab contribution.
Run task augr:engine:diagnos to see the current state of every entity in the ecosystem. The report shows states, HEAD positions, dirty counts, local-only branches, agent health, and config freshness.
Updating the shared image
Both agents share one Docker image: the dev agent owns it, metalab consumes it. Update it in two steps so an agent is always available:
- Rebuild and recreate the owner:
task augr:pkg:agent:rebuild. Validate the dev agent still works. - Adopt the validated image on metalab:
task augr:pkg:metalab:reup.
Note: task augr:build only aggregates and validates env configuration - it does not build images. Image builds happen inside task augr:up, or are forced per package with :rebuild (no-cache rebuild + recreate) and :reup (recreate on the current image, no rebuild).
The forge workflow
Forge is to metalab what "build" is to dev mode: the transition from working state to delivered artifact. The metalab agent produces changes in autograph sources; the operator forges them into upstream contributions.
Run task augr:engine:diagnos to verify the ecosystem state. Every modified entity should be in branched state. No entity should be aligned-dirty or indeterminate. Both agents should be healthy.
Inspect the diff in each modified repo (git status, git diff). The agent signals what changed and suggests commit messages.
Create a metalab/<slug> branch in each modified repo. For West packages this leaves detached HEAD (aligned -> branched).
Core packages first, engine second, seed root last. Project packages can be committed independently.
After committing, verify each commit contains exactly the reviewed changes: git diff HEAD~1 --stat, git status (must be clean).
Discover remotes first (git remote -v - do not assume origin). Push each branch in dependency order.
Create pull requests in dependency order. Downstream PRs note their upstream dependency.
task augr:update for packages, git submodule update for engine. Entities return to aligned.
Run task augr:engine:diagnos again. All entities should be aligned with clean working trees.
Delete local forge branches. Purge snapshots if no longer needed. Clear exchange zone proposals.
For v0, forge is purely operator-driven. There is no task augr:forge command yet. The operator follows explicit git commands described in autograph.pkg.metalab/docs/forge-workflow.md.
Exchange zones
Each agent mode has a dedicated exchange directory for proposing changes to files it cannot modify directly (L2 read-only files). The agent writes to its exchange zone; the operator reviews and applies via cp.
Dev agent
workspace/exchange.dev.tmp/proposed/
Proposes changes to engine files, Taskfiles, and other L2 content. Lives inside the workspace (L1).
Metalab agent
exchange.lab.tmp/
Proposes changes to project Taskfiles, root README, and workspace files. Lives at the project root, outside the workspace.
Both zones follow the mirror path convention: proposed changes replicate the host-relative path structure so it is unambiguous which file is being replaced.
Operation guards
Destructive task commands check source entity states before running. If any entity is in an unsafe state, the command refuses to proceed. Guards apply to task commands only - direct git and west commands are the operator's responsibility.
augr:updateAny entity is aligned-dirty or indeterminateaugr:upgradeEngine or packages are dirty or indeterminateaugr:engine:resetPackages have uncommitted or unpushed workaugr:uninstallSame as augr:engine:resetadmin:teardownAny entity has uncommitted or unpushed work (nuclear operation) Each guard supports an explicit --force override for cases where the operator intentionally wants to proceed. The override is logged. A generic force flag that silently skips all checks is not acceptable.
Runtime snapshots
Before risky operations (infrastructure validation, lifecycle tests, teardown), checkpoint the runtime state so you can restore sessions, auth, and agent configuration if something breaks.
task admin:snapshot copies env/<ENV>/ to env/<ENV>.snapshot/. Non-destructive - live state is unchanged.
task admin:snapshot:restore replaces live state with the snapshot copy. Removes stale .env.project (regenerate with augr:build).
task admin:snapshot:purge removes the snapshot when no longer needed. One snapshot per environment at a time; use --force to overwrite.
The former admin:backup and admin:restore commands are replaced by snapshots. Snapshots are copy-based (non-destructive) and restore the full runtime state, not just env.d/.
Manual git workflow
For direct contributions (without the metalab agent), follow the dedicated git flow.
1 Set up the remote
After task augr:install, West modules are in detached HEAD with a container-internal remote. Fix it:
cd engine/deps/modules/<package-name>
git remote -v # check current remote
git remote set-url origin <real-url> # fix if needed
git fetch origin
git checkout -B main origin/main2 Create a feature branch
git checkout -b feat/<Exx-slug>/<specialization>
# Make changes, then commit
git add -A && git commit -m '[Exx.Tyy] type: message'
# Push your branch
git push origin feat/<Exx-slug>/<specialization>3 Apply merged changes
# For packages (West-managed)
task augr:update # west update + env-collect
task augr:reup # if compose/env changed
# For the engine (submodule)
git submodule update --remote engine
git add engine && git commit -m 'chore: update engine submodule'Pitfalls
After west update, remotes use file:///workspace/repos/..., valid only inside the West container. Fix with git remote set-url before pushing.
This is normal. Your local branches are NOT deleted by west update. Just git checkout <your-branch> to get back.
If you run task augr:update without pushing first, West overwrites your local changes. For iterative dev, skip update and use task augr:rebuild instead.
When the metalab agent edits a West package on detached HEAD (the aligned-dirty state), those changes are orphaned by west update. Always create a branch (git checkout -b metalab/<slug>) before committing. Run task augr:engine:diagnos to check.
task admin:teardown removes env/ contents and deinitializes the engine submodule. All local-only work and runtime state become unreachable. Use task admin:snapshot before any destructive operation, and prefer task admin:snapshot:restore for recovery.
Key tasks
task augr:engine:diagnosEcosystem observation report (entity states, agent health, config freshness)task augr:installInit West, resolve deps, collect env templatestask augr:updateForce west update, re-collect env templates (guarded)task augr:reupStop + restart containers (applies new compose/config)task augr:pkg:agent:rebuildForce no-cache rebuild of the shared agent image + recreate dev-agenttask augr:engine:resetRemove resolved deps (forces full re-resolution, guarded)task admin:snapshotCheckpoint runtime state (copy-based, non-destructive)task admin:snapshot:restoreRestore runtime state from snapshottask admin:snapshot:purgeRemove snapshot when no longer neededtask augr:pkg:metalab:chatLaunch metalab agent session