aether-colony 5.0.0 → 5.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (317) hide show
  1. package/.aether/aether-utils.sh +3226 -3345
  2. package/.aether/agents-claude/aether-ambassador.md +265 -0
  3. package/.aether/agents-claude/aether-archaeologist.md +327 -0
  4. package/.aether/agents-claude/aether-architect.md +236 -0
  5. package/.aether/agents-claude/aether-auditor.md +271 -0
  6. package/.aether/agents-claude/aether-builder.md +224 -0
  7. package/.aether/agents-claude/aether-chaos.md +269 -0
  8. package/.aether/agents-claude/aether-chronicler.md +305 -0
  9. package/.aether/agents-claude/aether-gatekeeper.md +330 -0
  10. package/.aether/agents-claude/aether-includer.md +374 -0
  11. package/.aether/agents-claude/aether-keeper.md +272 -0
  12. package/.aether/agents-claude/aether-measurer.md +322 -0
  13. package/.aether/agents-claude/aether-oracle.md +237 -0
  14. package/.aether/agents-claude/aether-probe.md +211 -0
  15. package/.aether/agents-claude/aether-queen.md +330 -0
  16. package/.aether/agents-claude/aether-route-setter.md +178 -0
  17. package/.aether/agents-claude/aether-sage.md +418 -0
  18. package/.aether/agents-claude/aether-scout.md +179 -0
  19. package/.aether/agents-claude/aether-surveyor-disciplines.md +417 -0
  20. package/.aether/agents-claude/aether-surveyor-nest.md +355 -0
  21. package/.aether/agents-claude/aether-surveyor-pathogens.md +289 -0
  22. package/.aether/agents-claude/aether-surveyor-provisions.md +360 -0
  23. package/.aether/agents-claude/aether-tracker.md +270 -0
  24. package/.aether/agents-claude/aether-watcher.md +280 -0
  25. package/.aether/agents-claude/aether-weaver.md +248 -0
  26. package/.aether/commands/archaeology.yaml +653 -0
  27. package/.aether/commands/build.yaml +1221 -0
  28. package/.aether/commands/chaos.yaml +653 -0
  29. package/.aether/commands/colonize.yaml +442 -0
  30. package/.aether/commands/continue.yaml +1484 -0
  31. package/.aether/commands/council.yaml +509 -0
  32. package/.aether/commands/data-clean.yaml +80 -0
  33. package/.aether/commands/dream.yaml +275 -0
  34. package/.aether/commands/entomb.yaml +863 -0
  35. package/.aether/commands/export-signals.yaml +64 -0
  36. package/.aether/commands/feedback.yaml +158 -0
  37. package/.aether/commands/flag.yaml +160 -0
  38. package/.aether/commands/flags.yaml +177 -0
  39. package/.aether/commands/focus.yaml +112 -0
  40. package/.aether/commands/help.yaml +167 -0
  41. package/.aether/commands/history.yaml +137 -0
  42. package/.aether/commands/import-signals.yaml +79 -0
  43. package/.aether/commands/init.yaml +502 -0
  44. package/.aether/commands/insert-phase.yaml +102 -0
  45. package/.aether/commands/interpret.yaml +285 -0
  46. package/.aether/commands/lay-eggs.yaml +224 -0
  47. package/.aether/commands/maturity.yaml +122 -0
  48. package/.aether/commands/memory-details.yaml +74 -0
  49. package/.aether/commands/migrate-state.yaml +174 -0
  50. package/.aether/commands/oracle.yaml +1224 -0
  51. package/.aether/commands/organize.yaml +446 -0
  52. package/.aether/commands/patrol.yaml +621 -0
  53. package/.aether/commands/pause-colony.yaml +424 -0
  54. package/.aether/commands/phase.yaml +124 -0
  55. package/.aether/commands/pheromones.yaml +153 -0
  56. package/.aether/commands/plan.yaml +1364 -0
  57. package/.aether/commands/preferences.yaml +63 -0
  58. package/.aether/commands/quick.yaml +104 -0
  59. package/.aether/commands/redirect.yaml +123 -0
  60. package/.aether/commands/resume-colony.yaml +375 -0
  61. package/.aether/commands/resume.yaml +407 -0
  62. package/.aether/commands/run.yaml +229 -0
  63. package/.aether/commands/seal.yaml +1214 -0
  64. package/.aether/commands/skill-create.yaml +337 -0
  65. package/.aether/commands/status.yaml +408 -0
  66. package/.aether/commands/swarm.yaml +352 -0
  67. package/.aether/commands/tunnels.yaml +814 -0
  68. package/.aether/commands/update.yaml +131 -0
  69. package/.aether/commands/verify-castes.yaml +159 -0
  70. package/.aether/commands/watch.yaml +454 -0
  71. package/.aether/docs/INCIDENT_TEMPLATE.md +32 -0
  72. package/.aether/docs/QUEEN-SYSTEM.md +11 -11
  73. package/.aether/docs/README.md +32 -2
  74. package/.aether/docs/command-playbooks/README.md +23 -0
  75. package/.aether/docs/command-playbooks/build-complete.md +349 -0
  76. package/.aether/docs/command-playbooks/build-context.md +282 -0
  77. package/.aether/docs/command-playbooks/build-full.md +1683 -0
  78. package/.aether/docs/command-playbooks/build-prep.md +284 -0
  79. package/.aether/docs/command-playbooks/build-verify.md +405 -0
  80. package/.aether/docs/command-playbooks/build-wave.md +749 -0
  81. package/.aether/docs/command-playbooks/continue-advance.md +524 -0
  82. package/.aether/docs/command-playbooks/continue-finalize.md +447 -0
  83. package/.aether/docs/command-playbooks/continue-full.md +1725 -0
  84. package/.aether/docs/command-playbooks/continue-gates.md +686 -0
  85. package/.aether/docs/command-playbooks/continue-verify.md +407 -0
  86. package/.aether/docs/context-continuity.md +84 -0
  87. package/.aether/docs/disciplines/DISCIPLINES.md +9 -7
  88. package/.aether/docs/error-codes.md +1 -1
  89. package/.aether/docs/known-issues.md +34 -173
  90. package/.aether/docs/pheromones.md +86 -6
  91. package/.aether/docs/plans/pheromone-display-plan.md +257 -0
  92. package/.aether/docs/queen-commands.md +10 -9
  93. package/.aether/docs/source-of-truth-map.md +132 -0
  94. package/.aether/docs/xml-utilities.md +47 -0
  95. package/.aether/rules/aether-colony.md +23 -13
  96. package/.aether/scripts/incident-test-add.sh +47 -0
  97. package/.aether/scripts/weekly-audit.sh +79 -0
  98. package/.aether/skills/.index.json +649 -0
  99. package/.aether/skills/colony/.manifest.json +16 -0
  100. package/.aether/skills/colony/build-discipline/SKILL.md +78 -0
  101. package/.aether/skills/colony/colony-interaction/SKILL.md +56 -0
  102. package/.aether/skills/colony/colony-lifecycle/SKILL.md +77 -0
  103. package/.aether/skills/colony/colony-visuals/SKILL.md +112 -0
  104. package/.aether/skills/colony/context-management/SKILL.md +80 -0
  105. package/.aether/skills/colony/error-presentation/SKILL.md +99 -0
  106. package/.aether/skills/colony/pheromone-protocol/SKILL.md +79 -0
  107. package/.aether/skills/colony/pheromone-visibility/SKILL.md +81 -0
  108. package/.aether/skills/colony/state-safety/SKILL.md +84 -0
  109. package/.aether/skills/colony/worker-priming/SKILL.md +82 -0
  110. package/.aether/skills/domain/.manifest.json +24 -0
  111. package/.aether/skills/domain/README.md +33 -0
  112. package/.aether/skills/domain/django/SKILL.md +49 -0
  113. package/.aether/skills/domain/docker/SKILL.md +52 -0
  114. package/.aether/skills/domain/golang/SKILL.md +52 -0
  115. package/.aether/skills/domain/graphql/SKILL.md +51 -0
  116. package/.aether/skills/domain/html-css/SKILL.md +48 -0
  117. package/.aether/skills/domain/nextjs/SKILL.md +45 -0
  118. package/.aether/skills/domain/nodejs/SKILL.md +53 -0
  119. package/.aether/skills/domain/postgresql/SKILL.md +53 -0
  120. package/.aether/skills/domain/prisma/SKILL.md +59 -0
  121. package/.aether/skills/domain/python/SKILL.md +50 -0
  122. package/.aether/skills/domain/rails/SKILL.md +52 -0
  123. package/.aether/skills/domain/react/SKILL.md +45 -0
  124. package/.aether/skills/domain/rest-api/SKILL.md +58 -0
  125. package/.aether/skills/domain/svelte/SKILL.md +47 -0
  126. package/.aether/skills/domain/tailwind/SKILL.md +45 -0
  127. package/.aether/skills/domain/testing/SKILL.md +53 -0
  128. package/.aether/skills/domain/typescript/SKILL.md +58 -0
  129. package/.aether/skills/domain/vue/SKILL.md +49 -0
  130. package/.aether/templates/QUEEN.md.template +23 -41
  131. package/.aether/templates/colony-state-reset.jq.template +1 -0
  132. package/.aether/templates/colony-state.template.json +4 -0
  133. package/.aether/templates/learning-observations.template.json +6 -0
  134. package/.aether/templates/midden.template.json +13 -0
  135. package/.aether/templates/pheromones.template.json +6 -0
  136. package/.aether/templates/session.template.json +9 -0
  137. package/.aether/utils/atomic-write.sh +63 -17
  138. package/.aether/utils/chamber-utils.sh +145 -2
  139. package/.aether/utils/council.sh +425 -0
  140. package/.aether/utils/emoji-audit.sh +166 -0
  141. package/.aether/utils/error-handler.sh +21 -7
  142. package/.aether/utils/file-lock.sh +182 -27
  143. package/.aether/utils/flag.sh +278 -0
  144. package/.aether/utils/hive.sh +572 -0
  145. package/.aether/utils/immune.sh +508 -0
  146. package/.aether/utils/learning.sh +1928 -0
  147. package/.aether/utils/midden.sh +520 -0
  148. package/.aether/utils/oracle/oracle.md +168 -0
  149. package/.aether/utils/oracle/oracle.sh +1023 -0
  150. package/.aether/utils/pheromone.sh +2029 -0
  151. package/.aether/utils/queen.sh +1710 -0
  152. package/.aether/utils/scan.sh +860 -0
  153. package/.aether/utils/semantic-cli.sh +10 -8
  154. package/.aether/utils/session.sh +816 -0
  155. package/.aether/utils/skills.sh +509 -0
  156. package/.aether/utils/spawn-tree.sh +103 -271
  157. package/.aether/utils/spawn.sh +260 -0
  158. package/.aether/utils/state-api.sh +389 -0
  159. package/.aether/utils/state-loader.sh +8 -6
  160. package/.aether/utils/suggest.sh +611 -0
  161. package/.aether/utils/swarm-display.sh +10 -1
  162. package/.aether/utils/swarm.sh +1004 -0
  163. package/.aether/utils/watch-spawn-tree.sh +11 -2
  164. package/.aether/utils/xml-compose.sh +2 -2
  165. package/.aether/utils/xml-convert.sh +9 -5
  166. package/.aether/utils/xml-core.sh +5 -9
  167. package/.aether/utils/xml-query.sh +4 -4
  168. package/.aether/workers.md +86 -67
  169. package/.claude/agents/ant/aether-ambassador.md +2 -1
  170. package/.claude/agents/ant/aether-archaeologist.md +6 -1
  171. package/.claude/agents/ant/aether-architect.md +236 -0
  172. package/.claude/agents/ant/aether-auditor.md +6 -1
  173. package/.claude/agents/ant/aether-builder.md +38 -1
  174. package/.claude/agents/ant/aether-chaos.md +2 -1
  175. package/.claude/agents/ant/aether-chronicler.md +1 -0
  176. package/.claude/agents/ant/aether-gatekeeper.md +6 -1
  177. package/.claude/agents/ant/aether-includer.md +1 -0
  178. package/.claude/agents/ant/aether-keeper.md +1 -0
  179. package/.claude/agents/ant/aether-measurer.md +6 -1
  180. package/.claude/agents/ant/aether-oracle.md +237 -0
  181. package/.claude/agents/ant/aether-probe.md +2 -1
  182. package/.claude/agents/ant/aether-queen.md +6 -1
  183. package/.claude/agents/ant/aether-route-setter.md +6 -1
  184. package/.claude/agents/ant/aether-sage.md +68 -3
  185. package/.claude/agents/ant/aether-scout.md +38 -1
  186. package/.claude/agents/ant/aether-surveyor-disciplines.md +2 -1
  187. package/.claude/agents/ant/aether-surveyor-nest.md +2 -1
  188. package/.claude/agents/ant/aether-surveyor-pathogens.md +2 -1
  189. package/.claude/agents/ant/aether-surveyor-provisions.md +2 -1
  190. package/.claude/agents/ant/aether-tracker.md +6 -1
  191. package/.claude/agents/ant/aether-watcher.md +37 -1
  192. package/.claude/agents/ant/aether-weaver.md +2 -1
  193. package/.claude/commands/ant/archaeology.md +1 -8
  194. package/.claude/commands/ant/build.md +43 -1159
  195. package/.claude/commands/ant/chaos.md +1 -14
  196. package/.claude/commands/ant/colonize.md +3 -14
  197. package/.claude/commands/ant/continue.md +40 -1026
  198. package/.claude/commands/ant/council.md +213 -15
  199. package/.claude/commands/ant/data-clean.md +81 -0
  200. package/.claude/commands/ant/dream.md +12 -9
  201. package/.claude/commands/ant/entomb.md +62 -87
  202. package/.claude/commands/ant/export-signals.md +57 -0
  203. package/.claude/commands/ant/feedback.md +18 -0
  204. package/.claude/commands/ant/flag.md +12 -0
  205. package/.claude/commands/ant/flags.md +22 -8
  206. package/.claude/commands/ant/focus.md +18 -0
  207. package/.claude/commands/ant/help.md +40 -8
  208. package/.claude/commands/ant/history.md +3 -0
  209. package/.claude/commands/ant/import-signals.md +71 -0
  210. package/.claude/commands/ant/init.md +349 -191
  211. package/.claude/commands/ant/insert-phase.md +105 -0
  212. package/.claude/commands/ant/interpret.md +11 -0
  213. package/.claude/commands/ant/lay-eggs.md +167 -158
  214. package/.claude/commands/ant/maturity.md +22 -11
  215. package/.claude/commands/ant/memory-details.md +77 -0
  216. package/.claude/commands/ant/migrate-state.md +6 -0
  217. package/.claude/commands/ant/oracle.md +317 -62
  218. package/.claude/commands/ant/organize.md +10 -5
  219. package/.claude/commands/ant/patrol.md +620 -0
  220. package/.claude/commands/ant/pause-colony.md +8 -22
  221. package/.claude/commands/ant/phase.md +26 -37
  222. package/.claude/commands/ant/pheromones.md +156 -0
  223. package/.claude/commands/ant/plan.md +199 -50
  224. package/.claude/commands/ant/preferences.md +65 -0
  225. package/.claude/commands/ant/quick.md +100 -0
  226. package/.claude/commands/ant/redirect.md +18 -0
  227. package/.claude/commands/ant/resume-colony.md +37 -22
  228. package/.claude/commands/ant/resume.md +60 -7
  229. package/.claude/commands/ant/run.md +231 -0
  230. package/.claude/commands/ant/seal.md +506 -78
  231. package/.claude/commands/ant/skill-create.md +286 -0
  232. package/.claude/commands/ant/status.md +171 -1
  233. package/.claude/commands/ant/swarm.md +11 -23
  234. package/.claude/commands/ant/tunnels.md +1 -0
  235. package/.claude/commands/ant/update.md +58 -135
  236. package/.claude/commands/ant/verify-castes.md +90 -42
  237. package/.claude/commands/ant/watch.md +1 -0
  238. package/.opencode/agents/aether-ambassador.md +1 -1
  239. package/.opencode/agents/aether-architect.md +133 -0
  240. package/.opencode/agents/aether-builder.md +3 -3
  241. package/.opencode/agents/aether-oracle.md +137 -0
  242. package/.opencode/agents/aether-queen.md +1 -1
  243. package/.opencode/agents/aether-route-setter.md +1 -1
  244. package/.opencode/agents/aether-scout.md +1 -1
  245. package/.opencode/agents/aether-surveyor-disciplines.md +6 -1
  246. package/.opencode/agents/aether-surveyor-nest.md +6 -1
  247. package/.opencode/agents/aether-surveyor-pathogens.md +6 -1
  248. package/.opencode/agents/aether-surveyor-provisions.md +6 -1
  249. package/.opencode/agents/aether-tracker.md +1 -1
  250. package/.opencode/agents/aether-watcher.md +1 -1
  251. package/.opencode/agents/aether-weaver.md +1 -1
  252. package/.opencode/commands/ant/archaeology.md +7 -14
  253. package/.opencode/commands/ant/build.md +54 -88
  254. package/.opencode/commands/ant/chaos.md +7 -24
  255. package/.opencode/commands/ant/colonize.md +10 -17
  256. package/.opencode/commands/ant/continue.md +595 -66
  257. package/.opencode/commands/ant/council.md +150 -18
  258. package/.opencode/commands/ant/data-clean.md +77 -0
  259. package/.opencode/commands/ant/dream.md +15 -17
  260. package/.opencode/commands/ant/entomb.md +28 -18
  261. package/.opencode/commands/ant/export-signals.md +54 -0
  262. package/.opencode/commands/ant/feedback.md +24 -5
  263. package/.opencode/commands/ant/flag.md +16 -4
  264. package/.opencode/commands/ant/flags.md +24 -10
  265. package/.opencode/commands/ant/focus.md +22 -5
  266. package/.opencode/commands/ant/help.md +41 -8
  267. package/.opencode/commands/ant/history.md +9 -0
  268. package/.opencode/commands/ant/import-signals.md +68 -0
  269. package/.opencode/commands/ant/init.md +396 -154
  270. package/.opencode/commands/ant/insert-phase.md +111 -0
  271. package/.opencode/commands/ant/interpret.md +16 -0
  272. package/.opencode/commands/ant/lay-eggs.md +184 -112
  273. package/.opencode/commands/ant/maturity.md +18 -2
  274. package/.opencode/commands/ant/memory-details.md +83 -0
  275. package/.opencode/commands/ant/migrate-state.md +12 -0
  276. package/.opencode/commands/ant/oracle.md +322 -67
  277. package/.opencode/commands/ant/organize.md +14 -12
  278. package/.opencode/commands/ant/patrol.md +626 -0
  279. package/.opencode/commands/ant/pause-colony.md +12 -29
  280. package/.opencode/commands/ant/phase.md +30 -40
  281. package/.opencode/commands/ant/pheromones.md +162 -0
  282. package/.opencode/commands/ant/plan.md +210 -57
  283. package/.opencode/commands/ant/preferences.md +71 -0
  284. package/.opencode/commands/ant/quick.md +91 -0
  285. package/.opencode/commands/ant/redirect.md +22 -5
  286. package/.opencode/commands/ant/resume-colony.md +41 -29
  287. package/.opencode/commands/ant/resume.md +80 -20
  288. package/.opencode/commands/ant/run.md +237 -0
  289. package/.opencode/commands/ant/seal.md +230 -25
  290. package/.opencode/commands/ant/skill-create.md +63 -0
  291. package/.opencode/commands/ant/status.md +125 -30
  292. package/.opencode/commands/ant/swarm.md +3 -345
  293. package/.opencode/commands/ant/tunnels.md +3 -9
  294. package/.opencode/commands/ant/update.md +63 -127
  295. package/.opencode/commands/ant/verify-castes.md +96 -42
  296. package/.opencode/commands/ant/watch.md +7 -0
  297. package/CHANGELOG.md +368 -1
  298. package/README.md +195 -324
  299. package/bin/cli.js +236 -429
  300. package/bin/generate-commands.js +186 -0
  301. package/bin/generate-commands.sh +128 -89
  302. package/bin/lib/spawn-logger.js +0 -15
  303. package/bin/lib/update-transaction.js +285 -35
  304. package/bin/npx-install.js +178 -0
  305. package/bin/validate-package.sh +85 -3
  306. package/package.json +16 -4
  307. package/.aether/CONTEXT.md +0 -160
  308. package/.aether/docs/QUEEN.md +0 -84
  309. package/.aether/exchange/colony-registry.xml +0 -11
  310. package/.aether/exchange/pheromones.xml +0 -87
  311. package/.aether/exchange/queen-wisdom.xml +0 -14
  312. package/.aether/model-profiles.yaml +0 -100
  313. package/.aether/utils/spawn-with-model.sh +0 -56
  314. package/bin/lib/model-profiles.js +0 -445
  315. package/bin/lib/model-verify.js +0 -288
  316. package/bin/lib/proxy-health.js +0 -253
  317. package/bin/lib/telemetry.js +0 -441
