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,9 +1,10 @@
1
+ <!-- Generated from .aether/commands/seal.yaml - DO NOT EDIT DIRECTLY -->
1
2
  ---
2
3
  name: ant:seal
3
4
  description: "🏺🐜🏺 Seal the colony with Crowned Anthill milestone"
4
5
  ---
5
6
 
6
- You are the **Queen**. Seal the colony when all work is complete.
7
+ You are the **Queen**. Seal the colony with a ceremony no archiving.
7
8
 
8
9
  ## Instructions
9
10
 
@@ -11,18 +12,40 @@ Parse `$ARGUMENTS`:
11
12
  - If contains `--no-visual`: set `visual_mode = false` (visual is ON by default)
12
13
  - Otherwise: set `visual_mode = true`
13
14
 
15
+ <failure_modes>
16
+ ### Crowned Anthill Write Failure
17
+ If writing the Crowned Anthill milestone document fails:
18
+ - Do not mark the colony as sealed in state
19
+ - Report the error -- sealing is incomplete
20
+ - Recovery: user can re-run /ant:seal after fixing the issue
21
+
22
+ ### State Update Failure After Seal
23
+ If COLONY_STATE.json update fails after seal document is written:
24
+ - The seal document exists but state doesn't reflect it
25
+ - Report the inconsistency
26
+ - Options: (1) Retry state update only, (2) Manual state fix, (3) Re-run /ant:seal
27
+ </failure_modes>
28
+
29
+ <success_criteria>
30
+ Command is complete when:
31
+ - Crowned Anthill milestone document is written
32
+ - COLONY_STATE.json reflects sealed status
33
+ - All phase evidence is summarized in the seal document
34
+ - User sees confirmation of successful seal
35
+ </success_criteria>
36
+
37
+ <read_only>
38
+ Do not touch during seal:
39
+ - .aether/dreams/ (user notes)
40
+ - .aether/chambers/ (archived colonies -- seal does NOT archive)
41
+ - Source code files
42
+ - .env* files
43
+ - .claude/settings.json
44
+ </read_only>
45
+
14
46
  ### Step 0: Initialize Visual Mode (if enabled)
15
47
 
16
48
  If `visual_mode` is true:
17
- ```bash
18
- # Generate session ID
19
- seal_id="seal-$(date +%s)"
20
-
21
- # Initialize swarm display
22
- bash .aether/aether-utils.sh swarm-display-init "$seal_id"
23
- bash .aether/aether-utils.sh swarm-display-update "Queen" "prime" "excavating" "Sealing colony" "Colony" '{"read":0,"grep":0,"edit":0,"bash":0}' 0 "fungus_garden" 0
24
- ```
25
-
26
49
  ### Step 1: Read State
27
50
 
28
51
  Read `.aether/data/COLONY_STATE.json`.
@@ -33,304 +56,710 @@ No colony initialized. Run /ant:init first.
33
56
  ```
34
57
  Stop here.
35
58
 
36
- #### Step 1.5: Check for Concurrent Seal Operations
59
+ Extract: `goal`, `state`, `current_phase`, `plan.phases`, `milestone`, `version`, `initialized_at`.
37
60
 
38
- Capture session start time:
39
- ```bash
40
- SEAL_START=$(date +%s)
41
- ```
61
+ ### Step 2: Maturity Gate
42
62
 
43
- Check for existing seal operations (in-progress archives):
44
- ```bash
45
- # Check for incomplete archive directories (no manifest.json)
46
- incomplete_archives=$(find .aether/data/archive -type d -name "session_*_archive" 2>/dev/null | while read dir; do
47
- if [[ ! -f "$dir/manifest.json" ]]; then
48
- echo "$dir"
49
- fi
50
- done)
63
+ Run `bash .aether/aether-utils.sh milestone-detect` to get `milestone`, `phases_completed`, `total_phases`.
51
64
 
52
- if [[ -n "$incomplete_archives" ]]; then
53
- echo "Warning: Incomplete archive operations detected:"
54
- echo "$incomplete_archives"
55
- echo ""
56
- echo "These may be from interrupted seal operations."
57
- echo "Proceeding will create a new archive."
58
- fi
65
+ **If milestone is already "Crowned Anthill":**
59
66
  ```
67
+ Colony already sealed at Crowned Anthill.
68
+ Run /ant:entomb to archive this colony to chambers.
69
+ ```
70
+ Stop here.
60
71
 
61
- ### Step 2: Validate Colony Is Complete
72
+ **If state is "EXECUTING":**
73
+ ```
74
+ Colony is still executing. Run /ant:continue first.
75
+ ```
76
+ Stop here.
62
77
 
63
- Extract: `goal`, `current_phase`, `plan.phases`, `milestone`, `state`.
78
+ **If all phases complete** (phases_completed == total_phases, or milestone is "Sealed Chambers"):
79
+ - Set `incomplete_warning = ""` (no warning needed)
80
+ - Proceed to Step 3.
64
81
 
65
- **Precondition 1: All phases must be completed**
82
+ **If phases are incomplete** (any other milestone — First Mound, Open Chambers, Brood Stable, Ventilated Nest, etc.):
83
+ - Set `incomplete_warning = "WARNING: {phases_completed} of {total_phases} phases complete. Sealing now will mark incomplete work as the final state."`
84
+ - Proceed to Step 3 (warn but DO NOT block).
66
85
 
67
- Check if all phases in `plan.phases` have `status: "completed"`:
68
- ```
69
- all_completed = all(phase.status == "completed" for phase in plan.phases)
70
- ```
86
+ ### Step 3: Confirmation
71
87
 
72
- If NOT all completed:
88
+ Display what will be sealed:
73
89
  ```
74
- Cannot archive colony with incomplete phases.
90
+ SEAL COLONY
91
+
92
+ Goal: {goal}
93
+ Phases: {phases_completed} of {total_phases} completed
94
+ Current Milestone: {milestone}
95
+
96
+ {If incomplete_warning is not empty, display it here}
75
97
 
76
- Completed phases: X of Y
77
- Remaining: {list of incomplete phase names}
98
+ This will:
99
+ - Award the Crowned Anthill milestone
100
+ - Write CROWNED-ANTHILL.md ceremony record
101
+ - Promote colony wisdom to QUEEN.md
78
102
 
79
- Run /ant:continue to complete remaining phases first.
103
+ Seal this colony? (yes/no)
80
104
  ```
