aether-colony 5.3.2 → 5.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (281) hide show
  1. package/.aether/aether-utils.sh +181 -5
  2. package/.aether/commands/archaeology.yaml +3 -3
  3. package/.aether/commands/build.yaml +80 -45
  4. package/.aether/commands/chaos.yaml +7 -7
  5. package/.aether/commands/colonize.yaml +17 -17
  6. package/.aether/commands/continue.yaml +40 -40
  7. package/.aether/commands/council.yaml +6 -6
  8. package/.aether/commands/data-clean.yaml +3 -3
  9. package/.aether/commands/dream.yaml +2 -2
  10. package/.aether/commands/entomb.yaml +12 -12
  11. package/.aether/commands/export-signals.yaml +2 -2
  12. package/.aether/commands/feedback.yaml +6 -6
  13. package/.aether/commands/flag.yaml +2 -2
  14. package/.aether/commands/flags.yaml +4 -4
  15. package/.aether/commands/focus.yaml +6 -6
  16. package/.aether/commands/help.yaml +1 -1
  17. package/.aether/commands/history.yaml +1 -1
  18. package/.aether/commands/import-signals.yaml +2 -2
  19. package/.aether/commands/init.yaml +44 -27
  20. package/.aether/commands/insert-phase.yaml +1 -1
  21. package/.aether/commands/interpret.yaml +2 -2
  22. package/.aether/commands/lay-eggs.yaml +3 -3
  23. package/.aether/commands/maturity.yaml +2 -2
  24. package/.aether/commands/memory-details.yaml +1 -1
  25. package/.aether/commands/migrate-state.yaml +1 -1
  26. package/.aether/commands/oracle.yaml +147 -82
  27. package/.aether/commands/organize.yaml +5 -5
  28. package/.aether/commands/patrol.yaml +8 -8
  29. package/.aether/commands/pause-colony.yaml +7 -7
  30. package/.aether/commands/phase.yaml +1 -1
  31. package/.aether/commands/pheromones.yaml +1 -1
  32. package/.aether/commands/plan.yaml +14 -14
  33. package/.aether/commands/quick.yaml +4 -4
  34. package/.aether/commands/redirect.yaml +6 -6
  35. package/.aether/commands/resume-colony.yaml +9 -9
  36. package/.aether/commands/resume.yaml +5 -38
  37. package/.aether/commands/run.yaml +10 -10
  38. package/.aether/commands/seal.yaml +33 -33
  39. package/.aether/commands/skill-create.yaml +4 -4
  40. package/.aether/commands/status.yaml +14 -14
  41. package/.aether/commands/swarm.yaml +14 -14
  42. package/.aether/commands/tunnels.yaml +7 -7
  43. package/.aether/commands/update.yaml +1 -1
  44. package/.aether/commands/verify-castes.yaml +3 -3
  45. package/.aether/commands/watch.yaml +15 -15
  46. package/.aether/docs/command-playbooks/build-complete.md +48 -15
  47. package/.aether/docs/command-playbooks/build-context.md +11 -11
  48. package/.aether/docs/command-playbooks/build-full.md +76 -76
  49. package/.aether/docs/command-playbooks/build-prep.md +10 -10
  50. package/.aether/docs/command-playbooks/build-verify.md +27 -27
  51. package/.aether/docs/command-playbooks/build-wave.md +38 -38
  52. package/.aether/docs/command-playbooks/continue-advance.md +60 -27
  53. package/.aether/docs/command-playbooks/continue-finalize.md +25 -11
  54. package/.aether/docs/command-playbooks/continue-full.md +60 -46
  55. package/.aether/docs/command-playbooks/continue-gates.md +18 -18
  56. package/.aether/docs/command-playbooks/continue-verify.md +10 -10
  57. package/.aether/docs/source-of-truth-map.md +10 -10
  58. package/.aether/docs/structural-learning-stack.md +283 -0
  59. package/.aether/templates/colony-state-template.json +1 -0
  60. package/.aether/utils/consolidation-seal.sh +196 -0
  61. package/.aether/utils/consolidation.sh +127 -0
  62. package/.aether/utils/curation-ants/archivist.sh +97 -0
  63. package/.aether/utils/curation-ants/critic.sh +214 -0
  64. package/.aether/utils/curation-ants/herald.sh +102 -0
  65. package/.aether/utils/curation-ants/janitor.sh +121 -0
  66. package/.aether/utils/curation-ants/librarian.sh +99 -0
  67. package/.aether/utils/curation-ants/nurse.sh +153 -0
  68. package/.aether/utils/curation-ants/orchestrator.sh +181 -0
  69. package/.aether/utils/curation-ants/scribe.sh +164 -0
  70. package/.aether/utils/curation-ants/sentinel.sh +119 -0
  71. package/.aether/utils/event-bus.sh +301 -0
  72. package/.aether/utils/graph.sh +559 -0
  73. package/.aether/utils/instinct-store.sh +401 -0
  74. package/.aether/utils/learning.sh +79 -7
  75. package/.aether/utils/oracle/oracle-stop-hook.sh +896 -0
  76. package/.aether/utils/session.sh +13 -0
  77. package/.aether/utils/state-api.sh +1 -1
  78. package/.aether/utils/trust-scoring.sh +347 -0
  79. package/.aether/utils/worktree.sh +97 -0
  80. package/.claude/commands/ant/archaeology.md +2 -2
  81. package/.claude/commands/ant/chaos.md +4 -4
  82. package/.claude/commands/ant/colonize.md +9 -9
  83. package/.claude/commands/ant/council.md +6 -6
  84. package/.claude/commands/ant/data-clean.md +3 -3
  85. package/.claude/commands/ant/dream.md +2 -2
  86. package/.claude/commands/ant/entomb.md +9 -9
  87. package/.claude/commands/ant/export-signals.md +2 -2
  88. package/.claude/commands/ant/feedback.md +4 -4
  89. package/.claude/commands/ant/flag.md +2 -2
  90. package/.claude/commands/ant/flags.md +4 -4
  91. package/.claude/commands/ant/focus.md +4 -4
  92. package/.claude/commands/ant/help.md +1 -1
  93. package/.claude/commands/ant/history.md +1 -1
  94. package/.claude/commands/ant/import-signals.md +2 -2
  95. package/.claude/commands/ant/init.md +44 -27
  96. package/.claude/commands/ant/insert-phase.md +1 -1
  97. package/.claude/commands/ant/interpret.md +2 -2
  98. package/.claude/commands/ant/lay-eggs.md +2 -2
  99. package/.claude/commands/ant/maturity.md +2 -2
  100. package/.claude/commands/ant/memory-details.md +1 -1
  101. package/.claude/commands/ant/migrate-state.md +1 -1
  102. package/.claude/commands/ant/oracle.md +78 -42
  103. package/.claude/commands/ant/organize.md +3 -3
  104. package/.claude/commands/ant/patrol.md +8 -8
  105. package/.claude/commands/ant/pause-colony.md +5 -5
  106. package/.claude/commands/ant/phase.md +1 -1
  107. package/.claude/commands/ant/pheromones.md +1 -1
  108. package/.claude/commands/ant/plan.md +8 -8
  109. package/.claude/commands/ant/quick.md +4 -4
  110. package/.claude/commands/ant/redirect.md +4 -4
  111. package/.claude/commands/ant/resume-colony.md +5 -5
  112. package/.claude/commands/ant/resume.md +17 -29
  113. package/.claude/commands/ant/run.md +10 -10
  114. package/.claude/commands/ant/seal.md +25 -25
  115. package/.claude/commands/ant/skill-create.md +2 -2
  116. package/.claude/commands/ant/status.md +14 -14
  117. package/.claude/commands/ant/swarm.md +14 -14
  118. package/.claude/commands/ant/tunnels.md +4 -4
  119. package/.claude/commands/ant/update.md +1 -1
  120. package/.claude/commands/ant/verify-castes.md +2 -2
  121. package/.claude/commands/ant/watch.md +8 -8
  122. package/.opencode/commands/ant/archaeology.md +1 -1
  123. package/.opencode/commands/ant/build.md +80 -45
  124. package/.opencode/commands/ant/chaos.md +3 -3
  125. package/.opencode/commands/ant/colonize.md +8 -8
  126. package/.opencode/commands/ant/continue.md +40 -40
  127. package/.opencode/commands/ant/council.md +5 -5
  128. package/.opencode/commands/ant/data-clean.md +2 -2
  129. package/.opencode/commands/ant/dream.md +1 -1
  130. package/.opencode/commands/ant/entomb.md +3 -3
  131. package/.opencode/commands/ant/export-signals.md +1 -1
  132. package/.opencode/commands/ant/feedback.md +2 -2
  133. package/.opencode/commands/ant/flag.md +1 -1
  134. package/.opencode/commands/ant/flags.md +3 -3
  135. package/.opencode/commands/ant/focus.md +2 -2
  136. package/.opencode/commands/ant/import-signals.md +1 -1
  137. package/.opencode/commands/ant/init.md +44 -27
  138. package/.opencode/commands/ant/insert-phase.md +1 -1
  139. package/.opencode/commands/ant/interpret.md +1 -1
  140. package/.opencode/commands/ant/lay-eggs.md +2 -2
  141. package/.opencode/commands/ant/maturity.md +1 -1
  142. package/.opencode/commands/ant/memory-details.md +1 -1
  143. package/.opencode/commands/ant/oracle.md +69 -40
  144. package/.opencode/commands/ant/organize.md +2 -2
  145. package/.opencode/commands/ant/patrol.md +8 -8
  146. package/.opencode/commands/ant/pause-colony.md +2 -2
  147. package/.opencode/commands/ant/pheromones.md +1 -1
  148. package/.opencode/commands/ant/plan.md +6 -6
  149. package/.opencode/commands/ant/quick.md +4 -4
  150. package/.opencode/commands/ant/redirect.md +2 -2
  151. package/.opencode/commands/ant/resume-colony.md +4 -4
  152. package/.opencode/commands/ant/resume.md +5 -17
  153. package/.opencode/commands/ant/run.md +10 -10
  154. package/.opencode/commands/ant/seal.md +8 -8
  155. package/.opencode/commands/ant/skill-create.md +2 -2
  156. package/.opencode/commands/ant/status.md +10 -10
  157. package/.opencode/commands/ant/tunnels.md +3 -3
  158. package/.opencode/commands/ant/verify-castes.md +1 -1
  159. package/.opencode/commands/ant/watch.md +7 -7
  160. package/CHANGELOG.md +83 -0
  161. package/README.md +22 -9
  162. package/bin/cli.js +118 -3
  163. package/bin/lib/binary-downloader.js +267 -0
  164. package/bin/lib/update-transaction.js +27 -3
  165. package/bin/lib/version-gate.js +179 -0
  166. package/bin/npx-entry.js +0 -0
  167. package/package.json +1 -1
  168. package/.aether/agents/aether-ambassador.md +0 -140
  169. package/.aether/agents/aether-archaeologist.md +0 -108
  170. package/.aether/agents/aether-architect.md +0 -133
  171. package/.aether/agents/aether-auditor.md +0 -144
  172. package/.aether/agents/aether-builder.md +0 -184
  173. package/.aether/agents/aether-chaos.md +0 -115
  174. package/.aether/agents/aether-chronicler.md +0 -122
  175. package/.aether/agents/aether-gatekeeper.md +0 -116
  176. package/.aether/agents/aether-includer.md +0 -117
  177. package/.aether/agents/aether-keeper.md +0 -177
  178. package/.aether/agents/aether-measurer.md +0 -128
  179. package/.aether/agents/aether-oracle.md +0 -137
  180. package/.aether/agents/aether-probe.md +0 -133
  181. package/.aether/agents/aether-queen.md +0 -286
  182. package/.aether/agents/aether-route-setter.md +0 -130
  183. package/.aether/agents/aether-sage.md +0 -106
  184. package/.aether/agents/aether-scout.md +0 -101
  185. package/.aether/agents/aether-surveyor-disciplines.md +0 -391
  186. package/.aether/agents/aether-surveyor-nest.md +0 -329
  187. package/.aether/agents/aether-surveyor-pathogens.md +0 -264
  188. package/.aether/agents/aether-surveyor-provisions.md +0 -334
  189. package/.aether/agents/aether-tracker.md +0 -137
  190. package/.aether/agents/aether-watcher.md +0 -174
  191. package/.aether/agents/aether-weaver.md +0 -130
  192. package/.aether/commands/claude/archaeology.md +0 -334
  193. package/.aether/commands/claude/build.md +0 -65
  194. package/.aether/commands/claude/chaos.md +0 -336
  195. package/.aether/commands/claude/colonize.md +0 -259
  196. package/.aether/commands/claude/continue.md +0 -60
  197. package/.aether/commands/claude/council.md +0 -507
  198. package/.aether/commands/claude/data-clean.md +0 -81
  199. package/.aether/commands/claude/dream.md +0 -268
  200. package/.aether/commands/claude/entomb.md +0 -498
  201. package/.aether/commands/claude/export-signals.md +0 -57
  202. package/.aether/commands/claude/feedback.md +0 -96
  203. package/.aether/commands/claude/flag.md +0 -151
  204. package/.aether/commands/claude/flags.md +0 -169
  205. package/.aether/commands/claude/focus.md +0 -76
  206. package/.aether/commands/claude/help.md +0 -154
  207. package/.aether/commands/claude/history.md +0 -140
  208. package/.aether/commands/claude/import-signals.md +0 -71
  209. package/.aether/commands/claude/init.md +0 -505
  210. package/.aether/commands/claude/insert-phase.md +0 -105
  211. package/.aether/commands/claude/interpret.md +0 -278
  212. package/.aether/commands/claude/lay-eggs.md +0 -210
  213. package/.aether/commands/claude/maturity.md +0 -113
  214. package/.aether/commands/claude/memory-details.md +0 -77
  215. package/.aether/commands/claude/migrate-state.md +0 -171
  216. package/.aether/commands/claude/oracle.md +0 -642
  217. package/.aether/commands/claude/organize.md +0 -232
  218. package/.aether/commands/claude/patrol.md +0 -620
  219. package/.aether/commands/claude/pause-colony.md +0 -233
  220. package/.aether/commands/claude/phase.md +0 -115
  221. package/.aether/commands/claude/pheromones.md +0 -156
  222. package/.aether/commands/claude/plan.md +0 -693
  223. package/.aether/commands/claude/preferences.md +0 -65
  224. package/.aether/commands/claude/quick.md +0 -100
  225. package/.aether/commands/claude/redirect.md +0 -76
  226. package/.aether/commands/claude/resume-colony.md +0 -197
  227. package/.aether/commands/claude/resume.md +0 -388
  228. package/.aether/commands/claude/run.md +0 -231
  229. package/.aether/commands/claude/seal.md +0 -774
  230. package/.aether/commands/claude/skill-create.md +0 -286
  231. package/.aether/commands/claude/status.md +0 -410
  232. package/.aether/commands/claude/swarm.md +0 -349
  233. package/.aether/commands/claude/tunnels.md +0 -426
  234. package/.aether/commands/claude/update.md +0 -132
  235. package/.aether/commands/claude/verify-castes.md +0 -143
  236. package/.aether/commands/claude/watch.md +0 -239
  237. package/.aether/commands/opencode/archaeology.md +0 -331
  238. package/.aether/commands/opencode/build.md +0 -1168
  239. package/.aether/commands/opencode/chaos.md +0 -329
  240. package/.aether/commands/opencode/colonize.md +0 -195
  241. package/.aether/commands/opencode/continue.md +0 -1436
  242. package/.aether/commands/opencode/council.md +0 -437
  243. package/.aether/commands/opencode/data-clean.md +0 -77
  244. package/.aether/commands/opencode/dream.md +0 -260
  245. package/.aether/commands/opencode/entomb.md +0 -377
  246. package/.aether/commands/opencode/export-signals.md +0 -54
  247. package/.aether/commands/opencode/feedback.md +0 -99
  248. package/.aether/commands/opencode/flag.md +0 -149
  249. package/.aether/commands/opencode/flags.md +0 -167
  250. package/.aether/commands/opencode/focus.md +0 -73
  251. package/.aether/commands/opencode/help.md +0 -157
  252. package/.aether/commands/opencode/history.md +0 -136
  253. package/.aether/commands/opencode/import-signals.md +0 -68
  254. package/.aether/commands/opencode/init.md +0 -518
  255. package/.aether/commands/opencode/insert-phase.md +0 -111
  256. package/.aether/commands/opencode/interpret.md +0 -272
  257. package/.aether/commands/opencode/lay-eggs.md +0 -213
  258. package/.aether/commands/opencode/maturity.md +0 -108
  259. package/.aether/commands/opencode/memory-details.md +0 -83
  260. package/.aether/commands/opencode/migrate-state.md +0 -165
  261. package/.aether/commands/opencode/oracle.md +0 -593
  262. package/.aether/commands/opencode/organize.md +0 -226
  263. package/.aether/commands/opencode/patrol.md +0 -626
  264. package/.aether/commands/opencode/pause-colony.md +0 -203
  265. package/.aether/commands/opencode/phase.md +0 -113
  266. package/.aether/commands/opencode/pheromones.md +0 -162
  267. package/.aether/commands/opencode/plan.md +0 -684
  268. package/.aether/commands/opencode/preferences.md +0 -71
  269. package/.aether/commands/opencode/quick.md +0 -91
  270. package/.aether/commands/opencode/redirect.md +0 -84
  271. package/.aether/commands/opencode/resume-colony.md +0 -190
  272. package/.aether/commands/opencode/resume.md +0 -394
  273. package/.aether/commands/opencode/run.md +0 -237
  274. package/.aether/commands/opencode/seal.md +0 -452
  275. package/.aether/commands/opencode/skill-create.md +0 -63
  276. package/.aether/commands/opencode/status.md +0 -307
  277. package/.aether/commands/opencode/swarm.md +0 -15
  278. package/.aether/commands/opencode/tunnels.md +0 -400
  279. package/.aether/commands/opencode/update.md +0 -127
  280. package/.aether/commands/opencode/verify-castes.md +0 -139
  281. package/.aether/commands/opencode/watch.md +0 -227
