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/entomb.yaml - DO NOT EDIT DIRECTLY -->
1
2
  ---
2
3
  name: ant:entomb
3
4
  description: "⚰️🐜⚰️ Entomb completed colony in chambers"
4
5
  ---
5
6
 
6
- You are the **Queen**. Archive the completed colony to chambers.
7
+ You are the **Queen**. Archive the sealed colony to chambers.
7
8
 
8
9
  ## Instructions
9
10
 
@@ -11,18 +12,47 @@ 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
+ ### Archive Write Failure
17
+ If writing to chambers/ archive fails partway:
18
+ - Do NOT delete source data (the active colony) until archive is verified
19
+ - Report what was archived vs. what failed
20
+ - Recovery: the original colony data is intact -- user can retry
21
+
22
+ ### Seal Verification Failure
23
+ If the colony was not properly sealed before entomb:
24
+ - STOP -- do not archive an incomplete colony
25
+ - Direct user to run /ant:seal first
26
+ - This is a hard gate, not a suggestion
27
+
28
+ ### Chamber Naming Conflict
29
+ If the target chamber directory already exists:
30
+ - STOP -- do not overwrite an existing archive
31
+ - Report the conflict
32
+ - Options: (1) Use a different name, (2) Merge with existing, (3) Cancel
33
+ </failure_modes>
34
+
35
+ <success_criteria>
36
+ Command is complete when:
37
+ - Colony data is fully copied to chambers/ archive directory
38
+ - Archive integrity is verified (all expected files present)
39
+ - Active colony state is cleared only after archive verification
40
+ - User sees confirmation with archive location
41
+ </success_criteria>
42
+
43
+ <read_only>
44
+ Do not touch during entomb:
45
+ - .aether/dreams/ (user notes -- not archived)
46
+ - Source code files
47
+ - .env* files
48
+ - .claude/settings.json
49
+ - .github/workflows/
50
+ - Other chamber directories (only write to the new chamber)
51
+ </read_only>
52
+
14
53
  ### Step 0: Initialize Visual Mode (if enabled)
15
54
 
16
55
  If `visual_mode` is true:
17
- ```bash
18
- # Generate session ID
19
- entomb_id="entomb-$(date +%s)"
20
-
21
- # Initialize swarm display
22
- bash .aether/aether-utils.sh swarm-display-init "$entomb_id"
23
- bash .aether/aether-utils.sh swarm-display-update "Queen" "prime" "excavating" "Entombing colony" "Colony" '{"read":0,"grep":0,"edit":0,"bash":0}' 0 "fungus_garden" 0
24
- ```
25
-
26
56
  ### Step 1: Read State
27
57
 
28
58
  Read `.aether/data/COLONY_STATE.json`.
@@ -33,204 +63,169 @@ No colony to entomb. Run /ant:init first.
33
63
  ```
34
64
  Stop here.
35
65
 
36
- #### Step 1.5: Check for Concurrent Entomb Operations
66
+ Extract: `goal`, `state`, `current_phase`, `plan.phases`, `milestone`, `version`, `initialized_at`, `memory.decisions`, `memory.phase_learnings`, `memory.instincts`.
37
67
 
38
- Capture session start time:
68
+ Read `colony_version` for display (default to 1 for backward compat with older colonies):
39
69
  ```bash
40
- ENTOMB_START=$(date +%s)
70
+ colony_version=$(jq -r '.colony_version // 1' .aether/data/COLONY_STATE.json 2>/dev/null || echo 1)
71
+ [[ "$colony_version" =~ ^[0-9]+$ ]] || colony_version=1
41
72
  ```
42
73
 
43
- Check for incomplete chamber operations:
44
- ```bash
45
- # Check for incomplete chambers (no colony-state.json)
46
- incomplete_chambers=$(find .aether/chambers -type d -mindepth 1 -maxdepth 1 2>/dev/null | while read dir; do
47
- if [[ ! -f "$dir/colony-state.json" ]]; then
48
- echo "$dir"
49
- fi
50
- done)
74
+ ### Step 2: Seal-First Enforcement
51
75
 