81
- Stop here.
82
105
 
83
- **Precondition 2: State must not be EXECUTING**
106
+ Use `AskUserQuestion with yes/no options`.
84
107
 
85
- If `state == "EXECUTING"`:
108
+ If not "yes":
86
109
  ```
87
- Colony is still executing. Run /ant:continue to reconcile first.
110
+ Sealing cancelled. Colony remains active.
88
111
  ```
89
112
  Stop here.
90
113
 
91
- ### Step 3: Check Milestone Eligibility
114
+ ### Step 3.5: Analytics Review
92
115
 
93
- The full milestone progression is:
94
- - **First Mound** — Phase 1 complete (first runnable)
95
- - **Open Chambers** — Feature work underway (2+ phases complete)
96
- - **Brood Stable** — Tests consistently green
97
- - **Ventilated Nest** — Perf/latency acceptable (build + lint clean)
98
- - **Sealed Chambers** — All phases complete (interfaces frozen)
99
- - **Crowned Anthill** — Release-ready (user confirms via /ant:seal)
116
+ Before wisdom approval, spawn Sage to analyze colony trends and provide data-driven insights.
100
117
 
101
- **If current milestone is "Crowned Anthill":**
118
+ **Check phase threshold and spawn Sage:**
119
+ ```bash
120
+ # Check if colony has enough history for meaningful analytics
121
+ phases_completed=$(jq '[.plan.phases[] | select(.status == "completed")] | length' .aether/data/COLONY_STATE.json 2>/dev/null || echo "0")
122
+
123
+ if [[ "$phases_completed" -ge 3 ]]; then
124
+ # Generate Sage name and dispatch
125
+ sage_name=$(bash .aether/aether-utils.sh generate-ant-name "sage")
126
+ bash .aether/aether-utils.sh spawn-log "Queen" "sage" "$sage_name" "Colony analytics review"
127
+
128
+ # Display spawn notification
129
+ echo ""
130
+ echo "━━━ 📜🐜 S A G E ━━━"
131
+ echo "──── 📜🐜 Spawning $sage_name — Colony analytics review ────"
132
+ fi
102
133
  ```
103
- Colony is already at Crowned Anthill milestone.
104
- No further archiving needed.
105
134
 
106
- Use /ant:status to view colony state.
135
+ **Spawn Sage using Task tool when threshold is met:**
136
+ If phases_completed >= 3, spawn the Sage agent using Task tool with `subagent_type="aether-sage"`:
137
+
138
+ ```xml
139
+ <task>
140
+ <description>📜 Sage {sage_name}: Colony analytics review</description>
141
+ <prompt>
142
+ You are {sage_name}, a 📜 Sage Ant.
143
+
144
+ Mission: Analyze colony history and provide data-driven insights for wisdom promotion
145
+
146
+ Data Sources:
147
+ - COLONY_STATE.json: Colony configuration, phases, learnings, instincts
148
+ - activity.log: Activity history with timestamps
149
+ - midden.json: Failure patterns and flagged issues
150
+
151
+ Analysis Areas:
152
+ 1. Velocity Trends: Phase completion rate over time
153
+ 2. Bug Density: Error frequency and patterns from midden
154
+ 3. Review Turnaround: Time from build to continue
155
+
156
+ Work:
157
+ 1. Read COLONY_STATE.json for phase history and learnings
158
+ 2. Read activity.log for velocity patterns
159
+ 3. Read midden.json for bug density analysis
160
+ 4. Calculate metrics and identify trends
161
+ 5. Provide recommendations for wisdom promotion
162
+
163
+ **IMPORTANT:** You are strictly read-only. Do not modify any files.
164
+
165
+ Log activity: bash .aether/aether-utils.sh activity-log "ANALYZING" "{sage_name}" "description"
166
+
167
+ Return ONLY this JSON (no other text):
168
+ {{
169
+ "ant_name": "{sage_name}",
170
+ "caste": "sage",
171
+ "status": "completed" | "failed" | "blocked",
172
+ "summary": "What you analyzed and found",
173
+ "key_findings": [],
174
+ "trends": {{
175
+ "velocity": "increasing|stable|decreasing",
176
+ "bug_density": "high|medium|low",
177
+ "review_turnaround": "fast|moderate|slow"
178
+ }},
179
+ "metrics_analyzed": [],
180
+ "predictions": [],
181
+ "recommendations": [
182
+ {{"priority": 1, "action": "", "expected_impact": ""}}
183
+ ],
184
+ "next_steps": [],
185
+ "blockers": []
186
+ }}
187
+ </prompt>
188
+ </task>
107
189
  ```
108
- Stop here.
109
190
 
110
- **If current milestone is "Sealed Chambers":**
111
- - Proceed to Step 4 (will upgrade to Crowned Anthill)
191
+ **FALLBACK:** If "Agent type not found", use general-purpose agent and inject role: "You are a Sage Ant - analytics specialist that extracts trends from history to guide decisions."
112
192
 
113
- **If current milestone is "First Mound", "Open Chambers", "Brood Stable", "Ventilated Nest", or any intermediate milestone:**
114
- - Since all phases are complete, the colony qualifies for both Sealed Chambers and Crowned Anthill
115
- - The current logic allows proceeding to Step 4 (seal as Crowned Anthill)
116
- - If user wants to explicitly achieve Sealed Chambers first, they can manually update milestone via COLONY_STATE.json
193
+ **Parse Sage JSON output:**
194
+ After spawn, extract from response: `key_findings`, `trends`, `recommendations`
117
195
 
118
- **If milestone is unrecognized (not in the 6 known stages):**
196
+ Log completion and update swarm display:
197
+ ```bash
198
+ bash .aether/aether-utils.sh spawn-complete "$sage_name" "completed" "Analytics review complete"
119
199
  ```
120
- Unknown milestone: {milestone}
121
200
 