@@ -1,3 +1,4 @@
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"
@@ -45,14 +46,6 @@ Do not touch during seal:
45
46
  ### Step 0: Initialize Visual Mode (if enabled)
46
47
 
47
48
  If `visual_mode` is true:
48
- ```bash
49
- # Generate session ID
50
- seal_id="seal-$(date +%s)"
51
-
52
- # Initialize swarm display (consolidated)
53
- bash .aether/aether-utils.sh swarm-display-init "$seal_id" && 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
54
- ```
55
-
56
49
  ### Step 1: Read State
57
50
 
58
51
  Read `.aether/data/COLONY_STATE.json`.
@@ -118,83 +111,273 @@ Sealing cancelled. Colony remains active.
118
111
  ```
119
112
  Stop here.
120
113
 
121
- ### Step 4: Promote Colony Wisdom to QUEEN.md
114
+ ### Step 3.5: Analytics Review
122
115
 
123
- Extract and promote significant patterns, decisions, and instincts from the colony:
116
+ Before wisdom approval, spawn Sage to analyze colony trends and provide data-driven insights.
124
117
 
118
+ **Check phase threshold and spawn Sage:**
125
119
  ```bash
126
- # Ensure QUEEN.md exists
127
- if [[ ! -f ".aether/docs/QUEEN.md" ]]; then
128
- bash .aether/aether-utils.sh queen-init >/dev/null 2>&1
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 ────"
129
132
  fi
