aether-colony 5.0.0 → 5.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (317) hide show
  1. package/.aether/aether-utils.sh +3226 -3345
  2. package/.aether/agents-claude/aether-ambassador.md +265 -0
  3. package/.aether/agents-claude/aether-archaeologist.md +327 -0
  4. package/.aether/agents-claude/aether-architect.md +236 -0
  5. package/.aether/agents-claude/aether-auditor.md +271 -0
  6. package/.aether/agents-claude/aether-builder.md +224 -0
  7. package/.aether/agents-claude/aether-chaos.md +269 -0
  8. package/.aether/agents-claude/aether-chronicler.md +305 -0
  9. package/.aether/agents-claude/aether-gatekeeper.md +330 -0
  10. package/.aether/agents-claude/aether-includer.md +374 -0
  11. package/.aether/agents-claude/aether-keeper.md +272 -0
  12. package/.aether/agents-claude/aether-measurer.md +322 -0
  13. package/.aether/agents-claude/aether-oracle.md +237 -0
  14. package/.aether/agents-claude/aether-probe.md +211 -0
  15. package/.aether/agents-claude/aether-queen.md +330 -0
  16. package/.aether/agents-claude/aether-route-setter.md +178 -0
  17. package/.aether/agents-claude/aether-sage.md +418 -0
  18. package/.aether/agents-claude/aether-scout.md +179 -0
  19. package/.aether/agents-claude/aether-surveyor-disciplines.md +417 -0
  20. package/.aether/agents-claude/aether-surveyor-nest.md +355 -0
  21. package/.aether/agents-claude/aether-surveyor-pathogens.md +289 -0
  22. package/.aether/agents-claude/aether-surveyor-provisions.md +360 -0
  23. package/.aether/agents-claude/aether-tracker.md +270 -0
  24. package/.aether/agents-claude/aether-watcher.md +280 -0
  25. package/.aether/agents-claude/aether-weaver.md +248 -0
  26. package/.aether/commands/archaeology.yaml +653 -0
  27. package/.aether/commands/build.yaml +1221 -0
  28. package/.aether/commands/chaos.yaml +653 -0
  29. package/.aether/commands/colonize.yaml +442 -0
  30. package/.aether/commands/continue.yaml +1484 -0
  31. package/.aether/commands/council.yaml +509 -0
  32. package/.aether/commands/data-clean.yaml +80 -0
  33. package/.aether/commands/dream.yaml +275 -0
  34. package/.aether/commands/entomb.yaml +863 -0
  35. package/.aether/commands/export-signals.yaml +64 -0
  36. package/.aether/commands/feedback.yaml +158 -0
  37. package/.aether/commands/flag.yaml +160 -0
  38. package/.aether/commands/flags.yaml +177 -0
  39. package/.aether/commands/focus.yaml +112 -0
  40. package/.aether/commands/help.yaml +167 -0
  41. package/.aether/commands/history.yaml +137 -0
  42. package/.aether/commands/import-signals.yaml +79 -0
  43. package/.aether/commands/init.yaml +502 -0
  44. package/.aether/commands/insert-phase.yaml +102 -0
  45. package/.aether/commands/interpret.yaml +285 -0
  46. package/.aether/commands/lay-eggs.yaml +224 -0
  47. package/.aether/commands/maturity.yaml +122 -0
  48. package/.aether/commands/memory-details.yaml +74 -0
  49. package/.aether/commands/migrate-state.yaml +174 -0
  50. package/.aether/commands/oracle.yaml +1224 -0
  51. package/.aether/commands/organize.yaml +446 -0
  52. package/.aether/commands/patrol.yaml +621 -0
  53. package/.aether/commands/pause-colony.yaml +424 -0
  54. package/.aether/commands/phase.yaml +124 -0
  55. package/.aether/commands/pheromones.yaml +153 -0
  56. package/.aether/commands/plan.yaml +1364 -0
  57. package/.aether/commands/preferences.yaml +63 -0
  58. package/.aether/commands/quick.yaml +104 -0
  59. package/.aether/commands/redirect.yaml +123 -0
  60. package/.aether/commands/resume-colony.yaml +375 -0
  61. package/.aether/commands/resume.yaml +407 -0
  62. package/.aether/commands/run.yaml +229 -0
  63. package/.aether/commands/seal.yaml +1214 -0
  64. package/.aether/commands/skill-create.yaml +337 -0
  65. package/.aether/commands/status.yaml +408 -0
  66. package/.aether/commands/swarm.yaml +352 -0
  67. package/.aether/commands/tunnels.yaml +814 -0
  68. package/.aether/commands/update.yaml +131 -0
  69. package/.aether/commands/verify-castes.yaml +159 -0
  70. package/.aether/commands/watch.yaml +454 -0
  71. package/.aether/docs/INCIDENT_TEMPLATE.md +32 -0
  72. package/.aether/docs/QUEEN-SYSTEM.md +11 -11
  73. package/.aether/docs/README.md +32 -2
  74. package/.aether/docs/command-playbooks/README.md +23 -0
  75. package/.aether/docs/command-playbooks/build-complete.md +349 -0
  76. package/.aether/docs/command-playbooks/build-context.md +282 -0
  77. package/.aether/docs/command-playbooks/build-full.md +1683 -0
  78. package/.aether/docs/command-playbooks/build-prep.md +284 -0
  79. package/.aether/docs/command-playbooks/build-verify.md +405 -0
  80. package/.aether/docs/command-playbooks/build-wave.md +749 -0
  81. package/.aether/docs/command-playbooks/continue-advance.md +524 -0
  82. package/.aether/docs/command-playbooks/continue-finalize.md +447 -0
  83. package/.aether/docs/command-playbooks/continue-full.md +1725 -0
  84. package/.aether/docs/command-playbooks/continue-gates.md +686 -0
  85. package/.aether/docs/command-playbooks/continue-verify.md +407 -0
  86. package/.aether/docs/context-continuity.md +84 -0
  87. package/.aether/docs/disciplines/DISCIPLINES.md +9 -7
  88. package/.aether/docs/error-codes.md +1 -1
  89. package/.aether/docs/known-issues.md +34 -173
  90. package/.aether/docs/pheromones.md +86 -6
  91. package/.aether/docs/plans/pheromone-display-plan.md +257 -0
  92. package/.aether/docs/queen-commands.md +10 -9
  93. package/.aether/docs/source-of-truth-map.md +132 -0
  94. package/.aether/docs/xml-utilities.md +47 -0
  95. package/.aether/rules/aether-colony.md +23 -13
  96. package/.aether/scripts/incident-test-add.sh +47 -0
  97. package/.aether/scripts/weekly-audit.sh +79 -0
  98. package/.aether/skills/.index.json +649 -0
  99. package/.aether/skills/colony/.manifest.json +16 -0
  100. package/.aether/skills/colony/build-discipline/SKILL.md +78 -0
  101. package/.aether/skills/colony/colony-interaction/SKILL.md +56 -0
  102. package/.aether/skills/colony/colony-lifecycle/SKILL.md +77 -0
  103. package/.aether/skills/colony/colony-visuals/SKILL.md +112 -0
  104. package/.aether/skills/colony/context-management/SKILL.md +80 -0
  105. package/.aether/skills/colony/error-presentation/SKILL.md +99 -0
  106. package/.aether/skills/colony/pheromone-protocol/SKILL.md +79 -0
  107. package/.aether/skills/colony/pheromone-visibility/SKILL.md +81 -0
  108. package/.aether/skills/colony/state-safety/SKILL.md +84 -0
  109. package/.aether/skills/colony/worker-priming/SKILL.md +82 -0
  110. package/.aether/skills/domain/.manifest.json +24 -0
  111. package/.aether/skills/domain/README.md +33 -0
  112. package/.aether/skills/domain/django/SKILL.md +49 -0
  113. package/.aether/skills/domain/docker/SKILL.md +52 -0
  114. package/.aether/skills/domain/golang/SKILL.md +52 -0
  115. package/.aether/skills/domain/graphql/SKILL.md +51 -0
  116. package/.aether/skills/domain/html-css/SKILL.md +48 -0
  117. package/.aether/skills/domain/nextjs/SKILL.md +45 -0
  118. package/.aether/skills/domain/nodejs/SKILL.md +53 -0
  119. package/.aether/skills/domain/postgresql/SKILL.md +53 -0
  120. package/.aether/skills/domain/prisma/SKILL.md +59 -0
  121. package/.aether/skills/domain/python/SKILL.md +50 -0
  122. package/.aether/skills/domain/rails/SKILL.md +52 -0
  123. package/.aether/skills/domain/react/SKILL.md +45 -0
  124. package/.aether/skills/domain/rest-api/SKILL.md +58 -0
  125. package/.aether/skills/domain/svelte/SKILL.md +47 -0
  126. package/.aether/skills/domain/tailwind/SKILL.md +45 -0
  127. package/.aether/skills/domain/testing/SKILL.md +53 -0
  128. package/.aether/skills/domain/typescript/SKILL.md +58 -0
  129. package/.aether/skills/domain/vue/SKILL.md +49 -0
  130. package/.aether/templates/QUEEN.md.template +23 -41
  131. package/.aether/templates/colony-state-reset.jq.template +1 -0
  132. package/.aether/templates/colony-state.template.json +4 -0
  133. package/.aether/templates/learning-observations.template.json +6 -0
  134. package/.aether/templates/midden.template.json +13 -0
  135. package/.aether/templates/pheromones.template.json +6 -0
  136. package/.aether/templates/session.template.json +9 -0
  137. package/.aether/utils/atomic-write.sh +63 -17
  138. package/.aether/utils/chamber-utils.sh +145 -2
  139. package/.aether/utils/council.sh +425 -0
  140. package/.aether/utils/emoji-audit.sh +166 -0
  141. package/.aether/utils/error-handler.sh +21 -7
  142. package/.aether/utils/file-lock.sh +182 -27
  143. package/.aether/utils/flag.sh +278 -0
  144. package/.aether/utils/hive.sh +572 -0
  145. package/.aether/utils/immune.sh +508 -0
  146. package/.aether/utils/learning.sh +1928 -0
  147. package/.aether/utils/midden.sh +520 -0
  148. package/.aether/utils/oracle/oracle.md +168 -0
  149. package/.aether/utils/oracle/oracle.sh +1023 -0
  150. package/.aether/utils/pheromone.sh +2029 -0
  151. package/.aether/utils/queen.sh +1710 -0
  152. package/.aether/utils/scan.sh +860 -0
  153. package/.aether/utils/semantic-cli.sh +10 -8
  154. package/.aether/utils/session.sh +816 -0
  155. package/.aether/utils/skills.sh +509 -0
  156. package/.aether/utils/spawn-tree.sh +103 -271
  157. package/.aether/utils/spawn.sh +260 -0
  158. package/.aether/utils/state-api.sh +389 -0
  159. package/.aether/utils/state-loader.sh +8 -6
  160. package/.aether/utils/suggest.sh +611 -0
  161. package/.aether/utils/swarm-display.sh +10 -1
  162. package/.aether/utils/swarm.sh +1004 -0
  163. package/.aether/utils/watch-spawn-tree.sh +11 -2
  164. package/.aether/utils/xml-compose.sh +2 -2
  165. package/.aether/utils/xml-convert.sh +9 -5
  166. package/.aether/utils/xml-core.sh +5 -9
  167. package/.aether/utils/xml-query.sh +4 -4
  168. package/.aether/workers.md +86 -67
  169. package/.claude/agents/ant/aether-ambassador.md +2 -1
  170. package/.claude/agents/ant/aether-archaeologist.md +6 -1
  171. package/.claude/agents/ant/aether-architect.md +236 -0
  172. package/.claude/agents/ant/aether-auditor.md +6 -1
  173. package/.claude/agents/ant/aether-builder.md +38 -1
  174. package/.claude/agents/ant/aether-chaos.md +2 -1
  175. package/.claude/agents/ant/aether-chronicler.md +1 -0
  176. package/.claude/agents/ant/aether-gatekeeper.md +6 -1
  177. package/.claude/agents/ant/aether-includer.md +1 -0
  178. package/.claude/agents/ant/aether-keeper.md +1 -0
  179. package/.claude/agents/ant/aether-measurer.md +6 -1
  180. package/.claude/agents/ant/aether-oracle.md +237 -0
  181. package/.claude/agents/ant/aether-probe.md +2 -1
  182. package/.claude/agents/ant/aether-queen.md +6 -1
  183. package/.claude/agents/ant/aether-route-setter.md +6 -1
  184. package/.claude/agents/ant/aether-sage.md +68 -3
  185. package/.claude/agents/ant/aether-scout.md +38 -1
  186. package/.claude/agents/ant/aether-surveyor-disciplines.md +2 -1
  187. package/.claude/agents/ant/aether-surveyor-nest.md +2 -1
  188. package/.claude/agents/ant/aether-surveyor-pathogens.md +2 -1
  189. package/.claude/agents/ant/aether-surveyor-provisions.md +2 -1
  190. package/.claude/agents/ant/aether-tracker.md +6 -1
  191. package/.claude/agents/ant/aether-watcher.md +37 -1
  192. package/.claude/agents/ant/aether-weaver.md +2 -1
  193. package/.claude/commands/ant/archaeology.md +1 -8
  194. package/.claude/commands/ant/build.md +43 -1159
  195. package/.claude/commands/ant/chaos.md +1 -14
  196. package/.claude/commands/ant/colonize.md +3 -14
  197. package/.claude/commands/ant/continue.md +40 -1026
  198. package/.claude/commands/ant/council.md +213 -15
  199. package/.claude/commands/ant/data-clean.md +81 -0
  200. package/.claude/commands/ant/dream.md +12 -9
  201. package/.claude/commands/ant/entomb.md +62 -87
  202. package/.claude/commands/ant/export-signals.md +57 -0
  203. package/.claude/commands/ant/feedback.md +18 -0
  204. package/.claude/commands/ant/flag.md +12 -0
  205. package/.claude/commands/ant/flags.md +22 -8
  206. package/.claude/commands/ant/focus.md +18 -0
  207. package/.claude/commands/ant/help.md +40 -8
  208. package/.claude/commands/ant/history.md +3 -0
  209. package/.claude/commands/ant/import-signals.md +71 -0
  210. package/.claude/commands/ant/init.md +349 -191
  211. package/.claude/commands/ant/insert-phase.md +105 -0
  212. package/.claude/commands/ant/interpret.md +11 -0
  213. package/.claude/commands/ant/lay-eggs.md +167 -158
  214. package/.claude/commands/ant/maturity.md +22 -11
  215. package/.claude/commands/ant/memory-details.md +77 -0
  216. package/.claude/commands/ant/migrate-state.md +6 -0
  217. package/.claude/commands/ant/oracle.md +317 -62
  218. package/.claude/commands/ant/organize.md +10 -5
  219. package/.claude/commands/ant/patrol.md +620 -0
  220. package/.claude/commands/ant/pause-colony.md +8 -22
  221. package/.claude/commands/ant/phase.md +26 -37
  222. package/.claude/commands/ant/pheromones.md +156 -0
  223. package/.claude/commands/ant/plan.md +199 -50
  224. package/.claude/commands/ant/preferences.md +65 -0
  225. package/.claude/commands/ant/quick.md +100 -0
  226. package/.claude/commands/ant/redirect.md +18 -0
  227. package/.claude/commands/ant/resume-colony.md +37 -22
  228. package/.claude/commands/ant/resume.md +60 -7
  229. package/.claude/commands/ant/run.md +231 -0
  230. package/.claude/commands/ant/seal.md +506 -78
  231. package/.claude/commands/ant/skill-create.md +286 -0
  232. package/.claude/commands/ant/status.md +171 -1
  233. package/.claude/commands/ant/swarm.md +11 -23
  234. package/.claude/commands/ant/tunnels.md +1 -0
  235. package/.claude/commands/ant/update.md +58 -135
  236. package/.claude/commands/ant/verify-castes.md +90 -42
  237. package/.claude/commands/ant/watch.md +1 -0
  238. package/.opencode/agents/aether-ambassador.md +1 -1
  239. package/.opencode/agents/aether-architect.md +133 -0
  240. package/.opencode/agents/aether-builder.md +3 -3
  241. package/.opencode/agents/aether-oracle.md +137 -0
  242. package/.opencode/agents/aether-queen.md +1 -1
  243. package/.opencode/agents/aether-route-setter.md +1 -1
  244. package/.opencode/agents/aether-scout.md +1 -1
  245. package/.opencode/agents/aether-surveyor-disciplines.md +6 -1
  246. package/.opencode/agents/aether-surveyor-nest.md +6 -1
  247. package/.opencode/agents/aether-surveyor-pathogens.md +6 -1
  248. package/.opencode/agents/aether-surveyor-provisions.md +6 -1
  249. package/.opencode/agents/aether-tracker.md +1 -1
  250. package/.opencode/agents/aether-watcher.md +1 -1
  251. package/.opencode/agents/aether-weaver.md +1 -1
  252. package/.opencode/commands/ant/archaeology.md +7 -14
  253. package/.opencode/commands/ant/build.md +54 -88
  254. package/.opencode/commands/ant/chaos.md +7 -24
  255. package/.opencode/commands/ant/colonize.md +10 -17
  256. package/.opencode/commands/ant/continue.md +595 -66
  257. package/.opencode/commands/ant/council.md +150 -18
  258. package/.opencode/commands/ant/data-clean.md +77 -0
  259. package/.opencode/commands/ant/dream.md +15 -17
  260. package/.opencode/commands/ant/entomb.md +28 -18
  261. package/.opencode/commands/ant/export-signals.md +54 -0
  262. package/.opencode/commands/ant/feedback.md +24 -5
  263. package/.opencode/commands/ant/flag.md +16 -4
  264. package/.opencode/commands/ant/flags.md +24 -10
  265. package/.opencode/commands/ant/focus.md +22 -5
  266. package/.opencode/commands/ant/help.md +41 -8
  267. package/.opencode/commands/ant/history.md +9 -0
  268. package/.opencode/commands/ant/import-signals.md +68 -0
  269. package/.opencode/commands/ant/init.md +396 -154
  270. package/.opencode/commands/ant/insert-phase.md +111 -0
  271. package/.opencode/commands/ant/interpret.md +16 -0
  272. package/.opencode/commands/ant/lay-eggs.md +184 -112
  273. package/.opencode/commands/ant/maturity.md +18 -2
  274. package/.opencode/commands/ant/memory-details.md +83 -0
  275. package/.opencode/commands/ant/migrate-state.md +12 -0
  276. package/.opencode/commands/ant/oracle.md +322 -67
  277. package/.opencode/commands/ant/organize.md +14 -12
  278. package/.opencode/commands/ant/patrol.md +626 -0
  279. package/.opencode/commands/ant/pause-colony.md +12 -29
  280. package/.opencode/commands/ant/phase.md +30 -40
  281. package/.opencode/commands/ant/pheromones.md +162 -0
  282. package/.opencode/commands/ant/plan.md +210 -57
  283. package/.opencode/commands/ant/preferences.md +71 -0
  284. package/.opencode/commands/ant/quick.md +91 -0
  285. package/.opencode/commands/ant/redirect.md +22 -5
  286. package/.opencode/commands/ant/resume-colony.md +41 -29
  287. package/.opencode/commands/ant/resume.md +80 -20
  288. package/.opencode/commands/ant/run.md +237 -0
  289. package/.opencode/commands/ant/seal.md +230 -25
  290. package/.opencode/commands/ant/skill-create.md +63 -0
  291. package/.opencode/commands/ant/status.md +125 -30
  292. package/.opencode/commands/ant/swarm.md +3 -345
  293. package/.opencode/commands/ant/tunnels.md +3 -9
  294. package/.opencode/commands/ant/update.md +63 -127
  295. package/.opencode/commands/ant/verify-castes.md +96 -42
  296. package/.opencode/commands/ant/watch.md +7 -0
  297. package/CHANGELOG.md +368 -1
  298. package/README.md +195 -324
  299. package/bin/cli.js +236 -429
  300. package/bin/generate-commands.js +186 -0
  301. package/bin/generate-commands.sh +128 -89
  302. package/bin/lib/spawn-logger.js +0 -15
  303. package/bin/lib/update-transaction.js +285 -35
  304. package/bin/npx-install.js +178 -0
  305. package/bin/validate-package.sh +85 -3
  306. package/package.json +16 -4
  307. package/.aether/CONTEXT.md +0 -160
  308. package/.aether/docs/QUEEN.md +0 -84
  309. package/.aether/exchange/colony-registry.xml +0 -11
  310. package/.aether/exchange/pheromones.xml +0 -87
  311. package/.aether/exchange/queen-wisdom.xml +0 -14
  312. package/.aether/model-profiles.yaml +0 -100
  313. package/.aether/utils/spawn-with-model.sh +0 -56
  314. package/bin/lib/model-profiles.js +0 -445
  315. package/bin/lib/model-verify.js +0 -288
  316. package/bin/lib/proxy-health.js +0 -253
  317. package/bin/lib/telemetry.js +0 -441
