aether-colony 3.1.17 → 5.0.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 (183) hide show
  1. package/{runtime → .aether}/CONTEXT.md +1 -1
  2. package/{runtime → .aether}/aether-utils.sh +1772 -98
  3. package/.aether/docs/QUEEN-SYSTEM.md +211 -0
  4. package/.aether/docs/QUEEN.md +84 -0
  5. package/.aether/docs/README.md +68 -0
  6. package/.aether/docs/caste-system.md +48 -0
  7. package/{runtime → .aether/docs/disciplines}/DISCIPLINES.md +8 -8
  8. package/.aether/docs/error-codes.md +268 -0
  9. package/{runtime → .aether}/docs/known-issues.md +42 -26
  10. package/.aether/docs/queen-commands.md +97 -0
  11. package/.aether/exchange/colony-registry.xml +11 -0
  12. package/{runtime → .aether}/exchange/pheromone-xml.sh +2 -1
  13. package/.aether/exchange/pheromones.xml +87 -0
  14. package/.aether/exchange/queen-wisdom.xml +14 -0
  15. package/{runtime → .aether}/exchange/registry-xml.sh +7 -3
  16. package/{runtime → .aether}/exchange/wisdom-xml.sh +11 -4
  17. package/.aether/rules/aether-colony.md +134 -0
  18. package/.aether/schemas/example-prompt-builder.xml +234 -0
  19. package/.aether/templates/colony-state-reset.jq.template +22 -0
  20. package/.aether/templates/colony-state.template.json +35 -0
  21. package/.aether/templates/constraints.template.json +9 -0
  22. package/.aether/templates/crowned-anthill.template.md +36 -0
  23. package/.aether/templates/handoff-build-error.template.md +30 -0
  24. package/.aether/templates/handoff-build-success.template.md +39 -0
  25. package/.aether/templates/handoff.template.md +40 -0
  26. package/{runtime → .aether}/utils/atomic-write.sh +5 -5
  27. package/{runtime → .aether}/utils/chamber-compare.sh +23 -10
  28. package/{runtime → .aether}/utils/chamber-utils.sh +32 -20
  29. package/{runtime → .aether}/utils/error-handler.sh +13 -1
  30. package/{runtime → .aether}/utils/file-lock.sh +49 -13
  31. package/.aether/utils/semantic-cli.sh +413 -0
  32. package/{runtime → .aether}/utils/xml-compose.sh +7 -1
  33. package/.aether/utils/xml-convert.sh +273 -0
  34. package/.aether/utils/xml-query.sh +201 -0
  35. package/.aether/utils/xml-utils.sh +110 -0
  36. package/{runtime → .aether}/workers.md +14 -17
  37. package/.claude/agents/ant/aether-ambassador.md +264 -0
  38. package/.claude/agents/ant/aether-archaeologist.md +322 -0
  39. package/.claude/agents/ant/aether-auditor.md +266 -0
  40. package/.claude/agents/ant/aether-builder.md +187 -0
  41. package/.claude/agents/ant/aether-chaos.md +268 -0
  42. package/.claude/agents/ant/aether-chronicler.md +304 -0
  43. package/.claude/agents/ant/aether-gatekeeper.md +325 -0
  44. package/.claude/agents/ant/aether-includer.md +373 -0
  45. package/.claude/agents/ant/aether-keeper.md +271 -0
  46. package/.claude/agents/ant/aether-measurer.md +317 -0
  47. package/.claude/agents/ant/aether-probe.md +210 -0
  48. package/.claude/agents/ant/aether-queen.md +325 -0
  49. package/.claude/agents/ant/aether-route-setter.md +173 -0
  50. package/.claude/agents/ant/aether-sage.md +353 -0
  51. package/.claude/agents/ant/aether-scout.md +142 -0
  52. package/.claude/agents/ant/aether-surveyor-disciplines.md +416 -0
  53. package/.claude/agents/ant/aether-surveyor-nest.md +354 -0
  54. package/.claude/agents/ant/aether-surveyor-pathogens.md +288 -0
  55. package/.claude/agents/ant/aether-surveyor-provisions.md +359 -0
  56. package/.claude/agents/ant/aether-tracker.md +265 -0
  57. package/.claude/agents/ant/aether-watcher.md +244 -0
  58. package/.claude/agents/ant/aether-weaver.md +247 -0
  59. package/.claude/commands/ant/archaeology.md +16 -7
  60. package/.claude/commands/ant/build.md +415 -284
  61. package/.claude/commands/ant/chaos.md +19 -10
  62. package/.claude/commands/ant/colonize.md +58 -24
  63. package/.claude/commands/ant/continue.md +155 -145
  64. package/.claude/commands/ant/council.md +15 -5
  65. package/.claude/commands/ant/dream.md +16 -7
  66. package/.claude/commands/ant/entomb.md +274 -157
  67. package/.claude/commands/ant/feedback.md +33 -29
  68. package/.claude/commands/ant/flag.md +18 -10
  69. package/.claude/commands/ant/flags.md +14 -6
  70. package/.claude/commands/ant/focus.md +29 -21
  71. package/.claude/commands/ant/help.md +11 -1
  72. package/.claude/commands/ant/history.md +10 -0
  73. package/.claude/commands/ant/init.md +91 -65
  74. package/.claude/commands/ant/interpret.md +15 -4
  75. package/.claude/commands/ant/lay-eggs.md +55 -7
  76. package/.claude/commands/ant/maturity.md +11 -1
  77. package/.claude/commands/ant/migrate-state.md +14 -2
  78. package/.claude/commands/ant/oracle.md +23 -15
  79. package/.claude/commands/ant/organize.md +29 -20
  80. package/.claude/commands/ant/pause-colony.md +17 -7
  81. package/.claude/commands/ant/phase.md +17 -8
  82. package/.claude/commands/ant/plan.md +20 -9
  83. package/.claude/commands/ant/redirect.md +29 -32
  84. package/.claude/commands/ant/resume-colony.md +19 -9
  85. package/.claude/commands/ant/resume.md +272 -96
  86. package/.claude/commands/ant/seal.md +201 -191
  87. package/.claude/commands/ant/status.md +71 -32
  88. package/.claude/commands/ant/swarm.md +26 -44
  89. package/.claude/commands/ant/tunnels.md +279 -105
  90. package/.claude/commands/ant/update.md +81 -20
  91. package/.claude/commands/ant/verify-castes.md +14 -4
  92. package/.claude/commands/ant/watch.md +13 -12
  93. package/.opencode/agents/aether-ambassador.md +63 -20
  94. package/.opencode/agents/aether-archaeologist.md +29 -12
  95. package/.opencode/agents/aether-auditor.md +51 -18
  96. package/.opencode/agents/aether-builder.md +69 -19
  97. package/.opencode/agents/aether-chaos.md +29 -12
  98. package/.opencode/agents/aether-chronicler.md +60 -18
  99. package/.opencode/agents/aether-gatekeeper.md +27 -18
  100. package/.opencode/agents/aether-includer.md +27 -18
  101. package/.opencode/agents/aether-keeper.md +89 -18
  102. package/.opencode/agents/aether-measurer.md +27 -18
  103. package/.opencode/agents/aether-probe.md +60 -18
  104. package/.opencode/agents/aether-queen.md +172 -24
  105. package/.opencode/agents/aether-route-setter.md +57 -12
  106. package/.opencode/agents/aether-sage.md +26 -18
  107. package/.opencode/agents/aether-scout.md +27 -19
  108. package/.opencode/agents/aether-surveyor-disciplines.md +53 -1
  109. package/.opencode/agents/aether-surveyor-nest.md +53 -1
  110. package/.opencode/agents/aether-surveyor-pathogens.md +51 -1
  111. package/.opencode/agents/aether-surveyor-provisions.md +53 -1
  112. package/.opencode/agents/aether-tracker.md +64 -18
  113. package/.opencode/agents/aether-watcher.md +66 -19
  114. package/.opencode/agents/aether-weaver.md +61 -18
  115. package/.opencode/commands/ant/build.md +406 -192
  116. package/.opencode/commands/ant/continue.md +66 -76
  117. package/.opencode/commands/ant/entomb.md +106 -45
  118. package/.opencode/commands/ant/init.md +46 -48
  119. package/.opencode/commands/ant/organize.md +5 -5
  120. package/.opencode/commands/ant/resume.md +334 -0
  121. package/.opencode/commands/ant/seal.md +33 -24
  122. package/.opencode/commands/ant/status.md +11 -0
  123. package/.opencode/commands/ant/tunnels.md +149 -0
  124. package/.opencode/commands/ant/update.md +59 -16
  125. package/CHANGELOG.md +79 -0
  126. package/README.md +135 -353
  127. package/bin/cli.js +243 -122
  128. package/bin/generate-commands.sh +2 -2
  129. package/bin/lib/init.js +13 -3
  130. package/bin/lib/update-transaction.js +119 -117
  131. package/bin/sync-to-runtime.sh +5 -137
  132. package/bin/validate-package.sh +84 -0
  133. package/package.json +9 -6
  134. package/.opencode/agents/aether-architect.md +0 -66
  135. package/.opencode/agents/aether-guardian.md +0 -107
  136. package/.opencode/agents/workers.md +0 -1034
  137. package/runtime/QUEEN_ANT_ARCHITECTURE.md +0 -402
  138. package/runtime/data/signatures.json +0 -41
  139. package/runtime/docs/AETHER-2.0-IMPLEMENTATION-PLAN.md +0 -1343
  140. package/runtime/docs/AETHER-PHEROMONE-SYSTEM-MASTER-SPEC.md +0 -2642
  141. package/runtime/docs/PHEROMONE-INJECTION.md +0 -240
  142. package/runtime/docs/PHEROMONE-INTEGRATION.md +0 -192
  143. package/runtime/docs/PHEROMONE-SYSTEM-DESIGN.md +0 -426
  144. package/runtime/docs/README.md +0 -94
  145. package/runtime/docs/VISUAL-OUTPUT-SPEC.md +0 -219
  146. package/runtime/docs/biological-reference.md +0 -272
  147. package/runtime/docs/codebase-review.md +0 -399
  148. package/runtime/docs/command-sync.md +0 -164
  149. package/runtime/docs/constraints.md +0 -116
  150. package/runtime/docs/implementation-learnings.md +0 -89
  151. package/runtime/docs/namespace.md +0 -148
  152. package/runtime/docs/pathogen-schema-example.json +0 -36
  153. package/runtime/docs/pathogen-schema.md +0 -111
  154. package/runtime/docs/planning-discipline.md +0 -159
  155. package/runtime/docs/progressive-disclosure.md +0 -184
  156. package/runtime/lib/queen-utils.sh +0 -729
  157. package/runtime/planning.md +0 -159
  158. package/runtime/recover.sh +0 -136
  159. package/runtime/utils/xml-utils.sh +0 -2196
  160. package/runtime/workers-new-castes.md +0 -516
  161. /package/{runtime → .aether/docs/disciplines}/coding-standards.md +0 -0
  162. /package/{runtime → .aether/docs/disciplines}/debugging.md +0 -0
  163. /package/{runtime → .aether/docs/disciplines}/learning.md +0 -0
  164. /package/{runtime → .aether/docs/disciplines}/tdd.md +0 -0
  165. /package/{runtime → .aether/docs/disciplines}/verification-loop.md +0 -0
  166. /package/{runtime → .aether/docs/disciplines}/verification.md +0 -0
  167. /package/{runtime → .aether}/docs/pheromones.md +0 -0
  168. /package/{runtime → .aether}/model-profiles.yaml +0 -0
  169. /package/{runtime → .aether}/schemas/aether-types.xsd +0 -0
  170. /package/{runtime → .aether}/schemas/colony-registry.xsd +0 -0
  171. /package/{runtime → .aether}/schemas/pheromone.xsd +0 -0
  172. /package/{runtime → .aether}/schemas/prompt.xsd +0 -0
  173. /package/{runtime → .aether}/schemas/queen-wisdom.xsd +0 -0
  174. /package/{runtime → .aether}/schemas/worker-priming.xsd +0 -0
  175. /package/{runtime → .aether}/templates/QUEEN.md.template +0 -0
  176. /package/{runtime → .aether}/utils/colorize-log.sh +0 -0
  177. /package/{runtime → .aether}/utils/queen-to-md.xsl +0 -0
  178. /package/{runtime → .aether}/utils/spawn-tree.sh +0 -0
  179. /package/{runtime → .aether}/utils/spawn-with-model.sh +0 -0
  180. /package/{runtime → .aether}/utils/state-loader.sh +0 -0
  181. /package/{runtime → .aether}/utils/swarm-display.sh +0 -0
  182. /package/{runtime → .aether}/utils/watch-spawn-tree.sh +0 -0
  183. /package/{runtime → .aether}/utils/xml-core.sh +0 -0
