aether-colony 5.1.0 → 5.3.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 (185) hide show
  1. package/.aether/aether-utils.sh +157 -42
  2. package/.aether/agents/aether-ambassador.md +140 -0
  3. package/.aether/agents/aether-archaeologist.md +108 -0
  4. package/.aether/agents/aether-architect.md +133 -0
  5. package/.aether/agents/aether-auditor.md +144 -0
  6. package/.aether/agents/aether-builder.md +184 -0
  7. package/.aether/agents/aether-chaos.md +115 -0
  8. package/.aether/agents/aether-chronicler.md +122 -0
  9. package/.aether/agents/aether-gatekeeper.md +116 -0
  10. package/.aether/agents/aether-includer.md +117 -0
  11. package/.aether/agents/aether-keeper.md +177 -0
  12. package/.aether/agents/aether-measurer.md +128 -0
  13. package/.aether/agents/aether-oracle.md +137 -0
  14. package/.aether/agents/aether-probe.md +133 -0
  15. package/.aether/agents/aether-queen.md +286 -0
  16. package/.aether/agents/aether-route-setter.md +130 -0
  17. package/.aether/agents/aether-sage.md +106 -0
  18. package/.aether/agents/aether-scout.md +101 -0
  19. package/.aether/agents/aether-surveyor-disciplines.md +391 -0
  20. package/.aether/agents/aether-surveyor-nest.md +329 -0
  21. package/.aether/agents/aether-surveyor-pathogens.md +264 -0
  22. package/.aether/agents/aether-surveyor-provisions.md +334 -0
  23. package/.aether/agents/aether-tracker.md +137 -0
  24. package/.aether/agents/aether-watcher.md +174 -0
  25. package/.aether/agents/aether-weaver.md +130 -0
  26. package/.aether/commands/claude/archaeology.md +334 -0
  27. package/.aether/commands/claude/build.md +65 -0
  28. package/.aether/commands/claude/chaos.md +336 -0
  29. package/.aether/commands/claude/colonize.md +259 -0
  30. package/.aether/commands/claude/continue.md +60 -0
  31. package/.aether/commands/claude/council.md +507 -0
  32. package/.aether/commands/claude/data-clean.md +81 -0
  33. package/.aether/commands/claude/dream.md +268 -0
  34. package/.aether/commands/claude/entomb.md +498 -0
  35. package/.aether/commands/claude/export-signals.md +57 -0
  36. package/.aether/commands/claude/feedback.md +96 -0
  37. package/.aether/commands/claude/flag.md +151 -0
  38. package/.aether/commands/claude/flags.md +169 -0
  39. package/.aether/commands/claude/focus.md +76 -0
  40. package/.aether/commands/claude/help.md +154 -0
  41. package/.aether/commands/claude/history.md +140 -0
  42. package/.aether/commands/claude/import-signals.md +71 -0
  43. package/.aether/commands/claude/init.md +505 -0
  44. package/.aether/commands/claude/insert-phase.md +105 -0
  45. package/.aether/commands/claude/interpret.md +278 -0
  46. package/.aether/commands/claude/lay-eggs.md +210 -0
  47. package/.aether/commands/claude/maturity.md +113 -0
  48. package/.aether/commands/claude/memory-details.md +77 -0
  49. package/.aether/commands/claude/migrate-state.md +171 -0
  50. package/.aether/commands/claude/oracle.md +642 -0
  51. package/.aether/commands/claude/organize.md +232 -0
  52. package/.aether/commands/claude/patrol.md +620 -0
  53. package/.aether/commands/claude/pause-colony.md +233 -0
  54. package/.aether/commands/claude/phase.md +115 -0
  55. package/.aether/commands/claude/pheromones.md +156 -0
  56. package/.aether/commands/claude/plan.md +693 -0
  57. package/.aether/commands/claude/preferences.md +65 -0
  58. package/.aether/commands/claude/quick.md +100 -0
  59. package/.aether/commands/claude/redirect.md +76 -0
  60. package/.aether/commands/claude/resume-colony.md +197 -0
  61. package/.aether/commands/claude/resume.md +388 -0
  62. package/.aether/commands/claude/run.md +231 -0
  63. package/.aether/commands/claude/seal.md +774 -0
  64. package/.aether/commands/claude/skill-create.md +286 -0
  65. package/.aether/commands/claude/status.md +410 -0
  66. package/.aether/commands/claude/swarm.md +349 -0
  67. package/.aether/commands/claude/tunnels.md +426 -0
  68. package/.aether/commands/claude/update.md +132 -0
  69. package/.aether/commands/claude/verify-castes.md +143 -0
  70. package/.aether/commands/claude/watch.md +239 -0
  71. package/.aether/commands/colonize.yaml +4 -0
  72. package/.aether/commands/council.yaml +205 -0
  73. package/.aether/commands/init.yaml +46 -13
  74. package/.aether/commands/insert-phase.yaml +4 -0
  75. package/.aether/commands/opencode/archaeology.md +331 -0
  76. package/.aether/commands/opencode/build.md +1168 -0
  77. package/.aether/commands/opencode/chaos.md +329 -0
  78. package/.aether/commands/opencode/colonize.md +195 -0
  79. package/.aether/commands/opencode/continue.md +1436 -0
  80. package/.aether/commands/opencode/council.md +437 -0
  81. package/.aether/commands/opencode/data-clean.md +77 -0
  82. package/.aether/commands/opencode/dream.md +260 -0
  83. package/.aether/commands/opencode/entomb.md +377 -0
  84. package/.aether/commands/opencode/export-signals.md +54 -0
  85. package/.aether/commands/opencode/feedback.md +99 -0
  86. package/.aether/commands/opencode/flag.md +149 -0
  87. package/.aether/commands/opencode/flags.md +167 -0
  88. package/.aether/commands/opencode/focus.md +73 -0
  89. package/.aether/commands/opencode/help.md +157 -0
  90. package/.aether/commands/opencode/history.md +136 -0
  91. package/.aether/commands/opencode/import-signals.md +68 -0
  92. package/.aether/commands/opencode/init.md +518 -0
  93. package/.aether/commands/opencode/insert-phase.md +111 -0
  94. package/.aether/commands/opencode/interpret.md +272 -0
  95. package/.aether/commands/opencode/lay-eggs.md +213 -0
  96. package/.aether/commands/opencode/maturity.md +108 -0
  97. package/.aether/commands/opencode/memory-details.md +83 -0
  98. package/.aether/commands/opencode/migrate-state.md +165 -0
  99. package/.aether/commands/opencode/oracle.md +593 -0
  100. package/.aether/commands/opencode/organize.md +226 -0
  101. package/.aether/commands/opencode/patrol.md +626 -0
  102. package/.aether/commands/opencode/pause-colony.md +203 -0
  103. package/.aether/commands/opencode/phase.md +113 -0
  104. package/.aether/commands/opencode/pheromones.md +162 -0
  105. package/.aether/commands/opencode/plan.md +684 -0
  106. package/.aether/commands/opencode/preferences.md +71 -0
  107. package/.aether/commands/opencode/quick.md +91 -0
  108. package/.aether/commands/opencode/redirect.md +84 -0
  109. package/.aether/commands/opencode/resume-colony.md +190 -0
  110. package/.aether/commands/opencode/resume.md +394 -0
  111. package/.aether/commands/opencode/run.md +237 -0
  112. package/.aether/commands/opencode/seal.md +452 -0
  113. package/.aether/commands/opencode/skill-create.md +63 -0
  114. package/.aether/commands/opencode/status.md +307 -0
  115. package/.aether/commands/opencode/swarm.md +15 -0
  116. package/.aether/commands/opencode/tunnels.md +400 -0
  117. package/.aether/commands/opencode/update.md +127 -0
  118. package/.aether/commands/opencode/verify-castes.md +139 -0
  119. package/.aether/commands/opencode/watch.md +227 -0
  120. package/.aether/commands/plan.yaml +53 -2
  121. package/.aether/commands/quick.yaml +104 -0
  122. package/.aether/commands/resume-colony.yaml +6 -4
  123. package/.aether/commands/resume.yaml +9 -0
  124. package/.aether/commands/run.yaml +37 -1
  125. package/.aether/commands/seal.yaml +9 -0
  126. package/.aether/commands/status.yaml +45 -1
  127. package/.aether/docs/command-playbooks/build-full.md +3 -2
  128. package/.aether/docs/command-playbooks/build-prep.md +12 -4
  129. package/.aether/docs/command-playbooks/build-verify.md +51 -0
  130. package/.aether/docs/command-playbooks/continue-advance.md +115 -6
  131. package/.aether/docs/command-playbooks/continue-full.md +1 -0
  132. package/.aether/docs/command-playbooks/continue-verify.md +33 -0
  133. package/.aether/utils/clash-detect.sh +239 -0
  134. package/.aether/utils/council.sh +425 -0
  135. package/.aether/utils/error-handler.sh +3 -3
  136. package/.aether/utils/flag.sh +23 -12
  137. package/.aether/utils/hive.sh +2 -2
  138. package/.aether/utils/hooks/clash-pre-tool-use.js +99 -0
  139. package/.aether/utils/immune.sh +508 -0
  140. package/.aether/utils/learning.sh +2 -2
  141. package/.aether/utils/merge-driver-lockfile.sh +35 -0
  142. package/.aether/utils/midden.sh +712 -0
  143. package/.aether/utils/pheromone.sh +1376 -108
  144. package/.aether/utils/queen.sh +31 -21
  145. package/.aether/utils/session.sh +264 -0
  146. package/.aether/utils/spawn-tree.sh +7 -7
  147. package/.aether/utils/spawn.sh +2 -2
  148. package/.aether/utils/state-api.sh +216 -5
  149. package/.aether/utils/swarm.sh +1 -1
  150. package/.aether/utils/worktree.sh +189 -0
  151. package/.claude/commands/ant/colonize.md +2 -0
  152. package/.claude/commands/ant/council.md +205 -0
  153. package/.claude/commands/ant/init.md +53 -14
  154. package/.claude/commands/ant/insert-phase.md +4 -0
  155. package/.claude/commands/ant/plan.md +27 -1
  156. package/.claude/commands/ant/quick.md +100 -0
  157. package/.claude/commands/ant/resume-colony.md +3 -2
  158. package/.claude/commands/ant/resume.md +9 -0
  159. package/.claude/commands/ant/run.md +37 -1
  160. package/.claude/commands/ant/seal.md +9 -0
  161. package/.claude/commands/ant/status.md +45 -1
  162. package/.opencode/commands/ant/colonize.md +2 -0
  163. package/.opencode/commands/ant/council.md +143 -0
  164. package/.opencode/commands/ant/init.md +53 -13
  165. package/.opencode/commands/ant/insert-phase.md +4 -0
  166. package/.opencode/commands/ant/plan.md +26 -1
  167. package/.opencode/commands/ant/quick.md +91 -0
  168. package/.opencode/commands/ant/resume-colony.md +3 -2
  169. package/.opencode/commands/ant/resume.md +9 -0
  170. package/.opencode/commands/ant/run.md +37 -1
  171. package/.opencode/commands/ant/status.md +2 -0
  172. package/CHANGELOG.md +116 -0
  173. package/README.md +34 -8
  174. package/bin/cli.js +103 -61
  175. package/bin/lib/banner.js +14 -0
  176. package/bin/lib/init.js +8 -7
  177. package/bin/lib/interactive-setup.js +251 -0
  178. package/bin/npx-entry.js +21 -0
  179. package/bin/npx-install.js +9 -167
  180. package/bin/validate-package.sh +23 -0
  181. package/package.json +11 -3
  182. package/.aether/docs/plans/pheromone-display-plan.md +0 -257
  183. package/.aether/schemas/example-prompt-builder.xml +0 -234
  184. package/.aether/scripts/incident-test-add.sh +0 -47
  185. package/.aether/scripts/weekly-audit.sh +0 -79
