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
@@ -0,0 +1,227 @@
1
+ <!-- Generated from .aether/commands/watch.yaml - DO NOT EDIT DIRECTLY -->
2
+ ---
3
+ name: ant:watch
4
+ description: "👁️🔄🐜🏠🔄👁️ Set up tmux session to watch ants working in real-time"
5
+ ---
6
+
7
+ ### Step -1: Normalize Arguments
8
+
9
+ Run: `normalized_args=$(bash .aether/aether-utils.sh normalize-args "$@")`
10
+
11
+ This ensures arguments work correctly in both Claude Code and OpenCode. Use `$normalized_args` throughout this command.
12
+
13
+ You are the **Queen**. Set up live visibility into colony activity.
14
+
15
+ ## Instructions
16
+
17
+ ### Step 1: Check Prerequisites
18
+
19
+ Use Bash to check if tmux is available:
20
+ ```bash
21
+ command -v tmux >/dev/null 2>&1 && echo "tmux_available" || echo "tmux_missing"
22
+ ```
23
+
24
+ If tmux is missing:
25
+ ```
26
+ tmux is required for live colony viewing.
27
+
28
+ Install with:
29
+ macOS: brew install tmux
30
+ Ubuntu: sudo apt install tmux
31
+ Fedora: sudo dnf install tmux
32
+ ```
33
+ Stop here.
34
+
35
+ ### Step 2: Initialize Activity Log
36
+
37
+ Ensure activity log exists:
38
+ ```bash
39
+ mkdir -p .aether/data
40
+ touch .aether/data/activity.log
41
+ ```
42
+
43
+ ### Step 3: Create Status File
44
+
45
+ Write initial status to `.aether/data/watch-status.txt`:
46
+
47
+ ```
48
+ .-.
49
+ (o o) AETHER COLONY
50
+ | O | Live Status
51
+ `-`
52
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
53
+
54
+ State: IDLE
55
+ Phase: -/-
56
+
57
+ Active Workers:
58
+ (none)
59
+
60
+ Last Activity:
61
+ (waiting for colony activity)
62
+ ```
63
+
64
+ ### Step 4: Create or Attach to tmux Session
65
+
66
+ Check if session exists:
67
+ ```bash
68
+ tmux has-session -t aether-colony 2>/dev/null && echo "exists" || echo "new"
69
+ ```
70
+
71
+ **If session exists:** Attach to it
72
+ ```bash
73
+ tmux attach-session -t aether-colony
74
+ ```
75
+ Output: `Attached to existing aether-colony session.`
76
+ Stop here.
77
+
78
+ **If session is new:** Create the layout.
79
+
80
+ ### Step 5: Create tmux Layout (4-Pane)
81
+
82
+ Use Bash to create the session with 4 panes in a 2x2 grid:
83
+
84
+ ```bash
85
+ # Create session with first pane
86
+ tmux new-session -d -s aether-colony -n colony
87
+
88
+ # Split into 4 panes (2x2 grid)
89
+ # First split horizontally (left|right)
90
+ tmux split-window -h -t aether-colony:colony
91
+
92
+ # Split left side vertically (top-left, bottom-left)
93
+ tmux split-window -v -t aether-colony:colony.0
94
+
95
+ # Split right side vertically (top-right, bottom-right)
96
+ tmux split-window -v -t aether-colony:colony.2
97
+
98
+ # Set pane contents:
99
+ # Pane 0 (top-left): Status display
100
+ tmux send-keys -t aether-colony:colony.0 'watch -n 1 cat .aether/data/watch-status.txt' C-m
101
+
102
+ # Pane 1 (bottom-left): Progress bar
103
+ tmux send-keys -t aether-colony:colony.1 'watch -n 1 cat .aether/data/watch-progress.txt' C-m
104
+
105
+ # Pane 2 (top-right): Spawn tree visualization
106
+ tmux send-keys -t aether-colony:colony.2 'bash .aether/utils/watch-spawn-tree.sh .aether/data' C-m
107
+
108
+ # Pane 3 (bottom-right): Colorized activity log stream
109
+ tmux send-keys -t aether-colony:colony.3 'bash .aether/utils/colorize-log.sh .aether/data/activity.log' C-m
110
+
111
+ # Set pane titles (if supported)
112
+ tmux select-pane -t aether-colony:colony.0 -T "Status"
113
+ tmux select-pane -t aether-colony:colony.1 -T "Progress"
114
+ tmux select-pane -t aether-colony:colony.2 -T "Spawn Tree"
115
+ tmux select-pane -t aether-colony:colony.3 -T "Activity Log"
116
+
117
+ # Balance panes for even 2x2 grid
118
+ tmux select-layout -t aether-colony:colony tiled
119
+
120
+ echo "Session created"
121
+ ```
122
+
123
+ ### Step 6: Create Progress File
124
+
125
+ Write initial progress to `.aether/data/watch-progress.txt`:
126
+
127
+ ```
128
+ .-.
129
+ (o o) AETHER COLONY
130
+ | O | Progress
131
+ `-`
132
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
133
+
134
+ Phase: -/-
135
+
136
+ [░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░] 0%
137
+
138
+ ⏳ Waiting for build...
139
+
140
+ Target: 95% confidence
141
+ ```
142
+
143
+ ### Step 7: Attach and Display
144
+
145
+ ```bash
146
+ tmux attach-session -t aether-colony
147
+ ```
148
+
149
+ Before attaching, output:
150
+
151
+ ```
152
+ .-.
153
+ (o o) AETHER COLONY :: WATCH
154
+ | O |
155
+ `-`
156
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
157
+
158
+ tmux session 'aether-colony' created.
159
+
160
+ Layout (4-pane 2x2 grid):
161
+ +------------------+------------------+
162
+ | Status | Spawn Tree |
163
+ | Colony state | Worker hierarchy |
164
+ +------------------+------------------+
165
+ | Progress | Activity Log |
166
+ | Phase progress | Live stream |
167
+ +------------------+------------------+
168
+
169
+ Commands:
170
+ Ctrl+B D Detach from session
171
+ Ctrl+B [ Scroll mode (q to exit)
172
+ Ctrl+B Arrow Navigate between panes
173
+ tmux kill-session -t aether-colony Stop watching
174
+
175
+ The session will update in real-time as colony works.
176
+ Attaching now...
177
+ ```
178
+
179
+ ---
180
+
181
+ ## Status Update Protocol
182
+
183
+ Workers and commands update watch files as they work:
184
+
185
+ ### Activity Log
186
+ Workers write via: `bash .aether/aether-utils.sh activity-log "ACTION" "caste" "description"`
187
+
188
+ For named ants (recommended):
189
+ ```bash
190
+ # Generate a name first
191
+ ant_name=$(bash .aether/aether-utils.sh generate-ant-name "builder" | jq -r '.result')
192
+ # Log with ant name
193
+ bash .aether/aether-utils.sh activity-log "CREATED" "$ant_name (Builder)" "Implemented auth module"
194
+ ```
195
+
196
+ ### Spawn Tracking
197
+ Log spawns for tree visualization:
198
+ ```bash
199
+ bash .aether/aether-utils.sh spawn-log "Prime" "builder" "Hammer-42" "implementing auth"
200
+ bash .aether/aether-utils.sh spawn-complete "Hammer-42" "completed" "auth module done"
201
+ ```
202
+
203
+ ### Status File
204
+ Commands update `.aether/data/watch-status.txt` with current state:
205
+ - State: PLANNING, EXECUTING, READY
206
+ - Phase: current/total
207
+ - Active Workers: list of named ants
208
+ - Last Activity: most recent log entry
209
+
210
+ ### Progress File
211
+ Update via: `bash .aether/aether-utils.sh update-progress <percent> "<message>" <phase> <total>`
212
+
213
+ Example:
214
+ ```bash
215
+ bash .aether/aether-utils.sh update-progress 45 "Building auth module..." 2 5
216
+ ```
217
+
218
+ ---
219
+
220
+ ## Cleanup
221
+
222
+ To stop watching:
223
+ ```bash
224
+ tmux kill-session -t aether-colony
225
+ ```
226
+
227
+ This stops the session but preserves all log files.
@@ -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
 