@@ -152,8 +152,8 @@ git rev-parse --git-dir 2>/dev/null
152
152
  ```
153
153
 
154
154
  - **If succeeds** (is a git repo):
155
- 1. Check for changes in Aether-managed directories only: `.aether .claude/commands/ant .claude/commands/st .opencode runtime bin`
156
- 2. **If changes exist**: `git stash push -m "aether-checkpoint: pre-phase-$PHASE_NUMBER" -- .aether .claude/commands/ant .claude/commands/st .opencode runtime bin`
155
+ 1. Check for changes in Aether-managed directories only: `.aether .claude/commands/ant .claude/commands/st .opencode bin`
156
+ 2. **If changes exist**: `git stash push -m "aether-checkpoint: pre-phase-$PHASE_NUMBER" -- .aether .claude/commands/ant .claude/commands/st .opencode bin`
157
157
  - IMPORTANT: Never use `--include-untracked` — it stashes ALL files including user work!
158
158
  - Verify: `git stash list | head -1 | grep "aether-checkpoint"` — warn if empty
159
159
  - Store checkpoint as `{type: "stash", ref: "aether-checkpoint: pre-phase-$PHASE_NUMBER"}`
@@ -222,8 +222,7 @@ bash .aether/aether-utils.sh survey-load "{phase_name}" 2>/dev/null
222
222
 
223
223
  **Display summary:**
224
224
  ```
225
- 🗺️ SURVEY LOADED
226
- ================
225
+ ━━━ 🗺️🐜 S U R V E Y L O A D E D ━━━
227
226
  {for each doc loaded}
