aether-colony 3.1.17 → 5.0.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 (183) hide show
  1. package/{runtime → .aether}/CONTEXT.md +1 -1
  2. package/{runtime → .aether}/aether-utils.sh +1772 -98
  3. package/.aether/docs/QUEEN-SYSTEM.md +211 -0
  4. package/.aether/docs/QUEEN.md +84 -0
  5. package/.aether/docs/README.md +68 -0
  6. package/.aether/docs/caste-system.md +48 -0
  7. package/{runtime → .aether/docs/disciplines}/DISCIPLINES.md +8 -8
  8. package/.aether/docs/error-codes.md +268 -0
  9. package/{runtime → .aether}/docs/known-issues.md +42 -26
  10. package/.aether/docs/queen-commands.md +97 -0
  11. package/.aether/exchange/colony-registry.xml +11 -0
  12. package/{runtime → .aether}/exchange/pheromone-xml.sh +2 -1
  13. package/.aether/exchange/pheromones.xml +87 -0
  14. package/.aether/exchange/queen-wisdom.xml +14 -0
  15. package/{runtime → .aether}/exchange/registry-xml.sh +7 -3
  16. package/{runtime → .aether}/exchange/wisdom-xml.sh +11 -4
  17. package/.aether/rules/aether-colony.md +134 -0
  18. package/.aether/schemas/example-prompt-builder.xml +234 -0
  19. package/.aether/templates/colony-state-reset.jq.template +22 -0
  20. package/.aether/templates/colony-state.template.json +35 -0
  21. package/.aether/templates/constraints.template.json +9 -0
  22. package/.aether/templates/crowned-anthill.template.md +36 -0
  23. package/.aether/templates/handoff-build-error.template.md +30 -0
  24. package/.aether/templates/handoff-build-success.template.md +39 -0
  25. package/.aether/templates/handoff.template.md +40 -0
  26. package/{runtime → .aether}/utils/atomic-write.sh +5 -5
  27. package/{runtime → .aether}/utils/chamber-compare.sh +23 -10
  28. package/{runtime → .aether}/utils/chamber-utils.sh +32 -20
  29. package/{runtime → .aether}/utils/error-handler.sh +13 -1
  30. package/{runtime → .aether}/utils/file-lock.sh +49 -13
  31. package/.aether/utils/semantic-cli.sh +413 -0
  32. package/{runtime → .aether}/utils/xml-compose.sh +7 -1
  33. package/.aether/utils/xml-convert.sh +273 -0
  34. package/.aether/utils/xml-query.sh +201 -0
  35. package/.aether/utils/xml-utils.sh +110 -0
  36. package/{runtime → .aether}/workers.md +14 -17
  37. package/.claude/agents/ant/aether-ambassador.md +264 -0
  38. package/.claude/agents/ant/aether-archaeologist.md +322 -0
  39. package/.claude/agents/ant/aether-auditor.md +266 -0
  40. package/.claude/agents/ant/aether-builder.md +187 -0
  41. package/.claude/agents/ant/aether-chaos.md +268 -0
  42. package/.claude/agents/ant/aether-chronicler.md +304 -0
  43. package/.claude/agents/ant/aether-gatekeeper.md +325 -0
  44. package/.claude/agents/ant/aether-includer.md +373 -0
  45. package/.claude/agents/ant/aether-keeper.md +271 -0
  46. package/.claude/agents/ant/aether-measurer.md +317 -0
  47. package/.claude/agents/ant/aether-probe.md +210 -0
  48. package/.claude/agents/ant/aether-queen.md +325 -0
  49. package/.claude/agents/ant/aether-route-setter.md +173 -0
  50. package/.claude/agents/ant/aether-sage.md +353 -0
  51. package/.claude/agents/ant/aether-scout.md +142 -0
  52. package/.claude/agents/ant/aether-surveyor-disciplines.md +416 -0
  53. package/.claude/agents/ant/aether-surveyor-nest.md +354 -0
  54. package/.claude/agents/ant/aether-surveyor-pathogens.md +288 -0
  55. package/.claude/agents/ant/aether-surveyor-provisions.md +359 -0
  56. package/.claude/agents/ant/aether-tracker.md +265 -0
  57. package/.claude/agents/ant/aether-watcher.md +244 -0
  58. package/.claude/agents/ant/aether-weaver.md +247 -0
  59. package/.claude/commands/ant/archaeology.md +16 -7
  60. package/.claude/commands/ant/build.md +415 -284
  61. package/.claude/commands/ant/chaos.md +19 -10
  62. package/.claude/commands/ant/colonize.md +58 -24
  63. package/.claude/commands/ant/continue.md +155 -145
  64. package/.claude/commands/ant/council.md +15 -5
  65. package/.claude/commands/ant/dream.md +16 -7
  66. package/.claude/commands/ant/entomb.md +274 -157
  67. package/.claude/commands/ant/feedback.md +33 -29
  68. package/.claude/commands/ant/flag.md +18 -10
  69. package/.claude/commands/ant/flags.md +14 -6
  70. package/.claude/commands/ant/focus.md +29 -21
  71. package/.claude/commands/ant/help.md +11 -1
  72. package/.claude/commands/ant/history.md +10 -0
  73. package/.claude/commands/ant/init.md +91 -65
  74. package/.claude/commands/ant/interpret.md +15 -4
  75. package/.claude/commands/ant/lay-eggs.md +55 -7
  76. package/.claude/commands/ant/maturity.md +11 -1
  77. package/.claude/commands/ant/migrate-state.md +14 -2
  78. package/.claude/commands/ant/oracle.md +23 -15
  79. package/.claude/commands/ant/organize.md +29 -20
  80. package/.claude/commands/ant/pause-colony.md +17 -7
  81. package/.claude/commands/ant/phase.md +17 -8
  82. package/.claude/commands/ant/plan.md +20 -9
  83. package/.claude/commands/ant/redirect.md +29 -32
  84. package/.claude/commands/ant/resume-colony.md +19 -9
  85. package/.claude/commands/ant/resume.md +272 -96
  86. package/.claude/commands/ant/seal.md +201 -191
  87. package/.claude/commands/ant/status.md +71 -32
  88. package/.claude/commands/ant/swarm.md +26 -44
  89. package/.claude/commands/ant/tunnels.md +279 -105
  90. package/.claude/commands/ant/update.md +81 -20
  91. package/.claude/commands/ant/verify-castes.md +14 -4
  92. package/.claude/commands/ant/watch.md +13 -12
  93. package/.opencode/agents/aether-ambassador.md +63 -20
  94. package/.opencode/agents/aether-archaeologist.md +29 -12
  95. package/.opencode/agents/aether-auditor.md +51 -18
  96. package/.opencode/agents/aether-builder.md +69 -19
  97. package/.opencode/agents/aether-chaos.md +29 -12
  98. package/.opencode/agents/aether-chronicler.md +60 -18
  99. package/.opencode/agents/aether-gatekeeper.md +27 -18
  100. package/.opencode/agents/aether-includer.md +27 -18
  101. package/.opencode/agents/aether-keeper.md +89 -18
  102. package/.opencode/agents/aether-measurer.md +27 -18
  103. package/.opencode/agents/aether-probe.md +60 -18
  104. package/.opencode/agents/aether-queen.md +172 -24
  105. package/.opencode/agents/aether-route-setter.md +57 -12
  106. package/.opencode/agents/aether-sage.md +26 -18
  107. package/.opencode/agents/aether-scout.md +27 -19
  108. package/.opencode/agents/aether-surveyor-disciplines.md +53 -1
  109. package/.opencode/agents/aether-surveyor-nest.md +53 -1
  110. package/.opencode/agents/aether-surveyor-pathogens.md +51 -1
  111. package/.opencode/agents/aether-surveyor-provisions.md +53 -1
  112. package/.opencode/agents/aether-tracker.md +64 -18
  113. package/.opencode/agents/aether-watcher.md +66 -19
  114. package/.opencode/agents/aether-weaver.md +61 -18
  115. package/.opencode/commands/ant/build.md +406 -192
  116. package/.opencode/commands/ant/continue.md +66 -76
  117. package/.opencode/commands/ant/entomb.md +106 -45
  118. package/.opencode/commands/ant/init.md +46 -48
  119. package/.opencode/commands/ant/organize.md +5 -5
  120. package/.opencode/commands/ant/resume.md +334 -0
  121. package/.opencode/commands/ant/seal.md +33 -24
  122. package/.opencode/commands/ant/status.md +11 -0
  123. package/.opencode/commands/ant/tunnels.md +149 -0
  124. package/.opencode/commands/ant/update.md +59 -16
  125. package/CHANGELOG.md +79 -0
  126. package/README.md +135 -353
  127. package/bin/cli.js +243 -122
  128. package/bin/generate-commands.sh +2 -2
  129. package/bin/lib/init.js +13 -3
  130. package/bin/lib/update-transaction.js +119 -117
  131. package/bin/sync-to-runtime.sh +5 -137
  132. package/bin/validate-package.sh +84 -0
  133. package/package.json +9 -6
  134. package/.opencode/agents/aether-architect.md +0 -66
  135. package/.opencode/agents/aether-guardian.md +0 -107
  136. package/.opencode/agents/workers.md +0 -1034
  137. package/runtime/QUEEN_ANT_ARCHITECTURE.md +0 -402
  138. package/runtime/data/signatures.json +0 -41
  139. package/runtime/docs/AETHER-2.0-IMPLEMENTATION-PLAN.md +0 -1343
  140. package/runtime/docs/AETHER-PHEROMONE-SYSTEM-MASTER-SPEC.md +0 -2642
  141. package/runtime/docs/PHEROMONE-INJECTION.md +0 -240
  142. package/runtime/docs/PHEROMONE-INTEGRATION.md +0 -192
  143. package/runtime/docs/PHEROMONE-SYSTEM-DESIGN.md +0 -426
  144. package/runtime/docs/README.md +0 -94
  145. package/runtime/docs/VISUAL-OUTPUT-SPEC.md +0 -219
  146. package/runtime/docs/biological-reference.md +0 -272
  147. package/runtime/docs/codebase-review.md +0 -399
  148. package/runtime/docs/command-sync.md +0 -164
  149. package/runtime/docs/constraints.md +0 -116
  150. package/runtime/docs/implementation-learnings.md +0 -89
  151. package/runtime/docs/namespace.md +0 -148
  152. package/runtime/docs/pathogen-schema-example.json +0 -36
  153. package/runtime/docs/pathogen-schema.md +0 -111
  154. package/runtime/docs/planning-discipline.md +0 -159
  155. package/runtime/docs/progressive-disclosure.md +0 -184
  156. package/runtime/lib/queen-utils.sh +0 -729
  157. package/runtime/planning.md +0 -159
  158. package/runtime/recover.sh +0 -136
  159. package/runtime/utils/xml-utils.sh +0 -2196
  160. package/runtime/workers-new-castes.md +0 -516
  161. /package/{runtime → .aether/docs/disciplines}/coding-standards.md +0 -0
  162. /package/{runtime → .aether/docs/disciplines}/debugging.md +0 -0
  163. /package/{runtime → .aether/docs/disciplines}/learning.md +0 -0
  164. /package/{runtime → .aether/docs/disciplines}/tdd.md +0 -0
  165. /package/{runtime → .aether/docs/disciplines}/verification-loop.md +0 -0
  166. /package/{runtime → .aether/docs/disciplines}/verification.md +0 -0
  167. /package/{runtime → .aether}/docs/pheromones.md +0 -0
  168. /package/{runtime → .aether}/model-profiles.yaml +0 -0
  169. /package/{runtime → .aether}/schemas/aether-types.xsd +0 -0
  170. /package/{runtime → .aether}/schemas/colony-registry.xsd +0 -0
  171. /package/{runtime → .aether}/schemas/pheromone.xsd +0 -0
  172. /package/{runtime → .aether}/schemas/prompt.xsd +0 -0
  173. /package/{runtime → .aether}/schemas/queen-wisdom.xsd +0 -0
  174. /package/{runtime → .aether}/schemas/worker-priming.xsd +0 -0
  175. /package/{runtime → .aether}/templates/QUEEN.md.template +0 -0
  176. /package/{runtime → .aether}/utils/colorize-log.sh +0 -0
  177. /package/{runtime → .aether}/utils/queen-to-md.xsl +0 -0
  178. /package/{runtime → .aether}/utils/spawn-tree.sh +0 -0
  179. /package/{runtime → .aether}/utils/spawn-with-model.sh +0 -0
  180. /package/{runtime → .aether}/utils/state-loader.sh +0 -0
  181. /package/{runtime → .aether}/utils/swarm-display.sh +0 -0
  182. /package/{runtime → .aether}/utils/watch-spawn-tree.sh +0 -0
  183. /package/{runtime → .aether}/utils/xml-core.sh +0 -0