52
- if [[ -n "$incomplete_chambers" ]]; then
53
- echo "Warning: Incomplete chamber operations detected:"
54
- echo "$incomplete_chambers"
55
- fi
56
- ```
57
-
58
- ### Step 2: Validate Colony Can Be Entombed
76
+ Check `milestone` in COLONY_STATE.json.
59
77
 
60
- Extract: `goal`, `state`, `current_phase`, `plan.phases`, `memory.decisions`, `memory.phase_learnings`.
78
+ **If milestone != "Crowned Anthill":**
79
+ ```
80
+ Colony has not been sealed.
61
81
 
62
- **Precondition 1: All phases must be completed**
82
+ Current milestone: {milestone}
83
+ Required: Crowned Anthill
63
84
 
64
- Check if all phases in `plan.phases` have `status: "completed"`:
65
- ```
66
- all_completed = all(phase.status == "completed" for phase in plan.phases)
85
+ Run /ant:seal first to complete the sealing ceremony.
67
86
  ```
87
+ Stop here.
68
88
 
69
- If NOT all completed:
89
+ **Belt-and-suspenders:** Also check `.aether/CROWNED-ANTHILL.md` exists. If milestone is Crowned Anthill but file is missing:
70
90
  ```
71
- Cannot entomb incomplete colony.
72
-
73
- Completed phases: X of Y
74
- Remaining: {list of incomplete phase names}
75
-
76
- Run /ant:continue to complete remaining phases first.
91
+ CROWNED-ANTHILL.md not found — seal may have been interrupted. Run /ant:seal again.
77
92
  ```
78
93
  Stop here.
79
94
 
80
- **Precondition 2: State must not be EXECUTING**
95
+ ### Step 3: User Confirmation
81
96
 
82
- If `state == "EXECUTING"`:
83
- ```
84
- Colony is still executing. Run /ant:continue to reconcile first.
97
+ Show what will be archived:
85
98
  ```
86
- Stop here.
99
+ ENTOMB COLONY
100
+
101
+ Goal: {goal}
102
+ Version: v{colony_version}
103
+ Milestone: Crowned Anthill
104
+ Phases: {phases_completed} of {total_phases}
87
105
 
88
- **Precondition 3: No critical errors**
106
+ This will:
107
+ - Archive ALL colony data to .aether/chambers/
108
+ - Copy CROWNED-ANTHILL.md, pheromones, dreams, session data
109
+ - Promote colony wisdom to QUEEN.md (cross-generational learning)
110
+ - Reset COLONY_STATE.json for a fresh start
111
+ - Clear session data
89
112
 
90
- Check `errors.records` for any entries with `severity: "critical"`.
113
+ This action is permanent. The archived colony can be browsed via /ant:tunnels.
91
114
 