122
- The milestone "{milestone}" is not recognized.
123
- Known milestones: First Mound, Open Chambers, Brood Stable, Ventilated Nest, Sealed Chambers, Crowned Anthill
201
+ **Display Sage completion line:**
202
+ ```
203
+ 📜 {sage_name}: Colony analytics review complete ✓
204
+ Velocity: {trend} | Bug density: {level} | Review turnaround: {speed}
205
+ ```
124
206
 
125
- Run /ant:status to check colony state.
207
+ **Log high-priority recommendations to midden (non-blocking):**
208
+ For each recommendation with priority <= 2:
209
+ ```bash
210
+ bash .aether/aether-utils.sh midden-write "analytics" "Sage recommendation (P{priority}): {action}" "sage"
126
211
  ```
127
- Stop here.
128
212
 
129
- ### Step 4: Promote Colony Wisdom to QUEEN.md
213
+ **Display insights summary:**
214
+ ```
215
+ 📜 Sage Insights:
216
+ Key Findings: {count}
217
+ Top Recommendation: {first recommendation action}
218
+ ```
219
+
220
+ **Continue to Step 3.6 (non-blocking):**
221
+ Proceed to Step 3.6 regardless of Sage findings — Sage is strictly non-blocking.
222
+
223
+ **If phases_completed < 3:**
224
+ Skip silently (no output) — proceed directly to Step 3.6.
130
225
 
131
- Before archiving, extract and promote significant patterns and decisions from the colony:
226
+ ### Step 3.6: Wisdom Approval
227
+
228
+ Before sealing, review wisdom proposals accumulated during this colony's lifecycle.
132
229
 