@@ -42,10 +42,10 @@ body_claude: |
42
42
 
43
43
  ### Step 0b: Stop Oracle
44
44
 
45
- Create the stop signal file by running using the Bash tool with description "Stopping oracle research...":
45
+ Stop any active Oracle research by running using the Bash tool with description "Stopping oracle research...":
46
46
 
47
47
  ```bash
48
- mkdir -p .aether/oracle && touch .aether/oracle/.stop
48
+ mkdir -p .aether/oracle && touch .aether/oracle/.stop && rm -f .aether/oracle/.loop-active
49
49
  ```
50
50
 
51
51
  Output:
@@ -53,8 +53,11 @@ body_claude: |
53
53
  ```
54
54
  🔮🐜 Oracle Stop Signal Sent
55
55
 
56
- Created .aether/oracle/.stop
57
- The research loop will halt at the end of the current iteration.
56
+ Removed loop state files.
57
+ - .aether/oracle/.stop (signal for legacy tmux loop)
58
+ - .aether/oracle/.loop-active (signal for in-session loop)
59
+
60
+ Any active research will halt at the next iteration boundary.
58
61
 
59
62
  To check final results: /ant:oracle status
60
63
  ```
@@ -276,6 +279,41 @@ body_claude: |
276
279
 
277
280
  (The user will type their topic via the "Other" free-text option.)
