@ludecker/aaac 1.1.5 → 1.2.0
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.
- package/README.md +27 -12
- package/package.json +9 -9
- package/src/cli.mjs +19 -7
- package/src/generators/generate-commands.mjs +25 -1
- package/src/generators/generate-graph.mjs +9 -1
- package/src/lib/install.mjs +13 -1
- package/src/lib/sweep-project-docs.mjs +348 -0
- package/src/run-engine/advance-phase.mjs +23 -0
- package/src/run-engine/debug-run.mjs +0 -0
- package/src/run-engine/gate-write.mjs +13 -0
- package/src/run-engine/lib.mjs +153 -5
- package/src/run-engine/log-dump.mjs +0 -0
- package/src/run-engine/log-trace.mjs +0 -0
- package/templates/cursor/aaac/enforcement.json +96 -5
- package/templates/cursor/aaac/graph.project.yaml +44 -5
- package/templates/cursor/aaac/lifecycle/lifecycle.json +26 -0
- package/templates/cursor/aaac/lifecycle/phases.json +9 -1
- package/templates/cursor/aaac/ontology.json +1 -0
- package/templates/cursor/aaac/project.config.json +36 -0
- package/templates/cursor/aaac/scripts/remediation/auto-check-swarm-synthesis.mjs +75 -0
- package/templates/cursor/aaac/scripts/remediation/auto-dispatch-queue-from-health.mjs +78 -0
- package/templates/cursor/aaac/scripts/remediation/bootstrap-autonomous.mjs +113 -0
- package/templates/cursor/aaac/scripts/remediation/capture-verify-baseline.mjs +66 -0
- package/templates/cursor/aaac/scripts/remediation/capture-wave-snapshot.mjs +79 -0
- package/templates/cursor/aaac/scripts/remediation/check-swarm-raw.template.json +26 -0
- package/templates/cursor/aaac/scripts/remediation/classify-fallow-issues.mjs +77 -0
- package/templates/cursor/aaac/scripts/remediation/classify-verify-failure.mjs +176 -0
- package/templates/cursor/aaac/scripts/remediation/compute-satisfaction.mjs +344 -0
- package/templates/cursor/aaac/scripts/remediation/debt-sweep-gate.mjs +202 -0
- package/templates/cursor/aaac/scripts/remediation/dispatch-rules.json +44 -0
- package/templates/cursor/aaac/scripts/remediation/fallow-fp-rules.json +87 -0
- package/templates/cursor/aaac/scripts/remediation/fallow-scan.mjs +219 -0
- package/templates/cursor/aaac/scripts/remediation/handle-yield.mjs +240 -0
- package/templates/cursor/aaac/scripts/remediation/init-campaign.mjs +211 -0
- package/templates/cursor/aaac/scripts/remediation/lib/autonomous-mode.mjs +63 -0
- package/templates/cursor/aaac/scripts/remediation/lib/campaign-focus.mjs +87 -0
- package/templates/cursor/aaac/scripts/remediation/lib/fallow-classifier.mjs +190 -0
- package/templates/cursor/aaac/scripts/remediation/lib/fallow-health-targets.mjs +56 -0
- package/templates/cursor/aaac/scripts/remediation/lib/fallow-metrics.mjs +119 -0
- package/templates/cursor/aaac/scripts/remediation/lib/invoke-cursor-agent.mjs +51 -0
- package/templates/cursor/aaac/scripts/remediation/lib/reconcile-run-manifest.mjs +41 -0
- package/templates/cursor/aaac/scripts/remediation/lib/regression-analysis.mjs +55 -0
- package/templates/cursor/aaac/scripts/remediation/lib/remediation-config.mjs +69 -0
- package/templates/cursor/aaac/scripts/remediation/lib/remediation-progress.mjs +58 -0
- package/templates/cursor/aaac/scripts/remediation/lib/remediation-watch-loop.mjs +168 -0
- package/templates/cursor/aaac/scripts/remediation/lib/runner-exec.mjs +156 -0
- package/templates/cursor/aaac/scripts/remediation/lib/runner-state.mjs +145 -0
- package/templates/cursor/aaac/scripts/remediation/lib/verify-metrics.mjs +205 -0
- package/templates/cursor/aaac/scripts/remediation/merge-check-swarm.mjs +257 -0
- package/templates/cursor/aaac/scripts/remediation/plan-waves-from-queue.mjs +85 -0
- package/templates/cursor/aaac/scripts/remediation/prepare-check-context.mjs +148 -0
- package/templates/cursor/aaac/scripts/remediation/record-fallow-fp.mjs +107 -0
- package/templates/cursor/aaac/scripts/remediation/record-iteration-step.mjs +56 -0
- package/templates/cursor/aaac/scripts/remediation/remediation-cli.mjs +157 -0
- package/templates/cursor/aaac/scripts/remediation/remediation-cursor-watch.sh +10 -0
- package/templates/cursor/aaac/scripts/remediation/remediation-runner-daemon.sh +13 -0
- package/templates/cursor/aaac/scripts/remediation/remediation-runner.mjs +748 -0
- package/templates/cursor/aaac/scripts/remediation/remediation-yield-watcher.mjs +40 -0
- package/templates/cursor/aaac/scripts/remediation/remediator-gate.mjs +405 -0
- package/templates/cursor/aaac/scripts/remediation/repair-fallow-start-baseline.mjs +118 -0
- package/templates/cursor/aaac/scripts/remediation/runner-health-check.mjs +164 -0
- package/templates/cursor/aaac/scripts/remediation/satisfaction-loop-gate.mjs +286 -0
- package/templates/cursor/aaac/scripts/remediation/validate-campaign-complete.mjs +191 -0
- package/templates/cursor/aaac/scripts/remediation/verify-remediation-iteration.mjs +112 -0
- package/templates/cursor/aaac/scripts/run-engine/advance-phase.mjs +23 -0
- package/templates/cursor/aaac/scripts/run-engine/debug-run.mjs +0 -0
- package/templates/cursor/aaac/scripts/run-engine/gate-write.mjs +13 -0
- package/templates/cursor/aaac/scripts/run-engine/lib.mjs +153 -5
- package/templates/cursor/aaac/scripts/run-engine/log-dump.mjs +0 -0
- package/templates/cursor/aaac/scripts/run-engine/log-trace.mjs +0 -0
- package/templates/cursor/agents/doc-conformance.md +25 -0
- package/templates/cursor/agents/implementation-review.md +21 -0
- package/templates/cursor/agents/remediation-check-app-inventory.md +32 -0
- package/templates/cursor/agents/remediation-check-app-ssot.md +24 -0
- package/templates/cursor/agents/remediation-check-app-trace.md +29 -0
- package/templates/cursor/agents/remediation-check-architecture-boundaries.md +21 -0
- package/templates/cursor/agents/remediation-check-architecture-decomposition.md +25 -0
- package/templates/cursor/agents/remediation-check-architecture-deps.md +23 -0
- package/templates/cursor/agents/remediation-check-risk.md +37 -0
- package/templates/cursor/agents/remediation-e2e-gate.md +30 -0
- package/templates/cursor/agents/remediation-remediator.md +69 -0
- package/templates/cursor/agents/test-author.md +27 -0
- package/templates/cursor/commands/remediate-app.md +212 -0
- package/templates/cursor/hooks/aaac-before-submit.sh +0 -0
- package/templates/cursor/hooks/aaac-pre-tool.sh +0 -0
- package/templates/cursor/hooks/aaac-stop.sh +0 -0
- package/templates/cursor/hooks/aaac-subagent-start.sh +0 -0
- package/templates/cursor/rules/aaac-enforcement.mdc +10 -3
- package/templates/cursor/skills/shared/execution/SKILL.md +7 -3
- package/templates/cursor/skills/shared/governance/implementation/SKILL.md +396 -28
- package/templates/cursor/skills/shared/implementation-review/SKILL.md +49 -0
- package/templates/cursor/skills/shared/planning/SKILL.md +5 -0
- package/templates/cursor/skills/shared/remediation/SKILL.md +51 -0
- package/templates/cursor/skills/shared/remediation/babysit/SKILL.md +223 -0
- package/templates/cursor/skills/shared/remediation/check-swarm/SKILL.md +114 -0
- package/templates/cursor/skills/shared/remediation/orchestrator/SKILL.md +275 -0
- package/templates/cursor/skills/shared/remediation/orchestrator/contract.yaml +116 -0
- package/templates/cursor/skills/shared/test-authoring/SKILL.md +58 -0
- package/templates/cursor/skills/shared/testing/SKILL.md +6 -0
- package/templates/cursor/skills/shared/verbs/create/orchestrator/SKILL.md +5 -3
- package/templates/cursor/skills/shared/verbs/fix/orchestrator/SKILL.md +5 -3
- package/templates/cursor/skills/shared/verbs/update/orchestrator/SKILL.md +5 -3
- package/templates/cursor/skills/shared/verification/SKILL.md +5 -3
- package/templates/docs/agentic_architecture.md +169 -97
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Agent: remediation-remediator
|
|
2
|
+
|
|
3
|
+
## Role
|
|
4
|
+
|
|
5
|
+
Execute the **Remediator** step when `remediator-gate.mjs` or `debt-sweep-gate.mjs` exits **3** (`action: remediate`).
|
|
6
|
+
|
|
7
|
+
## Critical rule
|
|
8
|
+
|
|
9
|
+
**Exit 3 is not a stop signal.** The parent orchestrator must:
|
|
10
|
+
|
|
11
|
+
1. Apply the handoff inline
|
|
12
|
+
2. Re-run the gate with `--attempt N+1` (or debt-sweep retry_command)
|
|
13
|
+
3. Repeat until promote (exit 0) or true block (exit 1 after debt sweep exhaustion)
|
|
14
|
+
|
|
15
|
+
Never set `campaign.status=blocked` on exit 3. Never skip remaining waves.
|
|
16
|
+
|
|
17
|
+
## Trigger
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
node .cursor/aaac/scripts/remediation/remediator-gate.mjs \
|
|
21
|
+
--campaign-id <id> --iteration <n> --mode wave|debt \
|
|
22
|
+
--wave-index <w> --run-id <run_id> --attempt 1
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Read stdout JSON. When `action === "remediate"` OR `orchestrator_must_not_stop === true`:
|
|
26
|
+
|
|
27
|
+
- Apply handoff **inside parent `execute` or `debt_sweep` phase** (same chat — no nested Run)
|
|
28
|
+
|
|
29
|
+
## Handoff fields
|
|
30
|
+
|
|
31
|
+
| Field | Use |
|
|
32
|
+
|-------|-----|
|
|
33
|
+
| `handoff.command` | `fix-module` or `fix-bug` |
|
|
34
|
+
| `handoff.domain` | e.g. `frontend`, `backend` |
|
|
35
|
+
| `handoff.intent` | Full intent including validator output |
|
|
36
|
+
| `handoff.file_paths` | Prioritize these files |
|
|
37
|
+
| `handoff.log_path` | **Read full log** — primary evidence source |
|
|
38
|
+
| `handoff.layer` | Failed layer |
|
|
39
|
+
| `retry_command` | Exact re-run command after fix |
|
|
40
|
+
|
|
41
|
+
## Evidence (mandatory)
|
|
42
|
+
|
|
43
|
+
1. Read `handoff.log_path` or `iterations/{n}/verify-logs/{mode}-{layer}.log`
|
|
44
|
+
2. Do **not** rely on truncated `stderr_tail` alone
|
|
45
|
+
3. For wave regression handoffs, fix only **introduced** layers (`introduced_layers` in payload)
|
|
46
|
+
|
|
47
|
+
## Execution
|
|
48
|
+
|
|
49
|
+
1. Load `iterations/{n}/remediator-handoff-attempt-{attempt}.json`
|
|
50
|
+
2. Run fix-module / fix-bug **inline** (discover → execute → test_execute → verify)
|
|
51
|
+
3. Re-run gate using `retry_command` from payload
|
|
52
|
+
4. Repeat until `action: promote` | `promote_wave` | `defer_to_debt_sweep` | `debt_sweep_complete`
|
|
53
|
+
|
|
54
|
+
## Wave vs debt
|
|
55
|
+
|
|
56
|
+
| Mode | Fix scope |
|
|
57
|
+
|------|-----------|
|
|
58
|
+
| `wave` | Only layers in `introduced_layers` (new regression) |
|
|
59
|
+
| `debt` | All failing layers until strict pass |
|
|
60
|
+
|
|
61
|
+
## Return
|
|
62
|
+
|
|
63
|
+
```yaml
|
|
64
|
+
status: promoted | deferred | debt_sweep_complete | remediate_again
|
|
65
|
+
attempt: number
|
|
66
|
+
max_attempts: number
|
|
67
|
+
layers_fixed: []
|
|
68
|
+
remaining_failures: []
|
|
69
|
+
```
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Agent: test-author
|
|
2
|
+
|
|
3
|
+
**Phase:** `test_execute` only. Parent orchestrator must **not** write test files — this agent does.
|
|
4
|
+
|
|
5
|
+
## Role
|
|
6
|
+
|
|
7
|
+
Author behavioral tests for changes made in `execute`. Read plan `tests_to_add[]`, implementation diff, and domain inventory test conventions.
|
|
8
|
+
|
|
9
|
+
## Must
|
|
10
|
+
|
|
11
|
+
- Write only `*.test.*`, `*.spec.*`, or paths under `__tests__/` / `tests/`
|
|
12
|
+
- Cover behaviors from `requirement_map`, not implementation details
|
|
13
|
+
- Match existing test framework (vitest, playwright) in the touched package
|
|
14
|
+
- Include [_task-prompt-policy.md](../skills/shared/_task-prompt-policy.md) policies
|
|
15
|
+
|
|
16
|
+
## Must not
|
|
17
|
+
|
|
18
|
+
- Edit production/source files (non-test paths)
|
|
19
|
+
- Weaken assertions to make tests pass
|
|
20
|
+
- Duplicate tests that already cover the behavior
|
|
21
|
+
|
|
22
|
+
## Return
|
|
23
|
+
|
|
24
|
+
- Files created/modified (paths only)
|
|
25
|
+
- Behaviors covered (one line each)
|
|
26
|
+
- Gaps — behaviors still untested
|
|
27
|
+
- Confidence: high | medium | low
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
# remediate-app
|
|
2
|
+
|
|
3
|
+
AAAC: `/remediate-app [domain] "<intent>"`
|
|
4
|
+
|
|
5
|
+
**Layer:** system
|
|
6
|
+
**Campaign loop** — Fallow suite (dead-code + dupes + health) → check swarm → ranked fix waves → **regression wave gates** → **mandatory debt sweep** → satisfaction loop.
|
|
7
|
+
|
|
8
|
+
## Dispatch
|
|
9
|
+
|
|
10
|
+
1. [.cursor/aaac/dispatch.md](../aaac/dispatch.md)
|
|
11
|
+
2. [.cursor/aaac/graph.yaml](../aaac/graph.yaml) — **`remediate-app`**
|
|
12
|
+
3. [skills/shared/remediation/orchestrator/SKILL.md](../skills/shared/remediation/orchestrator/SKILL.md)
|
|
13
|
+
|
|
14
|
+
## Hard invariants
|
|
15
|
+
|
|
16
|
+
- **Exit 3 = continue** — never stop the campaign on `remediate` handoff
|
|
17
|
+
- **Waves use regression gate** — pre-existing TS/vitest debt does not block cleanup waves
|
|
18
|
+
- **Debt sweep is mandatory** — all layers must pass before report
|
|
19
|
+
- **All planned waves must run** — no skipping on verify failure
|
|
20
|
+
- **Satisfaction exit 3 = next iteration** — never report when score < threshold and iterations remain
|
|
21
|
+
- **Fallow start baselines are immutable** — `fallow-start-baseline.json` (dead-code), `fallow-start-dupes-baseline.json`, `fallow-start-health-baseline.json` set once at campaign start (dupes/health auto-backfill on first scan if missing)
|
|
22
|
+
- **Fallow false positives excluded from satisfaction** — dead-code score uses actionable issues; dupes uses `clone_groups`; health uses `health_score`
|
|
23
|
+
|
|
24
|
+
## Intent tokens
|
|
25
|
+
|
|
26
|
+
| Token | Default | Example |
|
|
27
|
+
|-------|---------|---------|
|
|
28
|
+
| `max_iterations` | `5` | `max_iterations=8` |
|
|
29
|
+
| `max_waves_per_iteration` | `3` | `max_waves_per_iteration=2` |
|
|
30
|
+
| `max_debt_sweep_rounds` | `10` | `max_debt_sweep_rounds=15` |
|
|
31
|
+
| `max_remediator_attempts_per_wave` | `3` | `max_remediator_attempts_per_wave=5` |
|
|
32
|
+
| `max_remediator_attempts_per_debt_round` | `3` | `max_remediator_attempts_per_debt_round=5` |
|
|
33
|
+
| `satisfaction_threshold` | `85` | `satisfaction_threshold=90` |
|
|
34
|
+
| `autonomous` | auto when threshold≥100 or max_iterations≥10 | `autonomous` / `manual` |
|
|
35
|
+
| `resume` | — | `resume campaign_20260617_abc123` |
|
|
36
|
+
|
|
37
|
+
## Example
|
|
38
|
+
|
|
39
|
+
```text
|
|
40
|
+
/remediate-app "whole repo; max_iterations=5; satisfaction_threshold=85"
|
|
41
|
+
/remediate-app cms "Fallow cleanup until regression clean"
|
|
42
|
+
/remediate-app cms "manual; max_iterations=3"
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Ensure dev server is running when Playwright is enabled — see `project.config.json` → `remediation.verify.dev_server`.
|
|
46
|
+
|
|
47
|
+
## Two-tier verification
|
|
48
|
+
|
|
49
|
+
### Wave gate (regression — after each fix wave)
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
node .cursor/aaac/scripts/remediation/capture-wave-snapshot.mjs \
|
|
53
|
+
--campaign-id <id> --iteration <n> --wave-index <w>
|
|
54
|
+
|
|
55
|
+
node .cursor/aaac/scripts/remediation/remediator-gate.mjs \
|
|
56
|
+
--campaign-id <id> --iteration <n> --mode wave --wave-index <w> \
|
|
57
|
+
--run-id <run_id> --attempt 1
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Promotes when errors did **not increase** vs pre-wave snapshot. Pre-existing debt is deferred to debt sweep.
|
|
61
|
+
|
|
62
|
+
**Exit 3** → run [remediation-remediator.md](../agents/remediation-remediator.md) → `--attempt N+1` → **do not stop**.
|
|
63
|
+
|
|
64
|
+
### Debt sweep (strict — after all waves)
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
node .cursor/aaac/scripts/remediation/debt-sweep-gate.mjs \
|
|
68
|
+
--campaign-id <id> --iteration <n> --run-id <run_id> --round 1 --attempt 1
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Loops until typecheck, vitest, go test, build, and Playwright all pass.
|
|
72
|
+
|
|
73
|
+
### Satisfaction loop (after debt sweep)
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
node .cursor/aaac/scripts/remediation/compute-satisfaction.mjs \
|
|
77
|
+
--campaign-id <id> --iteration <n>
|
|
78
|
+
|
|
79
|
+
node .cursor/aaac/scripts/remediation/satisfaction-loop-gate.mjs \
|
|
80
|
+
--campaign-id <id> --iteration <n> --run-id <run_id> --advance
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
| Code | Meaning |
|
|
84
|
+
|------|---------|
|
|
85
|
+
| `0` + `complete` | Threshold met → allow `report` |
|
|
86
|
+
| `0` + `partial_complete` | Max iterations → allow partial `report` |
|
|
87
|
+
| `3` + `continue_loop` | Score below threshold → **iteration N+1, return to scan** |
|
|
88
|
+
|
|
89
|
+
### Campaign complete check
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
node .cursor/aaac/scripts/remediation/validate-campaign-complete.mjs \
|
|
93
|
+
--campaign-id <id> --iteration <n> --require-debt-sweep --require-satisfaction-loop
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Repair corrupted Fallow baseline (legacy campaigns)
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
node .cursor/aaac/scripts/remediation/repair-fallow-start-baseline.mjs \
|
|
100
|
+
--campaign-id <id> --total 1649 --dupes-clone-groups 171 --health-score 87.7
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Fallow scan suite (scan phase)
|
|
104
|
+
|
|
105
|
+
`fallow-scan.mjs` runs three Fallow commands from `frontend/`:
|
|
106
|
+
|
|
107
|
+
| Layer | Command | Artifact | Baseline file | Scoring metric |
|
|
108
|
+
|-------|---------|----------|---------------|----------------|
|
|
109
|
+
| Dead code | `fallow dead-code` | `iterations/{n}/fallow-scan.json` | `fallow-start-baseline.json` | actionable issues (excludes FP) |
|
|
110
|
+
| Dupes | `fallow dupes` | `iterations/{n}/fallow-dupes.json` | `fallow-start-dupes-baseline.json` | `clone_groups` reduction |
|
|
111
|
+
| Health | `fallow health --score` | `iterations/{n}/fallow-health.json` | `fallow-start-health-baseline.json` | `health_score` improvement |
|
|
112
|
+
|
|
113
|
+
Combined summary: `iterations/{n}/fallow-scan-bundle.json`
|
|
114
|
+
|
|
115
|
+
### Satisfaction weights (40% Fallow total)
|
|
116
|
+
|
|
117
|
+
| Component | Weight |
|
|
118
|
+
|-----------|--------|
|
|
119
|
+
| `fallow_dead_code` | 0.25 |
|
|
120
|
+
| `fallow_dupes` | 0.10 |
|
|
121
|
+
| `fallow_health` | 0.05 |
|
|
122
|
+
| `structural_clean` | 0.15 |
|
|
123
|
+
| `unit_tests` | 0.15 |
|
|
124
|
+
| `build` | 0.10 |
|
|
125
|
+
| `e2e` | 0.20 |
|
|
126
|
+
|
|
127
|
+
Regression blocks completion when actionable dead-code, `clone_groups`, or `health_score` regresses vs immutable baselines.
|
|
128
|
+
|
|
129
|
+
## Exit codes (remediator-gate / debt-sweep-gate / satisfaction-loop-gate)
|
|
130
|
+
|
|
131
|
+
| Code | Meaning | Agent action |
|
|
132
|
+
|------|---------|--------------|
|
|
133
|
+
| `0` | Promote / debt sweep complete | Continue pipeline |
|
|
134
|
+
| `1` | Blocked (max rounds / infra) | Report with handoff |
|
|
135
|
+
| `3` | Remediate / continue loop | **Fix inline or advance iteration — never stop, never report** |
|
|
136
|
+
|
|
137
|
+
## Persistence
|
|
138
|
+
|
|
139
|
+
`.cursor/aaac/state/campaigns/{campaign_id}/` — see orchestrator SKILL for layout.
|
|
140
|
+
|
|
141
|
+
Full verify logs: `iterations/{n}/verify-logs/*.log` (not stderr tails).
|
|
142
|
+
|
|
143
|
+
## Fallow false positives (SSOT)
|
|
144
|
+
|
|
145
|
+
Fallow raw counts include issues that are not real debt. The loop bridges swarm knowledge into metrics via **check-app + check-architecture mirrors** (7-agent swarm).
|
|
146
|
+
|
|
147
|
+
### check_swarm flow
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
# After fallow-scan + classify
|
|
151
|
+
node .cursor/aaac/scripts/remediation/prepare-check-context.mjs \
|
|
152
|
+
--campaign-id <id> --iteration <n> --run-id <run_id>
|
|
153
|
+
|
|
154
|
+
# 7 parallel readonly Task agents (see skills/shared/remediation/check-swarm/SKILL.md)
|
|
155
|
+
# Parent collects JSON → iterations/{n}/check-swarm-raw.json
|
|
156
|
+
|
|
157
|
+
node .cursor/aaac/scripts/remediation/merge-check-swarm.mjs \
|
|
158
|
+
--campaign-id <id> --iteration <n> --run-id <run_id>
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
| Agent wave | Mirrors | Purpose |
|
|
162
|
+
|------------|---------|---------|
|
|
163
|
+
| check-app (×3) | `/check-app` | Workers, barrels, lazy routes, trace-file |
|
|
164
|
+
| check-architecture (×3) | `/check-architecture` | Boundaries, blast radius, dupes families |
|
|
165
|
+
| check-risk (×1) | remediation guard | FP registry, protected paths |
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
# Auto-runs after every fallow-scan
|
|
169
|
+
node .cursor/aaac/scripts/remediation/classify-fallow-issues.mjs \
|
|
170
|
+
--campaign-id <id> --iteration <n>
|
|
171
|
+
|
|
172
|
+
# check-risk swarm records confirmed false positives
|
|
173
|
+
node .cursor/aaac/scripts/remediation/record-fallow-fp.mjs \
|
|
174
|
+
--campaign-id <id> --path src/hooks/useCryptoPriceWorker.ts \
|
|
175
|
+
--classification false_positive --reason dynamically_loaded_worker --source check-risk
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
| File | Purpose |
|
|
179
|
+
|------|---------|
|
|
180
|
+
| `fallow-fp-rules.json` | Rule SSOT (workers, overlay barrels, barrel heuristics) |
|
|
181
|
+
| `fallow-false-positives.json` | Campaign registry (swarm + manual overrides) |
|
|
182
|
+
| `iterations/{n}/fallow-classification.json` | Per-scan classified inventory |
|
|
183
|
+
| `iterations/{n}/check-context.json` | Swarm input SSOT (Fallow inventory + dupes top groups) |
|
|
184
|
+
| `iterations/{n}/check-swarm-merge.json` | Merged FP/protected paths + reclassified totals |
|
|
185
|
+
| `artifacts/check_app_validate.yaml` | check-app mirror verdict |
|
|
186
|
+
| `artifacts/check_architecture_fitness.yaml` | check-architecture mirror criteria |
|
|
187
|
+
| `artifacts/protected_paths.yaml` | Wave exclusion list (mandatory in dispatch-queue) |
|
|
188
|
+
|
|
189
|
+
**Satisfaction** uses `actionable_total` for dead-code (excludes `false_positive`), `clone_groups` for dupes, and `health_score` for health. Waves must not delete paths in `fallow-false-positives.json`.
|
|
190
|
+
|
|
191
|
+
## Autonomous platform (runner + babysit)
|
|
192
|
+
|
|
193
|
+
Long campaigns (`satisfaction_threshold=100`, many iterations) must use the **shell runner**, not chat turns alone.
|
|
194
|
+
|
|
195
|
+
| Layer | Path |
|
|
196
|
+
|-------|------|
|
|
197
|
+
| Shell runner | `.cursor/aaac/scripts/remediation/remediation-runner.mjs` |
|
|
198
|
+
| Daemon | `.cursor/aaac/scripts/remediation/remediation-runner-daemon.sh` |
|
|
199
|
+
| Health | `.cursor/aaac/scripts/remediation/runner-health-check.mjs` |
|
|
200
|
+
| Babysit skill | [skills/shared/remediation/babysit/SKILL.md](../skills/shared/remediation/babysit/SKILL.md) |
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
# Bootstrap (after /remediate-app creates Run + campaign)
|
|
204
|
+
node .cursor/aaac/scripts/remediation/remediation-runner.mjs \
|
|
205
|
+
--run-id <run_id> --campaign-id <campaign_id> --until-yield
|
|
206
|
+
|
|
207
|
+
# Babysit: handle exit 3 yields, then --ack-yield <type>, repeat until exit 0
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
Stop-hook `loop_limit` (200) is a **guardrail** for short chat continuations — not the primary loop driver.
|
|
211
|
+
|
|
212
|
+
**Autonomous is baked into `init-campaign.mjs`:** when `campaign.config.autonomous`, the orchestrator reads `artifacts/autonomous_bootstrap.json` and follows [babysit/SKILL.md](../skills/shared/remediation/babysit/SKILL.md) — no extra user prompt required.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -19,7 +19,7 @@ Every AAAC slash command (`/fix-module`, `/update-module`, `/write-article`, …
|
|
|
19
19
|
| Hook | Effect |
|
|
20
20
|
|------|--------|
|
|
21
21
|
| `beforeSubmitPrompt` | Detects `/command` → creates Run scoped to **`conversation_id`** (this chat only) |
|
|
22
|
-
| `preToolUse` | **Denies**
|
|
22
|
+
| `preToolUse` | **Denies** edits outside allowed phases; **phase-scoped paths** — `execute` = prod only, `test_execute` = tests only |
|
|
23
23
|
| `subagentStart` | Counts Task launches for swarm phase validation |
|
|
24
24
|
| `stop` | Follow-up if Run not `completed` |
|
|
25
25
|
|
|
@@ -34,12 +34,19 @@ Every AAAC slash command (`/fix-module`, `/update-module`, `/write-article`, …
|
|
|
34
34
|
- `discover`: 4 Task agents (check verbs: `check_swarm` 3)
|
|
35
35
|
- `investigate_swarm`: 7 Task agents
|
|
36
36
|
- `research_swarm`: 6 Task agents
|
|
37
|
-
|
|
37
|
+
- `test_execute`: 1 test-author Task agent (mutating verbs)
|
|
38
|
+
- `verify`: 3 Task agents (all create/update/fix — not fix-only)
|
|
39
|
+
- `review_swarm`: 3 readonly reviewers (mutating verbs)
|
|
40
|
+
4. **Agent separation (mutating verbs):**
|
|
41
|
+
- **Writer** — parent in `execute` only (no test files)
|
|
42
|
+
- **Tester** — test-author subagent in `test_execute` only
|
|
43
|
+
- **Reviewer** — readonly swarm in `review_swarm` (not the execute agent)
|
|
44
|
+
5. **Verify gate (create / update / fix):** before advancing past `verify`, run:
|
|
38
45
|
```bash
|
|
39
46
|
node .cursor/aaac/scripts/run-engine/verify-website-build.mjs --run-id <run_id>
|
|
40
47
|
```
|
|
41
48
|
`advance-phase.mjs verify` runs this automatically and blocks on missing static assets or failed `vite build` (catches favicon/path regressions).
|
|
42
|
-
5. **
|
|
49
|
+
5. **Edits:** prod code in `execute`; test files in `test_execute` only. Run artifacts under `.cursor/aaac/state/runs/` anytime.
|
|
43
50
|
6. **Complete the Run** — advance through `report`, set status completed.
|
|
44
51
|
|
|
45
52
|
## If edit is denied
|
|
@@ -15,18 +15,22 @@ Orchestrator phase `execute` after approved plan.
|
|
|
15
15
|
## Mandatory
|
|
16
16
|
|
|
17
17
|
1. Read [governance/implementation/SKILL.md](../governance/implementation/SKILL.md)
|
|
18
|
-
2. Read domain inventory
|
|
18
|
+
2. Read domain [inventory](../../../domains/) constraints
|
|
19
19
|
3. Read [policies/](../../../policies/)
|
|
20
20
|
|
|
21
21
|
## Actions
|
|
22
22
|
|
|
23
|
-
- Edit files per plan and implementation skill
|
|
24
|
-
-
|
|
23
|
+
- Edit **production/source** files per plan and implementation skill
|
|
24
|
+
- **Do not** create or edit test files (`*.test.*`, `*.spec.*`, `__tests__/`) — deferred to `test_execute` / [test-authoring](../test-authoring/SKILL.md)
|
|
25
|
+
- `apply_migration` for new/changed `supabase/migrations/` (project `anseivwusnyiwopihnqu` — see [supabase-mcp.mdc](../../../rules/supabase-mcp.mdc))
|
|
26
|
+
- `track()` for user-facing mutations
|
|
25
27
|
- Structured logging on server async paths
|
|
26
28
|
|
|
27
29
|
## Must not
|
|
28
30
|
|
|
29
31
|
- Invent plan during execution
|
|
32
|
+
- Write or edit test files (hooks block in `execute`; use `test_execute`)
|
|
33
|
+
- Self-review implementation (use [implementation-review](../implementation-review/SKILL.md) in `review_swarm`)
|
|
30
34
|
- Race guards or useEffect-driven mutations (implementation ban)
|
|
31
35
|
- Skip schema validation at boundaries
|
|
32
36
|
|