@@ -0,0 +1,1224 @@
1
+ name: "ant:oracle"
2
+ description: "🔮🐜🧠🐜🔮🐜 Oracle Ant - deep research agent using RALF iterative loop pattern"
3
+ description_opencode: "🔮🐜🧠🐜🔮 Oracle Ant - deep research agent using RALF iterative loop pattern"
4
+ body_claude: |
5
+ You are the **Oracle Ant** command handler. You configure and launch a deep research loop that runs autonomously in a separate process.
6
+
7
+ The user's input is: `$ARGUMENTS`
8
+
9
+ ## Non-Invasive Guarantee
10
+
11
+ Oracle NEVER touches COLONY_STATE.json, constraints.json, activity.log, or any code files. Only writes to `.aether/oracle/`.
12
+
13
+ ## Instructions
14
+
15
+ ### Step 0: Parse Arguments and Route
16
+
17
+ Parse `$ARGUMENTS` to determine the action:
18
+
19
+ 1. Check for flags:
20
+ - If contains `--no-visual`: set `visual_mode = false` (visual is ON by default)
21
+ - If contains `--force` or `--force-research`: set `force_research = true`
22
+ - Otherwise: set `visual_mode = true`, `force_research = false`
23
+ - Remove flags from arguments before routing
24
+
25
+ 2. **If remaining arguments is exactly `stop`** — go to **Step 0b: Stop Oracle**
26
+ 3. **If remaining arguments is exactly `status`** — go to **Step 0c: Show Status**
27
+ 4. **If remaining arguments is exactly `promote`** — go to **Step 0d: Promote Findings**
28
+ 5. **Otherwise** — go to **Step 0.5: Initialize Visual Mode** then **Step 1: Research Wizard**
29
+
30
+ ### Step 0.5: Initialize Visual Mode (if enabled)
31
+
32
+ Display visual header:
33
+ ```
34
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
35
+ 🔮🐜🧠🐜🔮 O R A C L E — R e s e a r c h M o d e
36
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
37
+
38
+ Oracle peering into the depths...
39
+ ```
40
+
41
+ ---
42
+
43
+ ### Step 0b: Stop Oracle
44
+
45
+ Create the stop signal file by running using the Bash tool with description "Stopping oracle research...":
46
+
47
+ ```bash
48
+ mkdir -p .aether/oracle && touch .aether/oracle/.stop
49
+ ```
50
+
51
+ Output:
52
+
53
+ ```
54
+ 🔮🐜 Oracle Stop Signal Sent
55
+
56
+ Created .aether/oracle/.stop
57
+ The research loop will halt at the end of the current iteration.
58
+
59
+ To check final results: /ant:oracle status
60
+ ```
61
+
62
+ Stop here. Do not proceed.
63
+
64
+ ---
65
+
66
+ ### Step 0c: Show Status
67
+
68
+ Check if `.aether/oracle/research-plan.md` exists using the Read tool.
69
+
70
+ **If it does NOT exist**, output:
71
+
72
+ ```
73
+ 🔮🐜 Oracle Status: No Research In Progress
74
+
75
+ No active research session. Start one:
76
+ /ant:oracle
77
+ ```
78
+
79
+ Stop here.
80
+
81
+ **If it exists**, read `.aether/oracle/research-plan.md` and `.aether/oracle/state.json` (if present).
82
+
83
+ Output:
84
+
85
+ ```
86
+ 🔮🐜 Oracle Status
87
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
88
+ Topic: {topic from state.json, or "unknown"}
89
+ Iteration: {iteration} of {max_iterations}
90
+ Status: {status}
91
+
92
+ {contents of research-plan.md}
93
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
94
+
95
+ /ant:oracle stop Halt the loop
96
+ /ant:oracle Start new research
97
+ ```
98
+
99
+ Stop here.
100
+
101
+ ---
102
+
103
+ ### Step 0d: Promote Findings to Colony
104
+
105
+ Check if `.aether/oracle/state.json` exists. If it does NOT exist, or if the status is "active", output:
106
+
107
+ ```
108
+ 🔮🐜 Oracle Promote: No Completed Research
109
+
110
+ No completed research to promote. Run /ant:oracle first, then wait for completion.
111
+ ```
112
+
113
+ Stop here.
114
+
115
+ **If state.json exists and status is "complete" or "stopped":**
116
+
117
+ Read `.aether/oracle/plan.json` and extract high-confidence findings. Run using the Bash tool with description "Reading oracle findings for promotion...":
118
+
119
+ ```bash
120
+ ORACLE_DIR=".aether/oracle"
121
+ topic=$(jq -r '.topic // "unknown"' "$ORACLE_DIR/state.json")
122
+ status=$(jq -r '.status // "active"' "$ORACLE_DIR/state.json")
123
+ count=$(jq '[.questions[] | select(.status == "answered" and .confidence >= 80)] | length' "$ORACLE_DIR/plan.json" 2>/dev/null || echo "0")
124
+ total=$(jq '[.questions[]] | length' "$ORACLE_DIR/plan.json" 2>/dev/null || echo "0")
125
+ echo "TOPIC=$topic"
126
+ echo "STATUS=$status"
127
+ echo "QUALIFYING=$count"
128
+ echo "TOTAL=$total"
129
+ ```
130
+
131
+ If qualifying count is 0, output:
132
+
133
+ ```
134
+ 🔮🐜 Oracle Promote: No Qualifying Findings
135
+
136
+ Topic: {topic}
137
+ Status: {status}
138
+ Findings: 0 of {total} questions meet the threshold (answered + 80%+ confidence)
139
+
140
+ Lower-confidence findings remain in .aether/oracle/synthesis.md for reference.
141
+ ```
142
+
143
+ Stop here.
144
+
145
+ **If qualifying count > 0**, display the summary and ask for confirmation:
146
+
147
+ ```
148
+ 🔮🐜 Oracle Promote: Colony Knowledge Integration
149
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
150
+
151
+ Oracle Research: {topic}
152
+ Status: {status}
153
+ High-confidence findings: {count} (answering {count} of {total} questions)
154
+
155
+ These findings will be promoted to:
156
+ - Colony instincts (COLONY_STATE.json)
157
+ - Colony learnings (learnings.json)
158
+ - Observation pipeline (for queen-promote)
159
+
160
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
161
+ ```
162
+
163
+ Use AskUserQuestion to ask:
164
+
165
+ ```
166
+ Promote these findings to colony knowledge?
167
+ ```
168
+
169
+ Options:
170
+ 1. **Yes, promote all high-confidence findings** -- Push qualifying findings to colony instincts, learnings, and observations
171
+ 2. **No, skip promotion** -- Findings remain in .aether/oracle/ for reference only
172
+
173
+ **If user selects Yes:**
174
+
175
+ Run promotion using the Bash tool with description "Promoting oracle findings to colony knowledge...". For each qualifying question, call the colony APIs directly:
176
+
177
+ ```bash
178
+ ORACLE_DIR=".aether/oracle"
179
+ UTILS=".aether/aether-utils.sh"
180
+ topic=$(jq -r '.topic // "unknown"' "$ORACLE_DIR/state.json")
181
+ promoted=0
182
+
183
+ while IFS= read -r question; do
184
+ q_text=$(echo "$question" | jq -r '.text')
185
+ q_confidence=$(echo "$question" | jq -r '.confidence')
186
+ findings_text=$(echo "$question" | jq -r '[.key_findings[].text // .key_findings[]] | join("; ")' 2>/dev/null | head -c 200)
187
+ first_finding=$(echo "$question" | jq -r '[.key_findings[].text // .key_findings[]] | first // "No findings"' 2>/dev/null)
188
+
189
+ bash "$UTILS" instinct-create \
190
+ --trigger "researching: $q_text" \
191
+ --action "Oracle found (${q_confidence}% confidence): $findings_text" \
192
+ --confidence "$(echo "scale=2; $q_confidence / 100" | bc)" \
193
+ --domain "research" \
194
+ --source "oracle:$topic" \
195
+ --evidence "Oracle research: $q_text" 2>/dev/null || true
196
+
197
+ bash "$UTILS" learning-promote \
198
+ "Oracle: $q_text -- $first_finding" \
199
+ "oracle" \
200
+ "oracle-research" \
201
+ "oracle,research" 2>/dev/null || true
202
+
203
+ bash "$UTILS" memory-capture learning \
204
+ "Oracle research finding: $q_text (${q_confidence}%)" \
205
+ "pattern" \
206
+ "oracle:promote" 2>/dev/null || true
207
+
208
+ promoted=$((promoted + 1))
209
+ done < <(jq -c '[.questions[] | select(.status == "answered" and .confidence >= 80)] | .[]' "$ORACLE_DIR/plan.json")
210
+
211
+ echo "Promoted $promoted findings"
212
+ ```
213
+
214
+ Output:
215
+
216
+ ```
217
+ 🔮🐜 Oracle Promote: Complete
218
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
219
+
220
+ Promoted {count} findings to colony knowledge:
221
+ - Instincts created in COLONY_STATE.json
222
+ - Learnings stored in learnings.json
223
+ - Observations tracked for wisdom promotion
224
+
225
+ Run /ant:status to see colony knowledge updates.
226
+
227
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
228
+ ```
229
+
230
+ **If user selects No:**
231
+
232
+ ```
233
+ 🔮🐜 Promotion skipped. Findings remain in .aether/oracle/synthesis.md.
234
+ ```
235
+
236
+ Stop here.
237
+
238
+ ---
239
+
240
+ ### Step 1: Research Wizard
241
+
242
+ This is the setup phase. The Oracle asks questions to configure the research before launching.
243
+
244
+ Output the header:
245
+
246
+ ```
247
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
248
+ 🔮🐜🧠🐜🔮 O R A C L E A N T — R E S E A R C H W I Z A R D
249
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
250
+ ```
251
+
252
+ **If `$ARGUMENTS` is not empty and not a subcommand**, use it as the initial topic suggestion. Otherwise, the topic will be asked in Question 1.
253
+
254
+ Now ask questions using AskUserQuestion. Ask them one at a time so each answer can inform the next question.
255
+
256
+ **Question 1: Research Topic**
257
+
258
+ If `$ARGUMENTS` already contains a topic, skip this question and use that as the topic.
259
+
260
+ Otherwise ask:
261
+
262
+ ```
263
+ What should the Oracle research?
264
+ ```
265
+
266
+ Options:
267
+ 1. **Codebase analysis** — Deep dive into how this codebase works (architecture, patterns, conventions)
268
+ 2. **External research** — Research a technology, library, or concept using web search
269
+ 3. **Both** — Combine codebase exploration with external research
270
+
271
+ Then use a follow-up AskUserQuestion with a free-text prompt:
272
+
273
+ ```
274
+ Describe the research topic in detail. The more specific, the better the Oracle's results.
275
+ ```
276
+
277
+ (The user will type their topic via the "Other" free-text option.)
278
+
279
+ **Question 2: Research Template**
280
+
281
+ ```
282
+ What type of research is this?
283
+ ```
284
+
285
+ Options:
286
+ 1. **Technology evaluation** -- Compare and evaluate a technology, library, or tool
287
+ 2. **Architecture review** -- Analyze system design, components, and dependencies
288
+ 3. **Bug investigation** -- Track down and understand a specific bug or issue
289
+ 4. **Best practices** -- Research recommended approaches for a domain or technique
290
+ 5. **Custom research** -- Free-form research (Oracle decomposes the topic as it sees fit)
291
+
292
+ Map selection to template value: 1->tech-eval, 2->architecture-review, 3->bug-investigation, 4->best-practices, 5->custom
293
+
294
+ **Question 3: Research Depth**
295
+
296
+ ```
297
+ How deep should the Oracle go?
298
+ ```
299
+
300
+ Options:
301
+ 1. **Quick scan (5 iterations)** — Surface-level overview, fast results
302
+ 2. **Standard research (15 iterations)** — Thorough investigation, good balance
303
+ 3. **Deep dive (30 iterations)** — Exhaustive research, leaves no stone unturned
304
+ 4. **Marathon (50 iterations)** — Maximum depth, may take hours
305
+
306
+ **Question 4: Confidence Target**
307
+
308
+ ```
309
+ When should the Oracle consider the research complete?
310
+ ```
311
+
312
+ Options:
313
+ 1. **80% confidence** — Good enough for a first pass, stops early
314
+ 2. **90% confidence** — Solid understanding, most questions answered
315
+ 3. **95% confidence (recommended)** — Thorough, few gaps remaining
316
+ 4. **99% confidence** — Near-exhaustive, won't stop until almost everything is known
317
+
318
+ **Question 5: Research Scope** (only if topic involves codebase)
319
+
320
+ ```
321
+ Should the Oracle also search the web, or stay within the codebase?
322
+ ```
323
+
324
+ Options:
325
+ 1. **Codebase only** — Only use Glob, Grep, Read to explore local files
326
+ 2. **Codebase + web** — Also use WebSearch and WebFetch for docs, best practices, prior art
327
+ 3. **Web only** — Focus on external research (libraries, concepts, techniques)
328
+
329
+ **Question 6: Search Strategy**
330
+
331
+ (Ask this question for all research types.)
332
+
333
+ ```
334
+ How should the Oracle approach the research?
335
+ ```
336
+
337
+ Options:
338
+ 1. **Adaptive (recommended)** -- Oracle decides when to go broad vs deep based on research progress
339
+ 2. **Breadth-first** -- Cover all questions with initial findings before going deep on any single one
340
+ 3. **Depth-first** -- Pick the most important question and investigate it exhaustively before moving on
341
+
342
+ **Question 7: Focus Areas** (optional)
343
+
344
+ ```
345
+ Are there specific aspects you want the Oracle to prioritize?
346
+ ```
347
+
348
+ Options:
349
+ 1. **No specific focus** -- Let the Oracle decide what to investigate first
350
+ 2. **Yes, I have focus areas** -- I want to steer the research toward specific aspects
351
+
352
+ If the user selects option 2, ask a follow-up AskUserQuestion with free-text:
353
+
354
+ ```
355
+ List your focus areas (comma-separated). Example: "security implications, performance under load, migration path"
356
+ ```
357
+
358
+ Parse the comma-separated response into individual focus area strings.
359
+
360
+ After collecting all answers, proceed to Step 2.
361
+
362
+ ---
363
+
364
+ ### Step 1.5: Check for Stale Oracle Session
365
+
366
+ Before starting new research, check for existing oracle session files.
367
+
368
+ Capture session start time:
369
+ ```bash
370
+ ORACLE_START=$(date +%s)
371
+ ```
372
+
373
+ Check for stale files by running using the Bash tool with description "Checking for stale oracle session...":
374
+ ```bash
375
+ stale_check=$(bash .aether/aether-utils.sh session-verify-fresh --command oracle "" "$ORACLE_START")
376
+ has_stale=$(echo "$stale_check" | jq -r '.stale | length')
377
+ has_progress=$(echo "$stale_check" | jq -r '.fresh | length')
378
+
379
+ if [[ "$has_stale" -gt 0 ]] || [[ "$has_progress" -gt 0 ]]; then
380
+ # Found existing oracle session
381
+ if [[ "$force_research" == "true" ]]; then
382
+ bash .aether/aether-utils.sh session-clear --command oracle
383
+ echo "Cleared stale oracle session for fresh research"
384
+ else
385
+ # Existing session found - prompt user
386
+ echo "Found existing oracle session. Options:"
387
+ echo " /ant:oracle status - View current session"
388
+ echo " /ant:oracle --force - Restart with fresh session"
389
+ echo " /ant:oracle stop - Stop current session"
390
+ # Don't proceed - let user decide
391
+ exit 0
392
+ fi
393
+ fi
394
+ ```
395
+
396
+ ---
397
+
398
+ ### Step 2: Configure Research
399
+
400
+ Create the oracle directory structure by running using the Bash tool with description "Setting up oracle research...":
401
+
402
+ ```bash
403
+ mkdir -p .aether/oracle/archive .aether/oracle/discoveries
404
+ ```
405
+
406
+ Generate an ISO-8601 UTC timestamp.
407
+
408
+ **Archive previous research if it exists:**
409
+
410
+ Check if `.aether/oracle/state.json` exists. If it does, run using the Bash tool with description "Archiving previous research...":
411
+
412
+ ```bash
413
+ ARCHIVE_TS=$(date +%Y-%m-%d-%H%M%S)
414
+ mkdir -p .aether/oracle/archive/$ARCHIVE_TS
415
+ for f in state.json plan.json gaps.md synthesis.md research-plan.md; do
416
+ [ -f ".aether/oracle/$f" ] && cp ".aether/oracle/$f" ".aether/oracle/archive/$ARCHIVE_TS/"
417
+ done
418
+ ```
419
+
420
+ **Write state.json** (replaces research.json):
421
+
422
+ Use the Write tool to create `.aether/oracle/state.json`:
423
+
424
+ ```json
425
+ {
426
+ "version": "1.1",
427
+ "topic": "<the research topic>",
428
+ "scope": "<codebase|web|both>",
429
+ "template": "<template from Question 2: tech-eval|architecture-review|bug-investigation|best-practices|custom>",
430
+ "phase": "survey",
431
+ "iteration": 0,
432
+ "max_iterations": <number from depth choice>,
433
+ "target_confidence": <number from confidence choice>,
434
+ "overall_confidence": 0,
435
+ "started_at": "<ISO-8601 UTC timestamp>",
436
+ "last_updated": "<ISO-8601 UTC timestamp>",
437
+ "status": "active",
438
+ "strategy": "<strategy from Question 6: adaptive|breadth-first|depth-first>",
439
+ "focus_areas": [<array of focus area strings from Question 7, or empty array if no focus>]
440
+ }
441
+ ```
442
+
443
+ **Emit focus area pheromones** (if any focus areas were set):
444
+
445
+ For each focus area string from Question 7, run using the Bash tool with description "Emitting focus area pheromones...":
446
+
447
+ ```bash
448
+ bash .aether/aether-utils.sh pheromone-write FOCUS "$focus_area" \
449
+ --strength 0.8 --source "oracle:wizard" \
450
+ --reason "Focus area set in oracle wizard" --ttl "24h" 2>/dev/null || true
451
+ ```
452
+
453
+ **Write plan.json:**
454
+
455
+ **If template is NOT `custom`**, pre-populate plan.json with the template's default questions. **If template IS `custom`**, break the topic into 3-8 sub-questions (adapt to topic complexity -- broader topics get more questions, focused topics fewer).
456
+
457
+ Template default questions:
458
+
459
+ - **tech-eval**: q1 "What problem does this technology solve and what are its core capabilities?", q2 "How does it compare to alternative solutions?", q3 "What are its known limitations and tradeoffs?", q4 "What is the adoption and community status?", q5 "What is the migration or integration path?"
460
+ - **architecture-review**: q1 "What are the main components and their responsibilities?", q2 "What are the dependency relationships between components?", q3 "Where are the risk areas (coupling, complexity, single points of failure)?", q4 "How does it handle scale and growth?", q5 "What would an expert change about this architecture?"
461
+ - **bug-investigation**: q1 "What is the exact failure behavior?", q2 "What are the reproduction conditions?", q3 "What is the root cause?", q4 "What are possible fixes and their tradeoffs?", q5 "Are there related issues or regression risks?"
462
+ - **best-practices**: q1 "What is current industry best practice for this domain?", q2 "How does our implementation compare to best practice?", q3 "What gaps exist between our approach and best practice?", q4 "What is the recommended improvement path?"
463
+
464
+ Use the Write tool to create `.aether/oracle/plan.json`:
465
+
466
+ ```json
467
+ {
468
+ "version": "1.1",
469
+ "sources": {},
470
+ "questions": [
471
+ {
472
+ "id": "q1",
473
+ "text": "<question text from template or AI-decomposed>",
474
+ "status": "open",
475
+ "confidence": 0,
476
+ "key_findings": [],
477
+ "iterations_touched": []
478
+ }
479
+ ],
480
+ "created_at": "<ISO-8601 UTC timestamp>",
481
+ "last_updated": "<ISO-8601 UTC timestamp>"
482
+ }
483
+ ```
484
+
485
+ **Write gaps.md** (initial empty structure):
486
+
487
+ Use the Write tool to create `.aether/oracle/gaps.md`:
488
+
489
+ ```markdown
490
+ # Knowledge Gaps
491
+
492
+ ## Open Questions
493
+ (No research conducted yet)
494
+
495
+ ## Contradictions
496
+ (None identified)
497
+
498
+ ## Last Updated
499
+ Iteration 0 -- <ISO-8601 UTC timestamp>
500
+ ```
501
+
502
+ **Write synthesis.md** (initial empty structure):
503
+
504
+ Use the Write tool to create `.aether/oracle/synthesis.md`:
505
+
506
+ ```markdown
507
+ # Research Synthesis
508
+
509
+ ## Topic
510
+ <the research topic>
511
+
512
+ ## Findings by Question
513
+ (No findings yet -- research has not started)
514
+
515
+ ## Last Updated
516
+ Iteration 0 -- <ISO-8601 UTC timestamp>
517
+ ```
518
+
519
+ **Generate research-plan.md:**
520
+
521
+ After writing plan.json, generate research-plan.md as the executive summary. Use the Write tool to create `.aether/oracle/research-plan.md`:
522
+
523
+ ```markdown
524
+ # Research Plan
525
+
526
+ **Topic:** <topic>
527
+ **Status:** active | **Iteration:** 0 of <max>
528
+ **Overall Confidence:** 0%
529
+
530
+ ## Questions
531
+ | # | Question | Status | Confidence |
532
+ |---|----------|--------|------------|
533
+ | q1 | <question text> | open | 0% |
534
+ | q2 | ... | open | 0% |
535
+
536
+ ## Next Steps
537
+ Next investigation: <text of q1, the first question>
538
+
539
+ ---
540
+ *Generated from plan.json -- do not edit directly*
541
+ ```
542
+
543
+ #### Step 2.5: Verify Oracle Files Are Fresh
544
+
545
+ Verify that state.json, plan.json, gaps.md, synthesis.md, and research-plan.md were created successfully by running using the Bash tool with description "Verifying oracle files...":
546
+ ```bash
547
+ verify_result=$(bash .aether/aether-utils.sh session-verify-fresh --command oracle "" "$ORACLE_START")
548
+ fresh_count=$(echo "$verify_result" | jq -r '.fresh | length')
549
+
550
+ if [[ "$fresh_count" -lt 5 ]]; then
551
+ echo "Warning: Oracle files not properly initialized"
552
+ fi
553
+ ```
554
+
555
+ Proceed to Step 3.
556
+
557
+ ---
558
+
559
+ ### Step 3: Launch
560
+
561
+ Output the research configuration summary, showing the sub-questions from plan.json:
562
+
563
+ ```
564
+ 🔮 Research Configured
565
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
566
+
567
+ 📍 Topic: <topic>
568
+ 📐 Template: <template type, e.g. "tech-eval" or "custom">
569
+ 🔄 Iterations: <max_iterations>
570
+ 🎯 Confidence: <target_confidence>%
571
+ 🔍 Scope: <scope>
572
+ 📐 Strategy: <strategy>
573
+ 🎯 Focus: <focus areas comma-separated, or "None">
574
+
575
+ 📋 Sub-Questions:
576
+ q1. <question text from plan.json>
577
+ q2. <question text from plan.json>
578
+ q3. <question text from plan.json>
579
+
580
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
581
+ ```
582
+
583
+ Now launch the loop. Try tmux first, fall back to manual.
584
+
585
+ **Try tmux** by running using the Bash tool with description "Launching oracle in tmux...":
586
+
587
+ ```bash
588
+ tmux new-session -d -s oracle "cd $(pwd) && bash .aether/utils/oracle/oracle.sh; echo ''; echo '🔮🐜 Oracle loop finished. Press any key to close.'; read -n1" 2>/dev/null && echo "TMUX_OK" || echo "TMUX_FAIL"
589
+ ```
590
+
591
+ **If TMUX_OK:**
592
+
593
+ ```
594
+ 🔮🐜 Oracle Launched
595
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
596
+
597
+ The Oracle is researching in a background tmux session.
598
+
599
+ 👁️ Watch live: tmux attach -t oracle
600
+ 📊 Check status: /ant:oracle status
601
+ 🛑 Stop early: /ant:oracle stop
602
+
603
+ Research progress visible at .aether/oracle/research-plan.md
604
+ The Oracle will stop when it reaches {target_confidence}% confidence
605
+ or completes {max_iterations} iterations.
606
+
607
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
608
+
609
+ You can keep working. The Oracle runs independently.
610
+ ```
611
+
612
+ Stop here.
613
+
614
+ **If TMUX_FAIL** (tmux not installed or error):
615
+
616
+ ```
617
+ 🔮 Ready to Launch
618
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
619
+
620
+ tmux not available. Run this in a separate terminal:
621
+
622
+ cd {current_working_directory}
623
+ bash .aether/utils/oracle/oracle.sh
624
+
625
+ Then come back here:
626
+ 📊 Check status: /ant:oracle status
627
+ 🛑 Stop early: /ant:oracle stop
628
+
629
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
630
+ ```
631
+
632
+ Generate the state-based Next Up block by running using the Bash tool with description "Generating Next Up suggestions...":
633
+ ```bash
634
+ state=$(jq -r '.state // "IDLE"' .aether/data/COLONY_STATE.json)
635
+ current_phase=$(jq -r '.current_phase // 0' .aether/data/COLONY_STATE.json)
636
+ total_phases=$(jq -r '.plan.phases | length' .aether/data/COLONY_STATE.json)
637
+ bash .aether/aether-utils.sh print-next-up "$state" "$current_phase" "$total_phases"
638
+ ```
639
+
640
+ Stop here.
641
+
642
+ body_opencode: |
643
+ You are the **Oracle Ant** command handler. You configure and launch a deep research loop that runs autonomously in a separate process.
644
+
645
+ The user's input is: `$normalized_args`
646
+
647
+ ## Non-Invasive Guarantee
648
+
649
+ Oracle NEVER touches COLONY_STATE.json, constraints.json, activity.log, or any code files. Only writes to `.aether/oracle/`.
650
+
651
+ ## Instructions
652
+
653
+ ### Step 0: Parse Arguments and Route
654
+
655
+ Parse `$normalized_args` to determine the action:
656
+
657
+ 1. Check for flags:
658
+ - If contains `--no-visual`: set `visual_mode = false` (visual is ON by default)
659
+ - Otherwise: set `visual_mode = true`
660
+ - Remove flags from arguments before routing
661
+
662
+ 2. **If remaining arguments is exactly `stop`** — go to **Step 0b: Stop Oracle**
663
+ 3. **If remaining arguments is exactly `status`** — go to **Step 0c: Show Status**
664
+ 4. **If remaining arguments is exactly `promote`** — go to **Step 0d: Promote Findings**
665
+ 5. **Otherwise** — go to **Step 0.5: Initialize Visual Mode** then **Step 1: Research Wizard**
666
+
667
+ ### Step 0.5: Display Header
668
+
669
+ Display visual header:
670
+ ```
671
+ 🔮🐜🧠🐜🔮 ═══════════════════════════════════════════════
672
+ O R A C L E — R e s e a r c h M o d e
673
+ ═══════════════════════════════════════════════ 🔮🐜🧠🐜🔮
674
+
675
+ Oracle peering into the depths...
676
+ ```
677
+
678
+ ---
679
+
680
+ ### Step 0b: Stop Oracle
681
+
682
+ Create the stop signal file:
683
+
684
+ ```bash
685
+ mkdir -p .aether/oracle && touch .aether/oracle/.stop
686
+ ```
687
+
688
+ Output:
689
+
690
+ ```
691
+ 🔮 Oracle Stop Signal Sent
692
+
693
+ Created .aether/oracle/.stop
694
+ The research loop will halt at the end of the current iteration.
695
+
696
+ To check final results: /ant:oracle status
697
+ ```
698
+
699
+ Stop here. Do not proceed.
700
+
701
+ ---
702
+
703
+ ### Step 0c: Show Status
704
+
705
+ Check if `.aether/oracle/research-plan.md` exists using the Read tool.
706
+
707
+ **If it does NOT exist**, output:
708
+
709
+ ```
710
+ 🔮 Oracle Status: No Research In Progress
711
+
712
+ No active research session. Start one:
713
+ /ant:oracle
714
+ ```
715
+
716
+ Stop here.
717
+
718
+ **If it exists**, read `.aether/oracle/research-plan.md` and `.aether/oracle/state.json` (if present).
719
+
720
+ Output:
721
+
722
+ ```
723
+ 🔮 Oracle Status
724
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
725
+ Topic: {topic from state.json, or "unknown"}
726
+ Iteration: {iteration} of {max_iterations}
727
+ Status: {status}
728
+
729
+ {contents of research-plan.md}
730
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
731
+
732
+ /ant:oracle stop Halt the loop
733
+ /ant:oracle Start new research
734
+ ```
735
+
736
+ Stop here.
737
+
738
+ ---
739
+
740
+ ### Step 0d: Promote Findings to Colony
741
+
742
+ Check if `.aether/oracle/state.json` exists. If it does NOT exist, or if the status is "active", output:
743
+
744
+ ```
745
+ 🔮 Oracle Promote: No Completed Research
746
+
747
+ No completed research to promote. Run /ant:oracle first, then wait for completion.
748
+ ```
749
+
750
+ Stop here.
751
+
752
+ **If state.json exists and status is "complete" or "stopped":**
753
+
754
+ Read `.aether/oracle/plan.json` and extract high-confidence findings:
755
+
756
+ ```bash
757
+ ORACLE_DIR=".aether/oracle"
758
+ topic=$(jq -r '.topic // "unknown"' "$ORACLE_DIR/state.json")
759
+ status=$(jq -r '.status // "active"' "$ORACLE_DIR/state.json")
760
+ count=$(jq '[.questions[] | select(.status == "answered" and .confidence >= 80)] | length' "$ORACLE_DIR/plan.json" 2>/dev/null || echo "0")
761
+ total=$(jq '[.questions[]] | length' "$ORACLE_DIR/plan.json" 2>/dev/null || echo "0")
762
+ echo "TOPIC=$topic"
763
+ echo "STATUS=$status"
764
+ echo "QUALIFYING=$count"
765
+ echo "TOTAL=$total"
766
+ ```
767
+
768
+ If qualifying count is 0, output:
769
+
770
+ ```
771
+ 🔮 Oracle Promote: No Qualifying Findings
772
+
773
+ Topic: {topic}
774
+ Status: {status}
775
+ Findings: 0 of {total} questions meet the threshold (answered + 80%+ confidence)
776
+
777
+ Lower-confidence findings remain in .aether/oracle/synthesis.md for reference.
778
+ ```
779
+
780
+ Stop here.
781
+
782
+ **If qualifying count > 0**, display the summary and ask for confirmation:
783
+
784
+ ```
785
+ 🔮 Oracle Promote: Colony Knowledge Integration
786
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
787
+
788
+ Oracle Research: {topic}
789
+ Status: {status}
790
+ High-confidence findings: {count} (answering {count} of {total} questions)
791
+
792
+ These findings will be promoted to:
793
+ - Colony instincts (COLONY_STATE.json)
794
+ - Colony learnings (learnings.json)
795
+ - Observation pipeline (for queen-promote)
796
+
797
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
798
+ ```
799
+
800
+ Use AskUserQuestion to ask:
801
+
802
+ ```
803
+ Promote these findings to colony knowledge?
804
+ ```
805
+
806
+ Options:
807
+ 1. **Yes, promote all high-confidence findings** -- Push qualifying findings to colony instincts, learnings, and observations
808
+ 2. **No, skip promotion** -- Findings remain in .aether/oracle/ for reference only
809
+
810
+ **If user selects Yes:**
811
+
812
+ Run promotion. For each qualifying question, call the colony APIs directly:
813
+
814
+ ```bash
815
+ ORACLE_DIR=".aether/oracle"
816
+ UTILS=".aether/aether-utils.sh"
817
+ topic=$(jq -r '.topic // "unknown"' "$ORACLE_DIR/state.json")
818
+ promoted=0
819
+
820
+ while IFS= read -r question; do
821
+ q_text=$(echo "$question" | jq -r '.text')
822
+ q_confidence=$(echo "$question" | jq -r '.confidence')
823
+ findings_text=$(echo "$question" | jq -r '[.key_findings[].text // .key_findings[]] | join("; ")' 2>/dev/null | head -c 200)
824
+ first_finding=$(echo "$question" | jq -r '[.key_findings[].text // .key_findings[]] | first // "No findings"' 2>/dev/null)
825
+
826
+ bash "$UTILS" instinct-create \
827
+ --trigger "researching: $q_text" \
828
+ --action "Oracle found (${q_confidence}% confidence): $findings_text" \
829
+ --confidence "$(echo "scale=2; $q_confidence / 100" | bc)" \
830
+ --domain "research" \
831
+ --source "oracle:$topic" \
832
+ --evidence "Oracle research: $q_text" 2>/dev/null || true
833
+
834
+ bash "$UTILS" learning-promote \
835
+ "Oracle: $q_text -- $first_finding" \
836
+ "oracle" \
837
+ "oracle-research" \
838
+ "oracle,research" 2>/dev/null || true
839
+
840
+ bash "$UTILS" memory-capture learning \
841
+ "Oracle research finding: $q_text (${q_confidence}%)" \
842
+ "pattern" \
843
+ "oracle:promote" 2>/dev/null || true
844
+
845
+ promoted=$((promoted + 1))
846
+ done < <(jq -c '[.questions[] | select(.status == "answered" and .confidence >= 80)] | .[]' "$ORACLE_DIR/plan.json")
847
+
848
+ echo "Promoted $promoted findings"
849
+ ```
850
+
851
+ Output:
852
+
853
+ ```
854
+ 🔮 Oracle Promote: Complete
855
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
856
+
857
+ Promoted {count} findings to colony knowledge:
858
+ - Instincts created in COLONY_STATE.json
859
+ - Learnings stored in learnings.json
860
+ - Observations tracked for wisdom promotion
861
+
862
+ Run /ant:status to see colony knowledge updates.
863
+
864
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
865
+ ```
866
+
867
+ **If user selects No:**
868
+
869
+ ```
870
+ 🔮 Promotion skipped. Findings remain in .aether/oracle/synthesis.md.
871
+ ```
872
+
873
+ Stop here.
874
+
875
+ ---
876
+
877
+ ### Step 1: Research Wizard
878
+
879
+ This is the setup phase. The Oracle asks questions to configure the research before launching.
880
+
881
+ Output the header:
882
+
883
+ ```
884
+ 🔮🐜🧠🐜🔮 ═══════════════════════════════════════════════════
885
+ O R A C L E A N T — R E S E A R C H W I Z A R D
886
+ ═══════════════════════════════════════════════════ 🔮🐜🧠🐜🔮
887
+ ```
888
+
889
+ **If `$normalized_args` is not empty and not a subcommand**, use it as the initial topic suggestion. Otherwise, the topic will be asked in Question 1.
890
+
891
+ Now ask questions using AskUserQuestion. Ask them one at a time so each answer can inform the next question.
892
+
893
+ **Question 1: Research Topic**
894
+
895
+ If `$normalized_args` already contains a topic, skip this question and use that as the topic.
896
+
897
+ Otherwise ask:
898
+
899
+ ```
900
+ What should the Oracle research?
901
+ ```
902
+
903
+ Options:
904
+ 1. **Codebase analysis** — Deep dive into how this codebase works (architecture, patterns, conventions)
905
+ 2. **External research** — Research a technology, library, or concept using web search
906
+ 3. **Both** — Combine codebase exploration with external research
907
+
908
+ Then use a follow-up AskUserQuestion with a free-text prompt:
909
+
910
+ ```
911
+ Describe the research topic in detail. The more specific, the better the Oracle's results.
912
+ ```
913
+
914
+ (The user will type their topic via the "Other" free-text option.)
915
+
916
+ **Question 2: Research Template**
917
+
918
+ ```
919
+ What type of research is this?
920
+ ```
921
+
922
+ Options:
923
+ 1. **Technology evaluation** -- Compare and evaluate a technology, library, or tool
924
+ 2. **Architecture review** -- Analyze system design, components, and dependencies
925
+ 3. **Bug investigation** -- Track down and understand a specific bug or issue
926
+ 4. **Best practices** -- Research recommended approaches for a domain or technique
927
+ 5. **Custom research** -- Free-form research (Oracle decomposes the topic as it sees fit)
928
+
929
+ Map selection to template value: 1->tech-eval, 2->architecture-review, 3->bug-investigation, 4->best-practices, 5->custom
930
+
931
+ **Question 3: Research Depth**
932
+
933
+ ```
934
+ How deep should the Oracle go?
935
+ ```
936
+
937
+ Options:
938
+ 1. **Quick scan (5 iterations)** — Surface-level overview, fast results
939
+ 2. **Standard research (15 iterations)** — Thorough investigation, good balance
940
+ 3. **Deep dive (30 iterations)** — Exhaustive research, leaves no stone unturned
941
+ 4. **Marathon (50 iterations)** — Maximum depth, may take hours
942
+
943
+ **Question 4: Confidence Target**
944
+
945
+ ```
946
+ When should the Oracle consider the research complete?
947
+ ```
948
+
949
+ Options:
950
+ 1. **80% confidence** — Good enough for a first pass, stops early
951
+ 2. **90% confidence** — Solid understanding, most questions answered
952
+ 3. **95% confidence (recommended)** — Thorough, few gaps remaining
953
+ 4. **99% confidence** — Near-exhaustive, won't stop until almost everything is known
954
+
955
+ **Question 5: Research Scope** (only if topic involves codebase)
956
+
957
+ ```
958
+ Should the Oracle also search the web, or stay within the codebase?
959
+ ```
960
+
961
+ Options:
962
+ 1. **Codebase only** — Only use Glob, Grep, Read to explore local files
963
+ 2. **Codebase + web** — Also use WebSearch and WebFetch for docs, best practices, prior art
964
+ 3. **Web only** — Focus on external research (libraries, concepts, techniques)
965
+
966
+ **Question 6: Search Strategy**
967
+
968
+ (Ask this question for all research types.)
969
+
970
+ ```
971
+ How should the Oracle approach the research?
972
+ ```
973
+
974
+ Options:
975
+ 1. **Adaptive (recommended)** -- Oracle decides when to go broad vs deep based on research progress
976
+ 2. **Breadth-first** -- Cover all questions with initial findings before going deep on any single one
977
+ 3. **Depth-first** -- Pick the most important question and investigate it exhaustively before moving on
978
+
979
+ **Question 7: Focus Areas** (optional)
980
+
981
+ ```
982
+ Are there specific aspects you want the Oracle to prioritize?
983
+ ```
984
+
985
+ Options:
986
+ 1. **No specific focus** -- Let the Oracle decide what to investigate first
987
+ 2. **Yes, I have focus areas** -- I want to steer the research toward specific aspects
988
+
989
+ If the user selects option 2, ask a follow-up AskUserQuestion with free-text:
990
+
991
+ ```
992
+ List your focus areas (comma-separated). Example: "security implications, performance under load, migration path"
993
+ ```
994
+
995
+ Parse the comma-separated response into individual focus area strings.
996
+
997
+ After collecting all answers, proceed to Step 2.
998
+
999
+ ---
1000
+
1001
+ ### Step 2: Configure Research
1002
+
1003
+ Create the oracle directory structure:
1004
+
1005
+ ```bash
1006
+ mkdir -p .aether/oracle/archive .aether/oracle/discoveries
1007
+ ```
1008
+
1009
+ Generate an ISO-8601 UTC timestamp.
1010
+
1011
+ **Archive previous research if it exists:**
1012
+
1013
+ Check if `.aether/oracle/state.json` exists. If it does:
1014
+
1015
+ ```bash
1016
+ ARCHIVE_TS=$(date +%Y-%m-%d-%H%M%S)
1017
+ mkdir -p .aether/oracle/archive/$ARCHIVE_TS
1018
+ for f in state.json plan.json gaps.md synthesis.md research-plan.md; do
1019
+ [ -f ".aether/oracle/$f" ] && cp ".aether/oracle/$f" ".aether/oracle/archive/$ARCHIVE_TS/"
1020
+ done
1021
+ ```
1022
+
1023
+ **Write state.json** (replaces research.json):
1024
+
1025
+ Use the Write tool to create `.aether/oracle/state.json`:
1026
+
1027
+ ```json
1028
+ {
1029
+ "version": "1.1",
1030
+ "topic": "<the research topic>",
1031
+ "scope": "<codebase|web|both>",
1032
+ "template": "<template from Question 2: tech-eval|architecture-review|bug-investigation|best-practices|custom>",
1033
+ "phase": "survey",
1034
+ "iteration": 0,
1035
+ "max_iterations": <number from depth choice>,
1036
+ "target_confidence": <number from confidence choice>,
1037
+ "overall_confidence": 0,
1038
+ "started_at": "<ISO-8601 UTC timestamp>",
1039
+ "last_updated": "<ISO-8601 UTC timestamp>",
1040
+ "status": "active",
1041
+ "strategy": "<strategy from Question 6: adaptive|breadth-first|depth-first>",
1042
+ "focus_areas": [<array of focus area strings from Question 7, or empty array if no focus>]
1043
+ }
1044
+ ```
1045
+
1046
+ **Emit focus area pheromones** (if any focus areas were set):
1047
+
1048
+ For each focus area string from Question 7:
1049
+
1050
+ ```bash
1051
+ bash .aether/aether-utils.sh pheromone-write FOCUS "$focus_area" \
1052
+ --strength 0.8 --source "oracle:wizard" \
1053
+ --reason "Focus area set in oracle wizard" --ttl "24h" 2>/dev/null || true
1054
+ ```
1055
+
1056
+ **Write plan.json:**
1057
+
1058
+ **If template is NOT `custom`**, pre-populate plan.json with the template's default questions. **If template IS `custom`**, break the topic into 3-8 sub-questions (adapt to topic complexity -- broader topics get more questions, focused topics fewer).
1059
+
1060
+ Template default questions:
1061
+
1062
+ - **tech-eval**: q1 "What problem does this technology solve and what are its core capabilities?", q2 "How does it compare to alternative solutions?", q3 "What are its known limitations and tradeoffs?", q4 "What is the adoption and community status?", q5 "What is the migration or integration path?"
1063
+ - **architecture-review**: q1 "What are the main components and their responsibilities?", q2 "What are the dependency relationships between components?", q3 "Where are the risk areas (coupling, complexity, single points of failure)?", q4 "How does it handle scale and growth?", q5 "What would an expert change about this architecture?"
1064
+ - **bug-investigation**: q1 "What is the exact failure behavior?", q2 "What are the reproduction conditions?", q3 "What is the root cause?", q4 "What are possible fixes and their tradeoffs?", q5 "Are there related issues or regression risks?"
1065
+ - **best-practices**: q1 "What is current industry best practice for this domain?", q2 "How does our implementation compare to best practice?", q3 "What gaps exist between our approach and best practice?", q4 "What is the recommended improvement path?"
1066
+
1067
+ Use the Write tool to create `.aether/oracle/plan.json`:
1068
+
1069
+ ```json
1070
+ {
1071
+ "version": "1.1",
1072
+ "sources": {},
1073
+ "questions": [
1074
+ {
1075
+ "id": "q1",
1076
+ "text": "<question text from template or AI-decomposed>",
1077
+ "status": "open",
1078
+ "confidence": 0,
1079
+ "key_findings": [],
1080
+ "iterations_touched": []
1081
+ }
1082
+ ],
1083
+ "created_at": "<ISO-8601 UTC timestamp>",
1084
+ "last_updated": "<ISO-8601 UTC timestamp>"
1085
+ }
1086
+ ```
1087
+
1088
+ **Write gaps.md** (initial empty structure):
1089
+
1090
+ Use the Write tool to create `.aether/oracle/gaps.md`:
1091
+
1092
+ ```markdown
1093
+ # Knowledge Gaps
1094
+
1095
+ ## Open Questions
1096
+ (No research conducted yet)
1097
+
1098
+ ## Contradictions
1099
+ (None identified)
1100
+
1101
+ ## Last Updated
1102
+ Iteration 0 -- <ISO-8601 UTC timestamp>
1103
+ ```
1104
+
1105
+ **Write synthesis.md** (initial empty structure):
1106
+
1107
+ Use the Write tool to create `.aether/oracle/synthesis.md`:
1108
+
1109
+ ```markdown
1110
+ # Research Synthesis
1111
+
1112
+ ## Topic
1113
+ <the research topic>
1114
+
1115
+ ## Findings by Question
1116
+ (No findings yet -- research has not started)
1117
+
1118
+ ## Last Updated
1119
+ Iteration 0 -- <ISO-8601 UTC timestamp>
1120
+ ```
1121
+
1122
+ **Generate research-plan.md:**
1123
+
1124
+ After writing plan.json, generate research-plan.md as the executive summary. Use the Write tool to create `.aether/oracle/research-plan.md`:
1125
+
1126
+ ```markdown
1127
+ # Research Plan
1128
+
1129
+ **Topic:** <topic>
1130
+ **Status:** active | **Iteration:** 0 of <max>
1131
+ **Overall Confidence:** 0%
1132
+
1133
+ ## Questions
1134
+ | # | Question | Status | Confidence |
1135
+ |---|----------|--------|------------|
1136
+ | q1 | <question text> | open | 0% |
1137
+ | q2 | ... | open | 0% |
1138
+
1139
+ ## Next Steps
1140
+ Next investigation: <text of q1, the first question>
1141
+
1142
+ ---
1143
+ *Generated from plan.json -- do not edit directly*
1144
+ ```
1145
+
1146
+ Proceed to Step 3.
1147
+
1148
+ ---
1149
+
1150
+ ### Step 3: Launch
1151
+
1152
+ Output the research configuration summary, showing the sub-questions from plan.json:
1153
+
1154
+ ```
1155
+ 🔮 Research Configured
1156
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1157
+
1158
+ 📍 Topic: <topic>
1159
+ 📐 Template: <template type, e.g. "tech-eval" or "custom">
1160
+ 🔄 Iterations: <max_iterations>
1161
+ 🎯 Confidence: <target_confidence>%
1162
+ 🔍 Scope: <scope>
1163
+ 📐 Strategy: <strategy>
1164
+ 🎯 Focus: <focus areas comma-separated, or "None">
1165
+
1166
+ 📋 Sub-Questions:
1167
+ q1. <question text from plan.json>
1168
+ q2. <question text from plan.json>
1169
+ q3. <question text from plan.json>
1170
+
1171
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1172
+ ```
1173
+
1174
+ Now launch the loop. Try tmux first, fall back to manual.
1175
+
1176
+ **Try tmux:**
1177
+
1178
+ ```bash
1179
+ tmux new-session -d -s oracle "cd $(pwd) && bash .aether/utils/oracle/oracle.sh; echo ''; echo '🔮 Oracle loop finished. Press any key to close.'; read -n1" 2>/dev/null && echo "TMUX_OK" || echo "TMUX_FAIL"
1180
+ ```
1181
+
1182
+ **If TMUX_OK:**
1183
+
1184
+ ```
1185
+ 🔮 Oracle Launched
1186
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1187
+
1188
+ The Oracle is researching in a background tmux session.
1189
+
1190
+ 👁️ Watch live: tmux attach -t oracle
1191
+ 📊 Check status: /ant:oracle status
1192
+ 🛑 Stop early: /ant:oracle stop
1193
+
1194
+ Research progress visible at .aether/oracle/research-plan.md
1195
+ The Oracle will stop when it reaches {target_confidence}% confidence
1196
+ or completes {max_iterations} iterations.
1197
+
1198
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1199
+
1200
+ You can keep working. The Oracle runs independently.
1201
+ ```
1202
+
1203
+ Stop here.
1204
+
1205
+ **If TMUX_FAIL** (tmux not installed or error):
1206
+
1207
+ ```
1208
+ 🔮 Ready to Launch
1209
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1210
+
1211
+ tmux not available. Run this in a separate terminal:
1212
+
1213
+ cd {current_working_directory}
1214
+ bash .aether/utils/oracle/oracle.sh
1215
+
1216
+ Then come back here:
1217
+ 📊 Check status: /ant:oracle status
1218
+ 🛑 Stop early: /ant:oracle stop
1219
+
1220
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1221
+ ```
1222
+
1223
+ Stop here.
1224
+