228
227
  {emoji} {filename} — {brief description}
229
228
  {/for}
@@ -261,8 +260,7 @@ queen_decrees = .result.wisdom.decrees (if .result.priming.has_decrees)
261
260
 
262
261
  **Display summary (if any wisdom exists):**
263
262
  ```
264
- 📜 QUEEN WISDOM LOADED
265
- =====================
263
+ ━━━ 📜🐜 Q U E E N W I S D O M ━━━
266
264
  {if queen_philosophies:} 📜 Philosophies: yes{/if}
267
265
  {if queen_patterns:} 🧭 Patterns: yes{/if}
268
266
  {if queen_redirects:} ⚠️ Redirects: yes{/if}
@@ -274,6 +272,47 @@ queen_decrees = .result.wisdom.decrees (if .result.priming.has_decrees)
274
272
 
275
273
  **Graceful handling:** If QUEEN.md doesn't exist or `queen-read` fails, continue without wisdom injection. Workers will receive standard prompts.
276
274
 
275
+ ### Step 4.1.6: Load Active Pheromones (Signal Consumption)
276
+
277
+ Call `pheromone-read` to extract active colony signals for worker priming:
278
+
279
+ ```bash
280
+ bash .aether/aether-utils.sh pheromone-read 2>/dev/null
281
+ ```
282
+
283
+ **Parse the JSON response:**
284
+ - If `.ok` is false or command fails: Set `pheromone_section = null` and skip pheromone injection
285
+ - If successful: Extract signals from `.result.signals`
286
+
287
+ **Active Signals Section Template (injected into builder prompts):**
288
+ ```
289
+ --- ACTIVE SIGNALS (Pheromone Consumption) ---
290
+ {focus_section if .result.signals.focus exists:}
291
+ 🎯 FOCUS: {focus_description}
292
+ {redirect_section if .result.signals.redirect exists:}
293
+ ⚠️ AVOID: {redirect_description}
294
+ {feedback_section if .result.signals.feedback exists:}
295
+ 💬 FEEDBACK: {feedback_description}
296
+ --- END SIGNALS ---
297
+ ```
298
+
299
+ **Store for builder injection:**
300
+ - `pheromone_section` — formatted signal section for builder prompts
301
+
302
+ **Display summary (if any signals exist):**
303
+ ```
304
+ ━━━ 🦠🐜 P H E R O M O N E S D E T E C T E D ━━━
305
+ {focus_present:} 🎯 Focus signal: yes{/if}
306
+ {redirect_present:} ⚠️ Redirect signal: yes{/if}
307
+ {feedback_present:} 💬 Feedback signal: yes{/if}
308
+
309
+ {if none exist:} (no active signals){/if}
310
+ ```
311
+
312
+ **Graceful handling:** If pheromone-read fails or no signals exist, continue without pheromone injection.
313
+
314
+ ---
315
+
277
316
  ### Step 4.2: Archaeologist Pre-Build Scan
278
317
 
279
318
  **Conditional step — only fires when the phase modifies existing files.**
@@ -299,15 +338,15 @@ queen_decrees = .result.wisdom.decrees (if .result.priming.has_decrees)
299
338
 
300
339
  Display:
301
340
  ```
302
- 🏺 Archaeologist {archaeologist_name} spawning
341
+ 🏺🐜 Archaeologist {archaeologist_name} spawning
303
342
  Scanning history of files to be modified...
304
343
  ```
305
344
 
306
- Spawn a Scout (using Task tool with `subagent_type="general-purpose"`) with this prompt:
345
+ Spawn a Scout (using Task tool with `subagent_type="general-purpose"`, include `description: "🏺 Archaeologist {archaeologist_name}: Pre-build history scan"`) with this prompt:
307
346
  # NOTE: Claude Code uses aether-archaeologist; OpenCode uses general-purpose with role injection
308
347
 
309
348
  ```
310
- You are {Archaeologist-Name}, a 🏺 Archaeologist Ant.
349
+ You are {Archaeologist-Name}, a 🏺🐜 Archaeologist Ant.
311
350
 
312
351
  Mission: Pre-build archaeology scan
313
352
 
@@ -344,8 +383,7 @@ queen_decrees = .result.wisdom.decrees (if .result.priming.has_decrees)
344
383
 
345
384
  Display summary:
346
385
  ```
347
- 🏺 ARCHAEOLOGY CONTEXT
348
- =====================
386
+ ━━━ 🏺🐜 A R C H A E O L O G Y ━━━
349
387
  {summary of findings from archaeologist}
350
388
  ```
351
389
 
@@ -353,6 +391,8 @@ queen_decrees = .result.wisdom.decrees (if .result.priming.has_decrees)
353
391
  The `archaeology_context` will be injected into builder prompts in Step 5.1 (see below).
354
392
  If this step was skipped (no existing files modified), the archaeology section is omitted from builder prompts.
355
393
 
394
+ ---
395
+
356
396
  ### Step 5: Initialize Swarm Display and Analyze Tasks
357
397
 
358
398
  **YOU (the Queen) will spawn workers directly. Do NOT delegate to a single Prime Worker.**
@@ -374,14 +414,15 @@ bash .aether/aether-utils.sh swarm-display-update "Queen" "prime" "excavating" "
374
414
 
375
415
  **Show real-time display header:**
376
416
  ```
377
- 🔨 COLONY BUILD INITIATED
378
- ═══════════════════════════════════════════════════
379
- Phase {id}: {name}
380
- Build ID: {build_id}
381
-
382
- Launching swarm display...
417
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
418
+ Phase {id}: {name} — {N} waves, {M} tasks
419
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
383
420
  ```
384
421
 
422
+ Where N = number of builder waves (excluding watcher/chaos) and M = total builder tasks.
423
+
424
+ Record `build_started_at_epoch=$(date +%s)` — this epoch integer is used by the BUILD SUMMARY block in Step 7 to calculate elapsed time.
425
+
385
426
  Analyze the phase tasks:
386
427
 
387
428
  Analyze the phase tasks:
@@ -392,10 +433,10 @@ Analyze the phase tasks:
392
433
  - **Wave 3+:** Continue until all tasks assigned
393
434
 
394
435
  2. **Assign castes:**
395
- - Implementation tasks → 🔨 Builder
396
- - Research/docs tasks → 🔍 Scout
397
- - Testing/validation → 👁️ Watcher (ALWAYS spawn at least one)
398
- - Resilience testing → 🎲 Chaos (ALWAYS spawn one after Watcher)
436
+ - Implementation tasks → 🔨🐜 Builder
437
+ - Research/docs tasks → 🔍🐜 Scout
438
+ - Testing/validation → 👁️🐜 Watcher (ALWAYS spawn at least one)
439
+ - Resilience testing → 🎲🐜 Chaos (ALWAYS spawn one after Watcher)
399
440
 
400
441
  3. **Generate ant names for each worker:**
401
442
  ```bash
@@ -406,47 +447,95 @@ bash .aether/aether-utils.sh generate-ant-name "chaos"
406
447
 
407
448
  Display spawn plan with caste emojis:
408
449
  ```