278
281
 
282
+ **Question 1.5: Research Brief — Formulate and Approve**
283
+
284
+ Take the user's raw topic (from `$ARGUMENTS` or Question 1) and reformulate it into a structured research brief. The user may have typed casual natural language — your job is to sharpen it into a clear, well-scoped research prompt that will produce better results.
285
+
286
+ Display the brief for approval:
287
+
288
+ ```
289
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
290
+ 🔮 R E S E A R C H B R I E F
291
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
292
+
293
+ **Topic:** {reformulated topic — clear, specific, actionable}
294
+ **Core Question:** {the single most important question this research should answer}
295
+ **Context:** {what we already know from the codebase or user input}
296
+ **Success Criteria:** {what a good answer looks like — what would make this research useful}
297
+ ```
298
+
299
+ Guidelines for formulation:
300
+ - Turn vague topics into specific ones ("auth stuff" → "Authentication architecture: session-based vs token-based for this Node.js API")
301
+ - Add codebase context if relevant (tech stack, existing patterns)
302
+ - Make the core question answerable — not open-ended philosophy
303
+ - Keep success criteria concrete ("A recommendation with trade-offs" not "understand everything")
304
+
305
+ Then ask the user to approve:
306
+
307
+ ```
308
+ Does this capture what you're looking for? (approve / edit)
309
+ ```
310
+
311
+ - If the user approves: use the reformulated topic as the research topic going forward
312
+ - If the user edits: incorporate their changes, display the updated brief, and ask again
313
+ - Max 2 revision rounds (same as init). After 2, ask for final approval or cancel.
314
+
315
+ The approved **Topic** from the brief becomes the topic used in all subsequent steps (state.json, plan.json, research-plan.md).
316
+
279
317
  **Question 2: Research Template**
