aether-colony 5.1.0 β†’ 5.3.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.
Files changed (185) hide show
  1. package/.aether/aether-utils.sh +157 -42
  2. package/.aether/agents/aether-ambassador.md +140 -0
  3. package/.aether/agents/aether-archaeologist.md +108 -0
  4. package/.aether/agents/aether-architect.md +133 -0
  5. package/.aether/agents/aether-auditor.md +144 -0
  6. package/.aether/agents/aether-builder.md +184 -0
  7. package/.aether/agents/aether-chaos.md +115 -0
  8. package/.aether/agents/aether-chronicler.md +122 -0
  9. package/.aether/agents/aether-gatekeeper.md +116 -0
  10. package/.aether/agents/aether-includer.md +117 -0
  11. package/.aether/agents/aether-keeper.md +177 -0
  12. package/.aether/agents/aether-measurer.md +128 -0
  13. package/.aether/agents/aether-oracle.md +137 -0
  14. package/.aether/agents/aether-probe.md +133 -0
  15. package/.aether/agents/aether-queen.md +286 -0
  16. package/.aether/agents/aether-route-setter.md +130 -0
  17. package/.aether/agents/aether-sage.md +106 -0
  18. package/.aether/agents/aether-scout.md +101 -0
  19. package/.aether/agents/aether-surveyor-disciplines.md +391 -0
  20. package/.aether/agents/aether-surveyor-nest.md +329 -0
  21. package/.aether/agents/aether-surveyor-pathogens.md +264 -0
  22. package/.aether/agents/aether-surveyor-provisions.md +334 -0
  23. package/.aether/agents/aether-tracker.md +137 -0
  24. package/.aether/agents/aether-watcher.md +174 -0
  25. package/.aether/agents/aether-weaver.md +130 -0
  26. package/.aether/commands/claude/archaeology.md +334 -0
  27. package/.aether/commands/claude/build.md +65 -0
  28. package/.aether/commands/claude/chaos.md +336 -0
  29. package/.aether/commands/claude/colonize.md +259 -0
  30. package/.aether/commands/claude/continue.md +60 -0
  31. package/.aether/commands/claude/council.md +507 -0
  32. package/.aether/commands/claude/data-clean.md +81 -0
  33. package/.aether/commands/claude/dream.md +268 -0
  34. package/.aether/commands/claude/entomb.md +498 -0
  35. package/.aether/commands/claude/export-signals.md +57 -0
  36. package/.aether/commands/claude/feedback.md +96 -0
  37. package/.aether/commands/claude/flag.md +151 -0
  38. package/.aether/commands/claude/flags.md +169 -0
  39. package/.aether/commands/claude/focus.md +76 -0
  40. package/.aether/commands/claude/help.md +154 -0
  41. package/.aether/commands/claude/history.md +140 -0
  42. package/.aether/commands/claude/import-signals.md +71 -0
  43. package/.aether/commands/claude/init.md +505 -0
  44. package/.aether/commands/claude/insert-phase.md +105 -0
  45. package/.aether/commands/claude/interpret.md +278 -0
  46. package/.aether/commands/claude/lay-eggs.md +210 -0
  47. package/.aether/commands/claude/maturity.md +113 -0
  48. package/.aether/commands/claude/memory-details.md +77 -0
  49. package/.aether/commands/claude/migrate-state.md +171 -0
  50. package/.aether/commands/claude/oracle.md +642 -0
  51. package/.aether/commands/claude/organize.md +232 -0
  52. package/.aether/commands/claude/patrol.md +620 -0
  53. package/.aether/commands/claude/pause-colony.md +233 -0
  54. package/.aether/commands/claude/phase.md +115 -0
  55. package/.aether/commands/claude/pheromones.md +156 -0
  56. package/.aether/commands/claude/plan.md +693 -0
  57. package/.aether/commands/claude/preferences.md +65 -0
  58. package/.aether/commands/claude/quick.md +100 -0
  59. package/.aether/commands/claude/redirect.md +76 -0
  60. package/.aether/commands/claude/resume-colony.md +197 -0
  61. package/.aether/commands/claude/resume.md +388 -0
  62. package/.aether/commands/claude/run.md +231 -0
  63. package/.aether/commands/claude/seal.md +774 -0
  64. package/.aether/commands/claude/skill-create.md +286 -0
  65. package/.aether/commands/claude/status.md +410 -0
  66. package/.aether/commands/claude/swarm.md +349 -0
  67. package/.aether/commands/claude/tunnels.md +426 -0
  68. package/.aether/commands/claude/update.md +132 -0
  69. package/.aether/commands/claude/verify-castes.md +143 -0
  70. package/.aether/commands/claude/watch.md +239 -0
  71. package/.aether/commands/colonize.yaml +4 -0
  72. package/.aether/commands/council.yaml +205 -0
  73. package/.aether/commands/init.yaml +46 -13
  74. package/.aether/commands/insert-phase.yaml +4 -0
  75. package/.aether/commands/opencode/archaeology.md +331 -0
  76. package/.aether/commands/opencode/build.md +1168 -0
  77. package/.aether/commands/opencode/chaos.md +329 -0
  78. package/.aether/commands/opencode/colonize.md +195 -0
  79. package/.aether/commands/opencode/continue.md +1436 -0
  80. package/.aether/commands/opencode/council.md +437 -0
  81. package/.aether/commands/opencode/data-clean.md +77 -0
  82. package/.aether/commands/opencode/dream.md +260 -0
  83. package/.aether/commands/opencode/entomb.md +377 -0
  84. package/.aether/commands/opencode/export-signals.md +54 -0
  85. package/.aether/commands/opencode/feedback.md +99 -0
  86. package/.aether/commands/opencode/flag.md +149 -0
  87. package/.aether/commands/opencode/flags.md +167 -0
  88. package/.aether/commands/opencode/focus.md +73 -0
  89. package/.aether/commands/opencode/help.md +157 -0
  90. package/.aether/commands/opencode/history.md +136 -0
  91. package/.aether/commands/opencode/import-signals.md +68 -0
  92. package/.aether/commands/opencode/init.md +518 -0
  93. package/.aether/commands/opencode/insert-phase.md +111 -0
  94. package/.aether/commands/opencode/interpret.md +272 -0
  95. package/.aether/commands/opencode/lay-eggs.md +213 -0
  96. package/.aether/commands/opencode/maturity.md +108 -0
  97. package/.aether/commands/opencode/memory-details.md +83 -0
  98. package/.aether/commands/opencode/migrate-state.md +165 -0
  99. package/.aether/commands/opencode/oracle.md +593 -0
  100. package/.aether/commands/opencode/organize.md +226 -0
  101. package/.aether/commands/opencode/patrol.md +626 -0
  102. package/.aether/commands/opencode/pause-colony.md +203 -0
  103. package/.aether/commands/opencode/phase.md +113 -0
  104. package/.aether/commands/opencode/pheromones.md +162 -0
  105. package/.aether/commands/opencode/plan.md +684 -0
  106. package/.aether/commands/opencode/preferences.md +71 -0
  107. package/.aether/commands/opencode/quick.md +91 -0
  108. package/.aether/commands/opencode/redirect.md +84 -0
  109. package/.aether/commands/opencode/resume-colony.md +190 -0
  110. package/.aether/commands/opencode/resume.md +394 -0
  111. package/.aether/commands/opencode/run.md +237 -0
  112. package/.aether/commands/opencode/seal.md +452 -0
  113. package/.aether/commands/opencode/skill-create.md +63 -0
  114. package/.aether/commands/opencode/status.md +307 -0
  115. package/.aether/commands/opencode/swarm.md +15 -0
  116. package/.aether/commands/opencode/tunnels.md +400 -0
  117. package/.aether/commands/opencode/update.md +127 -0
  118. package/.aether/commands/opencode/verify-castes.md +139 -0
  119. package/.aether/commands/opencode/watch.md +227 -0
  120. package/.aether/commands/plan.yaml +53 -2
  121. package/.aether/commands/quick.yaml +104 -0
  122. package/.aether/commands/resume-colony.yaml +6 -4
  123. package/.aether/commands/resume.yaml +9 -0
  124. package/.aether/commands/run.yaml +37 -1
  125. package/.aether/commands/seal.yaml +9 -0
  126. package/.aether/commands/status.yaml +45 -1
  127. package/.aether/docs/command-playbooks/build-full.md +3 -2
  128. package/.aether/docs/command-playbooks/build-prep.md +12 -4
  129. package/.aether/docs/command-playbooks/build-verify.md +51 -0
  130. package/.aether/docs/command-playbooks/continue-advance.md +115 -6
  131. package/.aether/docs/command-playbooks/continue-full.md +1 -0
  132. package/.aether/docs/command-playbooks/continue-verify.md +33 -0
  133. package/.aether/utils/clash-detect.sh +239 -0
  134. package/.aether/utils/council.sh +425 -0
  135. package/.aether/utils/error-handler.sh +3 -3
  136. package/.aether/utils/flag.sh +23 -12
  137. package/.aether/utils/hive.sh +2 -2
  138. package/.aether/utils/hooks/clash-pre-tool-use.js +99 -0
  139. package/.aether/utils/immune.sh +508 -0
  140. package/.aether/utils/learning.sh +2 -2
  141. package/.aether/utils/merge-driver-lockfile.sh +35 -0
  142. package/.aether/utils/midden.sh +712 -0
  143. package/.aether/utils/pheromone.sh +1376 -108
  144. package/.aether/utils/queen.sh +31 -21
  145. package/.aether/utils/session.sh +264 -0
  146. package/.aether/utils/spawn-tree.sh +7 -7
  147. package/.aether/utils/spawn.sh +2 -2
  148. package/.aether/utils/state-api.sh +216 -5
  149. package/.aether/utils/swarm.sh +1 -1
  150. package/.aether/utils/worktree.sh +189 -0
  151. package/.claude/commands/ant/colonize.md +2 -0
  152. package/.claude/commands/ant/council.md +205 -0
  153. package/.claude/commands/ant/init.md +53 -14
  154. package/.claude/commands/ant/insert-phase.md +4 -0
  155. package/.claude/commands/ant/plan.md +27 -1
  156. package/.claude/commands/ant/quick.md +100 -0
  157. package/.claude/commands/ant/resume-colony.md +3 -2
  158. package/.claude/commands/ant/resume.md +9 -0
  159. package/.claude/commands/ant/run.md +37 -1
  160. package/.claude/commands/ant/seal.md +9 -0
  161. package/.claude/commands/ant/status.md +45 -1
  162. package/.opencode/commands/ant/colonize.md +2 -0
  163. package/.opencode/commands/ant/council.md +143 -0
  164. package/.opencode/commands/ant/init.md +53 -13
  165. package/.opencode/commands/ant/insert-phase.md +4 -0
  166. package/.opencode/commands/ant/plan.md +26 -1
  167. package/.opencode/commands/ant/quick.md +91 -0
  168. package/.opencode/commands/ant/resume-colony.md +3 -2
  169. package/.opencode/commands/ant/resume.md +9 -0
  170. package/.opencode/commands/ant/run.md +37 -1
  171. package/.opencode/commands/ant/status.md +2 -0
  172. package/CHANGELOG.md +116 -0
  173. package/README.md +34 -8
  174. package/bin/cli.js +103 -61
  175. package/bin/lib/banner.js +14 -0
  176. package/bin/lib/init.js +8 -7
  177. package/bin/lib/interactive-setup.js +251 -0
  178. package/bin/npx-entry.js +21 -0
  179. package/bin/npx-install.js +9 -167
  180. package/bin/validate-package.sh +23 -0
  181. package/package.json +11 -3
  182. package/.aether/docs/plans/pheromone-display-plan.md +0 -257
  183. package/.aether/schemas/example-prompt-builder.xml +0 -234
  184. package/.aether/scripts/incident-test-add.sh +0 -47
  185. package/.aether/scripts/weekly-audit.sh +0 -79