@@ -95,7 +95,7 @@ If `state != "EXECUTING"`:
95
95
 
96
96
  **The Iron Law:** No phase advancement without fresh verification evidence.
97
97
 
98
- Before ANY phase can advance, execute the 6-phase verification loop. See `.aether/verification-loop.md` for full reference.
98
+ Before ANY phase can advance, execute the 6-phase verification loop. See `.aether/docs/disciplines/verification-loop.md` for full reference.
99
99
 
100
100
  #### 1. Command Resolution (Priority Chain)
101
101
 
@@ -125,8 +125,10 @@ If no build system detected, skip build/test/type/lint checks but still verify s
125
125
  Execute all applicable phases and capture output:
126
126
 
127
127
  ```
128
- Phase {id} Verification Loop
129
- ============================
128
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
129
+ 👁️🐜 V E R I F I C A T I O N L O O P
130
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
131
+ Phase {id} — Checking colony work...
130
132
  ```
131
133
 
132
134
  **Phase 1: Build Check** (if command exists):
@@ -184,23 +186,28 @@ For EACH criterion:
184
186
 
185
187
  Display:
186
188
  ```
187
- VERIFICATION LOOP REPORT
188
- ========================
189
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
190
+ 👁️🐜 V E R I F I C A T I O N R E P O R T
191
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
189
192
 
190
- Phase 1: Build [PASS/FAIL]
191
- Phase 2: Types [PASS/FAIL] (X errors)
192
- Phase 3: Lint [PASS/FAIL] (X warnings)
193
- Phase 4: Tests [PASS/FAIL] (X/Y passed)
194
- Coverage {percent}% (target: 80%)
195
- Phase 5: Security [PASS/FAIL] (X issues)
196
- Phase 6: Diff [X files changed]
193
+ 🔨 Build [PASS/FAIL/SKIP]
194
+ 🔍 Types [PASS/FAIL/SKIP] (X errors)
195
+ 🧹 Lint [PASS/FAIL/SKIP] (X warnings)
196
+ 🧪 Tests [PASS/FAIL/SKIP] (X/Y passed)
197
+ Coverage {percent}% (target: 80%)
198
+ 🔒 Security [PASS/FAIL] (X issues)
199
+ 📋 Diff [X files changed]
197
200
 
198
- Success Criteria:
201
+ ──────────────────────────────────────────────────
202
+ 🐜 Success Criteria
203
+ ──────────────────────────────────────────────────
199
204
  ✅ {criterion 1}: {specific evidence}
200
205
  ✅ {criterion 2}: {specific evidence}
201
206
  ❌ {criterion 3}: {what's missing}
202
207
 
208
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
203
209
  Overall: READY / NOT READY
210
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
204
211
  ```