280
318
 
281
319
  ```
@@ -372,14 +410,14 @@ body_claude: |
372
410
 
373
411
  Check for stale files by running using the Bash tool with description "Checking for stale oracle session...":
374
412
  ```bash
375
- stale_check=$(bash .aether/aether-utils.sh session-verify-fresh --command oracle "" "$ORACLE_START")
413
+ stale_check=$(aether session-verify-fresh --command oracle "" "$ORACLE_START")
376
414
  has_stale=$(echo "$stale_check" | jq -r '.stale | length')
377
415
  has_progress=$(echo "$stale_check" | jq -r '.fresh | length')
378
416
 
379
417
  if [[ "$has_stale" -gt 0 ]] || [[ "$has_progress" -gt 0 ]]; then
380
418
  # Found existing oracle session
381
419
  if [[ "$force_research" == "true" ]]; then
382
- bash .aether/aether-utils.sh session-clear --command oracle
420
+ aether session-clear --command oracle
383
421
  echo "Cleared stale oracle session for fresh research"
384
422
  else
385
423
  # Existing session found - prompt user
@@ -445,7 +483,7 @@ body_claude: |
445
483
  For each focus area string from Question 7, run using the Bash tool with description "Emitting focus area pheromones...":
446
484
 
447
485
  ```bash
448
- bash .aether/aether-utils.sh pheromone-write FOCUS "$focus_area" \
486
+ aether pheromone-write --type FOCUS --content "$focus_area" \
449
487
  --strength 0.8 --source "oracle:wizard" \
450
488
  --reason "Focus area set in oracle wizard" --ttl "24h" 2>/dev/null || true
451
489
  ```