@@ -41,7 +41,6 @@ Do not touch during init:
41
41
  - .aether/dreams/ (user notes)
42
42
  - .aether/chambers/ (archived colonies)
43
43
  - .env* files
44
- - .claude/settings.json
45
44
  - .github/workflows/
46
45
  </read_only>
47
46
 
@@ -132,8 +131,14 @@ If `scan_result` is empty or `jq` fails, set all fields to fallback values (empt
132
131
 
133
132
  Use Read tool to check `.aether/data/COLONY_STATE.json`.
134
133
 
135
- - If file exists AND has a non-null `goal` field: set `reinit_mode = true`, store `existing_goal`
136
- - Otherwise: set `reinit_mode = false`
134
+ - If file exists AND has a non-null `goal` field:
135
+ - Check the `milestone` field. If `milestone == "Crowned Anthill"`:
136
+ - This is a **sealed colony**. Treat as **fresh init**, NOT re-init.
137
+ - Set `reinit_mode = false`
138
+ - Display: `Previous colony was sealed. Starting fresh colony.`
139
+ - The old COLONY_STATE.json will be overwritten in Step 7 (fresh init path).
140
+ - Otherwise (colony exists but is NOT sealed): set `reinit_mode = true`, store `existing_goal`
141
+ - If file does not exist or `goal` is null: set `reinit_mode = false`
137
142
 
138
143
  If re-init mode, read existing charter entries from `.aether/QUEEN.md`:
139
144
  ```bash
@@ -273,14 +278,29 @@ bash .aether/aether-utils.sh charter-write --intent "{approved_intent}" --vision
273
278
 
274
279
  2. Auto-apply approved pheromone suggestions (see pheromone auto-apply below).
275
280
 
276
- 3. Optionally update the goal field in COLONY_STATE.json in-place:
281
+ 3. Update the goal field in COLONY_STATE.json in-place using the state API:
277
282
  ```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
283
+ bash .aether/aether-utils.sh state-write "$(jq --arg new_goal "{approved_intent}" '.goal = $new_goal' .aether/data/COLONY_STATE.json)"
279
284
  ```
280
285
 
281
- 4. Run `bash .aether/aether-utils.sh session-init "$(jq -r '.session_id' .aether/data/COLONY_STATE.json)" "{approved_intent}"`
286
+ 4. **Verify the write** β€” read back and confirm goal is set:
287
+ ```bash
288
+ verify_goal=$(jq -r '.goal' .aether/data/COLONY_STATE.json)
289
+ if [[ "$verify_goal" == "null" || -z "$verify_goal" ]]; then
290
+ echo "ERROR: Colony state write failed β€” goal is still null after write. Re-run /ant:init."
291
+ # Attempt recovery: write goal directly
292
+ 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
293
+ verify_goal=$(jq -r '.goal' .aether/data/COLONY_STATE.json)
294
+ if [[ "$verify_goal" == "null" || -z "$verify_goal" ]]; then
295
+ echo "FATAL: Recovery write also failed. Colony state may be corrupted."
296
+ stop
297
+ fi
298
+ fi
299
+ ```
300
+
301
+ 5. Run `bash .aether/aether-utils.sh session-init "$(jq -r '.session_id' .aether/data/COLONY_STATE.json)" "{approved_intent}"`
282
302
 
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.
303
+ 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
304
 
285
305
  **If fresh init:**
286
306
 
@@ -296,12 +316,24 @@ jq --arg new_goal "{approved_intent}" '.goal = $new_goal' .aether/data/COLONY_ST
296
316
  - Remove ALL keys starting with underscore
297
317
  - Write the resulting JSON to `.aether/data/COLONY_STATE.json` using the Write tool
298
318
 
299
- 5. Write constraints.json from template:
319
+ 5. **Verify the write** β€” read back and confirm COLONY_STATE.json is valid and goal is set:
320
+ ```bash
321
+ verify_goal=$(jq -r '.goal' .aether/data/COLONY_STATE.json 2>/dev/null)
322
+ verify_valid=$(jq -e . .aether/data/COLONY_STATE.json >/dev/null 2>&1 && echo "valid" || echo "invalid")
323
+ if [[ "$verify_valid" != "valid" || "$verify_goal" == "null" || -z "$verify_goal" ]]; then
324
+ echo "ERROR: Colony state write verification failed (valid=$verify_valid, goal=$verify_goal)"
325
+ echo "The colony file may be corrupted. Remove .aether/data/COLONY_STATE.json and re-run /ant:init."
326
+ stop
327
+ fi
328
+ echo "Colony state verified: goal=\"$verify_goal\""
329
+ ```
330
+
331
+ 6. Write constraints.json from template:
300
332
  - Resolve template: check `~/.aether/system/templates/constraints.template.json` first, then `.aether/templates/constraints.template.json`
301
333
  - If no template found: output "Template missing: constraints.template.json. Run aether update to fix." and stop
302
334
  - Read template, follow `_instructions`, remove `_` prefixed keys, write to `.aether/data/constraints.json`
303
335
 
304
- 6. Initialize runtime files from templates (non-blocking):
336
+ 7. Initialize runtime files from templates (non-blocking):
305
337
  ```bash
306
338
  for template in pheromones midden learning-observations; do
307
339
  if [[ "$template" == "midden" ]]; then
@@ -324,15 +356,22 @@ for template in pheromones midden learning-observations; do
324
356
  done
325
357
  ```
326
358
 
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):
359
+ 8. Run `bash .aether/aether-utils.sh context-update init "{approved_intent}"`
360
+ 9. Run `bash .aether/aether-utils.sh validate-state colony`
361
+ 10. Register repo (silent on failure):
330
362
  ```bash
331
363
  domain_tags=$(bash .aether/aether-utils.sh domain-detect 2>/dev/null | jq -r '.result.tags // ""' || echo "")
332
364
  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
365
  cp ~/.aether/version.json .aether/version.json 2>/dev/null || true
334
366
  ```
335
- 10. Seed QUEEN.md from hive (non-blocking):
367
+ 11. Install clash detection hook and merge driver (non-blocking):
368
+ ```bash
369
+ # Install PreToolUse hook to detect file conflicts across worktrees
370
+ bash .aether/aether-utils.sh clash-setup --install 2>/dev/null || true
371
+ # Register lockfile merge driver (keeps "ours" on package-lock.json conflicts)
372
+ git config merge.lockfile.driver "bash .aether/utils/merge-driver-lockfile.sh %O %A %B" 2>/dev/null || true
373
+ ```
374
+ 12. Seed QUEEN.md from hive (non-blocking):
336
375
  ```bash
337
376
  domain_tags=$(jq -r --arg repo "$(pwd)" \
338
377
  '[.repos[] | select(.path == $repo) | .domain_tags // []] | .[0] // [] | join(",")' \
@@ -342,7 +381,7 @@ seed_args="queen-seed-from-hive --limit 5"
342
381
  seed_result=$(bash .aether/aether-utils.sh $seed_args 2>/dev/null || echo '{}')
343
382
  seeded_count=$(echo "$seed_result" | jq -r '.result.seeded // 0' 2>/dev/null || echo "0")
344
383
  ```
345
- 11. Run `bash .aether/aether-utils.sh session-init "{session_id}" "{approved_intent}"`
384
+ 13. Run `bash .aether/aether-utils.sh session-init "{session_id}" "{approved_intent}"`
346
385
 
347
386
  **Pheromone auto-apply (referenced by both re-init and fresh init paths above):**
348
387
 
@@ -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
 
@@ -43,6 +43,8 @@ Read `.aether/data/COLONY_STATE.json`.
43
43
 
44
44
  **If the file exists:** continue.
45
45
 
46
+ **If `milestone` == `"Crowned Anthill"`:** output "This colony has been sealed. Start a new colony with `/ant:init \"new goal\"`.", stop.
47
+
46
48
  **If `plan.phases` is not empty:** output "Colony already has phases. Use /ant:continue.", stop.
47
49
 
48
50
  ### Step 2: Quick Surface Scan (for session context)
@@ -15,9 +15,146 @@ You are the **Queen Ant Colony**. Convene the council to clarify user intent and
15
15
  ## Instructions
16
16
 
17
17
  Parse `$normalized_args`:
18
+ - If starts with `--deliberate`: set `deliberate_mode = true`, extract proposal text after `--deliberate`
18
19
  - If contains `--no-visual`: set `visual_mode = false` (visual is ON by default)
19
20
  - Otherwise: set `visual_mode = true`
20
21
 
22
+ **If `deliberate_mode` is true:** Skip to [Deliberation Mode](#deliberation-mode) and stop after it.
23
+
24
+ ---
25
+
26
+ ## Deliberation Mode
27
+
28
+ When `--deliberate "<proposal>"` is passed, run a structured Advocate/Challenger/Sage deliberation.
29
+
30
+ ### Step D1: Check Budget
31
+
32
+ Run using the Bash tool with description "Checking deliberation budget...":
33
+ ```bash
34
+ bash .aether/aether-utils.sh council-budget-check
35
+ ```
36
+
37
+ Parse result. If `allowed` is `false`:
38
+ ```
39
+ πŸ“œπŸœπŸ›οΈπŸœπŸ“œ COUNCIL β€” BUDGET EXHAUSTED
40
+
41
+ Spawn budget is fully allocated. Complete or close existing deliberations before starting new ones.
42
+ Run /ant:council to review existing deliberations.
43
+ ```
44
+ Stop here.
45
+
46
+ ### Step D2: Open Deliberation
47
+
48
+ Run using the Bash tool with description "Opening deliberation...":
49
+ ```bash
50
+ bash .aether/aether-utils.sh council-deliberate --proposal "<proposal>"
51
+ ```
52
+
53
+ Capture `deliberation_id` from `result.id`.
54
+
55
+ Display:
56
+ ```
57
+ πŸ“œπŸœπŸ›οΈπŸœπŸ“œ COUNCIL DELIBERATION OPENED
58
+
59
+ Proposal: "<proposal>"
60
+ ID: {deliberation_id}
61
+ Budget: {budget} spawns available
62
+
63
+ Convening Advocate, Challenger, and Sage...
64
+ ```
65
+
66
+ ### Step D3: Spawn Advocate Scout
67
+
68
+ Spawn an Advocate scout to argue **in favor** of the proposal.
69
+
70
+
71
+
72
+ Record the argument:
73
+ ```bash
74
+ bash .aether/aether-utils.sh council-advocate \
75
+ --deliberation-id "<deliberation_id>" \
76
+ --argument "<advocate_argument>"
77
+ ```
78
+
79
+ Display:
80
+ ```
81
+ βš–οΈ ADVOCATE:
82
+ {advocate_argument}
83
+ ```
84
+
85
+ ### Step D4: Spawn Challenger Scout
86
+
87
+ Spawn a Challenger scout to argue **against** the proposal.
88
+
89
+
90
+
91
+ Record the argument:
92
+ ```bash
93
+ bash .aether/aether-utils.sh council-challenger \
94
+ --deliberation-id "<deliberation_id>" \
95
+ --argument "<challenger_argument>"
96
+ ```
97
+
98
+ Display:
99
+ ```
100
+ βš”οΈ CHALLENGER:
101
+ {challenger_argument}
102
+ ```
103
+
104
+ ### Step D5: Spawn Sage Scout
105
+
106
+ Spawn a Sage scout to synthesize both positions and provide a recommendation.
107
+
108
+
109
+
110
+ Record the sage synthesis:
111
+ ```bash
112
+ bash .aether/aether-utils.sh council-sage \
113
+ --deliberation-id "<deliberation_id>" \
114
+ --synthesis "<synthesis>" \
115
+ --recommendation "<recommendation>"
116
+ ```
117
+
118
+ ### Step D6: Display Result
119
+
120
+ ```
121
+ πŸ“œπŸœπŸ›οΈπŸœπŸ“œ COUNCIL DELIBERATION COMPLETE
122
+
123
+ Proposal: "<proposal>"
124
+
125
+ βš–οΈ Advocate:
126
+ {advocate_argument}
127
+
128
+ βš”οΈ Challenger:
129
+ {challenger_argument}
130
+
131
+ πŸ§™ Sage Synthesis:
132
+ {synthesis}
133
+
134
+ Recommendation: {recommendation}
135
+ ```
136
+
137
+ If recommendation is `adopt` or `adopt-with-conditions`:
138
+ ```
139
+ βœ… Council recommends proceeding.
140
+ Run /ant:focus "<proposal summary>" to inject guidance for the colony.
141
+ ```
142
+
143
+ If recommendation is `reject`:
144
+ ```
145
+ ❌ Council recommends against this proposal.
146
+ Run /ant:redirect "<proposal summary>" if you want to make this a hard constraint.
147
+ ```
148
+
149
+ If recommendation is `defer`:
150
+ ```
151
+ ⏸️ Council recommends deferring this decision.
152
+ Return when more context is available.
153
+ ```
154
+
155
+ ---
156
+
157
+
21
158
 
22
159
  ### Step 1: Read Current State
23
160
 
@@ -31,6 +168,12 @@ No colony initialized. Run /ant:init first.
31
168
  ```
32
169
  Stop here.
33
170
 
171
+ If `milestone` == `"Crowned Anthill"`:
172
+ ```
173
+ This colony has been sealed. Start a new colony with /ant:init "new goal".
174
+ ```
175
+ Stop here.
176
+
34
177
  Capture the current state for context:
35
178
  - `prior_state` = state field value (READY, EXECUTING, PLANNING, etc.)
36
179
  - `current_phase` = current_phase field value