aether-colony 5.1.0 → 5.2.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 (52) hide show
  1. package/.aether/aether-utils.sh +122 -42
  2. package/.aether/commands/colonize.yaml +4 -0
  3. package/.aether/commands/council.yaml +205 -0
  4. package/.aether/commands/init.yaml +46 -13
  5. package/.aether/commands/insert-phase.yaml +4 -0
  6. package/.aether/commands/plan.yaml +53 -2
  7. package/.aether/commands/quick.yaml +104 -0
  8. package/.aether/commands/resume-colony.yaml +6 -4
  9. package/.aether/commands/resume.yaml +9 -0
  10. package/.aether/commands/run.yaml +37 -1
  11. package/.aether/commands/seal.yaml +9 -0
  12. package/.aether/commands/status.yaml +45 -1
  13. package/.aether/docs/command-playbooks/build-full.md +2 -1
  14. package/.aether/docs/command-playbooks/build-prep.md +2 -1
  15. package/.aether/docs/command-playbooks/continue-full.md +1 -0
  16. package/.aether/docs/command-playbooks/continue-verify.md +1 -0
  17. package/.aether/utils/council.sh +425 -0
  18. package/.aether/utils/error-handler.sh +3 -3
  19. package/.aether/utils/flag.sh +23 -12
  20. package/.aether/utils/hive.sh +2 -2
  21. package/.aether/utils/immune.sh +508 -0
  22. package/.aether/utils/learning.sh +2 -2
  23. package/.aether/utils/midden.sh +178 -0
  24. package/.aether/utils/queen.sh +29 -17
  25. package/.aether/utils/session.sh +264 -0
  26. package/.aether/utils/spawn-tree.sh +7 -7
  27. package/.aether/utils/spawn.sh +2 -2
  28. package/.aether/utils/state-api.sh +191 -1
  29. package/.claude/commands/ant/colonize.md +2 -0
  30. package/.claude/commands/ant/council.md +205 -0
  31. package/.claude/commands/ant/init.md +46 -13
  32. package/.claude/commands/ant/insert-phase.md +4 -0
  33. package/.claude/commands/ant/plan.md +27 -1
  34. package/.claude/commands/ant/quick.md +100 -0
  35. package/.claude/commands/ant/resume-colony.md +3 -2
  36. package/.claude/commands/ant/resume.md +9 -0
  37. package/.claude/commands/ant/run.md +37 -1
  38. package/.claude/commands/ant/seal.md +9 -0
  39. package/.claude/commands/ant/status.md +45 -1
  40. package/.opencode/commands/ant/colonize.md +2 -0
  41. package/.opencode/commands/ant/council.md +143 -0
  42. package/.opencode/commands/ant/init.md +46 -13
  43. package/.opencode/commands/ant/insert-phase.md +4 -0
  44. package/.opencode/commands/ant/plan.md +26 -1
  45. package/.opencode/commands/ant/quick.md +91 -0
  46. package/.opencode/commands/ant/resume-colony.md +3 -2
  47. package/.opencode/commands/ant/resume.md +9 -0
  48. package/.opencode/commands/ant/run.md +37 -1
  49. package/.opencode/commands/ant/status.md +2 -0
  50. package/CHANGELOG.md +90 -0
  51. package/README.md +23 -0
  52. package/package.json +10 -2
@@ -6,9 +6,208 @@ body: |
6
6
  ## Instructions
7
7
 
8
8
  Parse `{{ARGUMENTS}}`:
9
+ - If starts with `--deliberate`: set `deliberate_mode = true`, extract proposal text after `--deliberate`
9
10
  - If contains `--no-visual`: set `visual_mode = false` (visual is ON by default)
10
11
  - Otherwise: set `visual_mode = true`
11
12
 