409
- 🐜 SPAWN PLAN
450
+ ━━━ 🐜 S P A W N P L A N ━━━
410
451
 
411
452
  Wave 1 — Parallel
412
- 🔨 {Builder-Name} Task {id} {description}
413
- 🔨 {Builder-Name} Task {id} {description}
453
+ 🔨🐜 {Builder-Name} Task {id} {description}
454
+ 🔨🐜 {Builder-Name} Task {id} {description}
414
455
 
415
456
  Wave 2 — After Wave 1
416
- 🔨 {Builder-Name} Task {id} {description}
457
+ 🔨🐜 {Builder-Name} Task {id} {description}
417
458
 
418
459
  Verification
419
- 👁️ {Watcher-Name} Verify all work independently
420
- 🎲 {Chaos-Name} Resilience testing (after Watcher)
460
+ 👁️🐜 {Watcher-Name} Verify all work independently
461
+ 🎲🐜 {Chaos-Name} Resilience testing (after Watcher)
421
462
 
422
463
  Total: {N} Builders + 1 Watcher + 1 Chaos = {N+2} spawns
423
464
  ```
424
465
 
425
466
  **Caste Emoji Legend:**
426
- - 🔨 Builder (cyan if color enabled)
427
- - 👁️ Watcher (green if color enabled)
428
- - 🎲 Chaos (red if color enabled)
429
- - 🔍 Scout (yellow if color enabled)
430
- - 🏺 Archaeologist (magenta if color enabled)
467
+ - 🔨🐜 Builder (cyan if color enabled)
468
+ - 👁️🐜 Watcher (green if color enabled)
469
+ - 🎲🐜 Chaos (red if color enabled)
470
+ - 🔍🐜 Scout (yellow if color enabled)
471
+ - 🏺🐜 Archaeologist (magenta if color enabled)
431
472
  - 🥚 Queen/Prime
432
473
 
433
474
  **Every spawn must show its caste emoji.**
434
475
 
476
+ ### Step 5.0.5: Select and Announce Workflow Pattern
477
+
478
+ Examine the phase name and task descriptions. Select the first matching pattern:
479
+
480
+ | Phase contains | Pattern |
481
+ |----------------|---------|
482
+ | "bug", "fix", "error", "broken", "failing" | Investigate-Fix |
483
+ | "research", "oracle", "explore", "investigate" | Deep Research |
484
+ | "refactor", "restructure", "clean", "reorganize" | Refactor |
485
+ | "security", "audit", "compliance", "accessibility", "license" | Compliance |
486
+ | "docs", "documentation", "readme", "guide" | Documentation Sprint |
487
+ | (default) | SPBV |
488
+
489
+ Display the selected pattern:
490
+ ```
491
+ ━━ Pattern: {pattern_name} ━━
492
+ {announce_line from Queen's Workflow Patterns definition}
493
+ ```
494
+
495
+ Store `selected_pattern` for inclusion in the BUILD SUMMARY (Step 7).
496
+
435
497
  ### Step 5.1: Spawn Wave 1 Workers (Parallel)
436
498
 
437
499
  **CRITICAL: Spawn ALL Wave 1 workers in a SINGLE message using multiple Task tool calls.**
438
500
 
439
- For each Wave 1 task, use Task tool with `subagent_type="general-purpose"` (DO NOT use run_in_background - multiple Task calls in a single message run in parallel and block until complete):
501
+ **CRITICAL: Spawn ALL Wave 1 workers in a SINGLE message using multiple Task tool calls.**
502
+
503
+ **Announce the wave before spawning:**
504
+
505
+ Display the spawn announcement immediately before firing Task calls:
506
+
507
+ For single-caste waves (typical — all builders):
508
+ ```
509
+ ──── 🔨🐜 Spawning {N} Builders in parallel ────
510
+ ```
511
+
512
+ For mixed-caste waves (uncommon):
513
+ ```
514
+ ──── 🐜 Spawning {N} workers ({X} 🔨 Builder, {Y} 🔍 Scout) ────
515
+ ```
516
+
517
+ For a single worker:
518
+ ```
519
+ ──── 🔨🐜 Spawning {ant_name} — {task_summary} ────
520
+ ```
521
+
522
+ **First, mark build start in context:**
523
+ ```bash
524
+ bash .aether/aether-utils.sh context-update build-start {phase_id} {wave_1_worker_count} {wave_1_task_count}
525
+ ```
526
+
527
+ For each Wave 1 task, use Task tool with `subagent_type="general-purpose"`, include `description: "🔨 Builder {Ant-Name}: {task_description}"` (DO NOT use run_in_background - multiple Task calls in a single message run in parallel and block until complete):
440
528
 
441
529
  Log each spawn and update swarm display:
442
530
  ```bash
443
531
  bash .aether/aether-utils.sh spawn-log "Queen" "builder" "{ant_name}" "{task_description}"
444
532
  bash .aether/aether-utils.sh swarm-display-update "{ant_name}" "builder" "excavating" "{task_description}" "Queen" '{"read":0,"grep":0,"edit":0,"bash":0}' 0 "fungus_garden" 10
533
+ bash .aether/aether-utils.sh context-update worker-spawn "{ant_name}" "builder" "{task_description}"
445
534
  ```
446
535
 
447
536
  **Builder Worker Prompt (CLEAN OUTPUT):**
448
537
  ```
449
- You are {Ant-Name}, a 🔨 Builder Ant.
538
+ You are {Ant-Name}, a 🔨🐜 Builder Ant.
450
539
 
451
540
  Task {id}: {description}
452
541
 
@@ -454,6 +543,10 @@ Goal: "{colony_goal}"
454
543
 
455
544
  { archaeology_context if exists }
456
545
 
546
+ { queen_wisdom_section if any wisdom exists }
547
+
548
+ { pheromone_section if pheromone_section exists }
549
+
457
550
  Work:
458
551
  1. Read .aether/workers.md for Builder discipline
459
552
  2. Implement task, write tests
@@ -466,43 +559,196 @@ Spawn sub-workers ONLY if 3x complexity:
466
559
  - Announce: "🐜 Spawning {child_name} for {reason}"
467
560
  - Log: bash .aether/aether-utils.sh spawn-log "{Ant-Name}" "builder" "{child_name}" "{task}"
468
561
 
562
+ Count your total tool calls (Read + Grep + Edit + Bash + Write) and report as tool_count.
563
+
469
564
  Return ONLY this JSON (no other text):
470
- {"ant_name": "{Ant-Name}", "task_id": "{id}", "status": "completed|failed|blocked", "summary": "What you did", "files_created": [], "files_modified": [], "tests_written": [], "blockers": []}
565
+ {"ant_name": "{Ant-Name}", "task_id": "{id}", "status": "completed|failed|blocked", "summary": "What you did", "tool_count": 0, "files_created": [], "files_modified": [], "tests_written": [], "blockers": []}
566
+ ```
567
+
568
+ **Queen Wisdom Section Template (injected only if wisdom exists):**
569
+ ```
570
+ --- QUEEN WISDOM (Eternal Guidance) ---
571
+ { if queen_philosophies: }
572
+ 📜 Philosophies:
573
+ {queen_philosophies}
574
+ { endif }
575
+ { if queen_patterns: }
576
+ 🧭 Patterns:
577
+ {queen_patterns}
578
+ { endif }
579
+ { if queen_redirects: }
580
+ ⚠️ Redirects (AVOID these):
581
+ {queen_redirects}
582
+ { endif }
583
+ { if queen_stack_wisdom: }
584
+ 🔧 Stack Wisdom:
585
+ {queen_stack_wisdom}
586
+ { endif }
587
+ { if queen_decrees: }
588
+ 🏛️ Decrees:
589
+ {queen_decrees}
590
+ { endif }
591
+ --- END QUEEN WISDOM ---
592
+ ```
593
+
594
+ **Queen Wisdom Section Template (injected only if wisdom exists):**
595
+ ```
596
+ --- QUEEN WISDOM (Eternal Guidance) ---
597
+ { if queen_philosophies: }
598
+ 📜 Philosophies:
599
+ {queen_philosophies}
600
+ { endif }
601
+ { if queen_patterns: }
602
+ 🧭 Patterns:
603
+ {queen_patterns}
604
+ { endif }
605
+ { if queen_redirects: }
606
+ ⚠️ Redirects (AVOID these):
607
+ {queen_redirects}
608
+ { endif }
609
+ { if queen_stack_wisdom: }
610
+ 🔧 Stack Wisdom:
611
+ {queen_stack_wisdom}
612
+ { endif }
613
+ { if queen_decrees: }
614
+ 🏛️ Decrees:
615
+ {queen_decrees}
616
+ { endif }
617
+ --- END QUEEN WISDOM ---
618
+ ```
619
+
620
+ **Active Signals Section (injected if pheromones exist):**
621
+ ```
622
+ --- ACTIVE SIGNALS (From User) ---
623
+
624
+ 🎯 PRIORITIES (FOCUS):
625
+ {for each priority}
626
+ - {priority}
627
+ {endfor}
628
+
629
+ ⚠️ CONSTRAINTS (REDIRECT - AVOID):
630
+ {for each constraint}
631
+ - {constraint.content}
632
+ {endfor}
633
+
634
+ --- END ACTIVE SIGNALS ---
471
635
  ```
472
636
 
473
637
  ### Step 5.2: Process Wave 1 Results
474
638
 
475
639
  **Task calls return results directly (no TaskOutput needed).**
476
640
 
477
- **As each worker result arrives, immediately display:**
641
+ **As each worker result arrives, IMMEDIATELY display a single completion line — do not wait for other workers:**
642
+
643
+ For successful workers:
644
+ ```
645
+ 🔨 {Ant-Name}: {task_description} ({tool_count} tools) ✓
646
+ ```
647
+
648
+ For failed workers:
478
649
  ```
479
- 🔨 {Builder-Name} completed Task {id}
480
- 📖{read_count} 🔍{grep_count} ✏️{edit_count} ⚡{bash_count} {elapsed_time}
650
+ 🔨 {Ant-Name}: {task_description} ({failure_reason} after {tool_count} tools)
481
651
  ```
482
652
 
653
+ Where `tool_count` comes from the worker's returned JSON `tool_count` field, and `failure_reason` is extracted from the first item in the worker's `blockers` array or "unknown error" if empty.
654
+
483
655
  Log and update swarm display:
484
656
  ```bash
485
657
  bash .aether/aether-utils.sh spawn-complete "{ant_name}" "completed" "{summary}"
486
658
  bash .aether/aether-utils.sh swarm-display-update "{ant_name}" "builder" "completed" "{task_description}" "Queen" '{"read":5,"grep":3,"edit":2,"bash":1}' 100 "fungus_garden" 100
659
+ bash .aether/aether-utils.sh context-update worker-complete "{ant_name}" "completed"
660
+ ```
661
+
662
+ **Check for total wave failure:**
663
+
664
+ After processing all worker results in this wave, check if EVERY worker returned `status: "failed"`. If ALL workers in the wave failed:
665
+
666
+ Display a prominent halt alert:
487
667
  ```
668
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
669
+ ⚠ WAVE FAILURE — BUILD HALTED
670
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
671
+
672
+ All {N} workers in Wave {X} failed. Something is fundamentally wrong.
673
+
674
+ Failed workers:
675
+ {for each failed worker in this wave:}
676
+ {caste_emoji} {Ant-Name}: {task_description} ✗ ({failure_reason} after {tool_count} tools)
677
+ {end for}
678
+
679
+ Next steps:
680
+ /ant:flags Review blockers
681
+ /ant:swarm Auto-repair mode
682
+ ```
683
+
684
+ Then STOP — do not proceed to subsequent waves, Watcher, or Chaos. Skip directly to Step 5.9 synthesis with `status: "failed"`.
685
+
686
+ **Partial wave failure — escalation path:**
687
+
688
+ If SOME (but not all) workers in the wave failed:
689
+ 1. For each failed worker, attempt Tier 3 escalation: Queen spawns a different caste for the same task
690
+ 2. If Tier 3 succeeds: continue to next wave
691
+ 3. If Tier 3 fails: display the Tier 4 ESCALATION banner (from Queen agent definition):
692
+
693
+ ```
694
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
695
+ ⚠ ESCALATION — QUEEN NEEDS YOU
696
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
697
+
698
+ Task: {failed task description}
699
+ Phase: {phase number} — {phase name}
700
+
701
+ Tried:
702
+ • Worker retry (2 attempts) — {what failed}
703
+ • Parent tried alternate approach — {what failed}
704
+ • Queen reassigned to {other caste} — {what failed}
705
+
706
+ Options:
707
+ A) {recommended option} — RECOMMENDED
708
+ B) {alternate option}
709
+ C) Skip and continue — this task will be marked blocked
710
+
711
+ Awaiting your choice.
712
+ ```
713
+
714
+ Log escalation as flag:
715
+ ```bash
716
+ bash .aether/aether-utils.sh flag-add "blocker" "{task title}" "{failure summary}" "escalation" {phase_number}
717
+ ```
718
+
719
+ If at least one worker succeeded, continue normally to the next wave.
488
720
 
489
721
  **Parse each worker's JSON output to collect:** status, files_created, files_modified, blockers
490
722
 
491
- **Visual Mode: Render live display (if enabled):**
492
- If `visual_mode` is true, render the swarm display after all workers complete:
723
+ **Visual Mode: Render live display (tmux only):**
724
+ If `visual_mode` is true AND the build is running inside a tmux session (`$TMUX` environment variable is set), render the swarm display:
493
725
  ```bash
