aether-colony 5.0.0 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (312) hide show
  1. package/.aether/aether-utils.sh +3150 -3349
  2. package/.aether/agents-claude/aether-ambassador.md +265 -0
  3. package/.aether/agents-claude/aether-archaeologist.md +327 -0
  4. package/.aether/agents-claude/aether-architect.md +236 -0
  5. package/.aether/agents-claude/aether-auditor.md +271 -0
  6. package/.aether/agents-claude/aether-builder.md +224 -0
  7. package/.aether/agents-claude/aether-chaos.md +269 -0
  8. package/.aether/agents-claude/aether-chronicler.md +305 -0
  9. package/.aether/agents-claude/aether-gatekeeper.md +330 -0
  10. package/.aether/agents-claude/aether-includer.md +374 -0
  11. package/.aether/agents-claude/aether-keeper.md +272 -0
  12. package/.aether/agents-claude/aether-measurer.md +322 -0
  13. package/.aether/agents-claude/aether-oracle.md +237 -0
  14. package/.aether/agents-claude/aether-probe.md +211 -0
  15. package/.aether/agents-claude/aether-queen.md +330 -0
  16. package/.aether/agents-claude/aether-route-setter.md +178 -0
  17. package/.aether/agents-claude/aether-sage.md +418 -0
  18. package/.aether/agents-claude/aether-scout.md +179 -0
  19. package/.aether/agents-claude/aether-surveyor-disciplines.md +417 -0
  20. package/.aether/agents-claude/aether-surveyor-nest.md +355 -0
  21. package/.aether/agents-claude/aether-surveyor-pathogens.md +289 -0
  22. package/.aether/agents-claude/aether-surveyor-provisions.md +360 -0
  23. package/.aether/agents-claude/aether-tracker.md +270 -0
  24. package/.aether/agents-claude/aether-watcher.md +280 -0
  25. package/.aether/agents-claude/aether-weaver.md +248 -0
  26. package/.aether/commands/archaeology.yaml +653 -0
  27. package/.aether/commands/build.yaml +1221 -0
  28. package/.aether/commands/chaos.yaml +653 -0
  29. package/.aether/commands/colonize.yaml +438 -0
  30. package/.aether/commands/continue.yaml +1484 -0
  31. package/.aether/commands/council.yaml +304 -0
  32. package/.aether/commands/data-clean.yaml +80 -0
  33. package/.aether/commands/dream.yaml +275 -0
  34. package/.aether/commands/entomb.yaml +863 -0
  35. package/.aether/commands/export-signals.yaml +64 -0
  36. package/.aether/commands/feedback.yaml +158 -0
  37. package/.aether/commands/flag.yaml +160 -0
  38. package/.aether/commands/flags.yaml +177 -0
  39. package/.aether/commands/focus.yaml +112 -0
  40. package/.aether/commands/help.yaml +167 -0
  41. package/.aether/commands/history.yaml +137 -0
  42. package/.aether/commands/import-signals.yaml +79 -0
  43. package/.aether/commands/init.yaml +469 -0
  44. package/.aether/commands/insert-phase.yaml +98 -0
  45. package/.aether/commands/interpret.yaml +285 -0
  46. package/.aether/commands/lay-eggs.yaml +224 -0
  47. package/.aether/commands/maturity.yaml +122 -0
  48. package/.aether/commands/memory-details.yaml +74 -0
  49. package/.aether/commands/migrate-state.yaml +174 -0
  50. package/.aether/commands/oracle.yaml +1224 -0
  51. package/.aether/commands/organize.yaml +446 -0
  52. package/.aether/commands/patrol.yaml +621 -0
  53. package/.aether/commands/pause-colony.yaml +424 -0
  54. package/.aether/commands/phase.yaml +124 -0
  55. package/.aether/commands/pheromones.yaml +153 -0
  56. package/.aether/commands/plan.yaml +1313 -0
  57. package/.aether/commands/preferences.yaml +63 -0
  58. package/.aether/commands/redirect.yaml +123 -0
  59. package/.aether/commands/resume-colony.yaml +373 -0
  60. package/.aether/commands/resume.yaml +398 -0
  61. package/.aether/commands/run.yaml +193 -0
  62. package/.aether/commands/seal.yaml +1205 -0
  63. package/.aether/commands/skill-create.yaml +337 -0
  64. package/.aether/commands/status.yaml +364 -0
  65. package/.aether/commands/swarm.yaml +352 -0
  66. package/.aether/commands/tunnels.yaml +814 -0
  67. package/.aether/commands/update.yaml +131 -0
  68. package/.aether/commands/verify-castes.yaml +159 -0
  69. package/.aether/commands/watch.yaml +454 -0
  70. package/.aether/docs/INCIDENT_TEMPLATE.md +32 -0
  71. package/.aether/docs/QUEEN-SYSTEM.md +11 -11
  72. package/.aether/docs/README.md +32 -2
  73. package/.aether/docs/command-playbooks/README.md +23 -0
  74. package/.aether/docs/command-playbooks/build-complete.md +349 -0
  75. package/.aether/docs/command-playbooks/build-context.md +282 -0
  76. package/.aether/docs/command-playbooks/build-full.md +1682 -0
  77. package/.aether/docs/command-playbooks/build-prep.md +283 -0
  78. package/.aether/docs/command-playbooks/build-verify.md +405 -0
  79. package/.aether/docs/command-playbooks/build-wave.md +749 -0
  80. package/.aether/docs/command-playbooks/continue-advance.md +524 -0
  81. package/.aether/docs/command-playbooks/continue-finalize.md +447 -0
  82. package/.aether/docs/command-playbooks/continue-full.md +1724 -0
  83. package/.aether/docs/command-playbooks/continue-gates.md +686 -0
  84. package/.aether/docs/command-playbooks/continue-verify.md +406 -0
  85. package/.aether/docs/context-continuity.md +84 -0
  86. package/.aether/docs/disciplines/DISCIPLINES.md +9 -7
  87. package/.aether/docs/error-codes.md +1 -1
  88. package/.aether/docs/known-issues.md +34 -173
  89. package/.aether/docs/pheromones.md +86 -6
  90. package/.aether/docs/plans/pheromone-display-plan.md +257 -0
  91. package/.aether/docs/queen-commands.md +10 -9
  92. package/.aether/docs/source-of-truth-map.md +132 -0
  93. package/.aether/docs/xml-utilities.md +47 -0
  94. package/.aether/rules/aether-colony.md +23 -13
  95. package/.aether/scripts/incident-test-add.sh +47 -0
  96. package/.aether/scripts/weekly-audit.sh +79 -0
  97. package/.aether/skills/.index.json +649 -0
  98. package/.aether/skills/colony/.manifest.json +16 -0
  99. package/.aether/skills/colony/build-discipline/SKILL.md +78 -0
  100. package/.aether/skills/colony/colony-interaction/SKILL.md +56 -0
  101. package/.aether/skills/colony/colony-lifecycle/SKILL.md +77 -0
  102. package/.aether/skills/colony/colony-visuals/SKILL.md +112 -0
  103. package/.aether/skills/colony/context-management/SKILL.md +80 -0
  104. package/.aether/skills/colony/error-presentation/SKILL.md +99 -0
  105. package/.aether/skills/colony/pheromone-protocol/SKILL.md +79 -0
  106. package/.aether/skills/colony/pheromone-visibility/SKILL.md +81 -0
  107. package/.aether/skills/colony/state-safety/SKILL.md +84 -0
  108. package/.aether/skills/colony/worker-priming/SKILL.md +82 -0
  109. package/.aether/skills/domain/.manifest.json +24 -0
  110. package/.aether/skills/domain/README.md +33 -0
  111. package/.aether/skills/domain/django/SKILL.md +49 -0
  112. package/.aether/skills/domain/docker/SKILL.md +52 -0
  113. package/.aether/skills/domain/golang/SKILL.md +52 -0
  114. package/.aether/skills/domain/graphql/SKILL.md +51 -0
  115. package/.aether/skills/domain/html-css/SKILL.md +48 -0
  116. package/.aether/skills/domain/nextjs/SKILL.md +45 -0
  117. package/.aether/skills/domain/nodejs/SKILL.md +53 -0
  118. package/.aether/skills/domain/postgresql/SKILL.md +53 -0
  119. package/.aether/skills/domain/prisma/SKILL.md +59 -0
  120. package/.aether/skills/domain/python/SKILL.md +50 -0
  121. package/.aether/skills/domain/rails/SKILL.md +52 -0
  122. package/.aether/skills/domain/react/SKILL.md +45 -0
  123. package/.aether/skills/domain/rest-api/SKILL.md +58 -0
  124. package/.aether/skills/domain/svelte/SKILL.md +47 -0
  125. package/.aether/skills/domain/tailwind/SKILL.md +45 -0
  126. package/.aether/skills/domain/testing/SKILL.md +53 -0
  127. package/.aether/skills/domain/typescript/SKILL.md +58 -0
  128. package/.aether/skills/domain/vue/SKILL.md +49 -0
  129. package/.aether/templates/QUEEN.md.template +23 -41
  130. package/.aether/templates/colony-state-reset.jq.template +1 -0
  131. package/.aether/templates/colony-state.template.json +4 -0
  132. package/.aether/templates/learning-observations.template.json +6 -0
  133. package/.aether/templates/midden.template.json +13 -0
  134. package/.aether/templates/pheromones.template.json +6 -0
  135. package/.aether/templates/session.template.json +9 -0
  136. package/.aether/utils/atomic-write.sh +63 -17
  137. package/.aether/utils/chamber-utils.sh +145 -2
  138. package/.aether/utils/emoji-audit.sh +166 -0
  139. package/.aether/utils/error-handler.sh +21 -7
  140. package/.aether/utils/file-lock.sh +182 -27
  141. package/.aether/utils/flag.sh +267 -0
  142. package/.aether/utils/hive.sh +572 -0
  143. package/.aether/utils/learning.sh +1928 -0
  144. package/.aether/utils/midden.sh +342 -0
  145. package/.aether/utils/oracle/oracle.md +168 -0
  146. package/.aether/utils/oracle/oracle.sh +1023 -0
  147. package/.aether/utils/pheromone.sh +2029 -0
  148. package/.aether/utils/queen.sh +1698 -0
  149. package/.aether/utils/scan.sh +860 -0
  150. package/.aether/utils/semantic-cli.sh +10 -8
  151. package/.aether/utils/session.sh +552 -0
  152. package/.aether/utils/skills.sh +509 -0
  153. package/.aether/utils/spawn-tree.sh +103 -271
  154. package/.aether/utils/spawn.sh +260 -0
  155. package/.aether/utils/state-api.sh +199 -0
  156. package/.aether/utils/state-loader.sh +8 -6
  157. package/.aether/utils/suggest.sh +611 -0
  158. package/.aether/utils/swarm-display.sh +10 -1
  159. package/.aether/utils/swarm.sh +1004 -0
  160. package/.aether/utils/watch-spawn-tree.sh +11 -2
  161. package/.aether/utils/xml-compose.sh +2 -2
  162. package/.aether/utils/xml-convert.sh +9 -5
  163. package/.aether/utils/xml-core.sh +5 -9
  164. package/.aether/utils/xml-query.sh +4 -4
  165. package/.aether/workers.md +86 -67
  166. package/.claude/agents/ant/aether-ambassador.md +2 -1
  167. package/.claude/agents/ant/aether-archaeologist.md +6 -1
  168. package/.claude/agents/ant/aether-architect.md +236 -0
  169. package/.claude/agents/ant/aether-auditor.md +6 -1
  170. package/.claude/agents/ant/aether-builder.md +38 -1
  171. package/.claude/agents/ant/aether-chaos.md +2 -1
  172. package/.claude/agents/ant/aether-chronicler.md +1 -0
  173. package/.claude/agents/ant/aether-gatekeeper.md +6 -1
  174. package/.claude/agents/ant/aether-includer.md +1 -0
  175. package/.claude/agents/ant/aether-keeper.md +1 -0
  176. package/.claude/agents/ant/aether-measurer.md +6 -1
  177. package/.claude/agents/ant/aether-oracle.md +237 -0
  178. package/.claude/agents/ant/aether-probe.md +2 -1
  179. package/.claude/agents/ant/aether-queen.md +6 -1
  180. package/.claude/agents/ant/aether-route-setter.md +6 -1
  181. package/.claude/agents/ant/aether-sage.md +68 -3
  182. package/.claude/agents/ant/aether-scout.md +38 -1
  183. package/.claude/agents/ant/aether-surveyor-disciplines.md +2 -1
  184. package/.claude/agents/ant/aether-surveyor-nest.md +2 -1
  185. package/.claude/agents/ant/aether-surveyor-pathogens.md +2 -1
  186. package/.claude/agents/ant/aether-surveyor-provisions.md +2 -1
  187. package/.claude/agents/ant/aether-tracker.md +6 -1
  188. package/.claude/agents/ant/aether-watcher.md +37 -1
  189. package/.claude/agents/ant/aether-weaver.md +2 -1
  190. package/.claude/commands/ant/archaeology.md +1 -8
  191. package/.claude/commands/ant/build.md +43 -1159
  192. package/.claude/commands/ant/chaos.md +1 -14
  193. package/.claude/commands/ant/colonize.md +1 -14
  194. package/.claude/commands/ant/continue.md +40 -1026
  195. package/.claude/commands/ant/council.md +9 -16
  196. package/.claude/commands/ant/data-clean.md +81 -0
  197. package/.claude/commands/ant/dream.md +12 -9
  198. package/.claude/commands/ant/entomb.md +62 -87
  199. package/.claude/commands/ant/export-signals.md +57 -0
  200. package/.claude/commands/ant/feedback.md +18 -0
  201. package/.claude/commands/ant/flag.md +12 -0
  202. package/.claude/commands/ant/flags.md +22 -8
  203. package/.claude/commands/ant/focus.md +18 -0
  204. package/.claude/commands/ant/help.md +40 -8
  205. package/.claude/commands/ant/history.md +3 -0
  206. package/.claude/commands/ant/import-signals.md +71 -0
  207. package/.claude/commands/ant/init.md +316 -191
  208. package/.claude/commands/ant/insert-phase.md +101 -0
  209. package/.claude/commands/ant/interpret.md +11 -0
  210. package/.claude/commands/ant/lay-eggs.md +167 -158
  211. package/.claude/commands/ant/maturity.md +22 -11
  212. package/.claude/commands/ant/memory-details.md +77 -0
  213. package/.claude/commands/ant/migrate-state.md +6 -0
  214. package/.claude/commands/ant/oracle.md +317 -62
  215. package/.claude/commands/ant/organize.md +10 -5
  216. package/.claude/commands/ant/patrol.md +620 -0
  217. package/.claude/commands/ant/pause-colony.md +8 -22
  218. package/.claude/commands/ant/phase.md +26 -37
  219. package/.claude/commands/ant/pheromones.md +156 -0
  220. package/.claude/commands/ant/plan.md +175 -52
  221. package/.claude/commands/ant/preferences.md +65 -0
  222. package/.claude/commands/ant/redirect.md +18 -0
  223. package/.claude/commands/ant/resume-colony.md +34 -20
  224. package/.claude/commands/ant/resume.md +51 -7
  225. package/.claude/commands/ant/run.md +195 -0
  226. package/.claude/commands/ant/seal.md +497 -78
  227. package/.claude/commands/ant/skill-create.md +286 -0
  228. package/.claude/commands/ant/status.md +127 -1
  229. package/.claude/commands/ant/swarm.md +11 -23
  230. package/.claude/commands/ant/tunnels.md +1 -0
  231. package/.claude/commands/ant/update.md +58 -135
  232. package/.claude/commands/ant/verify-castes.md +90 -42
  233. package/.claude/commands/ant/watch.md +1 -0
  234. package/.opencode/agents/aether-ambassador.md +1 -1
  235. package/.opencode/agents/aether-architect.md +133 -0
  236. package/.opencode/agents/aether-builder.md +3 -3
  237. package/.opencode/agents/aether-oracle.md +137 -0
  238. package/.opencode/agents/aether-queen.md +1 -1
  239. package/.opencode/agents/aether-route-setter.md +1 -1
  240. package/.opencode/agents/aether-scout.md +1 -1
  241. package/.opencode/agents/aether-surveyor-disciplines.md +6 -1
  242. package/.opencode/agents/aether-surveyor-nest.md +6 -1
  243. package/.opencode/agents/aether-surveyor-pathogens.md +6 -1
  244. package/.opencode/agents/aether-surveyor-provisions.md +6 -1
  245. package/.opencode/agents/aether-tracker.md +1 -1
  246. package/.opencode/agents/aether-watcher.md +1 -1
  247. package/.opencode/agents/aether-weaver.md +1 -1
  248. package/.opencode/commands/ant/archaeology.md +7 -14
  249. package/.opencode/commands/ant/build.md +54 -88
  250. package/.opencode/commands/ant/chaos.md +7 -24
  251. package/.opencode/commands/ant/colonize.md +8 -17
  252. package/.opencode/commands/ant/continue.md +595 -66
  253. package/.opencode/commands/ant/council.md +11 -22
  254. package/.opencode/commands/ant/data-clean.md +77 -0
  255. package/.opencode/commands/ant/dream.md +15 -17
  256. package/.opencode/commands/ant/entomb.md +28 -18
  257. package/.opencode/commands/ant/export-signals.md +54 -0
  258. package/.opencode/commands/ant/feedback.md +24 -5
  259. package/.opencode/commands/ant/flag.md +16 -4
  260. package/.opencode/commands/ant/flags.md +24 -10
  261. package/.opencode/commands/ant/focus.md +22 -5
  262. package/.opencode/commands/ant/help.md +41 -8
  263. package/.opencode/commands/ant/history.md +9 -0
  264. package/.opencode/commands/ant/import-signals.md +68 -0
  265. package/.opencode/commands/ant/init.md +365 -156
  266. package/.opencode/commands/ant/insert-phase.md +107 -0
  267. package/.opencode/commands/ant/interpret.md +16 -0
  268. package/.opencode/commands/ant/lay-eggs.md +184 -112
  269. package/.opencode/commands/ant/maturity.md +18 -2
  270. package/.opencode/commands/ant/memory-details.md +83 -0
  271. package/.opencode/commands/ant/migrate-state.md +12 -0
  272. package/.opencode/commands/ant/oracle.md +322 -67
  273. package/.opencode/commands/ant/organize.md +14 -12
  274. package/.opencode/commands/ant/patrol.md +626 -0
  275. package/.opencode/commands/ant/pause-colony.md +12 -29
  276. package/.opencode/commands/ant/phase.md +30 -40
  277. package/.opencode/commands/ant/pheromones.md +162 -0
  278. package/.opencode/commands/ant/plan.md +184 -56
  279. package/.opencode/commands/ant/preferences.md +71 -0
  280. package/.opencode/commands/ant/redirect.md +22 -5
  281. package/.opencode/commands/ant/resume-colony.md +38 -27
  282. package/.opencode/commands/ant/resume.md +71 -20
  283. package/.opencode/commands/ant/run.md +201 -0
  284. package/.opencode/commands/ant/seal.md +230 -25
  285. package/.opencode/commands/ant/skill-create.md +63 -0
  286. package/.opencode/commands/ant/status.md +124 -31
  287. package/.opencode/commands/ant/swarm.md +3 -345
  288. package/.opencode/commands/ant/tunnels.md +3 -9
  289. package/.opencode/commands/ant/update.md +63 -127
  290. package/.opencode/commands/ant/verify-castes.md +96 -42
  291. package/.opencode/commands/ant/watch.md +7 -0
  292. package/CHANGELOG.md +278 -1
  293. package/README.md +188 -340
  294. package/bin/cli.js +236 -429
  295. package/bin/generate-commands.js +186 -0
  296. package/bin/generate-commands.sh +128 -89
  297. package/bin/lib/spawn-logger.js +0 -15
  298. package/bin/lib/update-transaction.js +285 -35
  299. package/bin/npx-install.js +178 -0
  300. package/bin/validate-package.sh +85 -3
  301. package/package.json +7 -3
  302. package/.aether/CONTEXT.md +0 -160
  303. package/.aether/docs/QUEEN.md +0 -84
  304. package/.aether/exchange/colony-registry.xml +0 -11
  305. package/.aether/exchange/pheromones.xml +0 -87
  306. package/.aether/exchange/queen-wisdom.xml +0 -14
  307. package/.aether/model-profiles.yaml +0 -100
  308. package/.aether/utils/spawn-with-model.sh +0 -56
  309. package/bin/lib/model-profiles.js +0 -445
  310. package/bin/lib/model-verify.js +0 -288
  311. package/bin/lib/proxy-health.js +0 -253
  312. package/bin/lib/telemetry.js +0 -441