@@ -544,7 +582,7 @@ body_claude: |
544
582
 
545
583
  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
584
  ```bash
547
- verify_result=$(bash .aether/aether-utils.sh session-verify-fresh --command oracle "" "$ORACLE_START")
585
+ verify_result=$(aether session-verify-fresh --command oracle "" "$ORACLE_START")
548
586
  fresh_count=$(echo "$verify_result" | jq -r '.fresh | length')
549
587
 
550
588
  if [[ "$fresh_count" -lt 5 ]]; then
@@ -556,7 +594,7 @@ body_claude: |
556
594
 
557
595
  ---
558
596
 
559
- ### Step 3: Launch
597
+ ### Step 3: Launch (In-Session Loop)
560
598
 
561
599
  Output the research configuration summary, showing the sub-questions from plan.json:
562
600
 
@@ -580,65 +618,63 @@ body_claude: |
580
618
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
581
619
  ```
582
620
 
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...":
621
+ **Create the loop marker file** by running using the Bash tool with description "Creating oracle loop marker...":
586
622
 
587
623
  ```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"
624
+ SESSION_ID="${CLAUDE_SESSION_ID:-$(uuidgen 2>/dev/null || date +%s)}"
625
+ MAX_IT=<max_iterations from wizard>
626
+ TARGET_CONF=<target_confidence from wizard>
627
+ cat > .aether/oracle/.loop-active <<MARKER
628
+ ---
629
+ iteration: 0
630
+ max_iterations: $MAX_IT
631
+ session_id: $SESSION_ID
632
+ phase: survey
633
+ target_confidence: $TARGET_CONF
634
+ synthesis_done: false
635
+ oracle_md_path: .aether/utils/oracle/oracle.md
636
+ ---
637
+ Oracle research loop active
638
+ MARKER
639
+ echo "LOOP_MARKER_CREATED"
589
640
  ```
590
641
 
591
- **If TMUX_OK:**
642
+ Output:
592
643
 
593
644
  ```
594
- 🔮🐜 Oracle Launched
645
+ 🔮🐜 Oracle Research Started (In-Session Loop)
595
646
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
596
647
 
597
- The Oracle is researching in a background tmux session.
648
+ The Oracle is researching IN THIS SESSION.
649
+
650
+ The Stop hook will keep the loop running automatically:
651
+ - Each iteration researches one question
652
+ - Phases advance: survey -> investigate -> synthesize -> verify
653
+ - Loop ends when confidence reaches {target_confidence}% or max iterations hit
654
+ - A final synthesis pass produces the research report
598
655
 
599
- 👁️ Watch live: tmux attach -t oracle
600
656
  📊 Check status: /ant:oracle status
601
657
  🛑 Stop early: /ant:oracle stop
602
658
 
603
659
  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
660
 
607
661
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
608
662
 
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
-
663
+ You can continue chatting. The Oracle loop runs between your messages.
616
664
  ```
617
- 🔮 Ready to Launch
618
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
619
-
620
- tmux not available. Run this in a separate terminal:
621
665
 
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
- ```
666
+ **Now begin the first iteration.** Read `.aether/utils/oracle/oracle.md` and start the survey phase research immediately.
667
+ Target the first untouched question from plan.json. Update state files as you go.
668
+ When you try to stop, the Stop hook will check progress and continue the loop if needed.
631
669
 
632
670
  Generate the state-based Next Up block by running using the Bash tool with description "Generating Next Up suggestions...":
633
671
  ```bash