494
- bash .aether/aether-utils.sh swarm-display-render "$build_id"
726
+ bash .aether/aether-utils.sh swarm-display-text "$build_id"
495
727
  ```
496
728
 
729
+ If `$TMUX` is not set, skip this call entirely — do not attempt it. Chat users see the structured completion lines above instead.
730
+
497
731
  ### Step 5.3: Spawn Wave 2+ Workers (Sequential Waves)
498
732
 
733
+ **Before each subsequent wave, display a wave separator:**
734
+ ```
735
+ ━━━ 🐜 Wave {X} of {N} ━━━
736
+ ```
737
+ Then display the spawn announcement (same format as Step 5.1).
738
+
499
739
  Repeat Step 5.1-5.2 for each subsequent wave, waiting for previous wave to complete.
500
740
 
501
741
  ### Step 5.4: Spawn Watcher for Verification
502
742
 
503
743
  **MANDATORY: Always spawn a Watcher — testing must be independent.**
504
744
 
505
- Spawn the Watcher using Task tool with `subagent_type="general-purpose"` (DO NOT use run_in_background - task blocks until complete):
745
+ **Announce the verification wave:**
746
+ ```
747
+ ━━━ 👁️🐜 V E R I F I C A T I O N ━━━
748
+ ──── 👁️🐜 Spawning {watcher_name} ────
749
+ ```
750
+
751
+ Spawn the Watcher using Task tool with `subagent_type="general-purpose"`, include `description: "👁️ Watcher {Watcher-Name}: Independent verification"` (DO NOT use run_in_background - task blocks until complete):
506
752
 
507
753
  ```bash
