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
@@ -9,9 +9,208 @@ You are the **Queen Ant Colony**. Convene the council to clarify user intent and
9
9
  ## Instructions
10
10
 
11
11
  Parse `$ARGUMENTS`:
12
+ - If starts with `--deliberate`: set `deliberate_mode = true`, extract proposal text after `--deliberate`
12
13
  - If contains `--no-visual`: set `visual_mode = false` (visual is ON by default)
13
14
  - Otherwise: set `visual_mode = true`
14
15
 
16
+ **If `deliberate_mode` is true:** Skip to [Deliberation Mode](#deliberation-mode) and stop after it.
17
+
18
+ ---
19
+
20
+ ## Deliberation Mode
21
+
22
+ When `--deliberate "<proposal>"` is passed, run a structured Advocate/Challenger/Sage deliberation.
23
+
24
+ ### Step D1: Check Budget
25
+
26
+ Run using the Bash tool with description "Checking deliberation budget...":
27
+ ```bash
28
+ bash .aether/aether-utils.sh council-budget-check
29
+ ```
30
+
31
+ Parse result. If `allowed` is `false`:
32
+ ```
33
+ 📜🐜🏛️🐜📜 COUNCIL — BUDGET EXHAUSTED
34
+
35
+ Spawn budget is fully allocated. Complete or close existing deliberations before starting new ones.
36
+ Run /ant:council to review existing deliberations.
37
+ ```
38
+ Stop here.
39
+
40
+ ### Step D2: Open Deliberation
41
+
42
+ Run using the Bash tool with description "Opening deliberation...":
43
+ ```bash
44
+ bash .aether/aether-utils.sh council-deliberate --proposal "<proposal>"
45
+ ```
46
+
47
+ Capture `deliberation_id` from `result.id`.
48
+
49
+ Display:
50
+ ```
51
+ 📜🐜🏛️🐜📜 COUNCIL DELIBERATION OPENED
52
+
53
+ Proposal: "<proposal>"
54
+ ID: {deliberation_id}
55
+ Budget: {budget} spawns available
56
+
57
+ Convening Advocate, Challenger, and Sage...
58
+ ```
59
+
60
+ ### Step D3: Spawn Advocate Scout
61
+
62
+ Spawn an Advocate scout to argue **in favor** of the proposal.
63
+
64
+
65
+ Use the Task tool to spawn a scout with the following system prompt:
66
+ ```
67
+ You are the Advocate on the Ant Colony council.
68
+ Your role is to argue STRONGLY IN FAVOR of the proposal.
69
+ Present the strongest possible case for why this proposal should be adopted.
70
+ Be specific. Focus on concrete benefits and outcomes.
71
+ Keep your argument under 200 words.
72
+ Reply with ONLY your argument text — no preamble or meta-commentary.
73
+ ```
74
+
75
+ And user message:
76
+ ```
77
+ Proposal: "<proposal>"
78
+
79
+ Present your strongest argument in favor of this proposal.
80
+ ```
81
+
82
+ Capture the advocate's argument as `advocate_argument`.
83
+
84
+
85
+ Record the argument:
86
+ ```bash
87
+ bash .aether/aether-utils.sh council-advocate \
88
+ --deliberation-id "<deliberation_id>" \
89
+ --argument "<advocate_argument>"
90
+ ```
91
+
92
+ Display:
93
+ ```
94
+ ⚖️ ADVOCATE:
95
+ {advocate_argument}
96
+ ```
97
+
98
+ ### Step D4: Spawn Challenger Scout
99
+
100
+ Spawn a Challenger scout to argue **against** the proposal.
101
+
102
+
103
+ Use the Task tool to spawn a scout with the following system prompt:
104
+ ```
105
+ You are the Challenger on the Ant Colony council.
106
+ Your role is to argue STRONGLY AGAINST the proposal.
107
+ Present the strongest possible case for why this proposal should be rejected or deferred.
108
+ Be specific. Focus on concrete risks, costs, and downsides.
109
+ Keep your argument under 200 words.
110
+ Reply with ONLY your argument text — no preamble or meta-commentary.
111
+ ```
112
+
113
+ And user message:
114
+ ```
115
+ Proposal: "<proposal>"
116
+
117
+ Present your strongest argument against this proposal.
118
+ ```
119
+
120
+ Capture the challenger's argument as `challenger_argument`.
121
+
122
+
123
+ Record the argument:
124
+ ```bash
125
+ bash .aether/aether-utils.sh council-challenger \
126
+ --deliberation-id "<deliberation_id>" \
127
+ --argument "<challenger_argument>"
128
+ ```
129
+
130
+ Display:
131
+ ```
132
+ ⚔️ CHALLENGER:
133
+ {challenger_argument}
134
+ ```
135
+
136
+ ### Step D5: Spawn Sage Scout
137
+
138
+ Spawn a Sage scout to synthesize both positions and provide a recommendation.
139
+
140
+
141
+ Use the Task tool to spawn a scout with the following system prompt:
142
+ ```
143
+ You are the Sage on the Ant Colony council.
144
+ You have heard both the Advocate and Challenger arguments.
145
+ Your role is to synthesize both positions into balanced wisdom and provide a clear recommendation.
146
+ Your recommendation must be one of: adopt, reject, defer, or adopt-with-conditions.
147
+ Keep your synthesis under 150 words.
148
+ Reply with JSON only:
149
+ {"synthesis": "<your balanced synthesis>", "recommendation": "adopt|reject|defer|adopt-with-conditions"}
150
+ ```
151
+
152
+ And user message:
153
+ ```
154
+ Proposal: "<proposal>"
155
+
156
+ Advocate argued: "<advocate_argument>"
157
+
158
+ Challenger argued: "<challenger_argument>"
159
+
160
+ Synthesize both positions and provide your recommendation.
161
+ ```
162
+
163
+ Parse the JSON response. Capture `synthesis` and `recommendation`.
164
+
165
+
166
+ Record the sage synthesis:
167
+ ```bash
168
+ bash .aether/aether-utils.sh council-sage \
169
+ --deliberation-id "<deliberation_id>" \
170
+ --synthesis "<synthesis>" \
171
+ --recommendation "<recommendation>"
172
+ ```
173
+
174
+ ### Step D6: Display Result
175
+
176
+ ```
177
+ 📜🐜🏛️🐜📜 COUNCIL DELIBERATION COMPLETE
178
+
179
+ Proposal: "<proposal>"
180
+
181
+ ⚖️ Advocate:
182
+ {advocate_argument}
183
+
184
+ ⚔️ Challenger:
185
+ {challenger_argument}
186
+
187
+ 🧙 Sage Synthesis:
188
+ {synthesis}
189
+
190
+ Recommendation: {recommendation}
191
+ ```
192
+
193
+ If recommendation is `adopt` or `adopt-with-conditions`:
194
+ ```
195
+ ✅ Council recommends proceeding.
196
+ Run /ant:focus "<proposal summary>" to inject guidance for the colony.
197
+ ```
198
+
199
+ If recommendation is `reject`:
200
+ ```
201
+ ❌ Council recommends against this proposal.
202
+ Run /ant:redirect "<proposal summary>" if you want to make this a hard constraint.
203
+ ```
204
+
205
+ If recommendation is `defer`:
206
+ ```
207
+ ⏸️ Council recommends deferring this decision.
208
+ Return when more context is available.
209
+ ```
210
+
211
+ ---
212
+
213
+
15
214
 
16
215
  ### Step 0: Initialize Visual Mode (if enabled)
17
216
 
@@ -29,6 +228,12 @@ No colony initialized. Run /ant:init first.
29
228
  ```
30
229
  Stop here.
31
230
 
231
+ If `milestone` == `"Crowned Anthill"`:
232
+ ```
233
+ This colony has been sealed. Start a new colony with /ant:init "new goal".
234
+ ```
235
+ Stop here.
236
+
32
237
  Capture the current state for context:
33
238
  - `prior_state` = state field value (READY, EXECUTING, PLANNING, etc.)
34
239
  - `current_phase` = current_phase field value
@@ -132,8 +132,14 @@ If `scan_result` is empty or `jq` fails, set all fields to fallback values (empt
132
132
 
133
133
  Use Read tool to check `.aether/data/COLONY_STATE.json`.
134
134
 
135
- - If file exists AND has a non-null `goal` field: set `reinit_mode = true`, store `existing_goal`
136
- - Otherwise: set `reinit_mode = false`
135
+ - If file exists AND has a non-null `goal` field:
136
+ - Check the `milestone` field. If `milestone == "Crowned Anthill"`:
137
+ - This is a **sealed colony**. Treat as **fresh init**, NOT re-init.
138
+ - Set `reinit_mode = false`
139
+ - Display: `Previous colony was sealed. Starting fresh colony.`
140
+ - The old COLONY_STATE.json will be overwritten in Step 7 (fresh init path).
141
+ - Otherwise (colony exists but is NOT sealed): set `reinit_mode = true`, store `existing_goal`
142
+ - If file does not exist or `goal` is null: set `reinit_mode = false`
137
143
 
138
144
  If re-init mode, read existing charter entries from `.aether/QUEEN.md`:
139
145
  ```bash
@@ -273,14 +279,29 @@ bash .aether/aether-utils.sh charter-write --intent "{approved_intent}" --vision
273
279
 
274
280
  2. Auto-apply approved pheromone suggestions (see pheromone auto-apply below).
275
281
 
276
- 3. Optionally update the goal field in COLONY_STATE.json in-place:
282
+ 3. Update the goal field in COLONY_STATE.json in-place using the state API:
277
283
  ```bash
278
- 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
284
+ bash .aether/aether-utils.sh state-write "$(jq --arg new_goal "{approved_intent}" '.goal = $new_goal' .aether/data/COLONY_STATE.json)"
279
285
  ```
280
286
 
281
- 4. Run `bash .aether/aether-utils.sh session-init "$(jq -r '.session_id' .aether/data/COLONY_STATE.json)" "{approved_intent}"`
287
+ 4. **Verify the write** read back and confirm goal is set:
288
+ ```bash
289
+ verify_goal=$(jq -r '.goal' .aether/data/COLONY_STATE.json)
290
+ if [[ "$verify_goal" == "null" || -z "$verify_goal" ]]; then
291
+ echo "ERROR: Colony state write failed — goal is still null after write. Re-run /ant:init."
292
+ # Attempt recovery: write goal directly
293
+ 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
294
+ verify_goal=$(jq -r '.goal' .aether/data/COLONY_STATE.json)
295
+ if [[ "$verify_goal" == "null" || -z "$verify_goal" ]]; then
296
+ echo "FATAL: Recovery write also failed. Colony state may be corrupted."
297
+ stop
298
+ fi
299
+ fi
300
+ ```
301
+
302
+ 5. Run `bash .aether/aether-utils.sh session-init "$(jq -r '.session_id' .aether/data/COLONY_STATE.json)" "{approved_intent}"`
282
303
 
283
- 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.
304
+ 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.
284
305
 
285
306
  **If fresh init:**
286
307
 
@@ -296,12 +317,24 @@ jq --arg new_goal "{approved_intent}" '.goal = $new_goal' .aether/data/COLONY_ST
296
317
  - Remove ALL keys starting with underscore
297
318
  - Write the resulting JSON to `.aether/data/COLONY_STATE.json` using the Write tool
298
319
 
299
- 5. Write constraints.json from template:
320
+ 5. **Verify the write** — read back and confirm COLONY_STATE.json is valid and goal is set:
321
+ ```bash
322
+ verify_goal=$(jq -r '.goal' .aether/data/COLONY_STATE.json 2>/dev/null)
323
+ verify_valid=$(jq -e . .aether/data/COLONY_STATE.json >/dev/null 2>&1 && echo "valid" || echo "invalid")
324
+ if [[ "$verify_valid" != "valid" || "$verify_goal" == "null" || -z "$verify_goal" ]]; then
325
+ echo "ERROR: Colony state write verification failed (valid=$verify_valid, goal=$verify_goal)"
326
+ echo "The colony file may be corrupted. Remove .aether/data/COLONY_STATE.json and re-run /ant:init."
327
+ stop
328
+ fi
329
+ echo "Colony state verified: goal=\"$verify_goal\""
330
+ ```
331
+
332
+ 6. Write constraints.json from template:
300
333
  - Resolve template: check `~/.aether/system/templates/constraints.template.json` first, then `.aether/templates/constraints.template.json`
301
334
  - If no template found: output "Template missing: constraints.template.json. Run aether update to fix." and stop
302
335
  - Read template, follow `_instructions`, remove `_` prefixed keys, write to `.aether/data/constraints.json`
303
336
 
304
- 6. Initialize runtime files from templates (non-blocking):
337
+ 7. Initialize runtime files from templates (non-blocking):
305
338
  ```bash
306
339
  for template in pheromones midden learning-observations; do
307
340
  if [[ "$template" == "midden" ]]; then
@@ -324,15 +357,15 @@ for template in pheromones midden learning-observations; do
324
357
  done
325
358
  ```
326
359
 
327
- 7. Run `bash .aether/aether-utils.sh context-update init "{approved_intent}"`
328
- 8. Run `bash .aether/aether-utils.sh validate-state colony`
329
- 9. Register repo (silent on failure):
360
+ 8. Run `bash .aether/aether-utils.sh context-update init "{approved_intent}"`
361
+ 9. Run `bash .aether/aether-utils.sh validate-state colony`
362
+ 10. Register repo (silent on failure):
330
363
  ```bash
331
364
  domain_tags=$(bash .aether/aether-utils.sh domain-detect 2>/dev/null | jq -r '.result.tags // ""' || echo "")
332
365
  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
333
366
  cp ~/.aether/version.json .aether/version.json 2>/dev/null || true
334
367
  ```
335
- 10. Seed QUEEN.md from hive (non-blocking):
368
+ 11. Seed QUEEN.md from hive (non-blocking):
336
369
  ```bash
337
370
  domain_tags=$(jq -r --arg repo "$(pwd)" \
338
371
  '[.repos[] | select(.path == $repo) | .domain_tags // []] | .[0] // [] | join(",")' \
@@ -342,7 +375,7 @@ seed_args="queen-seed-from-hive --limit 5"
342
375
  seed_result=$(bash .aether/aether-utils.sh $seed_args 2>/dev/null || echo '{}')
343
376
  seeded_count=$(echo "$seed_result" | jq -r '.result.seeded // 0' 2>/dev/null || echo "0")
344
377
  ```
345
- 11. Run `bash .aether/aether-utils.sh session-init "{session_id}" "{approved_intent}"`
378
+ 12. Run `bash .aether/aether-utils.sh session-init "{session_id}" "{approved_intent}"`
346
379
 
347
380
  **Pheromone auto-apply (referenced by both re-init and fresh init paths above):**
348
381
 
@@ -16,6 +16,10 @@ If `goal` is null:
16
16
  `No colony initialized. Run /ant:init first.`
17
17
  Stop.
18
18
 
19
+ If `milestone` == `"Crowned Anthill"`:
20
+ `This colony has been sealed. Start a new colony with /ant:init "new goal".`
21
+ Stop.
22
+
19
23
  If `plan.phases` is empty:
20
24
  `No project plan. Run /ant:plan first.`
21
25
  Stop.
@@ -23,7 +23,7 @@ If `version` field is missing, "1.0", or "2.0":
23
23
  3. Output: `State auto-upgraded to v3.0`
24
24
  4. Continue with command.
25
25
 
26
- Extract: `goal`, `plan.phases`
26
+ Extract: `goal`, `milestone`, `plan.phases`
27
27
 
28
28
  **Validate:** If `goal: null`:
29
29
  ```
@@ -31,6 +31,12 @@ No colony initialized. Run /ant:init "<goal>" first.
31
31
  ```
32
32
  Stop here.
33
33
 
34
+ If `milestone` == `"Crowned Anthill"`:
35
+ ```
36
+ This colony has been sealed. Start a new colony with /ant:init "new goal".
37
+ ```
38
+ Stop here.
39
+
34
40
  ### Step 1.5: Load State and Show Resumption Context
35
41
 
36
42
  Run using Bash tool: `bash .aether/aether-utils.sh load-state`
@@ -559,6 +565,26 @@ Read current COLONY_STATE.json, then update:
559
565
 
560
566
  Write COLONY_STATE.json.
561
567
 
568
+ **Verify the write** — read back and confirm the plan persisted:
569
+ ```bash
570
+ verify_phases=$(jq '.plan.phases | length' .aether/data/COLONY_STATE.json)
571
+ verify_timestamp=$(jq -r '.plan.generated_at' .aether/data/COLONY_STATE.json)
572
+ verify_state=$(jq -r '.state' .aether/data/COLONY_STATE.json)
573
+ if [[ "$verify_phases" -lt 1 || "$verify_timestamp" == "null" || "$verify_state" != "READY" ]]; then
574
+ echo "ERROR: Plan write verification failed (phases=$verify_phases, generated_at=$verify_timestamp, state=$verify_state)"
575
+ echo "Attempting retry write..."
576
+ # Retry: re-read, update, write via state API
577
+ 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)"
578
+ verify_phases=$(jq '.plan.phases | length' .aether/data/COLONY_STATE.json)
579
+ if [[ "$verify_phases" -lt 1 ]]; then
580
+ echo "FATAL: Retry write also failed. Plan was not persisted."
581
+ echo "Re-run /ant:plan to regenerate."
582
+ stop
583
+ fi
584
+ fi
585
+ echo "Plan verified: $verify_phases phases, generated_at=$verify_timestamp, state=$verify_state"
586
+ ```
587
+
562
588
  Log: `bash .aether/aether-utils.sh activity-log "PLAN_COMPLETE" "queen" "Plan finalized with {confidence}% confidence"`
563
589
 
564
590
  Update watch-status.txt:
@@ -0,0 +1,100 @@
1
+ <!-- Generated from .aether/commands/quick.yaml - DO NOT EDIT DIRECTLY -->
2
+ ---
3
+ name: ant:quick
4
+ description: "Quick scout query — fast answers without build ceremony"
5
+ ---
6
+
7
+ You are the **Queen**. Execute `/ant:quick` — a lightweight scout mission.
8
+
9
+ The query is: `$ARGUMENTS`
10
+
11
+ ## Purpose
12
+
13
+ Quick, focused answers to questions about the codebase, patterns, or implementation
14
+ details. No build ceremony, no state changes, no verification waves.
15
+
16
+ ## Instructions
17
+
18
+ ### Step 1: Validate Arguments
19
+
20
+ If `$ARGUMENTS` is empty:
21
+ ```
22
+ Usage: /ant:quick "<question>"
23
+
24
+ Examples:
25
+ /ant:quick "how does the pheromone system work?"
26
+ /ant:quick "find all uses of acquire_lock"
27
+ /ant:quick "what tests cover midden-write?"
28
+ /ant:quick "show me the colony-prime token budget logic"
29
+ ```
30
+ Stop here.
31
+
32
+ ### Step 2: Generate Scout Name
33
+
34
+ Run using the Bash tool with description "Naming scout...":
35
+ ```bash
36
+ bash .aether/aether-utils.sh generate-ant-name "scout"
37
+ ```
38
+
39
+ Capture the output as `scout_name`.
40
+
41
+ ### Step 3: Spawn Scout
42
+
43
+ Display:
44
+ ```
45
+ ━━━ Quick Scout ━━━
46
+ Spawning {scout_name} — {query truncated to 50 chars}
47
+ ```
48
+
49
+ Run using the Bash tool with description "Dispatching scout...":
50
+ ```bash
51
+ bash .aether/aether-utils.sh spawn-log "Queen" "scout" "{scout_name}" "Quick query: {query}"
52
+ ```
53
+
54
+
55
+ Spawn a Scout agent (using Task tool with subagent_type="aether-scout") with this prompt:
56
+
57
+ ```
58
+ You are {scout_name}, a Scout Ant on a quick mission.
59
+
60
+ Query: {query from ARGUMENTS}
61
+
62
+ Work:
63
+ 1. Search the codebase to answer the query
64
+ 2. Use Grep, Glob, and Read tools to find relevant code
65
+ 3. Provide a clear, focused answer
66
+ 4. Include file paths and line numbers for key findings
67
+
68
+ Keep your answer concise and actionable. This is a quick mission —
69
+ don't explore exhaustively, focus on the most relevant answer.
70
+
71
+ Return your findings as a clear text answer (not JSON).
72
+ ```
73
+
74
+
75
+
76
+ ### Step 4: Display Results
77
+
78
+
79
+ Display the Scout's answer directly to the user.
80
+
81
+
82
+
83
+ Run using the Bash tool with description "Recording scout completion...":
84
+ ```bash
85
+ bash .aether/aether-utils.sh spawn-complete "{scout_name}" "completed" "Quick query answered"
86
+ ```
87
+
88
+ ### Step 5: Update Session (lightweight)
89
+
90
+ Run using the Bash tool with description "Updating session...":
91
+ ```bash
92
+ bash .aether/aether-utils.sh session-update "/ant:quick" "" "Quick query: {query truncated to 60 chars}" 2>/dev/null || true
93
+ ```
94
+
95
+ **NOTE:** This command does NOT:
96
+ - Modify COLONY_STATE.json
97
+ - Advance phases
98
+ - Create checkpoints
99
+ - Spawn watchers or chaos ants
100
+ - Run verification
@@ -28,8 +28,9 @@ Run using the Bash tool with description "Restoring colony session...": `bash .a
28
28
  If successful:
29
29
  1. Parse state from result
30
30
  2. If goal is null: Show "No colony state found..." message and stop
31
- 3. Check if paused flag is true - if not, note "Colony was not paused, but resuming anyway"
32
- 4. Extract all state fields for display
31
+ 3. If `milestone` == `"Crowned Anthill"`: Show "This colony has been sealed. Start a new colony with `/ant:init \"new goal\"`." and stop
32
+ 4. Check if paused flag is true - if not, note "Colony was not paused, but resuming anyway"
33
+ 5. Extract all state fields for display
33
34
 
34
35
  Keep state loaded (don't unload yet) - we'll need it for the full display.
35
36
 
@@ -62,6 +62,7 @@ Use the Read tool to read `.aether/data/COLONY_STATE.json`.
62
62
 
63
63
  COLONY_STATE.json is the authoritative source for goal and state (session.json may be stale). Extract:
64
64
  - `goal` (use this as authoritative, overriding session.json colony_goal)
65
+ - `milestone` (check for sealed colony)
65
66
  - `state` (READY, PLANNING, EXECUTING, PAUSED)
66
67
  - `current_phase`
67
68
  - `plan.phases` (array with id, name, status for each phase)
@@ -69,6 +70,14 @@ COLONY_STATE.json is the authoritative source for goal and state (session.json m
69
70
  - `memory.decisions` (flat list — do NOT distinguish user vs Claude origin)
70
71
  - `events` (last 5 for recent activity context)
71
72
 
73
+ **If `milestone` == `"Crowned Anthill"`:** This colony has been sealed. Display:
74
+ ```
75
+ This colony has been sealed (Crowned Anthill).
76
+
77
+ Start a new colony with /ant:init "new goal"
78
+ ```
79
+ Stop here — do NOT display stale phase data from the sealed colony.
80
+
72
81
  If the file is missing or the JSON cannot be parsed, **stop immediately** and display:
73
82
 
74
83
  ```
@@ -30,6 +30,7 @@ Parse `$ARGUMENTS` for:
30
30
  - `--replan-interval N` — Pause for replan suggestion every N phases (default: 2)
31
31
  - `--continue` — Resume after a replan pause without replanning
32
32
  - `--dry-run` — Preview plan without executing
33
+ - `--headless` — Run without interactive prompts; queue decisions for later review
33
34
  - `--verbose` / `-v`, `--no-visual`, `--no-suggest` — Pass through to playbooks
34
35
 
35
36
  ```
@@ -38,6 +39,7 @@ Parse `$ARGUMENTS` for:
38
39
  /ant:run --replan-interval 3 Suggest replan every 3 phases instead of 2
39
40
  /ant:run --continue Resume after replan pause without replanning
40
41
  /ant:run --dry-run Preview the autopilot plan
42
+ /ant:run --headless Run all phases without interactive prompts
41
43
  /ant:run --max-phases 3 -v Run 3 phases with verbose output
42
44
  ```
43
45
 
@@ -63,10 +65,14 @@ replan suggestion (every {replan_interval} phases)
63
65
  ### Step 0: Initialize
64
66
 
65
67
  1. Read `.aether/data/COLONY_STATE.json`; validate goal + plan.phases exist
68
+ - If `milestone` == `"Crowned Anthill"`: output "This colony has been sealed. Start a new colony with `/ant:init \"new goal\"`." and stop
66
69
  2. Determine remaining incomplete phases; apply `--max-phases` cap
67
70
  3. Set `phases_completed = 0`, `autopilot_start = $(date +%s)`
68
71
  4. Record pre-build blocker count: `bash .aether/aether-utils.sh flag-check-blockers {phase}`
69
- 5. Display: `AUTOPILOT ENGAGED | Goal: {goal} | Phase {N} | Max: {max or "all"}`
72
+ 5. If `--headless` flag is present:
73
+ - Run: `bash .aether/aether-utils.sh autopilot-set-headless true`
74
+ - Display: `Headless mode: ON — interactive prompts will be queued as pending decisions`
75
+ 6. Display: `AUTOPILOT ENGAGED | Goal: {goal} | Phase {N} | Max: {max or "all"}`
70
76
 
71
77
  ### Step 1: Build Phase
72
78
 
@@ -97,6 +103,19 @@ On pause, display the AUTOPILOT PAUSED banner with reason, affected phase,
97
103
  specific issues, and instruction: "Fix issues, then run /ant:run to resume."
98
104
  Log: `"<timestamp>|autopilot_paused|run|Paused at Phase {id}: {reason}"`
99
105
 
106
+ **Headless override for visual checkpoints:** If headless mode is active and a
107
+ visual checkpoint prompt would normally be shown to the user, instead queue it as
108
+ a pending decision:
109
+ ```bash
110
+ bash .aether/aether-utils.sh pending-decision-add \
111
+ --title "Visual checkpoint: Phase {id}" \
112
+ --type "checkpoint" \
113
+ --description "{checkpoint_description}" \
114
+ --phase "{id}" \
115
+ --source "build-pause-check"
116
+ ```
117
+ Then continue without pausing.
118
+
100
119
  **If no pause:** proceed to Step 3.
101
120
 
102
121
  ### Step 3: Continue (Verify + Advance)
@@ -114,6 +133,18 @@ Execute continue playbooks in order, carrying cross-stage state
114
133
  Skip the AskUserQuestion prompt. Instead, auto-PAUSE with reason
115
134
  "Runtime verification required" so the user can test manually before resuming.
116
135
 
136
+ **Headless override for runtime verification:** If headless mode is active and
137
+ runtime verification would normally pause, queue as a pending decision instead:
138
+ ```bash
139
+ bash .aether/aether-utils.sh pending-decision-add \
140
+ --title "Runtime verification needed: Phase {id}" \
141
+ --type "runtime-verification" \
142
+ --description "Manual testing required before advancing past Phase {id}" \
143
+ --phase "{id}" \
144
+ --source "continue-gates"
145
+ ```
146
+ Then continue without pausing.
147
+
117
148
  ### Step 4: Continue Pause Check
118
149
 
119
150
  **PAUSE if ANY of these are true:**
@@ -183,6 +214,11 @@ Phases completed: {N} | Elapsed: {Xm Ys} | Now at: Phase {current}
183
214
  {paused} -> Fix {reason}, then /ant:run to resume
184
215
  ```
185
216
 
217
+ If headless mode was active and pending decisions were queued, display:
218
+ ```
219
+ Pending decisions: {N} — run `pending-decision-list` to review
220
+ ```
221
+
186
222
  Update session:
187
223
  `bash .aether/aether-utils.sh session-update "/ant:run" "/ant:run" "Autopilot: {N} phases, now Phase {current}"`
188
224
 
@@ -344,6 +344,15 @@ Log the seal ceremony to activity log:
344
344
  bash .aether/aether-utils.sh activity-log "MODIFIED" "Queen" "Colony sealed - wisdom review completed"
345
345
  ```
346
346
 
347
+ ### Step 4.4: Checkpoint State
348
+
349
+ Before modifying colony state, create a rolling backup:
350
+
351
+ Run using the Bash tool with description "Checkpointing colony state before seal...":
352
+ ```bash
353
+ bash .aether/aether-utils.sh state-checkpoint "pre-seal" 2>/dev/null || echo "Warning: State checkpoint failed -- continuing without backup" >&2
354
+ ```
355
+
347
356
  ### Step 4.5: Increment Colony Version
348
357
 
349
358
  Before writing the Crowned Anthill milestone, increment `colony_version` in COLONY_STATE.json.
@@ -302,9 +302,53 @@ Use the `phase_bar` and `task_bar` values computed in Step 2.7 for the actual ba
302
302
  ```
303
303
 
304
304
 
305
- **Data Safety:**
305
+ **Colony Vital Signs:**
306
306
  After the Memory Health table, run:
307
307
  ```bash
308
+ bash .aether/aether-utils.sh colony-vital-signs
309
+ ```
310
+
311
+ Extract from JSON result:
312
+ - build_velocity.phases_per_day and build_velocity.trend
313
+ - error_rate.errors_per_day and error_rate.status
314
+ - signal_health.active_count and signal_health.status
315
+ - memory_pressure.instinct_count and memory_pressure.status
316
+ - colony_age_hours
317
+ - overall_health (0-100 score)
318
+
319
+ Map overall_health score to a label:
320
+ - 80-100: "Thriving"
321
+ - 60-79: "Healthy"
322
+ - 40-59: "Stable"
323
+ - 20-39: "Struggling"
324
+ - 0-19: "Critical"
325
+
326
+ Display:
327
+ ```
328
+ 💓 Colony Vital Signs
329
+ ┌─────────────────┬────────────┬─────────────────────────────┐
330
+ │ Vital Sign │ Value │ Status │
331
+ ├─────────────────┼────────────┼─────────────────────────────┤
332
+ │ Build Velocity │ {phases_per_day}/d │ {trend} │
333
+ │ Error Rate │ {errors_per_day}/d │ {error_status} │
334
+ │ Signal Health │ {active_count} │ {signal_status} │
335
+ │ Memory Pressure │ {instinct_count} │ {memory_status} │
336
+ │ Colony Age │ {colony_age_hours}h │ │
337
+ ├─────────────────┼────────────┼─────────────────────────────┤
338
+ │ Overall Health │ {overall_health}% │ {health_label} │
339
+ └─────────────────┴────────────┴─────────────────────────────┘
340
+ ```
341
+
342
+ If the command fails or returns no data, display:
343
+ ```
344
+ 💓 Colony Vital Signs: No data available
345
+ ```
346
+
347
+
348
+
349
+ **Data Safety:**
350
+ After the Colony Vital Signs panel, run:
351
+ ```bash
308
352
  bash .aether/aether-utils.sh data-safety-stats
309
353
  ```
310
354