634
672
  state=$(jq -r '.state // "IDLE"' .aether/data/COLONY_STATE.json)
635
673
  current_phase=$(jq -r '.current_phase // 0' .aether/data/COLONY_STATE.json)
636
674
  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"
675
+ aether print-next-up
638
676
  ```
639
677
 
640
- Stop here.
641
-
642
678
  body_opencode: |
643
679
  You are the **Oracle Ant** command handler. You configure and launch a deep research loop that runs autonomously in a separate process.
644
680
 
@@ -679,10 +715,10 @@ body_opencode: |
679
715
 
680
716
  ### Step 0b: Stop Oracle
681
717
 
682
- Create the stop signal file:
718
+ Stop any active Oracle research:
683
719
 
684
720
  ```bash
685
- mkdir -p .aether/oracle && touch .aether/oracle/.stop
721
+ mkdir -p .aether/oracle && touch .aether/oracle/.stop && rm -f .aether/oracle/.loop-active
686
722
  ```
687
723
 
688
724
  Output:
@@ -690,8 +726,9 @@ body_opencode: |
690
726
  ```
691
727
  🔮 Oracle Stop Signal Sent
692
728
 
693
- Created .aether/oracle/.stop
694
- The research loop will halt at the end of the current iteration.
729
+ Created .aether/oracle/.stop (legacy tmux signal)
730
+ Removed .aether/oracle/.loop-active (in-session loop marker)
731
+ The research loop will halt at the next iteration boundary.
695
732
 
696
733
  To check final results: /ant:oracle status
697
734
  ```
@@ -913,6 +950,41 @@ body_opencode: |
913
950
 
914
951
  (The user will type their topic via the "Other" free-text option.)
915
952
 
953
+ **Question 1.5: Research Brief — Formulate and Approve**
954
+
955
+ Take the user's raw topic (from `$normalized_args` or Question 1) and reformulate it into a structured research brief. The user may have typed casual natural language — your job is to sharpen it into a clear, well-scoped research prompt that will produce better results.
956
+
957
+ Display the brief for approval:
958
+
959
+ ```
960
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
961
+ 🔮 R E S E A R C H B R I E F
962
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
963
+
964
+ **Topic:** {reformulated topic — clear, specific, actionable}
965
+ **Core Question:** {the single most important question this research should answer}
966
+ **Context:** {what we already know from the codebase or user input}
967
+ **Success Criteria:** {what a good answer looks like — what would make this research useful}
968
+ ```
969
+
970
+ Guidelines for formulation:
971
+ - Turn vague topics into specific ones ("auth stuff" → "Authentication architecture: session-based vs token-based for this Node.js API")
972
+ - Add codebase context if relevant (tech stack, existing patterns)
973
+ - Make the core question answerable — not open-ended philosophy
974
+ - Keep success criteria concrete ("A recommendation with trade-offs" not "understand everything")
975
+
976
+ Then ask the user to approve:
977
+
978
+ ```
979
+ Does this capture what you're looking for? (approve / edit)
980
+ ```
981
+
982
+ - If the user approves: use the reformulated topic as the research topic going forward
983
+ - If the user edits: incorporate their changes, display the updated brief, and ask again
984
+ - Max 2 revision rounds (same as init). After 2, ask for final approval or cancel.
985
+
986
+ The approved **Topic** from the brief becomes the topic used in all subsequent steps (state.json, plan.json, research-plan.md).
987
+
916
988
  **Question 2: Research Template**
917
989
 
918
990
  ```
@@ -1048,7 +1120,7 @@ body_opencode: |
1048
1120
  For each focus area string from Question 7:
1049
1121
 
1050
1122
  ```bash
1051
- bash .aether/aether-utils.sh pheromone-write FOCUS "$focus_area" \
1123
+ aether pheromone-write --type FOCUS --content "$focus_area" \
1052
1124
  --strength 0.8 --source "oracle:wizard" \
1053
1125
  --reason "Focus area set in oracle wizard" --ttl "24h" 2>/dev/null || true
1054
1126
  ```
@@ -1147,7 +1219,7 @@ body_opencode: |
1147
1219
 
1148
1220
  ---
1149
1221
 
1150
- ### Step 3: Launch
1222
+ ### Step 3: Launch (In-Session Loop)
1151
1223
 
1152
1224
  Output the research configuration summary, showing the sub-questions from plan.json:
1153
1225
 
@@ -1171,54 +1243,47 @@ body_opencode: |
1171
1243
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1172
1244
  ```
1173
1245
 
1174
- Now launch the loop. Try tmux first, fall back to manual.
1175
-
1176
- **Try tmux:**
1246
+ **Create the loop marker file:**
1177
1247
 
1178
1248
  ```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.
1249
+ SESSION_ID="${CLAUDE_SESSION_ID:-$(uuidgen 2>/dev/null || date +%s)}"
1250
+ MAX_IT=<max_iterations from wizard>
1251
+ TARGET_CONF=<target_confidence from wizard>
1252
+ cat > .aether/oracle/.loop-active <<MARKER
1253
+ ---
1254
+ iteration: 0
1255
+ max_iterations: $MAX_IT
1256
+ session_id: $SESSION_ID
1257
+ phase: survey
1258
+ target_confidence: $TARGET_CONF
1259
+ synthesis_done: false
1260
+ oracle_md_path: .aether/utils/oracle/oracle.md
1261
+ ---
1262
+ Oracle research loop active
1263
+ MARKER
1264
+ echo "LOOP_MARKER_CREATED"
1201
1265
  ```
1202
1266
 
1203
- Stop here.
1204
-
1205
- **If TMUX_FAIL** (tmux not installed or error):
1267
+ Output:
1206
1268
 
1207
1269
  ```