133
+ ```
130
134
 
131
- # Extract colony name from session_id or goal
132
- colony_name=$(jq -r '.session_id // empty' .aether/data/COLONY_STATE.json | sed 's/^session_//' | cut -d'_' -f1-3)
133
- [[ -z "$colony_name" ]] && colony_name=$(jq -r '.goal' .aether/data/COLONY_STATE.json | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | cut -c1-30)
134
-
135
- # Track promotion results
136
- promotions_made=0
137
- promotion_details=""
138
-
139
- # Extract and promote phase learnings (validated learnings)
140
- while IFS= read -r learning; do
141
- claim=$(echo "$learning" | jq -r '.claim // empty')
142
- status=$(echo "$learning" | jq -r '.status // empty')
143
-
144
- if [[ -n "$claim" && "$status" == "validated" ]]; then
145
- # Determine type based on content patterns
146
- if echo "$claim" | grep -qi "never\|avoid\|don't\|do not"; then
147
- type="redirect"
148
- elif echo "$claim" | grep -qi "always\|should\|must\|pattern\|approach"; then
149
- type="pattern"
150
- elif echo "$claim" | grep -qi "use\|prefer\|technology\|tool\|library"; then
151
- type="stack"
152
- else
153
- type="philosophy"
154
- fi
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>
189
+ ```
155
190
 
