@ludecker/aaac 1.0.0 → 1.1.1

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 (92) hide show
  1. package/README.md +4 -3
  2. package/package.json +13 -1
  3. package/src/cli.mjs +39 -5
  4. package/src/generators/generate-commands.mjs +120 -3
  5. package/src/generators/generate-graph.mjs +17 -0
  6. package/src/lib/install.mjs +1 -0
  7. package/src/lib/run-engine-paths.mjs +33 -0
  8. package/src/run-engine/advance-phase.mjs +343 -0
  9. package/src/run-engine/capability-evidence.mjs +460 -0
  10. package/src/run-engine/debug-run.mjs +38 -0
  11. package/src/run-engine/gate-write.mjs +95 -0
  12. package/src/run-engine/init-run.mjs +215 -0
  13. package/src/run-engine/lib.mjs +141 -0
  14. package/src/run-engine/log-dump.mjs +76 -0
  15. package/src/run-engine/log-trace.mjs +18 -0
  16. package/src/run-engine/log.mjs +343 -0
  17. package/src/run-engine/record-task.mjs +56 -0
  18. package/src/run-engine/stop-check.mjs +55 -0
  19. package/src/run-engine/verify-website-build.mjs +148 -0
  20. package/templates/cursor/aaac/capabilities/promotion-rules.json +64 -0
  21. package/templates/cursor/aaac/capabilities/registry.json +17 -15
  22. package/templates/cursor/aaac/complexity.yaml +98 -0
  23. package/templates/cursor/aaac/contracts/commands/fix-bug.yaml +10 -3
  24. package/templates/cursor/aaac/contracts/commands/fix-module.yaml +41 -0
  25. package/templates/cursor/aaac/contracts/skills/investigation.yaml +22 -1
  26. package/templates/cursor/aaac/contracts/skills/planning.yaml +17 -0
  27. package/templates/cursor/aaac/contracts/skills/validation.yaml +9 -1
  28. package/templates/cursor/aaac/dispatch.md +31 -6
  29. package/templates/cursor/aaac/enforcement.json +25 -0
  30. package/templates/cursor/aaac/fitness-functions.yaml +8 -0
  31. package/templates/cursor/aaac/governance/gates.json +6 -2
  32. package/templates/cursor/aaac/graph.project.yaml +237 -5
  33. package/templates/cursor/aaac/layers.md +6 -1
  34. package/templates/cursor/aaac/lifecycle/lifecycle.json +41 -1
  35. package/templates/cursor/aaac/lifecycle/phases.json +1 -0
  36. package/templates/cursor/aaac/observability/telemetry.yaml +63 -0
  37. package/templates/cursor/aaac/observability/verb-debug.yaml +170 -0
  38. package/templates/cursor/aaac/ontology.json +10 -1
  39. package/templates/cursor/aaac/run/RUN.md +2 -0
  40. package/templates/cursor/aaac/run/schema.json +11 -0
  41. package/templates/cursor/aaac/scripts/generate-runtime-registry.mjs +115 -0
  42. package/templates/cursor/aaac/scripts/run-engine/advance-phase.mjs +343 -0
  43. package/templates/cursor/aaac/scripts/run-engine/capability-evidence.mjs +460 -0
  44. package/templates/cursor/aaac/scripts/run-engine/debug-run.mjs +38 -0
  45. package/templates/cursor/aaac/scripts/run-engine/gate-write.mjs +95 -0
  46. package/templates/cursor/aaac/scripts/run-engine/init-run.mjs +215 -0
  47. package/templates/cursor/aaac/scripts/run-engine/lib.mjs +141 -0
  48. package/templates/cursor/aaac/scripts/run-engine/log-dump.mjs +76 -0
  49. package/templates/cursor/aaac/scripts/run-engine/log-trace.mjs +18 -0
  50. package/templates/cursor/aaac/scripts/run-engine/log.mjs +343 -0
  51. package/templates/cursor/aaac/scripts/run-engine/record-task.mjs +56 -0
  52. package/templates/cursor/aaac/scripts/run-engine/stop-check.mjs +55 -0
  53. package/templates/cursor/aaac/scripts/run-engine/verify-website-build.mjs +148 -0
  54. package/templates/cursor/aaac/state/capability-stats.json +5 -0
  55. package/templates/cursor/agents/aaac-log-debug.md +72 -0
  56. package/templates/cursor/agents/fix-code-path.md +27 -0
  57. package/templates/cursor/agents/fix-hypothesis-validate.md +26 -0
  58. package/templates/cursor/agents/fix-inventory-confirm.md +22 -0
  59. package/templates/cursor/agents/fix-recent-changes.md +22 -0
  60. package/templates/cursor/agents/fix-regression-scope.md +27 -0
  61. package/templates/cursor/agents/fix-repro-verify.md +21 -0
  62. package/templates/cursor/agents/fix-repro.md +29 -0
  63. package/templates/cursor/agents/fix-runtime-evidence.md +22 -0
  64. package/templates/cursor/agents/fix-test-failures.md +23 -0
  65. package/templates/cursor/agents/playwright-check-run.md +44 -0
  66. package/templates/cursor/hooks/aaac-before-submit.sh +3 -0
  67. package/templates/cursor/hooks/aaac-pre-tool.sh +4 -0
  68. package/templates/cursor/hooks/aaac-stop.sh +3 -0
  69. package/templates/cursor/hooks/aaac-subagent-start.sh +3 -0
  70. package/templates/cursor/hooks.json +30 -0
  71. package/templates/cursor/policies/minimal-complexity.md +101 -0
  72. package/templates/cursor/rules/aaac-enforcement.mdc +42 -0
  73. package/templates/cursor/skills/shared/execution/SKILL.md +1 -1
  74. package/templates/cursor/skills/shared/fitness-functions/SKILL.md +23 -7
  75. package/templates/cursor/skills/shared/investigation/SKILL.md +91 -18
  76. package/templates/cursor/skills/shared/investigation/orchestrator/SKILL.md +12 -4
  77. package/templates/cursor/skills/shared/planning/SKILL.md +74 -8
  78. package/templates/cursor/skills/shared/platform-release/SKILL.md +22 -19
  79. package/templates/cursor/skills/shared/platform-release/orchestrator/contract.yaml +27 -7
  80. package/templates/cursor/skills/shared/reporting/SKILL.md +2 -1
  81. package/templates/cursor/skills/shared/root-cause/SKILL.md +14 -3
  82. package/templates/cursor/skills/shared/testing/SKILL.md +31 -5
  83. package/templates/cursor/skills/shared/validation/SKILL.md +48 -13
  84. package/templates/cursor/skills/shared/verbs/_dispatch-utils.md +20 -1
  85. package/templates/cursor/skills/shared/verbs/_lifecycle.md +3 -2
  86. package/templates/cursor/skills/shared/verbs/check/orchestrator/SKILL.md +4 -1
  87. package/templates/cursor/skills/shared/verbs/create/orchestrator/SKILL.md +2 -2
  88. package/templates/cursor/skills/shared/verbs/fix/orchestrator/SKILL.md +21 -11
  89. package/templates/cursor/skills/shared/verbs/fix/orchestrator/contract.yaml +19 -4
  90. package/templates/cursor/skills/shared/verbs/update/orchestrator/SKILL.md +2 -2
  91. package/templates/cursor/skills/shared/verification/SKILL.md +3 -0
  92. package/templates/docs/agentic_architecture.md +236 -53