133
230
  ```bash
134
- # Ensure QUEEN.md exists
135
- if [[ ! -f ".aether/docs/QUEEN.md" ]]; then
136
- bash .aether/aether-utils.sh queen-init >/dev/null 2>&1
231
+ # --- Batch auto-promotion for auto-threshold observations (QUEEN-02) ---
232
+ # Auto-promote observations meeting higher recurrence thresholds
233
+ # before presenting the interactive review for lower-threshold proposals.
234
+
235
+ obs_file=".aether/data/learning-observations.json"
236
+ auto_promoted_count=0
237
+
238
+ if [[ -f "$obs_file" ]]; then
239
+ for encoded in $(jq -r '.observations[] | @base64' "$obs_file" 2>/dev/null); do
240
+ content=$(echo "$encoded" | base64 -d | jq -r '.content // empty')
241
+ wisdom_type=$(echo "$encoded" | base64 -d | jq -r '.wisdom_type // "pattern"')
242
+ colony=$(echo "$encoded" | base64 -d | jq -r '.colonies[0] // "unknown"')
243
+ [[ -z "$content" ]] && continue
244
+
245
+ result=$(bash .aether/aether-utils.sh learning-promote-auto "$wisdom_type" "$content" "$colony" "learning" 2>/dev/null || echo '{}')
246
+ was_promoted=$(echo "$result" | jq -r '.result.promoted // false' 2>/dev/null || echo "false")
247
+ if [[ "$was_promoted" == "true" ]]; then
248
+ auto_promoted_count=$((auto_promoted_count + 1))
249
+ fi
250
+ done
137
251
  fi
138
252
 
139
- # Extract colony name from session_id or goal
140
- colony_name=$(jq -r '.session_id // empty' .aether/data/COLONY_STATE.json | sed 's/^session_//' | cut -d'_' -f1-3)
141
- [[ -z "$colony_name" ]] && colony_name=$(jq -r '.goal' .aether/data/COLONY_STATE.json | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | cut -c1-30)
142
-
143
- # Track promotion results
144
- promotions_made=0
145
- promotion_details=""
146
-
147
- # Extract and promote phase learnings (validated learnings with high confidence)
148
- while IFS= read -r learning; do
149
- claim=$(echo "$learning" | jq -r '.claim // empty')
150
- status=$(echo "$learning" | jq -r '.status // empty')
151
-
152
- if [[ -n "$claim" && "$status" == "validated" ]]; then
153
- # Determine type based on content patterns
154
- if echo "$claim" | grep -qi "never\|avoid\|don't\|do not"; then
155
- type="redirect"
156
- elif echo "$claim" | grep -qi "always\|should\|must\|pattern\|approach"; then
157
- type="pattern"
158
- elif echo "$claim" | grep -qi "use\|prefer\|technology\|tool\|library"; then
159
- type="stack"
160
- else
161
- type="philosophy"
162
- fi
253
+ if [[ "$auto_promoted_count" -gt 0 ]]; then
254
+ echo "Auto-promoted $auto_promoted_count observation(s) to QUEEN.md (met recurrence thresholds)"
255
+ echo ""
256
+ fi
257
+ # --- END Batch auto-promotion ---
163
258
 
164
- result=$(bash .aether/aether-utils.sh queen-promote "$type" "$claim" "$colony_name" 2>/dev/null)
165
- if echo "$result" | jq -e '.ok' >/dev/null 2>&1; then
166
- promotions_made=$((promotions_made + 1))
167
- promotion_details="${promotion_details} - Promoted ${type}: ${claim:0:60}...\n"
168
- fi
169
- fi
170
- done < <(jq -c '.memory.phase_learnings[]?.learnings[]? // empty' .aether/data/COLONY_STATE.json 2>/dev/null)
171
-
172
- # Extract and promote decisions
173
- while IFS= read -r decision; do
174
- description=$(echo "$decision" | jq -r '.description // .rationale // empty')
175
- [[ -z "$description" ]] && description=$(echo "$decision" | jq -r '.decision // empty')
176
-
177
- if [[ -n "$description" ]]; then
178
- result=$(bash .aether/aether-utils.sh queen-promote "pattern" "$description" "$colony_name" 2>/dev/null)
179
- if echo "$result" | jq -e '.ok' >/dev/null 2>&1; then
180
- promotions_made=$((promotions_made + 1))
181
- promotion_details="${promotion_details} - Promoted pattern from decision: ${description:0:60}...\n"
182
- fi
259
+ # Check for pending proposals
260
+ proposals=$(bash .aether/aether-utils.sh learning-check-promotion 2>/dev/null || echo '{"proposals":[]}')
261
+ proposal_count=$(echo "$proposals" | jq '.proposals | length')
262
+
263
+ if [[ "$proposal_count" -gt 0 ]]; then
264
+ echo ""
265
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
266
+ echo " 🧠 WISDOM REVIEW"
267
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
268
+ echo ""
269
+ echo "Review wisdom proposals before sealing this colony."
270
+ echo "Approved proposals will be promoted to QUEEN.md."
271
+ echo ""
272
+
273
+ # Run approval workflow (blocking)
274
+ bash .aether/aether-utils.sh learning-approve-proposals
275
+
276
+ echo ""
277
+ echo "Wisdom review complete. Proceeding with sealing ceremony..."
278
+ echo ""
279
+ else
280
+ echo "No wisdom proposals to review."
281
+ fi
282
+ ```
283
+
284
+ ### Step 3.7: Hive Promotion (NON-BLOCKING)
285
+
286
+ After QUEEN.md promotion, promote abstracted instincts to the cross-colony hive.
287
+
288
+ **Extract high-confidence instincts for hive promotion:**
289
+ ```bash
290
+ # Get instincts with confidence >= 0.8
291
+ high_conf_instincts=$(jq -r '.memory.instincts[] | select(.confidence >= 0.8) | @base64' .aether/data/COLONY_STATE.json 2>/dev/null || echo "")
292
+
293
+ # Derive source repo name from current directory
294
+ source_repo="$(pwd)"
295
+
296
+ # Read domain tags from registry (NOT from instinct.domain which is a category, not a repo domain)
297
+ repo_domain_tags=$(jq -r --arg repo "$(pwd)" \
298
+ '[.repos[] | select(.path == $repo) | .domain_tags // []] | .[0] // [] | join(",")' \
299
+ "$HOME/.aether/registry.json" 2>/dev/null || echo "")
300
+
301
+ hive_promoted_count=0
302
+ hive_errors=0
303
+ for encoded in $high_conf_instincts; do
304
+ [[ -z "$encoded" ]] && continue
305
+
306
+ # Extract trigger and action fields from the instinct object
307
+ trigger=$(echo "$encoded" | base64 -d | jq -r '.trigger // empty')
308
+ action=$(echo "$encoded" | base64 -d | jq -r '.action // empty')
309
+ confidence=$(echo "$encoded" | base64 -d | jq -r '.confidence // 0.7')
310
+
311
+ [[ -z "$trigger" || -z "$action" ]] && continue
312
+
313
+ # Strip leading "When " or "when " from trigger to avoid "When When..." stutter
314
+ trigger_clean=$(echo "$trigger" | sed 's/^[Ww]hen //')
315
+
316
+ # Build the promotion text in "When {trigger}: {action}" format
317
+ promote_text="When ${trigger_clean}: ${action}"
318
+
319
+ # Build hive-promote args with --text and --source-repo (required)
320
+ promote_args=(hive-promote --text "$promote_text" --source-repo "$source_repo" --confidence "$confidence")
321
+ [[ -n "$repo_domain_tags" ]] && promote_args+=(--domain "$repo_domain_tags")
322
+
323
+ # Call hive-promote which orchestrates abstract + store
324
+ result=$(bash .aether/aether-utils.sh "${promote_args[@]}" 2>/dev/null || echo '{}')
325
+ was_promoted=$(echo "$result" | jq -r '.result.action // "skipped"' 2>/dev/null || echo "skipped")
326
+
327
+ if [[ "$was_promoted" == "promoted" || "$was_promoted" == "merged" ]]; then
328
+ hive_promoted_count=$((hive_promoted_count + 1))
183
329
  fi
184
- done < <(jq -c '.memory.decisions[]? // empty' .aether/data/COLONY_STATE.json 2>/dev/null)
330
+ done
331
+
332
+ if [[ "$hive_promoted_count" -gt 0 ]]; then
333
+ echo "Hive promotion: $hive_promoted_count instinct(s) promoted to cross-colony hive"
334
+ fi
335
+ ```
336
+
337
+ **Continue to Step 4 (non-blocking):**
338
+ Proceed to Step 4 regardless of hive promotion results — hive promotion is strictly non-blocking.
339
+
340
+ ### Step 4: Log Seal Activity
341
+
342
+ Log the seal ceremony to activity log:
343
+ ```bash
344
+ bash .aether/aether-utils.sh activity-log "MODIFIED" "Queen" "Colony sealed - wisdom review completed"
345
+ ```
346
+
347
+ ### Step 4.5: Increment Colony Version
348
+
349
+ Before writing the Crowned Anthill milestone, increment `colony_version` in COLONY_STATE.json.
350
+
351
+ ```bash
352
+ # Read current colony_version (default to 0 for backward compat with older colonies)
353
+ current_colony_version=$(jq -r '.colony_version // 0' .aether/data/COLONY_STATE.json 2>/dev/null || echo 0)
354
+ # Guard against non-integer values (floats, strings)
355
+ [[ "$current_colony_version" =~ ^[0-9]+$ ]] || current_colony_version=0
356
+ new_colony_version=$(( current_colony_version + 1 ))
357
+
358
+ # Write incremented value back — guard against empty output destroying the file
359
+ updated=$(jq --argjson v "$new_colony_version" '.colony_version = $v' .aether/data/COLONY_STATE.json 2>/dev/null)
360
+ if [[ -n "$updated" && ${#updated} -gt 10 ]]; then
361
+ echo "$updated" > .aether/data/COLONY_STATE.json
362
+ else
363
+ echo "Warning: jq update failed — colony_version defaults to 1, state file unchanged"
364
+ new_colony_version=1
365
+ fi
366
+ ```
367
+
368
+ Use `new_colony_version` as `{colony_version}` throughout the rest of the seal ceremony (e.g., display as "Crowned Anthill v{colony_version}").
369
+
370
+ **Error handling:** If jq fails or produces empty/short output, COLONY_STATE.json is NOT overwritten and `new_colony_version` defaults to 1. Never let version increment failures block the seal.
185
371
 
186
- # Log promotion results to activity log
187
- bash .aether/aether-utils.sh activity-log "MODIFIED" "Queen" "Promoted ${promotions_made} learnings/decisions to QUEEN.md from colony ${colony_name}"
372
+ ### Step 5: Update Milestone to Crowned Anthill
188
373
 