508
754
  bash .aether/aether-utils.sh spawn-log "Queen" "watcher" "{watcher_name}" "Independent verification"
@@ -511,7 +757,7 @@ bash .aether/aether-utils.sh swarm-display-update "{watcher_name}" "watcher" "ob
511
757
 
512
758
  **Watcher Worker Prompt (CLEAN OUTPUT):**
513
759
  ```
514
- You are {Watcher-Name}, a 👁️ Watcher Ant.
760
+ You are {Watcher-Name}, a 👁️🐜 Watcher Ant.
515
761
 
516
762
  Verify all work done by Builders in Phase {id}.
517
763
 
@@ -529,8 +775,10 @@ Spawn sub-workers if needed:
529
775
  - Log: bash .aether/aether-utils.sh spawn-log "{Watcher-Name}" "watcher" "{child}" "{task}"
530
776
  - Announce: "🐜 Spawning {child} to investigate {issue}"
531
777
 
778
+ Count your total tool calls (Read + Grep + Edit + Bash + Write) and report as tool_count.
779
+
532
780
  Return ONLY this JSON:
533
- {"ant_name": "{Watcher-Name}", "verification_passed": true|false, "files_verified": [], "issues_found": [], "quality_score": N, "recommendation": "proceed|fix_required"}
781
+ {"ant_name": "{Watcher-Name}", "verification_passed": true|false, "files_verified": [], "issues_found": [], "quality_score": N, "tool_count": 0, "recommendation": "proceed|fix_required"}
534
782
  ```
535
783
 
536
784
  ### Step 5.5: Process Watcher Results
@@ -539,6 +787,18 @@ Return ONLY this JSON:
539
787
 
540
788
  **Parse the Watcher's JSON response:** verification_passed, issues_found, quality_score, recommendation
541
789
 
790
+ **Display Watcher completion line:**
791
+
792
+ For successful verification:
793
+ ```
794
+ 👁️ {Watcher-Name}: Independent verification ({tool_count} tools) ✓
795
+ ```
796
+
797
+ For failed verification:
798
+ ```
799
+ 👁️ {Watcher-Name}: Independent verification ✗ ({issues_found count} issues after {tool_count} tools)
800
+ ```
801
+
542
802
  **Store results for synthesis in Step 5.7**
543
803
 
544
804
  **Update swarm display when Watcher completes:**
@@ -563,12 +823,17 @@ bash .aether/aether-utils.sh flag-list --phase {phase_number}
563
823
  ```
564
824
  Parse the result and extract unresolved flag titles into a list: `{existing_flag_titles}` (comma-separated titles from `.result.flags[].title`). If no flags exist, set `{existing_flag_titles}` to "None".
565
825
 
566
- Spawn the Chaos Ant using Task tool with `subagent_type="general-purpose"` (DO NOT use run_in_background - task blocks until complete):
826
+ **Announce the resilience testing wave:**
827
+ ```
828
+ ──── 🎲🐜 Spawning {chaos_name} — resilience testing ────
829
+ ```
830
+
831
+ Spawn the Chaos Ant using Task tool with `subagent_type="general-purpose"`, include `description: "🎲 Chaos {Chaos-Name}: Resilience testing"` (DO NOT use run_in_background - task blocks until complete):
567
832
  # NOTE: Claude Code uses aether-chaos; OpenCode uses general-purpose with role injection
568
833
 
569
834
  **Chaos Ant Prompt (CLEAN OUTPUT):**
570
835
  ```
571
- You are {Chaos-Name}, a 🎲 Chaos Ant.
836
+ You are {Chaos-Name}, a 🎲🐜 Chaos Ant.
572
837
 
573
838
  Test Phase {id} work for edge cases and boundary conditions.
574
839
 
@@ -582,8 +847,10 @@ Rules:
582
847
  - Read-only (don't modify code)
583
848
  - Focus: edge cases, boundaries, error handling
584
849
 
850
+ Count your total tool calls (Read + Grep + Edit + Bash + Write) and report as tool_count.
851
+
585
852
  Return ONLY this JSON:
586
- {"ant_name": "{Chaos-Name}", "scenarios_tested": 5, "findings": [{"id": 1, "category": "edge_case|boundary|error_handling", "severity": "critical|high|medium|low", "title": "...", "description": "..."}], "overall_resilience": "strong|moderate|weak", "summary": "..."}
853
+ {"ant_name": "{Chaos-Name}", "scenarios_tested": 5, "findings": [{"id": 1, "category": "edge_case|boundary|error_handling", "severity": "critical|high|medium|low", "title": "...", "description": "..."}], "overall_resilience": "strong|moderate|weak", "tool_count": 0, "summary": "..."}
587
854
  ```
588
855
 
589
856
  ### Step 5.7: Process Chaos Ant Results
@@ -592,6 +859,11 @@ Return ONLY this JSON:
592
859
 
593
860
  **Parse the Chaos Ant's JSON response:** findings, overall_resilience, summary
594
861
 
862
+ **Display Chaos completion line:**
863
+ ```
864
+ 🎲 {Chaos-Name}: Resilience testing ({tool_count} tools) ✓
865
+ ```
866
+
595
867
  **Store results for synthesis in Step 5.9**
596
868
 
597
869
  **Flag critical/high findings:**
@@ -678,36 +950,22 @@ bash .aether/aether-utils.sh activity-log "GRAVE" "Queen" "Grave marker placed a
678
950
 
679
951
  **Error Handoff Update:**
680
952
  If workers failed, update handoff with error context for recovery:
681
- ```bash
682
- cat > .aether/HANDOFF.md << 'HANDOFF_EOF'
683
- # Colony Session — Build Errors
684
-
685
- ## ⚠️ Build Status: ISSUES DETECTED
686
- **Phase:** {phase_number} — {phase_name}
687
- **Status:** Build completed with failures
688
- **Updated:** $(date -u +%Y-%m-%dT%H:%M:%SZ)
689
953
 
690
- ## Failed Workers
691
- {for each failed worker:}
692
- - {ant_name}: {failure_summary}
693
- {end for}
954
+ Resolve the build error handoff template path:
955
+ Check ~/.aether/system/templates/handoff-build-error.template.md first,
956
+ then .aether/templates/handoff-build-error.template.md.
694
957
 
695
- ## Grave Markers Placed
696
- {for each grave:}
697
- - {file}: {caution_level} caution
698
- {end for}
958
+ If no template found: output "Template missing: handoff-build-error.template.md. Run aether update to fix." and stop.
699
959
 
700
- ## Recovery Options
701
- 1. Review failures: Check `.aether/data/activity.log`
702
- 2. Fix and retry: `/ant:build {phase_number}`
703
- 3. Swarm fix: `/ant:swarm` for auto-repair
704
- 4. Manual fix: Address issues, then `/ant:continue`
960
+ Read the template file. Fill all {{PLACEHOLDER}} values:
961
+ - {{PHASE_NUMBER}} current phase number
962
+ - {{PHASE_NAME}} current phase name
963
+ - {{BUILD_TIMESTAMP}} current ISO-8601 UTC timestamp
964
+ - {{FAILED_WORKERS}} formatted list of failed workers (one "- {ant_name}: {failure_summary}" per line)
965
+ - {{GRAVE_MARKERS}} → formatted list of grave markers (one "- {file}: {caution_level} caution" per line)
705
966
 
706
- ## Session Note
707
- Build completed but workers failed. Grave markers placed.
708
- Review failures before advancing.
709
- HANDOFF_EOF
710
- ```
967
+ Remove the HTML comment lines at the top of the template.
968
+ Write the result to .aether/HANDOFF.md using the Write tool.
711
969
 
712
970
  Only fires when workers fail. Zero impact on successful builds.
713
971
 
@@ -785,8 +1043,7 @@ Return JSON:
785
1043
  Parse synthesis result. If `ui_touched` is true:
786
1044
 
787
1045
  ```
788
- Visual Checkpoint
789
- =================
1046
+ ━━━ 🖼️🐜 V I S U A L C H E C K P O I N T ━━━
790
1047
 
791
1048
  UI changes detected. Verify appearance before continuing.
792
1049
 
@@ -832,157 +1089,114 @@ jq -n \
832
1089
  "can_resume": true,
833
1090
  "note": "Phase build completed. Run /ant:continue to advance if verification passed."
834
1091
  }' > .aether/data/last-build-result.json
