| title | Augmented Context & Durable Dispatch (ACDD) |
|---|---|
| doc_type | guide |
Augmented Context & Durable Dispatch (ACDD) is ACDD's declarative lifecycle
state machine (crates/acdd-state + crates/acdd-core) for structured AI and
human software engineering. Instead of letting coding agents run open-ended
loops over an entire repository, ACDD binds Git-tracked specifications, SQLite
run state, and declarative v2 YAML GateProfile graphs into atomic, verifiable
gates that deliver only the context needed for the active step.
ACDD separates what must be built from how work is governed and verified:
- Git-Tracked Authority (
docs/milestones/*.md,docs/plans/*.md): Humans and architects keep contracts,### task:specifications, write perimeters (scope), dependency edges (depends_on), and proof policies in Markdown under Git (specs:collections inacdd.yaml). Milestone and taskspecreferences andacceptance_criteriaproject only the claimed task's criteria intoClaimResp.contract. - Persistent Run Queue & Proof Store (
.acdd/state.sqlite): ACDD synchronizes specifications and profile graphs into the primary worktree's.acdd/state.sqlite(runs,gate_nodes,task_dependencies,subtasks,gate_claims,gate_traces,gate_artifacts,blackboard,run_tombstones). Rebuilding.acdd/code-map.sqlitenever resets active run state or traces. - Declarative Governance Profile (
version: 2GateProfile): Defines Git isolation/integration (git:), persistence (save:), roles, commands,DomainProviderhooks (call,checks,context,tools_add/tools_remove), proof schemas, guidance slots, review contours, and ordered gates withpass/failedges.
Claiming a gate returns the budgeted ClaimResp bundle (ADR 0006, crates/acdd-state/src/context/mod.rs)
ordered across 6 priority tiers inside ResponsePolicy.max_output_bytes:
- Tier 1 (
contract+guidance): Mandatory claimed task/gate specification and resolved gate guidance entries (reserved insidemax_guidance_bytes, never truncated; fails withGUIDANCE_BUDGET_EXCEEDEDif oversized). - Tier 2 (
unresolved_findings+ failed trace tail): Structured findings and the tail of the latest failed trace log after a reject/fail rewind. - Tier 3 (
pre_task_slice): Pre-task blueprint slice (proof.tasks[<task_ref>]) emitted byblueprint_synthesis, andpredecessor_proofsfrom completed upstream sibling gates in the same container (e.g.,auditrecon -> analyze -> triage). - Tier 4 (
dependency_receipts): Receipts from completed dependency tasks. - Tier 5 (
blackboard): Up to 15 relevant blackboardnotes,blockers, anddecisionsentries capped at 500 characters each (excludesfindings, which arrive in Tier 2unresolved_findings). - Tier 6 (
context_lenses): DynamicDomainProviderlenses declared on the gate'scontext:list (e.g.,docs.adrs,docs.invariants,code.symbols,code.tests,code.external_callers), trimmed cleanly by section if needed and reported inomitted_sections.
MCP state tools and flat CLI commands share src/format/lifecycle.rs Markdown
rendering (delegating ClaimResp prompt formatting to
render_claim_prompt_markdown) by
default, or structured JSON via format: "json" / --format json;
see the task lifecycle Markdown contract.
Read-only StateQuery::Roadmap (acdd roadmap, acdd_state(action: "roadmap"))
aggregates specs across configured specs: collections with active runs, dependency
waves, critical-path ordering, scope-overlap markers, and optional per-spec task
drill-down. Formatting lives in src/format/roadmap.rs; the query opens
.acdd/state.sqlite read-only when present and does not create a missing database.
Under ADR 0003
and ADR 0004,
ACDD runs all workflows through one state machine (crates/acdd-state), selected
by GateProfile git: and save: policies:
| Mode / Embedded Profile | Spec / Input | Isolation & save |
Primary Use Case |
|---|---|---|---|
base |
Any spec or --goal |
git.isolation: worktree, save: commit |
Domain-pure baseline (gates: []) for custom overlays |
code (default) |
docs/milestones/*.md or custom spec |
git.isolation: worktree, save: commit |
Multi-task milestones with blueprint_synthesis, task worktrees, and verified handoff |
audit |
Any spec or --goal |
git.isolation: in_place, save: none |
Read-only recon -> analyze -> triage review and taint scanning with .acdd/reports/{run_name}.md |
documentation |
Any spec or --goal |
git.isolation: worktree, save: commit |
Compiler-free documentation and acdd-rule authoring gated on docs.links and code.lint ([arch, docs]) |
In-place / --goal |
Materialized .acdd/run/<run_id>/spec.md + --scope |
Defaults to code (worktree) unless --in-place (save: none) or --profile audit |
Taskless goal sweeps, autonomous QA, and single-branch runs |
Everything in a v2 GateProfile is a gate declared under gates:. Every
gate uses one primary proof/execution contract:
- Role / review / delivery gate (
role: <role_id>): Claimed viaacdd claim/acdd_claimand completed viaacdd submit/acdd_submit. Review gates declareproof: reviewand non-emptycontours:; delivery/handoff gates declarereceipt: trueandsave.post: commit(ornoneinin_place). - Command gate (
command: <command_id>, optionally paired with arole:): Executed viaacdd verify/acdd_verify(or headlessacdd run) against the registered command slot andtest_filter. Passingcommandproofs require exit code0(plus any attachedchecks:such ascode.seam). - Domain action / check gate (
call: <domain>.<action>,checks: [<domain>.<check>]): InvokesDomainProvidercapabilities registered insrc/state_bridge/(such ascode.seamreachability,code.lintarchitectural/doc lint, andcode.signature_scopeinsrc/state_bridge/code_domain/, ordocs.linksinsrc/state_bridge/docs_domain.rs). (docs.invariantsstamps"enforced": true/[ENFORCED]on invariants backed byacdd-ruleoracdd.yamlarchitecture.rules.) - Container gate (
gates: [...]): Groups sequential child gates under dotted hierarchical cursors (e.g.,blueprint_synthesis.synthesize->blueprint_synthesis.review). - Task container (
- tasks: { when?, gates: [...] }): Expands its child gate sequence for each matching admitted task, scheduled in topological DAG waves fromdepends_on/task_dependencies.
Profile containers expand into gate_nodes rows (container, root_gate,
task, task_gate) addressed by dotted NodeCursor identifiers
(blueprint_synthesis.synthesize, <task_ref>.build, verify, handoff).
Pre-task root gates run before - tasks: blocks unlock; when a pre-task gate
like blueprint_synthesis.synthesize submits proof: blueprint containing
tasks.<task_ref>, acdd-state injects strictly that task's slice as Tier 3
(pre_task_slice) when claiming that task.
Domain checks wired via checks: [code.seam] (implemented in
src/state_bridge/code_domain/mod.rs) verify
indexed test reachability into admitted production scope (calls, imports,
possible_calls, etc.) and reject out-of-scope public signature callers before
completion.
code_map_query(operation: "duplicates") pages duplicate symbol bodies and
repeated normalized code blocks in the indexed graph. At level: "symbol"
(default), duplicates_paged and MCP code_map_query(operation: "duplicates")
default min_lines to 5 when the argument is omitted; the CLI
acdd query run duplicates --min-lines flag still defaults to 10 unless set
explicitly. exact whole-symbol groups hash the blank-trimmed raw symbol
body (leading/trailing blank lines removed, indentation preserved). block
windows hash indent-normalized non-empty lines for each >= min_lines slice.
Near clones cluster by name and line similarity. block matches cover
repeated normalized windows across symbols/files or at non-overlapping positions
within one function (overlapping shifted windows are not double-counted). Block
groups that only repeat an already-reported whole-symbol exact or
similar clone are suppressed. See mcp-tools.md and
cli.md for pagination and scope options.
- Independent Worker Enforcement (
independent_from): Claim and submission verify thatworker_iddiffers from the accepted worker of each named predecessor gate (TASK_REVIEW_NOT_INDEPENDENT). - Forward & Rejection Routing (
pass,fail,fail_drift): Passing advances sequentially or topass:. Rejecting (--action reject) or failing routes alongfail:(ondefect) orfail_drift:(onarchitectural_drift, e.g.,rearchitect->buildtriggering builder context reset) with mandatory structuredRejectionFindings. Roles withreuse_on_reject: trueinstruct the runner/coordinator to return findings to the prior worker ondefectrejections. - Conditional Task Tracks (
when) & Retry Budgets (max_attempts):- tasks:andtask_gatenodes support booleanwhen:tag expressions evaluated against each task's effectivetags(tags:in profile + task YAML). Explicitmax_attempts(default3,>= 1) caps failures/cycles before escalation. - Save & Candidate Immutability (
save): Claim admission recordsclaim_treefrom the scoped candidate tree (TreeOid);save.immutable: truerejects candidate drift at submit (TASK_CANDIDATE_MISMATCH);save.post: commitcreates a scoped Git plumbing commit (Acdd-Claim) without polluting untracked engine paths excluded byWorkspacePathPolicy;save.post: snapshoton leaf task gates writes confined checkpoint refs underrefs/acdd/snapshots/...(see task snapshots).
Profiles follow the loading precedence documented in ACDD profiles
and Workspace configuration.
Repositories typically rely on the automatic workspace default (.acdd/profile.yaml
when present, else built-in code) and customize .acdd/profile.yaml with version: 2,
inherit: code (or base / audit), gates_patch:, and project
command bindings:
version: 2
inherit: code
gates_patch: []
commands:
test: "cargo test --lib {test_filter}"
build_check: "cargo clippy --all-targets -- -D warnings && cargo test --lib"
verify_all: "cargo clippy --all-targets --all-features -- -D warnings && cargo test --all-targets"crates/acdd-state/src/profile/embedded/base.yaml
defines the domain-pure baseline (gates: [], 7 core default_tools,
universal core.execution, core.review, and hitl.pro guidance, and three
core contours paths, claims, and administration). Embedded
code.yaml (the
built-in code-delivery fallback when .acdd/profile.yaml is absent) inherits base, adds the three-phase
milestone lifecycle (commands: build_check and verify_all are marked
unbound: true), sets tags: [default, docs] (docs-tagged tasks skip
code.seam), binds the 20 default_tools, attaches code.seam and code.lint checks and
docs.* / code.* context lenses, adds code.principles and code.tools, and
automatically strips disabled code.* / docs.* tools, checks, and lenses when
modules.code: false or modules.docs: false. Embedded
audit.yaml inherits base
with git.isolation: in_place and save: none, defining a read-only recon -> analyze -> triage
review and security/taint scanning pipeline that propagates upstream stage proofs via
predecessor_proofs and writes Markdown reports via save.report: ".acdd/reports/{run_name}.md".
Embedded documentation.yaml
inherits base with modules: { required: [docs, code] }, providing a
compiler-free lifecycle (blueprint_synthesis -> tasks build/review/deliver
-> verify_docs -> polish -> integration_review -> handoff) gated by
docs.links and code.lint ([arch, docs]).
Phase 1: Pre-Task Root Container (`blueprint_synthesis`)
└─ synthesize (role: architect, proof: blueprint) ──► review (role: independent_reviewer, fail -> synthesize)
│
▼ (fans out per-task blueprint slices; unlocks `- tasks:` wave)
Phase 2: Per-Task DAG Container (`- tasks:`, executed in topological waves)
└─ build (role: builder, command: build_check, proof: command, save.post: snapshot)
└─► review (role: independent_reviewer, proof: review, 6 contours, immutable, fail -> build, fail_drift -> rearchitect)
└─► deliver (role: independent_reviewer, need [build, review], receipt: true, save.post: commit)
(rearchitect: role: architect, pass -> build with builder context reset)
│
▼ (all non-cancelled tasks completed)
Phase 3: Post-Task Closure
└─ run_tests (command: verify_all, proof: command, max_attempts: 3)
├─ fail ──► polish (role: builder, command: verify_all, explicit polish scope, pass -> run_tests)
└─ pass ──► integration_review (role: independent_reviewer, independent_from [polish, tasks.build], need [run_tests], immutable, fail -> polish)
└─ pass ──► handoff (role: independent_reviewer, need [run_tests, integration_review], receipt: true, save { immutable, commit, archive, prune })
- Roles (
code.yaml):architect(subagent,reuse_on_reject: true),builder(subagent,reuse_on_reject: true), andindependent_reviewer(subagent,reuse_on_reject: false). - Contours:
paths,claims, andadministration(inbase.yaml);architecture(single-owner reuse, minimal complexity, strict layer boundaries, and zero shadow subsystems),concurrency, andproject_isolation(incode.yaml). - Guidance slots:
- Universal (
base.yaml):core.execution(admitted scope, proportional verification, andREBUTTAL OVER BLIND REWRITE),core.review(BURDEN OF PROOFandacdd_blackboarddeferred routing), andhitl.pro. - Code & milestone (
code.yaml):code.principles,code.tools,milestone.synthesis,milestone.blueprint_review,milestone.polish,milestone.review,milestone.handoff,task.code,task.review, andtask.rearchitect(each gate composes four clean layers: task/stage slot,core.*,code.principles+code.tools, andhitl.pro).
- Universal (
acdd run (--jobs N, --allow-main, --dry-run) drives the active Run's
DAG waves using crates/acdd-state/src/runner/:
- Mechanical
command:/call:gates run directly viaverify+submit. - Role-assigned gates require an explicit
runner:template onroles.<role>(otherwise failing closed withWORKFLOW_RUNNER_REQUIRED). - Each spawned runner receives a fresh session fingerprint, isolated process
group, and rendered
ClaimRespon stdin; exit status0without an accepted submission fails closed withRUNNER_NO_SUBMISSION. - See CLI reference and State, tasks & lifecycle for wave execution and recovery details.
A task that changes observable behavior, public interfaces, workflows, configuration, or operational assumptions updates matching documentation and agent instructions during its build stage (and includes those paths in its initial scope). Follow the shared skill's task guidance.
acdd-index selects tree-sitter language grammars at compile time through Cargo features (with built-in sql always enabled):
- Default build (
defaultfeature set):lang-html(htmlfor.html,.htm,.j2),lang-yaml(yaml),lang-toml(toml),lang-bash(bashfor.sh,.bash,.zsh),lang-css(cssfor.css),lang-json(jsonfor.json),lang-python(python),lang-rust(rust),lang-typescript(typescript,javascript,tsx,jsx),lang-vue(vue),lang-proto(proto), plus built-insql. - Optional Tier-2 profiles (
all-languagesor individuallang-*features):lang-go(go),lang-java(java),lang-csharp(csharp),lang-kotlin(kotlin),lang-php(php),lang-ruby(ruby),lang-c(c),lang-cpp(cpp). Build with--features all-languagesor--features lang-<id>to index repositories using those languages.