205
212
 
206
213
  #### 3. Gate Decision
@@ -208,14 +215,16 @@ Overall: READY / NOT READY
208
215
  **If NOT READY (any of: build fails, tests fail, critical security issues, success criteria unmet):**
209
216
 
210
217
  ```
211
- ⛔ VERIFICATION FAILED - PHASE BLOCKED
218
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
219
+ ⛔🐜 V E R I F I C A T I O N F A I L E D
220
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
212
221
 
213
222
  Phase {id} cannot advance until issues are resolved.
214
223
 
215
- Issues Found:
224
+ 🚨 Issues Found:
216
225
  {list each failure with specific evidence}
217
226
 
218
- Required Actions:
227
+ 🔧 Required Actions:
219
228
  1. Fix the issues listed above
220
229
  2. Run /ant:continue again to re-verify
221
230
 
@@ -232,12 +241,12 @@ Use AskUserQuestion to confirm they understand what needs to be fixed:
232
241
  **If READY (all checks pass with evidence):**
233
242
 
234
243
  ```
235
- VERIFICATION PASSED
244
+ ✅🐜 VERIFICATION PASSED
236
245
 
237
246
  All checks completed with evidence:
238
247
  {list each check and its evidence}
239
248
 
240
- Proceeding to phase advancement.
249
+ Proceeding to gate checks...
241
250
  ```
242
251
 
243
252
  Continue to Step 1.6.
@@ -260,17 +269,19 @@ grep -c "watcher" .aether/data/spawn-tree.txt 2>/dev/null || echo "0"
260
269
  **HARD REJECTION - If spawn_count == 0 and phase had 3+ tasks:**
261
270
 
262
271
  ```