1092
+ ```
1093
+
1094
+ Resolve the build success handoff template path:
1095
+ Check ~/.aether/system/templates/handoff-build-success.template.md first,
1096
+ then .aether/templates/handoff-build-success.template.md.
835
1097
 
836
- # Write handoff markdown
837
- cat > .aether/HANDOFF.md << 'HANDOFF_EOF'
838
- # Colony Session — Build Complete
1098
+ If no template found: output "Template missing: handoff-build-success.template.md. Run aether update to fix." and stop.
839
1099
 
840
- ## Quick Resume
841
- Run `/ant:continue` to advance phase, or `/ant:resume-colony` to restore full context.
1100
+ Read the template file. Fill all {{PLACEHOLDER}} values:
1101
+ - {{GOAL}} colony goal (from COLONY_STATE.json)
1102
+ - {{PHASE_NUMBER}} → current phase number
1103
+ - {{PHASE_NAME}} → current phase name
1104
+ - {{BUILD_STATUS}} → synthesis.status
1105
+ - {{BUILD_TIMESTAMP}} → current ISO-8601 UTC timestamp
1106
+ - {{BUILD_SUMMARY}} → synthesis summary
1107
+ - {{TASKS_COMPLETED}} → count of completed tasks
1108
+ - {{TASKS_FAILED}} → count of failed tasks
1109
+ - {{FILES_CREATED}} → count of created files
1110
+ - {{FILES_MODIFIED}} → count of modified files
1111
+ - {{SESSION_NOTE}} → "Build succeeded — ready to advance." if status is completed, else "Build completed with issues — review before continuing."
842
1112
 
843
- ## State at Build Completion
844
- - Goal: "$(jq -r '.goal' .aether/data/COLONY_STATE.json)"
845
- - Phase: {phase_number} — {phase_name}
846
- - Build Status: {synthesis.status}
847
- - Updated: $(date -u +%Y-%m-%dT%H:%M:%SZ)
1113
+ Remove the HTML comment lines at the top of the template.
1114
+ Write the result to .aether/HANDOFF.md using the Write tool.
848
1115
 
849
- ## Build Summary
850
- {summary}
1116
+ This ensures the handoff always reflects the latest build state, even if the session crashes before explicit pause.
851
1117
 
852
- ## Tasks
853
- - Completed: {synthesis.tasks_completed | length}
854
- - Failed: {synthesis.tasks_failed | length}
1118
+ ### Step 6.5: Update Context Document
855
1119
 
856
- ## Files Changed
857
- - Created: {synthesis.files_created | length} files
858
- - Modified: {synthesis.files_modified | length} files
1120
+ Log this build activity to `.aether/CONTEXT.md`:
859
1121
 
860
- ## Next Steps
861
- - If verification passed: `/ant:continue` to advance to next phase
862
- - If issues found: `/ant:flags` to review blockers
863
- - To pause: `/ant:pause-colony`
1122
+ ```bash
1123
+ bash .aether/aether-utils.sh context-update activity "build {phase_id}" "{synthesis.status}" "{files_created_count + files_modified_count}"
1124
+ ```
864
1125
 
865
- ## Session Note
866
- $(if synthesis.status == "completed" then "Build succeeded — ready to advance." else "Build completed with issues — review before continuing." end)
867
- HANDOFF_EOF
1126
+ Mark build as complete in context:
1127
+ ```bash
1128
+ bash .aether/aether-utils.sh context-update build-complete "{synthesis.status}" "{synthesis.status == 'completed' ? 'success' : 'failed'}"
868
1129
  ```
869
1130
 
870
- This ensures the handoff always reflects the latest build state, even if the session crashes before explicit pause.
1131
+ Also update safe-to-clear status:
1132
+ - If build completed successfully: `context-update safe-to-clear "YES" "Build complete, ready to continue"`
1133
+ - If build failed: `context-update safe-to-clear "NO" "Build failed — run /ant:swarm or /ant:flags"`
871
1134
 
872
1135
  ### Step 7: Display Results
873
1136
 
874
1137
  **This step runs ONLY after synthesis is complete. All values come from actual worker results.**
875
1138
 
876
- **First, render the final swarm display showing all completed workers:**
1139
+ **Update swarm display state (always) and render (tmux only):**
877
1140
  ```bash
878
- # Final swarm display update - mark Queen as completed
1141
+ # Update Queen as completed
879
1142
  bash .aether/aether-utils.sh swarm-display-update "Queen" "prime" "completed" "Phase {id} complete" "Colony" '{"read":10,"grep":5,"edit":5,"bash":2}' 100 "fungus_garden" 100
