aether-colony 3.1.17 → 5.1.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 (378) hide show
  1. package/.aether/aether-utils.sh +5354 -0
  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 +438 -0
  30. package/.aether/commands/continue.yaml +1484 -0
  31. package/.aether/commands/council.yaml +304 -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 +469 -0
  44. package/.aether/commands/insert-phase.yaml +98 -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 +1313 -0
  57. package/.aether/commands/preferences.yaml +63 -0
  58. package/.aether/commands/redirect.yaml +123 -0
  59. package/.aether/commands/resume-colony.yaml +373 -0
  60. package/.aether/commands/resume.yaml +398 -0
  61. package/.aether/commands/run.yaml +193 -0
  62. package/.aether/commands/seal.yaml +1205 -0
  63. package/.aether/commands/skill-create.yaml +337 -0
  64. package/.aether/commands/status.yaml +364 -0
  65. package/.aether/commands/swarm.yaml +352 -0
  66. package/.aether/commands/tunnels.yaml +814 -0
  67. package/.aether/commands/update.yaml +131 -0
  68. package/.aether/commands/verify-castes.yaml +159 -0
  69. package/.aether/commands/watch.yaml +454 -0
  70. package/.aether/docs/INCIDENT_TEMPLATE.md +32 -0
  71. package/.aether/docs/QUEEN-SYSTEM.md +211 -0
  72. package/.aether/docs/README.md +98 -0
  73. package/.aether/docs/caste-system.md +48 -0
  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 +1682 -0
  78. package/.aether/docs/command-playbooks/build-prep.md +283 -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 +1724 -0
  84. package/.aether/docs/command-playbooks/continue-gates.md +686 -0
  85. package/.aether/docs/command-playbooks/continue-verify.md +406 -0
  86. package/.aether/docs/context-continuity.md +84 -0
  87. package/{runtime → .aether/docs/disciplines}/DISCIPLINES.md +13 -11
  88. package/.aether/docs/error-codes.md +268 -0
  89. package/.aether/docs/known-issues.md +94 -0
  90. package/{runtime → .aether}/docs/pheromones.md +86 -6
  91. package/.aether/docs/plans/pheromone-display-plan.md +257 -0
  92. package/.aether/docs/queen-commands.md +98 -0
  93. package/.aether/docs/source-of-truth-map.md +132 -0
  94. package/.aether/docs/xml-utilities.md +47 -0
  95. package/{runtime → .aether}/exchange/pheromone-xml.sh +2 -1
  96. package/{runtime → .aether}/exchange/registry-xml.sh +7 -3
  97. package/{runtime → .aether}/exchange/wisdom-xml.sh +11 -4
  98. package/.aether/rules/aether-colony.md +144 -0
  99. package/.aether/schemas/example-prompt-builder.xml +234 -0
  100. package/.aether/scripts/incident-test-add.sh +47 -0
  101. package/.aether/scripts/weekly-audit.sh +79 -0
  102. package/.aether/skills/.index.json +649 -0
  103. package/.aether/skills/colony/.manifest.json +16 -0
  104. package/.aether/skills/colony/build-discipline/SKILL.md +78 -0
  105. package/.aether/skills/colony/colony-interaction/SKILL.md +56 -0
  106. package/.aether/skills/colony/colony-lifecycle/SKILL.md +77 -0
  107. package/.aether/skills/colony/colony-visuals/SKILL.md +112 -0
  108. package/.aether/skills/colony/context-management/SKILL.md +80 -0
  109. package/.aether/skills/colony/error-presentation/SKILL.md +99 -0
  110. package/.aether/skills/colony/pheromone-protocol/SKILL.md +79 -0
  111. package/.aether/skills/colony/pheromone-visibility/SKILL.md +81 -0
  112. package/.aether/skills/colony/state-safety/SKILL.md +84 -0
  113. package/.aether/skills/colony/worker-priming/SKILL.md +82 -0
  114. package/.aether/skills/domain/.manifest.json +24 -0
  115. package/.aether/skills/domain/README.md +33 -0
  116. package/.aether/skills/domain/django/SKILL.md +49 -0
  117. package/.aether/skills/domain/docker/SKILL.md +52 -0
  118. package/.aether/skills/domain/golang/SKILL.md +52 -0
  119. package/.aether/skills/domain/graphql/SKILL.md +51 -0
  120. package/.aether/skills/domain/html-css/SKILL.md +48 -0
  121. package/.aether/skills/domain/nextjs/SKILL.md +45 -0
  122. package/.aether/skills/domain/nodejs/SKILL.md +53 -0
  123. package/.aether/skills/domain/postgresql/SKILL.md +53 -0
  124. package/.aether/skills/domain/prisma/SKILL.md +59 -0
  125. package/.aether/skills/domain/python/SKILL.md +50 -0
  126. package/.aether/skills/domain/rails/SKILL.md +52 -0
  127. package/.aether/skills/domain/react/SKILL.md +45 -0
  128. package/.aether/skills/domain/rest-api/SKILL.md +58 -0
  129. package/.aether/skills/domain/svelte/SKILL.md +47 -0
  130. package/.aether/skills/domain/tailwind/SKILL.md +45 -0
  131. package/.aether/skills/domain/testing/SKILL.md +53 -0
  132. package/.aether/skills/domain/typescript/SKILL.md +58 -0
  133. package/.aether/skills/domain/vue/SKILL.md +49 -0
  134. package/.aether/templates/QUEEN.md.template +61 -0
  135. package/.aether/templates/colony-state-reset.jq.template +23 -0
  136. package/.aether/templates/colony-state.template.json +39 -0
  137. package/.aether/templates/constraints.template.json +9 -0
  138. package/.aether/templates/crowned-anthill.template.md +36 -0
  139. package/.aether/templates/handoff-build-error.template.md +30 -0
  140. package/.aether/templates/handoff-build-success.template.md +39 -0
  141. package/.aether/templates/handoff.template.md +40 -0
  142. package/.aether/templates/learning-observations.template.json +6 -0
  143. package/.aether/templates/midden.template.json +13 -0
  144. package/.aether/templates/pheromones.template.json +6 -0
  145. package/.aether/templates/session.template.json +9 -0
  146. package/{runtime → .aether}/utils/atomic-write.sh +68 -22
  147. package/{runtime → .aether}/utils/chamber-compare.sh +23 -10
  148. package/.aether/utils/chamber-utils.sh +440 -0
  149. package/.aether/utils/emoji-audit.sh +166 -0
  150. package/{runtime → .aether}/utils/error-handler.sh +34 -8
  151. package/.aether/utils/file-lock.sh +313 -0
  152. package/.aether/utils/flag.sh +267 -0
  153. package/.aether/utils/hive.sh +572 -0
  154. package/.aether/utils/learning.sh +1928 -0
  155. package/.aether/utils/midden.sh +342 -0
  156. package/.aether/utils/oracle/oracle.md +168 -0
  157. package/.aether/utils/oracle/oracle.sh +1023 -0
  158. package/.aether/utils/pheromone.sh +2029 -0
  159. package/.aether/utils/queen.sh +1698 -0
  160. package/.aether/utils/scan.sh +860 -0
  161. package/.aether/utils/semantic-cli.sh +415 -0
  162. package/.aether/utils/session.sh +552 -0
  163. package/.aether/utils/skills.sh +509 -0
  164. package/.aether/utils/spawn-tree.sh +260 -0
  165. package/.aether/utils/spawn.sh +260 -0
  166. package/.aether/utils/state-api.sh +199 -0
  167. package/{runtime → .aether}/utils/state-loader.sh +8 -6
  168. package/.aether/utils/suggest.sh +611 -0
  169. package/{runtime → .aether}/utils/swarm-display.sh +10 -1
  170. package/.aether/utils/swarm.sh +1004 -0
  171. package/{runtime → .aether}/utils/watch-spawn-tree.sh +11 -2
  172. package/{runtime → .aether}/utils/xml-compose.sh +9 -3
  173. package/.aether/utils/xml-convert.sh +277 -0
  174. package/{runtime → .aether}/utils/xml-core.sh +5 -9
  175. package/.aether/utils/xml-query.sh +201 -0
  176. package/.aether/utils/xml-utils.sh +110 -0
  177. package/{runtime → .aether}/workers.md +97 -81
  178. package/.claude/agents/ant/aether-ambassador.md +265 -0
  179. package/.claude/agents/ant/aether-archaeologist.md +327 -0
  180. package/.claude/agents/ant/aether-architect.md +236 -0
  181. package/.claude/agents/ant/aether-auditor.md +271 -0
  182. package/.claude/agents/ant/aether-builder.md +224 -0
  183. package/.claude/agents/ant/aether-chaos.md +269 -0
  184. package/.claude/agents/ant/aether-chronicler.md +305 -0
  185. package/.claude/agents/ant/aether-gatekeeper.md +330 -0
  186. package/.claude/agents/ant/aether-includer.md +374 -0
  187. package/.claude/agents/ant/aether-keeper.md +272 -0
  188. package/.claude/agents/ant/aether-measurer.md +322 -0
  189. package/.claude/agents/ant/aether-oracle.md +237 -0
  190. package/.claude/agents/ant/aether-probe.md +211 -0
  191. package/.claude/agents/ant/aether-queen.md +330 -0
  192. package/.claude/agents/ant/aether-route-setter.md +178 -0
  193. package/.claude/agents/ant/aether-sage.md +418 -0
  194. package/.claude/agents/ant/aether-scout.md +179 -0
  195. package/.claude/agents/ant/aether-surveyor-disciplines.md +417 -0
  196. package/.claude/agents/ant/aether-surveyor-nest.md +355 -0
  197. package/.claude/agents/ant/aether-surveyor-pathogens.md +289 -0
  198. package/.claude/agents/ant/aether-surveyor-provisions.md +360 -0
  199. package/.claude/agents/ant/aether-tracker.md +270 -0
  200. package/.claude/agents/ant/aether-watcher.md +280 -0
  201. package/.claude/agents/ant/aether-weaver.md +248 -0
  202. package/.claude/commands/ant/archaeology.md +16 -14
  203. package/.claude/commands/ant/build.md +43 -1028
  204. package/.claude/commands/ant/chaos.md +19 -23
  205. package/.claude/commands/ant/colonize.md +52 -31
  206. package/.claude/commands/ant/continue.md +40 -1016
  207. package/.claude/commands/ant/council.md +21 -18
  208. package/.claude/commands/ant/data-clean.md +81 -0
  209. package/.claude/commands/ant/dream.md +27 -15
  210. package/.claude/commands/ant/entomb.md +317 -225
  211. package/.claude/commands/ant/export-signals.md +57 -0
  212. package/.claude/commands/ant/feedback.md +48 -26
  213. package/.claude/commands/ant/flag.md +30 -10
  214. package/.claude/commands/ant/flags.md +34 -12
  215. package/.claude/commands/ant/focus.md +45 -19
  216. package/.claude/commands/ant/help.md +50 -8
  217. package/.claude/commands/ant/history.md +13 -0
  218. package/.claude/commands/ant/import-signals.md +71 -0
  219. package/.claude/commands/ant/init.md +345 -194
  220. package/.claude/commands/ant/insert-phase.md +101 -0
  221. package/.claude/commands/ant/interpret.md +26 -4
  222. package/.claude/commands/ant/lay-eggs.md +184 -127
  223. package/.claude/commands/ant/maturity.md +32 -11
  224. package/.claude/commands/ant/memory-details.md +77 -0
  225. package/.claude/commands/ant/migrate-state.md +20 -2
  226. package/.claude/commands/ant/oracle.md +337 -74
  227. package/.claude/commands/ant/organize.md +39 -25
  228. package/.claude/commands/ant/patrol.md +620 -0
  229. package/.claude/commands/ant/pause-colony.md +23 -27
  230. package/.claude/commands/ant/phase.md +40 -42
  231. package/.claude/commands/ant/pheromones.md +156 -0
  232. package/.claude/commands/ant/plan.md +185 -51
  233. package/.claude/commands/ant/preferences.md +65 -0
  234. package/.claude/commands/ant/redirect.md +45 -30
  235. package/.claude/commands/ant/resume-colony.md +51 -27
  236. package/.claude/commands/ant/resume.md +314 -94
  237. package/.claude/commands/ant/run.md +195 -0
  238. package/.claude/commands/ant/seal.md +650 -221
  239. package/.claude/commands/ant/skill-create.md +286 -0
  240. package/.claude/commands/ant/status.md +196 -31
  241. package/.claude/commands/ant/swarm.md +16 -46
  242. package/.claude/commands/ant/tunnels.md +280 -105
  243. package/.claude/commands/ant/update.md +73 -89
  244. package/.claude/commands/ant/verify-castes.md +100 -42
  245. package/.claude/commands/ant/watch.md +14 -12
  246. package/.opencode/agents/aether-ambassador.md +63 -20
  247. package/.opencode/agents/aether-archaeologist.md +29 -12
  248. package/.opencode/agents/aether-architect.md +103 -36
  249. package/.opencode/agents/aether-auditor.md +51 -18
  250. package/.opencode/agents/aether-builder.md +70 -20
  251. package/.opencode/agents/aether-chaos.md +29 -12
  252. package/.opencode/agents/aether-chronicler.md +60 -18
  253. package/.opencode/agents/aether-gatekeeper.md +27 -18
  254. package/.opencode/agents/aether-includer.md +27 -18
  255. package/.opencode/agents/aether-keeper.md +89 -18
  256. package/.opencode/agents/aether-measurer.md +27 -18
  257. package/.opencode/agents/aether-oracle.md +137 -0
  258. package/.opencode/agents/aether-probe.md +60 -18
  259. package/.opencode/agents/aether-queen.md +172 -24
  260. package/.opencode/agents/aether-route-setter.md +57 -12
  261. package/.opencode/agents/aether-sage.md +26 -18
  262. package/.opencode/agents/aether-scout.md +28 -20
  263. package/.opencode/agents/aether-surveyor-disciplines.md +59 -2
  264. package/.opencode/agents/aether-surveyor-nest.md +59 -2
  265. package/.opencode/agents/aether-surveyor-pathogens.md +57 -2
  266. package/.opencode/agents/aether-surveyor-provisions.md +59 -2
  267. package/.opencode/agents/aether-tracker.md +64 -18
  268. package/.opencode/agents/aether-watcher.md +66 -19
  269. package/.opencode/agents/aether-weaver.md +61 -18
  270. package/.opencode/commands/ant/archaeology.md +7 -14
  271. package/.opencode/commands/ant/build.md +437 -257
  272. package/.opencode/commands/ant/chaos.md +7 -24
  273. package/.opencode/commands/ant/colonize.md +8 -17
  274. package/.opencode/commands/ant/continue.md +661 -142
  275. package/.opencode/commands/ant/council.md +11 -22
  276. package/.opencode/commands/ant/data-clean.md +77 -0
  277. package/.opencode/commands/ant/dream.md +15 -17
  278. package/.opencode/commands/ant/entomb.md +133 -62
  279. package/.opencode/commands/ant/export-signals.md +54 -0
  280. package/.opencode/commands/ant/feedback.md +24 -5
  281. package/.opencode/commands/ant/flag.md +16 -4
  282. package/.opencode/commands/ant/flags.md +24 -10
  283. package/.opencode/commands/ant/focus.md +22 -5
  284. package/.opencode/commands/ant/help.md +41 -8
  285. package/.opencode/commands/ant/history.md +9 -0
  286. package/.opencode/commands/ant/import-signals.md +68 -0
  287. package/.opencode/commands/ant/init.md +374 -167
  288. package/.opencode/commands/ant/insert-phase.md +107 -0
  289. package/.opencode/commands/ant/interpret.md +16 -0
  290. package/.opencode/commands/ant/lay-eggs.md +184 -112
  291. package/.opencode/commands/ant/maturity.md +18 -2
  292. package/.opencode/commands/ant/memory-details.md +83 -0
  293. package/.opencode/commands/ant/migrate-state.md +12 -0
  294. package/.opencode/commands/ant/oracle.md +322 -67
  295. package/.opencode/commands/ant/organize.md +18 -16
  296. package/.opencode/commands/ant/patrol.md +626 -0
  297. package/.opencode/commands/ant/pause-colony.md +12 -29
  298. package/.opencode/commands/ant/phase.md +30 -40
  299. package/.opencode/commands/ant/pheromones.md +162 -0
  300. package/.opencode/commands/ant/plan.md +184 -56
  301. package/.opencode/commands/ant/preferences.md +71 -0
  302. package/.opencode/commands/ant/redirect.md +22 -5
  303. package/.opencode/commands/ant/resume-colony.md +38 -27
  304. package/.opencode/commands/ant/resume.md +385 -0
  305. package/.opencode/commands/ant/run.md +201 -0
  306. package/.opencode/commands/ant/seal.md +259 -45
  307. package/.opencode/commands/ant/skill-create.md +63 -0
  308. package/.opencode/commands/ant/status.md +135 -31
  309. package/.opencode/commands/ant/swarm.md +3 -345
  310. package/.opencode/commands/ant/tunnels.md +152 -9
  311. package/.opencode/commands/ant/update.md +70 -91
  312. package/.opencode/commands/ant/verify-castes.md +96 -42
  313. package/.opencode/commands/ant/watch.md +7 -0
  314. package/CHANGELOG.md +356 -0
  315. package/README.md +203 -573
  316. package/bin/cli.js +455 -527
  317. package/bin/generate-commands.js +186 -0
  318. package/bin/generate-commands.sh +127 -88
  319. package/bin/lib/init.js +13 -3
  320. package/bin/lib/spawn-logger.js +0 -15
  321. package/bin/lib/update-transaction.js +392 -140
  322. package/bin/npx-install.js +178 -0
  323. package/bin/sync-to-runtime.sh +5 -137
  324. package/bin/validate-package.sh +166 -0
  325. package/package.json +14 -7
  326. package/.opencode/agents/aether-guardian.md +0 -107
  327. package/.opencode/agents/workers.md +0 -1034
  328. package/bin/lib/model-profiles.js +0 -445
  329. package/bin/lib/model-verify.js +0 -288
  330. package/bin/lib/proxy-health.js +0 -253
  331. package/bin/lib/telemetry.js +0 -441
  332. package/runtime/CONTEXT.md +0 -160
  333. package/runtime/QUEEN_ANT_ARCHITECTURE.md +0 -402
  334. package/runtime/aether-utils.sh +0 -3879
  335. package/runtime/data/signatures.json +0 -41
  336. package/runtime/docs/AETHER-2.0-IMPLEMENTATION-PLAN.md +0 -1343
  337. package/runtime/docs/AETHER-PHEROMONE-SYSTEM-MASTER-SPEC.md +0 -2642
  338. package/runtime/docs/PHEROMONE-INJECTION.md +0 -240
  339. package/runtime/docs/PHEROMONE-INTEGRATION.md +0 -192
  340. package/runtime/docs/PHEROMONE-SYSTEM-DESIGN.md +0 -426
  341. package/runtime/docs/README.md +0 -94
  342. package/runtime/docs/VISUAL-OUTPUT-SPEC.md +0 -219
  343. package/runtime/docs/biological-reference.md +0 -272
  344. package/runtime/docs/codebase-review.md +0 -399
  345. package/runtime/docs/command-sync.md +0 -164
  346. package/runtime/docs/constraints.md +0 -116
  347. package/runtime/docs/implementation-learnings.md +0 -89
  348. package/runtime/docs/known-issues.md +0 -217
  349. package/runtime/docs/namespace.md +0 -148
  350. package/runtime/docs/pathogen-schema-example.json +0 -36
  351. package/runtime/docs/pathogen-schema.md +0 -111
  352. package/runtime/docs/planning-discipline.md +0 -159
  353. package/runtime/docs/progressive-disclosure.md +0 -184
  354. package/runtime/lib/queen-utils.sh +0 -729
  355. package/runtime/model-profiles.yaml +0 -100
  356. package/runtime/planning.md +0 -159
  357. package/runtime/recover.sh +0 -136
  358. package/runtime/templates/QUEEN.md.template +0 -79
  359. package/runtime/utils/chamber-utils.sh +0 -285
  360. package/runtime/utils/file-lock.sh +0 -122
  361. package/runtime/utils/spawn-tree.sh +0 -428
  362. package/runtime/utils/spawn-with-model.sh +0 -56
  363. package/runtime/utils/xml-utils.sh +0 -2196
  364. package/runtime/workers-new-castes.md +0 -516
  365. /package/{runtime → .aether/docs/disciplines}/coding-standards.md +0 -0
  366. /package/{runtime → .aether/docs/disciplines}/debugging.md +0 -0
  367. /package/{runtime → .aether/docs/disciplines}/learning.md +0 -0
  368. /package/{runtime → .aether/docs/disciplines}/tdd.md +0 -0
  369. /package/{runtime → .aether/docs/disciplines}/verification-loop.md +0 -0
  370. /package/{runtime → .aether/docs/disciplines}/verification.md +0 -0
  371. /package/{runtime → .aether}/schemas/aether-types.xsd +0 -0
  372. /package/{runtime → .aether}/schemas/colony-registry.xsd +0 -0
  373. /package/{runtime → .aether}/schemas/pheromone.xsd +0 -0
  374. /package/{runtime → .aether}/schemas/prompt.xsd +0 -0
  375. /package/{runtime → .aether}/schemas/queen-wisdom.xsd +0 -0
  376. /package/{runtime → .aether}/schemas/worker-priming.xsd +0 -0
  377. /package/{runtime → .aether}/utils/colorize-log.sh +0 -0
  378. /package/{runtime → .aether}/utils/queen-to-md.xsl +0 -0