263
- ⛔ SPAWN GATE FAILED - PHASE BLOCKED
272
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
273
+ ⛔🐜 S P A W N G A T E F A I L E D
274
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
264
275
 
265
276
  This phase had {task_count} tasks but spawn_count: 0
266
277
  The Prime Worker violated the spawn protocol.
267
278
 
268
- The colony metaphor requires actual parallelism:
279
+ 🐜 The colony requires actual parallelism:
269
280
  - Prime Worker MUST spawn specialists for non-trivial work
270
281
  - A single agent doing everything is NOT a colony
271
282
  - "Justifications" for not spawning are not accepted
272
283
 
273
- Required Actions:
284
+ 🔧 Required Actions:
274
285
  1. Run /ant:build {phase} again
275
286
  2. Prime Worker MUST spawn at least 1 specialist
276
287
  3. Re-run /ant:continue after spawns complete
@@ -288,17 +299,19 @@ bash .aether/aether-utils.sh error-flag-pattern "no-spawn-violation" "Prime Work
288
299
  **HARD REJECTION - If watcher_count == 0 (no testing separation):**
289
300
 
290
301
  ```
291
- ⛔ WATCHER GATE FAILED - PHASE BLOCKED
302
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
303
+ ⛔👁️🐜 W A T C H E R G A T E F A I L E D
304
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
292
305
 
293
306
  No Watcher ant was spawned for testing/verification.
294
307
  Testing MUST be performed by a separate agent, not the builder.
295
308
 
296
- Why this matters:
309
+ 🐜 Why this matters:
297
310
  - Builders verify their own work = confirmation bias
298
311
  - Independent Watchers catch bugs builders miss
299
312
  - "Build passing" ≠ "App working"
300
313
 
301
- Required Actions:
314
+ 🔧 Required Actions:
302
315
  1. Run /ant:build {phase} again
303
316
  2. Prime Worker MUST spawn at least 1 Watcher
304
317
  3. Watcher must independently verify the work
@@ -311,12 +324,7 @@ The phase will NOT advance until a Watcher validates.
311
324
  **If spawn_count >= 1 AND watcher_count >= 1:**
312
325
 
313
326
  ```
314
- SPAWN GATE PASSED
315
-
316
- Spawns: {spawn_count} workers
317
- Watchers: {watcher_count} (independent verification)
318
-
319
- Proceeding to runtime verification.
327
+ ✅🐜 SPAWN GATE PASSED — {spawn_count} workers | {watcher_count} watchers
320
328
  ```
321
329
 
322
330
  Continue to Step 1.7.
@@ -334,20 +342,18 @@ Run for each file in `files_created` and `files_modified` from Prime Worker outp
334
342
  **Anti-Pattern Report:**
335
343
 
336
344
  ```
337
- Anti-Pattern Scan
338
- =================
339
- Files scanned: {count}
345
+ 🔍🐜 Anti-Pattern Scan — {count} files scanned
340
346
 
341
347
  {if critical issues:}
342
- 🛑 CRITICAL ISSUES (must fix):
348
+ 🛑 CRITICAL (must fix):
343
349
  {list each with file:line and description}
344
350
 
345
351
  {if warnings:}
346
- ⚠️ WARNINGS (review recommended):
352
+ ⚠️ WARNINGS:
347
353
  {list each with file:line and description}
348
354
 
349
355
  {if clean:}
350
- No anti-patterns detected
356
+ ✅🐜 No anti-patterns detected
351
357
  ```
352
358
 
353
359
  **CRITICAL issues block phase advancement:**
@@ -364,9 +370,9 @@ Files scanned: {count}
364
370
  If CRITICAL issues found, display:
365
371
 
366
372
  ```
367
- ANTI-PATTERN GATE FAILED
373
+ ⛔🐜 ANTI-PATTERN GATE FAILED
368
374
 
369
- Critical anti-patterns detected that must be fixed:
375
+ Critical anti-patterns detected:
370
376
  {list issues with file paths}
371
377
 
372
378
  Run /ant:build {phase} again after fixing.
@@ -390,21 +396,20 @@ find . -name "*.test.*" -o -name "*_test.*" -o -name "*Tests.swift" -o -name "te
390
396
  **If Prime Worker claimed tests_added > 0 but no test files found:**
391
397
 
