A harness-agnostic meta-harness for AI coding agents
Build any sequence of verified gates, wire any AI agents and CLI tools into each stage, and keep every change grounded in a live Tree-sitter code graph, parallel worktrees, and an architectural linter.
A regular agent harness (Claude Code, Codex CLI, Antigravity, Cursor) runs one LLM's prompt-and-tool loop, leaving discipline to prompt luck. ACDD sits one layer higher as a meta-harness — guiding every step, supplying context on demand, and verifying proof before work lands.
Unguided Agent Harnesses
Where autonomous sessions break down
Instructions fade mid-session — long instruction files and constraints get buried or silently ignored as context fills up.
Premature "done" claims — agents stop after happy-path edits without proving callers, edge cases, or tests actually pass.
Fragile, low-awareness edits — blind grep loops miss downstream dependencies, breaking distant modules and contracts.
Silent architectural erosion — duplicated helpers, boundary violations, and stale docs accumulate unchecked.
ACDD Meta-Harness
Controlled, evidence-backed engineering
Step-by-step gate control — every stage is an explicit node in a verified DAG; agents cannot skip ahead or self-approve.
Just-in-time context & rules — acdd_claim injects only the exact contract, guidance, and INV-* rules relevant to the current gate.
Proof required before advancing — transitions fail closed until real CLI checks (acdd_verify), JSON Schema proofs, and independent reviews pass.
Continuous architecture verification — acdd lint and the live SQLite code graph guard crate boundaries, callers, and doc links on every change.
Build any scenario you need — from focused code generation and read-only audits to complex automated workflows coordinating multi-agent swarms across isolated worktrees.
Built-in profiles let you start immediately, while flexible overrides and extensions let you tailor every gate, check, and agent runner to your repository.
01 · ACDD State
Deterministic state machine, specs & multi-agent dispatch
Start workflows from versioned Markdown specifications or ad-hoc goals, drive stages via CLI or MCP subagents, and coordinate parallel waves inside isolated worktrees.
Manual & Headless CLI
Step-by-step control from your terminal
Start a milestone spec or an ad-hoc fix, inspect ready cursors, claim a gate, verify tests and lint, and submit — or let acdd run spawn configured role runners across parallel waves.
terminal · bash
# 1. Draft or start a spec run (or ad-hoc goal) in an isolated worktree
acdd draft milestones auth-tokens --prefix AC
acdd start docs/milestones/AC-010-auth-tokens.md --worktree
# acdd start --goal "Fix auth parser" --profile hotfix --scope src/auth/
# 2. Check ready cursors & claim a task gate
acdd next
acdd claim T1.build --worker dev-1
# 3. Verify scoped checks & submit transition
acdd verify T1.build --test parser_tests
acdd submit T1.build --action pass
# 4. Independent review & commit, or headless multi-wave runner
acdd claim T1.review --worker rev-1
acdd submit T1.review --action pass --evidence review.json
# acdd run --jobs 4 # spawns configured role runners across waves
Orchestrator ↔ Agents via MCP
Thin coordinator prompts, self-claiming workers
In subagent mode, the orchestrator never pastes giant specs or claims gates on a worker's behalf. ACDD's state machine coordinates every agent over MCP:
Inspect ready waves (acdd_state): The orchestrator calls acdd_state(action="start" | "next") to resolve schedulable gate cursors and isolated worktree paths.
Spawn workers with a thin prompt: It launches subagents (Claude, Codex, Antigravity, Cursor) passing only (run, node_cursor, worker_id, worktree).
Worker self-claims context (acdd_claim): Each agent calls acdd_claim first and receives its budgeted Markdown ClaimResp (contract, architect slice, findings, blackboard, and graph lenses).
Verify, coordinate & submit: The worker edits inside its worktree, runs acdd_verify, logs decisions or rebuttals on acdd_blackboard, and advances via acdd_submit — handing off to an independent reviewer.
Spec Creation & Collections
Zero-collision spec drafting
Configure named specification directories (like milestones and plans) with automatic sequential IDs. Draft specs via acdd draft or launch the built-in spec_planning profile so an architect validates acceptance criteria and disjoint wave scopes.
Wave Scheduling, Snapshots & Compaction
Durable state across restarts
Inspect cross-run dependency waves with acdd roadmap, save Git checkpoints with acdd snapshot, expand write scopes via acdd extend-scope, and reload active contracts after context compaction with acdd context.
Polyglot Tree-sitter graph built for speed and freshness
Every admitted file is parsed into a single incremental SQLite graph (.acdd/code-map.sqlite) linking AST symbols, calls, documentation sections, and cross-repo libraries.
01 · Extraction Pipeline
How languages are indexed
Native Tree-sitter grammars extract declarations, imports, calls, and receiver bindings, while typed framework manifests resolve framework conventions (Django, HTMX, Alpine, Vue/Nuxt, GridViewSpec). Mixed templates ({% ... %}, {{ ... }}) are byte-masked by TemplateMasker before HTML/JS parsing so line offsets stay exact.
02 · Benchmark Speed
Fast cold builds & 12–25ms queries
Measured on a 4,150-file polyglot corpus (72,293 nodes, 221,662 edges, 2,967 doc sections): cold build finishes in ~10.0 s median, single-file incremental delta in ~2.8 s, and warm MCP queries (code_map_search, inspect, impact, search_docs) respond in 12–25 ms p50.
03 · Auto-Refresh & Digest Safety
Always fresh without manual rebuilds
Over MCP (acdd serve), each request verifies workspace identity and adapter digest, automatically running incremental delta or full rebuilds on edits (reusing a valid inventory check for up to 5 seconds). acdd_read rejects stale snippets by SHA-256 digest, and CLI commands trigger automatic rebuilds when an index is missing.
04 · Code ↔ Docs Binding
Verified documentation edges
Markdown files are split at headings into BM25-searchable sections. Code claims and INV-* invariants resolve uniquely against indexed AST symbols to create verified governs edges surfaced directly inside code_map_inspect and code_map_explain.
05 · Multi-Repo Graphs
Linked Workspaces
Index shared libraries or companion repositories alongside your primary project via acdd.yaml. Each linked entry declares its own source roots, docs, and exclusions, resolving cross-repo imports and docs while tracking coverage separately per workspace.
Tier-2 (8, --features all-languages): Go · Java · C# · Kotlin · PHP · Ruby · C · C++
03 · ACDD Lint
How acdd lint enforces rules across code and docs
Rules declared in acdd.yaml and executable acdd-rule blocks inside Markdown docs compile into one check pass against code-map.sqlite — blocking architectural drift in gates and CI.
Full acdd lint --categories all
What gets checked
arch — Architectural Boundaries (8 primitives): evaluates forbid_dependency, allow_only_dependencies, single_owner, forbid_cycles, boundary_entry, must_implement, ast_pattern, and doc_integrity rules from acdd.yaml and Markdown acdd-rule blocks.
docs — Documentation Integrity & Governance: checks frontmatter, Markdown links and heading anchors, symbol claims against indexed code files, stale declaration line ranges, duplicate non-contract INV-* declarations, orphan invariants lacking a governs link or acdd-rule, and invalid rule YAML.
syntax — Tree-sitter Parse Diagnostics: surfaces syntax and grammar parse errors across all admitted source files (syntax.parse).
duplicates — Structural Code Clones: detects exact and parameterized duplicate code blocks across functions and methods.
dead_tails — Call & Test Graph Hygiene: catches unreachable symbols (dead_tails.unreachable), functions covered only by orphaned tests (dead_tails.phantom_tested), and unresolved calls (dead_tails.dangling_call).
cycles — Dependency Cycles: identifies strongly connected call and import components across the workspace graph (cycles.scc).
Default gate checks run arch, syntax, and docs; pass --categories all for the full 6-category workspace sweep.
04 · ACDD Profiles
Built-in profiles, gates & what agents receive in context
Five embedded profiles out of the box — plus repository overlays you can inherit, patch, or compose for any stack.
baseworktree · save: commit
Foundation profile supplying default tool admission, protective limits, core execution/review guidance, and paths / claims / administration contours.
Markdown delivered to independent_reviewer by acdd_claimscroll ↓
# Gate Claim: `T1.review`
- Run: `PAY-014`
- Claim Revision: `1`
- Contract Revision: `1`
- Worker: `reviewer-1`
- Worktree: `/repo/.worktrees/PAY-014-T1`
- Candidate Tree: `7c12d8aa...`
- Inspect: `acdd show T1.review --run PAY-014`
## Contract
- **Gate**: `tasks.review`
- **Proof**: `review`
- **Task**: `T1`
- **Scope**: `src/billing/webhook.rs`, `src/storage/ledger.rs`, `tests/billing_test.rs`
### Contours
#### `paths`
- Verify modified, staged, and untracked files stay strictly within admitted scope.
#### `claims`
- Verify every `AC-*` criterion has live test evidence proportional to operational risk.
#### `architecture`
- Verify single-owner reuse, zero `duplicates` clones (`>= 5` lines), and zero `dead_tails`.
#### `concurrency`
- Verify concurrent webhook replays serialize cleanly under unique constraint without races.
#### `project_isolation`
- Verify no hardcoded paths, temp leaks, or cross-workspace writes.
#### `administration`
- Verify `BUDGET_OVERRIDE` authority vs measured net LOC (`+54 / -18 = 36 <= 85`).
## Guidance
- **INDEPENDENT TASK REVIEW**: No early-abort — audit every declared contour and changed file in one pass; search sibling call sites on any defect.
- **INDEPENDENT EVIDENCE-BASED REVIEW**: Reject only on concrete contract or invariant violations; post optional follow-ups to `acdd_blackboard` (`topic: deferred`).
## Pre-Task Architectural Slice
- **Max Net LOC**: `85`
- **Verification Seam**: `tests/billing_test.rs::dedupes_replayed_webhook_atomically`
- **Canonical Owners**: `src/billing/webhook.rs`, `src/storage/ledger.rs`
- **Negative Boundaries**: Do not add a separate Redis cache or middleware table.
## Dependency Receipts
- `T1.build` @ `7c12d8aa...` (verified `build_check`, `code.seam`, `code.lint`)
## Blackboard
- #112 [notes | builder-1]: Moved `verify_hmac` ahead of `begin_tx()`; verified 0 clones & 0 dead tails.
## Repository Instructions - MANDATORY
- `AGENTS.md` (Review Authority, Verification Gates)
- `src/billing/AGENTS.md` (Idempotency Keys, Transaction Ownership)
## Governing Invariants
- `INV-BILLING-IDEMPOTENT` (`docs/adr/0004-idempotent-ledger.md:14`) [ENFORCED]
- `INV-WEBHOOK-HMAC-FIRST` (`docs/adr/0009-webhook-auth-boundary.md:21`) [ENFORCED]
## Scoped Symbols & Tests
- `WebhookProcessor::handle` : 38:96 : `pub async fn handle(&self, sig: &str, raw: &[u8]) -> Result<WebhookOutcome>`
- `dedupes_replayed_webhook_atomically` (`tests/billing_test.rs:42`)
- `rejects_invalid_hmac_without_db_write` (`tests/billing_test.rs:88`)
## External Callers
- `routes::stripe_webhook_handler` (`src/api/routes.rs`) -> `WebhookProcessor::handle`
tasks.<id>.deliver
Immutable Candidate Commit
Verifies that the working tree matches the reviewed candidate_tree OID, creates an atomic commit stamped with Acdd-Claim, and records a durable receipt.