189
- # Store promotion summary for display
190
- promotion_summary="${promotions_made} wisdom entries promoted"
374
+ Update COLONY_STATE.json:
375
+ 1. Set `milestone` to `"Crowned Anthill"`
376
+ 2. Set `milestone_updated_at` to current ISO-8601 timestamp
377
+ 3. Append event: `"<timestamp>|milestone_reached|seal|Achieved Crowned Anthill milestone"`
378
+
379
+ Run `bash .aether/aether-utils.sh validate-state colony` after write.
380
+
381
+ ### Step 5.1: Update Changelog
382
+
383
+ **MANDATORY: Record the seal in the project changelog. This step is never skipped.**
384
+
385
+ If no `CHANGELOG.md` exists, `changelog-append` creates one automatically.
386
+
387
+ Build a summary of what the colony accomplished across all phases:
388
+ - Collect completed phase names from COLONY_STATE.json
389
+ - Summarize the goal and key outcomes in one line
390
+
391
+ ```bash
392
+ bash .aether/aether-utils.sh changelog-append \
393
+ "$(date +%Y-%m-%d)" \
394
+ "seal-crowned-anthill" \
395
+ "00" \
396
+ "{key_files_csv}" \
397
+ "Colony sealed at Crowned Anthill;{goal}" \
398
+ "{phases_completed} phases completed;Colony wisdom promoted to QUEEN.md" \
399
+ ""
191
400
  ```
192
401
 
193
- ### Step 5: Archive Colony State
402
+ - `{key_files_csv}` list the most significant files created or modified across the colony's lifetime (derive from phase plans or git log)
403
+ - `{goal}` — the colony goal from COLONY_STATE.json
404
+
405
+ **Error handling:** If `changelog-append` fails, log to midden and continue — changelog failure never blocks sealing.
194
406
 
195
- Create archive directory:
407
+ ### Step 5.2: Update Registry (Silent)
408
+
409
+ Mark the colony as inactive in the global registry. This is silent on failure — registry is not required for the colony to work.
410
+
411
+ Run using the Bash tool (ignore errors):
412
+ ```bash
413
+ bash .aether/aether-utils.sh registry-add "$(pwd)" "$(jq -r '.version // "unknown"' ~/.aether/version.json 2>/dev/null || echo 'unknown')" --active false 2>/dev/null || true
196
414
  ```
197
- archive_dir=".aether/data/archive/session_$(date -u +%s)_archive"
198
- mkdir -p "$archive_dir"
415
+
416
+ If the command fails, proceed silently. This is optional bookkeeping.
417
+
418
+ ### Step 5.5: Documentation Coverage Audit
419
+
420
+ Before writing the seal document, spawn a Chronicler to survey documentation coverage.
421
+
422
+ **Generate Chronicler name and dispatch:**
423
+ ```bash
424
+ # Generate unique chronicler name
425
+ chronicler_name=$(bash .aether/aether-utils.sh generate-ant-name "chronicler")
426
+
427
+ # Log spawn and update swarm display
428
+ bash .aether/aether-utils.sh spawn-log "Queen" "chronicler" "$chronicler_name" "Documentation coverage audit"
199
429
  ```
200
430
 
201
- Copy the following files to the archive directory:
202
- 1. `.aether/data/COLONY_STATE.json` → `$archive_dir/COLONY_STATE.json`
203
- 2. `.aether/data/activity.log` `$archive_dir/activity.log`
204
- 3. `.aether/data/spawn-tree.txt` `$archive_dir/spawn-tree.txt`
205
- 4. `.aether/data/flags.json` → `$archive_dir/flags.json` (if exists)
206
- 5. `.aether/data/constraints.json` → `$archive_dir/constraints.json` (if exists)
431
+ **Display:**
432
+ ```
433
+ ━━━ 📝🐜 C H R O N I C L E R ━━━
434
+ ──── 📝🐜 Spawning {chronicler_name} — documentation coverage audit ────
435
+ ```
207
436
 
208
- Create archive manifest file `$archive_dir/manifest.json`:
209
- ```json
437
+ **Spawn Chronicler using Task tool:**
438
+ Spawn the Chronicler using Task tool with `subagent_type="aether-chronicler"`:
439
+
440
+ ```xml
441
+ <task>
442
+ <description>📝 Chronicler {chronicler_name}: Documentation coverage audit</description>
443
+ <prompt>
444
+ You are {chronicler_name}, a 📝 Chronicler Ant.
445
+
446
+ Mission: Documentation coverage audit before seal ceremony
447
+
448
+ Survey the following documentation types:
449
+ - README.md (project overview, quick start)
450
+ - API documentation (endpoints, parameters, responses)
451
+ - Guides (tutorials, how-tos, best practices)
452
+ - Changelogs (version history, release notes)
453
+ - Code comments (JSDoc, TSDoc inline documentation)
454
+ - Architecture docs (system design, decisions)
455
+
456
+ Work:
457
+ 1. Check if README.md exists and covers: installation, usage, examples
458
+ 2. Look for docs/ directory and survey guide coverage
459
+ 3. Check for API documentation (OpenAPI, README sections, etc.)
460
+ 4. Verify CHANGELOG.md exists and has recent entries
461
+ 5. Sample source files for inline documentation coverage
462
+ 6. Identify documentation gaps (missing, outdated, incomplete)
463
+
464
+ **IMPORTANT:** You are strictly read-only. Do not modify any files.
465
+
466
+ Log activity: bash .aether/aether-utils.sh activity-log "SURVEYING" "{chronicler_name}" "description"
467
+
468
+ Return ONLY this JSON (no other text):
210
469
  {
211
- "archived_at": "<ISO-8601 timestamp>",
212
- "goal": "<colony goal>",
213
- "total_phases": <number>,
214
- "milestone": "Crowned Anthill",
215
- "files": [
216
- "COLONY_STATE.json",
217
- "activity.log",
218
- "spawn-tree.txt",
219
- "flags.json",
220
- "constraints.json"
221
- ]
470
+ "ant_name": "{chronicler_name}",
471
+ "caste": "chronicler",
472
+ "status": "completed" | "failed" | "blocked",
473
+ "summary": "What you surveyed and found",
474
+ "documentation_created": [],
475
+ "documentation_updated": [],
476
+ "pages_documented": 0,
477
+ "code_examples_verified": [],
478
+ "coverage_percent": 0,
479
+ "gaps_identified": [
480
+ {"type": "README|API|Guide|Changelog|Comments|Architecture", "severity": "high|medium|low", "description": "...", "location": "..."}
481
+ ],
482
+ "blockers": []
222
483
  }