1208
- 🔮 Ready to Launch
1270
+ 🔮 Oracle Research Started (In-Session Loop)
1209
1271
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1210
1272
 
1211
- tmux not available. Run this in a separate terminal:
1273
+ The Oracle is researching IN THIS SESSION.
1212
1274
 
1213
- cd {current_working_directory}
1214
- bash .aether/utils/oracle/oracle.sh
1275
+ The Stop hook keeps the loop running automatically between iterations.
1276
+ Phases advance: survey -> investigate -> synthesize -> verify
1277
+ Loop ends when confidence target is reached or max iterations hit.
1215
1278
 
1216
- Then come back here:
1217
1279
  📊 Check status: /ant:oracle status
1218
1280
  🛑 Stop early: /ant:oracle stop
1219
1281
 
1220
1282
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1283
+
1284
+ You can continue chatting. The Oracle loop runs between your messages.
1221
1285
  ```
1222
1286
 
1223
- Stop here.
1287
+ **Now begin the first iteration.** Read `.aether/utils/oracle/oracle.md` and start survey phase research.
1288
+ Target the first untouched question from plan.json. Update state files as you go.
1224
1289
 
@@ -30,7 +30,7 @@ body_claude: |
30
30
 
31
31
  Run using the Bash tool with description "Loading active pheromones...":
32
32
  ```bash
33
- bash .aether/aether-utils.sh pheromone-read
33
+ aether pheromone-read
34
34
  ```
35
35
 
36
36
  Use `.result.signals` as the active signal list (already decay-filtered by runtime logic).
@@ -206,7 +206,7 @@ body_claude: |
206
206
 
207
207
  Use the Bash tool with description "Logging hygiene activity..." to run:
208
208
  ```
209
- bash .aether/aether-utils.sh activity-log "COMPLETE" "queen" "Hygiene report generated"
209
+ aether activity-log "COMPLETE" "queen" "Hygiene report generated"
210
210
  ```
211
211
 
212
212
  Display persistence confirmation:
@@ -225,7 +225,7 @@ body_claude: |
225
225
  state=$(jq -r '.state // "IDLE"' .aether/data/COLONY_STATE.json)
226
226
  current_phase=$(jq -r '.current_phase // 0' .aether/data/COLONY_STATE.json)
227
227
  total_phases=$(jq -r '.plan.phases | length' .aether/data/COLONY_STATE.json)
228
- bash .aether/aether-utils.sh print-next-up "$state" "$current_phase" "$total_phases"
228
+ aether print-next-up
229
229
  ```
230
230
 
231
231
  body_opencode: |
@@ -255,7 +255,7 @@ body_opencode: |
255
255
 
256
256
  Run using the Bash tool:
257
257
  ```bash
258
- bash .aether/aether-utils.sh pheromone-read
258
+ aether pheromone-read
259
259
  ```
260
260
 
261
261
  Use `.result.signals` as the active signal list (already decay-filtered by runtime logic).
@@ -432,7 +432,7 @@ body_opencode: |
432
432
 
433
433
  Use the Bash tool to run:
434
434
  ```
435
- bash .aether/aether-utils.sh activity-log "COMPLETE" "queen" "Hygiene report generated"
435
+ aether activity-log "COMPLETE" "queen" "Hygiene report generated"
436
436
  ```
437
437
 
438
438
  Display persistence confirmation:
@@ -78,7 +78,7 @@ body: |
78
78
  Display audit header:
79
79
  ```
80
80
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
81
- C O L O N Y A U D I T
81
+ 🔍 C O L O N Y A U D I T
82
82
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
83
83
 
84
84
  Goal: {goal}
@@ -248,12 +248,12 @@ body: |
248
248
 
249
249
  **Flags check:**
250
250
  ```bash
251
- bash .aether/aether-utils.sh flag-list 2>/dev/null || echo '{"result":{"flags":[]}}'
251
+ aether flag-list --json 2>/dev/null || echo '{"result":{"flags":[]}}'
252
252
  ```
253
253
 
254
254
  **Midden check:**
255
255
  ```bash
256
- bash .aether/aether-utils.sh midden-recent-failures 2>/dev/null || echo '{"result":{"failures":[]}}'
256
+ aether midden-recent-failures 2>/dev/null || echo '{"result":{"failures":[]}}'
257
257
  ```
258
258
 
259
259
  **Parse flag results:**
@@ -333,12 +333,12 @@ body: |
333
333
 
334
334
  **Expire stale pheromones:**
335
335
  ```bash
336
- bash .aether/aether-utils.sh pheromone-expire 2>/dev/null || true
336
+ aether pheromone-expire 2>/dev/null || true
337
337
  ```
338
338
 
339
339
  **Load memory metrics:**
340
340
  ```bash
341
- bash .aether/aether-utils.sh memory-metrics 2>/dev/null || echo '{}'
341
+ aether memory-metrics 2>/dev/null || echo '{}'
342
342
  ```
343
343
 
344
344
  **Load instincts:**
@@ -358,7 +358,7 @@ body: |
358
358
 
359
359
  **Count pheromone signals:**
360
360
  ```bash
