@ludecker/aaac 1.1.4 → 1.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/README.md +27 -12
  2. package/package.json +1 -1
  3. package/src/cli.mjs +19 -7
  4. package/src/generators/generate-commands.mjs +25 -1
  5. package/src/generators/generate-graph.mjs +9 -1
  6. package/src/lib/install.mjs +13 -1
  7. package/src/lib/sweep-project-docs.mjs +348 -0
  8. package/src/run-engine/advance-phase.mjs +25 -5
  9. package/src/run-engine/debug-run.mjs +6 -0
  10. package/src/run-engine/gate-write.mjs +13 -0
  11. package/src/run-engine/lib.mjs +165 -0
  12. package/src/run-engine/log.mjs +1 -1
  13. package/src/run-engine/record-task.mjs +25 -4
  14. package/templates/cursor/aaac/enforcement.json +20 -4
  15. package/templates/cursor/aaac/graph.project.yaml +16 -5
  16. package/templates/cursor/aaac/lifecycle/lifecycle.json +12 -0
  17. package/templates/cursor/aaac/lifecycle/phases.json +2 -0
  18. package/templates/cursor/aaac/run/schema.json +5 -0
  19. package/templates/cursor/aaac/scripts/run-engine/advance-phase.mjs +25 -5
  20. package/templates/cursor/aaac/scripts/run-engine/debug-run.mjs +6 -0
  21. package/templates/cursor/aaac/scripts/run-engine/gate-write.mjs +13 -0
  22. package/templates/cursor/aaac/scripts/run-engine/lib.mjs +165 -0
  23. package/templates/cursor/aaac/scripts/run-engine/log.mjs +1 -1
  24. package/templates/cursor/aaac/scripts/run-engine/record-task.mjs +25 -4
  25. package/templates/cursor/agents/doc-conformance.md +25 -0
  26. package/templates/cursor/agents/implementation-review.md +21 -0
  27. package/templates/cursor/agents/test-author.md +27 -0
  28. package/templates/cursor/rules/aaac-enforcement.mdc +18 -6
  29. package/templates/cursor/skills/shared/_task-prompt-policy.md +18 -0
  30. package/templates/cursor/skills/shared/check/SKILL.md +4 -0
  31. package/templates/cursor/skills/shared/discovery/SKILL.md +4 -0
  32. package/templates/cursor/skills/shared/execution/SKILL.md +7 -3
  33. package/templates/cursor/skills/shared/governance/implementation/SKILL.md +396 -28
  34. package/templates/cursor/skills/shared/implementation-review/SKILL.md +49 -0
  35. package/templates/cursor/skills/shared/investigation/SKILL.md +1 -1
  36. package/templates/cursor/skills/shared/investigation-lite/SKILL.md +2 -0
  37. package/templates/cursor/skills/shared/planning/SKILL.md +5 -0
  38. package/templates/cursor/skills/shared/test-authoring/SKILL.md +58 -0
  39. package/templates/cursor/skills/shared/testing/SKILL.md +9 -3
  40. package/templates/cursor/skills/shared/verbs/create/orchestrator/SKILL.md +5 -3
  41. package/templates/cursor/skills/shared/verbs/fix/orchestrator/SKILL.md +5 -3
  42. package/templates/cursor/skills/shared/verbs/update/orchestrator/SKILL.md +5 -3
  43. package/templates/cursor/skills/shared/verification/SKILL.md +5 -3
  44. package/templates/docs/agentic_architecture.md +168 -97
@@ -29,9 +29,11 @@ Lifecycle: graph `verb_runtime.fix` or `command_workflows.fix-module` on Run
29
29
  10. **fitness_functions** — [fitness-functions](../../fitness-functions/SKILL.md)
30
30
  11. **rollback** — [rollback](../../rollback/SKILL.md) when maturity protected/critical or blast_radius ≥ medium
31
31
  12. **execute** — [execution](../../execution/SKILL.md)