156
- result=$(bash .aether/aether-utils.sh queen-promote "$type" "$claim" "$colony_name" 2>/dev/null)
157
- if echo "$result" | jq -e '.ok' >/dev/null 2>&1; then
158
- promotions_made=$((promotions_made + 1))
159
- promotion_details="${promotion_details} - Promoted ${type}: ${claim:0:60}...\n"
160
- fi
161
- fi
162
- done < <(jq -c '.memory.phase_learnings[]?.learnings[]? // empty' .aether/data/COLONY_STATE.json 2>/dev/null)
163
-
164
- # Extract and promote decisions
165
- while IFS= read -r decision; do
166
- description=$(echo "$decision" | jq -r '.description // .rationale // empty')
167
- [[ -z "$description" ]] && description=$(echo "$decision" | jq -r '.decision // empty')
168
-
169
- if [[ -n "$description" ]]; then
170
- result=$(bash .aether/aether-utils.sh queen-promote "pattern" "$description" "$colony_name" 2>/dev/null)
171
- if echo "$result" | jq -e '.ok' >/dev/null 2>&1; then
172
- promotions_made=$((promotions_made + 1))
173
- promotion_details="${promotion_details} - Promoted pattern from decision: ${description:0:60}...\n"
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."
192
+
193
+ **Parse Sage JSON output:**
194
+ After spawn, extract from response: `key_findings`, `trends`, `recommendations`
195
+
196
+ Log completion and update swarm display:
197
+ ```bash
198
+ bash .aether/aether-utils.sh spawn-complete "$sage_name" "completed" "Analytics review complete"
199
+ ```
200
+
201
+ **Display Sage completion line:**
202
+ ```
203
+ 📜 {sage_name}: Colony analytics review complete ✓
204
+ Velocity: {trend} | Bug density: {level} | Review turnaround: {speed}
205
+ ```
206
+
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"
211
+ ```
212
+
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.
225
+
226
+ ### Step 3.6: Wisdom Approval
227
+
228
+ Before sealing, review wisdom proposals accumulated during this colony's lifecycle.
229
+
230
+ ```bash
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))
174
249
  fi