484
+ </prompt>
485
+ </task>
486
+ ```
487
+
488
+ **FALLBACK:** If "Agent type not found", use general-purpose agent and inject role: "You are a Chronicler Ant - documentation specialist that surveys and identifies documentation gaps."
489
+
490
+ **Parse Chronicler JSON output:**
491
+ Extract from response: `coverage_percent`, `gaps_identified`, `pages_documented`
492
+
493
+ Log completion and update swarm display:
494
+ ```bash
495
+ bash .aether/aether-utils.sh spawn-complete "$chronicler_name" "completed" "Documentation audit complete"
496
+ ```
497
+
498
+ **Display Chronicler completion line:**
499
+ ```
500
+ 📝 {chronicler_name}: Documentation coverage audit ({pages_documented} pages, {coverage_percent}% coverage) ✓
501
+ ```
502
+
503
+ **Log gaps to midden (non-blocking):**
504
+ For each gap in `gaps_identified` with severity "high" or "medium":
505
+ ```bash
506
+ bash .aether/aether-utils.sh midden-write "documentation" "Gap ({severity}): {description} at {location}" "chronicler"
507
+ ```
508
+
509
+ **Display summary:**
510
+ ```
511
+ 📝 Chronicler complete — {coverage_percent}% coverage, {gap_count} gaps logged to midden
223
512
  ```
224
513
 
225
- #### Step 5.5: Verify Archive Integrity
514
+ **Continue to Step 6 (non-blocking):**
515
+ Proceed to Step 6 regardless of Chronicler findings — Chronicler is strictly non-blocking.
226
516
 
227
- Verify the archive was created successfully:
517
+ ### Step 6: Write CROWNED-ANTHILL.md
518
+
519
+ Calculate colony age:
228
520
  ```bash
229
- if [[ -f "$archive_dir/manifest.json" ]]; then
230
- echo "Archive verified: $archive_dir"
521
+ initialized_at=$(jq -r '.initialized_at // empty' .aether/data/COLONY_STATE.json)
522
+ if [[ -n "$initialized_at" ]]; then
523
+ init_epoch=$(date -j -f "%Y-%m-%dT%H:%M:%SZ" "$initialized_at" +%s 2>/dev/null || echo 0)
524
+ now_epoch=$(date +%s)
525
+ if [[ "$init_epoch" -gt 0 ]]; then
526
+ colony_age_days=$(( (now_epoch - init_epoch) / 86400 ))
527
+ else
528
+ colony_age_days=0
529
+ fi
231
530
  else
232
- echo "Error: Archive creation incomplete"
233
- # Don't proceed with milestone update
234
- exit 1
531
+ colony_age_days=0
235
532
  fi
236
533
  ```
237
534
 
238
- ### Step 6: Update Milestone to Crowned Anthill
535
+ Extract phase recap:
536
+ ```bash
537
+ phase_recap=""
538
+ while IFS= read -r phase_line; do
539
+ phase_name=$(echo "$phase_line" | jq -r '.name')
540
+ phase_status=$(echo "$phase_line" | jq -r '.status')
541
+ phase_recap="${phase_recap} - ${phase_name}: ${phase_status}\n"
542
+ done < <(jq -c '.plan.phases[]' .aether/data/COLONY_STATE.json 2>/dev/null)
543
+ ```
239
544
 
240
- Update COLONY_STATE.json:
241
- 1. Set `milestone` to `"Crowned Anthill"`
242
- 2. Set `milestone_updated_at` to current ISO-8601 timestamp
243
- 3. Append event: `"<timestamp>|milestone_reached|archive|Achieved Crowned Anthill milestone - colony archived"`
545
+ Write the seal document:
546
+ ```bash
547
+ version=$(jq -r '.version // "3.0"' .aether/data/COLONY_STATE.json)
548
+ seal_date=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
549
+ ```
550
+
551
+ Resolve the crowned-anthill template path:
552
+ Check ~/.aether/system/templates/crowned-anthill.template.md first,
553
+ then .aether/templates/crowned-anthill.template.md.
554
+
555
+ If no template found: output "Template missing: crowned-anthill.template.md. Run aether update to fix." and stop.
244
556
 
245
- ### Step 7: Write Final Handoff
557
+ Read the template file. Fill all {{PLACEHOLDER}} values:
558
+ - {{GOAL}} → goal (from colony state)
559
+ - {{SEAL_DATE}} → seal_date (ISO-8601 UTC timestamp)
560
+ - {{VERSION}} → version (from colony state)
561
+ - {{TOTAL_PHASES}} → total_phases
562
+ - {{PHASES_COMPLETED}} → phases_completed
563
+ - {{COLONY_AGE_DAYS}} → colony_age_days
564
+ - {{PROMOTIONS_MADE}} → promotions_made
565
+ - {{PHASE_RECAP}} → phase recap list (one entry per line, formatted from the bash loop above)
246
566
 
247
- After archiving and promoting wisdom, write the final handoff documenting the completed colony:
567
+ Remove the HTML comment lines at the top of the template (lines starting with <!--).
568
+ Write the result to .aether/CROWNED-ANTHILL.md using the Write tool.
569
+
570
+ ### Step 6.5: Export XML Archive (best-effort)
571
+
572
+ Export colony data as a combined XML archive and a standalone pheromones.xml. Both are best-effort — seal proceeds even if XML export fails.
248
573
 
249
574
  ```bash
