aether-colony 5.0.0 → 5.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (317) hide show
  1. package/.aether/aether-utils.sh +3226 -3345
  2. package/.aether/agents-claude/aether-ambassador.md +265 -0
  3. package/.aether/agents-claude/aether-archaeologist.md +327 -0
  4. package/.aether/agents-claude/aether-architect.md +236 -0
  5. package/.aether/agents-claude/aether-auditor.md +271 -0
  6. package/.aether/agents-claude/aether-builder.md +224 -0
  7. package/.aether/agents-claude/aether-chaos.md +269 -0
  8. package/.aether/agents-claude/aether-chronicler.md +305 -0
  9. package/.aether/agents-claude/aether-gatekeeper.md +330 -0
  10. package/.aether/agents-claude/aether-includer.md +374 -0
  11. package/.aether/agents-claude/aether-keeper.md +272 -0
  12. package/.aether/agents-claude/aether-measurer.md +322 -0
  13. package/.aether/agents-claude/aether-oracle.md +237 -0
  14. package/.aether/agents-claude/aether-probe.md +211 -0
  15. package/.aether/agents-claude/aether-queen.md +330 -0
  16. package/.aether/agents-claude/aether-route-setter.md +178 -0
  17. package/.aether/agents-claude/aether-sage.md +418 -0
  18. package/.aether/agents-claude/aether-scout.md +179 -0
  19. package/.aether/agents-claude/aether-surveyor-disciplines.md +417 -0
  20. package/.aether/agents-claude/aether-surveyor-nest.md +355 -0
  21. package/.aether/agents-claude/aether-surveyor-pathogens.md +289 -0
  22. package/.aether/agents-claude/aether-surveyor-provisions.md +360 -0
  23. package/.aether/agents-claude/aether-tracker.md +270 -0
  24. package/.aether/agents-claude/aether-watcher.md +280 -0
  25. package/.aether/agents-claude/aether-weaver.md +248 -0
  26. package/.aether/commands/archaeology.yaml +653 -0
  27. package/.aether/commands/build.yaml +1221 -0
  28. package/.aether/commands/chaos.yaml +653 -0
  29. package/.aether/commands/colonize.yaml +442 -0
  30. package/.aether/commands/continue.yaml +1484 -0
  31. package/.aether/commands/council.yaml +509 -0
  32. package/.aether/commands/data-clean.yaml +80 -0
  33. package/.aether/commands/dream.yaml +275 -0
  34. package/.aether/commands/entomb.yaml +863 -0
  35. package/.aether/commands/export-signals.yaml +64 -0
  36. package/.aether/commands/feedback.yaml +158 -0
  37. package/.aether/commands/flag.yaml +160 -0
  38. package/.aether/commands/flags.yaml +177 -0
  39. package/.aether/commands/focus.yaml +112 -0
  40. package/.aether/commands/help.yaml +167 -0
  41. package/.aether/commands/history.yaml +137 -0
  42. package/.aether/commands/import-signals.yaml +79 -0
  43. package/.aether/commands/init.yaml +502 -0
  44. package/.aether/commands/insert-phase.yaml +102 -0
  45. package/.aether/commands/interpret.yaml +285 -0
  46. package/.aether/commands/lay-eggs.yaml +224 -0
  47. package/.aether/commands/maturity.yaml +122 -0
  48. package/.aether/commands/memory-details.yaml +74 -0
  49. package/.aether/commands/migrate-state.yaml +174 -0
  50. package/.aether/commands/oracle.yaml +1224 -0
  51. package/.aether/commands/organize.yaml +446 -0
  52. package/.aether/commands/patrol.yaml +621 -0
  53. package/.aether/commands/pause-colony.yaml +424 -0
  54. package/.aether/commands/phase.yaml +124 -0
  55. package/.aether/commands/pheromones.yaml +153 -0
  56. package/.aether/commands/plan.yaml +1364 -0
  57. package/.aether/commands/preferences.yaml +63 -0
  58. package/.aether/commands/quick.yaml +104 -0
  59. package/.aether/commands/redirect.yaml +123 -0
  60. package/.aether/commands/resume-colony.yaml +375 -0
  61. package/.aether/commands/resume.yaml +407 -0
  62. package/.aether/commands/run.yaml +229 -0
  63. package/.aether/commands/seal.yaml +1214 -0
  64. package/.aether/commands/skill-create.yaml +337 -0
  65. package/.aether/commands/status.yaml +408 -0
  66. package/.aether/commands/swarm.yaml +352 -0
  67. package/.aether/commands/tunnels.yaml +814 -0
  68. package/.aether/commands/update.yaml +131 -0
  69. package/.aether/commands/verify-castes.yaml +159 -0
  70. package/.aether/commands/watch.yaml +454 -0
  71. package/.aether/docs/INCIDENT_TEMPLATE.md +32 -0
  72. package/.aether/docs/QUEEN-SYSTEM.md +11 -11
  73. package/.aether/docs/README.md +32 -2
  74. package/.aether/docs/command-playbooks/README.md +23 -0
  75. package/.aether/docs/command-playbooks/build-complete.md +349 -0
  76. package/.aether/docs/command-playbooks/build-context.md +282 -0
  77. package/.aether/docs/command-playbooks/build-full.md +1683 -0
  78. package/.aether/docs/command-playbooks/build-prep.md +284 -0
  79. package/.aether/docs/command-playbooks/build-verify.md +405 -0
  80. package/.aether/docs/command-playbooks/build-wave.md +749 -0
  81. package/.aether/docs/command-playbooks/continue-advance.md +524 -0
  82. package/.aether/docs/command-playbooks/continue-finalize.md +447 -0
  83. package/.aether/docs/command-playbooks/continue-full.md +1725 -0
  84. package/.aether/docs/command-playbooks/continue-gates.md +686 -0
  85. package/.aether/docs/command-playbooks/continue-verify.md +407 -0
  86. package/.aether/docs/context-continuity.md +84 -0
  87. package/.aether/docs/disciplines/DISCIPLINES.md +9 -7
  88. package/.aether/docs/error-codes.md +1 -1
  89. package/.aether/docs/known-issues.md +34 -173
  90. package/.aether/docs/pheromones.md +86 -6
  91. package/.aether/docs/plans/pheromone-display-plan.md +257 -0
  92. package/.aether/docs/queen-commands.md +10 -9
  93. package/.aether/docs/source-of-truth-map.md +132 -0
  94. package/.aether/docs/xml-utilities.md +47 -0
  95. package/.aether/rules/aether-colony.md +23 -13
  96. package/.aether/scripts/incident-test-add.sh +47 -0
  97. package/.aether/scripts/weekly-audit.sh +79 -0
  98. package/.aether/skills/.index.json +649 -0
  99. package/.aether/skills/colony/.manifest.json +16 -0
  100. package/.aether/skills/colony/build-discipline/SKILL.md +78 -0
  101. package/.aether/skills/colony/colony-interaction/SKILL.md +56 -0
  102. package/.aether/skills/colony/colony-lifecycle/SKILL.md +77 -0
  103. package/.aether/skills/colony/colony-visuals/SKILL.md +112 -0
  104. package/.aether/skills/colony/context-management/SKILL.md +80 -0
  105. package/.aether/skills/colony/error-presentation/SKILL.md +99 -0
  106. package/.aether/skills/colony/pheromone-protocol/SKILL.md +79 -0
  107. package/.aether/skills/colony/pheromone-visibility/SKILL.md +81 -0
  108. package/.aether/skills/colony/state-safety/SKILL.md +84 -0
  109. package/.aether/skills/colony/worker-priming/SKILL.md +82 -0
  110. package/.aether/skills/domain/.manifest.json +24 -0
  111. package/.aether/skills/domain/README.md +33 -0
  112. package/.aether/skills/domain/django/SKILL.md +49 -0
  113. package/.aether/skills/domain/docker/SKILL.md +52 -0
  114. package/.aether/skills/domain/golang/SKILL.md +52 -0
  115. package/.aether/skills/domain/graphql/SKILL.md +51 -0
  116. package/.aether/skills/domain/html-css/SKILL.md +48 -0
  117. package/.aether/skills/domain/nextjs/SKILL.md +45 -0
  118. package/.aether/skills/domain/nodejs/SKILL.md +53 -0
  119. package/.aether/skills/domain/postgresql/SKILL.md +53 -0
  120. package/.aether/skills/domain/prisma/SKILL.md +59 -0
  121. package/.aether/skills/domain/python/SKILL.md +50 -0
  122. package/.aether/skills/domain/rails/SKILL.md +52 -0
  123. package/.aether/skills/domain/react/SKILL.md +45 -0
  124. package/.aether/skills/domain/rest-api/SKILL.md +58 -0
  125. package/.aether/skills/domain/svelte/SKILL.md +47 -0
  126. package/.aether/skills/domain/tailwind/SKILL.md +45 -0
  127. package/.aether/skills/domain/testing/SKILL.md +53 -0
  128. package/.aether/skills/domain/typescript/SKILL.md +58 -0
  129. package/.aether/skills/domain/vue/SKILL.md +49 -0
  130. package/.aether/templates/QUEEN.md.template +23 -41
  131. package/.aether/templates/colony-state-reset.jq.template +1 -0
  132. package/.aether/templates/colony-state.template.json +4 -0
  133. package/.aether/templates/learning-observations.template.json +6 -0
  134. package/.aether/templates/midden.template.json +13 -0
  135. package/.aether/templates/pheromones.template.json +6 -0
  136. package/.aether/templates/session.template.json +9 -0
  137. package/.aether/utils/atomic-write.sh +63 -17
  138. package/.aether/utils/chamber-utils.sh +145 -2
  139. package/.aether/utils/council.sh +425 -0
  140. package/.aether/utils/emoji-audit.sh +166 -0
  141. package/.aether/utils/error-handler.sh +21 -7
  142. package/.aether/utils/file-lock.sh +182 -27
  143. package/.aether/utils/flag.sh +278 -0
  144. package/.aether/utils/hive.sh +572 -0
  145. package/.aether/utils/immune.sh +508 -0
  146. package/.aether/utils/learning.sh +1928 -0
  147. package/.aether/utils/midden.sh +520 -0
  148. package/.aether/utils/oracle/oracle.md +168 -0
  149. package/.aether/utils/oracle/oracle.sh +1023 -0
  150. package/.aether/utils/pheromone.sh +2029 -0
  151. package/.aether/utils/queen.sh +1710 -0
  152. package/.aether/utils/scan.sh +860 -0
  153. package/.aether/utils/semantic-cli.sh +10 -8
  154. package/.aether/utils/session.sh +816 -0
  155. package/.aether/utils/skills.sh +509 -0
  156. package/.aether/utils/spawn-tree.sh +103 -271
  157. package/.aether/utils/spawn.sh +260 -0
  158. package/.aether/utils/state-api.sh +389 -0
  159. package/.aether/utils/state-loader.sh +8 -6
  160. package/.aether/utils/suggest.sh +611 -0
  161. package/.aether/utils/swarm-display.sh +10 -1
  162. package/.aether/utils/swarm.sh +1004 -0
  163. package/.aether/utils/watch-spawn-tree.sh +11 -2
  164. package/.aether/utils/xml-compose.sh +2 -2
  165. package/.aether/utils/xml-convert.sh +9 -5
  166. package/.aether/utils/xml-core.sh +5 -9
  167. package/.aether/utils/xml-query.sh +4 -4
  168. package/.aether/workers.md +86 -67
  169. package/.claude/agents/ant/aether-ambassador.md +2 -1
  170. package/.claude/agents/ant/aether-archaeologist.md +6 -1
  171. package/.claude/agents/ant/aether-architect.md +236 -0
  172. package/.claude/agents/ant/aether-auditor.md +6 -1
  173. package/.claude/agents/ant/aether-builder.md +38 -1
  174. package/.claude/agents/ant/aether-chaos.md +2 -1
  175. package/.claude/agents/ant/aether-chronicler.md +1 -0
  176. package/.claude/agents/ant/aether-gatekeeper.md +6 -1
  177. package/.claude/agents/ant/aether-includer.md +1 -0
  178. package/.claude/agents/ant/aether-keeper.md +1 -0
  179. package/.claude/agents/ant/aether-measurer.md +6 -1
  180. package/.claude/agents/ant/aether-oracle.md +237 -0
  181. package/.claude/agents/ant/aether-probe.md +2 -1
  182. package/.claude/agents/ant/aether-queen.md +6 -1
  183. package/.claude/agents/ant/aether-route-setter.md +6 -1
  184. package/.claude/agents/ant/aether-sage.md +68 -3
  185. package/.claude/agents/ant/aether-scout.md +38 -1
  186. package/.claude/agents/ant/aether-surveyor-disciplines.md +2 -1
  187. package/.claude/agents/ant/aether-surveyor-nest.md +2 -1
  188. package/.claude/agents/ant/aether-surveyor-pathogens.md +2 -1
  189. package/.claude/agents/ant/aether-surveyor-provisions.md +2 -1
  190. package/.claude/agents/ant/aether-tracker.md +6 -1
  191. package/.claude/agents/ant/aether-watcher.md +37 -1
  192. package/.claude/agents/ant/aether-weaver.md +2 -1
  193. package/.claude/commands/ant/archaeology.md +1 -8
  194. package/.claude/commands/ant/build.md +43 -1159
  195. package/.claude/commands/ant/chaos.md +1 -14
  196. package/.claude/commands/ant/colonize.md +3 -14
  197. package/.claude/commands/ant/continue.md +40 -1026
  198. package/.claude/commands/ant/council.md +213 -15
  199. package/.claude/commands/ant/data-clean.md +81 -0
  200. package/.claude/commands/ant/dream.md +12 -9
  201. package/.claude/commands/ant/entomb.md +62 -87
  202. package/.claude/commands/ant/export-signals.md +57 -0
  203. package/.claude/commands/ant/feedback.md +18 -0
  204. package/.claude/commands/ant/flag.md +12 -0
  205. package/.claude/commands/ant/flags.md +22 -8
  206. package/.claude/commands/ant/focus.md +18 -0
  207. package/.claude/commands/ant/help.md +40 -8
  208. package/.claude/commands/ant/history.md +3 -0
  209. package/.claude/commands/ant/import-signals.md +71 -0
  210. package/.claude/commands/ant/init.md +349 -191
  211. package/.claude/commands/ant/insert-phase.md +105 -0
  212. package/.claude/commands/ant/interpret.md +11 -0
  213. package/.claude/commands/ant/lay-eggs.md +167 -158
  214. package/.claude/commands/ant/maturity.md +22 -11
  215. package/.claude/commands/ant/memory-details.md +77 -0
  216. package/.claude/commands/ant/migrate-state.md +6 -0
  217. package/.claude/commands/ant/oracle.md +317 -62
  218. package/.claude/commands/ant/organize.md +10 -5
  219. package/.claude/commands/ant/patrol.md +620 -0
  220. package/.claude/commands/ant/pause-colony.md +8 -22
  221. package/.claude/commands/ant/phase.md +26 -37
  222. package/.claude/commands/ant/pheromones.md +156 -0
  223. package/.claude/commands/ant/plan.md +199 -50
  224. package/.claude/commands/ant/preferences.md +65 -0
  225. package/.claude/commands/ant/quick.md +100 -0
  226. package/.claude/commands/ant/redirect.md +18 -0
  227. package/.claude/commands/ant/resume-colony.md +37 -22
  228. package/.claude/commands/ant/resume.md +60 -7
  229. package/.claude/commands/ant/run.md +231 -0
  230. package/.claude/commands/ant/seal.md +506 -78
  231. package/.claude/commands/ant/skill-create.md +286 -0
  232. package/.claude/commands/ant/status.md +171 -1
  233. package/.claude/commands/ant/swarm.md +11 -23
  234. package/.claude/commands/ant/tunnels.md +1 -0
  235. package/.claude/commands/ant/update.md +58 -135
  236. package/.claude/commands/ant/verify-castes.md +90 -42
  237. package/.claude/commands/ant/watch.md +1 -0
  238. package/.opencode/agents/aether-ambassador.md +1 -1
  239. package/.opencode/agents/aether-architect.md +133 -0
  240. package/.opencode/agents/aether-builder.md +3 -3
  241. package/.opencode/agents/aether-oracle.md +137 -0
  242. package/.opencode/agents/aether-queen.md +1 -1
  243. package/.opencode/agents/aether-route-setter.md +1 -1
  244. package/.opencode/agents/aether-scout.md +1 -1
  245. package/.opencode/agents/aether-surveyor-disciplines.md +6 -1
  246. package/.opencode/agents/aether-surveyor-nest.md +6 -1
  247. package/.opencode/agents/aether-surveyor-pathogens.md +6 -1
  248. package/.opencode/agents/aether-surveyor-provisions.md +6 -1
  249. package/.opencode/agents/aether-tracker.md +1 -1
  250. package/.opencode/agents/aether-watcher.md +1 -1
  251. package/.opencode/agents/aether-weaver.md +1 -1
  252. package/.opencode/commands/ant/archaeology.md +7 -14
  253. package/.opencode/commands/ant/build.md +54 -88
  254. package/.opencode/commands/ant/chaos.md +7 -24
  255. package/.opencode/commands/ant/colonize.md +10 -17
  256. package/.opencode/commands/ant/continue.md +595 -66
  257. package/.opencode/commands/ant/council.md +150 -18
  258. package/.opencode/commands/ant/data-clean.md +77 -0
  259. package/.opencode/commands/ant/dream.md +15 -17
  260. package/.opencode/commands/ant/entomb.md +28 -18
  261. package/.opencode/commands/ant/export-signals.md +54 -0
  262. package/.opencode/commands/ant/feedback.md +24 -5
  263. package/.opencode/commands/ant/flag.md +16 -4
  264. package/.opencode/commands/ant/flags.md +24 -10
  265. package/.opencode/commands/ant/focus.md +22 -5
  266. package/.opencode/commands/ant/help.md +41 -8
  267. package/.opencode/commands/ant/history.md +9 -0
  268. package/.opencode/commands/ant/import-signals.md +68 -0
  269. package/.opencode/commands/ant/init.md +396 -154
  270. package/.opencode/commands/ant/insert-phase.md +111 -0
  271. package/.opencode/commands/ant/interpret.md +16 -0
  272. package/.opencode/commands/ant/lay-eggs.md +184 -112
  273. package/.opencode/commands/ant/maturity.md +18 -2
  274. package/.opencode/commands/ant/memory-details.md +83 -0
  275. package/.opencode/commands/ant/migrate-state.md +12 -0
  276. package/.opencode/commands/ant/oracle.md +322 -67
  277. package/.opencode/commands/ant/organize.md +14 -12
  278. package/.opencode/commands/ant/patrol.md +626 -0
  279. package/.opencode/commands/ant/pause-colony.md +12 -29
  280. package/.opencode/commands/ant/phase.md +30 -40
  281. package/.opencode/commands/ant/pheromones.md +162 -0
  282. package/.opencode/commands/ant/plan.md +210 -57
  283. package/.opencode/commands/ant/preferences.md +71 -0
  284. package/.opencode/commands/ant/quick.md +91 -0
  285. package/.opencode/commands/ant/redirect.md +22 -5
  286. package/.opencode/commands/ant/resume-colony.md +41 -29
  287. package/.opencode/commands/ant/resume.md +80 -20
  288. package/.opencode/commands/ant/run.md +237 -0
  289. package/.opencode/commands/ant/seal.md +230 -25
  290. package/.opencode/commands/ant/skill-create.md +63 -0
  291. package/.opencode/commands/ant/status.md +125 -30
  292. package/.opencode/commands/ant/swarm.md +3 -345
  293. package/.opencode/commands/ant/tunnels.md +3 -9
  294. package/.opencode/commands/ant/update.md +63 -127
  295. package/.opencode/commands/ant/verify-castes.md +96 -42
  296. package/.opencode/commands/ant/watch.md +7 -0
  297. package/CHANGELOG.md +368 -1
  298. package/README.md +195 -324
  299. package/bin/cli.js +236 -429
  300. package/bin/generate-commands.js +186 -0
  301. package/bin/generate-commands.sh +128 -89
  302. package/bin/lib/spawn-logger.js +0 -15
  303. package/bin/lib/update-transaction.js +285 -35
  304. package/bin/npx-install.js +178 -0
  305. package/bin/validate-package.sh +85 -3
  306. package/package.json +16 -4
  307. package/.aether/CONTEXT.md +0 -160
  308. package/.aether/docs/QUEEN.md +0 -84
  309. package/.aether/exchange/colony-registry.xml +0 -11
  310. package/.aether/exchange/pheromones.xml +0 -87
  311. package/.aether/exchange/queen-wisdom.xml +0 -14
  312. package/.aether/model-profiles.yaml +0 -100
  313. package/.aether/utils/spawn-with-model.sh +0 -56
  314. package/bin/lib/model-profiles.js +0 -445
  315. package/bin/lib/model-verify.js +0 -288
  316. package/bin/lib/proxy-health.js +0 -253
  317. package/bin/lib/telemetry.js +0 -441