13
+ **If `deliberate_mode` is true:** Skip to [Deliberation Mode](#deliberation-mode) and stop after it.
14
+
15
+ ---
16
+
17
+ ## Deliberation Mode
18
+
19
+ When `--deliberate "<proposal>"` is passed, run a structured Advocate/Challenger/Sage deliberation.
20
+
21
+ ### Step D1: Check Budget
22
+
23
+ Run using the Bash tool with description "Checking deliberation budget...":
24
+ ```bash
25
+ bash .aether/aether-utils.sh council-budget-check
26
+ ```
27
+
28
+ Parse result. If `allowed` is `false`:
29
+ ```
30
+ 📜🐜🏛️🐜📜 COUNCIL — BUDGET EXHAUSTED
31
+
32
+ Spawn budget is fully allocated. Complete or close existing deliberations before starting new ones.
33
+ Run /ant:council to review existing deliberations.
34
+ ```
35
+ Stop here.
36
+
37
+ ### Step D2: Open Deliberation
38
+
39
+ Run using the Bash tool with description "Opening deliberation...":
40
+ ```bash
41
+ bash .aether/aether-utils.sh council-deliberate --proposal "<proposal>"
42
+ ```
43
+
44
+ Capture `deliberation_id` from `result.id`.
45
+
46
+ Display:
47
+ ```
48
+ 📜🐜🏛️🐜📜 COUNCIL DELIBERATION OPENED
49
+
50
+ Proposal: "<proposal>"
51
+ ID: {deliberation_id}
52
+ Budget: {budget} spawns available
53
+
54
+ Convening Advocate, Challenger, and Sage...
55
+ ```
56
+
57
+ ### Step D3: Spawn Advocate Scout
58
+
59
+ Spawn an Advocate scout to argue **in favor** of the proposal.
60
+
61
+ {{#claude}}
62
+ Use the Task tool to spawn a scout with the following system prompt:
63
+ ```
64
+ You are the Advocate on the Ant Colony council.
65
+ Your role is to argue STRONGLY IN FAVOR of the proposal.
66
+ Present the strongest possible case for why this proposal should be adopted.
67
+ Be specific. Focus on concrete benefits and outcomes.
68
+ Keep your argument under 200 words.
69
+ Reply with ONLY your argument text — no preamble or meta-commentary.
70
+ ```
71
+
72
+ And user message:
73
+ ```
74
+ Proposal: "<proposal>"
75
+
76
+ Present your strongest argument in favor of this proposal.
77
+ ```
78
+
79
+ Capture the advocate's argument as `advocate_argument`.
80
+ {{/claude}}
81
+
82
+ Record the argument:
83
+ ```bash
84
+ bash .aether/aether-utils.sh council-advocate \
85
+ --deliberation-id "<deliberation_id>" \
86
+ --argument "<advocate_argument>"
87
+ ```
88
+
89
+ Display:
90
+ ```
91
+ ⚖️ ADVOCATE:
92
+ {advocate_argument}
93
+ ```
94
+
95
+ ### Step D4: Spawn Challenger Scout
96
+
97
+ Spawn a Challenger scout to argue **against** the proposal.
98
+
99
+ {{#claude}}
100
+ Use the Task tool to spawn a scout with the following system prompt:
101
+ ```
102
+ You are the Challenger on the Ant Colony council.
103
+ Your role is to argue STRONGLY AGAINST the proposal.
104
+ Present the strongest possible case for why this proposal should be rejected or deferred.
105
+ Be specific. Focus on concrete risks, costs, and downsides.
106
+ Keep your argument under 200 words.
107
+ Reply with ONLY your argument text — no preamble or meta-commentary.
108
+ ```
109
+
110
+ And user message:
111
+ ```
112
+ Proposal: "<proposal>"
113
+
114
+ Present your strongest argument against this proposal.
115
+ ```
116
+
117
+ Capture the challenger's argument as `challenger_argument`.
118
+ {{/claude}}
119
+
120
+ Record the argument:
121
+ ```bash
122
+ bash .aether/aether-utils.sh council-challenger \
123
+ --deliberation-id "<deliberation_id>" \
124
+ --argument "<challenger_argument>"
125
+ ```
126
+
127
+ Display:
128
+ ```
129
+ ⚔️ CHALLENGER:
130
+ {challenger_argument}
131
+ ```
132
+
133
+ ### Step D5: Spawn Sage Scout
134
+
135
+ Spawn a Sage scout to synthesize both positions and provide a recommendation.
136
+
137
+ {{#claude}}
138
+ Use the Task tool to spawn a scout with the following system prompt:
139
+ ```
140
+ You are the Sage on the Ant Colony council.
141
+ You have heard both the Advocate and Challenger arguments.
142
+ Your role is to synthesize both positions into balanced wisdom and provide a clear recommendation.
143
+ Your recommendation must be one of: adopt, reject, defer, or adopt-with-conditions.
144
+ Keep your synthesis under 150 words.
145
+ Reply with JSON only:
146
+ {"synthesis": "<your balanced synthesis>", "recommendation": "adopt|reject|defer|adopt-with-conditions"}
147
+ ```
148
+
149
+ And user message:
150
+ ```
151
+ Proposal: "<proposal>"
152
+
153
+ Advocate argued: "<advocate_argument>"
154
+
155
+ Challenger argued: "<challenger_argument>"
156
+
157
+ Synthesize both positions and provide your recommendation.
158
+ ```
159
+
160
+ Parse the JSON response. Capture `synthesis` and `recommendation`.
161
+ {{/claude}}
162
+
163
+ Record the sage synthesis:
164
+ ```bash
165
+ bash .aether/aether-utils.sh council-sage \
166
+ --deliberation-id "<deliberation_id>" \
167
+ --synthesis "<synthesis>" \
168
+ --recommendation "<recommendation>"
169
+ ```
170
+
171
+ ### Step D6: Display Result
172
+
173
+ ```
174
+ 📜🐜🏛️🐜📜 COUNCIL DELIBERATION COMPLETE
175
+
176
+ Proposal: "<proposal>"
177
+
178
+ ⚖️ Advocate:
179
+ {advocate_argument}
180
+
181
+ ⚔️ Challenger:
182
+ {challenger_argument}
183
+
184
+ 🧙 Sage Synthesis:
185
+ {synthesis}
186
+
187
+ Recommendation: {recommendation}
188
+ ```
189
+
190
+ If recommendation is `adopt` or `adopt-with-conditions`:
191
+ ```
192
+ ✅ Council recommends proceeding.
193
+ Run /ant:focus "<proposal summary>" to inject guidance for the colony.
194
+ ```
195
+
196
+ If recommendation is `reject`:
197
+ ```
198
+ ❌ Council recommends against this proposal.
199
+ Run /ant:redirect "<proposal summary>" if you want to make this a hard constraint.
200
+ ```
201
+
202
+ If recommendation is `defer`:
203
+ ```
204
+ ⏸️ Council recommends deferring this decision.
205
+ Return when more context is available.
206
+ ```
207
+
208
+ ---
209
+
210
+
12
211
  {{#claude}}
13
212
  ### Step 0: Initialize Visual Mode (if enabled)
14
213
 
@@ -26,6 +225,12 @@ body: |
26
225
  ```
27
226
  Stop here.
28
227
 
228
+ If `milestone` == `"Crowned Anthill"`:
229
+ ```
230
+ This colony has been sealed. Start a new colony with /ant:init "new goal".
231
+ ```
232
+ Stop here.
233
+
29
234
  Capture the current state for context:
30
235
  - `prior_state` = state field value (READY, EXECUTING, PLANNING, etc.)
31
236
  - `current_phase` = current_phase field value
@@ -135,8 +135,14 @@ body: |
135
135
 
136
136
  Use Read tool to check `.aether/data/COLONY_STATE.json`.
137
137
 
138
- - If file exists AND has a non-null `goal` field: set `reinit_mode = true`, store `existing_goal`
139
- - Otherwise: set `reinit_mode = false`
138
+ - If file exists AND has a non-null `goal` field:
139
+ - Check the `milestone` field. If `milestone == "Crowned Anthill"`:
140
+ - This is a **sealed colony**. Treat as **fresh init**, NOT re-init.
141
+ - Set `reinit_mode = false`
142
+ - Display: `Previous colony was sealed. Starting fresh colony.`
143
+ - The old COLONY_STATE.json will be overwritten in Step 7 (fresh init path).
144
+ - Otherwise (colony exists but is NOT sealed): set `reinit_mode = true`, store `existing_goal`
145
+ - If file does not exist or `goal` is null: set `reinit_mode = false`
140
146
 
141
147
  If re-init mode, read existing charter entries from `.aether/QUEEN.md`:
142
148
  ```bash
@@ -276,14 +282,29 @@ body: |
276
282
 
277
283
  2. Auto-apply approved pheromone suggestions (see pheromone auto-apply below).
278
284
 
279
- 3. Optionally update the goal field in COLONY_STATE.json in-place:
285
+ 3. Update the goal field in COLONY_STATE.json in-place using the state API:
280
286
  ```bash
281
- jq --arg new_goal "{approved_intent}" '.goal = $new_goal' .aether/data/COLONY_STATE.json > .aether/data/COLONY_STATE.json.tmp && mv .aether/data/COLONY_STATE.json.tmp .aether/data/COLONY_STATE.json
287
+ bash .aether/aether-utils.sh state-write "$(jq --arg new_goal "{approved_intent}" '.goal = $new_goal' .aether/data/COLONY_STATE.json)"
282
288
  ```
283
289
 
284
- 4. Run `bash .aether/aether-utils.sh session-init "$(jq -r '.session_id' .aether/data/COLONY_STATE.json)" "{approved_intent}"`
290
+ 4. **Verify the write** read back and confirm goal is set:
291
+ ```bash
292
+ verify_goal=$(jq -r '.goal' .aether/data/COLONY_STATE.json)
293
+ if [[ "$verify_goal" == "null" || -z "$verify_goal" ]]; then
294
+ echo "ERROR: Colony state write failed — goal is still null after write. Re-run /ant:init."
295
+ # Attempt recovery: write goal directly
296
+ jq --arg g "{approved_intent}" '.goal = $g' .aether/data/COLONY_STATE.json > .aether/data/COLONY_STATE.json.tmp && mv .aether/data/COLONY_STATE.json.tmp .aether/data/COLONY_STATE.json
297
+ verify_goal=$(jq -r '.goal' .aether/data/COLONY_STATE.json)
298
+ if [[ "$verify_goal" == "null" || -z "$verify_goal" ]]; then
299
+ echo "FATAL: Recovery write also failed. Colony state may be corrupted."
300
+ stop
301
+ fi
302
+ fi
303
+ ```
304
+
305
+ 5. Run `bash .aether/aether-utils.sh session-init "$(jq -r '.session_id' .aether/data/COLONY_STATE.json)" "{approved_intent}"`
285
306
 
286
- 5. Skip to Step 8 (display result). Do NOT write COLONY_STATE.json from template, do NOT write constraints.json, do NOT write pheromones.json.
307
+ 6. Skip to Step 8 (display result). Do NOT write COLONY_STATE.json from template, do NOT write constraints.json, do NOT write pheromones.json.
287
308
 
288
309
  **If fresh init:**
289
310
 
@@ -299,12 +320,24 @@ body: |
299
320
  - Remove ALL keys starting with underscore
300
321
  - Write the resulting JSON to `.aether/data/COLONY_STATE.json` using the Write tool
301
322
 
302
- 5. Write constraints.json from template:
323
+ 5. **Verify the write** — read back and confirm COLONY_STATE.json is valid and goal is set:
324
+ ```bash
325
+ verify_goal=$(jq -r '.goal' .aether/data/COLONY_STATE.json 2>/dev/null)
326
+ verify_valid=$(jq -e . .aether/data/COLONY_STATE.json >/dev/null 2>&1 && echo "valid" || echo "invalid")
327
+ if [[ "$verify_valid" != "valid" || "$verify_goal" == "null" || -z "$verify_goal" ]]; then
328
+ echo "ERROR: Colony state write verification failed (valid=$verify_valid, goal=$verify_goal)"
329
+ echo "The colony file may be corrupted. Remove .aether/data/COLONY_STATE.json and re-run /ant:init."
330
+ stop
331
+ fi
332
+ echo "Colony state verified: goal=\"$verify_goal\""
333
+ ```
334
+
335
+ 6. Write constraints.json from template:
303
336
  - Resolve template: check `~/.aether/system/templates/constraints.template.json` first, then `.aether/templates/constraints.template.json`
304
337
  - If no template found: output "Template missing: constraints.template.json. Run aether update to fix." and stop
305
338
  - Read template, follow `_instructions`, remove `_` prefixed keys, write to `.aether/data/constraints.json`
306
339
 
307
- 6. Initialize runtime files from templates (non-blocking):
340
+ 7. Initialize runtime files from templates (non-blocking):
308
341
  ```bash
309
342
  for template in pheromones midden learning-observations; do
310
343
  if [[ "$template" == "midden" ]]; then
@@ -327,15 +360,15 @@ body: |
327
360
  done
328
361
  ```
329
362
 
330
- 7. Run `bash .aether/aether-utils.sh context-update init "{approved_intent}"`
331
- 8. Run `bash .aether/aether-utils.sh validate-state colony`
332
- 9. Register repo (silent on failure):
363
+ 8. Run `bash .aether/aether-utils.sh context-update init "{approved_intent}"`
364
+ 9. Run `bash .aether/aether-utils.sh validate-state colony`
365
+ 10. Register repo (silent on failure):
333
366
  ```bash
334
367
  domain_tags=$(bash .aether/aether-utils.sh domain-detect 2>/dev/null | jq -r '.result.tags // ""' || echo "")
335
368
  bash .aether/aether-utils.sh registry-add "$(pwd)" "$(jq -r '.version // "unknown"' ~/.aether/version.json 2>/dev/null || echo 'unknown')" --goal "{approved_intent}" --active true --tags "$domain_tags" 2>/dev/null || true
336
369
  cp ~/.aether/version.json .aether/version.json 2>/dev/null || true
337
370
  ```
338
- 10. Seed QUEEN.md from hive (non-blocking):
371
+ 11. Seed QUEEN.md from hive (non-blocking):
339
372
  ```bash
340
373
  domain_tags=$(jq -r --arg repo "$(pwd)" \
341
374
  '[.repos[] | select(.path == $repo) | .domain_tags // []] | .[0] // [] | join(",")' \
@@ -345,7 +378,7 @@ body: |
345
378
  seed_result=$(bash .aether/aether-utils.sh $seed_args 2>/dev/null || echo '{}')
346
379
  seeded_count=$(echo "$seed_result" | jq -r '.result.seeded // 0' 2>/dev/null || echo "0")
347
380
  ```
348
- 11. Run `bash .aether/aether-utils.sh session-init "{session_id}" "{approved_intent}"`
381
+ 12. Run `bash .aether/aether-utils.sh session-init "{session_id}" "{approved_intent}"`
349
382
 
350
383
  **Pheromone auto-apply (referenced by both re-init and fresh init paths above):**
351
384
 
@@ -13,6 +13,10 @@ body: |
13
13
  `No colony initialized. Run /ant:init first.`
14
14
  Stop.
15
15
 
16
+ If `milestone` == `"Crowned Anthill"`:
17
+ `This colony has been sealed. Start a new colony with /ant:init "new goal".`
18
+ Stop.
19
+
16
20
  If `plan.phases` is empty:
17
21
  `No project plan. Run /ant:plan first.`
18
22
  Stop.
@@ -20,7 +20,7 @@ body_claude: |
20
20
  3. Output: `State auto-upgraded to v3.0`
21
21
  4. Continue with command.
22
22
 
23
- Extract: `goal`, `plan.phases`
23
+ Extract: `goal`, `milestone`, `plan.phases`
24
24
 
25
25
  **Validate:** If `goal: null`:
26
26
  ```
@@ -28,6 +28,12 @@ body_claude: |
28
28
  ```
29
29
  Stop here.
30
30
 
31
+ If `milestone` == `"Crowned Anthill"`:
32
+ ```
33
+ This colony has been sealed. Start a new colony with /ant:init "new goal".
34
+ ```
35
+ Stop here.
36
+
31
37
  ### Step 1.5: Load State and Show Resumption Context
32
38
 
33
39
  Run using Bash tool: `bash .aether/aether-utils.sh load-state`
@@ -556,6 +562,26 @@ body_claude: |
556
562
 
557
563
  Write COLONY_STATE.json.
558
564
 
565
+ **Verify the write** — read back and confirm the plan persisted:
566
+ ```bash
567
+ verify_phases=$(jq '.plan.phases | length' .aether/data/COLONY_STATE.json)
568
+ verify_timestamp=$(jq -r '.plan.generated_at' .aether/data/COLONY_STATE.json)
569
+ verify_state=$(jq -r '.state' .aether/data/COLONY_STATE.json)
570
+ if [[ "$verify_phases" -lt 1 || "$verify_timestamp" == "null" || "$verify_state" != "READY" ]]; then
571
+ echo "ERROR: Plan write verification failed (phases=$verify_phases, generated_at=$verify_timestamp, state=$verify_state)"
572
+ echo "Attempting retry write..."
573
+ # Retry: re-read, update, write via state API
574
+ bash .aether/aether-utils.sh state-write "$(jq --argjson phases "$(echo '$PLAN_JSON' | jq '.plan.phases')" --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" '.plan.phases = $phases | .plan.generated_at = $ts | .state = "READY"' .aether/data/COLONY_STATE.json)"
575
+ verify_phases=$(jq '.plan.phases | length' .aether/data/COLONY_STATE.json)
576
+ if [[ "$verify_phases" -lt 1 ]]; then
577
+ echo "FATAL: Retry write also failed. Plan was not persisted."
578
+ echo "Re-run /ant:plan to regenerate."
579
+ stop
580
+ fi
581
+ fi
582
+ echo "Plan verified: $verify_phases phases, generated_at=$verify_timestamp, state=$verify_state"
583
+ ```
584
+
559
585
  Log: `bash .aether/aether-utils.sh activity-log "PLAN_COMPLETE" "queen" "Plan finalized with {confidence}% confidence"`
560
586
 
561
587
  Update watch-status.txt:
@@ -683,7 +709,7 @@ body_opencode: |
683
709
  3. Output: `State auto-upgraded to v3.0`
684
710
  4. Continue with command.
685
711
 
686
- Extract: `goal`, `plan.phases`
712
+ Extract: `goal`, `milestone`, `plan.phases`
687
713
 
688
714
  **Validate:** If `goal: null`:
689
715
  ```
@@ -691,6 +717,12 @@ body_opencode: |
691
717
  ```
692
718
  Stop here.
693
719
 
720
+ If `milestone` == `"Crowned Anthill"`:
721
+ ```
722
+ This colony has been sealed. Start a new colony with /ant:init "new goal".
723
+ ```
724
+ Stop here.
725
+
694
726
  ### Step 1.5: Load State and Show Resumption Context
695
727
 
696
728
  Run using Bash tool: `bash .aether/aether-utils.sh load-state`
@@ -1220,6 +1252,25 @@ body_opencode: |
1220
1252
 
1221
1253
  Write COLONY_STATE.json.
1222
1254
 
1255
+ **Verify the write** — read back and confirm the plan persisted:
1256
+ ```bash
1257
+ verify_phases=$(jq '.plan.phases | length' .aether/data/COLONY_STATE.json)
1258
+ verify_timestamp=$(jq -r '.plan.generated_at' .aether/data/COLONY_STATE.json)
1259
+ verify_state=$(jq -r '.state' .aether/data/COLONY_STATE.json)
1260
+ if [[ "$verify_phases" -lt 1 || "$verify_timestamp" == "null" || "$verify_state" != "READY" ]]; then
1261
+ echo "ERROR: Plan write verification failed (phases=$verify_phases, generated_at=$verify_timestamp, state=$verify_state)"
1262
+ echo "Attempting retry write..."
1263
+ bash .aether/aether-utils.sh state-write "$(jq --argjson phases "$(echo '$PLAN_JSON' | jq '.plan.phases')" --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" '.plan.phases = $phases | .plan.generated_at = $ts | .state = "READY"' .aether/data/COLONY_STATE.json)"
1264
+ verify_phases=$(jq '.plan.phases | length' .aether/data/COLONY_STATE.json)
1265
+ if [[ "$verify_phases" -lt 1 ]]; then
1266
+ echo "FATAL: Retry write also failed. Plan was not persisted."
1267
+ echo "Re-run /ant:plan to regenerate."
1268
+ stop
1269
+ fi
1270
+ fi
1271
+ echo "Plan verified: $verify_phases phases, generated_at=$verify_timestamp, state=$verify_state"
1272
+ ```
1273
+
1223
1274
  Log plan completion: `bash .aether/aether-utils.sh activity-log "PLAN_COMPLETE" "queen" "Plan finalized with {confidence}% confidence"`
1224
1275
 
1225
1276
  Update watch-status.txt:
@@ -0,0 +1,104 @@
1
+ name: "ant:quick"
2
+ description: "Quick scout query — fast answers without build ceremony"
3
+ description_opencode: "🔍🐜⚡🐜🔍 Quick scout query — fast answers without build ceremony"
4
+ body: |
5
+ You are the **Queen**. Execute `/ant:quick` — a lightweight scout mission.
6
+
7
+ The query is: `{{ARGUMENTS}}`
8
+
9
+ ## Purpose
10
+
11
+ Quick, focused answers to questions about the codebase, patterns, or implementation
12
+ details. No build ceremony, no state changes, no verification waves.
13
+
14
+ ## Instructions
15
+
16
+ ### Step 1: Validate Arguments
17
+
18
+ If `{{ARGUMENTS}}` is empty:
19
+ ```
20
+ Usage: /ant:quick "<question>"
21
+
22
+ Examples:
23
+ /ant:quick "how does the pheromone system work?"
24
+ /ant:quick "find all uses of acquire_lock"
25
+ /ant:quick "what tests cover midden-write?"
26
+ /ant:quick "show me the colony-prime token budget logic"
27
+ ```
28
+ Stop here.
29
+
30
+ ### Step 2: Generate Scout Name
31
+
32
+ {{TOOL_PREFIX "Naming scout..."}}
33
+ ```bash
34
+ bash .aether/aether-utils.sh generate-ant-name "scout"
35
+ ```
36
+
37
+ Capture the output as `scout_name`.
38
+
39
+ ### Step 3: Spawn Scout
40
+
41
+ Display:
42
+ ```
43
+ ━━━ Quick Scout ━━━
44
+ Spawning {scout_name} — {query truncated to 50 chars}
45
+ ```
46
+
47
+ {{TOOL_PREFIX "Dispatching scout..."}}
48
+ ```bash
49
+ bash .aether/aether-utils.sh spawn-log "Queen" "scout" "{scout_name}" "Quick query: {query}"
50
+ ```
51
+
52
+ {{#claude}}
53
+ Spawn a Scout agent (using Task tool with subagent_type="aether-scout") with this prompt:
54
+
55
+ ```
56
+ You are {scout_name}, a Scout Ant on a quick mission.
57
+
58
+ Query: {query from ARGUMENTS}
59
+
60
+ Work:
61
+ 1. Search the codebase to answer the query
62
+ 2. Use Grep, Glob, and Read tools to find relevant code
63
+ 3. Provide a clear, focused answer
64
+ 4. Include file paths and line numbers for key findings
65
+
66
+ Keep your answer concise and actionable. This is a quick mission —
67
+ don't explore exhaustively, focus on the most relevant answer.
68
+
69
+ Return your findings as a clear text answer (not JSON).
70
+ ```
71
+ {{/claude}}
72
+ {{#opencode}}
73
+ Investigate the query directly using available tools (Grep, Glob, Read).
74
+ Search the codebase and provide a clear, focused answer with file paths and line numbers for key findings.
75
+ Keep your answer concise and actionable.
76
+ {{/opencode}}
77
+
78
+ ### Step 4: Display Results
79
+
80
+ {{#claude}}
81
+ Display the Scout's answer directly to the user.
82
+ {{/claude}}
83
+ {{#opencode}}
84
+ Display your findings directly to the user.
85
+ {{/opencode}}
86
+
87
+ {{TOOL_PREFIX "Recording scout completion..."}}
88
+ ```bash
89
+ bash .aether/aether-utils.sh spawn-complete "{scout_name}" "completed" "Quick query answered"
90
+ ```
91
+
92
+ ### Step 5: Update Session (lightweight)
93
+
94
+ {{TOOL_PREFIX "Updating session..."}}
95
+ ```bash
96
+ bash .aether/aether-utils.sh session-update "/ant:quick" "" "Quick query: {query truncated to 60 chars}" 2>/dev/null || true
97
+ ```
98
+
99
+ **NOTE:** This command does NOT:
100
+ - Modify COLONY_STATE.json
101
+ - Advance phases
102
+ - Create checkpoints
103
+ - Spawn watchers or chaos ants
104
+ - Run verification
@@ -25,8 +25,9 @@ body_claude: |
25
25
  If successful:
26
26
  1. Parse state from result
27
27
  2. If goal is null: Show "No colony state found..." message and stop
28
- 3. Check if paused flag is true - if not, note "Colony was not paused, but resuming anyway"
29
- 4. Extract all state fields for display
28
+ 3. If `milestone` == `"Crowned Anthill"`: Show "This colony has been sealed. Start a new colony with `/ant:init \"new goal\"`." and stop
29
+ 4. Check if paused flag is true - if not, note "Colony was not paused, but resuming anyway"
30
+ 5. Extract all state fields for display
30
31
 
31
32
  Keep state loaded (don't unload yet) - we'll need it for the full display.
32
33
 
@@ -214,8 +215,9 @@ body_opencode: |
214
215
  If successful:
215
216
  1. Parse state from result
216
217
  2. If goal is null: Show "No colony state found..." message and stop
217
- 3. Check if paused flag is true - if not, note "Colony was not paused, but resuming anyway"
218
- 4. Extract all state fields for display
218
+ 3. If `milestone` == `"Crowned Anthill"`: Show "This colony has been sealed. Start a new colony with `/ant:init \"new goal\"`." and stop
219
+ 4. Check if paused flag is true - if not, note "Colony was not paused, but resuming anyway"
220
+ 5. Extract all state fields for display
219
221
 
220
222
  Keep state loaded (don't unload yet) - we'll need it for the full display.
221
223
 
@@ -60,6 +60,7 @@ body: |
60
60
 
61
61
  COLONY_STATE.json is the authoritative source for goal and state (session.json may be stale). Extract:
62
62
  - `goal` (use this as authoritative, overriding session.json colony_goal)
63
+ - `milestone` (check for sealed colony)
63
64
  - `state` (READY, PLANNING, EXECUTING, PAUSED)
64
65
  - `current_phase`
65
66
  - `plan.phases` (array with id, name, status for each phase)
@@ -67,6 +68,14 @@ body: |
67
68
  - `memory.decisions` (flat list — do NOT distinguish user vs Claude origin)
68
69
  - `events` (last 5 for recent activity context)
69
70
 
71
+ **If `milestone` == `"Crowned Anthill"`:** This colony has been sealed. Display:
72
+ ```
73
+ This colony has been sealed (Crowned Anthill).
74
+
75
+ Start a new colony with /ant:init "new goal"
76
+ ```
77
+ Stop here — do NOT display stale phase data from the sealed colony.
78
+
70
79
  If the file is missing or the JSON cannot be parsed, **stop immediately** and display:
71
80
 
72
81
  ```
@@ -28,6 +28,7 @@ body: |
28
28
  - `--replan-interval N` — Pause for replan suggestion every N phases (default: 2)
29
29
  - `--continue` — Resume after a replan pause without replanning
30
30
  - `--dry-run` — Preview plan without executing
31
+ - `--headless` — Run without interactive prompts; queue decisions for later review
31
32
  - `--verbose` / `-v`, `--no-visual`, `--no-suggest` — Pass through to playbooks
32
33
 
33
34
  ```
@@ -36,6 +37,7 @@ body: |
36
37
  /ant:run --replan-interval 3 Suggest replan every 3 phases instead of 2
37
38
  /ant:run --continue Resume after replan pause without replanning
38
39
  /ant:run --dry-run Preview the autopilot plan
40
+ /ant:run --headless Run all phases without interactive prompts
39
41
  /ant:run --max-phases 3 -v Run 3 phases with verbose output
40
42
  ```
41
43
 
@@ -61,10 +63,14 @@ body: |
61
63
  ### Step 0: Initialize
62
64
 
63
65
  1. Read `.aether/data/COLONY_STATE.json`; validate goal + plan.phases exist
66
+ - If `milestone` == `"Crowned Anthill"`: output "This colony has been sealed. Start a new colony with `/ant:init \"new goal\"`." and stop
64
67
  2. Determine remaining incomplete phases; apply `--max-phases` cap
65
68
  3. Set `phases_completed = 0`, `autopilot_start = $(date +%s)`
66
69
  4. Record pre-build blocker count: `bash .aether/aether-utils.sh flag-check-blockers {phase}`
67
- 5. Display: `AUTOPILOT ENGAGED | Goal: {goal} | Phase {N} | Max: {max or "all"}`
70
+ 5. If `--headless` flag is present:
71
+ - Run: `bash .aether/aether-utils.sh autopilot-set-headless true`
72
+ - Display: `Headless mode: ON — interactive prompts will be queued as pending decisions`
73
+ 6. Display: `AUTOPILOT ENGAGED | Goal: {goal} | Phase {N} | Max: {max or "all"}`
68
74
 
69
75
  ### Step 1: Build Phase
70
76
 
@@ -95,6 +101,19 @@ body: |
95
101
  specific issues, and instruction: "Fix issues, then run /ant:run to resume."
96
102
  Log: `"<timestamp>|autopilot_paused|run|Paused at Phase {id}: {reason}"`
97
103
 
104
+ **Headless override for visual checkpoints:** If headless mode is active and a
105
+ visual checkpoint prompt would normally be shown to the user, instead queue it as
106
+ a pending decision:
107
+ ```bash
108
+ bash .aether/aether-utils.sh pending-decision-add \
109
+ --title "Visual checkpoint: Phase {id}" \
110
+ --type "checkpoint" \
111
+ --description "{checkpoint_description}" \
112
+ --phase "{id}" \
113
+ --source "build-pause-check"
114
+ ```
115
+ Then continue without pausing.
116
+
98
117
  **If no pause:** proceed to Step 3.
99
118
 
100
119
  ### Step 3: Continue (Verify + Advance)
@@ -112,6 +131,18 @@ body: |
112
131
  Skip the AskUserQuestion prompt. Instead, auto-PAUSE with reason
113
132
  "Runtime verification required" so the user can test manually before resuming.
114
133
 
134
+ **Headless override for runtime verification:** If headless mode is active and
135
+ runtime verification would normally pause, queue as a pending decision instead:
136
+ ```bash
137
+ bash .aether/aether-utils.sh pending-decision-add \
138
+ --title "Runtime verification needed: Phase {id}" \
139
+ --type "runtime-verification" \
140
+ --description "Manual testing required before advancing past Phase {id}" \
141
+ --phase "{id}" \
142
+ --source "continue-gates"
143
+ ```
144
+ Then continue without pausing.
145
+
115
146
  ### Step 4: Continue Pause Check
116
147
 
117
148
  **PAUSE if ANY of these are true:**
@@ -181,6 +212,11 @@ body: |
181
212
  {paused} -> Fix {reason}, then /ant:run to resume
182
213
  ```
183
214
 
215
+ If headless mode was active and pending decisions were queued, display:
216
+ ```
217
+ Pending decisions: {N} — run `pending-decision-list` to review
218
+ ```
219
+
184
220
  Update session:
185
221
  `bash .aether/aether-utils.sh session-update "/ant:run" "/ant:run" "Autopilot: {N} phases, now Phase {current}"`
186
222