92
- If critical errors exist:
115
+ Entomb this colony? (yes/no)
93
116
  ```
94
- Cannot entomb colony with critical errors.
95
117
 
96
- Critical errors: {count}
97
- Run /ant:continue to resolve errors first.
118
+ Use `AskUserQuestion with yes/no options`.
119
+
120
+ If not "yes":
121
+ ```
122
+ Entombment cancelled. Colony remains active.
98
123
  ```
99
124
  Stop here.
100
125
 
101
- ### Step 3: Compute Milestone
126
+ ### Step 3.25: Wisdom Approval
102
127
 
103
- Determine milestone based on phases completed:
104
- - 0 phases: "Fresh Start"
105
- - 1 phase: "First Mound"
106
- - 2-4 phases: "Open Chambers"
107
- - 5+ phases: "Sealed Chambers"
128
+ Before archiving, review wisdom proposals accumulated during this colony's lifecycle.
108
129
 
109
- If all phases completed AND user explicitly sealing: "Crowned Anthill"
130
+ ```bash
131
+ # Check for pending proposals
132
+ proposals=$(bash .aether/aether-utils.sh learning-check-promotion 2>/dev/null || echo '{"proposals":[]}')
133
+ proposal_count=$(echo "$proposals" | jq '.proposals | length')
134
+
135
+ if [[ "$proposal_count" -gt 0 ]]; then
136
+ echo ""
137
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
138
+ echo " 🧠 FINAL WISDOM REVIEW"
139
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
140
+ echo ""
141
+ echo "Review wisdom proposals before archiving this colony."
142
+ echo "Approved proposals will be promoted to QUEEN.md."
143
+ echo ""
144
+
145
+ # Run approval workflow (blocking)
146
+ bash .aether/aether-utils.sh learning-approve-proposals
147
+
148
+ echo ""
149
+ echo "Wisdom review complete. Proceeding with entombment..."
150
+ echo ""
151
+ else
152
+ echo "No wisdom proposals to review."
153
+ fi
154
+ ```
110
155
 
111
- For entombment, use the computed milestone or extract from state if already set.
156
+ ### Step 3.5: Check XML Tools
112
157
 
113
- ### Step 4: User Confirmation
158
+ XML archiving is required for entombment. Check tool availability before proceeding.
159
+ Uses `command -v xmllint` directly — consistent with seal.md's tool check.
114
160
 
115
- Display:
161
+ ```bash
162
+ if command -v xmllint >/dev/null 2>&1; then
163
+ xmllint_available=true
164
+ else
165
+ xmllint_available=false
166
+ fi
116
167
  ```
117
- 🏺 ═══════════════════════════════════════════════════
118
- E N T O M B C O L O N Y
119
- ══════════════════════════════════════════════════ 🏺
120
168
 
121
- Goal: {goal}
122
- Phases: {completed}/{total} completed
123
- Milestone: {milestone}
169
+ **If xmllint is NOT available:**
170
+
171
+ Ask the user:
172
+ ```
173
+ xmllint is not installed — XML archiving requires it.
124
174
 
125
- Archive will include:
126
- - COLONY_STATE.json
127
- - manifest.json (pheromone trails)
175
+ Install now?
176
+ - macOS: xcode-select --install (or brew install libxml2)
177
+ - Linux: apt-get install libxml2-utils
128
178
 
129
- This will reset the active colony. Continue? (yes/no)
179
+ Install xmllint? (yes/no)
130
180
  ```
131
181
 
132
- Wait for explicit "yes" response before proceeding.
182
+ Use AskUserQuestion with yes/no options.
133
183
 
134
- If user responds with anything other than "yes", display:
184
+ If yes:
185
+ - On macOS: Run `xcode-select --install` or `brew install libxml2`
186
+ - On Linux: Run `sudo apt-get install -y libxml2-utils`
187
+ - After install attempt, re-check: `command -v xmllint >/dev/null 2>&1`
188
+ - If still not available after install:
189
+ ```
190
+ xmllint installation failed. Cannot entomb without XML archiving.
191
+ Install xmllint manually and try again.
192
+ ```
193
+ Stop here.
194
+
195
+ If no:
135
196
  ```
136
- Entombment cancelled. Colony remains active.
197
+ Entombment requires XML archiving. Install xmllint and try again.
137
198
  ```
138
199
  Stop here.
139
200
 
140
- ### Step 5: Promote Wisdom to QUEEN.md
141
-
142
- Before creating the chamber, promote validated learnings to QUEEN.md for future colonies.
201
+ ### Step 4: Ensure QUEEN.md Exists
143
202
 
144
- **Step 5.1: Ensure QUEEN.md exists**
203
+ Verify QUEEN.md is initialized for wisdom storage:
145
204
 
146
205
  ```bash
147
- queen_file=".aether/docs/QUEEN.md"
206
+ queen_file=".aether/QUEEN.md"
148
207
  if [[ ! -f "$queen_file" ]]; then
149
208
  init_result=$(bash .aether/aether-utils.sh queen-init 2>/dev/null || echo '{"ok":false}')
150
209
  init_ok=$(echo "$init_result" | jq -r '.ok // false')