@@ -1,41 +1,24 @@
1
+ <!-- Generated from .aether/commands/continue.yaml - DO NOT EDIT DIRECTLY -->
1
2
  ---
2
3
  name: ant:continue
3
4
  description: "➡️🐜🚪🐜➡️ Detect build completion, reconcile state, and advance to next phase"
4
5
  ---
5
6
 
6
- You are the **Queen Ant Colony**. Reconcile completed work and advance to the next phase.
7
-
8
- ## Instructions
9
-
10
7
  ### Step -1: Normalize Arguments
11
8
 
12
9
  Run: `normalized_args=$(bash .aether/aether-utils.sh normalize-args "$@")`
13
10
 
14
11
  This ensures arguments work correctly in both Claude Code and OpenCode. Use `$normalized_args` throughout this command.
15
12
 
13
+ You are the **Queen Ant Colony**. Reconcile completed work and advance to the next phase.
14
+
15
+ ## Instructions
16
+
16
17
  Parse `$normalized_args`:
17
18
  - If contains `--no-visual`: set `visual_mode = false` (visual is ON by default)
18
19
  - Otherwise: set `visual_mode = true`
19
20
 
20
- ### Step 0: Initialize Visual Mode (if enabled)
21
-
22
- If `visual_mode` is true:
23
- ```bash
24
- # Generate session ID
25
- continue_id="continue-$(date +%s)"
26
-
27
- # Initialize swarm display
28
- bash .aether/aether-utils.sh swarm-display-init "$continue_id"
29
- bash .aether/aether-utils.sh swarm-display-update "Queen" "prime" "excavating" "Phase continuation" "Colony" '{"read":0,"grep":0,"edit":0,"bash":0}' 0 "fungus_garden" 0
30
- ```
31
-
32
- ### Step 0.5: Version Check (Non-blocking)
33
-
34
- Run using the Bash tool: `bash .aether/aether-utils.sh version-check 2>/dev/null || true`
35
-
36
- If the command succeeds and the JSON result contains a non-empty string, display it as a one-line notice. Proceed regardless of outcome.
37
-
38
- ### Step 1: Read State + Version Check
21
+ ### Step 1: Read State
39
22
 