392
398
  ```
393
- ⛔ TDD GATE FAILED - FABRICATED METRICS
399
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
400
+ ⛔🧪🐜 T D D G A T E F A I L E D
401
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
394
402
 
395
403
  Prime Worker claimed:
396
404
  tests_added: {claimed_count}
397
405
  tests_total: {claimed_total}
398
- coverage_percent: {claimed_coverage}%
406
+ coverage: {claimed_coverage}%
399
407
 
400
408
  But no test files were found in the codebase.
401
409
 
402
- This is a CRITICAL violation:
403
- - TDD metrics were fabricated
404
- - No actual tests were written
405
- - "All passing: true" was a lie
410
+ 🚨 CRITICAL violation fabricated TDD metrics.
406
411
 
407
- Required Actions:
412
+ 🔧 Required Actions:
408
413
  1. Run /ant:build {phase} again
409
414
  2. Actually write test files (not just claim them)
410
415
  3. Tests must exist and be runnable
@@ -430,10 +435,11 @@ Before advancing, the user must confirm the application actually runs.
430
435
  Use AskUserQuestion:
431
436
 
432
437
  ```
433
- Runtime Verification Required
434
- =============================
438
+ ──────────────────────────────────────────────────
439
+ 🐜 Runtime Verification Required
440
+ ──────────────────────────────────────────────────
435
441
 
436
- Build and compile checks passed, but we need to verify the app actually works.
442
+ Build checks passed but does the app actually work?
437
443
 
438
444
  Have you tested the application at runtime?
439
445
  ```
@@ -446,18 +452,13 @@ Options:
446
452
 
447
453
  **If "Yes, tested and working":**
448
454
  ```
449
- RUNTIME VERIFICATION PASSED
450
-
451
- User confirmed application runs correctly.
452
- Proceeding to phase advancement.
455
+ ✅🐜 RUNTIME VERIFIED — User confirmed app works.
453
456
  ```
454
457
  Continue to Step 2.
455
458
 
456
459
  **If "Yes, tested but has issues":**
457
460
  ```
458
- RUNTIME GATE FAILED
459
-
460
- User reported runtime issues. The phase cannot advance with a broken app.
461
+ ⛔🐜 RUNTIME GATE FAILED — User reported issues.
461
462
 
462
463
  Please describe the issues so they can be addressed:
463
464
  ```
@@ -471,17 +472,12 @@ Do NOT proceed to Step 2.
471
472
 
472
473
  **If "No, haven't tested yet":**
473
474
  ```
474
- ⏸️ RUNTIME VERIFICATION PENDING
475
+ ⏸️🐜 RUNTIME PENDING — Test the app, then run /ant:continue again.
475
476
 
476
- Please test the application and run /ant:continue again.
477
-
478
- Testing checklist:
479
477
  - [ ] App launches without crashing
480
478
  - [ ] Core features work as expected
481
479
  - [ ] UI responds to user interaction
482
480
  - [ ] No freezes or hangs
483
-
484
- Come back when you've tested.
485
481
  ```
486
482
 
487
483
  Do NOT proceed to Step 2.
@@ -518,19 +514,19 @@ Parse result for `blockers`, `issues`, and `notes` counts.
518
514
  **If blockers > 0:**
519
515
 
520
516
  ```
521
- ⛔ FLAGS GATE FAILED - BLOCKERS ACTIVE
517
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
518
+ ⛔🚩🐜 F L A G S G A T E F A I L E D
519
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
522
520
 
523
- {blockers} blocking flag(s) must be resolved before phase advancement.
521
+ {blockers} blocker(s) must be resolved first.
524
522
 
525
- Active Blockers:
523
+ 🚩 Active Blockers:
526
524
  {list each blocker flag with ID, title, and description}
527
525
 
528
- Required Actions:
526
+ 🔧 Required Actions:
529
527
  1. Fix the issues described in each blocker
530
528
  2. Resolve flags: /ant:flags --resolve {flag_id} "resolution message"
531
529
  3. Run /ant:continue again after resolving all blockers
532
-
533
- The phase will NOT advance with active blockers.
534
530
  ```
535
531
 
536
532
  **CRITICAL:** Do NOT proceed to Step 2. Do NOT advance the phase.
@@ -538,15 +534,11 @@ The phase will NOT advance with active blockers.
538
534
  **If blockers == 0 but issues > 0:**
539
535
 
540
536
  ```
541
- ⚠️ FLAGS GATE: ISSUES NOTED
542
-
543
- No blockers, but {issues} issue(s) are active.
544
- These don't block advancement but should be addressed.
537
+ ⚠️🐜 FLAGS: {issues} issue(s) noted (non-blocking)
545
538
 
546
- Active Issues:
547
539
  {list each issue flag}
548
540
 
549
- Use /ant:flags to review and acknowledge or resolve.
541
+ Use /ant:flags to review.
550
542
  ```
551
543
 
552
544
  Continue to Step 2.
@@ -554,9 +546,7 @@ Continue to Step 2.
554
546
  **If all clear (no blockers or issues):**
555
547
 
556
548
  ```
557
- FLAGS GATE PASSED
558
-
559
- No blocking flags. Proceeding to phase advancement.
549
+ ✅🐜 FLAGS GATE PASSED — No blockers.
560
550
  ```
561
551
 
562
552
  Continue to Step 2.
@@ -121,6 +121,51 @@ Entombment cancelled. Colony remains active.
121
121
  ```
122
122
  Stop here.
123
123
 