880
-
881
- # Render the final swarm display
882
- bash .aether/aether-utils.sh swarm-display-render "$build_id"
883
1143
  ```
884
1144
 
885
- The swarm display will show:
886
- - 🐜 All workers with their caste emojis (🔨 Builder, 👁️ Watcher, 🎲 Chaos)
887
- - 📖 Tool usage stats (Read, Grep, Edit, Bash counts)
888
- - 🏠 Chamber activity map (Fungus Garden, Nursery, Refuse Pile)
889
- - ✅ Progress bars at 100% for completed work
890
- - 🌈 Color-coded by caste
891
-
892
- **Then display build summary based on synthesis results AND `verbose_mode` from Step 1:**
893
-
894
- **If verbose_mode = false (compact output, ~12 lines):**
895
-
896
- ```
897
- 🔨 PHASE {id} {status_icon}
898
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
899
- 📍 {name}
900
- 📊 {status} | 📁 {files_created count} created, {files_modified count} modified
901
- 🐜 {spawn_count} workers | 🧪 {tests_total} tests {if all_passing}passing{else}{passed}/{total}{end if}
902
- {if learning.patterns_observed.length > 0:}🧠 +{patterns_observed.length} patterns{end if}
903
-
904
- {if synthesis.status == "failed" OR verification.recommendation == "fix_required":}
905
- ⚠️ BLOCKERS: {first 2 issues, comma-separated}
906
- {end if}
907
-
908
- ➡️ Next: {primary_command}
909
- --verbose for spawn tree, TDD details, patterns
1145
+ If `$TMUX` is set, also render the final swarm display:
1146
+ ```bash
1147
+ bash .aether/aether-utils.sh swarm-display-text "$build_id"
910
1148
  ```
911
1149
 
912
- **Status icon logic:** completed+proceed = checkmark, blockers = warning, failed = X
1150
+ **Display BUILD SUMMARY (always shown, replaces compact/verbose split):**
913
1151
 
914
- **Primary command logic:**
915
- - completed + proceed: `/ant:continue`
916
- - has blockers: `/ant:flags`
917
- - failed: `/ant:swarm`
918
-
919
- **If verbose_mode = true (full output):**
1152
+ Calculate `total_tools` by summing `tool_count` from all worker return JSONs (builders + watcher + chaos).
1153
+ Calculate `elapsed` using `build_started_at_epoch` (epoch integer captured at Step 5 start): `$(( $(date +%s) - build_started_at_epoch ))` formatted as Xm Ys.
920
1154
 
921
1155
  ```
922
- 🔨🐜🏗️🐜🔨 ═══════════════════════════════════════════════════
923
- P H A S E {id} C O M P L E T E
924
- ═══════════════════════════════════════════════════ 🔨🐜🏗️🐜🔨
1156
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1157
+ B U I L D S U M M A R Y
1158
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1159
+ Phase {id}: {name}
1160
+ Pattern: {selected_pattern}
925
1161
 
926
- 📍 Phase {id}: {name}
927
- 📊 Status: {status}
928
- 💾 Git Checkpoint: {commit_hash}
929
-
930
- 📝 Summary:
931
- {summary from synthesis}
932
-
933
- 🐜 Colony Work Tree:
934
- 👑Queen
935
- {for each spawn in spawn_tree:}
936
- ├── {caste_emoji}{ant_name}: {task} [{status}]
937
- {end for}
938
-
939
- ✅ Tasks Completed:
940
- {for each task in tasks_completed:}
941
- 🐜 {task_id}: done
942
- {end for}
943
- {for each task in tasks_failed:}
944
- ❌ {task_id}: failed
945
- {end for}
946
-
947
- 📁 Files: {files_created count} created, {files_modified count} modified
948
-
949
- {if tdd.tests_added > 0:}
950
- 🧪 TDD: {tdd.cycles_completed} cycles | {tdd.tests_added} tests | {tdd.coverage_percent}% coverage
951
- {end if}
1162
+ Workers: {pass_count} passed {fail_count} failed ({total} total)
1163
+ Tools: {total_tools} calls across all workers
1164
+ Duration: {elapsed}
952
1165
 
953
- {if learning.patterns_observed not empty:}
954
- 🧠 Patterns Learned:
955
- {for each pattern in learning.patterns_observed:}
956
- 🐜 {pattern.trigger} {pattern.action}
957
- {end for}
958
- {end if}
1166
+ {if fail_count > 0:}
1167
+ Failed:
1168
+ {for each failed worker:}
1169
+ {caste_emoji} {Ant-Name}: {task_description} ✗ ({failure_reason} after {tool_count} tools)
1170
+ {end for}
959
1171
 
960
- {if debugging.issues_encountered > 0:}
961
- 🔧 Debugging: {debugging.issues_resolved}/{debugging.issues_encountered} resolved
1172
+ Retry: /ant:swarm to auto-repair failed tasks, or /ant:flags to review blockers
962
1173
  {end if}
1174
+ ```
963
1175
 
964
- 🤖 Model Routing:
965
- {for each spawn in spawn_tree where model_context exists:}
966
- {caste_emoji}{ant_name}: {model_context.assigned} {if model_context.assigned matches caste expectation:}✓{else}⚠️{end if}
967
- {end for}
968
- Proxy: {if proxy_healthy:}✓ Healthy @ http://localhost:4000{else}✗ Not running (using default model){end if}
969
-
970
- 🐜 Next Steps:
971
- {if synthesis.status == "completed" AND verification.recommendation == "proceed":}
972
- /ant:continue ➡️ Advance to next phase
973
- /ant:feedback 💬 Give feedback first
974
- {else if synthesis.status == "failed" OR verification.recommendation == "fix_required":}
975
- ⚠️ BLOCKERS DETECTED - Cannot proceed until resolved
976
- /ant:flags 🚩 View blockers
977
- /ant:swarm 🔥 Auto-fix issues
978
- {end if}
1176
+ **If verbose_mode is true**, additionally show the spawn tree and TDD details after the BUILD SUMMARY block (keep the existing verbose-only sections: Colony Work Tree, Tasks Completed, TDD, Patterns Learned, Debugging, Model Routing). Prepend with:
1177
+ ```
1178
+ ━━ Details (--verbose) ━━
1179
+ ```
979
1180
 
980
- 💾 State persisted safe to /clear, then run /ant:continue
1181
+ After displaying the BUILD SUMMARY (and optional verbose details), display Next Steps based on synthesis results:
1182
+ ```bash
1183
+ state=$(jq -r '.state // "IDLE"' .aether/data/COLONY_STATE.json 2>/dev/null || echo "IDLE")
1184
+ current_phase=$(jq -r '.current_phase // 0' .aether/data/COLONY_STATE.json 2>/dev/null || echo "0")
1185
+ total_phases=$(jq -r '.plan.phases | length' .aether/data/COLONY_STATE.json 2>/dev/null || echo "0")
1186
+ bash .aether/aether-utils.sh print-next-up "$state" "$current_phase" "$total_phases"
981
1187
  ```
982
1188
 
983
- **Conditional Next Steps:** The suggestions above are based on actual worker results. If verification failed or blockers exist, `/ant:continue` is NOT suggested.
1189
+ **Routing Note:** The state-based Next Up block above routes based on colony state. If verification failed or blockers exist, review `/ant:flags` before continuing.
984
1190
 
985
1191
  **IMPORTANT:** Build does NOT update task statuses or advance state. Run `/ant:continue` to:
986
1192
  - Mark tasks as completed
987
1193
  - Extract learnings
988
1194
  - Advance to next phase
1195
+
1196
+ ### Step 8: Update Session
1197
+
1198
+ Update the session tracking file to enable `/ant:resume` after context clear:
1199
+
1200
+ ```bash
1201
+ bash .aether/aether-utils.sh session-update "/ant:build {phase_id}" "/ant:continue" "Phase {phase_id} build completed: {synthesis.status}"
1202
+ ```