40
23
  Read `.aether/data/COLONY_STATE.json`.
41
24
 
@@ -91,11 +74,35 @@ If `state == "EXECUTING"`:
91
74
  If `state != "EXECUTING"`:
92
75
  - Normal continue flow (no build to reconcile)
93
76
 
94
- ### Step 1.5: Verification Loop Gate (MANDATORY)
77
+ ### Step 1.5.2: Load Survey Context (Non-blocking)
78
+
79
+ Run:
80
+ ```bash
81
+ survey_check=$(bash .aether/aether-utils.sh survey-verify 2>/dev/null || true)
82
+ survey_docs=$(ls -1 .aether/data/survey/*.md 2>/dev/null | wc -l | tr -d ' ')
83
+ survey_latest=$(ls -t .aether/data/survey/*.md 2>/dev/null | head -1)
84
+ if [[ -n "$survey_latest" ]]; then
85
+ now_epoch=$(date +%s)
86
+ modified_epoch=$(stat -f %m "$survey_latest" 2>/dev/null || stat -c %Y "$survey_latest" 2>/dev/null || echo 0)
87
+ survey_age_days=$(( (now_epoch - modified_epoch) / 86400 ))
88
+ else
89
+ survey_age_days=-1
90
+ fi
91
+ echo "{\"docs\":$survey_docs,\"age_days\":$survey_age_days,\"verify\":$survey_check}"
92
+ ```
93
+
94
+ Interpretation:
95
+ - If `docs == 0`: display `🗺️ Survey: not found (run /ant:colonize for stronger context)` and continue.
96
+ - If `age_days > 14`: display `🗺️ Survey: {docs} docs loaded ({age_days}d old, consider /ant:colonize --force-resurvey)` and continue.
97
+ - Otherwise: display `🗺️ Survey: {docs} docs loaded ({age_days}d old)` and continue.
98
+
99
+ Survey context is advisory only and must not block advancement by itself.
100
+
101
+ ### Step 1.5.3: Verification Loop Gate (MANDATORY)
95
102
 
96
103
  **The Iron Law:** No phase advancement without fresh verification evidence.
97
104
 
98
- Before ANY phase can advance, execute the 6-phase verification loop. See `.aether/verification-loop.md` for full reference.
105
+ Before ANY phase can advance, execute the 6-phase verification loop. See `.aether/docs/disciplines/verification-loop.md` for full reference.
99
106
 
100
107
  #### 1. Command Resolution (Priority Chain)
101
108
 
@@ -125,8 +132,10 @@ If no build system detected, skip build/test/type/lint checks but still verify s
125
132
  Execute all applicable phases and capture output:
126
133
 
127
134
  ```
128
- Phase {id} Verification Loop
129
- ============================
135
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
136
+ 👁️🐜 V E R I F I C A T I O N L O O P
137
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
138
+ Phase {id} — Checking colony work...
130
139
  ```
131
140
 
132
141
  **Phase 1: Build Check** (if command exists):