124
+ ### Step 4.5: Check XML Tools
125
+
126
+ XML archiving is required for entombment. Check tool availability before proceeding.
127
+ Uses `command -v xmllint` directly — consistent with seal.md's tool check.
128
+
129
+ ```bash
130
+ if command -v xmllint >/dev/null 2>&1; then
131
+ xmllint_available=true
132
+ else
133
+ xmllint_available=false
134
+ fi
135
+ ```
136
+
137
+ **If xmllint is NOT available:**
138
+
139
+ Ask the user:
140
+ ```
141
+ xmllint is not installed — XML archiving requires it.
142
+
143
+ Install now?
144
+ - macOS: xcode-select --install (or brew install libxml2)
145
+ - Linux: apt-get install libxml2-utils
146
+
147
+ Install xmllint? (yes/no)
148
+ ```
149
+
150
+ Use AskUserQuestion with yes/no options.
151
+
152
+ If yes:
153
+ - On macOS: Run `xcode-select --install` or `brew install libxml2`
154
+ - On Linux: Run `sudo apt-get install -y libxml2-utils`
155
+ - After install attempt, re-check: `command -v xmllint >/dev/null 2>&1`
156
+ - If still not available after install:
157
+ ```
158
+ xmllint installation failed. Cannot entomb without XML archiving.
159
+ Install xmllint manually and try again.
160
+ ```
161
+ Stop here.
162
+
163
+ If no:
164
+ ```
165
+ Entombment requires XML archiving. Install xmllint and try again.
166
+ ```
167
+ Stop here.
168
+
124
169
  ### Step 5: Create Chamber
125
170
 
126
171
  Generate chamber name:
@@ -165,6 +210,35 @@ bash .aether/aether-utils.sh chamber-create \
165
210
  '{learnings_json}'
166
211
  ```
167
212
 
213
+ ### Step 6.5: Export XML Archive (hard-stop)
214
+
215
+ Export combined XML archive to the chamber. This is a HARD REQUIREMENT — entomb fails if XML export fails.
216
+
217
+ ```bash
218
+ chamber_dir=".aether/chambers/$chamber_name"
219
+ xml_result=$(bash .aether/aether-utils.sh colony-archive-xml "$chamber_dir/colony-archive.xml" 2>&1)
220
+ xml_ok=$(echo "$xml_result" | jq -r '.ok // false' 2>/dev/null)
221
+
222
+ if [[ "$xml_ok" != "true" ]]; then
223
+ # HARD STOP — remove the chamber and abort
224
+ rm -rf "$chamber_dir"
225
+ echo "XML archive export failed. Colony NOT entombed."
226
+ echo ""
227
+ echo "Error: $(echo "$xml_result" | jq -r '.error // "Unknown error"' 2>/dev/null)"
228
+ echo ""
229
+ echo "The chamber has been cleaned up. Fix the XML issue and try again."
230
+ # Do NOT proceed to state reset or any further steps
231
+ fi
232
+ ```
233
+
234
+ If xml_ok is true, store for display:
235
+ ```bash
236
+ xml_pheromone_count=$(echo "$xml_result" | jq -r '.result.pheromone_count // 0' 2>/dev/null)
237
+ xml_archive_line="XML Archive: colony-archive.xml (${xml_pheromone_count} active signals)"
238
+ ```
239
+
240
+ **Critical behavior:** If XML export fails, entomb STOPS. The chamber directory is removed (cleanup). The colony state is NOT reset. The user sees a clear error and can retry after fixing the issue.
241
+
168
242
  ### Step 7: Verify Chamber Integrity
169
243
 
170
244
  Run verification:
@@ -190,24 +264,25 @@ Backup current state:
190
264
  cp .aether/data/COLONY_STATE.json .aether/data/COLONY_STATE.json.bak
191
265
  ```
192
266
 
193
- Reset state while preserving memory (pheromones):
267
+ Reset state (including memory fields, already promoted to QUEEN.md):
194
268
  ```bash
195
- jq '
196
- .goal = null |
197
- .state = "IDLE" |
198
- .current_phase = 0 |
199
- .plan.phases = [] |
200
- .plan.generated_at = null |
201
- .plan.confidence = null |
202
- .build_started_at = null |
203
- .session_id = null |
204
- .initialized_at = null |
205
- .events = [] |
206
- .errors.records = [] |
207
- .errors.flagged_patterns = [] |
208
- .signals = [] |
209
- .graveyards = []
210
- ' .aether/data/COLONY_STATE.json.bak > .aether/data/COLONY_STATE.json
269
+ # Resolve jq template path (hub-first)
270
+ jq_template=""
271
+ for path in \
272
+ "$HOME/.aether/system/templates/colony-state-reset.jq.template" \
273
+ ".aether/templates/colony-state-reset.jq.template"; do
274
+ if [[ -f "$path" ]]; then
275
+ jq_template="$path"
276
+ break
277
+ fi
278
+ done
279
+
280
+ if [[ -z "$jq_template" ]]; then
281
+ echo "Template missing: colony-state-reset.jq.template. Run aether update to fix."
282
+ exit 1
283
+ fi
284
+
285
+ jq -f "$jq_template" .aether/data/COLONY_STATE.json.bak > .aether/data/COLONY_STATE.json
211
286
  ```
212
287
 
213
288
  Verify reset succeeded:
@@ -230,37 +305,22 @@ rm -f .aether/data/COLONY_STATE.json.bak
230
305
 
231
306
  After entombing the colony, write the final handoff documenting the archived colony:
232
307
 