32
- 13. **verify** — [testing](../../testing/SKILL.md) fix verify swarm + [verification](../../verification/SKILL.md)
33
- 14. **sync_inventory** — when domain inventory exists
34
- 15. **report** — [reporting](../../reporting/SKILL.md)
32
+ 13. **test_execute** — [test-authoring](../../test-authoring/SKILL.md) **1** test-author Task agent
33
+ 14. **verify** — [testing](../../testing/SKILL.md) fix verify swarm + [verification](../../verification/SKILL.md) — **3** subagents
34
+ 15. **review_swarm** — [implementation-review](../../implementation-review/SKILL.md) — **3** readonly reviewers
35
+ 16. **sync_inventory** — when domain inventory exists
36
+ 17. **report** — [reporting](../../reporting/SKILL.md)
35
37
 
36
38
  ## Swarm anti-patterns (hard fail)
37
39
 
@@ -25,9 +25,11 @@ Lifecycle: graph `verb_runtime.update` (work + gates on Run)
25
25
  9. **fitness_functions** — [fitness-functions](../../fitness-functions/SKILL.md)
26
26
  10. **rollback** — [rollback](../../rollback/SKILL.md) when maturity protected or blast_radius high
27
27
  11. **execute** — [execution](../../execution/SKILL.md); `design_mode` when component + design resolver
28
- 12. **verify** — [testing](../../testing/SKILL.md) + [verification](../../verification/SKILL.md)
29
- 13. **sync_inventory**
30
- 14. **report** — [reporting](../../reporting/SKILL.md)
28
+ 12. **test_execute** — [test-authoring](../../test-authoring/SKILL.md) **1** test-author Task agent
29
+ 13. **verify** — [testing](../../testing/SKILL.md) + [verification](../../verification/SKILL.md) — **3** verify subagents
30
+ 14. **review_swarm** — [implementation-review](../../implementation-review/SKILL.md) — **3** readonly reviewers
31
+ 15. **sync_inventory**
32
+ 16. **report** — [reporting](../../reporting/SKILL.md)
31
33
 
32
34
  Intent `Sync inventory only` → inventory sync only, no execution.
33
35
 
@@ -10,12 +10,14 @@ disable-model-invocation: true
10
10
 
11
11
  ## When
12
12
 
13
- After `testing`. Before `report`.
13
+ After `testing`. Before `review_swarm` (mutating verbs) or `report`.
14
+
15
+ **Agent separation:** Intent and contract checks here are orchestrator duties. Architecture/doc conformance review is **only** in [implementation-review](../implementation-review/SKILL.md) — not the execute agent.
14
16
 
15
17
  ## Checks
16
18
 
17
- - **App build gate** (create / update / fix, when `project.config.json` `verify.enabled`): `artifacts/verify.yaml` from [verify-website-build.mjs](../../../aaac/scripts/run-engine/verify-website-build.mjs)
18
- - **E2E smoke** (optional): launch [playwright-check-run](../../../agents/playwright-check-run.md) when project defines Playwright targets; set `PLAYWRIGHT_BASE_URL` for public-route smoke
19
+ - **Website build gate** (create / update / fix): `artifacts/verify.yaml` from [verify-website-build.mjs](../../../aaac/scripts/run-engine/verify-website-build.mjs) — static assets in `index.html` must exist; `pnpm --filter @ludecker/website build` must pass
20
+ - **Playwright verb checks** (create / update / fix): launch [playwright-check-run](../../../agents/playwright-check-run.md) `pnpm --filter @ludecker/aaac test:e2e` must pass; set `PLAYWRIGHT_BASE_URL` for public-route smoke
19
21
  - Run artifact `artifacts.testing.repro_status` is **fixed** or **partial** with documented follow-up (fix paths)
20
22
  - Orchestrator `contract.yaml` `success_criteria`
21
23
  - Graph `object_skills` / `object_skill_verbs` skills were loaded for command object + verb
@@ -10,97 +10,78 @@ You express intent; the architecture determines execution.
10
10
 
11
11
  ## Part 1 — For everyone
12
12
 
13
+ ### Get started
14
+
15
+ 1. **Install** — `npx @ludecker/aaac@latest init` (or `pnpm dlx @ludecker/aaac@latest init --yes`)
16
+ 2. **Open in Cursor** — Settings → **Hooks** → enable → restart Cursor
17
+ 3. **Run a command** — graph and slash commands are already generated; no manual `generate` step
18
+
19
+ `init` also writes **`.cursor/aaac/state/install-sweep-report.md`** — a read-only inventory of project docs, Cursor rules, and AAAC framework markdown, with recommendations only (no merges).
20
+
21
+ Optional later: add **domain slugs** and `.cursor/domains/<slug>/` for project-specific routing (Part 2).
22
+
13
23
  ### What you do