@@ -159,7 +168,74 @@ Record: pass count, fail count, exit code. **STOP if fails.**
159
168
  ```
160
169
  Record: coverage percentage (target: 80%+ for new code)
161
170
 
162
- **Phase 5: Security Scan**:
171
+ #### Step 1.5.1: Probe Coverage Agent (Conditional)
172
+
173
+ **Test coverage improvement -- runs when coverage < 80% AND tests pass.**
174
+
175
+ 1. **Check coverage threshold condition:**
176
+ - Coverage data is already available from Phase 4 coverage check
177
+ - If tests failed: Skip Probe silently (coverage data unreliable)
178
+ - If coverage_percent >= 80%: Skip Probe silently, continue to Phase 5
179
+ - If coverage_percent < 80% AND tests passed: Proceed to spawn Probe
180
+
181
+ 2. **If skipping Probe:**
182
+ ```
183
+ Probe: Coverage at {coverage_percent}% -- {reason_for_skip}
184
+ ```
185
+ Continue to Phase 5: Secrets Scan.
186
+
187
+ 3. **If spawning Probe:**
188
+
189
+ a. Generate Probe name and dispatch:
190
+ Run using the Bash tool with description "Generating Probe name...": `probe_name=$(bash .aether/aether-utils.sh generate-ant-name "probe") && bash .aether/aether-utils.sh spawn-log "Queen" "probe" "$probe_name" "Coverage improvement: ${coverage_percent}%" && echo "{\"name\":\"$probe_name\"}"`
191
+
192
+ b. Display:
193
+ ```
194
+ ━━━ 🧪🐜 P R O B E ━━━
195
+ ──── 🧪🐜 Spawning {probe_name} — Coverage improvement ────
196
+ ```
197
+
198
+ d. Determine uncovered files:
199
+ Run using the Bash tool with description "Getting modified source files...": `modified_source_files=$(git diff --name-only HEAD~1 2>/dev/null || git diff --name-only) && source_files=$(echo "$modified_source_files" | grep -v "\.test\." | grep -v "\.spec\." | grep -v "__tests__") && echo "$source_files"`
200
+
201
+ e. Spawn Probe agent:
202
+
203
+ > **Platform note**: In Claude Code, use `Task tool with subagent_type="aether-probe"`. In OpenCode, use the equivalent agent spawning mechanism for your platform (e.g., invoke the aether-probe agent definition from `.opencode/agents/aether-probe.md`).
204
+
205
+ Probe mission: Improve test coverage for uncovered code paths in the modified files.
206
+ - Analyze the modified source files for uncovered branches and edge cases
207
+ - Identify which paths lack test coverage
208
+ - Generate test cases that exercise uncovered code paths
209
+ - Run the new tests to verify they pass
210
+ - Report coverage improvements and edge cases discovered
211
+
212
+ Constraints:
213
+ - Test files ONLY -- never modify source code
214
+ - Follow existing test conventions in the codebase
215
+ - Do NOT delete or modify existing tests
216
+
217
+ f. Parse Probe JSON output and log completion:
218
+ Extract: `tests_added`, `coverage.lines`, `coverage.branches`, `coverage.functions`, `edge_cases_discovered`
219
+
220
+ Run using the Bash tool with description "Logging Probe completion...": `bash .aether/aether-utils.sh spawn-complete "$probe_name" "completed" "{probe_summary}"`
221
+
222
+ g. Log findings to midden:
223
+ Run using the Bash tool with description "Logging Probe findings to midden...": `bash .aether/aether-utils.sh midden-write "coverage" "Probe generated tests, coverage: ${coverage_lines}%/${coverage_branches}%/${coverage_functions}%" "probe"`
224
+
225
+ 4. **NON-BLOCKING continuation:**
226
+ Display Probe findings summary:
227
+ ```
228
+ Probe complete -- Findings logged to midden, continuing verification...
229
+ Tests added: {count}
230
+ Edge cases discovered: {count}
231
+ ```
232
+
233
+ **CRITICAL:** ALWAYS continue to Phase 5 (Secrets Scan) regardless of Probe results. Probe is strictly non-blocking.
234
+
235
+ 5. **Record Probe status for verification report:**
236
+ Set `probe_status = "ACTIVE"` and store tests_added count and edge_cases count for the verification report.
237
+
238
+ **Phase 5: Secrets Scan**:
163
239
  ```bash
164
240
  # Check for exposed secrets
165
241
  grep -rn "sk-\|api_key\|password\s*=" --include="*.ts" --include="*.js" --include="*.py" src/ 2>/dev/null | head -10
@@ -184,23 +260,31 @@ For EACH criterion:
184
260
 
185
261
  Display:
186
262
  ```
187
- VERIFICATION LOOP REPORT
188
- ========================
263
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
264
+ 👁️🐜 V E R I F I C A T I O N R E P O R T
265
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
266
+
267
+ 🔨 Build [PASS/FAIL/SKIP]
268
+ 🔍 Types [PASS/FAIL/SKIP] (X errors)
269
+ 🧹 Lint [PASS/FAIL/SKIP] (X warnings)
270
+ 🧪 Tests [PASS/FAIL/SKIP] (X/Y passed)
271
+ Coverage {percent}% (target: 80%)
272
+ 🧪 Probe [ACTIVE/SKIP] (tests added: X, edge cases: Y)
273
+ 🔒 Secrets [PASS/FAIL] (X issues)
274
+ 📦 Gatekeeper [PASS/WARN/SKIP] (X critical, X high)
275
+ 👥 Auditor [PASS/FAIL] (score: X/100)
276
+ 📋 Diff [X files changed]
189
277
 
190
- Phase 1: Build [PASS/FAIL]
191
- Phase 2: Types [PASS/FAIL] (X errors)
192
- Phase 3: Lint [PASS/FAIL] (X warnings)
193
- Phase 4: Tests [PASS/FAIL] (X/Y passed)
194
- Coverage {percent}% (target: 80%)
195
- Phase 5: Security [PASS/FAIL] (X issues)
196
- Phase 6: Diff [X files changed]
197
-
198
- Success Criteria:
278
+ ──────────────────────────────────────────────────
279
+ 🐜 Success Criteria
280
+ ──────────────────────────────────────────────────
199
281
  ✅ {criterion 1}: {specific evidence}
200
282
  ✅ {criterion 2}: {specific evidence}
201
283
  ❌ {criterion 3}: {what's missing}
202
284
 
285
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
203
286
  Overall: READY / NOT READY
287
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
204
288
  ```
205
289
 
206
290
  #### 3. Gate Decision
@@ -208,14 +292,16 @@ Overall: READY / NOT READY
208
292
  **If NOT READY (any of: build fails, tests fail, critical security issues, success criteria unmet):**
209
293
 
210
294
  ```
211
- ⛔ VERIFICATION FAILED - PHASE BLOCKED
295
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
296
+ ⛔🐜 V E R I F I C A T I O N F A I L E D
297
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
212
298
 
213
299
  Phase {id} cannot advance until issues are resolved.
214
300
 
215
- Issues Found:
301
+ 🚨 Issues Found:
216
302
  {list each failure with specific evidence}
217
303
 
218
- Required Actions:
304
+ 🔧 Required Actions:
219
305
  1. Fix the issues listed above
220
306
  2. Run /ant:continue again to re-verify
221
307
 
@@ -232,12 +318,12 @@ Use AskUserQuestion to confirm they understand what needs to be fixed:
232
318
  **If READY (all checks pass with evidence):**
233
319
 
234
320
  ```
235
- VERIFICATION PASSED
321
+ ✅🐜 VERIFICATION PASSED
236
322
 
237
323
  All checks completed with evidence:
238
324
  {list each check and its evidence}
239
325
 
240
- Proceeding to phase advancement.
326
+ Proceeding to gate checks...
241
327
  ```
242
328
 
243
329
  Continue to Step 1.6.
@@ -260,17 +346,19 @@ grep -c "watcher" .aether/data/spawn-tree.txt 2>/dev/null || echo "0"
260
346
  **HARD REJECTION - If spawn_count == 0 and phase had 3+ tasks:**
261
347
 
262
348
  ```
263
- ⛔ SPAWN GATE FAILED - PHASE BLOCKED
349
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
350
+ ⛔🐜 S P A W N G A T E F A I L E D
351
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
264
352
 
265
353
  This phase had {task_count} tasks but spawn_count: 0
266
354
  The Prime Worker violated the spawn protocol.
267
355
 
268
- The colony metaphor requires actual parallelism:
356
+ 🐜 The colony requires actual parallelism:
269
357
  - Prime Worker MUST spawn specialists for non-trivial work
270
358
  - A single agent doing everything is NOT a colony
271
359
  - "Justifications" for not spawning are not accepted
272
360
 
273
- Required Actions:
361
+ 🔧 Required Actions:
274
362
  1. Run /ant:build {phase} again
275
363
  2. Prime Worker MUST spawn at least 1 specialist
276
364
  3. Re-run /ant:continue after spawns complete
@@ -288,17 +376,19 @@ bash .aether/aether-utils.sh error-flag-pattern "no-spawn-violation" "Prime Work
288
376
  **HARD REJECTION - If watcher_count == 0 (no testing separation):**
289
377
 
290
378
  ```
291
- ⛔ WATCHER GATE FAILED - PHASE BLOCKED
379
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
380
+ ⛔👁️🐜 W A T C H E R G A T E F A I L E D
381
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
292
382
 
293
383
  No Watcher ant was spawned for testing/verification.
294
384
  Testing MUST be performed by a separate agent, not the builder.
295
385
 
296
- Why this matters:
386
+ 🐜 Why this matters:
297
387
  - Builders verify their own work = confirmation bias
298
388
  - Independent Watchers catch bugs builders miss
299
389
  - "Build passing" ≠ "App working"
300
390
 
301
- Required Actions:
391
+ 🔧 Required Actions:
302
392
  1. Run /ant:build {phase} again
303
393
  2. Prime Worker MUST spawn at least 1 Watcher
304
394
  3. Watcher must independently verify the work
@@ -311,12 +401,7 @@ The phase will NOT advance until a Watcher validates.
311
401
  **If spawn_count >= 1 AND watcher_count >= 1:**
312
402
 
313
403
  ```
314
- SPAWN GATE PASSED
315
-
316
- Spawns: {spawn_count} workers
317
- Watchers: {watcher_count} (independent verification)
318
-
319
- Proceeding to runtime verification.
404
+ ✅🐜 SPAWN GATE PASSED — {spawn_count} workers | {watcher_count} watchers
320
405
  ```
321
406
 
322
407
  Continue to Step 1.7.
@@ -334,20 +419,18 @@ Run for each file in `files_created` and `files_modified` from Prime Worker outp
334
419
  **Anti-Pattern Report:**
335
420
 
336
421
  ```
337
- Anti-Pattern Scan
338
- =================
339
- Files scanned: {count}
422
+ 🔍🐜 Anti-Pattern Scan — {count} files scanned
340
423
 
341
424
  {if critical issues:}
342
- 🛑 CRITICAL ISSUES (must fix):
425
+ 🛑 CRITICAL (must fix):
343
426
  {list each with file:line and description}
344
427
 
345
428
  {if warnings:}
346
- ⚠️ WARNINGS (review recommended):
429
+ ⚠️ WARNINGS:
347
430
  {list each with file:line and description}
348
431
 