151
210
  if [[ "$init_ok" == "true" ]]; then
152
211
  created=$(echo "$init_result" | jq -r '.result.created // false')
153
212
  if [[ "$created" == "true" ]]; then
154
- bash .aether/aether-utils.sh activity-log "CREATED" "Queen" "Initialized QUEEN.md for wisdom promotion"
213
+ bash .aether/aether-utils.sh activity-log "CREATED" "Queen" "Initialized QUEEN.md for wisdom storage"
155
214
  fi
156
215
  fi
157
216
  fi
158
217
  ```
159
218
 
160
- **Step 5.2: Extract and promote validated learnings**
161
-
162
- ```bash
163
- # Extract colony name from goal (sanitized)
164
- colony_name=$(jq -r '.goal' .aether/data/COLONY_STATE.json | tr '[:upper:]' '[:lower:]' | tr -cs '[:alnum:]' '-' | sed 's/^-//;s/-$//' | cut -c1-30)
165
-
166
- # Extract validated learnings from phase_learnings
167
- learnings=$(jq -c '.memory.phase_learnings // []' .aether/data/COLONY_STATE.json)
168
-
169
- # Extract decisions
170
- decisions=$(jq -c '.memory.decisions // []' .aether/data/COLONY_STATE.json)
171
-
172
- promotion_count=0
173
-
174
- # Promote patterns from validated learnings
175
- if [[ -f "$queen_file" ]]; then
176
- # Process each phase's learnings
177
- echo "$learnings" | jq -c '.[]' 2>/dev/null | while read -r learning_group; do
178
- phase=$(echo "$learning_group" | jq -r '.phase // "unknown"')
179
- # Extract individual learnings and promote as patterns
180
- echo "$learning_group" | jq -r '.learnings[]? | select(.status == "validated") | .claim' 2>/dev/null | while read -r claim; do
181
- if [[ -n "$claim" && "$claim" != "null" ]]; then
182
- # Truncate if too long
183
- content=$(echo "$claim" | cut -c1-200)
184
- result=$(bash .aether/aether-utils.sh queen-promote "pattern" "$content" "$colony_name" 2>/dev/null || echo '{"ok":false}')
185
- if [[ $(echo "$result" | jq -r '.ok // false') == "true" ]]; then
186
- promotion_count=$((promotion_count + 1))
187
- fi
188
- fi
189
- done
190
- done
191
-
192
- # Promote high-confidence instincts as patterns
193
- instincts=$(jq -c '.memory.instincts // []' .aether/data/COLONY_STATE.json)
194
- echo "$instincts" | jq -c '.[]' 2>/dev/null | while read -r instinct; do
195
- confidence=$(echo "$instinct" | jq -r '.confidence // 0')
196
- status=$(echo "$instinct" | jq -r '.status // ""')
197
- action=$(echo "$instinct" | jq -r '.action // ""')
198
- # Promote validated instincts with high confidence (>= 0.7)
199
- if [[ "$status" == "validated" && $(echo "$confidence >= 0.7" | bc -l 2>/dev/null || echo 0) -eq 1 && -n "$action" ]]; then
200
- content=$(echo "$action" | cut -c1-200)
201
- result=$(bash .aether/aether-utils.sh queen-promote "pattern" "$content" "$colony_name" 2>/dev/null || echo '{"ok":false}')
202
- if [[ $(echo "$result" | jq -r '.ok // false') == "true" ]]; then
203
- promotion_count=$((promotion_count + 1))
204
- fi
205
- fi
206
- done
207
-
208
- # Log promotion results
209
- bash .aether/aether-utils.sh activity-log "MODIFIED" "Queen" "Promoted $promotion_count validated learnings to QUEEN.md from entombed colony"
210
- fi
211
- ```
212
-
213
- **Step 5.3: Display promotion summary**
214
-
215
- ```
216
- ---
217
- Wisdom Promotion Summary
218
- ---
219
- Colony: {colony_name}
220
- Promoted: {promotion_count} validated patterns to QUEEN.md
221
- ---
222
- ```
223
-
224
- ### Step 6: Create Chamber
219
+ ### Step 5: Generate Chamber Name
225
220
 
226
- Generate chamber name:
221
+ Date-first naming:
227
222
  ```bash