@@ -0,0 +1,284 @@
1
+ ---
2
+ name: ant:build
3
+ description: "🔨🐜🏗️🐜🔨 Build a phase with pure emergence - colony self-organizes and completes tasks"
4
+ ---
5
+
6
+ You are the **Queen**. You DIRECTLY spawn multiple workers — do not delegate to a single Prime Worker.
7
+
8
+ ## Pheromone Suggestions
9
+
10
+ At build start, the colony analyzes the codebase for patterns that might benefit
11
+ from pheromone signals (complex files, TODOs, debug artifacts, etc.). Suggested
12
+ signals are presented for approval and written as FOCUS pheromones if approved.
13
+
14
+ Use `--no-suggest` to skip this analysis.
15
+
16
+ The phase to build is: `$ARGUMENTS`
17
+
18
+ ## Instructions
19
+
20
+ ### Context Confirmation Rule (CRITICAL)
21
+
22
+ **Before switching to a different colony directory, you MUST confirm with the user.**
23
+
24
+ When the user mentions a colony name that doesn't match the current directory:
25
+ 1. State clearly: "You're currently in [Current Directory/Colony Name]"
26
+ 2. Ask: "Did you mean to switch to [Other Colony], or continue here?"
27
+ 3. Wait for confirmation — DO NOT proceed until the user clarifies
28
+
29
+ **Example:**
30
+ > User: "THE FUCKING ANIMATION COLONY DO THE NEXT BUILD"
31
+ >
32
+ > Assistant: "You're currently in SonoTherapie (ACF/WPML site). Did you mean:
33
+ > 1. Continue with SonoTherapie (which has animated hero sections)
34
+ > 2. Switch to AnalogWave (NEW SITE)
35
+ >
36
+ > Which would you like?"
37
+
38
+ This prevents accidental context switches when the user is frustrated or uses imprecise language.
39
+
40
+ <failure_modes>
41
+ ### Wave Failure Mid-Build
42
+ If a worker fails during a build wave:
43
+ - Do NOT continue to next wave (failed dependencies will cascade)
44
+ - Report which worker failed, what task it was on, and what was attempted
45
+ - Options: (1) Retry the failed task, (2) Skip and continue with remaining tasks, (3) Abort build
46
+
47
+ ### Partial File Writes
48
+ If a builder crashes mid-write:
49
+ - Check git status for uncommitted partial changes
50
+ - If partial changes exist, offer: (1) Review and keep, (2) Revert with git checkout, (3) Stash for later
51
+
52
+ ### State Corruption
53
+ If COLONY_STATE.json becomes invalid during build:
54
+ - STOP all workers immediately
55
+ - Do not attempt to fix state automatically
56
+ - Report the issue and offer to restore from last known good state
57
+ </failure_modes>
58
+
59
+ <success_criteria>
60
+ Command is complete when:
61
+ - All waves executed in order with no skipped dependencies
62
+ - Each worker's task output is verified (files exist, tests pass)
63
+ - COLONY_STATE.json reflects completed phase progress
64
+ - Build summary reports all workers' outcomes
65
+ </success_criteria>
66
+
67
+ <read_only>
68
+ Do not touch during build:
69
+ - .aether/dreams/ (user notes)
70
+ - .aether/chambers/ (archived colonies)
71
+ - .env* files
72
+ - .claude/settings.json
73
+ - .github/workflows/
74
+ - Other agents' config files (only modify files assigned to the current build task)
75
+ </read_only>
76
+
77
+ ### Step 0.6: Verify LiteLLM Proxy
78
+
79
+ Check that the LiteLLM proxy is running for model routing:
80
+
81
+ Run using the Bash tool with description "Checking model proxy...":
82
+ ```bash
83
+ curl -s http://localhost:4000/health | grep -q "healthy" && echo "Proxy healthy" || echo "Proxy not running - workers will use default model"
84
+ ```
85
+
86
+ If proxy is not healthy, log a warning but continue (workers will fall back to default routing).
87
+
88
+ ### Step 0.5: Load Colony State
89
+
90
+ Run using the Bash tool with description "Loading colony state...": `bash .aether/aether-utils.sh load-state`
91
+
92
+ If the command fails (non-zero exit or JSON has ok: false):
93
+ 1. Parse error JSON
94
+ 2. If error code is E_FILE_NOT_FOUND: "No colony initialized. Run /ant:init first." and stop
95
+ 3. If validation error: Display error details with recovery suggestion and stop
96
+ 4. For other errors: Display generic error and suggest /ant:status for diagnostics
97
+
98
+ If successful:
99
+ 1. Parse the state JSON from result field
100
+ 2. Check if goal is null - if so: "No colony initialized. Run /ant:init first." and stop
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
103
+ 4. Display brief resumption context:
104
+ ```
105
+ 🔄 Resuming: Phase X - Name
106
+ ```
107
+ (If HANDOFF.md exists, this provides orientation before the build proceeds)
108
+
109
+ After displaying context, run using the Bash tool with description "Releasing colony lock...": `bash .aether/aether-utils.sh unload-state` to release the lock.
110
+
111
+ ### Step 1: Validate + Read State
112
+
113
+ **Parse $ARGUMENTS:**
114
+ 1. Extract the phase number (first argument)
115
+ 2. Check remaining arguments for flags:
116
+ - If contains `--verbose` or `-v`: set `verbose_mode = true`
117
+ - If contains `--no-visual`: set `visual_mode = false` (visual is ON by default)
118
+ - If contains `--no-suggest`: set `suggest_enabled = false` (suggestions are ON by default)
119
+ - If contains `--depth <level>`: set `cli_depth_override = <level>`
120
+ - Otherwise: set `visual_mode = true`, `suggest_enabled = true` (defaults)
121
+
122
+ If the phase number is empty or not a number:
123
+
124
+ ```
125
+ Usage: /ant:build <phase_number> [--verbose|-v] [--no-visual] [--no-suggest] [--depth <level>]
126
+
127
+ Options:
128
+ --verbose, -v Show full completion details (spawn tree, TDD, patterns)
129
+ --no-visual Disable real-time visual display (visual is on by default)
130
+ --no-suggest Skip pheromone suggestion analysis
131
+ --depth <level> Set colony depth for this build (light|standard|deep|full)
132
+
133
+ Examples:
134
+ /ant:build 1 Build Phase 1 (with visual display)
135
+ /ant:build 1 --verbose Build Phase 1 (full details + visual)
136
+ /ant:build 1 --no-visual Build Phase 1 without visual display
137
+ /ant:build 1 --no-suggest Build Phase 1 without pheromone suggestions
138
+ /ant:build 1 --depth deep Build Phase 1 with thorough investigation
139
+ ```
140
+
141
+ Stop here.
142
+
143
+ **Set colony depth (if --depth flag provided):**
144
+ If `cli_depth_override` is set:
145
+ 1. Run using the Bash tool with description "Setting colony depth...": `bash .aether/aether-utils.sh colony-depth set "$cli_depth_override"`
146
+ 2. Parse JSON result - if `.ok` is false:
147
+ - Display: `Error: Invalid depth "$cli_depth_override". Use: light, standard, deep, full`
148
+ - Stop here
149
+ 3. If valid: Display `Colony depth: {level}`
150
+
151
+ **Read colony depth:**
152
+
153
+ Run using the Bash tool with description "Reading colony depth...":
154
+ ```bash
155
+ depth_result=$(bash .aether/aether-utils.sh colony-depth get 2>/dev/null || echo '{"ok":true,"result":{"depth":"standard","source":"default"}}')
156
+ colony_depth=$(echo "$depth_result" | jq -r '.result.depth // "standard"')
157
+ depth_source=$(echo "$depth_result" | jq -r '.result.source // "default"')
158
+ echo "colony_depth=$colony_depth"
159
+ echo "depth_source=$depth_source"
160
+ ```
161
+
162
+ Store `colony_depth` as cross-stage state for use by build-wave.md and build-verify.md.
163
+
164
+ Display depth with label:
165
+ ```
166
+ Depth: {colony_depth} ({label})
167
+ ```
168
+
169
+ Where label maps:
170
+ - light -> "Builder only -- fastest"
171
+ - standard -> "Builder + Scout -- balanced"
172
+ - deep -> "Builder + Scout + Oracle -- thorough"
173
+ - full -> "All agents -- most thorough"
174
+
175
+ If `colony_depth` is "standard" and `depth_source` is "default" (user never explicitly set it), also display:
176
+ ```
177
+ (Tip: use --depth deep for Oracle research, or --depth light for fast builds)
178
+ ```
179
+
180
+ **Auto-upgrade old state:**
181
+ If `version` field is missing, "1.0", or "2.0":
182
+ 1. Preserve: `goal`, `state`, `current_phase`, `plan.phases`
183
+ 2. Write upgraded v3.0 state (same structure as /ant:init but preserving data)
184
+ 3. Output: `State auto-upgraded to v3.0`
185
+ 4. Continue with command.
186
+
187
+ Extract:
188
+ - `goal`, `state`, `current_phase` from top level
189
+ - `plan.phases` for phase data
190
+ - `errors.records` for error context
191
+ - `memory` for decisions/learnings
192
+
193
+ **Validate:**
194
+ - If `plan.phases` is empty -> output `No project plan. Run /ant:plan first.` and stop.
195
+ - Find the phase matching the requested ID. If not found -> output `Phase {id} not found.` and stop.
196
+ - If the phase status is `"completed"` -> output `Phase {id} already completed.` and stop.
197
+
198
+ ### Step 1.5: Blocker Advisory (Non-blocking)
199
+
200
+ Check for unresolved blocker flags on the requested phase:
201
+
202
+ Run using the Bash tool with description "Checking for blockers...":
203
+ ```bash
204
+ bash .aether/aether-utils.sh flag-check-blockers {phase_number}
205
+ ```
206
+
207
+ Parse the JSON result (`.result.blockers`):
208
+
209
+ - **If blockers == 0:** Display nothing (or optionally a brief `No active blockers for Phase {id}.` line). Proceed to Step 2.
210
+ - **If blockers > 0:** Retrieve blocker details:
211
+ Run using the Bash tool with description "Loading blocker details...":
212
+ ```bash
213
+ bash .aether/aether-utils.sh flag-list --type blocker --phase {phase_number}
214
+ ```
215
+ Parse `.result.flags` and display an advisory warning:
216
+ ```
217
+ ⚠️ BLOCKER ADVISORY: {blockers} unresolved blocker(s) for Phase {id}
218
+ {for each flag in result.flags:}
219
+ - [{flag.id}] {flag.title}
220
+ {end for}
221
+
222
+ Consider reviewing with /ant:flags or auto-fixing with /ant:swarm before building.
223
+ Proceeding anyway...
224
+ ```
225
+ **This is advisory only — do NOT stop.** Continue to Step 2 regardless.
226
+
227
+ ### Step 2: Update State
228
+
229
+ Read then update `.aether/data/COLONY_STATE.json`:
230
+ - Set `state` to `"EXECUTING"`
231
+ - Set `current_phase` to the phase number
232
+ - Set the phase's `status` to `"in_progress"` in `plan.phases[N]`
233
+ - Add `build_started_at` field with current ISO-8601 UTC timestamp
234
+ - Append to `events`: `"<timestamp>|phase_started|build|Phase <id>: <name> started"`
235
+
236
+ If `events` exceeds 100 entries, keep only the last 100.
237
+
238
+ Write COLONY_STATE.json.
239
+
240
+ Validate the state file:
241
+ Run using the Bash tool with description "Validating colony state...":
242
+ ```bash
243
+ bash .aether/aether-utils.sh validate-state colony
244
+ ```
245
+
246
+ ### Step 3: Git Checkpoint
247
+
248
+ Create a git checkpoint for rollback capability.
249
+
250
+ Run using the Bash tool with description "Checking git repository...":
251
+ ```bash
252
+ git rev-parse --git-dir 2>/dev/null
253
+ ```
254
+
255
+ - **If succeeds** (is a git repo):
256
+ 1. Check for changes in Aether-managed directories only: `.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`
258
+ - IMPORTANT: Never use `--include-untracked` — it stashes ALL files including user work!
259
+ - Run using the Bash tool with description "Verifying checkpoint...": `git stash list | head -1 | grep "aether-checkpoint"` — warn if empty
260
+ - Store checkpoint as `{type: "stash", ref: "aether-checkpoint: pre-phase-$PHASE_NUMBER"}`
261
+ 3. **If clean working tree**: Run using the Bash tool with description "Recording HEAD position...": `git rev-parse HEAD`
262
+ - Store checkpoint as `{type: "commit", ref: "$HEAD_HASH"}`
263
+ - **If fails** (not a git repo): Set checkpoint to `{type: "none", ref: "(not a git repo)"}`.
264
+
265
+ Rollback procedure: `git stash pop` (if type is "stash") or `git reset --hard $ref` (if type is "commit").
266
+
267
+ Output header:
268
+
269
+ ```
270
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
271
+ B U I L D I N G P H A S E {id}
272
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
273
+
274
+ 📍 Phase {id}: {name}
275
+ 💾 Git checkpoint saved
276
+ ```
277
+
278
+ Run using the Bash tool with description "Showing phase progress...":
279
+ ```bash
280
+ progress_bar=$(bash .aether/aether-utils.sh generate-progress-bar "$current_phase" "$total_phases" 20 2>/dev/null || echo "")
281
+ if [[ -n "$progress_bar" ]]; then
282
+ echo "[Phase ${current_phase}/${total_phases}] ${progress_bar}"
283
+ fi
284
+ ```
@@ -0,0 +1,405 @@
1
+ ### Step 5.4: Spawn Watcher for Verification
2
+
3
+ **MANDATORY: Always spawn a Watcher — testing must be independent.**
4
+
5
+ **Announce the verification wave:**
6
+ ```
7
+ ━━━ 👁️🐜 V E R I F I C A T I O N ━━━
8
+ ──── 👁️🐜 Spawning {watcher_name} — Independent verification ────
9
+ ```
10
+
11
+ > **Platform note**: In Claude Code, use `Task tool with subagent_type`. In OpenCode, use the equivalent agent spawning mechanism for your platform (e.g., invoke the agent definition from `.opencode/agents/`).
12
+
13
+ Spawn the Watcher using Task tool with `subagent_type="aether-watcher"`, include `description: "👁️ Watcher {Watcher-Name}: Independent verification"` (DO NOT use run_in_background - task blocks until complete):
14
+
15
+ Run using the Bash tool with description "Dispatching watcher...": `bash .aether/aether-utils.sh spawn-log "Queen" "watcher" "{watcher_name}" "Independent verification"`
16
+
17
+ **Load skills for the Watcher role (NON-BLOCKING):**
18
+
19
+ ```bash
20
+ skill_match_result=$(bash .aether/aether-utils.sh skill-match "watcher" "{verification_context}" 2>/dev/null)
21
+ skill_inject_result=$(bash .aether/aether-utils.sh skill-inject "$(echo $skill_match_result | jq -r '.result')" 2>/dev/null)
22
+ skill_section=$(echo "$skill_inject_result" | jq -r '.result.skill_section // ""')
23
+ ```
24
+
25
+ Display: `🧠 Skills loaded for watcher verification`
26
+
27
+ **Watcher Worker Prompt (CLEAN OUTPUT):**
28
+ ```
29
+ You are {Watcher-Name}, a 👁️🐜 Watcher Ant.
30
+
31
+ Verify all work done by Builders in Phase {id}.
32
+
33
+ Files to verify:
34
+ - Created: {list from builder results}
35
+ - Modified: {list from builder results}
36
+
37
+ { research_context if exists }
38
+
39
+ **Phase Research Context (if provided):**
40
+ - Use domain research to verify builders followed recommended patterns and avoided documented gotchas.
41
+ - Check that gotchas listed in research were properly handled.
42
+
43
+ { prompt_section }
44
+
45
+ { skill_section }
46
+
47
+ **IMPORTANT:** When using the Bash tool for activity calls, always include a description parameter:
48
+ - activity-log calls → "Logging {action}..."
49
+ - pheromone-read calls → "Checking colony signals..."
50
+ - spawn-log calls → "Dispatching sub-worker..."
51
+
52
+ Use colony-flavored language, 4-8 words, trailing ellipsis.
53
+
54
+ Verification:
55
+ 1. Check files exist (Read each)
56
+ 2. Run build/type-check
57
+ 3. Run tests if they exist
58
+ 4. Check success criteria: {list}
59
+
60
+ Spawn sub-workers if needed:
61
+ - Log spawn using Bash tool with description
62
+ - Announce: "🐜 Spawning {child} to investigate {issue}"
63
+
64
+ Count your total tool calls (Read + Grep + Edit + Bash + Write) and report as tool_count.
65
+
66
+ Return ONLY this JSON:
67
+ {"ant_name": "{Watcher-Name}", "verification_passed": true|false, "files_verified": [], "issues_found": [], "quality_score": N, "tool_count": 0, "recommendation": "proceed|fix_required"}
68
+ ```
69
+
70
+ ### Step 5.5: Process Watcher Results
71
+
72
+ **Task call returns results directly (no TaskOutput needed).**
73
+
74
+ Validate watcher payload first:
75
+ Run using the Bash tool with description "Validating watcher response...": `bash .aether/aether-utils.sh validate-worker-response watcher '{watcher_json}'`
76
+
77
+ **Parse the Watcher's validated JSON response:** verification_passed, issues_found, quality_score, recommendation
78
+
79
+ **Display Watcher completion line:**
80
+
81
+ For successful verification:
82
+ ```
83
+ 👁️ {Watcher-Name}: Independent verification ({tool_count} tools) ✓
84
+ ```
85
+
86
+ For failed verification:
87
+ ```
88
+ 👁️ {Watcher-Name}: Independent verification ✗ ({issues_found count} issues after {tool_count} tools)
89
+ ```
90
+
91
+ **Store results for synthesis in Step 5.7**
92
+
93
+ ### Step 5.5.1: Measurer Performance Agent (Conditional)
94
+
95
+ **Conditional step — only runs for performance-sensitive phases.**
96
+
97
+ 1. **Check if phase is performance-sensitive:**
98
+
99
+ Extract phase name from COLONY_STATE.json (already loaded in Step 1). Check for performance keywords (case-insensitive):
100
+ - "performance", "optimize", "latency", "throughput", "benchmark", "speed", "memory", "cpu", "efficiency"
101
+
102
+ Run using the Bash tool with description "Checking phase for performance sensitivity...":
103
+ ```bash
104
+ phase_name="{phase_name_from_state}"
105
+ performance_keywords="performance optimize latency throughput benchmark speed memory cpu efficiency"
106
+ is_performance_sensitive="false"
107
+ for keyword in $performance_keywords; do
108
+ if [[ "${phase_name,,}" == *"$keyword"* ]]; then
109
+ is_performance_sensitive="true"
110
+ break
111
+ fi
112
+ done
113
+ echo "{\"is_performance_sensitive\": \"$is_performance_sensitive\", \"phase_name\": \"$phase_name\"}"
114
+ ```
115
+
116
+ Parse the JSON result. If `is_performance_sensitive` is `"false"`:
117
+ - Display: `📊 Measurer: Phase not performance-sensitive — skipping baseline measurement`
118
+ - Skip to Step 5.6 (Chaos Ant)
119
+
120
+ 2. **Check Watcher verification status:**
121
+
122
+ Only spawn Measurer if Watcher verification passed (`verification_passed: true`). If Watcher failed:
123
+ - Display: `📊 Measurer: Watcher verification failed — skipping performance measurement`
124
+ - Skip to Step 5.6 (Chaos Ant)
125
+
126
+ 3. **Generate Measurer name and dispatch:**
127
+
128
+ Run using the Bash tool with description "Naming measurer...": `bash .aether/aether-utils.sh generate-ant-name "measurer"` (store as `{measurer_name}`)
129
+ Run using the Bash tool with description "Dispatching measurer...": `bash .aether/aether-utils.sh spawn-log "Queen" "measurer" "{measurer_name}" "Performance baseline measurement"`
130
+
131
+ Display:
132
+ ```
133
+ ━━━ 📊🐜 M E A S U R E R ━━━
134
+ ──── 📊🐜 Spawning {measurer_name} — establishing performance baselines ────
135
+ ```
136
+
137
+ 4. **Get files to measure:**
138
+
139
+ Use `files_created` and `files_modified` from builder results (already collected in synthesis preparation). Filter for source files only:
140
+ - Include: `.js`, `.ts`, `.sh`, `.py` files
141
+ - Exclude: `.test.js`, `.test.ts`, `.spec.js`, `.spec.ts`, `__tests__/`, config files
142
+
143
+ Store filtered list as `{source_files_to_measure}`.
144
+
145
+ 5. **Spawn Measurer using Task tool:**
146
+
147
+ > **Platform note**: In Claude Code, use `Task tool with subagent_type`. In OpenCode, use the equivalent agent spawning mechanism for your platform (e.g., invoke the agent definition from `.opencode/agents/`).
148
+
149
+ Spawn the Measurer using Task tool with `subagent_type="aether-measurer"`, include `description: "📊 Measurer {Measurer-Name}: Performance baseline measurement"` (DO NOT use run_in_background - task blocks until complete):
150
+
151
+ # FALLBACK: If "Agent type not found", use general-purpose and inject role: "You are a Measurer Ant - performance profiler that benchmarks and identifies bottlenecks."
152
+
153
+ **Measurer Worker Prompt (CLEAN OUTPUT):**
154
+ ```
155
+ You are {Measurer-Name}, a 📊 Measurer Ant.
156
+
157
+ Mission: Performance baseline measurement for Phase {id}
158
+
159
+ Phase: {phase_name}
160
+ Keywords that triggered spawn: {matched_keywords}
161
+
162
+ Files to measure:
163
+ - {list from source_files_to_measure}
164
+
165
+ Work:
166
+ 1. Read each source file to understand operation patterns
167
+ 2. Analyze algorithmic complexity (Big O) for key functions
168
+ 3. Identify potential bottlenecks (loops, recursion, I/O)
169
+ 4. Document current baseline metrics for comparison
170
+ 5. Recommend optimizations with estimated impact
171
+
172
+ **IMPORTANT:** You are strictly read-only. Do not modify any files.
173
+
174
+ Log activity: bash .aether/aether-utils.sh activity-log "BENCHMARKING" "{Measurer-Name}" "description"
175
+
176
+ Return ONLY this JSON (no other text):
177
+ {
178
+ "ant_name": "{Measurer-Name}",
179
+ "caste": "measurer",
180
+ "status": "completed" | "failed" | "blocked",
181
+ "summary": "What you measured and found",
182
+ "metrics": {
183
+ "response_time_ms": 0,
184
+ "throughput_rps": 0,
185
+ "cpu_percent": 0,
186
+ "memory_mb": 0
187
+ },
188
+ "baselines_established": [
189
+ {"operation": "name", "complexity": "O(n)", "file": "path", "line": 0}
190
+ ],
191
+ "bottlenecks_identified": [
192
+ {"description": "...", "severity": "high|medium|low", "location": "file:line"}
193
+ ],
194
+ "recommendations": [
195
+ {"priority": 1, "change": "...", "estimated_improvement": "..."}
196
+ ],
197
+ "tool_count": 0
198
+ }
199
+ ```
200
+
201
+ 6. **Parse Measurer JSON output:**
202
+
203
+ Extract from response: `baselines_established`, `bottlenecks_identified`, `recommendations`, `tool_count`
204
+
205
+ Log completion:
206
+ Run using the Bash tool with description "Recording measurer completion...": `bash .aether/aether-utils.sh spawn-complete "{measurer_name}" "completed" "Baselines established, bottlenecks identified"`
207
+
208
+ **Display Measurer completion line:**
209
+ ```
210
+ 📊 {Measurer-Name}: Performance baseline measurement ({tool_count} tools) ✓
211
+ ```
212
+
213
+ 7. **Log findings to midden:**
214
+
215
+ For each baseline established, run using the Bash tool with description "Logging baseline...":
216
+ ```bash
217
+ bash .aether/aether-utils.sh midden-write "performance" "Baseline: {baseline.operation} ({baseline.complexity}) at {baseline.file}:{baseline.line}" "measurer"
218
+ ```
219
+
220
+ For each bottleneck identified, run using the Bash tool with description "Logging bottleneck...":
221
+ ```bash
222
+ bash .aether/aether-utils.sh midden-write "performance" "Bottleneck: {bottleneck.description} ({bottleneck.severity}) at {bottleneck.location}" "measurer"
223
+ ```
224
+
225
+ For each recommendation, run using the Bash tool with description "Logging recommendation...":
226
+ ```bash
227
+ bash .aether/aether-utils.sh midden-write "performance" "Recommendation (P{rec.priority}): {rec.change} - {rec.estimated_improvement}" "measurer"
228
+ ```
229
+
230
+ 8. **Display summary and store for synthesis:**
231
+
232
+ Display:
233
+ ```
234
+ 📊 Measurer complete — {baseline_count} baselines, {bottleneck_count} bottlenecks logged to midden
235
+ ```
236
+
237
+ Store Measurer results in synthesis data structure:
238
+ - Add `performance` object to synthesis JSON with: `baselines_established`, `bottlenecks_identified`, `recommendations`
239
+ - Include in BUILD SUMMARY display: `📊 Measurer: {baseline_count} baselines established, {bottleneck_count} bottlenecks identified`
240
+
241
+ 9. **Continue to Chaos Ant:**
242
+
243
+ Proceed to Step 5.6 (Chaos Ant) regardless of Measurer results — Measurer is strictly non-blocking.
244
+
245
+ ### Step 5.6: Spawn Chaos Ant for Resilience Testing
246
+
247
+ **DEPTH CHECK: Skip if colony depth is not "full".**
248
+
249
+ - If `colony_depth` is not "full": Display `Chaos testing skipped (depth: {colony_depth})` and skip to Step 5.7 (Process Chaos Ant Results -- which will be a no-op).
250
+ - If `colony_depth` is "full": Proceed with existing Chaos spawn logic below.
251
+
252
+ **After the Watcher completes, spawn a Chaos Ant to probe the phase work for edge cases and boundary conditions.**
253
+
254
+ Generate a chaos ant name and dispatch:
255
+ Run using the Bash tool with description "Naming chaos ant...": `bash .aether/aether-utils.sh generate-ant-name "chaos"` (store as `{chaos_name}`)
256
+ Run using the Bash tool with description "Loading existing flags...": `bash .aether/aether-utils.sh flag-list --phase {phase_number}`
257
+ 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".
258
+ Run using the Bash tool with description "Dispatching chaos ant...": `bash .aether/aether-utils.sh spawn-log "Queen" "chaos" "{chaos_name}" "Resilience testing of Phase {id} work"`
259
+
260
+ **Announce the resilience testing wave:**
261
+ ```
262
+ ──── 🎲🐜 Spawning {chaos_name} — resilience testing ────
263
+ ```
264
+
265
+ > **Platform note**: In Claude Code, use `Task tool with subagent_type`. In OpenCode, use the equivalent agent spawning mechanism for your platform (e.g., invoke the agent definition from `.opencode/agents/`).
266
+
267
+ Spawn the Chaos Ant using Task tool with `subagent_type="aether-chaos"`, include `description: "🎲 Chaos {Chaos-Name}: Resilience testing"` (DO NOT use run_in_background - task blocks until complete):
268
+ # FALLBACK: If "Agent type not found", use general-purpose and inject role: "You are a Chaos Ant - resilience tester that probes edge cases and boundary conditions."
269
+
270
+ **Chaos Ant Prompt (CLEAN OUTPUT):**
271
+ ```
272
+ You are {Chaos-Name}, a 🎲🐜 Chaos Ant.
273
+
274
+ Test Phase {id} work for edge cases and boundary conditions.
275
+
276
+ Files to test:
277
+ - {list from builder results}
278
+
279
+ Skip these known issues: {existing_flag_titles}
280
+
281
+ **IMPORTANT:** When using the Bash tool for activity calls, always include a description parameter:
282
+ - activity-log calls → "Logging {action}..."
283
+ - pheromone-read calls → "Checking colony signals..."
284
+
285
+ Use colony-flavored language, 4-8 words, trailing ellipsis.
286
+
287
+ Rules:
288
+ - Max 5 scenarios
289
+ - Read-only (don't modify code)
290
+ - Focus: edge cases, boundaries, error handling
291
+
292
+ Count your total tool calls (Read + Grep + Edit + Bash + Write) and report as tool_count.
293
+
294
+ Return ONLY this JSON:
295
+ {"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": "..."}
296
+ ```
297
+
298
+ ### Step 5.7: Process Chaos Ant Results
299
+
300
+ **Task call returns results directly (no TaskOutput needed).**
301
+
302
+ **Parse the Chaos Ant's JSON response:** findings, overall_resilience, summary
303
+
304
+ **Display Chaos completion line:**
305
+ ```
306
+ 🎲 {Chaos-Name}: Resilience testing ({tool_count} tools) ✓
307
+ ```
308
+
309
+ **Store results for synthesis in Step 5.9**
310
+
311
+ **Flag critical/high findings:**
312
+
313
+ If any findings have severity `"critical"` or `"high"`:
314
+ Run using the Bash tool with description "Flagging {finding.title}...": `bash .aether/aether-utils.sh flag-add "blocker" "{finding.title}" "{finding.description}" "chaos-testing" {phase_number} && bash .aether/aether-utils.sh activity-log "FLAG" "Chaos" "Created blocker: {finding.title}"`
315
+
316
+ **Log resilience finding to midden (MEM-02):**
317
+
318
+ For each critical/high finding, run using the Bash tool with description "Logging resilience finding...":
319
+ ```bash
320
+ colony_name=$(bash .aether/aether-utils.sh colony-name 2>/dev/null | jq -r '.result.name // ""')
321
+ [[ -z "$colony_name" ]] && colony_name="unknown"
322
+ phase_num=$(jq -r '.phase.number // "unknown"' .aether/data/COLONY_STATE.json 2>/dev/null || echo "unknown")
323
+
324
+ # Append to build-failures.md
325
+ cat >> .aether/midden/build-failures.md << EOF
326
+ - timestamp: "$(date -u +%Y-%m-%dT%H:%M:%SZ)"
327
+ phase: ${phase_num}
328
+ colony: "${colony_name}"
329
+ worker: "${chaos_name}"
330
+ test_context: "resilience"
331
+ what_failed: "${finding.title}"
332
+ why: "${finding.description}"
333
+ what_worked: null
334
+ severity: "${finding.severity}"
335
+ EOF
336
+
337
+ # Write to structured midden for threshold detection (MID-01)
338
+ bash .aether/aether-utils.sh midden-write "resilience" "Chaos finding: ${finding.title} (${finding.severity})" "chaos" 2>/dev/null || true
339
+
340
+ # Capture resilience failure in memory pipeline (observe + pheromone + auto-promotion)
341
+ bash .aether/aether-utils.sh memory-capture \
342
+ "failure" \
343
+ "Resilience issue found: ${finding.title} (${finding.severity})" \
344
+ "failure" \
345
+ "worker:chaos" 2>/dev/null || true
346
+ ```
347
+
348
+ Log chaos ant completion:
349
+ Run using the Bash tool with description "Recording chaos completion...": `bash .aether/aether-utils.sh spawn-complete "{chaos_name}" "completed" "{summary}"`
350
+
351
+ **Success capture: chaos resilience (MEM-01):**
352
+
353
+ If `overall_resilience` is `"strong"`:
354
+
355
+ Run using the Bash tool with description "Capturing chaos resilience success...":
356
+ ```bash
357
+ bash .aether/aether-utils.sh memory-capture \
358
+ "success" \
359
+ "Chaos resilience strong: ${summary}" \
360
+ "pattern" \
361
+ "worker:chaos" 2>/dev/null || true
362
+ ```
363
+
364
+ This records the resilience success in learning-observations.json via the existing memory pipeline (observe + pheromone + auto-promotion + rolling-summary).
365
+
366
+ ### Step 5.8: Create Flags for Verification Failures
367
+
368
+ If the Watcher reported `verification_passed: false` or `recommendation: "fix_required"`:
369
+
370
+ For each issue in `issues_found`:
371
+ Run using the Bash tool with description "Flagging {issue_title}...": `bash .aether/aether-utils.sh flag-add "blocker" "{issue_title}" "{issue_description}" "verification" {phase_number} && bash .aether/aether-utils.sh activity-log "FLAG" "Watcher" "Created blocker: {issue_title}"`
372
+
373
+ **Log verification failure to midden (MEM-02):**
374
+
375
+ After flagging each issue, run using the Bash tool with description "Logging verification failure...":
376
+ ```bash
377
+ colony_name=$(bash .aether/aether-utils.sh colony-name 2>/dev/null | jq -r '.result.name // ""')
378
+ [[ -z "$colony_name" ]] && colony_name="unknown"
379
+ phase_num=$(jq -r '.phase.number // "unknown"' .aether/data/COLONY_STATE.json 2>/dev/null || echo "unknown")
380
+
381
+ # Append to test-failures.md
382
+ cat >> .aether/midden/test-failures.md << EOF
383
+ - timestamp: "$(date -u +%Y-%m-%dT%H:%M:%SZ)"
384
+ phase: ${phase_num}
385
+ colony: "${colony_name}"
386
+ worker: "${watcher_name}"
387
+ test_context: "verification"
388
+ what_failed: "${issue_title}"
389
+ why: "${issue_description}"
390
+ what_worked: null
391
+ severity: "high"
392
+ EOF
393
+
394
+ # Write to structured midden for threshold detection (MID-01)
395
+ bash .aether/aether-utils.sh midden-write "verification" "Watcher verification failed: ${issue_title}" "watcher" 2>/dev/null || true
396
+
397
+ # Capture verification failure in memory pipeline (observe + pheromone + auto-promotion)
398
+ bash .aether/aether-utils.sh memory-capture \
399
+ "failure" \
400
+ "Verification failed: ${issue_title} - ${issue_description}" \
401
+ "failure" \
402
+ "worker:watcher" 2>/dev/null || true
403
+ ```
404
+
405
+ This ensures verification failures are persisted as blockers that survive context resets. Chaos Ant findings are flagged in Step 5.7.