349
432
  {if clean:}
350
- No anti-patterns detected
433
+ ✅🐜 No anti-patterns detected
351
434
  ```
352
435
 
353
436
  **CRITICAL issues block phase advancement:**
@@ -364,9 +447,9 @@ Files scanned: {count}
364
447
  If CRITICAL issues found, display:
365
448
 
366
449
  ```
367
- ANTI-PATTERN GATE FAILED
450
+ ⛔🐜 ANTI-PATTERN GATE FAILED
368
451
 
369
- Critical anti-patterns detected that must be fixed:
452
+ Critical anti-patterns detected:
370
453
  {list issues with file paths}
371
454
 
372
455
  Run /ant:build {phase} again after fixing.
@@ -374,9 +457,299 @@ Run /ant:build {phase} again after fixing.
374
457
 
375
458
  Do NOT proceed to Step 2.
376
459
 
377
- If no CRITICAL issues, continue to Step 1.8.
460
+ If no CRITICAL issues, continue to Step 1.7.1.
461
+
462
+ ### Step 1.7.1: Proactive Refactoring Gate (Conditional)
463
+
464
+ **Complexity-based refactoring -- runs when code exceeds maintainability thresholds.**
465
+
466
+ 1. **Get modified/created files from recent work:**
467
+ Run using the Bash tool with description "Getting modified files for complexity check...": `modified_files=$(git diff --name-only HEAD~1 2>/dev/null || git diff --name-only) && echo "$modified_files"`
468
+
469
+ 2. **Check complexity thresholds for each file:**
470
+
471
+ For each file, check:
472
+ - Line count > 300 lines
473
+ - Long functions > 50 lines (simplified heuristic)
474
+ - Directory density > 10 new files
475
+
476
+ Run using the Bash tool with description "Checking complexity thresholds...":
477
+ ```bash
478
+ modified_files=$(git diff --name-only HEAD~1 2>/dev/null || git diff --name-only)
479
+
480
+ complexity_trigger=false
481
+ files_needing_refactor=""
482
+
483
+ for file in $modified_files; do
484
+ if [[ -f "$file" ]]; then
485
+ line_count=$(wc -l < "$file" 2>/dev/null || echo "0")
486
+ if [[ "$line_count" -gt 300 ]]; then
487
+ complexity_trigger=true
488
+ files_needing_refactor="$files_needing_refactor $file"
489
+ continue
490
+ fi
491
+
492
+ long_funcs=$(grep -c "^[[:space:]]*[a-zA-Z_][a-zA-Z0-9_]*[[:space:]]*(" "$file" 2>/dev/null || echo "0")
493
+ if [[ "$long_funcs" -gt 50 ]]; then
494
+ complexity_trigger=true
495
+ files_needing_refactor="$files_needing_refactor $file"
496
+ fi
497
+ fi
498
+ done
499
+
500
+ if [[ -n "$modified_files" ]]; then
501
+ dir_counts=$(echo "$modified_files" | xargs -I {} dirname {} 2>/dev/null | sort | uniq -c | sort -rn)
502
+ high_density_dir=$(echo "$dir_counts" | awk '$1 > 10 {print $2}' | head -1)
503
+ if [[ -n "$high_density_dir" ]]; then
504
+ complexity_trigger=true
505
+ fi
506
+ fi
507
+
508
+ echo "{\"complexity_trigger\": \"$complexity_trigger\", \"files_needing_refactor\": \"$files_needing_refactor\"}"
509
+ ```
510
+
511
+ 3. **If complexity thresholds NOT exceeded:**
512
+ ```
513
+ Weaver: Complexity thresholds not exceeded -- skipping proactive refactoring
514
+ ```
515
+ Continue to Step 1.8.
516
+
517
+ 4. **If complexity thresholds exceeded:**
518
+
519
+ a. **Establish test baseline before refactoring:**
520
+ Run using the Bash tool with description "Establishing test baseline...": `test_output_before=$(npm test 2>&1 || echo "TEST_FAILED") && tests_passing_before=$(echo "$test_output_before" | grep -oE '[0-9]+ passing' | grep -oE '[0-9]+' || echo "0") && echo "Baseline: $tests_passing_before tests passing"`
521
+
522
+ b. **Generate Weaver name and dispatch:**
523
+ Run using the Bash tool with description "Generating Weaver name...": `weaver_name=$(bash .aether/aether-utils.sh generate-ant-name "weaver") && bash .aether/aether-utils.sh spawn-log "Queen" "weaver" "$weaver_name" "Proactive refactoring" && echo "{\"name\":\"$weaver_name\"}"`
524
+
525
+ c. **Display:**
526
+ ```
527
+ ━━━ 🔄🐜 W E A V E R ━━━
528
+ ──── 🔄🐜 Spawning {weaver_name} — Proactive refactoring ────
529
+ ```
530
+
531
+ e. **Spawn Weaver agent:**
532
+
533
+ > **Platform note**: In Claude Code, use `Task tool with subagent_type="aether-weaver"`. In OpenCode, use the equivalent agent spawning mechanism for your platform (e.g., invoke the aether-weaver agent definition from `.opencode/agents/aether-weaver.md`).
534
+
535
+ Weaver mission: Refactor complex code to improve maintainability while preserving behavior.
536
+ - Analyze target files for complexity issues
537
+ - Plan incremental refactoring steps
538
+ - Execute one step at a time
539
+ - Run tests after each step
540
+ - If tests pass, continue; if fail, revert and try smaller step
541
+ - Report all changes made
542
+
543
+ Constraints:
544
+ - NEVER change behavior -- only structure
545
+ - Run tests after each refactoring step
546
+ - If tests fail, revert immediately
547
+ - Do NOT modify test expectations to make tests pass
548
+ - Do NOT modify .aether/ system files
549
+
550
+ f. **Parse Weaver JSON output and verify tests:**
551
+ Extract: `files_refactored`, `tests_all_passing`, `complexity_before`, `complexity_after`
552
+
553
+ Run using the Bash tool with description "Verifying tests after refactoring...":
554
+ ```bash
555
+ test_output_after=$(npm test 2>&1 || echo "TEST_FAILED")
556
+ tests_passing_after=$(echo "$test_output_after" | grep -oE '[0-9]+ passing' | grep -oE '[0-9]+' || echo "0")
557
+
558
+ if [[ "$tests_passing_after" -lt "$tests_passing_before" ]]; then
559
+ echo "REVERT_NEEDED: Tests failed after refactoring"
560
+ git checkout -- $files_needing_refactor
561
+ weaver_status="reverted"
562
+ else
563
+ echo "PASSING: Tests passing after refactoring ($tests_passing_after)"
564
+ weaver_status="completed"
565
+ fi
566
+ ```
567
+
568
+ g. **Log completion:**
569
+ Run using the Bash tool with description "Logging Weaver completion...": `bash .aether/aether-utils.sh spawn-complete "$weaver_name" "$weaver_status" "Refactoring $weaver_status"`
570
+
571
+ h. **Log to midden:**
572
+ Run using the Bash tool with description "Logging refactoring activity to midden...": `bash .aether/aether-utils.sh midden-write "refactoring" "Weaver refactored files, complexity before/after: ${complexity_before}/${complexity_after}" "weaver"`
573
+
574
+ 5. **Display completion:**
575
+ ```
576
+ Weaver: Proactive refactoring {weaver_status}
577
+ Files refactored: {count} | Complexity: {before} -> {after}
578
+ ```
579
+
580
+ 6. **NON-BLOCKING continuation:**
581
+ The Weaver step is NON-BLOCKING -- continue to Step 1.8 regardless of refactoring results.
582
+
583
+ Continue to Step 1.8.
584
+
585
+ ### Step 1.8: Gatekeeper Security Gate (Conditional)
586
+
587
+ **Supply chain security audit -- runs only when package.json exists.**
588
+
589
+ First, check for package.json:
590
+ Run using the Bash tool with description "Checking for package.json...": `test -f package.json && echo "exists" || echo "missing"`
591
+
592
+ **If package.json is missing:**
593
+ ```
594
+ Gatekeeper: No package.json found -- skipping supply chain audit
595
+ ```
596
+ Continue to Step 1.9.
597
+
598
+ **If package.json exists:**
599
+
600
+ 1. Generate Gatekeeper name and log spawn:
601
+ Run using the Bash tool with description "Generating Gatekeeper name...": `gatekeeper_name=$(bash .aether/aether-utils.sh generate-ant-name "gatekeeper") && bash .aether/aether-utils.sh spawn-log "Queen" "gatekeeper" "$gatekeeper_name" "Supply chain security audit" && echo "{\"name\":\"$gatekeeper_name\"}"`
602
+
603
+ 2. Display:
604
+ ```
605
+ ━━━ 📦🐜 G A T E K E E P E R ━━━
606
+ ──── 📦🐜 Spawning {gatekeeper_name} — Supply chain security audit ────
607
+ ```
608
+
609
+ 4. Spawn Gatekeeper agent:
610
+
611
+ > **Platform note**: In Claude Code, use `Task tool with subagent_type="aether-gatekeeper"`. In OpenCode, use the equivalent agent spawning mechanism for your platform (e.g., invoke the aether-gatekeeper agent definition from `.opencode/agents/aether-gatekeeper.md`).
612
+
613
+ Gatekeeper mission: Perform supply chain security audit on this codebase.
614
+ - Inventory all dependencies from package.json
615
+ - Scan for known CVEs using npm audit or equivalent
616
+ - Check license compliance for all packages
617
+ - Assess dependency health (outdated, deprecated, maintenance status)
618
+ - Report findings with severity levels
619
+
620
+ 5. Parse Gatekeeper JSON output and log completion:
621
+ Extract: `security.critical`, `security.high`, `status`
622
+
623
+ Run using the Bash tool with description "Logging Gatekeeper completion...": `bash .aether/aether-utils.sh spawn-complete "$gatekeeper_name" "completed" "{gatekeeper_summary}"`
624
+
625
+ **Gate Decision Logic:**
626
+
627
+ - **If `security.critical > 0`:**
628
+ ```
629
+ GATEKEEPER GATE FAILED
630
+
631
+ Critical security vulnerabilities detected: {critical_count}
632
+
633
+ CRITICAL CVEs must be fixed before phase advancement.
634
+
635
+ Required Actions:
636
+ 1. Run `npm audit` to see full details
637
+ 2. Fix or update vulnerable dependencies
638
+ 3. Run /ant:continue again after resolving
639
+
640
+ The phase will NOT advance with critical CVEs.
641
+ ```
642
+ **CRITICAL:** Do NOT proceed to Step 1.9. Stop here.
643
+
644
+ - **If `security.high > 0`:**
645
+ ```
646
+ Gatekeeper: {high_count} high-severity issues found
647
+
648
+ Security warnings logged to midden for later review.
649
+ Proceeding with caution...
650
+ ```
651
+ Run using the Bash tool with description "Logging high-severity warnings...": `bash .aether/aether-utils.sh midden-write "security" "High CVEs found: $high_count" "gatekeeper"`
652
+ Continue to Step 1.9.
653
+
654
+ - **If clean (no critical or high):**
655
+ ```
656
+ Gatekeeper: No critical security issues found
657
+ ```
658
+ Continue to Step 1.9.
659
+
660
+ ### Step 1.9: Auditor Quality Gate (MANDATORY)
661
+
662
+ **Code quality audit -- runs on every `/ant:continue` for consistent coverage.**
378
663
 