228
- sanitized_goal=$(echo "{goal}" | tr '[:upper:]' '[:lower:]' | tr -cs '[:alnum:]' '-' | sed 's/^-//;s/-$//' | cut -c1-50)
229
- timestamp=$(date -u +%Y%m%d-%H%M%S)
230
- chamber_name="${sanitized_goal}-${timestamp}"
223
+ date_prefix=$(date -u +%Y-%m-%d)
224
+ sanitized_goal=$(echo "$goal" | tr '[:upper:]' '[:lower:]' | tr -cs '[:alnum:]' '-' | sed 's/^-//;s/-$//' | cut -c1-40)
225
+ chamber_name="${date_prefix}-${sanitized_goal}"
231
226
  ```
232
227
 
233
- Handle name collision: if directory exists, append counter:
228
+ Collision handling:
234
229
  ```bash
235
230
  counter=1
236
231
  original_name="$chamber_name"
@@ -240,7 +235,7 @@ while [[ -d ".aether/chambers/$chamber_name" ]]; do
240
235
  done
241
236
  ```
242
237
 
243
- ### Step 7: Create Chamber Using Utilities
238
+ ### Step 6: Create Chamber
244
239
 
245
240
  Extract decisions and learnings as JSON arrays:
246
241
  ```bash
@@ -254,27 +249,89 @@ version=$(jq -r '.version // "3.0"' .aether/data/COLONY_STATE.json)
254
249
  Create the chamber:
255
250
  ```bash
256
251
  bash .aether/aether-utils.sh chamber-create \
257
- ".aether/chambers/{chamber_name}" \
252
+ ".aether/chambers/$chamber_name" \
258
253
  ".aether/data/COLONY_STATE.json" \
259
- "{goal}" \
260
- {phases_completed} \
261
- {total_phases} \
262
- "{milestone}" \
263
- "{version}" \
264
- '{decisions_json}' \
265
- '{learnings_json}'
254
+ "$goal" \
255
+ "$phases_completed" \
256
+ "$total_phases" \
257
+ "$milestone" \
258
+ "$version" \
259
+ "$decisions_json" \
260
+ "$learnings_json"
261
+ ```
262
+
263
+ ### Step 7: Archive Additional Files
264
+
265
+ AFTER chamber-create succeeds, copy additional data files:
266
+ ```bash
267
+ chamber_dir=".aether/chambers/$chamber_name"
268
+
269
+ # Archive data files (if they exist)
270
+ for f in pheromones.json session.json activity.log flags.json constraints.json spawn-tree.txt timing.log view-state.json; do
271
+ [[ -f ".aether/data/$f" ]] && cp ".aether/data/$f" "$chamber_dir/" 2>/dev/null || true
272
+ done
273
+
274
+ # Archive seal document (critical — this is the ceremony record)
275
+ [[ -f ".aether/CROWNED-ANTHILL.md" ]] && cp ".aether/CROWNED-ANTHILL.md" "$chamber_dir/"
276
+
277
+ # Archive HANDOFF.md if it exists
278
+ [[ -f ".aether/HANDOFF.md" ]] && cp ".aether/HANDOFF.md" "$chamber_dir/"
279
+
280
+ # Archive dreams directory (optional — may not exist)
281
+ [[ -d ".aether/dreams" ]] && cp -r ".aether/dreams" "$chamber_dir/dreams" 2>/dev/null || true
282
+
283
+ # Archive XML exchange files to chamber (per D-04, D-05)
284
+ xml_archived=0
285
+ for xml_file in .aether/exchange/*.xml; do
286
+ [[ -f "$xml_file" ]] && cp "$xml_file" "$chamber_dir/" && xml_archived=$((xml_archived + 1))
287
+ done
288
+ if [[ "$xml_archived" -gt 0 ]]; then
289
+ echo "XML Archive: ${xml_archived} exchange file(s) copied to chamber"
290
+ fi
266
291
  ```
