-
Notifications
You must be signed in to change notification settings - Fork 2
Worktree Isolation
Every issue gets its own sandbox — and enforcement is non-optional
Each GitHub issue gets its own git worktree. Agents never modify main directly. This prevents conflicts when multiple agents work concurrently and ensures every PR has a clean diff.
main (protected)
├── worktree: AssemblyZero-838/ (branch: 838-refactor)
├── worktree: AssemblyZero-840/ (branch: 840-fix)
└── worktree: AssemblyZero-850/ (branch: 850-refactor)
| Workflow | Creates Worktree? | Command |
|---|---|---|
run_requirements_workflow.py |
Yes (LLD work) | Auto-creates ../AssemblyZero-{ID}/
|
run_implement_from_lld.py |
Yes (implementation) | Auto-creates ../AssemblyZero-{ID}/
|
| Both | Cleanup after merge | git worktree remove ../AssemblyZero-{ID} |
Each worktree has a full repo copy on an independent branch. File changes in one worktree cannot affect another.
Branches share the working directory. With 3–4 agents running concurrently:
| Approach | Concurrent Agents | Risk |
|---|---|---|
| Branches only | Agent A checks out 840-fix, Agent B checks out 838-refactor
|
File conflicts, corrupted state, lost work |
| Worktrees | Agent A works in AssemblyZero-840/, Agent B in AssemblyZero-838/
|
Physically separate directories — zero conflict |
Originally, --no-worktree was documented as the default. This trained agents to lock main by running implementations directly on the main branch.
Fix: Worktree is now the DEFAULT. --no-worktree requires explicit opt-in and produces a warning. Agents that were trained on the old documentation now get worktrees automatically.
run_requirements_workflow.py was missing worktree enforcement — agents wrote LLDs directly on main. Fixed to create worktrees for LLD work, not just implementation.
A sub-agent blocked on permissions fell back to running on main instead of in its assigned worktree. The permissions dialog interrupted the worktree setup, and the agent proceeded without isolation.
Fix: Explicit worktree validation at workflow entry points — if the worktree doesn't exist, the workflow fails rather than silently falling back to main.
Before creating a PR, workflow artifacts are archived inside the worktree:
# Inside the worktree:
poetry run python tools/archive_worktree_lineage.py \
--worktree . --issue {ID} --main-repo .
git commit -m "chore: archive workflow lineage (Closes #{ID})"
# Then push and create PRThis ensures the PR includes the full decision trail: LLD, implementation spec, test reports, Gemini verdicts.
After merge:
git worktree remove ../AssemblyZero-{ID}
git branch -d {ID}-fix && git checkout main && git pullWorktree and branch are removed. main is updated. No dangling state.
- Implementation Workflow — The pipeline that uses worktrees
- Safety & Guardrails — Worktree as rollback mechanism
- Cerberus PR Governance — What happens after the PR is created
| You are... | Go to |
|---|---|
| Engineering Leader | Why AssemblyZero? |
| AI Strategy / Ops | AI Strategy & Operations |
| Technical Architect | Technical Architecture |
| Security & Compliance | Secret Guard Architecture |
| Practitioner | Quick Start |
- Q2 2026 Velocity — 398 issues closed, 321 PRs merged; the orchestrator goes end-to-end
- March 2026 Velocity — 206 issues in 21 days
- Why AssemblyZero?
- AI Strategy & Operations
- Security & Compliance
- OWASP LLM & Agentic Top 10 — AssemblyZero's own agentic risk map
- Dramatis Personae
- Multi-Agent Orchestration
- RAG and Beyond — ⚠ retired 2026-07-06 (ADR-0223); LLD grounding is now Tiphys
- Gemini Verification
- Governance Gates
- How AssemblyZero Learns
- LangGraph Evolution
- The Pipeline (Idea → Tested Code)
- Requirements Workflow
- Implementation Workflow
- The Scout
- Worktree Isolation
- OWASP LLM & Agentic Top 10 — risk map for the system itself
- Secret Guard Architecture
- Fleet Security Audit
- Agent Instruction Hierarchy
- Closing the Agent Self-Authorization Loop — separating identity for AI-safe PR governance
- Dependabot Pipeline — adjacent, intentionally separate
- Branch Protection at Scale
- Hex (Codebase) — ⚠ RAG layer retired (ADR-0223)
- Ponder Stibbons
- History Monks
- Concept Field Guide
- State of Activation — what's live, dormant, historical, or metaphor
- Audits Catalog
- Tools Reference