250
+ done
251
+ fi
252
+
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 ---
258
+
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))
175
329
  fi
176
- done < <(jq -c '.memory.decisions[]? // empty' .aether/data/COLONY_STATE.json 2>/dev/null)
177
-
178
- # Promote high-confidence instincts
179
- instinct_result=$(bash .aether/aether-utils.sh instinct-read --min-confidence 0.7 2>/dev/null || echo '{"ok":false}')
180
- if echo "$instinct_result" | jq -e '.ok' >/dev/null 2>&1; then
181
- while IFS= read -r instinct_action; do
182
- if [[ -n "$instinct_action" && "$instinct_action" != "null" ]]; then
183
- result=$(bash .aether/aether-utils.sh queen-promote "pattern" "$instinct_action" "$colony_name" 2>/dev/null)
184
- if echo "$result" | jq -e '.ok' >/dev/null 2>&1; then
185
- promotions_made=$((promotions_made + 1))
186
- fi
187
- fi
188
- done < <(echo "$instinct_result" | jq -r '.result[]?.action // empty' 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"
189
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.4: Checkpoint State
348
+
349
+ Before modifying colony state, create a rolling backup:
190
350
 
191
- # Log promotion results to activity log
192
- bash .aether/aether-utils.sh activity-log "MODIFIED" "Queen" "Promoted ${promotions_made} learnings/decisions/instincts to QUEEN.md from colony ${colony_name}"
351
+ Run using the Bash tool with description "Checkpointing colony state before seal...":
352
+ ```bash
353
+ bash .aether/aether-utils.sh state-checkpoint "pre-seal" 2>/dev/null || echo "Warning: State checkpoint failed -- continuing without backup" >&2
354
+ ```
355
+
356
+ ### Step 4.5: Increment Colony Version
193
357
 
194
- # Store promotion summary for display
195
- promotion_summary="${promotions_made} wisdom entries promoted"
358
+ Before writing the Crowned Anthill milestone, increment `colony_version` in COLONY_STATE.json.
359
+
360
+ ```bash
361
+ # Read current colony_version (default to 0 for backward compat with older colonies)
362
+ current_colony_version=$(jq -r '.colony_version // 0' .aether/data/COLONY_STATE.json 2>/dev/null || echo 0)
363
+ # Guard against non-integer values (floats, strings)
364
+ [[ "$current_colony_version" =~ ^[0-9]+$ ]] || current_colony_version=0
365
+ new_colony_version=$(( current_colony_version + 1 ))
366
+
367
+ # Write incremented value back — guard against empty output destroying the file
368
+ updated=$(jq --argjson v "$new_colony_version" '.colony_version = $v' .aether/data/COLONY_STATE.json 2>/dev/null)
369
+ if [[ -n "$updated" && ${#updated} -gt 10 ]]; then
370
+ echo "$updated" > .aether/data/COLONY_STATE.json
371
+ else
372
+ echo "Warning: jq update failed — colony_version defaults to 1, state file unchanged"
373
+ new_colony_version=1
374
+ fi
196
375
  ```
197
376
 
377
+ Use `new_colony_version` as `{colony_version}` throughout the rest of the seal ceremony (e.g., display as "Crowned Anthill v{colony_version}").
378
+
379
+ **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.
380
+
198
381
  ### Step 5: Update Milestone to Crowned Anthill
199
382
 
200
383
  Update COLONY_STATE.json:
@@ -204,6 +387,142 @@ Update COLONY_STATE.json:
204
387
 
205
388
  Run `bash .aether/aether-utils.sh validate-state colony` after write.
206
389
 
390
+ ### Step 5.1: Update Changelog
391
+
392
+ **MANDATORY: Record the seal in the project changelog. This step is never skipped.**
393
+
394
+ If no `CHANGELOG.md` exists, `changelog-append` creates one automatically.
395
+
396
+ Build a summary of what the colony accomplished across all phases:
397
+ - Collect completed phase names from COLONY_STATE.json
398
+ - Summarize the goal and key outcomes in one line
399
+
400
+ ```bash
401
+ bash .aether/aether-utils.sh changelog-append \
402
+ "$(date +%Y-%m-%d)" \
403
+ "seal-crowned-anthill" \
404
+ "00" \
405
+ "{key_files_csv}" \
406
+ "Colony sealed at Crowned Anthill;{goal}" \
407
+ "{phases_completed} phases completed;Colony wisdom promoted to QUEEN.md" \
408
+ ""
409
+ ```
410
+
411
+ - `{key_files_csv}` — list the most significant files created or modified across the colony's lifetime (derive from phase plans or git log)
412
+ - `{goal}` — the colony goal from COLONY_STATE.json
413
+
414
+ **Error handling:** If `changelog-append` fails, log to midden and continue — changelog failure never blocks sealing.
415
+
416
+ ### Step 5.2: Update Registry (Silent)
417
+
418
+ Mark the colony as inactive in the global registry. This is silent on failure — registry is not required for the colony to work.
419
+
420
+ Run using the Bash tool (ignore errors):
421
+ ```bash
422
+ 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
423
+ ```
424
+
425
+ If the command fails, proceed silently. This is optional bookkeeping.
426
+
427
+ ### Step 5.5: Documentation Coverage Audit
428
+
429
+ Before writing the seal document, spawn a Chronicler to survey documentation coverage.
430
+
431
+ **Generate Chronicler name and dispatch:**
432
+ ```bash
433
+ # Generate unique chronicler name
434
+ chronicler_name=$(bash .aether/aether-utils.sh generate-ant-name "chronicler")
435
+
436
+ # Log spawn and update swarm display
437
+ bash .aether/aether-utils.sh spawn-log "Queen" "chronicler" "$chronicler_name" "Documentation coverage audit"
438
+ ```
439
+
440
+ **Display:**
441
+ ```
442
+ ━━━ 📝🐜 C H R O N I C L E R ━━━
443
+ ──── 📝🐜 Spawning {chronicler_name} — documentation coverage audit ────
444
+ ```
445
+
446
+ **Spawn Chronicler using Task tool:**
447
+ Spawn the Chronicler using Task tool with `subagent_type="aether-chronicler"`:
448
+
449
+ ```xml
450
+ <task>
451
+ <description>📝 Chronicler {chronicler_name}: Documentation coverage audit</description>
452
+ <prompt>
453
+ You are {chronicler_name}, a 📝 Chronicler Ant.
454
+
455
+ Mission: Documentation coverage audit before seal ceremony
456
+
457
+ Survey the following documentation types:
458
+ - README.md (project overview, quick start)
459
+ - API documentation (endpoints, parameters, responses)
460
+ - Guides (tutorials, how-tos, best practices)
461
+ - Changelogs (version history, release notes)
462
+ - Code comments (JSDoc, TSDoc inline documentation)
463
+ - Architecture docs (system design, decisions)
464
+
465
+ Work:
466
+ 1. Check if README.md exists and covers: installation, usage, examples
467
+ 2. Look for docs/ directory and survey guide coverage
468
+ 3. Check for API documentation (OpenAPI, README sections, etc.)
469
+ 4. Verify CHANGELOG.md exists and has recent entries
470
+ 5. Sample source files for inline documentation coverage
471
+ 6. Identify documentation gaps (missing, outdated, incomplete)
472
+
473
+ **IMPORTANT:** You are strictly read-only. Do not modify any files.
474
+
475
+ Log activity: bash .aether/aether-utils.sh activity-log "SURVEYING" "{chronicler_name}" "description"
476
+
477
+ Return ONLY this JSON (no other text):
478
+ {
479
+ "ant_name": "{chronicler_name}",
480
+ "caste": "chronicler",
481
+ "status": "completed" | "failed" | "blocked",
482
+ "summary": "What you surveyed and found",
483
+ "documentation_created": [],
484
+ "documentation_updated": [],
485
+ "pages_documented": 0,
486
+ "code_examples_verified": [],
487
+ "coverage_percent": 0,
488
+ "gaps_identified": [
489
+ {"type": "README|API|Guide|Changelog|Comments|Architecture", "severity": "high|medium|low", "description": "...", "location": "..."}
490
+ ],
491
+ "blockers": []
492
+ }
493
+ </prompt>
494
+ </task>
495
+ ```
496
+
497
+ **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."
498
+
499
+ **Parse Chronicler JSON output:**
500
+ Extract from response: `coverage_percent`, `gaps_identified`, `pages_documented`
501
+
502
+ Log completion and update swarm display:
503
+ ```bash
504
+ bash .aether/aether-utils.sh spawn-complete "$chronicler_name" "completed" "Documentation audit complete"
505
+ ```
506
+
507
+ **Display Chronicler completion line:**
508
+ ```
509
+ 📝 {chronicler_name}: Documentation coverage audit ({pages_documented} pages, {coverage_percent}% coverage) ✓
510
+ ```
511
+
512
+ **Log gaps to midden (non-blocking):**
513
+ For each gap in `gaps_identified` with severity "high" or "medium":
514
+ ```bash
515
+ bash .aether/aether-utils.sh midden-write "documentation" "Gap ({severity}): {description} at {location}" "chronicler"
516
+ ```
517
+
518
+ **Display summary:**
519
+ ```
520
+ 📝 Chronicler complete — {coverage_percent}% coverage, {gap_count} gaps logged to midden
521
+ ```
522
+
523
+ **Continue to Step 6 (non-blocking):**
524
+ Proceed to Step 6 regardless of Chronicler findings — Chronicler is strictly non-blocking.
525
+
207
526
  ### Step 6: Write CROWNED-ANTHILL.md
208
527
 
209
528
  Calculate colony age:
@@ -259,7 +578,7 @@ Write the result to .aether/CROWNED-ANTHILL.md using the Write tool.
259
578
 
260
579
  ### Step 6.5: Export XML Archive (best-effort)
261
580
 
262
- Export colony data as a combined XML archive. This is best-effort — seal proceeds even if XML export fails.
581
+ Export colony data as a combined XML archive and a standalone pheromones.xml. Both are best-effort — seal proceeds even if XML export fails.
263
582
 
264
583
  ```bash
265
584
  # Check if xmllint is available
@@ -272,17 +591,46 @@ if command -v xmllint >/dev/null 2>&1; then
272
591
  else
273
592
  xml_export_line="XML Archive: export failed (non-blocking)"
274
593
  fi
594
+
595
+ # Also export standalone pheromones.xml for cross-colony sharing
596
+ pher_result=$(bash .aether/aether-utils.sh pheromone-export-xml ".aether/exchange/pheromones.xml" 2>&1)
597
+ pher_ok=$(echo "$pher_result" | jq -r '.ok // false' 2>/dev/null)
598
+ if [[ "$pher_ok" == "true" ]]; then
599
+ pher_signal_count=$(jq '[.signals[] | select(.active != false)] | length' .aether/data/pheromones.json 2>/dev/null || echo "0")
600
+ pher_export_line="Signal Export: pheromones.xml (${pher_signal_count} signals, importable by other colonies)"
601
+ else
602
+ pher_export_line="Signal Export: failed (non-blocking)"
603
+ fi
604
+
605
+ # Export standalone queen-wisdom.xml for cross-colony wisdom sharing
606
+ wisdom_result=$(bash .aether/aether-utils.sh wisdom-export-xml ".aether/exchange/queen-wisdom.xml" 2>&1)
607
+ wisdom_ok=$(echo "$wisdom_result" | jq -r '.ok // false' 2>/dev/null)
608
+ if [[ "$wisdom_ok" == "true" ]]; then
609
+ wisdom_count=$(echo "$wisdom_result" | jq -r '.result.entries // 0' 2>/dev/null)
610
+ wisdom_export_line="Wisdom Export: queen-wisdom.xml (${wisdom_count} entries)"
611
+ else
612
+ wisdom_export_line="Wisdom Export: failed (non-blocking)"
613
+ fi
614
+
615
+ # Export standalone colony-registry.xml for lineage tracking
616
+ registry_result=$(bash .aether/aether-utils.sh registry-export-xml ".aether/exchange/colony-registry.xml" 2>&1)
617
+ registry_ok=$(echo "$registry_result" | jq -r '.ok // false' 2>/dev/null)
618
+ if [[ "$registry_ok" == "true" ]]; then
619
+ registry_count=$(echo "$registry_result" | jq -r '.result.colonies // 0' 2>/dev/null)
620
+ registry_export_line="Registry Export: colony-registry.xml (${registry_count} colonies)"
621
+ else
622
+ registry_export_line="Registry Export: failed (non-blocking)"
623
+ fi
275
624
  else
276
625
  xml_export_line="XML Archive: skipped (xmllint not available)"
626
+ pher_export_line="Signal Export: skipped (xmllint not available)"
627
+ wisdom_export_line="Wisdom Export: skipped (xmllint not available)"
628
+ registry_export_line="Registry Export: skipped (xmllint not available)"
277
629
  fi
278
630
  ```
279
631
 
280
632
  ### Step 7: Display Ceremony
281
633
 
282
- **If visual_mode is true, render swarm display BEFORE the ASCII art (consolidated):**
283
- ```bash
284
- 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 && bash .aether/aether-utils.sh swarm-display-inline "$seal_id"
285
- ```
286
634
 
287
635
  Display the ASCII art ceremony:
288
636
  ```
@@ -305,16 +653,20 @@ Display the ASCII art ceremony:
305
653
  Below the ASCII art, display:
306
654
  ```
307
655
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
308
- C R O W N E D A N T H I L L
656
+ C R O W N E D A N T H I L L v{colony_version}
309
657
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
310
658
 
311
659
  Goal: {goal}
312
660
  Phases: {phases_completed} of {total_phases} completed
661
+ Milestone: Crowned Anthill v{colony_version}
313
662
  {If incomplete_warning is not empty: display it}
314
663
  Wisdom Promoted: {promotion_summary}
315
664
 
316
665
  Seal Document: .aether/CROWNED-ANTHILL.md
317
666
  {xml_export_line}
667
+ {pher_export_line}
668
+ {wisdom_export_line}
669
+ {registry_export_line}
318
670
 
319
671
  The colony stands crowned and sealed.
320
672
  Its wisdom lives on in QUEEN.md.
@@ -328,6 +680,82 @@ The anthill has reached its final form.
328
680
  /ant:tunnels 🗄️ Browse archived chambers
329
681
  ```
330
682
 
683
+ ### Step 7.5: Commit Suggestion (Non-blocking)
684
+
685
+ After the ceremony, offer to commit all colony work.
686
+
687
+ **Gate check — skip silently if any fail:**
688
+ 1. Not a git repo: `git rev-parse --git-dir 2>/dev/null` fails → skip
689
+ 2. Clean working tree: `git status --porcelain 2>/dev/null` is empty → skip to Step 7.6 (may still want to push)
690
+
691
+ **If uncommitted changes exist:**
692
+
693
+ Generate a seal commit message:
694
+ ```bash
695
+ seal_commit=$(bash .aether/aether-utils.sh generate-commit-message seal "$phases_completed" "$goal" "$colony_age_days" 2>/dev/null)
696
+ seal_message=$(echo "$seal_commit" | jq -r '.result.message // "aether-seal: colony sealed"')
697
+ seal_body=$(echo "$seal_commit" | jq -r '.result.body // ""')
698
+ ```
699
+
700
+ Display the suggestion:
701
+ ```
702
+ ──────────────────────────────────────────────────
703
+ Commit suggestion:
704
+
705
+ $seal_message
706
+
707
+ $seal_body
708
+ ──────────────────────────────────────────────────
709
+ ```
710
+
711
+ Prompt with AskUserQuestion (3 options):
712
+ 1. **Commit with this message** — Run `git add -A && git commit -m "$seal_message" -m "$seal_body"`
713
+ 2. **Edit message** — Ask user for their preferred message, then commit with that
714
+ 3. **Skip** — Do not commit
715
+
716
+ If the user chooses option 1 or 2 and the commit succeeds, set `seal_committed = true`.
717
+ If the commit fails or user skips, set `seal_committed = false`.
718
+
719
+ **Error handling:** If `generate-commit-message` fails, fall back to message `"aether-seal: colony sealed"`. Never let commit suggestion failures stop the seal flow.
720
+
721
+ ### Step 7.6: Push Suggestion (Non-blocking)
722
+
723
+ Only show if a commit was just made in Step 7.5 (`seal_committed == true`) OR if there are unpushed commits.
724
+
725
+ **Gate check — skip silently if any fail:**
726
+ 1. Not a git repo → skip
727
+ 2. No remote configured: `git remote -v 2>/dev/null` is empty → skip
728
+
729
+ **Check for unpushed commits:**
730
+ ```bash
731
+ unpushed=$(git log --oneline @{u}..HEAD 2>/dev/null | wc -l | tr -d ' ')
732
+ ```
733
+ If `unpushed == 0` and `seal_committed == false` → skip (nothing to push)
734
+
735
+ **If there are commits to push:**
736
+
737
+ Detect current branch and upstream status:
738
+ ```bash
739
+ current_branch=$(git branch --show-current)
740
+ has_upstream=$(git rev-parse --abbrev-ref @{u} 2>/dev/null && echo "yes" || echo "no")
741
+ ```
742
+
743
+ Display:
744
+ ```
745
+ Push {unpushed} commit(s) to remote?
746
+ Branch: {current_branch}
747
+ ```
748
+
749
+ Prompt with AskUserQuestion (2 options):
750
+ 1. **Push now** — If upstream exists: `git push`. If no upstream: `git push -u origin $current_branch`
751
+ 2. **I'll push later** — Skip
752
+
753
+ Display result: `Pushed to origin/{current_branch}` on success, or `Push skipped` if declined.
754
+
755
+ **Error handling:** If push fails, display the error message but do not stop the seal flow. Suggest: "You can push manually with `git push`."
756
+
757
+ **Safety:** Never auto-push. Always require explicit user approval via AskUserQuestion.
758
+
331
759
  ### Edge Cases
332
760
 
333
761
  **Colony already at Crowned Anthill:**