267
292
 
293
+ Do NOT copy: `.aether/data/backups/`, `.aether/data/locks/`, `.aether/data/midden/`, `.aether/data/survey/`.
294
+
295
+ ### Step 7.5: Export XML Archive (hard-stop)
296
+
297
+ Export combined XML archive to the chamber. This is a HARD REQUIREMENT — entomb fails if XML export fails.
298
+
299
+ ```bash
300
+ chamber_dir=".aether/chambers/$chamber_name"
301
+ xml_result=$(bash .aether/aether-utils.sh colony-archive-xml "$chamber_dir/colony-archive.xml" 2>&1)
302
+ xml_ok=$(echo "$xml_result" | jq -r '.ok // false' 2>/dev/null)
303
+
304
+ if [[ "$xml_ok" != "true" ]]; then
305
+ # HARD STOP — remove the chamber and abort
306
+ rm -rf "$chamber_dir"
307
+ echo "XML archive export failed. Colony NOT entombed."
308
+ echo ""
309
+ echo "Error: $(echo "$xml_result" | jq -r '.error // "Unknown error"' 2>/dev/null)"
310
+ echo ""
311
+ echo "The chamber has been cleaned up. Fix the XML issue and try again."
312
+ # Do NOT proceed to state reset or any further steps
313
+ fi
314
+ ```
315
+
316
+ If xml_ok is true, store for display:
317
+ ```bash
318
+ xml_pheromone_count=$(echo "$xml_result" | jq -r '.result.pheromone_count // 0' 2>/dev/null)
319
+ xml_exchange_count=$(find .aether/exchange -maxdepth 1 -name "*.xml" 2>/dev/null | wc -l | tr -d ' ')
320
+ xml_archive_line="XML Archive: colony-archive.xml (${xml_pheromone_count} signals) + ${xml_exchange_count} exchange file(s)"
321
+ ```
322
+
323
+ **Critical behavior:** If XML export fails, entomb STOPS. The chamber directory is removed (cleanup). The colony state is NOT reset. The user sees a clear error and can retry after fixing the issue.
324
+
268
325
  ### Step 8: Verify Chamber Integrity
269
326
 
270
327
  Run verification:
271
328
  ```bash
272
- bash .aether/aether-utils.sh chamber-verify ".aether/chambers/{chamber_name}"
329
+ bash .aether/aether-utils.sh chamber-verify ".aether/chambers/$chamber_name"
273
330
  ```
274
331
 
275
332
  If verification fails, display error and stop:
276
333
  ```
277
- Chamber verification failed.
334
+ Chamber verification failed.
278
335
 
279
336
  Error: {verification_error}
280
337
 
@@ -283,31 +340,51 @@ The colony has NOT been reset. Please check the chamber directory:
283
340
  ```
284
341
  Stop here.
285
342
 
286
- ### Step 9: Reset Colony State
343
+ ### Step 9: Record in Eternal Memory
344
+
345
+ Write colony summary to eternal memory:
346
+ ```bash
347
+ bash .aether/aether-utils.sh eternal-init # idempotent
348
+ eternal_file="$HOME/.aether/eternal/memory.json"
349
+ if [[ -f "$eternal_file" ]]; then
350
+ colony_entry=$(jq -n \
351
+ --arg goal "$goal" \
352
+ --arg milestone "$milestone" \
353
+ --arg sealed_at "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
354
+ --arg chamber ".aether/chambers/$chamber_name" \
355
+ '{goal: $goal, milestone: $milestone, sealed_at: $sealed_at, chamber: $chamber}')
356
+ tmp_eternal="$(mktemp /tmp/aether-eternal.XXXXXX)"
357
+ jq --argjson colony_entry "$colony_entry" '.colonies = ((.colonies // []) + [$colony_entry])' "$eternal_file" > "$tmp_eternal" \
358
+ && mv "$tmp_eternal" "$eternal_file"
359
+ fi
360
+ ```
361
+
362
+ ### Step 10: Reset Colony State
287
363
 