250
- cat > .aether/HANDOFF.md << 'HANDOFF_EOF'
251
- # Colony Session SEALED (Crowned Anthill)
575
+ # Check if xmllint is available
576
+ if command -v xmllint >/dev/null 2>&1; then
577
+ xml_result=$(bash .aether/aether-utils.sh colony-archive-xml ".aether/exchange/colony-archive.xml" 2>&1)
578
+ xml_ok=$(echo "$xml_result" | jq -r '.ok // false' 2>/dev/null)
579
+ if [[ "$xml_ok" == "true" ]]; then
580
+ xml_pheromone_count=$(echo "$xml_result" | jq -r '.result.pheromone_count // 0' 2>/dev/null)
581
+ xml_export_line="XML Archive: colony-archive.xml (${xml_pheromone_count} active signals)"
582
+ else
583
+ xml_export_line="XML Archive: export failed (non-blocking)"
584
+ fi
252
585
 
253
- ## 🏆 Colony Complete
254
- **Status:** Crowned Anthill All phases completed and archived
586
+ # Also export standalone pheromones.xml for cross-colony sharing
587
+ pher_result=$(bash .aether/aether-utils.sh pheromone-export-xml ".aether/exchange/pheromones.xml" 2>&1)
588
+ pher_ok=$(echo "$pher_result" | jq -r '.ok // false' 2>/dev/null)
589
+ if [[ "$pher_ok" == "true" ]]; then
590
+ pher_signal_count=$(jq '[.signals[] | select(.active != false)] | length' .aether/data/pheromones.json 2>/dev/null || echo "0")
591
+ pher_export_line="Signal Export: pheromones.xml (${pher_signal_count} signals, importable by other colonies)"
592
+ else
593
+ pher_export_line="Signal Export: failed (non-blocking)"
594
+ fi
255
595
 
256
- ## Archive Location
257
- {archive_dir}
596
+ # Export standalone queen-wisdom.xml for cross-colony wisdom sharing
597
+ wisdom_result=$(bash .aether/aether-utils.sh wisdom-export-xml ".aether/exchange/queen-wisdom.xml" 2>&1)
598
+ wisdom_ok=$(echo "$wisdom_result" | jq -r '.ok // false' 2>/dev/null)
599
+ if [[ "$wisdom_ok" == "true" ]]; then
600
+ wisdom_count=$(echo "$wisdom_result" | jq -r '.result.entries // 0' 2>/dev/null)
601
+ wisdom_export_line="Wisdom Export: queen-wisdom.xml (${wisdom_count} entries)"
602
+ else
603
+ wisdom_export_line="Wisdom Export: failed (non-blocking)"
604
+ fi
258
605
 
259
- ## Colony Summary
260
- - Goal: "{goal}"
261
- - Total Phases: {total_phases}
262
- - Milestone: Crowned Anthill
263
- - Sealed At: {timestamp}
264
- - Wisdom Promoted: {promotion_summary}
606
+ # Export standalone colony-registry.xml for lineage tracking
607
+ registry_result=$(bash .aether/aether-utils.sh registry-export-xml ".aether/exchange/colony-registry.xml" 2>&1)
608
+ registry_ok=$(echo "$registry_result" | jq -r '.ok // false' 2>/dev/null)
609
+ if [[ "$registry_ok" == "true" ]]; then
610
+ registry_count=$(echo "$registry_result" | jq -r '.result.colonies // 0' 2>/dev/null)
611
+ registry_export_line="Registry Export: colony-registry.xml (${registry_count} colonies)"
612
+ else
613
+ registry_export_line="Registry Export: failed (non-blocking)"
614
+ fi
615
+ else
616
+ xml_export_line="XML Archive: skipped (xmllint not available)"
617
+ pher_export_line="Signal Export: skipped (xmllint not available)"
618
+ wisdom_export_line="Wisdom Export: skipped (xmllint not available)"
619
+ registry_export_line="Registry Export: skipped (xmllint not available)"
620
+ fi
621
+ ```
265
622
 
266
- ## Files Archived
267
- - COLONY_STATE.json
268
- - activity.log
269
- - spawn-tree.txt
270
- - flags.json (if existed)
271
- - constraints.json (if existed)
623
+ ### Step 7: Display Ceremony
272
624
 
273
- ## Session Note
274
- This colony has been sealed and archived. The anthill stands crowned.
275
- To start anew, run: /ant:lay-eggs "<new goal>"
276
- HANDOFF_EOF
625
+
626
+ Display the ASCII art ceremony:
627
+ ```
628
+ . .
629
+ /|\ /|\
630
+ / | \ / | \
631
+ / | X | \
632
+ / | / \ | \
633
+ / |/ \| \
634
+ / / \ \
635
+ /____ / ___ \ ____\
636
+ / / \ \
637
+ / / \ \
638
+ /_/ \_\
639
+ | CROWNED |
640
+ | ANTHILL |
641
+ |__________|
277
642
  ```
278
643
 
279
- This handoff serves as the final record of the completed colony.
644
+ Below the ASCII art, display:
645
+ ```
646
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
647
+ C R O W N E D A N T H I L L v{colony_version}
648
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
649
+
650
+ Goal: {goal}
651
+ Phases: {phases_completed} of {total_phases} completed
652
+ Milestone: Crowned Anthill v{colony_version}
653
+ {If incomplete_warning is not empty: display it}
654
+ Wisdom Promoted: {promotion_summary}
655
+
656
+ Seal Document: .aether/CROWNED-ANTHILL.md
657
+ {xml_export_line}
658
+ {pher_export_line}
659
+ {wisdom_export_line}
660
+ {registry_export_line}
661
+
662
+ The colony stands crowned and sealed.
663
+ Its wisdom lives on in QUEEN.md.
664
+ The anthill has reached its final form.
665
+
666
+ ──────────────────────────────────────────────────
667
+ 🐜 Next Up
668
+ ──────────────────────────────────────────────────
669
+ /ant:entomb 🏺 Archive colony to chambers
670
+ /ant:lay-eggs 🥚 Start a new colony
671
+ /ant:tunnels 🗄️ Browse archived chambers
672
+ ```
673
+
674
+ ### Step 7.5: Commit Suggestion (Non-blocking)
280
675
 
281
- ### Step 8: Display Result
676
+ After the ceremony, offer to commit all colony work.
282
677
 
283
- **If visual_mode is true, render final swarm display:**
678
+ **Gate check skip silently if any fail:**
679
+ 1. Not a git repo: `git rev-parse --git-dir 2>/dev/null` fails → skip
680
+ 2. Clean working tree: `git status --porcelain 2>/dev/null` is empty → skip to Step 7.6 (may still want to push)
681
+
682
+ **If uncommitted changes exist:**
683
+
684
+ Generate a seal commit message:
284
685
  ```bash