14
24
 
15
25
  > **Call a command. The system figures out the rest.**
16
26
 
17
- Ask: *What do I want?* Then type:
18
-
19
27
  ```text
20
- /<verb>-<object> <domain> "<intent>"
28
+ /<verb>-<object> [domain] "<intent>"
21
29
  ```
22
30
 
23
31
  | Part | Meaning | Example |
24
32
  |------|---------|---------|
25
33
  | Command | Kind of work | `update-module` |
26
- | Domain | Which area (optional until you add domains) | `payments` |
27
- | Intent | Goal in plain language | `"Add idempotency key to webhook handler"` |
28
-
29
- ### Command matrix (ships with every install)
34
+ | Domain | Optional bounded area | `payments` (only when your overlay defines slug resolvers) |
35
+ | Intent | Goal in plain language | `"Add webhook retry with idempotency key"` |
30
36
 
31
- AAAC generates ~130 commands from **8 verbs × 12 objects**:
32
-
33
- | Verb | Meaning | Example |
34
- |------|---------|---------|
35
- | `create` | Add something new | `/create-module api "Add rate limiter"` |
36
- | `update` | Change existing | `/update-component ui "Extract Button variants"` |
37
- | `fix` | Repair broken behavior | `/fix-module auth "Session expires on refresh"` |
38
- | `review` | Readonly quality check | `/review-architecture system "Check layer boundaries"` |
39
- | `check` | Readonly capability trace | `/check-module api "Can we add OAuth?"` |
40
- | `test` | Run verification | `/test-module api "Contract tests for webhooks"` |
41
- | `release` | Ship to production | `/release-app production "Ship v2.1.0"` |
42
- | `remove` | Delete safely | `/remove-module legacy "Drop v1 export path"` |
37
+ Without a domain overlay, commands route to **generic verb orchestrators** (`verb-create`, `verb-update`, `verb-fix`, …) — enough to create, fix, check, and review work in any repo.
43
38
 
44
- **Exception commands** (dedicated orchestrators):
39
+ ### Common commands
45
40
 
46
41
  | Command | When to use |
47
42
  |---------|-------------|
48
- | `update-doc` | Update architecture documentation (no code) |
49
- | `review-module` | Quality/architecture review (no code) |
43
+ | `create-module` | Add a new bounded module or package |
44
+ | `update-module` | Change existing module behavior |
45
+ | `fix-module` / `fix-bug` | Repair something broken (fix-bug: domain optional) |
46
+ | `check-module` | Validate or inspect (readonly) |
47
+ | `review-module` | Architecture / quality review (readonly) |
50
48
  | `review-incident` | Investigate production or deploy issue |
51
- | `test-function` | Test a user journey end-to-end |
52
- | `release-app` | Phased release swarm (git → deploy) |
53
- | `fix-module` / `fix-bug` | Full fix swarm domain optional until you add resolvers |
54
-
55
- ### Out of the box no setup after install
56
-
57
- Install copies everything you need. Open the project in Cursor and run commands.
58
-
59
- - ~130 slash commands and the full shared pipeline (discover → plan → execute → verify → report)
60
- - Generic `master_rules.md`, `ui_design.md`, `project_context.md`, and `architecture.md` in your docs folder — **already filled in**, not empty stubs
61
- - Hook scripts and Run lifecycle under `.cursor/`
62
- - Generic capability registry (shared skills only)
63
- - **No** project domains required; **no** app build gate until you opt in (`verify.enabled: false` in `project.config.json`)
64
-
65
- You do **not** need to enable hooks manually, write rules, add domains, or configure a stack before your first command.
66
-
67
- ### Optional — when you want more (any stack)
68
-
69
- 1. Fill in `docs/project_context.md` with your repo layout and SSOT anchors; extend `docs/master_rules.md` and `docs/architecture.md` when needed
70
- 2. Add `domains/<slug>/update/` (orchestrator + inventory) — see Part 2
71
- 3. Extend `graph.project.yaml` with resolvers and project skills
72
- 4. Enable verify in `project.config.json` when you have a web app to gate:
73
-
74
- ```json
75
- {
76
- "verify": {
77
- "enabled": true,
78
- "app_root": "apps/web",
79
- "index_html": "apps/web/index.html",
80
- "build": { "command": "pnpm", "args": ["--filter", "web", "build"] }
81
- }
82
- }
83
- ```
49
+ | `test-module` / `test-function` | Verify behavior |
50
+ | `update-doc` | Update architecture documentation (no code) |
51
+ | `release-app` | Phased release swarm (git push + deploy steps) |
52
+
53
+ See [`.cursor/aaac/ontology.md`](../.cursor/aaac/ontology.md) for the full verb × object matrix (~130 commands).
84
54
 