288
364
  Backup current state:
289
365
  ```bash
290
366
  cp .aether/data/COLONY_STATE.json .aether/data/COLONY_STATE.json.bak
291
367
  ```
292
368
 
293
- Reset state while preserving memory (pheromones):
369
+ Reset state, clearing everything including promoted wisdom (already in QUEEN.md):
294
370
  ```bash
295
- jq '
296
- .goal = null |
297
- .state = "IDLE" |
298
- .current_phase = 0 |
299
- .plan.phases = [] |
300
- .plan.generated_at = null |
301
- .plan.confidence = null |
302
- .build_started_at = null |
303
- .session_id = null |
304
- .initialized_at = null |
305
- .events = [] |
306
- .errors.records = [] |
307
- .errors.flagged_patterns = [] |
308
- .signals = [] |
309
- .graveyards = []
310
- ' .aether/data/COLONY_STATE.json.bak > .aether/data/COLONY_STATE.json
371
+ # Resolve jq template path (hub-first)
372
+ jq_template=""
373
+ for path in \
374
+ "$HOME/.aether/system/templates/colony-state-reset.jq.template" \
375
+ ".aether/templates/colony-state-reset.jq.template"; do
376
+ if [[ -f "$path" ]]; then
377
+ jq_template="$path"
378
+ break
379
+ fi
380
+ done
381
+
382
+ if [[ -z "$jq_template" ]]; then
383
+ echo "Template missing: colony-state-reset.jq.template. Run aether update to fix."
384
+ exit 1
385
+ fi
386
+
387
+ jq -f "$jq_template" .aether/data/COLONY_STATE.json.bak > .aether/data/COLONY_STATE.json
311
388
  ```
312
389
 
313
390
  Verify reset succeeded:
@@ -326,67 +403,72 @@ Remove backup after successful reset:
326
403
  rm -f .aether/data/COLONY_STATE.json.bak
327
404
  ```
328
405
 
329
- ### Step 9.5: Write Final Handoff
330
-
331
- After entombing the colony, write the final handoff documenting the archived colony:
406
+ Clear session data:
407
+ ```bash
408
+ rm -f .aether/data/session.json
409
+ ```
332
410
 
411
+ Clean up seal document (it's now in the chamber):
333
412
  ```bash