@@ -0,0 +1,349 @@
1
+ ### Step 5.9: Synthesize Results
2
+
3
+ **This step runs after all worker tasks have completed (Builders, Watcher, Chaos).**
4
+
5
+ Collect all worker outputs and create phase summary:
6
+
7
+ ```json
8
+ {
9
+ "status": "completed" | "failed" | "blocked",
10
+ "summary": "...",
11
+ "tasks_completed": [...],
12
+ "tasks_failed": [...],
13
+ "files_created": [...],
14
+ "files_modified": [...],
15
+ "spawn_metrics": {
16
+ "spawn_count": {total workers spawned, including archaeologist if Step 4.5 fired, measurer if Step 5.5.1 fired, ambassador if Step 5.1.1 fired},
17
+ "builder_count": {N},
18
+ "watcher_count": 1,
19
+ "chaos_count": 1,
20
+ "archaeologist_count": {0 or 1, conditional on Step 4.5},
21
+ "measurer_count": {0 or 1, conditional on Step 5.5.1},
22
+ "ambassador_count": {0 or 1, conditional on Step 5.1.1},
23
+ "parallel_batches": {number of waves}
24
+ },
25
+ "spawn_tree": {
26
+ "{Archaeologist-Name}": {"caste": "archaeologist", "task": "pre-build history scan", "status": "completed"},
27
+ "{Ambassador-Name}": {"caste": "ambassador", "task": "external integration design", "status": "completed"},
28
+ "{Builder-Name}": {"caste": "builder", "task": "...", "status": "completed"},
29
+ "{Watcher-Name}": {"caste": "watcher", "task": "verify", "status": "completed"},
30
+ "{Measurer-Name}": {"caste": "measurer", "task": "performance baseline", "status": "completed"},
31
+ "{Chaos-Name}": {"caste": "chaos", "task": "resilience testing", "status": "completed"}
32
+ },
33
+ "verification": {from Watcher output},
34
+ "performance": {from Measurer output, or null if Step 5.5.1 was skipped},
35
+ "resilience": {from Chaos Ant output},
36
+ "archaeology": {from Archaeologist output, or null if Step 4.5 was skipped},
37
+ "quality_notes": "..."
38
+ }
39
+ ```
40
+
41
+ **Graveyard Recording:**
42
+ For each worker that returned `status: "failed"`:
43
+ For each file in that worker's `files_modified` or `files_created`:
44
+ Run using the Bash tool with description "Recording failure grave...": `bash .aether/aether-utils.sh grave-add "{file}" "{ant_name}" "{task_id}" {phase} "{first blocker or summary}" && bash .aether/aether-utils.sh activity-log "GRAVE" "Queen" "Grave marker placed at {file} — {ant_name} failed: {summary}"`
45
+ Then display a user-visible confirmation line:
46
+ `⚰️ Grave recorded: {file} — {ant_name} failed ({summary})`
47
+
48
+ **Success capture: pattern synthesis (MEM-01):**
49
+
50
+ If `learning.patterns_observed` array in the synthesis JSON is non-empty, capture up to 2 patterns as success events:
51
+
52
+ Initialize a counter: `success_capture_count=0`
53
+
54
+ For each pattern in `learning.patterns_observed`:
55
+ - If `success_capture_count >= 2`, stop (cap reached)
56
+ - Run using the Bash tool with description "Capturing synthesis pattern success...":
57
+ ```bash
58
+ bash .aether/aether-utils.sh memory-capture \
59
+ "success" \
60
+ "${pattern.trigger}: ${pattern.action} (evidence: ${pattern.evidence})" \
61
+ "pattern" \
62
+ "worker:builder" 2>/dev/null || true
63
+ ```
64
+ - Increment `success_capture_count`
65
+
66
+ The cap of 2 prevents observation count inflation when builds produce many patterns. Each captured pattern enters learning-observations.json with a content hash for deduplication across builds.
67
+
68
+ ### Step 5.9.1: Persist Builder Claims (MANDATORY)
69
+
70
+ Write builder file claims to `.aether/data/last-build-claims.json` for verification during /ant:continue.
71
+
72
+ Collect from each builder worker's output:
73
+ - files_created: [...all files_created from all builders...]
74
+ - files_modified: [...all files_modified from all builders...]
75
+
76
+ Run using the Bash tool with description "Persisting builder claims...":
77
+ ```bash
78
+ echo '{"files_created":[...], "files_modified":[...], "build_phase": N, "timestamp": "ISO8601"}' > .aether/data/last-build-claims.json
79
+ ```
80
+
81
+ Replace the `[...]` placeholders with the actual arrays collected from builder outputs, `N` with the current phase number, and `ISO8601` with the current timestamp.
82
+
83
+ This file is consumed by verify-claims during /ant:continue.
84
+
85
+ **Error Handoff Update:**
86
+ If workers failed, update handoff with error context for recovery:
87
+
88
+ Resolve the build error handoff template path:
89
+ Check ~/.aether/system/templates/handoff-build-error.template.md first,
90
+ then .aether/templates/handoff-build-error.template.md.
91
+
92
+ If no template found: output "Template missing: handoff-build-error.template.md. Run aether update to fix." and stop.
93
+
94
+ Read the template file. Fill all {{PLACEHOLDER}} values:
95
+ - {{PHASE_NUMBER}} → current phase number
96
+ - {{PHASE_NAME}} → current phase name
97
+ - {{BUILD_TIMESTAMP}} → current ISO-8601 UTC timestamp
98
+ - {{FAILED_WORKERS}} → formatted list of failed workers (one "- {ant_name}: {failure_summary}" per line)
99
+ - {{GRAVE_MARKERS}} → formatted list of grave markers (one "- {file}: {caution_level} caution" per line)
100
+
101
+ Remove the HTML comment lines at the top of the template.
102
+ Write the result to .aether/HANDOFF.md using the Write tool.
103
+
104
+ Only fires when workers fail. Zero impact on successful builds.
105
+
106
+ --- SPAWN TRACKING ---
107
+
108
+ The spawn tree will be visible in `/ant:watch` because each spawn is logged.
109
+
110
+ --- OUTPUT FORMAT ---
111
+
112
+ Return JSON:
113
+ {
114
+ "status": "completed" | "failed" | "blocked",
115
+ "summary": "What the phase accomplished",
116
+ "tasks_completed": ["1.1", "1.2"],
117
+ "tasks_failed": [],
118
+ "files_created": ["path1", "path2"],
119
+ "files_modified": ["path3"],
120
+ "spawn_metrics": {
121
+ "spawn_count": 7,
122
+ "watcher_count": 1,
123
+ "chaos_count": 1,
124
+ "archaeologist_count": 1,
125
+ "measurer_count": 1,
126
+ "ambassador_count": 1,
127
+ "builder_count": 3,
128
+ "parallel_batches": 2,
129
+ "sequential_tasks": 1
130
+ },
131
+ "spawn_tree": {
132
+ "Relic-8": {"caste": "archaeologist", "task": "pre-build history scan", "status": "completed", "children": {}},
133
+ "Diplomat-7": {"caste": "ambassador", "task": "external integration design", "status": "completed", "children": {}},
134
+ "Hammer-42": {"caste": "builder", "task": "...", "status": "completed", "children": {}},
135
+ "Vigil-17": {"caste": "watcher", "task": "...", "status": "completed", "children": {}},
136
+ "Benchmark-3": {"caste": "measurer", "task": "performance baseline", "status": "completed", "children": {}},
137
+ "Entropy-9": {"caste": "chaos", "task": "resilience testing", "status": "completed", "children": {}}
138
+ },
139
+ "verification": {
140
+ "build": {"command": "npm run build", "exit_code": 0, "passed": true},
141
+ "tests": {"command": "npm test", "passed": 24, "failed": 0, "total": 24},
142
+ "success_criteria": [
143
+ {"criterion": "API endpoint exists", "evidence": "GET /api/users returns 200", "passed": true},
144
+ {"criterion": "Tests cover happy path", "evidence": "3 tests in users.test.ts", "passed": true}
145
+ ]
146
+ },
147
+ "debugging": {
148
+ "issues_encountered": 0,
149
+ "issues_resolved": 0,
150
+ "fix_attempts": 0,
151
+ "architectural_concerns": []
152
+ },
153
+ "tdd": {
154
+ "cycles_completed": 5,
155
+ "tests_added": 5,
156
+ "tests_total": 47,
157
+ "coverage_percent": 85,
158
+ "all_passing": true
159
+ },
160
+ "learning": {
161
+ "patterns_observed": [
162
+ {
163
+ "type": "success",
164
+ "trigger": "when implementing API endpoints",
165
+ "action": "use repository pattern with DI",
166
+ "evidence": "All tests passed first try"
167
+ }
168
+ ],
169
+ "instincts_applied": ["instinct_123"],
170
+ "instinct_outcomes": [
171
+ {"id": "instinct_123", "success": true}
172
+ ]
173
+ },
174
+ "quality_notes": "Any concerns or recommendations",
175
+ "ui_touched": true | false
176
+ }
177
+ ```
178
+
179
+ ### Step 6: Visual Checkpoint (if UI touched)
180
+
181
+ Parse synthesis result. If `ui_touched` is true:
182
+
183
+ ```
184
+ ━━━ 🖼️🐜 V I S U A L C H E C K P O I N T ━━━
185
+
186
+ UI changes detected. Verify appearance before continuing.
187
+
188
+ Files touched:
189
+ {list files from files_created + files_modified that match UI patterns}
190
+
191
+ Options:
192
+ 1. Approve - UI looks correct
193
+ 2. Reject - needs changes (describe issues)
194
+ 3. Skip - defer visual review
195
+ ```
196
+
197
+ Use AskUserQuestion to get approval. Record in events:
198
+ - If approved: `"<timestamp>|visual_approved|build|Phase {id} UI approved"`
199
+ - If rejected: `"<timestamp>|visual_rejected|build|Phase {id} UI rejected: {reason}"`
200
+
201
+ ### Step 6.5: Update Handoff Document
202
+
203
+ After synthesis is complete, update the handoff document with current state for session recovery:
204
+
205
+ ```bash
206
+ # Update handoff with build results
207
+ jq -n \
208
+ --arg timestamp "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
209
+ --arg goal "$(jq -r '.goal' .aether/data/COLONY_STATE.json)" \
210
+ --arg phase "$(jq -r '.current_phase' .aether/data/COLONY_STATE.json)" \
211
+ --arg phase_name "{phase_name}" \
212
+ --arg status "{synthesis.status}" \
213
+ --arg summary "{synthesis.summary}" \
214
+ --argjson tasks_completed '{synthesis.tasks_completed | length}' \
215
+ --argjson tasks_failed '{synthesis.tasks_failed | length}' \
216
+ --arg next_action "{if synthesis.status == "completed" then "/ant:continue" else "/ant:flags" end}" \
217
+ '{
218
+ "last_updated": $timestamp,
219
+ "goal": $goal,
220
+ "current_phase": $phase,
221
+ "phase_name": $phase_name,
222
+ "build_status": $status,
223
+ "summary": $summary,
224
+ "tasks_completed": $tasks_completed,
225
+ "tasks_failed": $tasks_failed,
226
+ "next_recommended_action": $next_action,
227
+ "can_resume": true,
228
+ "note": "Phase build completed. Run /ant:continue to advance if verification passed."
229
+ }' > .aether/data/last-build-result.json
230
+ ```
231
+
232
+ Resolve the build success handoff template path:
233
+ Check ~/.aether/system/templates/handoff-build-success.template.md first,
234
+ then .aether/templates/handoff-build-success.template.md.
235
+
236
+ If no template found: output "Template missing: handoff-build-success.template.md. Run aether update to fix." and stop.
237
+
238
+ Read the template file. Fill all {{PLACEHOLDER}} values:
239
+ - {{GOAL}} → colony goal (from COLONY_STATE.json)
240
+ - {{PHASE_NUMBER}} → current phase number
241
+ - {{PHASE_NAME}} → current phase name
242
+ - {{BUILD_STATUS}} → synthesis.status
243
+ - {{BUILD_TIMESTAMP}} → current ISO-8601 UTC timestamp
244
+ - {{BUILD_SUMMARY}} → synthesis summary
245
+ - {{TASKS_COMPLETED}} → count of completed tasks
246
+ - {{TASKS_FAILED}} → count of failed tasks
247
+ - {{FILES_CREATED}} → count of created files
248
+ - {{FILES_MODIFIED}} → count of modified files
249
+ - {{SESSION_NOTE}} → "Build succeeded — ready to advance." if status is completed, else "Build completed with issues — review before continuing."
250
+
251
+ Remove the HTML comment lines at the top of the template.
252
+ Write the result to .aether/HANDOFF.md using the Write tool.
253
+
254
+ This ensures the handoff always reflects the latest build state, even if the session crashes before explicit pause.
255
+
256
+ ### Step 6.5: Update Context Document
257
+
258
+ Log this build activity to `.aether/CONTEXT.md`:
259
+
260
+ Run using the Bash tool with description "Updating build context...": `bash .aether/aether-utils.sh context-update activity "build {phase_id}" "{synthesis.status}" "{files_created_count + files_modified_count}" && bash .aether/aether-utils.sh context-update build-complete "{synthesis.status}" "{synthesis.status == 'completed' ? 'success' : 'failed'}"`
261
+
262
+ Also update safe-to-clear status:
263
+ - If build completed successfully: `context-update safe-to-clear "YES" "Build complete, ready to continue"`
264
+ - If build failed: `context-update safe-to-clear "NO" "Build failed — run /ant:swarm or /ant:flags"`
265
+
266
+ ### Step 5.10: Check for Promotion Proposals
267
+
268
+ After build completion (success or failure), check if any observations have met promotion thresholds.
269
+
270
+ Run using the Bash tool with description "Checking for wisdom promotions...":
271
+ ```bash
272
+ proposals=$(bash .aether/aether-utils.sh learning-check-promotion 2>/dev/null || echo '{"proposals":[]}')
273
+ proposal_count=$(echo "$proposals" | jq '.proposals | length')
274
+ echo "{\"proposal_count\": $proposal_count}"
275
+ ```
276
+
277
+ Parse the result. If proposal_count > 0:
278
+ - Display: "📚 $proposal_count wisdom proposal(s) ready for review"
279
+ - Run: `bash .aether/aether-utils.sh learning-approve-proposals`
280
+ - This presents the one-at-a-time UI for user review
281
+
282
+ If proposal_count == 0:
283
+ - Silently continue (no output needed per user decision)
284
+
285
+ Note: This runs regardless of build success/failure. Failed builds may have recorded failure observations that are ready for promotion.
286
+
287
+ ### Step 7: Display Results
288
+
289
+ **This step runs ONLY after synthesis is complete. All values come from actual worker results.**
290
+
291
+ **Display BUILD SUMMARY (always shown, replaces compact/verbose split):**
292
+
293
+ Calculate `total_tools` by summing `tool_count` from all worker return JSONs (builders + watcher + chaos).
294
+ Calculate `elapsed` using `build_started_at_epoch` (epoch integer captured at Step 5 start by Plan 01): `$(( $(date +%s) - build_started_at_epoch ))` formatted as Xm Ys.
295
+
296
+ ```
297
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
298
+ B U I L D S U M M A R Y
299
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
300
+ Phase {id}: {name}
301
+ Pattern: {selected_pattern}
302
+
303
+ Workers: {pass_count} passed {fail_count} failed ({total} total)
304
+ Tools: {total_tools} calls across all workers
305
+ Duration: {elapsed}
306
+
307
+ {if measurer_ran:}
308
+ 📊 Measurer: {baseline_count} baselines established, {bottleneck_count} bottlenecks identified
309
+ {end if}
310
+
311
+ {if ambassador_ran:}
312
+ 🔌 Ambassador: Integration plan for {integration_plan.service_name} ready
313
+ {end if}
314
+
315
+ {if fail_count > 0:}
316
+ Failed:
317
+ {for each failed worker:}
318
+ {caste_emoji} {Ant-Name}: {task_description} ✗ ({failure_reason} after {tool_count} tools)
319
+ {end for}
320
+
321
+ Retry: /ant:swarm to auto-repair failed tasks, or /ant:flags to review blockers
322
+ {end if}
323
+ ```
324
+
325
+ **If verbose_mode is true**, additionally show the spawn tree and TDD details after the BUILD SUMMARY block (keep the existing verbose-only sections: Colony Work Tree, Tasks Completed, TDD, Patterns Learned, Debugging, Model Routing). Prepend with:
326
+ ```
327
+ ━━ Details (--verbose) ━━
328
+ ```
329
+
330
+ After displaying the BUILD SUMMARY (and optional verbose details), call the Next Up helper by running using the Bash tool with description "Displaying next steps...":
331
+ ```bash
332
+ state=$(jq -r '.state // "IDLE"' .aether/data/COLONY_STATE.json 2>/dev/null || echo "IDLE")
333
+ current_phase=$(jq -r '.current_phase // 0' .aether/data/COLONY_STATE.json 2>/dev/null || echo "0")
334
+ total_phases=$(jq -r '.plan.phases | length' .aether/data/COLONY_STATE.json 2>/dev/null || echo "0")
335
+ bash .aether/aether-utils.sh print-next-up "$state" "$current_phase" "$total_phases"
336
+ ```
337
+
338
+ **Routing Note:** The state-based Next Up block above routes based on colony state. If verification failed or blockers exist, review `/ant:flags` before continuing.
339
+
340
+ **IMPORTANT:** Build does NOT update task statuses or advance state. Run `/ant:continue` to:
341
+ - Mark tasks as completed
342
+ - Extract learnings
343
+ - Advance to next phase
344
+
345
+ ### Step 8: Update Session
346
+
347
+ Update the session tracking file to enable `/ant:resume` after context clear:
348
+
349
+ Run using the Bash tool with description "Saving build session...": `bash .aether/aether-utils.sh session-update "/ant:build {phase_id}" "/ant:continue" "Phase {phase_id} build completed: {synthesis.status}"`
@@ -0,0 +1,282 @@
1
+ ### Step 4: Load Colony Context (colony-prime)
2
+
3
+ Call `colony-prime --compact` to get unified worker context (wisdom + context capsule + signals + instincts):
4
+
5
+ Run using the Bash tool with description "Loading colony context...":
6
+ ```bash
7
+ prime_result=$(bash .aether/aether-utils.sh colony-prime --compact 2>/dev/null)
8
+ ```
9
+
10
+ **Parse the JSON response:**
11
+ - If `.ok` is false: This is a FAIL HARD error - display the error message and stop the build
12
+ - If successful: Extract from `.result`:
13
+ - `signal_count` - number of active pheromone signals
14
+ - `instinct_count` - number of filtered instincts
15
+ - `prompt_section` - the formatted markdown to inject into worker prompts
16
+ - `log_line` - status message for display
17
+
18
+ Display after constraints:
19
+ ```
20
+ {log_line from colony-prime}
21
+ ```
22
+
23
+ Then display the active pheromones table by running:
24
+ ```bash
25
+ bash .aether/aether-utils.sh pheromone-display
26
+ ```
27
+
28
+ This shows the user exactly what signals are guiding the colony:
29
+ - 🎯 FOCUS signals (what to pay attention to)
30
+ - 🚫 REDIRECT signals (what to avoid - hard constraints)
31
+ - 💬 FEEDBACK signals (guidance to consider)
32
+
33
+ **Store for worker injection:** The `prompt_section` variable contains compact formatted context (QUEEN wisdom + context capsule + pheromone signals) ready for injection.
34
+
35
+ ### Step 4.0: Load Territory Survey
36
+
37
+ Check if territory survey exists and load relevant documents:
38
+
39
+ Run using the Bash tool with description "Loading territory survey...":
40
+ ```bash
41
+ bash .aether/aether-utils.sh survey-load "{phase_name}" 2>/dev/null
42
+ ```
43
+
44
+ **Parse the JSON response:**
45
+ - If `.ok` is false: Set `survey_docs = null` and skip survey loading
46
+ - If successful: Extract `.docs` (comma-separated list) and `.dir`
47
+
48
+ **Determine phase type from phase name:**
49
+ | Phase Contains | Documents to Load |
50
+ |----------------|-------------------|
51
+ | UI, frontend, component, button, page | DISCIPLINES.md, CHAMBERS.md |
52
+ | API, endpoint, backend, route | BLUEPRINT.md, DISCIPLINES.md |
53
+ | database, schema, model, migration | BLUEPRINT.md, PROVISIONS.md |
54
+ | test, spec, coverage | SENTINEL-PROTOCOLS.md, DISCIPLINES.md |
55
+ | integration, external, client | TRAILS.md, PROVISIONS.md |
56
+ | refactor, cleanup, debt | PATHOGENS.md, BLUEPRINT.md |
57
+ | setup, config, initialize | PROVISIONS.md, CHAMBERS.md |
58
+ | *default* | PROVISIONS.md, BLUEPRINT.md |
59
+
60
+ **Read the relevant survey documents** from `.aether/data/survey/`:
61
+ - Extract key patterns to follow
62
+ - Note file locations for new code
63
+ - Identify known concerns to avoid
64
+
65
+ **Display summary:**
66
+ ```
67
+ ━━━ 🗺️🐜 S U R V E Y L O A D E D ━━━
68
+ {for each doc loaded}
69
+ {emoji} {filename} — {brief description}
70
+ {/for}
71
+
72
+ {if no survey}
73
+ (No territory survey — run /ant:colonize for deeper context)
74
+ {/if}
75
+ ```
76
+
77
+ **Store for builder injection:**
78
+ - `survey_patterns` — patterns to follow
79
+ - `survey_locations` — where to place files
80
+ - `survey_concerns` — concerns to avoid
81
+
82
+ ### Step 4.0.5: Load Phase Research
83
+
84
+ Load domain research generated during `/ant:plan` for injection into worker prompts:
85
+
86
+ Run using the Bash tool with description "Loading phase research...":
87
+ ```bash
88
+ phase_id="{phase_number}"
89
+ research_file=".aether/data/phase-research/phase-${phase_id}-research.md"
90
+
91
+ if [[ -f "$research_file" ]]; then
92
+ research_content=$(cat "$research_file")
93
+ research_word_count=$(wc -w < "$research_file" | tr -d ' ')
94
+
95
+ # Apply 8K character budget (same size as colony-prime's 8K; skills has its own 8K)
96
+ research_budget=8000
97
+ if [[ ${#research_content} -gt $research_budget ]]; then
98
+ research_content="${research_content:0:$research_budget}"
99
+ echo "[research] trimmed to ${research_budget} chars" >&2
100
+ fi
101
+
102
+ research_context="--- PHASE RESEARCH (Domain Knowledge) ---
103
+ ${research_content}
104
+ --- END PHASE RESEARCH ---"
105
+
106
+ echo "Research loaded: phase-${phase_id}-research.md (${research_word_count} words)"
107
+ else
108
+ research_context=""
109
+ echo "No phase research found -- plan was generated before research feature"
110
+ fi
111
+ ```
112
+
113
+ **Parse the result:**
114
+ - If file exists: `research_context` contains the wrapped research content, ready for injection
115
+ - If file does NOT exist: `research_context` is empty, build continues without research (backward compatibility)
116
+
117
+ **Display:**
118
+ ```
119
+ Research loaded: phase-{phase_id}-research.md ({research_word_count} words)
120
+ ```
121
+ Or if no research file:
122
+ ```
123
+ No phase research found -- plan was generated before research feature
124
+ ```
125
+
126
+ **Store for worker injection:** The `research_context` variable is now available for build-wave.md and build-verify.md to inject into worker prompts. This 8K budget matches colony-prime's 8K budget; skills also has its own separate 8K budget.
127
+
128
+ ### Step 4.1: Archaeologist Pre-Build Scan
129
+
130
+ **Conditional step — only fires when the phase modifies existing files.**
131
+
132
+ **DEPTH CHECK: Also skip at "light" depth regardless of file modification.**
133
+
134
+ If `colony_depth` is "light": Skip this step silently, proceed to Step 4.2.
135
+ Otherwise: Apply existing file-modification conditional below.
136
+
137
+ 1. **Detect existing-file modification:**
138
+ Examine each task in the phase. Look at task descriptions, constraints, and hints for signals:
139
+ - Keywords: "update", "modify", "add to", "integrate into", "extend", "change", "refactor", "fix"
140
+ - References to existing file paths (files that already exist in the repo)
141
+ - Task type: if a task is purely "create new file X" with no references to existing code, it is new-file-only
142
+
143
+ **If ALL tasks are new-file-only** (no existing files will be modified):
144
+ - Skip this step silently — produce no output, no spawn
145
+ - Proceed directly to Step 4.2
146
+
147
+ ### Step 4.2: Suggest Pheromones
148
+
149
+ **Conditional step — skipped if `--no-suggest` flag is passed.**
150
+
151
+ Analyze codebase and suggest pheromone signals based on detected patterns.
152
+
153
+ Run using the Bash tool with description "Analyzing codebase for suggestions...":
154
+ ```bash
155
+ bash .aether/aether-utils.sh suggest-approve --dry-run 2>/dev/null
156
+ ```
157
+
158
+ Parse the JSON result to get `suggestion_count`.
159
+
160
+ If `suggestion_count` > 0:
161
+ - Display: "💡 {count} pheromone suggestion(s) detected from code analysis"
162
+ - Run: `bash .aether/aether-utils.sh suggest-approve`
163
+ - Parse result for approved/rejected/skipped counts
164
+ - If approved > 0: Display "✓ {approved} FOCUS signal(s) added"
165
+
166
+ If `suggestion_count` == 0:
167
+ - Skip silently (no output)
168
+
169
+ **Non-blocking**: This step never stops the build. Even if suggest-approve fails,
170
+ log a warning and continue to Step 5.
171
+
172
+ **Error handling**:
173
+ - If suggest-analyze returns error: Log warning, continue
174
+ - If suggest-approve returns error: Log warning, continue
175
+ - Never let suggestion failures block the build
176
+
177
+ ### Step 4.3: Skill Detection
178
+
179
+ **Non-blocking step — failures are logged and skipped.**
180
+
181
+ Build the skills index and detect which domain skills match the current codebase.
182
+
183
+ **4.3.1 — Build/read the skills index:**
184
+
185
+ Run using the Bash tool with description "Building skills index...":
186
+ ```bash
187
+ skill_index_result=$(bash .aether/aether-utils.sh skill-index 2>/dev/null)
188
+ ```
189
+
190
+ **Parse the JSON response:**
191
+ - If `.ok` is false or command fails: Set `skill_index_count = 0`, log warning, skip to next step
192
+ - If successful: Extract `.result.skill_count` as `skill_index_count`
193
+
194
+ **4.3.2 — Detect domain skills matching this codebase:**
195
+
196
+ Run using the Bash tool with description "Detecting codebase skills...":
197
+ ```bash
198
+ skill_detect_result=$(bash .aether/aether-utils.sh skill-detect "$(pwd)" 2>/dev/null)
199
+ ```
200
+
201
+ **Parse the JSON response:**
202
+ - If `.ok` is false or command fails: Set `skill_detections = "[]"`, log warning, continue
203
+ - If successful: Extract `.result.detections` as `skill_detections` (JSON array)
204
+ - Count entries in `skill_detections` as `skill_detection_count`
205
+
206
+ **4.3.3 — Store cross-stage state and display:**
207
+
208
+ Store the following variables for use by build-wave.md:
209
+ - `skill_index_count` — total number of skills in the index
210
+ - `skill_detections` — JSON array of matched skills with scores (e.g., `[{"name": "react", "score": 70}]`)
211
+
212
+ Display to user:
213
+ ```
214
+ 🧠 Skills: {skill_index_count} indexed, {skill_detection_count} matched to codebase
215
+ ```
216
+
217
+ **Error handling:**
218
+ - If `skill-index` fails: Log `⚠️ Skill index unavailable — continuing without skills`, set defaults, continue
219
+ - If `skill-detect` fails: Log `⚠️ Skill detection failed — continuing without matches`, set defaults, continue
220
+ - Never let skill failures block the build
221
+
222
+ 2. **If existing code modification detected — spawn Archaeologist Scout:**
223
+
224
+ Generate archaeologist name and dispatch:
225
+ Run using the Bash tool with description "Naming archaeologist...": `bash .aether/aether-utils.sh generate-ant-name "archaeologist"` (store as `{archaeologist_name}`)
226
+ Run using the Bash tool with description "Dispatching archaeologist...": `bash .aether/aether-utils.sh spawn-log "Queen" "scout" "{archaeologist_name}" "Pre-build archaeology scan"`
227
+
228
+ Display:
229
+ ```
230
+ ━━━ 🏺🐜 A R C H A E O L O G I S T ━━━
231
+ ──── 🏺🐜 Spawning {archaeologist_name} — Pre-build history scan ────
232
+ ```
233
+
234
+ > **Platform note**: In Claude Code, use `Task tool with subagent_type`. In OpenCode, use the equivalent agent spawning mechanism for your platform (e.g., invoke the agent definition from `.opencode/agents/`).
235
+
236
+ Spawn a Scout (using Task tool with `subagent_type="aether-archaeologist"`, include `description: "🏺 Archaeologist {archaeologist_name}: Pre-build history scan"`) with this prompt:
237
+ # FALLBACK: If "Agent type not found", use general-purpose and inject role: "You are an Archaeologist Ant - git historian that excavates why code exists."
238
+
239
+ ```
240
+ You are {Archaeologist-Name}, a 🏺🐜 Archaeologist Ant.
241
+
242
+ Mission: Pre-build archaeology scan
243
+
244
+ Files: {list of existing files that will be modified}
245
+
246
+ Work:
247
+ 1. Read each file to understand current state
248
+ 2. Run: git log --oneline -15 -- "{file_path}" for history
249
+ 3. Run: git log --all --grep="fix\|bug\|workaround\|hack\|revert" --oneline -- "{file_path}" for incident history
250
+ 4. Run: git blame "{file_path}" | head -40 for authorship
251
+ 5. Note TODO/FIXME/HACK markers
252
+
253
+ Log activity: bash .aether/aether-utils.sh activity-log "READ" "{Ant-Name}" "description"
254
+
255
+ Report (plain text):
256
+ - WHY key code sections exist (from commits)
257
+ - Known workarounds/hacks to preserve
258
+ - Key architectural decisions
259
+ - Areas of caution (high churn, reverts, emergencies)
260
+ - Stable bedrock vs volatile sand sections
261
+ ```
262
+
263
+ **Wait for results** (blocking — use TaskOutput with `block: true`).
264
+
265
+ Log completion:
266
+ Run using the Bash tool with description "Recording archaeologist findings...": `bash .aether/aether-utils.sh spawn-complete "{archaeologist_name}" "completed" "Pre-build archaeology scan"`
267
+
268
+ 3. **Store and display findings:**
269
+
270
+ Store the archaeologist's output as `archaeology_context`.
271
+
272
+ Display summary:
273
+ ```
274
+ ━━━ 🏺🐜 A R C H A E O L O G Y ━━━
275
+ {summary of findings from archaeologist}
276
+ ```
277
+
278
+ 4. **Injection into builder prompts:**
279
+ The `archaeology_context` will be injected into builder prompts in Step 5.1 (see below).
280
+ If this step was skipped (no existing files modified), the archaeology section is omitted from builder prompts.
281
+
282
+ ---