233
- ```bash
234
- cat > .aether/HANDOFF.md << 'HANDOFF_EOF'
235
- # Colony Session — ENTOMBED
308
+ Resolve the handoff template path:
309
+ Check ~/.aether/system/templates/handoff.template.md first,
310
+ then .aether/templates/handoff.template.md.
236
311
 
237
- ## ⚰️ Colony Archived
238
- **Status:** Entombed in Chambers — Colony work preserved
312
+ If no template found: output "Template missing: handoff.template.md. Run aether update to fix." and stop.
239
313
 
240
- ## Chamber Location
241
- .aether/chambers/{chamber_name}/
314
+ Read the template file. Fill all {{PLACEHOLDER}} values:
315
+ - {{CHAMBER_NAME}} → chamber_name
316
+ - {{GOAL}} → goal
317
+ - {{PHASES_COMPLETED}} → phases completed count
318
+ - {{TOTAL_PHASES}} → total phases count
319
+ - {{MILESTONE}} → milestone
320
+ - {{ENTOMB_TIMESTAMP}} → current ISO-8601 UTC timestamp
242
321
 
243
- ## Colony Summary
244
- - Goal: "{goal}"
245
- - Phases: {completed} completed of {total}
246
- - Milestone: {milestone}
247
- - Entombed At: {timestamp}
248
-
249
- ## Chamber Contents
250
- - colony-state.json — Full colony state
251
- - manifest.json — Archive metadata
252
- - activity.log — Colony activity history
253
- - spawn-tree.txt — Worker spawn records
254
- - flags.json — Project flags (if existed)
255
-
256
- ## Session Note
257
- This colony has been entombed and the active state reset.
258
- The colony rests. Its learnings are preserved in the chamber.
259
-
260
- To start anew: /ant:lay-eggs "<new goal>"
261
- To explore chambers: /ant:tunnels
262
- HANDOFF_EOF
263
- ```
322
+ Remove the HTML comment lines at the top of the template.
323
+ Write the result to .aether/HANDOFF.md using the Write tool.
264
324
 
265
325
  This handoff serves as the record of the entombed colony.
266
326
 
@@ -278,6 +338,7 @@ This handoff serves as the record of the entombed colony.
278
338
  🏆 Milestone: {milestone}
279
339
 
280
340
  📦 Chamber: .aether/chambers/{chamber_name}/
341
+ {xml_archive_line}
281
342
 
282
343
  🐜 The colony rests. Its learnings are preserved.
283
344
 
@@ -66,18 +66,29 @@ Check if `.aether/aether-utils.sh` exists using the Read tool.
66
66
  **If the file already exists** — skip this step entirely. System files are present.
67
67
 
68
68
  **If the file does NOT exist:**
