aether-colony 5.3.2 → 5.4.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 (281) hide show
  1. package/.aether/aether-utils.sh +181 -5
  2. package/.aether/commands/archaeology.yaml +3 -3
  3. package/.aether/commands/build.yaml +80 -45
  4. package/.aether/commands/chaos.yaml +7 -7
  5. package/.aether/commands/colonize.yaml +17 -17
  6. package/.aether/commands/continue.yaml +40 -40
  7. package/.aether/commands/council.yaml +6 -6
  8. package/.aether/commands/data-clean.yaml +3 -3
  9. package/.aether/commands/dream.yaml +2 -2
  10. package/.aether/commands/entomb.yaml +12 -12
  11. package/.aether/commands/export-signals.yaml +2 -2
  12. package/.aether/commands/feedback.yaml +6 -6
  13. package/.aether/commands/flag.yaml +2 -2
  14. package/.aether/commands/flags.yaml +4 -4
  15. package/.aether/commands/focus.yaml +6 -6
  16. package/.aether/commands/help.yaml +1 -1
  17. package/.aether/commands/history.yaml +1 -1
  18. package/.aether/commands/import-signals.yaml +2 -2
  19. package/.aether/commands/init.yaml +44 -27
  20. package/.aether/commands/insert-phase.yaml +1 -1
  21. package/.aether/commands/interpret.yaml +2 -2
  22. package/.aether/commands/lay-eggs.yaml +3 -3
  23. package/.aether/commands/maturity.yaml +2 -2
  24. package/.aether/commands/memory-details.yaml +1 -1
  25. package/.aether/commands/migrate-state.yaml +1 -1
  26. package/.aether/commands/oracle.yaml +147 -82
  27. package/.aether/commands/organize.yaml +5 -5
  28. package/.aether/commands/patrol.yaml +8 -8
  29. package/.aether/commands/pause-colony.yaml +7 -7
  30. package/.aether/commands/phase.yaml +1 -1
  31. package/.aether/commands/pheromones.yaml +1 -1
  32. package/.aether/commands/plan.yaml +14 -14
  33. package/.aether/commands/quick.yaml +4 -4
  34. package/.aether/commands/redirect.yaml +6 -6
  35. package/.aether/commands/resume-colony.yaml +9 -9
  36. package/.aether/commands/resume.yaml +5 -38
  37. package/.aether/commands/run.yaml +10 -10
  38. package/.aether/commands/seal.yaml +33 -33
  39. package/.aether/commands/skill-create.yaml +4 -4
  40. package/.aether/commands/status.yaml +14 -14
  41. package/.aether/commands/swarm.yaml +14 -14
  42. package/.aether/commands/tunnels.yaml +7 -7
  43. package/.aether/commands/update.yaml +1 -1
  44. package/.aether/commands/verify-castes.yaml +3 -3
  45. package/.aether/commands/watch.yaml +15 -15
  46. package/.aether/docs/command-playbooks/build-complete.md +48 -15
  47. package/.aether/docs/command-playbooks/build-context.md +11 -11
  48. package/.aether/docs/command-playbooks/build-full.md +76 -76
  49. package/.aether/docs/command-playbooks/build-prep.md +10 -10
  50. package/.aether/docs/command-playbooks/build-verify.md +27 -27
  51. package/.aether/docs/command-playbooks/build-wave.md +38 -38
  52. package/.aether/docs/command-playbooks/continue-advance.md +60 -27
  53. package/.aether/docs/command-playbooks/continue-finalize.md +25 -11
  54. package/.aether/docs/command-playbooks/continue-full.md +60 -46
  55. package/.aether/docs/command-playbooks/continue-gates.md +18 -18
  56. package/.aether/docs/command-playbooks/continue-verify.md +10 -10
  57. package/.aether/docs/source-of-truth-map.md +10 -10
  58. package/.aether/docs/structural-learning-stack.md +283 -0
  59. package/.aether/templates/colony-state-template.json +1 -0
  60. package/.aether/utils/consolidation-seal.sh +196 -0
  61. package/.aether/utils/consolidation.sh +127 -0
  62. package/.aether/utils/curation-ants/archivist.sh +97 -0
  63. package/.aether/utils/curation-ants/critic.sh +214 -0
  64. package/.aether/utils/curation-ants/herald.sh +102 -0
  65. package/.aether/utils/curation-ants/janitor.sh +121 -0
  66. package/.aether/utils/curation-ants/librarian.sh +99 -0
  67. package/.aether/utils/curation-ants/nurse.sh +153 -0
  68. package/.aether/utils/curation-ants/orchestrator.sh +181 -0
  69. package/.aether/utils/curation-ants/scribe.sh +164 -0
  70. package/.aether/utils/curation-ants/sentinel.sh +119 -0
  71. package/.aether/utils/event-bus.sh +301 -0
  72. package/.aether/utils/graph.sh +559 -0
  73. package/.aether/utils/instinct-store.sh +401 -0
  74. package/.aether/utils/learning.sh +79 -7
  75. package/.aether/utils/oracle/oracle-stop-hook.sh +896 -0
  76. package/.aether/utils/session.sh +13 -0
  77. package/.aether/utils/state-api.sh +1 -1
  78. package/.aether/utils/trust-scoring.sh +347 -0
  79. package/.aether/utils/worktree.sh +97 -0
  80. package/.claude/commands/ant/archaeology.md +2 -2
  81. package/.claude/commands/ant/chaos.md +4 -4
  82. package/.claude/commands/ant/colonize.md +9 -9
  83. package/.claude/commands/ant/council.md +6 -6
  84. package/.claude/commands/ant/data-clean.md +3 -3
  85. package/.claude/commands/ant/dream.md +2 -2
  86. package/.claude/commands/ant/entomb.md +9 -9
  87. package/.claude/commands/ant/export-signals.md +2 -2
  88. package/.claude/commands/ant/feedback.md +4 -4
  89. package/.claude/commands/ant/flag.md +2 -2
  90. package/.claude/commands/ant/flags.md +4 -4
  91. package/.claude/commands/ant/focus.md +4 -4
  92. package/.claude/commands/ant/help.md +1 -1
  93. package/.claude/commands/ant/history.md +1 -1
  94. package/.claude/commands/ant/import-signals.md +2 -2
  95. package/.claude/commands/ant/init.md +44 -27
  96. package/.claude/commands/ant/insert-phase.md +1 -1
  97. package/.claude/commands/ant/interpret.md +2 -2
  98. package/.claude/commands/ant/lay-eggs.md +2 -2
  99. package/.claude/commands/ant/maturity.md +2 -2
  100. package/.claude/commands/ant/memory-details.md +1 -1
  101. package/.claude/commands/ant/migrate-state.md +1 -1
  102. package/.claude/commands/ant/oracle.md +78 -42
  103. package/.claude/commands/ant/organize.md +3 -3
  104. package/.claude/commands/ant/patrol.md +8 -8
  105. package/.claude/commands/ant/pause-colony.md +5 -5
  106. package/.claude/commands/ant/phase.md +1 -1
  107. package/.claude/commands/ant/pheromones.md +1 -1
  108. package/.claude/commands/ant/plan.md +8 -8
  109. package/.claude/commands/ant/quick.md +4 -4
  110. package/.claude/commands/ant/redirect.md +4 -4
  111. package/.claude/commands/ant/resume-colony.md +5 -5
  112. package/.claude/commands/ant/resume.md +17 -29
  113. package/.claude/commands/ant/run.md +10 -10
  114. package/.claude/commands/ant/seal.md +25 -25
  115. package/.claude/commands/ant/skill-create.md +2 -2
  116. package/.claude/commands/ant/status.md +14 -14
  117. package/.claude/commands/ant/swarm.md +14 -14
  118. package/.claude/commands/ant/tunnels.md +4 -4
  119. package/.claude/commands/ant/update.md +1 -1
  120. package/.claude/commands/ant/verify-castes.md +2 -2
  121. package/.claude/commands/ant/watch.md +8 -8
  122. package/.opencode/commands/ant/archaeology.md +1 -1
  123. package/.opencode/commands/ant/build.md +80 -45
  124. package/.opencode/commands/ant/chaos.md +3 -3
  125. package/.opencode/commands/ant/colonize.md +8 -8
  126. package/.opencode/commands/ant/continue.md +40 -40
  127. package/.opencode/commands/ant/council.md +5 -5
  128. package/.opencode/commands/ant/data-clean.md +2 -2
  129. package/.opencode/commands/ant/dream.md +1 -1
  130. package/.opencode/commands/ant/entomb.md +3 -3
  131. package/.opencode/commands/ant/export-signals.md +1 -1
  132. package/.opencode/commands/ant/feedback.md +2 -2
  133. package/.opencode/commands/ant/flag.md +1 -1
  134. package/.opencode/commands/ant/flags.md +3 -3
  135. package/.opencode/commands/ant/focus.md +2 -2
  136. package/.opencode/commands/ant/import-signals.md +1 -1
  137. package/.opencode/commands/ant/init.md +44 -27
  138. package/.opencode/commands/ant/insert-phase.md +1 -1
  139. package/.opencode/commands/ant/interpret.md +1 -1
  140. package/.opencode/commands/ant/lay-eggs.md +2 -2
  141. package/.opencode/commands/ant/maturity.md +1 -1
  142. package/.opencode/commands/ant/memory-details.md +1 -1
  143. package/.opencode/commands/ant/oracle.md +69 -40
  144. package/.opencode/commands/ant/organize.md +2 -2
  145. package/.opencode/commands/ant/patrol.md +8 -8
  146. package/.opencode/commands/ant/pause-colony.md +2 -2
  147. package/.opencode/commands/ant/pheromones.md +1 -1
  148. package/.opencode/commands/ant/plan.md +6 -6
  149. package/.opencode/commands/ant/quick.md +4 -4
  150. package/.opencode/commands/ant/redirect.md +2 -2
  151. package/.opencode/commands/ant/resume-colony.md +4 -4
  152. package/.opencode/commands/ant/resume.md +5 -17
  153. package/.opencode/commands/ant/run.md +10 -10
  154. package/.opencode/commands/ant/seal.md +8 -8
  155. package/.opencode/commands/ant/skill-create.md +2 -2
  156. package/.opencode/commands/ant/status.md +10 -10
  157. package/.opencode/commands/ant/tunnels.md +3 -3
  158. package/.opencode/commands/ant/verify-castes.md +1 -1
  159. package/.opencode/commands/ant/watch.md +7 -7
  160. package/CHANGELOG.md +83 -0
  161. package/README.md +22 -9
  162. package/bin/cli.js +118 -3
  163. package/bin/lib/binary-downloader.js +267 -0
  164. package/bin/lib/update-transaction.js +27 -3
  165. package/bin/lib/version-gate.js +179 -0
  166. package/bin/npx-entry.js +0 -0
  167. package/package.json +1 -1
  168. package/.aether/agents/aether-ambassador.md +0 -140
  169. package/.aether/agents/aether-archaeologist.md +0 -108
  170. package/.aether/agents/aether-architect.md +0 -133
  171. package/.aether/agents/aether-auditor.md +0 -144
  172. package/.aether/agents/aether-builder.md +0 -184
  173. package/.aether/agents/aether-chaos.md +0 -115
  174. package/.aether/agents/aether-chronicler.md +0 -122
  175. package/.aether/agents/aether-gatekeeper.md +0 -116
  176. package/.aether/agents/aether-includer.md +0 -117
  177. package/.aether/agents/aether-keeper.md +0 -177
  178. package/.aether/agents/aether-measurer.md +0 -128
  179. package/.aether/agents/aether-oracle.md +0 -137
  180. package/.aether/agents/aether-probe.md +0 -133
  181. package/.aether/agents/aether-queen.md +0 -286
  182. package/.aether/agents/aether-route-setter.md +0 -130
  183. package/.aether/agents/aether-sage.md +0 -106
  184. package/.aether/agents/aether-scout.md +0 -101
  185. package/.aether/agents/aether-surveyor-disciplines.md +0 -391
  186. package/.aether/agents/aether-surveyor-nest.md +0 -329
  187. package/.aether/agents/aether-surveyor-pathogens.md +0 -264
  188. package/.aether/agents/aether-surveyor-provisions.md +0 -334
  189. package/.aether/agents/aether-tracker.md +0 -137
  190. package/.aether/agents/aether-watcher.md +0 -174
  191. package/.aether/agents/aether-weaver.md +0 -130
  192. package/.aether/commands/claude/archaeology.md +0 -334
  193. package/.aether/commands/claude/build.md +0 -65
  194. package/.aether/commands/claude/chaos.md +0 -336
  195. package/.aether/commands/claude/colonize.md +0 -259
  196. package/.aether/commands/claude/continue.md +0 -60
  197. package/.aether/commands/claude/council.md +0 -507
  198. package/.aether/commands/claude/data-clean.md +0 -81
  199. package/.aether/commands/claude/dream.md +0 -268
  200. package/.aether/commands/claude/entomb.md +0 -498
  201. package/.aether/commands/claude/export-signals.md +0 -57
  202. package/.aether/commands/claude/feedback.md +0 -96
  203. package/.aether/commands/claude/flag.md +0 -151
  204. package/.aether/commands/claude/flags.md +0 -169
  205. package/.aether/commands/claude/focus.md +0 -76
  206. package/.aether/commands/claude/help.md +0 -154
  207. package/.aether/commands/claude/history.md +0 -140
  208. package/.aether/commands/claude/import-signals.md +0 -71
  209. package/.aether/commands/claude/init.md +0 -505
  210. package/.aether/commands/claude/insert-phase.md +0 -105
  211. package/.aether/commands/claude/interpret.md +0 -278
  212. package/.aether/commands/claude/lay-eggs.md +0 -210
  213. package/.aether/commands/claude/maturity.md +0 -113
  214. package/.aether/commands/claude/memory-details.md +0 -77
  215. package/.aether/commands/claude/migrate-state.md +0 -171
  216. package/.aether/commands/claude/oracle.md +0 -642
  217. package/.aether/commands/claude/organize.md +0 -232
  218. package/.aether/commands/claude/patrol.md +0 -620
  219. package/.aether/commands/claude/pause-colony.md +0 -233
  220. package/.aether/commands/claude/phase.md +0 -115
  221. package/.aether/commands/claude/pheromones.md +0 -156
  222. package/.aether/commands/claude/plan.md +0 -693
  223. package/.aether/commands/claude/preferences.md +0 -65
  224. package/.aether/commands/claude/quick.md +0 -100
  225. package/.aether/commands/claude/redirect.md +0 -76
  226. package/.aether/commands/claude/resume-colony.md +0 -197
  227. package/.aether/commands/claude/resume.md +0 -388
  228. package/.aether/commands/claude/run.md +0 -231
  229. package/.aether/commands/claude/seal.md +0 -774
  230. package/.aether/commands/claude/skill-create.md +0 -286
  231. package/.aether/commands/claude/status.md +0 -410
  232. package/.aether/commands/claude/swarm.md +0 -349
  233. package/.aether/commands/claude/tunnels.md +0 -426
  234. package/.aether/commands/claude/update.md +0 -132
  235. package/.aether/commands/claude/verify-castes.md +0 -143
  236. package/.aether/commands/claude/watch.md +0 -239
  237. package/.aether/commands/opencode/archaeology.md +0 -331
  238. package/.aether/commands/opencode/build.md +0 -1168
  239. package/.aether/commands/opencode/chaos.md +0 -329
  240. package/.aether/commands/opencode/colonize.md +0 -195
  241. package/.aether/commands/opencode/continue.md +0 -1436
  242. package/.aether/commands/opencode/council.md +0 -437
  243. package/.aether/commands/opencode/data-clean.md +0 -77
  244. package/.aether/commands/opencode/dream.md +0 -260
  245. package/.aether/commands/opencode/entomb.md +0 -377
  246. package/.aether/commands/opencode/export-signals.md +0 -54
  247. package/.aether/commands/opencode/feedback.md +0 -99
  248. package/.aether/commands/opencode/flag.md +0 -149
  249. package/.aether/commands/opencode/flags.md +0 -167
  250. package/.aether/commands/opencode/focus.md +0 -73
  251. package/.aether/commands/opencode/help.md +0 -157
  252. package/.aether/commands/opencode/history.md +0 -136
  253. package/.aether/commands/opencode/import-signals.md +0 -68
  254. package/.aether/commands/opencode/init.md +0 -518
  255. package/.aether/commands/opencode/insert-phase.md +0 -111
  256. package/.aether/commands/opencode/interpret.md +0 -272
  257. package/.aether/commands/opencode/lay-eggs.md +0 -213
  258. package/.aether/commands/opencode/maturity.md +0 -108
  259. package/.aether/commands/opencode/memory-details.md +0 -83
  260. package/.aether/commands/opencode/migrate-state.md +0 -165
  261. package/.aether/commands/opencode/oracle.md +0 -593
  262. package/.aether/commands/opencode/organize.md +0 -226
  263. package/.aether/commands/opencode/patrol.md +0 -626
  264. package/.aether/commands/opencode/pause-colony.md +0 -203
  265. package/.aether/commands/opencode/phase.md +0 -113
  266. package/.aether/commands/opencode/pheromones.md +0 -162
  267. package/.aether/commands/opencode/plan.md +0 -684
  268. package/.aether/commands/opencode/preferences.md +0 -71
  269. package/.aether/commands/opencode/quick.md +0 -91
  270. package/.aether/commands/opencode/redirect.md +0 -84
  271. package/.aether/commands/opencode/resume-colony.md +0 -190
  272. package/.aether/commands/opencode/resume.md +0 -394
  273. package/.aether/commands/opencode/run.md +0 -237
  274. package/.aether/commands/opencode/seal.md +0 -452
  275. package/.aether/commands/opencode/skill-create.md +0 -63
  276. package/.aether/commands/opencode/status.md +0 -307
  277. package/.aether/commands/opencode/swarm.md +0 -15
  278. package/.aether/commands/opencode/tunnels.md +0 -400
  279. package/.aether/commands/opencode/update.md +0 -127
  280. package/.aether/commands/opencode/verify-castes.md +0 -139
  281. package/.aether/commands/opencode/watch.md +0 -227