379
- ### Step 1.8: TDD Evidence Gate (MANDATORY)
664
+ 1. Generate Auditor name and log spawn:
665
+ Run using the Bash tool with description "Generating Auditor name...": `auditor_name=$(bash .aether/aether-utils.sh generate-ant-name "auditor") && bash .aether/aether-utils.sh spawn-log "Queen" "auditor" "$auditor_name" "Code quality audit" && echo "{\"name\":\"$auditor_name\"}"`
666
+
667
+ 2. Display:
668
+ ```
669
+ ━━━ 👥🐜 A U D I T O R ━━━
670
+ ──── 👥🐜 Spawning {auditor_name} — Code quality audit ────
671
+ ```
672
+
673
+ 4. Get modified files for audit context:
674
+ Run using the Bash tool with description "Getting modified files...": `modified_files=$(git diff --name-only HEAD~1 2>/dev/null || git diff --name-only) && echo "$modified_files"`
675
+
676
+ 5. Spawn Auditor agent:
677
+
678
+ > **Platform note**: In Claude Code, use `Task tool with subagent_type="aether-auditor"`. In OpenCode, use the equivalent agent spawning mechanism for your platform (e.g., invoke the aether-auditor agent definition from `.opencode/agents/aether-auditor.md`).
679
+
680
+ Auditor mission: Perform comprehensive code quality audit on this codebase.
681
+ - Review all modified files from the recent commit(s)
682
+ - Apply all 4 audit lenses: security, performance, quality, maintainability
683
+ - Score each finding by severity (CRITICAL/HIGH/MEDIUM/LOW/INFO)
684
+ - Calculate overall quality score (0-100)
685
+ - Document specific issues with file:line references and fix suggestions
686
+
687
+ 6. Parse Auditor JSON output and log completion:
688
+ Extract: `findings.critical`, `findings.high`, `findings.medium`, `findings.low`, `findings.info`, `overall_score`, `dimensions_audited`
689
+
690
+ Run using the Bash tool with description "Logging Auditor completion...": `bash .aether/aether-utils.sh spawn-complete "$auditor_name" "completed" "{auditor_summary}"`
691
+
692
+ **Gate Decision Logic:**
693
+
694
+ - **If `findings.critical > 0`:**
695
+ ```
696
+ AUDITOR GATE FAILED
697
+
698
+ Critical code quality issues detected: {critical_count}
699
+
700
+ CRITICAL findings must be fixed before phase advancement.
701
+
702
+ Required Actions:
703
+ 1. Review the critical issues listed below
704
+ 2. Fix each critical finding
705
+ 3. Run /ant:continue again after resolving
706
+
707
+ Critical Findings:
708
+ {list each critical finding with file:line and description}
709
+
710
+ The phase will NOT advance with critical quality issues.
711
+ ```
712
+ Run using the Bash tool with description "Logging critical quality block...": `bash .aether/aether-utils.sh error-flag-pattern "auditor-critical-findings" "$critical_count critical quality issues found" "critical"`
713
+ **CRITICAL:** Do NOT proceed to Step 1.10. Stop here.
714
+
715
+ - **Else if `overall_score < 60`:**
716
+ ```
717
+ AUDITOR GATE FAILED
718
+
719
+ Code quality score below threshold: {overall_score}/100 (threshold: 60)
720
+
721
+ Quality score must reach 60+ before phase advancement.
722
+
723
+ Required Actions:
724
+ 1. Address the top issues preventing score improvement
725
+ 2. Focus on HIGH severity items first
726
+ 3. Run /ant:continue again after improving quality
727
+
728
+ The phase will NOT advance with quality score below 60.
729
+ ```
730
+ Run using the Bash tool with description "Logging quality score block...": `bash .aether/aether-utils.sh error-flag-pattern "auditor-quality-score" "Score $overall_score below threshold 60" "critical"`
731
+ **CRITICAL:** Do NOT proceed to Step 1.10. Stop here.
732
+
733
+ - **Else if `findings.high > 0`:**
734
+ ```
735
+ Auditor: Quality score {overall_score}/100 -- PASSED with warnings
736
+
737
+ {high_count} high-severity quality issues found:
738
+ {list high findings}
739
+
740
+ Quality warnings logged to midden for later review.
741
+ Proceeding with caution...
742
+ ```
743
+ Run using the Bash tool with description "Logging high-quality warnings...": `bash .aether/aether-utils.sh midden-write "quality" "High severity issues: $high_count (score: $overall_score)" "auditor"`
744
+ Continue to Step 1.10.
745
+
746
+ - **If clean (score >= 60, no critical):**
747
+ ```
748
+ Auditor: Quality score {overall_score}/100 -- PASSED
749
+ ```
750
+ Continue to Step 1.10.
751
+
752
+ ### Step 1.10: TDD Evidence Gate (MANDATORY)
380
753
 
381
754
  **The Iron Law:** No TDD claims without actual test files.
382
755
 
@@ -390,21 +763,20 @@ find . -name "*.test.*" -o -name "*_test.*" -o -name "*Tests.swift" -o -name "te
390
763
  **If Prime Worker claimed tests_added > 0 but no test files found:**
391
764
 
392
765
  ```
393
- ⛔ TDD GATE FAILED - FABRICATED METRICS
766
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
767
+ ⛔🧪🐜 T D D G A T E F A I L E D
768
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
394
769
 
395
770
  Prime Worker claimed:
396
771
  tests_added: {claimed_count}
397
772
  tests_total: {claimed_total}
398
- coverage_percent: {claimed_coverage}%
773
+ coverage: {claimed_coverage}%
399
774
 
400
775
  But no test files were found in the codebase.
401
776
 
402
- This is a CRITICAL violation:
403
- - TDD metrics were fabricated
404
- - No actual tests were written
405
- - "All passing: true" was a lie
777
+ 🚨 CRITICAL violation fabricated TDD metrics.
406
778
 
407
- Required Actions:
779
+ 🔧 Required Actions:
408
780
  1. Run /ant:build {phase} again
409
781
  2. Actually write test files (not just claim them)
410
782
  3. Tests must exist and be runnable
@@ -419,9 +791,9 @@ bash .aether/aether-utils.sh error-flag-pattern "fabricated-tdd" "Prime Worker r
419
791
 
420
792
  **If tests_added == 0 or test files exist matching claims:**
421
793
 
422
- Continue to Step 1.9.
794
+ Continue to Step 1.11.
423
795
 
424
- ### Step 1.9: Runtime Verification Gate (MANDATORY)
796
+ ### Step 1.11: Runtime Verification Gate (MANDATORY)
425
797
 
426
798
  **The Iron Law:** Build passing ≠ App working.
427
799
 
@@ -430,10 +802,11 @@ Before advancing, the user must confirm the application actually runs.
430
802
  Use AskUserQuestion:
431
803
 
432
804
  ```
433
- Runtime Verification Required
434
- =============================
805
+ ──────────────────────────────────────────────────
806
+ 🐜 Runtime Verification Required
807
+ ──────────────────────────────────────────────────
435
808
 
436
- Build and compile checks passed, but we need to verify the app actually works.
809
+ Build checks passed but does the app actually work?
437
810
 
438
811
  Have you tested the application at runtime?
439
812
  ```
@@ -446,18 +819,13 @@ Options:
446
819
 
447
820
  **If "Yes, tested and working":**
448
821
  ```
449
- RUNTIME VERIFICATION PASSED
450
-
451
- User confirmed application runs correctly.
452
- Proceeding to phase advancement.
822
+ ✅🐜 RUNTIME VERIFIED — User confirmed app works.
453
823
  ```
454
- Continue to Step 2.
824
+ Continue to Step 1.12.
455
825
 
456
826
  **If "Yes, tested but has issues":**
457
827
  ```