69
- - Check if `~/.aether/system/` exists (expand `~` to the user's home directory)
69
+ - Check if `~/.aether/system/aether-utils.sh` exists (expand `~` to the user's home directory)
70
70
  - **If the hub exists:** Run using the Bash tool:
71
+ ```bash
72
+ mkdir -p .aether/docs .aether/utils .aether/templates .aether/schemas .aether/exchange .claude/rules && \
73
+ cp -f ~/.aether/system/aether-utils.sh .aether/ && \
74
+ cp -f ~/.aether/system/workers.md .aether/ 2>/dev/null || true && \
75
+ cp -f ~/.aether/system/CONTEXT.md .aether/ 2>/dev/null || true && \
76
+ cp -f ~/.aether/system/model-profiles.yaml .aether/ 2>/dev/null || true && \
77
+ cp -Rf ~/.aether/system/docs/* .aether/docs/ 2>/dev/null || true && \
78
+ cp -Rf ~/.aether/system/utils/* .aether/utils/ 2>/dev/null || true && \
79
+ cp -Rf ~/.aether/system/templates/* .aether/templates/ 2>/dev/null || true && \
80
+ cp -Rf ~/.aether/system/schemas/* .aether/schemas/ 2>/dev/null || true && \
81
+ cp -Rf ~/.aether/system/exchange/* .aether/exchange/ 2>/dev/null || true && \
82
+ cp -Rf ~/.aether/system/rules/* .claude/rules/ 2>/dev/null || true && \
83
+ chmod +x .aether/aether-utils.sh
71
84
  ```
72
- bash ~/.aether/system/aether-utils.sh bootstrap-system
73
- ```
74
- This copies system files from the global hub into `.aether/`. Display:
85
+ This copies system files from the global hub into `.aether/` and rules into `.claude/rules/`. Display:
75
86
  ```
76
87
  Bootstrapped system files from global hub.
77
88
  ```
78
89
  - **If the hub does NOT exist:** Output:
79
90
  ```
80
- No Aether system files found locally or in ~/.aether/.
91
+ No Aether system files found locally or in ~/.aether/system/.
81
92
  Run `aether install` or `npx aether-colony install` to set up the global hub first.
82
93
  ```
83
94
  Stop here. Do not proceed.
@@ -124,9 +135,23 @@ If no instincts meet the threshold, display:
124
135
 
125
136
  Generate a session ID in the format `session_{unix_timestamp}_{random}` and an ISO-8601 UTC timestamp.
126
137
 
127
- Use the Write tool to write `.aether/data/COLONY_STATE.json` with the v3.0 structure.
138
+ Resolve the colony-state template path:
139
+ Check `~/.aether/system/templates/colony-state.template.json` first,
140
+ then `.aether/templates/colony-state.template.json`.
141
+
142
+ If no template found: output "Template missing: colony-state.template.json. Run aether update to fix." and stop.
143
+
144
+ Read the template file. Follow its `_instructions` field.
145
+ Replace all `__PLACEHOLDER__` values:
146
+ - `__GOAL__` → the user's goal from $normalized_args
147
+ - `__SESSION_ID__` → the generated session ID (format: `session_{unix_timestamp}_{random}`)
148
+ - `__ISO8601_TIMESTAMP__` → the current ISO-8601 UTC timestamp (used in both `initialized_at` and the events entry)
149
+ - `__PHASE_LEARNINGS__` → JSON array from Step 2.5, or `[]` if none
150
+ - `__INSTINCTS__` → JSON array from Step 2.5, or `[]` if none
151
+
152
+ IMPORTANT: `__PHASE_LEARNINGS__` and `__INSTINCTS__` must be JSON array values (e.g., `[]` not `"[]"`).
128
153
 
129
- **If Step 2.5 found instincts to inherit**, convert each into the instinct format and seed the `memory.instincts` array. Each inherited instinct should have:
154
+ **If Step 2.5 found instincts to inherit**, convert each into the instinct format for the `__INSTINCTS__` array. Each inherited instinct should have:
130
155
  - `id`: `instinct_inherited_{index}`
131
156
  - `trigger`: inferred from the instinct description
132
157
  - `action`: the instinct description
@@ -139,56 +164,29 @@ Use the Write tool to write `.aether/data/COLONY_STATE.json` with the v3.0 struc
139
164
  - `applications`: 0
140
165
  - `successes`: 0
141
166
 
142
- **If Step 2.5 found validated learnings**, seed `memory.phase_learnings` with each as:
167
+ **If Step 2.5 found validated learnings**, seed the `__PHASE_LEARNINGS__` array with each as:
143
168
  - `phase`: `"inherited"`
144
169
  - `learning`: the learning text
145
170
  - `status`: `"validated"`
146
171
  - `source`: `"inherited:completion-report"`
147
172
 
148
- **If Step 2.5 was skipped or found nothing**, use empty arrays as before.
149
-
150
- ```json
151
- {
152
- "version": "3.0",
153
- "goal": "<the user's goal>",
154
- "state": "READY",
155
- "current_phase": 0,
156
- "session_id": "<generated session_id>",
157
- "initialized_at": "<ISO-8601 timestamp>",
158
- "build_started_at": null,
159
- "plan": {
160
- "generated_at": null,
161
- "confidence": null,
162
- "phases": []
163
- },
164
- "memory": {
165
- "phase_learnings": "<inherited learnings or []>",
166
- "decisions": [],
167
- "instincts": "<inherited instincts or []>"
168
- },
169
- "errors": {
170
- "records": [],
171
- "flagged_patterns": []
172
- },
173
- "signals": [],
174
- "graveyards": [],
175
- "events": [
176
- "<ISO-8601 timestamp>|colony_initialized|init|Colony initialized with goal: <the user's goal>"
177
- ]
178
- }
179
- ```
173
+ **If Step 2.5 was skipped or found nothing**, use empty arrays `[]` for both `__PHASE_LEARNINGS__` and `__INSTINCTS__`.
174
+
175
+ Remove ALL keys starting with underscore (`_template`, `_version`, `_instructions`, `_comment_*`).
176
+ Write the resulting JSON to `.aether/data/COLONY_STATE.json` using the Write tool.
180
177
 
181
178
  ### Step 4: Initialize Constraints
182
179
 
183
- Write `.aether/data/constraints.json`:
180
+ Resolve the constraints template path:
181
+ Check `~/.aether/system/templates/constraints.template.json` first,
182
+ then `.aether/templates/constraints.template.json`.
184
183
 
185
- ```json
186
- {
187
- "version": "1.0",
188
- "focus": [],
189
- "constraints": []
190
- }
191
- ```
184
+ If no template found: output "Template missing: constraints.template.json. Run aether update to fix." and stop.
185
+
186
+ Read the template file. Follow its `_instructions` field.
187
+ No placeholder substitution needed — the data keys are written as-is.
188
+ Remove ALL keys starting with underscore (`_template`, `_version`, `_instructions`, `_comment_*`).
189
+ Write the resulting JSON to `.aether/data/constraints.json` using the Write tool.
192
190
 
193
191
  ### Step 5: Validate State File
194
192
 
@@ -50,12 +50,12 @@ If no active signals after filtering:
50
50
  (no active pheromones)
51
51
  ```
52
52
 
53
- ### Step 3: Spawn Archivist (Architect-Ant)
53
+ ### Step 3: Spawn Archivist (Keeper-Ant)
54
54
 
55
- Read `.aether/workers.md` and extract the `## Architect` section.
55
+ Read `.aether/workers.md` and extract the `## Keeper` section.
56
56
 
57
57
  Spawn via **Task tool** with `subagent_type="general-purpose"`:
58
- # NOTE: Claude Code uses aether-architect; OpenCode uses general-purpose with role injection
58
+ # NOTE: Claude Code uses aether-keeper; OpenCode uses general-purpose with role injection
59
59
 
60
60
  ```
61
61
  --- WORKER SPEC ---
@@ -171,7 +171,7 @@ CONSTRAINTS:
171
171
 
172
172
  ### Step 4: Display Report
173
173
 
174
- After the architect-ant returns, display header:
174
+ After the keeper-ant returns, display header:
175
175
 
176
176
  ```
177
177
  🧹🐜🏛️🐜🧹 ═══════════════════════════════════════════════════
@@ -187,7 +187,7 @@ bash -c 'printf "\e[37m| CODEBASE HYGIENE REPORT |\e
187
187
  bash -c 'printf "\e[37m+=====================================================+\e[0m\n\n"'
188
188
  ```
189
189
 
190
- Then display the architect-ant's full report verbatim.
190
+ Then display the keeper-ant's full report verbatim.
191
191
 
192
192
  ### Step 5: Persist Report
193
193