@@ -2,44 +2,44 @@
2
2
  "version": 2,
3
3
  "capabilities": {
4
4
  "ui-design": {
5
- "description": "Design tokens, component CSS, presentational UI",
5
+ "description": "Design tokens, component CSS, Figma alignment",
6
6
  "providers": [
7
- { "id": "component", "type": "skill", "path": "skills/shared/component" }
7
+ { "id": "ludecker-design-system", "type": "skill", "path": "skills/ludecker/design-system" }
8
8
  ]
9
9
  },
10
10
  "ux-design": {
11
- "description": "User flows, readability, navigation clarity",
11
+ "description": "Editorial readability, publish flow, navigation clarity",
12
12
  "providers": [
13
- { "id": "workflow", "type": "skill", "path": "skills/shared/workflow" }
13
+ { "id": "ludecker-user-experience", "type": "skill", "path": "skills/ludecker/user-experience" }
14
14
  ]
15
15
  },
16
16
  "api-design": {
17
17
  "description": "Contracts and validation at boundaries",
18
18
  "providers": [
19
- { "id": "integration", "type": "skill", "path": "skills/shared/integration" }
19
+ { "id": "ludecker-api-first", "type": "skill", "path": "skills/ludecker/api-first" }
20
20
  ]
21
21
  },
22
22
  "database-design": {
23
- "description": "Schema, migrations, persistence contracts",
23
+ "description": "Schema, migrations, RLS, type mirrors",
24
24
  "providers": [
25
- { "id": "schema", "type": "skill", "path": "skills/shared/schema" },
26
- { "id": "migration", "type": "skill", "path": "skills/shared/migration" }
25
+ { "id": "ludecker-database-schema", "type": "skill", "path": "skills/ludecker/database-schema" },
26
+ { "id": "supabase-mcp", "type": "mcp", "optional": true, "note": "Apply migrations and RLS via Supabase MCP" }
27
27
  ]
28
28
  },
29
29
  "security": {
30
- "description": "Auth, secrets, access control — extend with project skills",
30
+ "description": "Auth, RLS, secrets, CMS gates",
31
31
  "providers": [
32
- { "id": "architecture", "type": "skill", "path": "skills/shared/architecture" }
32
+ { "id": "ludecker-security", "type": "skill", "path": "skills/ludecker/security" }
33
33
  ]
34
34
  },
35
35
  "infrastructure": {
36
- "description": "Deploy, hosting, environment",
36
+ "description": "Deploy, Render, env, hosting",
37
37
  "providers": [
38
- { "id": "platform-release", "type": "skill", "path": "skills/shared/platform-release" }
38
+ { "id": "ludecker-infrastructure", "type": "skill", "path": "skills/ludecker/infrastructure" }
39
39
  ]
40
40
  },
41
41
  "layer-boundaries": {
42
- "description": "SSOT, import direction, module layers",
42
+ "description": "SSOT, import direction, monorepo layers",
43
43
  "providers": [
44
44
  { "id": "architecture", "type": "skill", "path": "skills/shared/architecture" }
45
45
  ]
@@ -65,7 +65,8 @@
65
65
  "migration-model": {
66
66
  "description": "Migration scripts and apply procedure",
67
67
  "providers": [
68
- { "id": "migration", "type": "skill", "path": "skills/shared/migration" }
68
+ { "id": "migration", "type": "skill", "path": "skills/shared/migration" },
69
+ { "id": "supabase-mcp", "type": "mcp", "optional": true }
69
70
  ]
70
71
  },
71
72
  "workflow-model": {
@@ -101,6 +102,7 @@
101
102
  },
102
103
  "resolution": {
103
104
  "graph_skill_keys": "providers where type=skill → id maps to graph skills key",
104
- "run_record": "all providers including type=mcp recorded on Run.capabilities_resolved and decisions"
105
+ "run_record": "all providers including type=mcp recorded on Run.capabilities_resolved and decisions",
106
+ "lifecycle": "cross-run state in state/capability-stats.json; promotion thresholds in promotion-rules.json; updated by capability-evidence.mjs after each completed Run"
105
107
  }
106
108
  }
@@ -0,0 +1,98 @@
1
+ # Complexity governance — SSOT for create / update / fix (code-changing verbs)
2
+ # Policy: .cursor/policies/minimal-complexity.md
3
+ # Scored in plan; validated at validate gate; enforced at fitness_functions gate.
4
+
5
+ version: 1
6
+
7
+ mutating_verbs: [create, update, fix]
8
+
9
+ optimization:
10
+ target: "maximum outcome / minimum structure"
11
+ default_verb_when_ambiguous: update
12
+
13
+ strategy_priority:
14
+ - reuse_existing
15
+ - extend_existing
16
+ - modify_existing
17
+ - create_new
18
+
19
+ scoring:
20
+ description: Sum weights for every net-new artifact in the plan (not edits to existing files).
21
+ weights:
22
+ new_file: 1
23
+ new_component: 1
24
+ new_function: 1
25
+ new_hook: 1
26
+ new_module: 3
27
+ new_service: 5
28
+ new_api_endpoint: 2
29
+ new_table: 3
30
+ new_migration: 2
31
+ new_state_machine: 4
32
+ new_queue_or_bus: 5
33
+ new_abstraction_layer: 4
34
+ new_orchestrator: 4
35
+ new_skill: 2
36
+ new_dependency: 2
37
+
38
+ thresholds:
39
+ fix: 5
40
+ update: 8
41
+ create: 12
42
+
43
+ yagni:
44
+ rule: Future requirements do not exist unless the user stated them.
45
+ reject_without_user_evidence:
46
+ - maybe later
47
+ - might need
48
+ - future-proof
49
+ - future proof
50
+ - scalability
51
+ - extensibility
52
+ - plugin system
53
+ - event bus
54
+ - generic framework
55
+ - abstraction layer
56
+ - for flexibility
57
+ - potential use case
58
+
59
+ plan_artifact:
60
+ path: Run.artifacts.plan
61
+ required_for_verbs: [create, update, fix]
62
+ required_fields:
63
+ requirement_map:
64
+ description: Each stated requirement mapped to satisfying artifacts
65
+ item_shape:
66
+ requirement: string
67
+ satisfies_with: list
68
+ complexity_score: number
69
+ complexity_breakdown: object
70
+ reuse:
71
+ description: Existing artifacts to reuse or extend (preferred)
72
+ type: list
73
+ modify:
74
+ description: Existing artifacts to change in place
75
+ type: list
76
+ create:
77
+ description: Net-new artifacts — each must cite requirement_map entry
78
+ item_shape:
79
+ artifact: string
80
+ kind: string
81
+ requirement_ref: string
82
+ why_not_reuse: string
83
+ rejected_alternatives:
84
+ description: Higher-complexity options considered and rejected
85
+ type: list
86
+
87
+ gate_rules:
88
+ validate:
89
+ fail_when:
90
+ - missing required plan fields for mutating verb
91
+ - create entry without requirement_ref or why_not_reuse
92
+ - yagni phrase in plan without user intent evidence
93
+ fitness_functions:
94
+ function: minimal_complexity
95
+ fail_when:
96
+ - complexity_score above threshold for verb
97
+ - speculative create not justified
98
+ blocking: true
@@ -1,12 +1,13 @@
1
1
  name: fix-bug
2
- purpose: Repair broken behavior in a domain
2
+ purpose: Repair broken behavior in a domain (alias of fix-module workflow)
3
3
  inputs:
4
4
  domain:
5
5
  required: false
6
+ enum: [cms, ui, database, aaac]
6
7
  intent:
7
8
  required: true
8
9
  outputs:
9
- findings:
10
+ investigation:
10
11
  type: markdown
11
12
  required: true
12
13
  root_cause:
@@ -24,9 +25,15 @@ outputs:
24
25
  type: markdown
25
26
  required: true
26
27
  lifecycle_verb: fix
28
+ workflow: fix-bug
27
29
  success_criteria:
28
- - deep investigation and root_cause before plan
30
+ - discovery swarm completed (4-6 agents)
31
+ - fix investigation swarm completed (7 parallel agents)
32
+ - root_cause confidence at least 0.7
33
+ - repro_status fixed after execute
29
34
  - impact_analysis proceed yes or rollback defined
30
35
  failure_conditions:
36
+ - skip discovery or investigate_swarm phase
31
37
  - root_cause confidence below 0.7
32
38
  - symptom patch without root cause frame
39
+ - repro_status not_fixed while claiming success
@@ -0,0 +1,41 @@
1
+ name: fix-module
2
+ purpose: Repair broken behavior in a bounded domain module
3
+ inputs:
4
+ domain:
5
+ required: true
6
+ enum: [cms, ui, database, aaac]
7
+ intent:
8
+ required: true
9
+ outputs:
10
+ investigation:
11
+ type: markdown
12
+ required: true
13
+ root_cause:
14
+ type: markdown
15
+ required: true
16
+ plan:
17
+ type: markdown
18
+ required: true
19
+ implementation:
20
+ type: code_changes
21
+ verification:
22
+ type: markdown
23
+ required: true
24
+ report:
25
+ type: markdown
26
+ required: true
27
+ lifecycle_verb: fix
28
+ workflow: fix-module
29
+ success_criteria:
30
+ - discovery swarm completed (4-6 agents)
31
+ - fix investigation swarm completed (7 parallel agents)
32
+ - root_cause confidence at least 0.7
33
+ - repro_status fixed after execute
34
+ - domain inventory Section 3 synced after execute
35
+ - complexity_score at most 5
36
+ failure_conditions:
37
+ - skip discovery or investigate_swarm phase
38
+ - plan or execute before root_cause artifact
39
+ - symptom patch without root cause frame
40
+ - repro_status not_fixed while claiming success
41
+ - domain slug missing for resolver commands
@@ -1,9 +1,22 @@
1
1
  name: investigation
2
- purpose: Deep investigation for fix paths and incidents
2
+ purpose: Deep investigation swarm for fix paths and incidents
3
3
  outputs:
4
+ investigation_frame:
5
+ type: object
6
+ required: true
4
7
  findings:
5
8
  type: list
6
9
  required: true
10
+ repro_steps:
11
+ type: list
12
+ required: true
13
+ repro_confirmed:
14
+ type: string
15
+ required: true
16
+ enum: [yes, partial, no]
17
+ suspect_files:
18
+ type: list
19
+ required: true
7
20
  risks:
8
21
  type: list
9
22
  required: true
@@ -14,4 +27,12 @@ outputs:
14
27
  type: object
15
28
  required: true
16
29
  fields: [architecture, requirements, scope]
30
+ swarm:
31
+ fix_path:
32
+ prerequisite: discovery
33
+ agents: 7
34
+ parallel: mandatory
35
+ incident_path:
36
+ agents: 4
37
+ parallel: mandatory
17
38
  readonly: true
@@ -0,0 +1,17 @@
1
+ name: planning
2
+ purpose: Plan mutating changes with complexity score and requirement map before execute
3
+ applies_to_verbs: [create, update, fix]
4
+ outputs:
5
+ plan:
6
+ type: object
7
+ required_for_verbs: [create, update, fix]
8
+ required_fields:
9
+ - requirement_map
10
+ - complexity_score
11
+ - complexity_breakdown
12
+ - reuse
13
+ - modify
14
+ - create
15
+ - rejected_alternatives
16
+ store_at: Run.artifacts.plan
17
+ readonly: true
@@ -1,5 +1,6 @@
1
1
  name: validation
2
- purpose: Confidence gates before execute
2
+ purpose: Confidence and complexity gates before execute (mutating verbs)
3
+ applies_to_verbs: [create, update, fix]
3
4
  outputs:
4
5
  validation:
5
6
  type: enum
@@ -8,6 +9,13 @@ outputs:
8
9
  scores:
9
10
  type: object
10
11
  required: true
12
+ complexity:
13
+ type: object
14
+ required_for_verbs: [create, update, fix]
15
+ fields:
16
+ score: number
17
+ threshold: number
18
+ pass: boolean
11
19
  clarification_questions:
12
20
  type: list
13
21
  required_when: validation fail
@@ -2,10 +2,22 @@
2
2
 
3
3
  Agents running any AAAC command **must** follow this sequence.
4
4
 
5
+ **Enforcement (runtime):** Cursor hooks in [.cursor/hooks.json](../hooks.json) create Runs and **block code edits** until the `execute` phase. See [.cursor/rules/aaac-enforcement.mdc](../rules/aaac-enforcement.mdc). Applies to **all** AAAC slash commands.
6
+
5
7
  **Path convention:** In [graph.yaml](graph.yaml), paths under `agents/`, `policies/`, `skills/`, and `domains/` are relative to **`.cursor/`**.
6
8
 
7
9
  **Primary execution object:** Every command runs inside a **Run** — see [run/RUN.md](run/RUN.md) and [run/schema.json](run/schema.json).
8
10
 
11
+ ## 0. Hook-initiated Run (automatic)
12
+
13
+ On submit, hooks call [scripts/run-engine/init-run.mjs](../scripts/run-engine/init-run.mjs). Follow `run.json` phases. `preToolUse` denies Write/StrReplace/Delete outside allowed phases.
14
+
15
+ Advance after swarm + artifacts:
16
+
17
+ ```bash
18
+ node .cursor/aaac/scripts/run-engine/advance-phase.mjs <run_id> <completed_phase>
19
+ ```
20
+
9
21
  ## 1. Parse input
10
22
 
11
23
  From `$ARGUMENTS` and the user message:
@@ -21,6 +33,8 @@ If intent contains `Sync inventory only` (case-insensitive), orchestrator runs *
21
33
 
22
34
  **Resume:** If user references `run_{id}`, load `state/runs/{run_id}/run.json` and continue from `phase`.
23
35
 
36
+ **Workflow exceptions:** Commands like `write-article` use `command_workflows.<command>` in graph (not `verb_runtime`). `fix-module` and `fix-bug` also have explicit workflows matching the fix verb runtime. No governance gate stack unless orchestrator specifies one.
37
+
24
38
  **Aliases:** `commands.<name>.alias` → resolve canonical command (e.g. `update-api` → `update-integration`) and continue.
25
39
 
26
40
  Legacy names (`module-update`, `architecture`, `swarm-check`, …) are aliases in [graph.yaml](graph.yaml).
@@ -37,9 +51,10 @@ Read [graph.yaml](graph.yaml) and [ontology.json](ontology.json).
37
51
  - **Lifecycle (work):** [lifecycle/lifecycle.json](lifecycle/lifecycle.json) `verbs.*.work_phases`
38
52
  - **Gates (approval):** [governance/gates.json](governance/gates.json) — composed into runtime per `verb_runtime` in graph
39
53
  - **Maturity:** read `object_maturity.<object>` and apply `maturity_rules.<level>` (may require extra gate phases)
40
- - **Capabilities:** resolve `object_capabilities.<object>` via [capabilities/registry.json](capabilities/registry.json) — record all providers (skill + mcp) on Run
54
+ - **Capabilities:** resolve `object_capabilities.<object>` via [capabilities/registry.json](capabilities/registry.json) — `init-run.mjs` records providers on `Run.capabilities_resolved`; on completion `capability-evidence.mjs` aggregates evidence into [state/capability-stats.json](state/capability-stats.json) and evaluates [capabilities/promotion-rules.json](capabilities/promotion-rules.json)
41
55
  - **Dependencies:** [dependencies.yaml](dependencies.yaml)
42
- - **Fitness:** [fitness-functions.yaml](fitness-functions.yaml)
56
+ - **Fitness:** [fitness-functions.yaml](fitness-functions.yaml) — includes `minimal_complexity` for create/update/fix
57
+ - **Complexity:** [complexity.yaml](complexity.yaml) + [minimal-complexity.md](../policies/minimal-complexity.md) for create/update/fix
43
58
  - **Contracts:** validate against [contracts/commands/](contracts/commands/) and [contracts/skills/](contracts/skills/)
44
59
 
45
60
  ## 2.5 Create or resume Run
@@ -47,7 +62,7 @@ Read [graph.yaml](graph.yaml) and [ontology.json](ontology.json).
47
62
  Before loading orchestrator:
48
63
 
49
64
  1. **Create** `state/runs/{run_id}/run.json` per [run/schema.json](run/schema.json)
50
- 2. Set `pending` from `verb_runtime.<verb>` in graph (work + gates composed)
65
+ 2. Set `pending` from `command_workflows.<command>` when present, else `verb_runtime.<verb>`
51
66
  3. Set `status: running`, first `phase`, `phase_kind: work`
52
67
  4. Record resolved orchestrator, object, domain, intent on Run
53
68
 
@@ -63,6 +78,7 @@ All state and observability live on the Run — **no** standalone execution-stat
63
78
  - [master-rules.md](../policies/master-rules.md)
64
79
  - [implementation.md](../policies/implementation.md)
65
80
  - [mcp-and-deploy.md](../policies/mcp-and-deploy.md)
81
+ - [minimal-complexity.md](../policies/minimal-complexity.md) — **create / update / fix only**
66
82
  - Read [verbs/_dispatch-utils.md](../skills/shared/verbs/_dispatch-utils.md) for inventory + investigation rules
67
83
  - Read [run/SKILL.md](../skills/shared/run/SKILL.md) for Run update protocol
68
84
 
@@ -89,10 +105,10 @@ Gates run after `plan`, before `execute` (or before `report` when verb has no ex
89
105
 
90
106
  | Gate | Skill |
91
107
  |------|-------|
92
- | **validate** | [validation/SKILL.md](../skills/shared/validation/SKILL.md) |
108
+ | **validate** | [validation/SKILL.md](../skills/shared/validation/SKILL.md) — confidence + **complexity plan** |
93
109
  | **impact_analysis** | [impact-analysis/SKILL.md](../skills/shared/impact-analysis/SKILL.md) |
94
110
  | **dependency_graph** | [dependency-graph/SKILL.md](../skills/shared/dependency-graph/SKILL.md) |
95
- | **fitness_functions** | [fitness-functions/SKILL.md](../skills/shared/fitness-functions/SKILL.md) |
111
+ | **fitness_functions** | [fitness-functions/SKILL.md](../skills/shared/fitness-functions/SKILL.md) — **`minimal_complexity` blocks on fail** |
96
112
  | **rollback** | [rollback/SKILL.md](../skills/shared/rollback/SKILL.md) when maturity or blast radius requires |
97
113
 
98
114
  ### Human approval at gate boundaries
@@ -121,7 +137,16 @@ Do **not** proceed until user approves in chat. On approval: log decision, set `
121
137
  |------|----------------|
122
138
  | create | [investigation-lite](../skills/shared/investigation-lite/SKILL.md) |
123
139
  | update | [investigation-lite](../skills/shared/investigation-lite/SKILL.md) |
124
- | fix | [investigation](../skills/shared/investigation/SKILL.md) → [root-cause](../skills/shared/root-cause/SKILL.md) |
140
+ | fix | [investigation](../skills/shared/investigation/SKILL.md) Mode A (7-agent swarm) → [root-cause](../skills/shared/root-cause/SKILL.md) |
141
+
142
+ ### Fix swarm (mandatory on fix verb / fix_mode)
143
+
144
+ 1. **discover** — 4–6 parallel Task agents per [discovery/SKILL.md](../skills/shared/discovery/SKILL.md)
145
+ 2. **investigate_swarm** — 7 parallel Task agents per investigation Mode A — **one message**
146
+ 3. **root_cause** — artifact required; confidence ≥ 0.7 before plan
147
+ 4. **verify** — fix verify swarm (3 parallel) per [testing/SKILL.md](../skills/shared/testing/SKILL.md); **website build gate** (`verify-website-build.mjs`) must pass for create/update/fix; fail if `repro_status: not_fixed`
148
+
149
+ Skipping swarms because the issue "looks simple" is a **contract violation** for `fix-module` / `fix-bug` / `fix_mode`.
125
150
 
126
151
  ## 5. Report
127
152
 
@@ -0,0 +1,25 @@
1
+ {
2
+ "version": 2,
3
+ "description": "AAAC runtime enforcement — SSOT for hooks and run engine",
4
+ "edit_phases": ["execute", "sync_inventory", "persist", "write"],
5
+ "artifact_write_phases": ["plan", "report", "verify"],
6
+ "verify_verbs": ["create", "update", "fix"],
7
+ "swarm_min_agents": {
8
+ "discover": 4,
9
+ "investigate_swarm": 7,
10
+ "research_swarm": 6,
11
+ "verify_fix": 3
12
+ },
13
+ "phase_artifacts": {
14
+ "investigate_swarm": ["artifacts/investigation.md"],
15
+ "root_cause": ["artifacts/root_cause.yaml"],
16
+ "plan": ["artifacts/plan.yaml"],
17
+ "verify": ["artifacts/verify.yaml"],
18
+ "report": ["artifacts/report.md"]
19
+ },
20
+ "allowed_path_prefixes": {
21
+ "run_artifacts": [".cursor/aaac/state/runs/", "aaac/state/runs/"],
22
+ "write_article": [".cursor/write-article-runs/"]
23
+ },
24
+ "fix_commands": ["fix-module", "fix-bug", "module-fix", "bug-fix"]
25
+ }
@@ -28,6 +28,14 @@ functions:
28
28
  skill: architecture
29
29
  applies_to: [module, component, feature, app]
30
30
 
31
+ minimal_complexity:
32
+ description: Reuse-first plan, complexity score within verb threshold, YAGNI — no speculative architecture
33
+ policy: minimal-complexity
34
+ config: aaac/complexity.yaml
35
+ applies_to: [function, component, module, schema, model, migration, feature, workflow, integration, app, domain, architecture]
36
+ applies_to_verbs: [create, update, fix]
37
+ blocking: true
38
+
31
39
  scoring:
32
40
  pass: meets criteria
33
41
  warning: minor gap — document in report, may proceed if user intent clear
@@ -24,10 +24,14 @@
24
24
  "human_approval": {
25
25
  "trigger_when": [
26
26
  "confidence below threshold",
27
- "fitness fail on security or layer_boundaries",
27
+ "fitness fail on security or layer_boundaries or minimal_complexity",
28
+ "complexity score above verb threshold",
29
+ "plan missing requirement_map or unjustified create",
28
30
  "impact proceed false",
29
31
  "rollback unverified",
30
- "user intent contains requires approval"
32
+ "user intent contains requires approval",
33
+ "capability runtime require_approval",
34
+ "capability state deprecated"
31
35
  ],
32
36
  "run_fields": {
33
37
  "status": "blocked",