458
- RUNTIME GATE FAILED
459
-
460
- User reported runtime issues. The phase cannot advance with a broken app.
828
+ ⛔🐜 RUNTIME GATE FAILED — User reported issues.
461
829
 
462
830
  Please describe the issues so they can be addressed:
463
831
  ```
@@ -471,17 +839,12 @@ Do NOT proceed to Step 2.
471
839
 
472
840
  **If "No, haven't tested yet":**
473
841
  ```
474
- ⏸️ RUNTIME VERIFICATION PENDING
842
+ ⏸️🐜 RUNTIME PENDING — Test the app, then run /ant:continue again.
475
843
 
476
- Please test the application and run /ant:continue again.
477
-
478
- Testing checklist:
479
844
  - [ ] App launches without crashing
480
845
  - [ ] Core features work as expected
481
846
  - [ ] UI responds to user interaction
482
847
  - [ ] No freezes or hangs
483
-
484
- Come back when you've tested.
485
848
  ```
486
849
 
487
850
  Do NOT proceed to Step 2.
@@ -497,9 +860,9 @@ User indicated no runnable app for this phase.
497
860
  Proceeding to phase advancement.
498
861
  ```
499
862
 
500
- Continue to Step 1.10.
863
+ Continue to Step 1.12.
501
864
 
502
- ### Step 1.10: Flags Gate (MANDATORY)
865
+ ### Step 1.12: Flags Gate (MANDATORY)
503
866
 
504
867
  **The Iron Law:** No phase advancement with unresolved blockers.
505
868
 
@@ -518,19 +881,19 @@ Parse result for `blockers`, `issues`, and `notes` counts.
518
881
  **If blockers > 0:**
519
882
 
520
883
  ```
521
- ⛔ FLAGS GATE FAILED - BLOCKERS ACTIVE
884
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
885
+ ⛔🚩🐜 F L A G S G A T E F A I L E D
886
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
522
887
 
523
- {blockers} blocking flag(s) must be resolved before phase advancement.
888
+ {blockers} blocker(s) must be resolved first.
524
889
 
525
- Active Blockers:
890
+ 🚩 Active Blockers:
526
891
  {list each blocker flag with ID, title, and description}
527
892
 
528
- Required Actions:
893
+ 🔧 Required Actions:
529
894
  1. Fix the issues described in each blocker
530
895
  2. Resolve flags: /ant:flags --resolve {flag_id} "resolution message"
531
896
  3. Run /ant:continue again after resolving all blockers
532
-
533
- The phase will NOT advance with active blockers.
534
897
  ```
535
898
 
536
899
  **CRITICAL:** Do NOT proceed to Step 2. Do NOT advance the phase.
@@ -538,15 +901,11 @@ The phase will NOT advance with active blockers.
538
901
  **If blockers == 0 but issues > 0:**
539
902
 
540
903
  ```
541
- ⚠️ FLAGS GATE: ISSUES NOTED
542
-
543
- No blockers, but {issues} issue(s) are active.
544
- These don't block advancement but should be addressed.
904
+ ⚠️🐜 FLAGS: {issues} issue(s) noted (non-blocking)
545
905
 
546
- Active Issues:
547
906
  {list each issue flag}
548
907
 
549
- Use /ant:flags to review and acknowledge or resolve.
908
+ Use /ant:flags to review.
550
909
  ```
551
910
 
552
911
  Continue to Step 2.
@@ -554,9 +913,7 @@ Continue to Step 2.
554
913
  **If all clear (no blockers or issues):**
555
914
 
556
915
  ```
557
- FLAGS GATE PASSED
558
-
559
- No blocking flags. Proceeding to phase advancement.
916
+ ✅🐜 FLAGS GATE PASSED — No blockers.
560
917
  ```
561
918
 
562
919
  Continue to Step 2.
@@ -612,6 +969,38 @@ Update COLONY_STATE.json:
612
969
  - It's stating the obvious
613
970
  - There's no evidence it works
614
971
 
972
+ 2.5. **Record learning observations for threshold tracking:**
973
+
974
+ For each learning extracted, record an observation to enable threshold-based wisdom promotion.
975
+
976
+ Run using the Bash tool with description "Recording learning observations...":
977
+ ```bash
978
+ colony_name=$(bash .aether/aether-utils.sh colony-name 2>/dev/null | jq -r '.result.name // ""')
979
+ [[ -z "$colony_name" ]] && colony_name="unknown"
980
+
981
+ # Get learnings from the current phase
982
+ current_phase_learnings=$(jq -r --argjson phase "$current_phase" '.memory.phase_learnings[] | select(.phase == $phase)' .aether/data/COLONY_STATE.json 2>/dev/null || echo "")
983
+
984
+ if [[ -n "$current_phase_learnings" ]]; then
985
+ echo "$current_phase_learnings" | jq -r '.learnings[]?.claim // empty' 2>/dev/null | while read -r claim; do
986
+ if [[ -n "$claim" ]]; then
987
+ # Default wisdom_type to "pattern" (threshold: 3 observations)
988
+ bash .aether/aether-utils.sh memory-capture "learning" "$claim" "pattern" "worker:continue" 2>/dev/null || true
989
+ fi
990
+ done
991
+ echo "Recorded observations for threshold tracking"
992
+ else
993
+ echo "No learnings to record"
994
+ fi
995
+ ```
996
+
997
+ This records each learning in `learning-observations.json` with:
998
+ - Content hash for deduplication (same claim across phases increments count)
999
+ - Observation count (increments if seen before)
1000
+ - Colony name for cross-colony tracking
1001
+
1002
+ When observations reach threshold (default: 3 for "pattern" type), they become eligible for promotion in Step 2.1.5.
1003
+
615
1004
  3. **Extract instincts from patterns:**
616
1005
 
617
1006
  Read activity.log for patterns from this phase's build.
@@ -671,7 +1060,106 @@ Update COLONY_STATE.json:
671
1060
 
672
1061
  Write COLONY_STATE.json.
673
1062
 
674
- ### Step 2.3: Update Handoff Document
1063
+ Validate the state file:
1064
+ Run using the Bash tool with description "Validating colony state...": `bash .aether/aether-utils.sh validate-state colony`
1065
+
1066
+ ### Step 2.1: Auto-Emit Phase Pheromones (SILENT)
1067
+
1068
+ **This entire step produces NO user-visible output.** All pheromone operations run silently -- learnings are deposited in the background. If any pheromone call fails, log the error and continue. Phase advancement must never fail due to pheromone errors.
1069
+
1070
+ #### 2.1a: Auto-emit FEEDBACK pheromone for phase outcome
1071
+
1072
+ After learning extraction completes in Step 2, auto-emit a FEEDBACK signal summarizing the phase:
1073
+
1074
+ ```bash
1075
+ # phase_id and phase_name come from Step 2 state update
1076
+ # Take the top 1-3 learnings by evidence strength from memory.phase_learnings
1077
+ # Compress into a single summary sentence
1078
+
1079
+ phase_feedback="Phase $phase_id ($phase_name) completed. Key patterns: {brief summary of 1-3 learnings from Step 2}"
1080
+ # Fallback if no learnings: "Phase $phase_id ($phase_name) completed without notable patterns."
1081
+
1082
+ bash .aether/aether-utils.sh pheromone-write FEEDBACK "$phase_feedback" \
1083
+ --strength 0.6 \
1084
+ --source "worker:continue" \
1085
+ --reason "Auto-emitted on phase advance: captures what worked and what was learned" \
1086
+ --ttl "30d" 2>/dev/null || true
1087
+ ```
1088
+
1089
+ The strength is 0.6 (auto-emitted = lower than user-emitted 0.7). Source is "worker:continue" to distinguish from user-emitted feedback. TTL is 30d so it survives phase transitions and can guide subsequent work.
1090
+
1091
+ #### 2.1b: Auto-emit REDIRECT for recurring error patterns
1092
+
1093
+ Check `errors.flagged_patterns[]` in COLONY_STATE.json for patterns that have appeared in 2+ phases:
1094
+
1095
+ ```bash
1096
+ flagged_patterns=$(jq -r '.errors.flagged_patterns[]? | select(.count >= 2) | .pattern' .aether/data/COLONY_STATE.json 2>/dev/null || true)
1097
+ ```
1098
+
1099
+ For each pattern returned by the above query, emit a REDIRECT signal:
1100
+
1101
+ ```bash
1102
+ bash .aether/aether-utils.sh pheromone-write REDIRECT "$pattern_text" \
1103
+ --strength 0.7 \
1104
+ --source "system" \
1105
+ --reason "Auto-emitted: error pattern recurred across 2+ phases" \
1106
+ --ttl "30d" 2>/dev/null || true
1107
+ ```
1108
+
1109
+ Also capture each recurring pattern as a resolution candidate:
1110
+
1111
+ ```bash
1112
+ bash .aether/aether-utils.sh memory-capture \
1113
+ "resolution" \
1114
+ "$pattern_text" \
1115
+ "pattern" \
1116
+ "worker:continue" 2>/dev/null || true
1117
+ ```
1118
+
1119
+ If `errors.flagged_patterns` doesn't exist or is empty, skip silently.
1120
+
1121
+ #### 2.1c: Expire phase_end signals and archive to midden
1122
+
1123
+ After auto-emission, expire all signals with `expires_at == "phase_end"`:
1124
+
1125
+ Run using the Bash tool with description "Maintaining pheromone memory...": `bash .aether/aether-utils.sh pheromone-expire --phase-end-only 2>/dev/null && bash .aether/aether-utils.sh eternal-init 2>/dev/null`
1126
+
1127
+ ### Step 2.1.5: Check for Promotion Proposals
1128
+
1129
+ After extracting learnings, check for observations that have met promotion thresholds and present the tick-to-approve UX.
1130
+
1131
+ **Normal proposal flow (MEM-01: Silent skip if empty):**
1132
+
1133
+ 1. **Check for proposals:**
1134
+ ```bash
1135
+ proposals=$(bash .aether/aether-utils.sh learning-check-promotion 2>/dev/null || echo '{"proposals":[]}')
1136
+ proposal_count=$(echo "$proposals" | jq '.proposals | length')
1137
+ ```
1138
+
1139
+ 2. **If proposals exist, invoke the approval workflow:**
1140
+
1141
+ Only show the approval UI when there are actual proposals to review:
1142
+
1143
+ ```bash
1144
+ if [[ "$proposal_count" -gt 0 ]]; then
1145
+ bash .aether/aether-utils.sh learning-approve-proposals
1146
+ fi
1147
+ # If no proposals, silently skip without notice
1148
+ ```
1149
+
1150
+ The learning-approve-proposals function handles:
1151
+ - Displaying proposals with checkbox UI
1152
+ - Capturing user selection
1153
+ - Executing batch promotions via queen-promote
1154
+ - Deferring unselected proposals
1155
+ - Offering undo after successful promotions
1156
+
1157
+ **Skip conditions:**
1158
+ - learning-check-promotion returns empty or fails
1159
+ - No proposals to review (silent skip - no output)
1160
+ - QUEEN.md does not exist
1161
+
1162
+ ### Step 2.2: Update Handoff Document
675
1163
 