285
- bash .aether/aether-utils.sh swarm-display-update "Queen" "prime" "completed" "Colony sealed" "Colony" '{"read":3,"grep":0,"edit":2,"bash":3}' 100 "fungus_garden" 100
286
- bash .aether/aether-utils.sh swarm-display-inline "$seal_id"
686
+ seal_commit=$(bash .aether/aether-utils.sh generate-commit-message seal "$phases_completed" "$goal" "$colony_age_days" 2>/dev/null)
687
+ seal_message=$(echo "$seal_commit" | jq -r '.result.message // "aether-seal: colony sealed"')
688
+ seal_body=$(echo "$seal_commit" | jq -r '.result.body // ""')
287
689
  ```
288
690
 
289
- Output:
691
+ Display the suggestion:
290
692
  ```
291
- 🏺 ════════════════════════════════════════════════════
292
- C R O W N E D A N T H I L L
293
- ══════════════════════════════════════════════════ 🏺
693
+ ──────────────────────────────────────────────────
694
+ Commit suggestion:
294
695
 
295
- ✅ Colony archived successfully!
696
+ $seal_message
296
697
 
297
- 👑 Goal: {goal (truncated to 60 chars)}
298
- 📍 Phases: {total_phases} completed
299
- 🏆 Milestone: Crowned Anthill
300
- 📚 Wisdom Promoted: {promotion_summary}
698
+ $seal_body
699
+ ──────────────────────────────────────────────────
700
+ ```
301
701
 
302
- 📦 Archive Location: {archive_dir}
303
- - COLONY_STATE.json
304
- - activity.log
305
- - spawn-tree.txt
306
- - flags.json (if existed)
307
- - constraints.json (if existed)
702
+ Prompt with AskUserQuestion (3 options):
703
+ 1. **Commit with this message** — Run `git add -A && git commit -m "$seal_message" -m "$seal_body"`
704
+ 2. **Edit message** — Ask user for their preferred message, then commit with that
705
+ 3. **Skip** — Do not commit
308
706
 
309
- 🐜 The colony has reached its final form.
310
- The anthill stands crowned and sealed.
311
- History is preserved. The colony rests.
707
+ If the user chooses option 1 or 2 and the commit succeeds, set `seal_committed = true`.
708
+ If the commit fails or user skips, set `seal_committed = false`.
312
709
 
313
- 💾 State persisted safe to /clear
710
+ **Error handling:** If `generate-commit-message` fails, fall back to message `"aether-seal: colony sealed"`. Never let commit suggestion failures stop the seal flow.
314
711
 
315
- 🐜 What would you like to do next?
316
- 1. /ant:lay-eggs "<new goal>" — Start a new colony
317
- 2. /ant:tunnels — Browse archived colonies
318
- 3. /clear — Clear context and continue
712
+ ### Step 7.6: Push Suggestion (Non-blocking)
319
713
 
320
- Use AskUserQuestion with these three options.
714
+ Only show if a commit was just made in Step 7.5 (`seal_committed == true`) OR if there are unpushed commits.
321
715
 
322
- If option 1 selected: proceed to run /ant:lay-eggs flow
323
- If option 2 selected: run /ant:tunnels
324
- If option 3 selected: display "Run /ant:lay-eggs to begin anew after clearing"
716
+ **Gate check skip silently if any fail:**
717
+ 1. Not a git repo → skip
718
+ 2. No remote configured: `git remote -v 2>/dev/null` is empty skip
719
+
720
+ **Check for unpushed commits:**
721
+ ```bash
722
+ unpushed=$(git log --oneline @{u}..HEAD 2>/dev/null | wc -l | tr -d ' ')
325
723
  ```
724
+ If `unpushed == 0` and `seal_committed == false` → skip (nothing to push)
725
+
726
+ **If there are commits to push:**
727
+
728
+ Detect current branch and upstream status:
729
+ ```bash
730
+ current_branch=$(git branch --show-current)
731
+ has_upstream=$(git rev-parse --abbrev-ref @{u} 2>/dev/null && echo "yes" || echo "no")
732
+ ```
733
+
734
+ Display:
735
+ ```
736
+ Push {unpushed} commit(s) to remote?
737
+ Branch: {current_branch}
738
+ ```
739
+
740
+ Prompt with AskUserQuestion (2 options):
741
+ 1. **Push now** — If upstream exists: `git push`. If no upstream: `git push -u origin $current_branch`
742
+ 2. **I'll push later** — Skip
743
+
744
+ Display result: `Pushed to origin/{current_branch}` on success, or `Push skipped` if declined.
745
+
746
+ **Error handling:** If push fails, display the error message but do not stop the seal flow. Suggest: "You can push manually with `git push`."
747
+
748
+ **Safety:** Never auto-push. Always require explicit user approval via AskUserQuestion.
326
749
 
327
750
  ### Edge Cases
328
751
 
329
- **If milestone is already "Sealed Chambers" but phases are complete:**
330
- - Proceed with archiving and upgrade to Crowned Anthill
752
+ **Colony already at Crowned Anthill:**
753
+ - Display message and guide to /ant:entomb. Do NOT re-seal.
754
+
755
+ **Phases incomplete:**
756
+ - Warn but allow. The seal proceeds after confirmation.
757
+
758
+ **Missing QUEEN.md:**
759
+ - queen-init creates it. If that fails, skip promotion (non-fatal).
331
760
 
332
- **If any archive files are missing:**
333
- - Archive what exists, note in manifest which files were missing
761
+ **Missing initialized_at:**
762
+ - Colony age defaults to 0 days.
334
763
 
335
- **If archive directory already exists:**
336
- - Append timestamp to make unique: `session_<ts>_archive_<random>`
764
+ **Empty phases array:**
765
+ - Can seal a colony with 0 phases (rare but valid). phases_completed = 0, total_phases = 0.