@@ -341,6 +341,15 @@ body_claude: |
341
341
  bash .aether/aether-utils.sh activity-log "MODIFIED" "Queen" "Colony sealed - wisdom review completed"
342
342
  ```
343
343
 
344
+ ### Step 4.4: Checkpoint State
345
+
346
+ Before modifying colony state, create a rolling backup:
347
+
348
+ Run using the Bash tool with description "Checkpointing colony state before seal...":
349
+ ```bash
350
+ bash .aether/aether-utils.sh state-checkpoint "pre-seal" 2>/dev/null || echo "Warning: State checkpoint failed -- continuing without backup" >&2
351
+ ```
352
+
344
353
  ### Step 4.5: Increment Colony Version
345
354
 
346
355
  Before writing the Crowned Anthill milestone, increment `colony_version` in COLONY_STATE.json.
@@ -300,9 +300,53 @@ body: |
300
300
  ```
301
301
 
302
302
  {{#claude}}
303
- **Data Safety:**
303
+ **Colony Vital Signs:**
304
304
  After the Memory Health table, run:
305
305
  ```bash
306
+ bash .aether/aether-utils.sh colony-vital-signs
307
+ ```
308
+
309
+ Extract from JSON result:
310
+ - build_velocity.phases_per_day and build_velocity.trend
311
+ - error_rate.errors_per_day and error_rate.status
312
+ - signal_health.active_count and signal_health.status
313
+ - memory_pressure.instinct_count and memory_pressure.status
314
+ - colony_age_hours
315
+ - overall_health (0-100 score)
316
+
317
+ Map overall_health score to a label:
318
+ - 80-100: "Thriving"
319
+ - 60-79: "Healthy"
320
+ - 40-59: "Stable"
321
+ - 20-39: "Struggling"
322
+ - 0-19: "Critical"
323
+
324
+ Display:
325
+ ```
326
+ 💓 Colony Vital Signs
327
+ ┌─────────────────┬────────────┬─────────────────────────────┐
328
+ │ Vital Sign │ Value │ Status │
329
+ ├─────────────────┼────────────┼─────────────────────────────┤
330
+ │ Build Velocity │ {phases_per_day}/d │ {trend} │
331
+ │ Error Rate │ {errors_per_day}/d │ {error_status} │
332
+ │ Signal Health │ {active_count} │ {signal_status} │
333
+ │ Memory Pressure │ {instinct_count} │ {memory_status} │
334
+ │ Colony Age │ {colony_age_hours}h │ │
335
+ ├─────────────────┼────────────┼─────────────────────────────┤
336
+ │ Overall Health │ {overall_health}% │ {health_label} │
337
+ └─────────────────┴────────────┴─────────────────────────────┘
338
+ ```
339
+
340
+ If the command fails or returns no data, display:
341
+ ```
342
+ 💓 Colony Vital Signs: No data available
343
+ ```
344
+ {{/claude}}
345
+
346
+ {{#claude}}
347
+ **Data Safety:**
348
+ After the Colony Vital Signs panel, run:
349
+ ```bash
306
350
  bash .aether/aether-utils.sh data-safety-stats
307
351
  ```
308
352
 
@@ -98,7 +98,8 @@ If the command fails (non-zero exit or JSON has ok: false):
98
98
  If successful:
99
99
  1. Parse the state JSON from result field
100
100
  2. Check if goal is null - if so: "No colony initialized. Run /ant:init first." and stop
101
- 3. Extract current_phase and phase name from plan.phases[current_phase - 1].name
101
+ 3. Check if `milestone` == `"Crowned Anthill"` - if so: "This colony has been sealed. Start a new colony with `/ant:init \"new goal\"`." and stop
102
+ 4. Extract current_phase and phase name from plan.phases[current_phase - 1].name
102
103
  4. Display brief resumption context:
103
104
  ```
104
105
  🔄 Resuming: Phase X - Name
@@ -253,7 +254,7 @@ git rev-parse --git-dir 2>/dev/null
253
254
 
254
255
  - **If succeeds** (is a git repo):
255
256
  1. Check for changes in Aether-managed directories only: `.aether .claude/commands/ant .claude/commands/st .opencode bin`
256
- 2. **If changes exist**: Run using the Bash tool with description "Creating git checkpoint...": `git stash push -m "aether-checkpoint: pre-phase-$PHASE_NUMBER" -- .aether .claude/commands/ant .claude/commands/st .opencode bin`
257
+ 2. **If changes exist**: Run using the Bash tool with description "Creating git checkpoint...": `git stash push -m "aether-checkpoint: pre-phase-$PHASE_NUMBER" -- .aether .claude/commands/ant .claude/commands/st .opencode bin ":(exclude).aether/data/"`
257
258
  - IMPORTANT: Never use `--include-untracked` — it stashes ALL files including user work!
258
259
  - Run using the Bash tool with description "Verifying checkpoint...": `git stash list | head -1 | grep "aether-checkpoint"` — warn if empty
259
260
  - Store checkpoint as `{type: "stash", ref: "aether-checkpoint: pre-phase-$PHASE_NUMBER"}`