334
- cat > .aether/HANDOFF.md << 'HANDOFF_EOF'
335
- # Colony Session — ENTOMBED
413
+ rm -f .aether/CROWNED-ANTHILL.md
414
+ ```
336
415
 
337
- ## ⚰️ Colony Archived
338
- **Status:** Entombed in Chambers — Colony work preserved
416
+ Clean up exchange XML files (now archived in chamber per D-06):
417
+ ```bash
418
+ rm -f .aether/exchange/*.xml 2>/dev/null || true
419
+ ```
339
420
 
340
- ## Chamber Location
341
- .aether/chambers/{chamber_name}/
421
+ ### Step 11: Write HANDOFF.md
342
422
 
343
- ## Colony Summary
344
- - Goal: "{goal}"
345
- - Phases: {completed} completed of {total}
346
- - Milestone: {milestone}
347
- - Entombed At: {timestamp}
423
+ Write handoff documenting the entombed colony:
348
424
 
349
- ## Chamber Contents
350
- - colony-state.json — Full colony state
351
- - manifest.json — Archive metadata
352
- - activity.log — Colony activity history
353
- - spawn-tree.txt — Worker spawn records
354
- - flags.json — Project flags (if existed)
425
+ Resolve the handoff template path:
426
+ Check ~/.aether/system/templates/handoff.template.md first,
427
+ then .aether/templates/handoff.template.md.
355
428
 
356
- ## Session Note
357
- This colony has been entombed and the active state reset.
358
- The colony rests. Its learnings are preserved in the chamber.
429
+ If no template found: output "Template missing: handoff.template.md. Run aether update to fix." and stop.
359
430
 
360
- To start anew: /ant:lay-eggs "<new goal>"
361
- To explore chambers: /ant:tunnels
362
- HANDOFF_EOF
363
- ```
431
+ Read the template file. Fill all {{PLACEHOLDER}} values:
432
+ - {{CHAMBER_NAME}} chamber_name
433
+ - {{GOAL}} → goal
434
+ - {{PHASES_COMPLETED}} → phases completed count
435
+ - {{TOTAL_PHASES}} → total phases count
436
+ - {{MILESTONE}} → milestone
437
+ - {{ENTOMB_TIMESTAMP}} → current ISO-8601 UTC timestamp
364
438
 
365
- This handoff serves as the record of the entombed colony.
439
+ Remove the HTML comment lines at the top of the template.
440
+ Write the result to .aether/HANDOFF.md using the Write tool.
366
441
 
367
- ### Step 10: Display Result
442
+ ### Step 12: Display Result
368
443
 
444
+ Display:
369
445
  ```
370
- 🏺 ═══════════════════════════════════════════════════
446
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
371
447
  C O L O N Y E N T O M B E D
372
- ══════════════════════════════════════════════════ 🏺
448
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
373
449
 
374
- Colony archived successfully
450
+ Entombed v{colony_version}
375
451
 
376
- 👑 Goal: {goal}
377
- 📍 Phases: {completed} completed
378
- 🏆 Milestone: {milestone}
452
+ Goal: {goal}
453
+ Phases: {completed} completed
454
+ Milestone: {milestone}
379
455
 
380
- 📦 Chamber: .aether/chambers/{chamber_name}/
456
+ Chamber: .aether/chambers/{chamber_name}/
457
+ {xml_archive_line}
381
458
 
382
- 🐜 The colony rests. Its learnings are preserved.
459
+ The colony rests. Its learnings live on in QUEEN.md.
383
460
 
384
- 💾 State persisted — safe to /clear
461
+ ──────────────────────────────────────────────────
462
+ 🐜 Next Up
463
+ ──────────────────────────────────────────────────
464
+ /ant:lay-eggs 🥚 Start a new colony
465
+ /ant:tunnels 🗄️ Browse archived chambers
466
+ ```
385
467
 
386
- 🐜 What would you like to do next?
387
- 1. /ant:lay-eggs "<new goal>" — Start a new colony
388
- 2. /ant:tunnels — Browse archived colonies
389
- 3. /clear — Clear context and continue
468
+ What would you like to do next?
469
+ 1. /ant:lay-eggs "<new goal>" — Start a new colony
470
+ 2. /ant:tunnels — Browse archived colonies
471
+ 3. /clear — Clear context and continue
390
472
 
391
473
  Use AskUserQuestion with these three options.
392
474
 
@@ -397,10 +479,20 @@ If option 3 selected: display "Run /ant:lay-eggs to begin anew after clearing"
397
479
 
398
480
  ### Edge Cases
399
481
 
400
- **Chamber name collision:** Automatically append counter to make unique.
482
+ **Colony not sealed:**
483
+ - Refuse with guidance to run /ant:seal first. This is the primary gate.
484
+
485
+ **Chamber name collision:**
486
+ - Automatically append counter to make unique.
487
+
488
+ **Missing files during archive:**
489
+ - Note in output but continue with available files. The `|| true` in the copy loop handles this.
401
490
 
402
- **Missing files during archive:** Note in output but continue with available files.
491
+ **State reset failure:**
492
+ - Restore from backup, display error, do not claim success.
403
493
 
404
- **State reset failure:** Restore from backup, display error, do not claim success.
494
+ **Empty phases array:**
495
+ - Can entomb a colony that was initialized but had no phases planned (treat as 0 of 0 completed).
405
496
 
406
- **Empty phases array:** Can entomb a colony that was initialized but had no phases planned (treat as 0 of 0 completed).
497
+ **Missing CROWNED-ANTHILL.md:**
498
+ - Refuse with guidance to run /ant:seal again.