@@ -1,774 +0,0 @@
1
- <!-- Generated from .aether/commands/seal.yaml - DO NOT EDIT DIRECTLY -->
2
- ---
3
- name: ant:seal
4
- description: "🏺🐜🏺 Seal the colony with Crowned Anthill milestone"
5
- ---
6
-
7
- You are the **Queen**. Seal the colony with a ceremony — no archiving.
8
-
9
- ## Instructions
10
-
11
- Parse `$ARGUMENTS`:
12
- - If contains `--no-visual`: set `visual_mode = false` (visual is ON by default)
13
- - Otherwise: set `visual_mode = true`
14
-
15
- <failure_modes>
16
- ### Crowned Anthill Write Failure
17
- If writing the Crowned Anthill milestone document fails:
18
- - Do not mark the colony as sealed in state
19
- - Report the error -- sealing is incomplete
20
- - Recovery: user can re-run /ant:seal after fixing the issue
21
-
22
- ### State Update Failure After Seal
23
- If COLONY_STATE.json update fails after seal document is written:
24
- - The seal document exists but state doesn't reflect it
25
- - Report the inconsistency
26
- - Options: (1) Retry state update only, (2) Manual state fix, (3) Re-run /ant:seal
27
- </failure_modes>
28
-
29
- <success_criteria>
30
- Command is complete when:
31
- - Crowned Anthill milestone document is written
32
- - COLONY_STATE.json reflects sealed status
33
- - All phase evidence is summarized in the seal document
34
- - User sees confirmation of successful seal
35
- </success_criteria>
36
-
37
- <read_only>
38
- Do not touch during seal:
39
- - .aether/dreams/ (user notes)
40
- - .aether/chambers/ (archived colonies -- seal does NOT archive)
41
- - Source code files
42
- - .env* files
43
- - .claude/settings.json
44
- </read_only>
45
-
46
- ### Step 0: Initialize Visual Mode (if enabled)
47
-
48
- If `visual_mode` is true:
49
- ### Step 1: Read State
50
-
51
- Read `.aether/data/COLONY_STATE.json`.
52
-
53
- If file missing or `goal: null`:
54
- ```
55
- No colony initialized. Run /ant:init first.
56
- ```
57
- Stop here.
58
-
59
- Extract: `goal`, `state`, `current_phase`, `plan.phases`, `milestone`, `version`, `initialized_at`.
60
-
61
- ### Step 2: Maturity Gate
62
-
63
- Run `bash .aether/aether-utils.sh milestone-detect` to get `milestone`, `phases_completed`, `total_phases`.
64
-
65
- **If milestone is already "Crowned Anthill":**
66
- ```
67
- Colony already sealed at Crowned Anthill.
68
- Run /ant:entomb to archive this colony to chambers.
69
- ```
70
- Stop here.
71
-
72
- **If state is "EXECUTING":**
73
- ```
74
- Colony is still executing. Run /ant:continue first.
75
- ```
76
- Stop here.
77
-
78
- **If all phases complete** (phases_completed == total_phases, or milestone is "Sealed Chambers"):
79
- - Set `incomplete_warning = ""` (no warning needed)
80
- - Proceed to Step 3.
81
-
82
- **If phases are incomplete** (any other milestone — First Mound, Open Chambers, Brood Stable, Ventilated Nest, etc.):
83
- - Set `incomplete_warning = "WARNING: {phases_completed} of {total_phases} phases complete. Sealing now will mark incomplete work as the final state."`
84
- - Proceed to Step 3 (warn but DO NOT block).
85
-
86
- ### Step 3: Confirmation
87
-
88
- Display what will be sealed:
89
- ```
90
- SEAL COLONY
91
-
92
- Goal: {goal}
93
- Phases: {phases_completed} of {total_phases} completed
94
- Current Milestone: {milestone}
95
-
96
- {If incomplete_warning is not empty, display it here}
97
-
98
- This will:
99
- - Award the Crowned Anthill milestone
100
- - Write CROWNED-ANTHILL.md ceremony record
101
- - Promote colony wisdom to QUEEN.md
102
-
103
- Seal this colony? (yes/no)
104
- ```
105
-
106
- Use `AskUserQuestion with yes/no options`.
107
-
108
- If not "yes":
109
- ```
110
- Sealing cancelled. Colony remains active.
111
- ```
112
- Stop here.
113
-
114
- ### Step 3.5: Analytics Review
115
-
116
- Before wisdom approval, spawn Sage to analyze colony trends and provide data-driven insights.
117
-
118
- **Check phase threshold and spawn Sage:**
119
- ```bash
120
- # Check if colony has enough history for meaningful analytics
121
- phases_completed=$(jq '[.plan.phases[] | select(.status == "completed")] | length' .aether/data/COLONY_STATE.json 2>/dev/null || echo "0")
122
-
123
- if [[ "$phases_completed" -ge 3 ]]; then
124
- # Generate Sage name and dispatch
125
- sage_name=$(bash .aether/aether-utils.sh generate-ant-name "sage")
126
- bash .aether/aether-utils.sh spawn-log "Queen" "sage" "$sage_name" "Colony analytics review"
127
-
128
- # Display spawn notification
129
- echo ""
130
- echo "━━━ 📜🐜 S A G E ━━━"
131
- echo "──── 📜🐜 Spawning $sage_name — Colony analytics review ────"
132
- fi
133
- ```
134
-
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
- ```
190
-
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))
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))
329
- fi
330
- done
331
-
332
- if [[ "$hive_promoted_count" -gt 0 ]]; then
333
- echo "Hive promotion: $hive_promoted_count instinct(s) promoted to cross-colony hive"
334
- fi
335
- ```
336
-
337
- **Continue to Step 4 (non-blocking):**
338
- Proceed to Step 4 regardless of hive promotion results — hive promotion is strictly non-blocking.
339
-
340
- ### Step 4: Log Seal Activity
341
-
342
- Log the seal ceremony to activity log:
343
- ```bash
344
- bash .aether/aether-utils.sh activity-log "MODIFIED" "Queen" "Colony sealed - wisdom review completed"
345
- ```
346
-
347
- ### Step 4.4: Checkpoint State
348
-
349
- Before modifying colony state, create a rolling backup:
350
-
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
357
-
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
375
- ```
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
-
381
- ### Step 5: Update Milestone to Crowned Anthill
382
-
383
- Update COLONY_STATE.json:
384
- 1. Set `milestone` to `"Crowned Anthill"`
385
- 2. Set `milestone_updated_at` to current ISO-8601 timestamp
386
- 3. Append event: `"<timestamp>|milestone_reached|seal|Achieved Crowned Anthill milestone"`
387
-
388
- Run `bash .aether/aether-utils.sh validate-state colony` after write.
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
-
526
- ### Step 6: Write CROWNED-ANTHILL.md
527
-
528
- Calculate colony age:
529
- ```bash
530
- initialized_at=$(jq -r '.initialized_at // empty' .aether/data/COLONY_STATE.json)
531
- if [[ -n "$initialized_at" ]]; then
532
- init_epoch=$(date -j -f "%Y-%m-%dT%H:%M:%SZ" "$initialized_at" +%s 2>/dev/null || echo 0)
533
- now_epoch=$(date +%s)
534
- if [[ "$init_epoch" -gt 0 ]]; then
535
- colony_age_days=$(( (now_epoch - init_epoch) / 86400 ))
536
- else
537
- colony_age_days=0
538
- fi
539
- else
540
- colony_age_days=0
541
- fi
542
- ```
543
-
544
- Extract phase recap:
545
- ```bash
546
- phase_recap=""
547
- while IFS= read -r phase_line; do
548
- phase_name=$(echo "$phase_line" | jq -r '.name')
549
- phase_status=$(echo "$phase_line" | jq -r '.status')
550
- phase_recap="${phase_recap} - ${phase_name}: ${phase_status}\n"
551
- done < <(jq -c '.plan.phases[]' .aether/data/COLONY_STATE.json 2>/dev/null)
552
- ```
553
-
554
- Write the seal document:
555
- ```bash
556
- version=$(jq -r '.version // "3.0"' .aether/data/COLONY_STATE.json)
557
- seal_date=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
558
- ```
559
-
560
- Resolve the crowned-anthill template path:
561
- Check ~/.aether/system/templates/crowned-anthill.template.md first,
562
- then .aether/templates/crowned-anthill.template.md.
563
-
564
- If no template found: output "Template missing: crowned-anthill.template.md. Run aether update to fix." and stop.
565
-
566
- Read the template file. Fill all {{PLACEHOLDER}} values:
567
- - {{GOAL}} → goal (from colony state)
568
- - {{SEAL_DATE}} → seal_date (ISO-8601 UTC timestamp)
569
- - {{VERSION}} → version (from colony state)
570
- - {{TOTAL_PHASES}} → total_phases
571
- - {{PHASES_COMPLETED}} → phases_completed
572
- - {{COLONY_AGE_DAYS}} → colony_age_days
573
- - {{PROMOTIONS_MADE}} → promotions_made
574
- - {{PHASE_RECAP}} → phase recap list (one entry per line, formatted from the bash loop above)
575
-
576
- Remove the HTML comment lines at the top of the template (lines starting with <!--).
577
- Write the result to .aether/CROWNED-ANTHILL.md using the Write tool.
578
-
579
- ### Step 6.5: Export XML Archive (best-effort)
580
-
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.
582
-
583
- ```bash
584
- # Check if xmllint is available
585
- if command -v xmllint >/dev/null 2>&1; then
586
- xml_result=$(bash .aether/aether-utils.sh colony-archive-xml ".aether/exchange/colony-archive.xml" 2>&1)
587
- xml_ok=$(echo "$xml_result" | jq -r '.ok // false' 2>/dev/null)
588
- if [[ "$xml_ok" == "true" ]]; then
589
- xml_pheromone_count=$(echo "$xml_result" | jq -r '.result.pheromone_count // 0' 2>/dev/null)
590
- xml_export_line="XML Archive: colony-archive.xml (${xml_pheromone_count} active signals)"
591
- else
592
- xml_export_line="XML Archive: export failed (non-blocking)"
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
624
- else
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)"
629
- fi
630
- ```
631
-
632
- ### Step 7: Display Ceremony
633
-
634
-
635
- Display the ASCII art ceremony:
636
- ```
637
- . .
638
- /|\ /|\
639
- / | \ / | \
640
- / | X | \
641
- / | / \ | \
642
- / |/ \| \
643
- / / \ \
644
- /____ / ___ \ ____\
645
- / / \ \
646
- / / \ \
647
- /_/ \_\
648
- | CROWNED |
649
- | ANTHILL |
650
- |__________|
651
- ```
652
-
653
- Below the ASCII art, display:
654
- ```
655
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
656
- C R O W N E D A N T H I L L v{colony_version}
657
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
658
-
659
- Goal: {goal}
660
- Phases: {phases_completed} of {total_phases} completed
661
- Milestone: Crowned Anthill v{colony_version}
662
- {If incomplete_warning is not empty: display it}
663
- Wisdom Promoted: {promotion_summary}
664
-
665
- Seal Document: .aether/CROWNED-ANTHILL.md
666
- {xml_export_line}
667
- {pher_export_line}
668
- {wisdom_export_line}
669
- {registry_export_line}
670
-
671
- The colony stands crowned and sealed.
672
- Its wisdom lives on in QUEEN.md.
673
- The anthill has reached its final form.
674
-
675
- ──────────────────────────────────────────────────
676
- 🐜 Next Up
677
- ──────────────────────────────────────────────────
678
- /ant:entomb 🏺 Archive colony to chambers
679
- /ant:lay-eggs 🥚 Start a new colony
680
- /ant:tunnels 🗄️ Browse archived chambers
681
- ```
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
-
759
- ### Edge Cases
760
-
761
- **Colony already at Crowned Anthill:**
762
- - Display message and guide to /ant:entomb. Do NOT re-seal.
763
-
764
- **Phases incomplete:**
765
- - Warn but allow. The seal proceeds after confirmation.
766
-
767
- **Missing QUEEN.md:**
768
- - queen-init creates it. If that fails, skip promotion (non-fatal).
769
-
770
- **Missing initialized_at:**
771
- - Colony age defaults to 0 days.
772
-
773
- **Empty phases array:**
774
- - Can seal a colony with 0 phases (rare but valid). phases_completed = 0, total_phases = 0.