361
- bash .aether/aether-utils.sh pheromone-count 2>/dev/null || echo '{"result":{"count":0}}'
361
+ aether pheromone-count 2>/dev/null || echo '{"result":{"count":0}}'
362
362
  ```
363
363
 
364
364
  Display:
@@ -502,7 +502,7 @@ body: |
502
502
 
503
503
  ```
504
504
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
505
- A U D I T R E S U L T S
505
+ 📋 A U D I T R E S U L T S
506
506
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
507
507
 
508
508
  Goal: {goal}
@@ -587,7 +587,7 @@ body: |
587
587
 
588
588
  Run using the Bash tool:
589
589
  ```bash
590
- bash .aether/aether-utils.sh activity-log "COMPLETE" "queen" "Colony audit completed - {recommendation}"
590
+ aether activity-log "COMPLETE" "queen" "Colony audit completed - {recommendation}"
591
591
  ```
592
592
 
593
593
  Display persistence confirmation:
@@ -22,7 +22,7 @@ body_claude: |
22
22
 
23
23
  Run using the Bash tool with description "Loading active pheromones...":
24
24
  ```bash
25
- bash .aether/aether-utils.sh pheromone-read
25
+ aether pheromone-read
26
26
  ```
27
27
 
28
28
  Use `.result.signals` as the active signal list (already decay-filtered by runtime logic).
@@ -114,7 +114,7 @@ body_claude: |
114
114
 
115
115
  **4. Generate Enhanced Commit Message:**
116
116
  ```bash
117
- bash .aether/aether-utils.sh generate-commit-message "contextual" {current_phase} "{phase_name}" "{ai_description}" {plan_number}
117
+ aether generate-commit-message --type "contextual" --phase {current_phase} --subject "{phase_name}" "{ai_description}" {plan_number}
118
118
  ```
119
119
 
120
120
  Parse the returned JSON to extract `message`, `body`, `files_changed`, `subsystem`, and `scope`.
@@ -170,12 +170,12 @@ body_claude: |
170
170
  Log this pause activity to `.aether/CONTEXT.md` by running using the Bash tool with description "Updating context document...":
171
171
 
172
172
  ```bash
173
- bash .aether/aether-utils.sh context-update activity "pause-colony" "Colony paused — handoff created" "—"
173
+ aether context-update activity "pause-colony" "Colony paused — handoff created" "—"
174
174
  ```
175
175
 
176
176
  Update safe-to-clear status by running using the Bash tool with description "Marking safe to clear...":
177
177
  ```bash
178
- bash .aether/aether-utils.sh context-update safe-to-clear "YES" "Colony paused — safe to /clear, run /ant:resume-colony to continue"
178
+ aether context-update safe-to-clear "YES" "Colony paused — safe to /clear, run /ant:resume-colony to continue"
179
179
  ```
180
180
 
181
181
  ### Step 5: Display Confirmation
@@ -226,7 +226,7 @@ body_claude: |
226
226
  state=$(jq -r '.state // "IDLE"' .aether/data/COLONY_STATE.json)
227
227
  current_phase=$(jq -r '.current_phase // 0' .aether/data/COLONY_STATE.json)
228
228
  total_phases=$(jq -r '.plan.phases | length' .aether/data/COLONY_STATE.json)
229
- bash .aether/aether-utils.sh print-next-up "$state" "$current_phase" "$total_phases"
229
+ aether print-next-up
230
230
  ```
231
231
 
232
232
  body_opencode: |
@@ -248,7 +248,7 @@ body_opencode: |
248
248
 
249
249
  Run using the Bash tool:
250
250
  ```bash
251
- bash .aether/aether-utils.sh pheromone-read
251
+ aether pheromone-read
252
252
  ```
253
253
 
254
254
  Use `.result.signals` as the active signal list (already decay-filtered by runtime logic).
@@ -329,7 +329,7 @@ body_opencode: |
329
329
 
330
330
  3. **Generate the commit message:**
331
331
  ```bash
332
- bash .aether/aether-utils.sh generate-commit-message "pause" {current_phase} "{phase_name}"
332
+ aether generate-commit-message --type "pause" --phase {current_phase} --subject "{phase_name}"
333
333
  ```
334
334
  Parse the returned JSON to extract `message` and `files_changed`.
335
335
 
@@ -79,7 +79,7 @@ body: |
79
79
  state=$(jq -r '.state // "IDLE"' .aether/data/COLONY_STATE.json)
80
80
  current_phase=$(jq -r '.current_phase // 0' .aether/data/COLONY_STATE.json)
81
81
  total_phases=$(jq -r '.plan.phases | length' .aether/data/COLONY_STATE.json)
82
- bash .aether/aether-utils.sh print-next-up "$state" "$current_phase" "$total_phases"
82
+ aether print-next-up
83
83
  ```
84
84
  {{/claude}}
85
85
 
@@ -109,7 +109,7 @@ body: |
109
109
 
110
110
  Run using the Bash tool with description "Displaying pheromones...":
111
111
  ```bash
112
- bash .aether/aether-utils.sh pheromone-display "{subcommand or 'all'}"
112
+ aether pheromone-display "{subcommand or 'all'}"
113
113
  ```
114
114
 
115
115
  The output will be the formatted pheromone table.