@@ -0,0 +1,593 @@
1
+ <!-- Generated from .aether/commands/oracle.yaml - DO NOT EDIT DIRECTLY -->
2
+ ---
3
+ name: ant:oracle
4
+ description: "🔮🐜🧠🐜🔮 Oracle Ant - deep research agent using RALF iterative loop pattern"
5
+ ---
6
+
7
+ ### Step -1: Normalize Arguments
8
+
9
+ Run: `normalized_args=$(bash .aether/aether-utils.sh normalize-args "$@")`
10
+
11
+ This ensures arguments work correctly in both Claude Code and OpenCode. Use `$normalized_args` throughout this command.
12
+
13
+ You are the **Oracle Ant** command handler. You configure and launch a deep research loop that runs autonomously in a separate process.
14
+
15
+ The user's input is: `$normalized_args`
16
+
17
+ ## Non-Invasive Guarantee
18
+
19
+ Oracle NEVER touches COLONY_STATE.json, constraints.json, activity.log, or any code files. Only writes to `.aether/oracle/`.
20
+
21
+ ## Instructions
22
+
23
+ ### Step 0: Parse Arguments and Route
24
+
25
+ Parse `$normalized_args` to determine the action:
26
+
27
+ 1. Check for flags:
28
+ - If contains `--no-visual`: set `visual_mode = false` (visual is ON by default)
29
+ - Otherwise: set `visual_mode = true`
30
+ - Remove flags from arguments before routing
31
+
32
+ 2. **If remaining arguments is exactly `stop`** — go to **Step 0b: Stop Oracle**
33
+ 3. **If remaining arguments is exactly `status`** — go to **Step 0c: Show Status**
34
+ 4. **If remaining arguments is exactly `promote`** — go to **Step 0d: Promote Findings**
35
+ 5. **Otherwise** — go to **Step 0.5: Initialize Visual Mode** then **Step 1: Research Wizard**
36
+
37
+ ### Step 0.5: Display Header
38
+
39
+ Display visual header:
40
+ ```
41
+ 🔮🐜🧠🐜🔮 ═══════════════════════════════════════════════
42
+ O R A C L E — R e s e a r c h M o d e
43
+ ═══════════════════════════════════════════════ 🔮🐜🧠🐜🔮
44
+
45
+ Oracle peering into the depths...
46
+ ```
47
+
48
+ ---
49
+
50
+ ### Step 0b: Stop Oracle
51
+
52
+ Create the stop signal file:
53
+
54
+ ```bash
55
+ mkdir -p .aether/oracle && touch .aether/oracle/.stop
56
+ ```
57
+
58
+ Output:
59
+
60
+ ```
61
+ 🔮 Oracle Stop Signal Sent
62
+
63
+ Created .aether/oracle/.stop
64
+ The research loop will halt at the end of the current iteration.
65
+
66
+ To check final results: /ant:oracle status
67
+ ```
68
+
69
+ Stop here. Do not proceed.
70
+
71
+ ---
72
+
73
+ ### Step 0c: Show Status
74
+
75
+ Check if `.aether/oracle/research-plan.md` exists using the Read tool.
76
+
77
+ **If it does NOT exist**, output:
78
+
79
+ ```
80
+ 🔮 Oracle Status: No Research In Progress
81
+
82
+ No active research session. Start one:
83
+ /ant:oracle
84
+ ```
85
+
86
+ Stop here.
87
+
88
+ **If it exists**, read `.aether/oracle/research-plan.md` and `.aether/oracle/state.json` (if present).
89
+
90
+ Output:
91
+
92
+ ```
93
+ 🔮 Oracle Status
94
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
95
+ Topic: {topic from state.json, or "unknown"}
96
+ Iteration: {iteration} of {max_iterations}
97
+ Status: {status}
98
+
99
+ {contents of research-plan.md}
100
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
101
+
102
+ /ant:oracle stop Halt the loop
103
+ /ant:oracle Start new research
104
+ ```
105
+
106
+ Stop here.
107
+
108
+ ---
109
+
110
+ ### Step 0d: Promote Findings to Colony
111
+
112
+ Check if `.aether/oracle/state.json` exists. If it does NOT exist, or if the status is "active", output:
113
+
114
+ ```
115
+ 🔮 Oracle Promote: No Completed Research
116
+
117
+ No completed research to promote. Run /ant:oracle first, then wait for completion.
118
+ ```
119
+
120
+ Stop here.
121
+
122
+ **If state.json exists and status is "complete" or "stopped":**
123
+
124
+ Read `.aether/oracle/plan.json` and extract high-confidence findings:
125
+
126
+ ```bash
127
+ ORACLE_DIR=".aether/oracle"
128
+ topic=$(jq -r '.topic // "unknown"' "$ORACLE_DIR/state.json")
129
+ status=$(jq -r '.status // "active"' "$ORACLE_DIR/state.json")
130
+ count=$(jq '[.questions[] | select(.status == "answered" and .confidence >= 80)] | length' "$ORACLE_DIR/plan.json" 2>/dev/null || echo "0")
131
+ total=$(jq '[.questions[]] | length' "$ORACLE_DIR/plan.json" 2>/dev/null || echo "0")
132
+ echo "TOPIC=$topic"
133
+ echo "STATUS=$status"
134
+ echo "QUALIFYING=$count"
135
+ echo "TOTAL=$total"
136
+ ```
137
+
138
+ If qualifying count is 0, output:
139
+
140
+ ```
141
+ 🔮 Oracle Promote: No Qualifying Findings
142
+
143
+ Topic: {topic}
144
+ Status: {status}
145
+ Findings: 0 of {total} questions meet the threshold (answered + 80%+ confidence)
146
+
147
+ Lower-confidence findings remain in .aether/oracle/synthesis.md for reference.
148
+ ```
149
+
150
+ Stop here.
151
+
152
+ **If qualifying count > 0**, display the summary and ask for confirmation:
153
+
154
+ ```
155
+ 🔮 Oracle Promote: Colony Knowledge Integration
156
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
157
+
158
+ Oracle Research: {topic}
159
+ Status: {status}
160
+ High-confidence findings: {count} (answering {count} of {total} questions)
161
+
162
+ These findings will be promoted to:
163
+ - Colony instincts (COLONY_STATE.json)
164
+ - Colony learnings (learnings.json)
165
+ - Observation pipeline (for queen-promote)
166
+
167
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
168
+ ```
169
+
170
+ Use AskUserQuestion to ask:
171
+
172
+ ```
173
+ Promote these findings to colony knowledge?
174
+ ```
175
+
176
+ Options:
177
+ 1. **Yes, promote all high-confidence findings** -- Push qualifying findings to colony instincts, learnings, and observations
178
+ 2. **No, skip promotion** -- Findings remain in .aether/oracle/ for reference only
179
+
180
+ **If user selects Yes:**
181
+
182
+ Run promotion. For each qualifying question, call the colony APIs directly:
183
+
184
+ ```bash
185
+ ORACLE_DIR=".aether/oracle"
186
+ UTILS=".aether/aether-utils.sh"
187
+ topic=$(jq -r '.topic // "unknown"' "$ORACLE_DIR/state.json")
188
+ promoted=0
189
+
190
+ while IFS= read -r question; do
191
+ q_text=$(echo "$question" | jq -r '.text')
192
+ q_confidence=$(echo "$question" | jq -r '.confidence')
193
+ findings_text=$(echo "$question" | jq -r '[.key_findings[].text // .key_findings[]] | join("; ")' 2>/dev/null | head -c 200)
194
+ first_finding=$(echo "$question" | jq -r '[.key_findings[].text // .key_findings[]] | first // "No findings"' 2>/dev/null)
195
+
196
+ bash "$UTILS" instinct-create \
197
+ --trigger "researching: $q_text" \
198
+ --action "Oracle found (${q_confidence}% confidence): $findings_text" \
199
+ --confidence "$(echo "scale=2; $q_confidence / 100" | bc)" \
200
+ --domain "research" \
201
+ --source "oracle:$topic" \
202
+ --evidence "Oracle research: $q_text" 2>/dev/null || true
203
+
204
+ bash "$UTILS" learning-promote \
205
+ "Oracle: $q_text -- $first_finding" \
206
+ "oracle" \
207
+ "oracle-research" \
208
+ "oracle,research" 2>/dev/null || true
209
+
210
+ bash "$UTILS" memory-capture learning \
211
+ "Oracle research finding: $q_text (${q_confidence}%)" \
212
+ "pattern" \
213
+ "oracle:promote" 2>/dev/null || true
214
+
215
+ promoted=$((promoted + 1))
216
+ done < <(jq -c '[.questions[] | select(.status == "answered" and .confidence >= 80)] | .[]' "$ORACLE_DIR/plan.json")
217
+
218
+ echo "Promoted $promoted findings"
219
+ ```
220
+
221
+ Output:
222
+
223
+ ```
224
+ 🔮 Oracle Promote: Complete
225
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
226
+
227
+ Promoted {count} findings to colony knowledge:
228
+ - Instincts created in COLONY_STATE.json
229
+ - Learnings stored in learnings.json
230
+ - Observations tracked for wisdom promotion
231
+
232
+ Run /ant:status to see colony knowledge updates.
233
+
234
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
235
+ ```
236
+
237
+ **If user selects No:**
238
+
239
+ ```
240
+ 🔮 Promotion skipped. Findings remain in .aether/oracle/synthesis.md.
241
+ ```
242
+
243
+ Stop here.
244
+
245
+ ---
246
+
247
+ ### Step 1: Research Wizard
248
+
249
+ This is the setup phase. The Oracle asks questions to configure the research before launching.
250
+
251
+ Output the header:
252
+
253
+ ```
254
+ 🔮🐜🧠🐜🔮 ═══════════════════════════════════════════════════
255
+ O R A C L E A N T — R E S E A R C H W I Z A R D
256
+ ═══════════════════════════════════════════════════ 🔮🐜🧠🐜🔮
257
+ ```
258
+
259
+ **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.
260
+
261
+ Now ask questions using AskUserQuestion. Ask them one at a time so each answer can inform the next question.
262
+
263
+ **Question 1: Research Topic**
264
+
265
+ If `$normalized_args` already contains a topic, skip this question and use that as the topic.
266
+
267
+ Otherwise ask:
268
+
269
+ ```
270
+ What should the Oracle research?
271
+ ```
272
+
273
+ Options:
274
+ 1. **Codebase analysis** — Deep dive into how this codebase works (architecture, patterns, conventions)
275
+ 2. **External research** — Research a technology, library, or concept using web search
276
+ 3. **Both** — Combine codebase exploration with external research
277
+
278
+ Then use a follow-up AskUserQuestion with a free-text prompt:
279
+
280
+ ```
281
+ Describe the research topic in detail. The more specific, the better the Oracle's results.
282
+ ```
283
+
284
+ (The user will type their topic via the "Other" free-text option.)
285
+
286
+ **Question 2: Research Template**
287
+
288
+ ```
289
+ What type of research is this?
290
+ ```
291
+
292
+ Options:
293
+ 1. **Technology evaluation** -- Compare and evaluate a technology, library, or tool
294
+ 2. **Architecture review** -- Analyze system design, components, and dependencies
295
+ 3. **Bug investigation** -- Track down and understand a specific bug or issue
296
+ 4. **Best practices** -- Research recommended approaches for a domain or technique
297
+ 5. **Custom research** -- Free-form research (Oracle decomposes the topic as it sees fit)
298
+
299
+ Map selection to template value: 1->tech-eval, 2->architecture-review, 3->bug-investigation, 4->best-practices, 5->custom
300
+
301
+ **Question 3: Research Depth**
302
+
303
+ ```
304
+ How deep should the Oracle go?
305
+ ```
306
+
307
+ Options:
308
+ 1. **Quick scan (5 iterations)** — Surface-level overview, fast results
309
+ 2. **Standard research (15 iterations)** — Thorough investigation, good balance
310
+ 3. **Deep dive (30 iterations)** — Exhaustive research, leaves no stone unturned
311
+ 4. **Marathon (50 iterations)** — Maximum depth, may take hours
312
+
313
+ **Question 4: Confidence Target**
314
+
315
+ ```
316
+ When should the Oracle consider the research complete?
317
+ ```
318
+
319
+ Options:
320
+ 1. **80% confidence** — Good enough for a first pass, stops early
321
+ 2. **90% confidence** — Solid understanding, most questions answered
322
+ 3. **95% confidence (recommended)** — Thorough, few gaps remaining
323
+ 4. **99% confidence** — Near-exhaustive, won't stop until almost everything is known
324
+
325
+ **Question 5: Research Scope** (only if topic involves codebase)
326
+
327
+ ```
328
+ Should the Oracle also search the web, or stay within the codebase?
329
+ ```
330
+
331
+ Options:
332
+ 1. **Codebase only** — Only use Glob, Grep, Read to explore local files
333
+ 2. **Codebase + web** — Also use WebSearch and WebFetch for docs, best practices, prior art
334
+ 3. **Web only** — Focus on external research (libraries, concepts, techniques)
335
+
336
+ **Question 6: Search Strategy**
337
+
338
+ (Ask this question for all research types.)
339
+
340
+ ```
341
+ How should the Oracle approach the research?
342
+ ```
343
+
344
+ Options:
345
+ 1. **Adaptive (recommended)** -- Oracle decides when to go broad vs deep based on research progress
346
+ 2. **Breadth-first** -- Cover all questions with initial findings before going deep on any single one
347
+ 3. **Depth-first** -- Pick the most important question and investigate it exhaustively before moving on
348
+
349
+ **Question 7: Focus Areas** (optional)
350
+
351
+ ```
352
+ Are there specific aspects you want the Oracle to prioritize?
353
+ ```
354
+
355
+ Options:
356
+ 1. **No specific focus** -- Let the Oracle decide what to investigate first
357
+ 2. **Yes, I have focus areas** -- I want to steer the research toward specific aspects
358
+
359
+ If the user selects option 2, ask a follow-up AskUserQuestion with free-text:
360
+
361
+ ```
362
+ List your focus areas (comma-separated). Example: "security implications, performance under load, migration path"
363
+ ```
364
+
365
+ Parse the comma-separated response into individual focus area strings.
366
+
367
+ After collecting all answers, proceed to Step 2.
368
+
369
+ ---
370
+
371
+ ### Step 2: Configure Research
372
+
373
+ Create the oracle directory structure:
374
+
375
+ ```bash
376
+ mkdir -p .aether/oracle/archive .aether/oracle/discoveries
377
+ ```
378
+
379
+ Generate an ISO-8601 UTC timestamp.
380
+
381
+ **Archive previous research if it exists:**
382
+
383
+ Check if `.aether/oracle/state.json` exists. If it does:
384
+
385
+ ```bash
386
+ ARCHIVE_TS=$(date +%Y-%m-%d-%H%M%S)
387
+ mkdir -p .aether/oracle/archive/$ARCHIVE_TS
388
+ for f in state.json plan.json gaps.md synthesis.md research-plan.md; do
389
+ [ -f ".aether/oracle/$f" ] && cp ".aether/oracle/$f" ".aether/oracle/archive/$ARCHIVE_TS/"
390
+ done
391
+ ```
392
+
393
+ **Write state.json** (replaces research.json):
394
+
395
+ Use the Write tool to create `.aether/oracle/state.json`:
396
+
397
+ ```json
398
+ {
399
+ "version": "1.1",
400
+ "topic": "<the research topic>",
401
+ "scope": "<codebase|web|both>",
402
+ "template": "<template from Question 2: tech-eval|architecture-review|bug-investigation|best-practices|custom>",
403
+ "phase": "survey",
404
+ "iteration": 0,
405
+ "max_iterations": <number from depth choice>,
406
+ "target_confidence": <number from confidence choice>,
407
+ "overall_confidence": 0,
408
+ "started_at": "<ISO-8601 UTC timestamp>",
409
+ "last_updated": "<ISO-8601 UTC timestamp>",
410
+ "status": "active",
411
+ "strategy": "<strategy from Question 6: adaptive|breadth-first|depth-first>",
412
+ "focus_areas": [<array of focus area strings from Question 7, or empty array if no focus>]
413
+ }
414
+ ```
415
+
416
+ **Emit focus area pheromones** (if any focus areas were set):
417
+
418
+ For each focus area string from Question 7:
419
+
420
+ ```bash
421
+ bash .aether/aether-utils.sh pheromone-write FOCUS "$focus_area" \
422
+ --strength 0.8 --source "oracle:wizard" \
423
+ --reason "Focus area set in oracle wizard" --ttl "24h" 2>/dev/null || true
424
+ ```
425
+
426
+ **Write plan.json:**
427
+
428
+ **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).
429
+
430
+ Template default questions:
431
+
432
+ - **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?"
433
+ - **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?"
434
+ - **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?"
435
+ - **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?"
436
+
437
+ Use the Write tool to create `.aether/oracle/plan.json`:
438
+
439
+ ```json
440
+ {
441
+ "version": "1.1",
442
+ "sources": {},
443
+ "questions": [
444
+ {
445
+ "id": "q1",
446
+ "text": "<question text from template or AI-decomposed>",
447
+ "status": "open",
448
+ "confidence": 0,
449
+ "key_findings": [],
450
+ "iterations_touched": []
451
+ }
452
+ ],
453
+ "created_at": "<ISO-8601 UTC timestamp>",
454
+ "last_updated": "<ISO-8601 UTC timestamp>"
455
+ }
456
+ ```
457
+
458
+ **Write gaps.md** (initial empty structure):
459
+
460
+ Use the Write tool to create `.aether/oracle/gaps.md`:
461
+
462
+ ```markdown
463
+ # Knowledge Gaps
464
+
465
+ ## Open Questions
466
+ (No research conducted yet)
467
+
468
+ ## Contradictions
469
+ (None identified)
470
+
471
+ ## Last Updated
472
+ Iteration 0 -- <ISO-8601 UTC timestamp>
473
+ ```
474
+
475
+ **Write synthesis.md** (initial empty structure):
476
+
477
+ Use the Write tool to create `.aether/oracle/synthesis.md`:
478
+
479
+ ```markdown
480
+ # Research Synthesis
481
+
482
+ ## Topic
483
+ <the research topic>
484
+
485
+ ## Findings by Question
486
+ (No findings yet -- research has not started)
487
+
488
+ ## Last Updated
489
+ Iteration 0 -- <ISO-8601 UTC timestamp>
490
+ ```
491
+
492
+ **Generate research-plan.md:**
493
+
494
+ After writing plan.json, generate research-plan.md as the executive summary. Use the Write tool to create `.aether/oracle/research-plan.md`:
495
+
496
+ ```markdown
497
+ # Research Plan
498
+
499
+ **Topic:** <topic>
500
+ **Status:** active | **Iteration:** 0 of <max>
501
+ **Overall Confidence:** 0%
502
+
503
+ ## Questions
504
+ | # | Question | Status | Confidence |
505
+ |---|----------|--------|------------|
506
+ | q1 | <question text> | open | 0% |
507
+ | q2 | ... | open | 0% |
508
+
509
+ ## Next Steps
510
+ Next investigation: <text of q1, the first question>
511
+
512
+ ---
513
+ *Generated from plan.json -- do not edit directly*
514
+ ```
515
+
516
+ Proceed to Step 3.
517
+
518
+ ---
519
+
520
+ ### Step 3: Launch
521
+
522
+ Output the research configuration summary, showing the sub-questions from plan.json:
523
+
524
+ ```
525
+ 🔮 Research Configured
526
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
527
+
528
+ 📍 Topic: <topic>
529
+ 📐 Template: <template type, e.g. "tech-eval" or "custom">
530
+ 🔄 Iterations: <max_iterations>
531
+ 🎯 Confidence: <target_confidence>%
532
+ 🔍 Scope: <scope>
533
+ 📐 Strategy: <strategy>
534
+ 🎯 Focus: <focus areas comma-separated, or "None">
535
+
536
+ 📋 Sub-Questions:
537
+ q1. <question text from plan.json>
538
+ q2. <question text from plan.json>
539
+ q3. <question text from plan.json>
540
+
541
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
542
+ ```
543
+
544
+ Now launch the loop. Try tmux first, fall back to manual.
545
+
546
+ **Try tmux:**
547
+
548
+ ```bash
549
+ 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"
550
+ ```
551
+
552
+ **If TMUX_OK:**
553
+
554
+ ```
555
+ 🔮 Oracle Launched
556
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
557
+
558
+ The Oracle is researching in a background tmux session.
559
+
560
+ 👁️ Watch live: tmux attach -t oracle
561
+ 📊 Check status: /ant:oracle status
562
+ 🛑 Stop early: /ant:oracle stop
563
+
564
+ Research progress visible at .aether/oracle/research-plan.md
565
+ The Oracle will stop when it reaches {target_confidence}% confidence
566
+ or completes {max_iterations} iterations.
567
+
568
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
569
+
570
+ You can keep working. The Oracle runs independently.
571
+ ```
572
+
573
+ Stop here.
574
+
575
+ **If TMUX_FAIL** (tmux not installed or error):
576
+
577
+ ```
578
+ 🔮 Ready to Launch
579
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
580
+
581
+ tmux not available. Run this in a separate terminal:
582
+
583
+ cd {current_working_directory}
584
+ bash .aether/utils/oracle/oracle.sh
585
+
586
+ Then come back here:
587
+ 📊 Check status: /ant:oracle status
588
+ 🛑 Stop early: /ant:oracle stop
589
+
590
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
591
+ ```
592
+
593
+ Stop here.