676
1164
  After advancing the phase, update the handoff document with the new current state:
677
1165
 
@@ -714,33 +1202,46 @@ HANDOFF_EOF
714
1202
 
715
1203
  This handoff reflects the post-advancement state, allowing seamless resumption even if the session is lost.
716
1204
 
717
- ### Step 2.4: Update Changelog
1205
+ ### Step 2.3: Update Changelog
718
1206
 
719
- **Append a changelog entry for the completed phase.**
1207
+ **MANDATORY: Append a changelog entry for the completed phase. This step is never skipped.**
720
1208
 
721
- If `CHANGELOG.md` exists in the project root:
1209
+ If no `CHANGELOG.md` exists, `changelog-append` creates one automatically.
722
1210
 
723
- 1. Read the file
724
- 2. Find the `## [Unreleased]` section
725
- 3. Under the appropriate sub-heading (`### Added`, `### Changed`, or `### Fixed`), append a bullet for the completed phase:
1211
+ **Step 2.3.1: Collect plan data**
726
1212
 
727
- ```
728
- - **Phase {id}: {phase_name}** — {one-line summary of what was accomplished}. ({list of key files modified})
1213
+ ```bash
1214
+ bash .aether/aether-utils.sh changelog-collect-plan-data "{phase_identifier}" "{plan_number}"
729
1215
  ```
730
1216
 
731
- **Determining the sub-heading:**
732
- - If the phase created new features/commands → `### Added`
733
- - If the phase modified existing behavior → `### Changed`
734
- - If the phase fixed bugs → `### Fixed`
735
- - If unclear, default to `### Changed`
1217
+ Parse the returned JSON to extract `files`, `decisions`, `worked`, and `requirements` arrays.
736
1218
 
737
- **The one-line summary** should describe the user-visible outcome, not implementation details. Derive it from the phase description and task summaries.
1219
+ - `{phase_identifier}` is the full phase name (e.g., `36-memory-capture`)
1220
+ - `{plan_number}` is the plan number (e.g., `01`)
738
1221
 
739
- **If no `## [Unreleased]` section exists**, create one at the top of the file (after the header).
1222
+ If the command fails (e.g., no plan file found), fall back to collecting data manually:
1223
+ - Files: from `git diff --stat` of the completed phase
1224
+ - Decisions: from COLONY_STATE.json `memory.decisions` (last 5)
1225
+ - Worked/requirements: leave empty
740
1226
 
741
- **If no `CHANGELOG.md` exists**, skip this step silently.
1227
+ **Step 2.3.2: Append changelog entry**
742
1228
 
743
- ### Step 2.6: Commit Suggestion (Optional)
1229
+ ```bash
1230
+ bash .aether/aether-utils.sh changelog-append \
1231
+ "$(date +%Y-%m-%d)" \
1232
+ "{phase_identifier}" \
1233
+ "{plan_number}" \
1234
+ "{files_csv}" \
1235
+ "{decisions_semicolon_separated}" \
1236
+ "{worked_semicolon_separated}" \
1237
+ "{requirements_csv}"
1238
+ ```
1239
+
1240
+ This atomically writes the entry. If the project already has a Keep a Changelog format, it adds a "Colony Work Log" separator section to keep both formats clean.
1241
+
1242
+ **Error handling:** If `changelog-append` fails, log to midden and continue — changelog failure never blocks phase advancement.
1243
+
1244
+ ### Step 2.4: Commit Suggestion (Optional)
744
1245
 
745
1246
  **This step is non-blocking. Skipping does not affect phase advancement or any subsequent steps. Failure to commit has zero consequences.**
746
1247
 
@@ -801,9 +1302,9 @@ Set `last_commit_suggestion_phase` to `{phase_id}` in COLONY_STATE.json (add the
801
1302
 
802
1303
  **Error handling:** If any git command fails (not a repo, merge conflict, pre-commit hook rejection), display the error output and continue to the next step. The commit suggestion is advisory only -- it never blocks the flow.
803
1304
 
804
- Continue to Step 2.7 (Context Clear Suggestion), then to Step 2.5 (Project Completion) or Step 3 (Display Result).
1305
+ Continue to Step 2.5 (Context Clear Suggestion), then to Step 2.7 (Project Completion) or Step 3 (Display Result).
805
1306
 
806
- ### Step 2.7: Context Clear Suggestion (Optional)
1307
+ ### Step 2.5: Context Clear Suggestion (Optional)
807
1308
 
808
1309
  **This step is non-blocking. Skipping does not affect phase advancement.**
809
1310
 
@@ -831,21 +1332,39 @@ Clear context now?
831
1332
 
832
1333
  3. **If option 1 ("Yes, clear context"):**
833
1334
 
834
- **IMPORTANT:** Claude Code does not support programmatic /clear. Display instructions:
1335
+ **IMPORTANT:** Most AI platforms do not support programmatic context clearing. Display instructions:
835
1336
  ```
836
- Please type: /clear
837
-
838
- Then run: /ant:build {next_id}
1337
+ Please clear your context/conversation, then run: /ant:build {next_id}
839
1338
  ```
840
-
1339
+
841
1340
  Record the suggestion: Set `context_clear_suggested` to `true` in COLONY_STATE.json.
842
1341
 
843
1342
  4. **If option 2 ("No, continue in current context"):**
844
1343
  Display: `Continuing in current context. State is saved.`
845
1344
 
846
- Continue to Step 2.5 (Project Completion) or Step 3 (Display Result).
1345
+ Continue to Step 2.6 (Context Update), then Step 2.7 (Project Completion) or Step 3 (Display Result).
1346
+
1347
+ ### Step 2.6: Update Context Document
1348
+
1349
+ After phase advancement is complete, update `.aether/CONTEXT.md`:
847
1350
 
848
- ### Step 2.5: Project Completion
1351
+ **Log the activity:**
1352
+ ```bash
1353
+ bash .aether/aether-utils.sh context-update activity "continue" "Phase {prev_id} completed, advanced to {next_id}" "---"
1354
+ ```
1355
+
1356
+ **Update the phase:**
1357
+ ```bash
1358
+ bash .aether/aether-utils.sh context-update update-phase {next_id} "{next_phase_name}" "YES" "Phase advanced, ready to build"
1359
+ ```
1360
+
1361
+ **Log any decisions from this session:**
1362
+ If any architectural decisions were made during verification, also run:
1363
+ ```bash
1364
+ bash .aether/aether-utils.sh context-update decision "{decision_description}" "{rationale}" "Queen"
1365
+ ```
1366
+
1367
+ ### Step 2.7: Project Completion
849
1368
 
850
1369
  Runs ONLY when all phases complete.
851
1370
 
@@ -876,12 +1395,6 @@ Runs ONLY when all phases complete.
876
1395
 
877
1396
  ### Step 3: Display Result
878
1397
 
879
- **If visual_mode is true, render final swarm display:**
880
- ```bash
881
- bash .aether/aether-utils.sh swarm-display-update "Queen" "prime" "completed" "Phase advanced" "Colony" '{"read":5,"grep":2,"edit":3,"bash":2}' 100 "fungus_garden" 100
882
- bash .aether/aether-utils.sh swarm-display-render "$continue_id"
883
- ```
884
-
885
1398
  Output:
886
1399
 
887
1400
  ```
@@ -915,3 +1428,9 @@ Output:
915
1428
  ```
916
1429
 
917
1430
  **IMPORTANT:** In the "Next Steps" section above, substitute the actual phase number for `{next_id}` (calculated in Step 2 as `current_phase + 1`). For example, if advancing to phase 4, output `/ant:build 4` not `/ant:build {next_id}`.
1431
+
1432
+ ### Step 4: Update Session
1433
+
1434
+ Update the session tracking file to enable `/ant:resume` after context clear:
1435
+
1436
+ Run using the Bash tool with description "Saving session state...": `bash .aether/aether-utils.sh session-update "/ant:continue" "/ant:build {next_id}" "Phase {prev_id} completed, advanced to Phase {next_id}"`