85
55
  ### Examples (generic)
86
56
 
87
57
  ```text
88
- /create-module billing "Add invoice PDF export"
89
- /update-component ui "Tokenize spacing scale"
90
- /fix-module api "Webhook signature validation fails on chunked bodies"
91
- /review-module billing "Check SSOT for tax rates"
92
- /test-function checkout "Guest can complete purchase"
93
- /release-app staging "Deploy with migration"
94
- /update-doc architecture "Document event bus boundaries"
58
+ /create-module api "Add health check endpoint"
59
+ /update-module auth "Refresh session TTL configuration"
60
+ /fix-bug payments "Webhook handler drops events on retry"
61
+ /check-module billing "Confirm idempotency on duplicate events"
62
+ /review-module core "Check layer boundaries and module size budgets"
63
+ /test-function checkout "Verify cart → pay → confirmation journey"
64
+ /update-doc architecture "Document service boundaries"
65
+ /release-app production "Ship with typecheck and smoke test"
95
66
  ```
96
67
 
97
- ### What you should not need to know
68
+ ### Deprecated (still work one release)
98
69
 
99
- skill, agent, subagent, tool, workflow, graph, orchestrator — infrastructure only.
70
+ | Old | New |
71
+ |-----|-----|
72
+ | `/ship-ludecker` | `/release-app` |
73
+ | `/module-update` | `/update-module` |
74
+ | `/architecture` | `/update-doc` |
75
+ | `/swarm-check` | `/review-incident` or `/fix-bug` |
76
+ | `/refactor` | `/review-module` |
77
+
78
+ ### Reference: [Lüdecker](https://ludecker.com) (optional domain overlay)
79
+
80
+ The [Lüdecker monorepo](https://github.com/eriklydecker/ludecker) adds slug resolvers (`cms`, `ui`, `database`, `aaac`) and domain orchestrators under `.cursor/domains/`. That pattern is **not** required for a fresh install — copy it when you want bounded-context routing like `/update-module cms "…"`.
100
81
 
101
- ### Reference implementation
82
+ ### What you should not need to know
102
83
 
103
- [Lüdecker](https://ludecker.com) dogfoods AAAC with `cms`, `ui`, `database`, and `aaac` domains. That overlay lives in the Lüdecker repo not in the generic npm template.
84
+ skill, agent, subagent, tool, workflow, graph, orchestratorinfrastructure only.
104
85
 
105
86
  ---
106
87
 
@@ -130,7 +111,7 @@ Knowledge Layer → docs/
130
111
  | Lifecycle | **Work** phase configuration |
131
112
  | Gate stacks | **Approval** checkpoints |
132
113
  | Run | Primary execution object; decisions, log, checkpoints |
133
- | Domain orchestrators | Domain coordination (you add these) |
114
+ | Domain orchestrators | Domain coordination |
134
115
  | Shared pipeline skills | Phase execution |
135
116
  | Capability registry | object → capability → provider |
136
117
  | Object skills | Skill-type providers |
@@ -149,7 +130,7 @@ Intent → Command → Execution Graph → Result
149
130
 
150
131
  **Execution graph** = orchestrator + skills + agents + tools + rules + documentation.
151
132
 
152
- **SSOT:** [`.cursor/aaac/graph.yaml`](../.cursor/aaac/graph.yaml) (generated — edit `graph.project.yaml` instead)
133
+ **SSOT:** [`.cursor/aaac/graph.yaml`](../.cursor/aaac/graph.yaml)
153
134
 
154
135
  **Dispatch procedure:** [`.cursor/aaac/dispatch.md`](../.cursor/aaac/dispatch.md)
155
136
 
@@ -158,32 +139,16 @@ Intent → Command → Execution Graph → Result
158
139
  ```text
159
140
  .cursor/
160
141
  commands/ # thin routers (public)
161
- aaac/
162
- graph.project.yaml # your overlay (resolvers, orchestrators)
163
- graph.yaml # generated wiring
142
+ aaac/graph.yaml # wiring (private OS)
164
143
  domains/<slug>/update/
165
144
  orchestrator/ # what happens
166
145
  inventory/ # what exists
167
- skills/shared/ # framework pipeline
168
- skills/<project>/ # your object-capability skills (optional)
146
+ skills/shared/ # framework (discovery, planning, execution, …)
147
+ skills/<project>/ # optional project-specific object skills
169
148
  agents/ # subagent prompt specs
170
149
  policies/ # rules all skills inherit
171
150
  ```
172
151
 
173
- ### Generic kernel vs project overlay
174
-
175
- | Layer | Location | Owner |
176
- |-------|----------|-------|
177
- | Generic kernel | `@ludecker/aaac` npm templates | Package maintainers |
178
- | Project overlay | `.cursor/aaac/graph.project.yaml`, `ontology.json`, `project.config.json` | Your repo |
179
- | Domains | `.cursor/domains/<slug>/` | Your repo |
180
-
181
- Regenerate after ontology or overlay edits:
182
-
183
- ```bash
184
- npx @ludecker/aaac@latest generate
185
- ```
186
-
187
152
  ### Orchestrator vs inventory
188
153
 
189
154
  | | Orchestrator | Inventory |
@@ -191,49 +156,155 @@ npx @ludecker/aaac@latest generate
191
156
  | Question | What should happen? | What exists? |
192
157
  | Updates when | Workflow changes | After every code-changing `update-module` |
193
158
 
159
+ Inventory documents constraints and file maps. **Dependency reasoning** uses [`.cursor/aaac/dependencies.yaml`](../.cursor/aaac/dependencies.yaml) via the `dependency_graph` phase — not inventory alone.
160
+
194
161
  ### Execution determinism (create / update / fix)
195
162
 
163
+ Commands define *what* to load; **work lifecycle** defines phases of work; **gate stacks** define approval checkpoints; the **Run** holds state and observability.
164
+
165
+ **Mature stack (composed on Run):**
166
+
167
+ ```text
168
+ Policies → Ontology → Graph → Create Run
169
+ → Work: Discovery → Investigation → Planning
170
+ → Gates: Validation → Impact → Deps → Fitness → Rollback
171
+ → Work: Execute → Test execute → Verify → Review swarm → Report
172
+ ```
173
+
174
+ **Agent separation (create / update / fix):** production code in `execute`; tests in `test_execute` (separate test-author agent); readonly review swarm before report. Hooks enforce path scopes via `enforcement.json` `phase_edit_scopes`.
175
+
196
176
  **Work lifecycles** (SSOT: [`.cursor/aaac/lifecycle/lifecycle.json`](../.cursor/aaac/lifecycle/lifecycle.json)):
197
177
 
198
178
  | Verb | Work | Gate stack |
199
179
  |------|------|------------|
200
- | create | discover → investigate_lite → plan → execute → verify → report | pre_execute |
180
+ | create | discover → investigate_lite → plan → execute → test_execute → verify → review_swarm → report | pre_execute |
201
181
  | update | same | pre_execute |
202
- | fix | discover → investigate_swarm → root_cause → plan → execute → verify → report | pre_execute |
182
+ | fix | discover → investigate_swarm → root_cause → plan → execute → test_execute → verify → review_swarm → report | pre_execute |
203
183
  | release | execute → verify → report | release |
204
184
 
205
- **Gate stacks** (SSOT: [`.cursor/aaac/governance/gates.json`](../.cursor/aaac/governance/gates.json))
185
+ **Gate stacks** (SSOT: [`.cursor/aaac/governance/gates.json`](../.cursor/aaac/governance/gates.json)) — approval, not work.
186
+
187
+ Composed runtime in graph `verb_runtime`. Human approval at gate boundaries: Run `status: blocked`, `awaiting_approval: true`.
188
+
189
+ **Confidence gates** — before execute, if any score is below threshold → `STOP, REQUEST CLARIFICATION`:
190
+
191
+ | Dimension | Minimum |
192
+ |-----------|---------|
193
+ | architecture | 0.9 |
194
+ | requirements | 0.8 |
195
+ | scope | 0.8 |
196
+
197
+ **Object maturity** — harder objects require more phases:
198
+
199
+ | Level | Objects (examples) | Extra requirements |
200
+ |-------|-------------------|-------------------|
201
+ | protected | schema, migration, architecture | impact + deps + rollback |
202
+ | critical | module, integration, app | impact + deps |
203
+ | stable | feature, workflow | impact on fix |
204
+ | evolving | component, function | lifecycle only |
205
+
206
+ **Fitness functions** — [`.cursor/aaac/fitness-functions.yaml`](../.cursor/aaac/fitness-functions.yaml): api_first, design_system, accessibility, security, layer_boundaries, performance. Scored `pass` / `warning` / `fail` before execute.
207
+
208
+ Lifecycle reference: [`.cursor/skills/shared/verbs/_lifecycle.md`](../.cursor/skills/shared/verbs/_lifecycle.md)
209
+
210
+ ### Fix swarm (`/fix-module`, `/fix-bug`, `fix_mode`)
211
+
212
+ Same rigor as `write-article` research — parallel Task subagents, one message per wave.
213
+
214
+ | Phase | Agent specs | Count |
215
+ |-------|-------------|-------|
216
+ | discover | discovery-inventory, discovery-boundaries, discovery-ssot | 4–6 |
217
+ | investigate_swarm | fix-repro, fix-code-path, fix-recent-changes, fix-test-failures, fix-regression-scope, fix-runtime-evidence, fix-inventory-confirm | **7** |
218
+ | root_cause | parent + optional fix-hypothesis-validate | 0–1 |
219
+ | verify | fix-repro-verify, unit-test-run, fallow-check-changed | **3** (all mutating verbs) |
220
+ | test_execute | test-author | **1** |
221
+ | review_swarm | boundary-review, doc-conformance, implementation-review | **3** |
222
+
223
+ Skills: [investigation/SKILL.md](../.cursor/skills/shared/investigation/SKILL.md), [testing/SKILL.md](../.cursor/skills/shared/testing/SKILL.md), [test-authoring/SKILL.md](../.cursor/skills/shared/test-authoring/SKILL.md), [implementation-review/SKILL.md](../.cursor/skills/shared/implementation-review/SKILL.md).
224
+ Contracts: [fix-module.yaml](../.cursor/aaac/contracts/commands/fix-module.yaml), [fix-bug.yaml](../.cursor/aaac/contracts/commands/fix-bug.yaml).
225
+
226
+ Resolver: `fix-domain-by-slug` (`fix-module`) and `fix-bug-by-slug` → `cms-fix-bug` | `ui-fix-bug` | `database-fix-bug` | `aaac-fix-bug`.
206
227
 
207
228
  ### Capability registry
208
229
 
209
230
  Objects declare capabilities in ontology; providers resolve from [`.cursor/aaac/capabilities/registry.json`](../.cursor/aaac/capabilities/registry.json):
210
231
 
211
232
  ```text
212
- object → capability → provider (skill | mcp)
233
+ object → capability → provider (skill | mcp | expert)
234
+ ```
235
+
236
+ Graph `object_skills` includes skill-type providers only. MCP providers (e.g. `supabase-mcp` on `database-design`) are recorded on the Run.
237
+
238
+ **Capability lifecycle (evidence-driven):** State belongs to the **capability**, not the provider. After each completed Run, `capability-evidence.mjs` aggregates per-run evidence into [`.cursor/aaac/state/capability-stats.json`](../.cursor/aaac/state/capability-stats.json) and evaluates deterministic promotion using [`.cursor/aaac/capabilities/promotion-rules.json`](../.cursor/aaac/capabilities/promotion-rules.json):
239
+
240
+ ```text
241
+ experimental → validated → trusted → canonical → deprecated
213
242
  ```
214
243
 
215
- Replace generic shared-skill providers with project skills as you mature.
244
+ Promotion uses accumulated metrics: `invocations`, `success_rate`, `rollback_rate`, `gate_failure_rate`, `avg_fitness`. `canonical` requires `manual_approval` (human override on the capability entry). Providers contribute evidence; governance changes state.
245
+
246
+ **Runtime behavior:** At dispatch and before `execute`, `promotion-rules.json` `runtime` section is evaluated — `deprecated` blocks execute; `experimental` on `critical`/`protected` objects requires user approval; low `success_rate` or `avg_fitness` triggers approval. Set `capability_runtime_approved: true` on the Run after user approves.
216
247
 
217
248
  ### Run (primary execution object)
218
249
 
219
250
  **SSOT:** [`.cursor/aaac/run/schema.json`](../.cursor/aaac/run/schema.json), [`.cursor/aaac/run/RUN.md`](../.cursor/aaac/run/RUN.md)
220
251
 
252
+ Every command executes within a Run at `state/runs/{run_id}/run.json`:
253
+
254
+ | Field | Purpose |
255
+ |-------|---------|
256
+ | `phase`, `pending`, `completed` | Where we are |
257
+ | `decisions[]` | Why routes and gates |
258
+ | `log[]` | Phase events |
259
+ | `checkpoints[]` | Resume points |
260
+ | `artifacts{}` | Plan, impact, report, … |
261
+ | `awaiting_approval` | Human gate approval |
262
+
263
+ Observability: [`.cursor/aaac/observability/telemetry.yaml`](../.cursor/aaac/observability/telemetry.yaml) — all telemetry on Run, no standalone logs.
264
+
265
+ ### Contracts
266
+
267
+ Command contracts: [`.cursor/aaac/contracts/commands/`](../.cursor/aaac/contracts/commands/). Skill contracts: [`.cursor/aaac/contracts/skills/`](../.cursor/aaac/contracts/skills/). Schema: [`.cursor/aaac/contract-schema.md`](../.cursor/aaac/contract-schema.md)
268
+
269
+ ### Implementation governance
270
+
271
+ Not a slash command. Loaded by `shared/execution` on code changes:
272
+
273
+ [`.cursor/skills/shared/governance/implementation/SKILL.md`](../.cursor/skills/shared/governance/implementation/SKILL.md)
274
+
221
275
  ### Adding a product domain
222
276
 
223
277
  1. Add `domains/<slug>/update/` (inventory + orchestrator)
224
- 2. Add resolver entries to `graph.project.yaml` — **no new command shape**
225
- 3. Regenerate: `npx @ludecker/aaac@latest generate`
278
+ 2. Add slug to `graph.yaml` resolvers — **no new command shape**
279
+ 3. Regenerate: `node .cursor/aaac/generate-graph.mjs && node .cursor/aaac/generate-commands.mjs`
280
+
281
+ ### Contracts
226
282
 
227
- See [module-authoring/SKILL.md](../.cursor/skills/shared/module-authoring/SKILL.md).
283
+ Plugins may include `contract.yaml` beside `SKILL.md`. Central contracts: [`.cursor/aaac/contracts/`](../.cursor/aaac/contracts/). Schema: [`.cursor/aaac/contract-schema.md`](../.cursor/aaac/contract-schema.md)
228
284
 
229
285
  ### Release swarm (`release-app`)
230
286
 
231
- Wave 1: `release-git` (blocking). Add deploy agents in your overlay (e.g. `release-render`, `release-k8s`) — generic template ships git only.
287
+ Expert subagents run in **waves**, not one monolithic agent:
288
+
289
+ | Wave | Agents | Notes |
290
+ |------|--------|-------|
291
+ | 0 | Preflight typecheck (optional) | From intent, e.g. "with tests" |
292
+ | 1 | `release-git` | **Blocking** — must return `commit_sha` before wave 2 |
293
+ | 2 | `release-render` | Poll `ludecker-website` until `live`; smoke-check `/` |
294
+
295
+ Wiring: `graph.yaml` agents `release-*`. Orchestrator: [platform-release/orchestrator](../.cursor/skills/shared/platform-release/orchestrator/SKILL.md). DAG: [platform-release/SKILL.md](../.cursor/skills/shared/platform-release/SKILL.md).
232
296
 
233
297
  ### Regenerating commands
234
298
 
235
299
  ```bash
236
- npx @ludecker/aaac@latest generate
300
+ pnpm aaac:generate
301
+ ```
302
+
303
+ Or:
304
+
305
+ ```bash
306
+ node .cursor/aaac/generate-graph.mjs
307
+ node .cursor/aaac/generate-commands.mjs
237
308
  ```
238
309
 
239
310
  Ontology reference: [`.cursor/aaac/ontology.md`](../.cursor/aaac/ontology.md)