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
@@ -1,684 +0,0 @@
1
- <!-- Generated from .aether/commands/plan.yaml - DO NOT EDIT DIRECTLY -->
2
- ---
3
- name: ant:plan
4
- description: "📊🐜🗺️🐜📊 Show project plan or generate project-specific phases"
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
-
14
- You are the **Queen**. Orchestrate research and planning until the selected confidence target is reached within the selected iteration budget.
15
-
16
- ## Instructions
17
-
18
- Parse `$normalized_args`:
19
- - If contains `--no-visual`: set `visual_mode = false` (visual is ON by default)
20
- - Otherwise: set `visual_mode = true`
21
-
22
- ### Step 1: Read State
23
-
24
- Read `.aether/data/COLONY_STATE.json`.
25
-
26
- **Auto-upgrade old state:**
27
- If `version` field is missing, "1.0", or "2.0":
28
- 1. Preserve: `goal`, `state`, `current_phase`, `plan.phases`
29
- 2. Write upgraded v3.0 state (same structure as /ant:init but preserving data)
30
- 3. Output: `State auto-upgraded to v3.0`
31
- 4. Continue with command.
32
-
33
- Extract: `goal`, `milestone`, `plan.phases`
34
-
35
- **Validate:** If `goal: null`:
36
- ```
37
- No colony initialized. Run /ant:init "<goal>" first.
38
- ```
39
- Stop here.
40
-
41
- If `milestone` == `"Crowned Anthill"`:
42
- ```
43
- This colony has been sealed. Start a new colony with /ant:init "new goal".
44
- ```
45
- Stop here.
46
-
47
- ### Step 1.5: Load State and Show Resumption Context
48
-
49
- Run using Bash tool: `bash .aether/aether-utils.sh load-state`
50
-
51
- If successful and goal is not null:
52
- 1. Extract current_phase from state
53
- 2. Get phase name from plan.phases[current_phase - 1].name (or "(unnamed)")
54
- 3. Display brief resumption context:
55
- ```
56
- 🔄 Resuming: Phase X - Name
57
- ```
58
-
59
- If .aether/HANDOFF.md exists (detected in load-state output):
60
- - Display "Resuming from paused session"
61
- - Read .aether/HANDOFF.md for additional context
62
- - Remove .aether/HANDOFF.md after display (cleanup)
63
-
64
- Run: `bash .aether/aether-utils.sh unload-state` to release lock.
65
-
66
- **Error handling:**
67
- - If E_FILE_NOT_FOUND: "No colony initialized. Run /ant:init first." and stop
68
- - If validation error: Display error details with recovery suggestion and stop
69
- - For other errors: Display generic error and suggest /ant:status for diagnostics
70
-
71
- ### Step 2: Check Existing Plan
72
-
73
- If `plan.phases` has entries (non-empty array), skip to **Step 6** (Display Plan).
74
-
75
- Parse `$normalized_args`:
76
- - If contains `--accept`: Set `force_accept = true` (accept current plan regardless of confidence)
77
- - Otherwise: `force_accept = false`
78
-
79
- Select planning depth (prompt user if not explicitly provided):
80
- - Presets:
81
- - `fast`: `target_confidence = 80`, `max_iterations = 4`
82
- - `balanced`: `target_confidence = 90`, `max_iterations = 6`
83
- - `deep`: `target_confidence = 95`, `max_iterations = 8`
84
- - `exhaustive`: `target_confidence = 99`, `max_iterations = 12`
85
- - Preset selectors:
86
- - `--fast`, `--balanced`, `--deep`, `--exhaustive`
87
- - `--quality fast|balanced|deep|exhaustive`
88
- - CLI overrides:
89
- - `--target <70-99>` to set `target_confidence`
90
- - `--max-iterations <2-12>` to set `max_iterations`
91
- - If no preset/overrides are provided, ask:
92
- `Planning depth? 1) Fast 2) Balanced 3) Deep (recommended) 4) Exhaustive`
93
- - Map user choice to a preset, default to `deep` on unclear input.
94
- - If overrides are out of range, clamp to valid ranges and continue.
95
-
96
- ### Step 2.5: Load Compact Context Capsule
97
-
98
- Run using the Bash tool with description "Loading compact planning context...":
99
- ```bash
100
- bash .aether/aether-utils.sh context-capsule --compact --json 2>/dev/null
101
- ```
102
-
103
- If JSON is valid and `.ok == true`, extract `.result.prompt_section` into `context_capsule_prompt`.
104
- If command fails or returns invalid JSON, set `context_capsule_prompt = ""` and continue.
105
-
106
- ### Step 3: Initialize Planning State
107
-
108
- Update watch files for tmux visibility:
109
-
110
- Write `.aether/data/watch-status.txt`:
111
- ```
112
- AETHER COLONY :: PLANNING
113
- ==========================
114
-
115
- State: PLANNING
116
- Phase: 0/0 (generating plan)
117
- Confidence: 0%
118
- Iteration: 0/{max_iterations}
119
-
120
- Active Workers:
121
- [Research] Starting...
122
- [Planning] Waiting...
123
-
124
- Last Activity:
125
- Planning loop initiated
126
- ```
127
-
128
- Write `.aether/data/watch-progress.txt`:
129
- ```
130
- Progress
131
- ========
132
-
133
- [ ] 0%
134
-
135
- Target: {target_confidence}% confidence
136
-
137
- Iteration: 0/{max_iterations}
138
- Gaps: (analyzing...)
139
- ```
140
-
141
- ### Step 3.5: Load Territory Survey
142
-
143
- Check if territory survey exists before research:
144
-
145
- ```bash
146
- ls .aether/data/survey/*.md 2>/dev/null
147
- ```
148
-
149
- **If survey exists:**
150
- 1. **Always read PATHOGENS.md first** — understand known concerns before planning
151
- 2. Read other relevant docs based on goal keywords:
152
-
153
- | Goal Contains | Additional Documents |
154
- |---------------|---------------------|
155
- | UI, frontend, component, page | DISCIPLINES.md, CHAMBERS.md |
156
- | API, backend, endpoint | BLUEPRINT.md, DISCIPLINES.md |
157
- | database, schema, model | BLUEPRINT.md, PROVISIONS.md |
158
- | test, spec | SENTINEL-PROTOCOLS.md, DISCIPLINES.md |
159
- | integration, external | TRAILS.md, PROVISIONS.md |
160
- | refactor, cleanup | PATHOGENS.md, BLUEPRINT.md |
161
-
162
- **Inject survey context into scout and planner prompts:**
163
- - Include key patterns from DISCIPLINES.md
164
- - Reference architecture from BLUEPRINT.md
165
- - Note tech stack from PROVISIONS.md
166
- - Flag concerns from PATHOGENS.md
167
-
168
- **Display:**
169
- ```
170
- 🗺️ Territory survey loaded — incorporating context into planning
171
- ```
172
-
173
- **If no survey:** Continue without survey context (scouts will do fresh exploration)
174
-
175
- ### Step 3.6: Phase Domain Research
176
-
177
- Investigate domain knowledge for each phase before the planning loop begins. This runs every time `/ant:plan` generates a new plan -- no skip flag.
178
-
179
- **1. Retrieve hive wisdom for research priming:**
180
-
181
- ```bash
182
- hive_context=$(bash .aether/aether-utils.sh hive-read --limit 5 --format text 2>/dev/null)
183
- ```
184
-
185
- Parse the JSON result to extract `.result.text` as `hive_text`. If command fails or returns empty, set `hive_text = ""`.
186
-
187
- **2. Clean any previous research for this phase:**
188
-
189
- ```bash
190
- research_dir=".aether/data/phase-research"
191
- mkdir -p "$research_dir"
192
- rm -f "$research_dir/phase-{phase_number}-research.md"
193
- ```
194
-
195
- Re-running /ant:plan always re-researches from scratch.
196
-
197
- **3. Spawn Research Scout** via Task tool with `subagent_type="aether-scout"`:
198
-
199
- FALLBACK: If "Agent type not found", use general-purpose and inject role: "You are a Scout Ant performing Phase Domain Research."
200
-
201
- ```
202
- You are a Scout Ant performing Phase Domain Research.
203
-
204
- --- MISSION ---
205
- Investigate the domain knowledge needed for Phase {phase_number}: {phase_name}
206
- Goal: "{goal}"
207
- Phase description: "{phase_description}"
208
-
209
- {context_capsule_prompt}
210
-
211
- --- PRE-EXISTING COLONY WISDOM ---
212
- {hive_text}
213
-
214
- --- RESEARCH AREAS ---
215
- 1. Key patterns in the existing codebase relevant to this phase
216
- 2. External library/API documentation if the phase involves external tools
217
- 3. Common gotchas and pitfalls in this domain
218
- 4. Recommended implementation approach based on findings
219
-
220
- --- SCOPE CONSTRAINTS ---
221
- - Maximum 5 key patterns
222
- - Maximum 3 gotchas
223
- - Maximum 1 recommended approach paragraph
224
- - Total output under 3000 words
225
- - Prioritize actionable guidance over exhaustive documentation
226
- - Check hive wisdom above first -- do not re-discover known patterns
227
-
228
- --- TOOLS ---
229
- Use: Glob, Grep, Read, WebSearch, WebFetch
230
- Do NOT use: Task, Write, Edit
231
-
232
- --- OUTPUT FORMAT ---
233
- Return JSON:
234
- {
235
- "hive_wisdom_used": ["list of hive entries that were relevant"],
236
- "key_patterns": [
237
- {"pattern": "description", "source": "file path or URL", "relevance": "why it matters for this phase"}
238
- ],
239
- "external_context": [
240
- {"topic": "what", "finding": "description", "source": "URL or doc reference"}
241
- ],
242
- "gotchas": [
243
- {"issue": "what can go wrong", "prevention": "how to avoid it", "source": "evidence"}
244
- ],
245
- "recommended_approach": "synthesis paragraph",
246
- "files_to_study": ["path1", "path2"]
247
- }
248
- ```
249
-
250
- **4. Wait for scout to complete** (blocking -- direct Task return).
251
-
252
- **5. Parse scout JSON output and write RESEARCH.md to disk.** The Queen (plan.md orchestrator) writes the file -- scout is read-only. Write to: `.aether/data/phase-research/phase-{phase_number}-research.md`
253
-
254
- RESEARCH.md format (6 fixed sections):
255
-
256
- ```markdown
257
- # Phase {N} Research: {Phase Name}
258
-
259
- **Generated:** {ISO-8601 timestamp}
260
- **Phase:** {N} - {Phase Name}
261
- **Research scope:** {brief summary of what was investigated}
262
-
263
- ## Hive Wisdom (Pre-existing Knowledge)
264
- {Format hive_wisdom_used entries, or "No relevant hive wisdom found" if empty}
265
-
266
- ## Key Patterns
267
- {Format each key_patterns entry as: **{pattern}:** {relevance} (Source: {source})}
268
-
269
- ## External Context
270
- {Format each external_context entry as: **{topic}:** {finding} (Source: {source})}
271
- {If empty: "No external research needed for this phase"}
272
-
273
- ## Gotchas
274
- {Format each gotchas entry as: **{issue}:** {prevention} (Source: {source})}
275
-
276
- ## Recommended Approach
277
- {recommended_approach text}
278
-
279
- ## Files to Study
280
- {Format as bullet list of file paths}
281
- ```
282
-
283
- **6. Store research findings** in a variable `research_findings_summary` for injection into the Route-Setter prompt in Step 4. This is a compact summary (not the full RESEARCH.md):
284
-
285
- ```
286
- Key Patterns: {bullet list of pattern names}
287
- Gotchas: {bullet list of gotcha titles}
288
- Recommended: {recommended_approach, first sentence only}
289
- Files: {comma-separated file paths}
290
- ```
291
-
292
- **7. Display completion:**
293
-
294
- ```
295
- Research complete: phase-{phase_number}-research.md ({word_count} words)
296
- ```
297
-
298
- ### Step 4: Research and Planning Loop
299
-
300
- Initialize tracking:
301
- - `iteration = 0`
302
- - `confidence = 0`
303
- - `gaps = []` (list of knowledge gaps)
304
- - `plan_draft = null`
305
- - `last_confidence = 0`
306
- - `stall_count = 0` (consecutive iterations with < 5% improvement)
307
-
308
- **Loop (max {max_iterations} iterations, 2 agents per iteration: 1 scout + 1 planner):**
309
-
310
- ```
311
- while iteration < max_iterations AND confidence < target_confidence:
312
- iteration += 1
313
-
314
- # === AUTO-BREAK CHECKS (no user prompt needed) ===
315
- if iteration > 1:
316
- if confidence >= target_confidence:
317
- Log: "Confidence threshold reached ({confidence}%), finalizing plan"
318
- break
319
- if stall_count >= 2:
320
- Log: "Planning stalled at {confidence}%, finalizing current plan"
321
- break
322
-
323
- # === RESEARCH PHASE (always runs — 1 scout per iteration) ===
324
-
325
- if iteration == 1:
326
-
327
- # Broad exploration on first pass
328
- Spawn Research Scout via Task tool with subagent_type="aether-scout":
329
-
330
- """
331
- You are a Scout Ant in the Aether Colony.
332
-
333
- --- MISSION ---
334
- Research the codebase to understand what exists and how it works.
335
-
336
- Goal: "{goal}"
337
- Iteration: {iteration}/{max_iterations}
338
-
339
- {context_capsule_prompt}
340
-
341
- --- EXPLORATION AREAS ---
342
- Cover ALL of these in a single pass:
343
- 1. Core architecture, entry points, and main modules
344
- 2. Business logic and domain models
345
- 3. Testing patterns and quality practices
346
- 4. Configuration, dependencies, and infrastructure
347
- 5. Edge cases, error handling, and validation
348
-
349
- --- TOOLS ---
350
- Use: Glob, Grep, Read, WebSearch, WebFetch
351
- Do NOT use: Task, Write, Edit
352
-
353
- --- OUTPUT CONSTRAINTS ---
354
- Maximum 5 findings (prioritize by impact on the goal).
355
- Maximum 2 sentences per finding.
356
- Maximum 3 knowledge gaps identified.
357
-
358
- --- OUTPUT FORMAT ---
359
- Return JSON:
360
- {
361
- "findings": [
362
- {"area": "...", "discovery": "...", "source": "file or search"}
363
- ],
364
- "gaps_remaining": [
365
- {"id": "gap_N", "description": "..."}
366
- ],
367
- "overall_knowledge_confidence": 0-100
368
- }
369
- """
370
-
371
- else:
372
-
373
- # Gap-focused research on subsequent passes
374
- Spawn Gap-Focused Scout via Task tool with subagent_type="aether-scout":
375
-
376
- """
377
- You are a Scout Ant in the Aether Colony (gap-focused research).
378
-
379
- --- MISSION ---
380
- Investigate ONLY these specific knowledge gaps. Do not explore broadly.
381
-
382
- Goal: "{goal}"
383
- Iteration: {iteration}/{max_iterations}
384
-
385
- {context_capsule_prompt}
386
-
387
- --- GAPS TO INVESTIGATE ---
388
- {for each gap in gaps:}
389
- - {gap.id}: {gap.description}
390
- {end for}
391
-
392
- --- TOOLS ---
393
- Use: Glob, Grep, Read, WebSearch, WebFetch
394
- Do NOT use: Task, Write, Edit
395
-
396
- --- OUTPUT CONSTRAINTS ---
397
- Maximum 3 findings (one per gap investigated).
398
- Maximum 2 sentences per finding.
399
- Only report gaps that are STILL unresolved after your research.
400
-
401
- --- OUTPUT FORMAT ---
402
- Return JSON:
403
- {
404
- "findings": [
405
- {"area": "...", "discovery": "...", "source": "file or search"}
406
- ],
407
- "gaps_remaining": [
408
- {"id": "gap_N", "description": "..."}
409
- ],
410
- "gaps_resolved": ["gap_1", "gap_2"],
411
- "overall_knowledge_confidence": 0-100
412
- }
413
- """
414
-
415
- # Wait for scout to complete.
416
- # Update gaps list from scout results.
417
-
418
- # === PLANNING PHASE (always runs — 1 planner per iteration) ===
419
-
420
- Spawn Planning Ant (Route-Setter) via Task tool with subagent_type="aether-route-setter":
421
- # NOTE: Claude Code uses aether-route-setter; OpenCode now uses same specialist agent
422
-
423
- """
424
- You are a Route-Setter Ant in the Aether Colony.
425
-
426
- --- MISSION ---
427
- Create or refine a project plan based on research findings.
428
-
429
- Goal: "{goal}"
430
- Iteration: {iteration}/{max_iterations}
431
-
432
- {context_capsule_prompt}
433
-
434
- --- PLANNING DISCIPLINE ---
435
- Read .aether/planning.md for full reference.
436
-
437
- Key rules:
438
- - Bite-sized tasks (2-5 minutes each) - one action per task
439
- - Goal-oriented - describe WHAT to achieve, not HOW
440
- - Constraints define boundaries, not implementation
441
- - Hints point toward patterns, not solutions
442
- - Success criteria are testable outcomes
443
-
444
- Task format (GOAL-ORIENTED):
445
- ```
446
- Task N.1: {goal description}
447
- Goal: What to achieve (not how)
448
- Constraints:
449
- - Boundaries and requirements
450
- - Integration points
451
- Hints:
452
- - Pointer to existing patterns (optional)
453
- - Relevant files to reference (optional)
454
- Success Criteria:
455
- - Testable outcome 1
456
- - Testable outcome 2
457
- ```
458
-
459
- DO NOT include:
460
- - Exact code to write
461
- - Specific function names (unless critical API)
462
- - Implementation details
463
- - Line-by-line instructions
464
-
465
- Workers discover implementations by reading existing code and patterns.
466
- This enables TRUE EMERGENCE - different approaches based on context.
467
-
468
- --- RESEARCH FINDINGS ---
469
- {scout.findings formatted — compact, max 5 items}
470
-
471
- --- PHASE DOMAIN RESEARCH (from Step 3.6) ---
472
- {research_findings_summary if available, otherwise omit this section}
473
-
474
- Remaining Gaps:
475
- {gaps formatted — compact, max 3 items}
476
-
477
- --- CURRENT PLAN DRAFT ---
478
- {if plan_draft:}
479
- {plan_draft}
480
- {else:}
481
- No plan yet. Create initial draft.
482
- {end if}
483
-
484
- --- INSTRUCTIONS ---
485
- 1. If no plan exists, create 3-6 phases with concrete tasks
486
- 2. If plan exists, refine based on NEW information only
487
- 3. Rate confidence across 5 dimensions
488
- 4. Keep response concise — no verbose explanations
489
-
490
- Do NOT assign castes to tasks - describe the work only.
491
-
492
- --- OUTPUT CONSTRAINTS ---
493
- Maximum 6 phases. Maximum 4 tasks per phase.
494
- Maximum 2 sentence description per task.
495
- Confidence dimensions as single numbers, not paragraphs.
496
-
497
- --- OUTPUT FORMAT ---
498
- Return JSON:
499
- {
500
- "plan": {
501
- "phases": [
502
- {
503
- "id": 1,
504
- "name": "...",
505
- "description": "...",
506
- "tasks": [
507
- {
508
- "id": "1.1",
509
- "goal": "What to achieve (not how)",
510
- "constraints": ["boundary 1", "boundary 2"],
511
- "hints": ["optional pointer to pattern"],
512
- "success_criteria": ["testable outcome 1", "testable outcome 2"],
513
- "depends_on": []
514
- }
515
- ],
516
- "success_criteria": ["...", "..."]
517
- }
518
- ]
519
- },
520
- "confidence": {
521
- "knowledge": 0-100,
522
- "requirements": 0-100,
523
- "risks": 0-100,
524
- "dependencies": 0-100,
525
- "effort": 0-100,
526
- "overall": 0-100
527
- },
528
- "delta_reasoning": "One sentence: what changed from last iteration",
529
- "unresolved_gaps": ["...", "..."]
530
- }
531
- """
532
-
533
- Parse planning results. Update plan_draft and confidence.
534
-
535
- # === UPDATE WATCH FILES ===
536
-
537
- Update `.aether/data/watch-status.txt` with current state.
538
- Update `.aether/data/watch-progress.txt` with progress bar.
539
-
540
- # === STALL TRACKING ===
541
-
542
- delta = confidence - last_confidence
543
- if delta < 5:
544
- stall_count += 1
545
- else:
546
- stall_count = 0
547
-
548
- last_confidence = confidence
549
- ```
550
-
551
- **After loop exits (auto-finalize, no user prompt needed):**
552
-
553
- ```
554
- Planning complete after {iteration} iteration(s).
555
-
556
- Confidence: {confidence}%
557
- {if gaps remain:}
558
- Note: {gaps.length} knowledge gap(s) deferred — these can be resolved during builds.
559
- {end if}
560
- ```
561
-
562
- Proceed directly to Step 5. No user confirmation needed — the plan auto-finalizes.
563
-
564
- ### Step 5: Finalize Plan
565
-
566
- Once loop exits (confidence >= {target_confidence}, max iterations reached, or stall detected):
567
-
568
- Read current COLONY_STATE.json, then update:
569
- - Set `plan.phases` to the final phases array
570
- - Set `plan.generated_at` to ISO-8601 timestamp
571
- - Set `state` to `"READY"`
572
- - Append event: `"<timestamp>|plan_generated|plan|Generated {N} phases with {confidence}% confidence"`
573
-
574
- Write COLONY_STATE.json.
575
-
576
- **Verify the write** — read back and confirm the plan persisted:
577
- ```bash
578
- verify_phases=$(jq '.plan.phases | length' .aether/data/COLONY_STATE.json)
579
- verify_timestamp=$(jq -r '.plan.generated_at' .aether/data/COLONY_STATE.json)
580
- verify_state=$(jq -r '.state' .aether/data/COLONY_STATE.json)
581
- if [[ "$verify_phases" -lt 1 || "$verify_timestamp" == "null" || "$verify_state" != "READY" ]]; then
582
- echo "ERROR: Plan write verification failed (phases=$verify_phases, generated_at=$verify_timestamp, state=$verify_state)"
583
- echo "Attempting retry write..."
584
- bash .aether/aether-utils.sh state-write "$(jq --argjson phases "$(echo '$PLAN_JSON' | jq '.plan.phases')" --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" '.plan.phases = $phases | .plan.generated_at = $ts | .state = "READY"' .aether/data/COLONY_STATE.json)"
585
- verify_phases=$(jq '.plan.phases | length' .aether/data/COLONY_STATE.json)
586
- if [[ "$verify_phases" -lt 1 ]]; then
587
- echo "FATAL: Retry write also failed. Plan was not persisted."
588
- echo "Re-run /ant:plan to regenerate."
589
- stop
590
- fi
591
- fi
592
- echo "Plan verified: $verify_phases phases, generated_at=$verify_timestamp, state=$verify_state"
593
- ```
594
-
595
- Log plan completion: `bash .aether/aether-utils.sh activity-log "PLAN_COMPLETE" "queen" "Plan finalized with {confidence}% confidence"`
596
-
597
- Update watch-status.txt:
598
- ```
599
- AETHER COLONY :: READY
600
- =======================
601
-
602
- State: READY
603
- Plan: {N} phases generated
604
- Confidence: {confidence}%
605
-
606
- Ready to build.
607
- ```
608
-
609
- ### Step 6: Display Plan
610
-
611
- Read `plan.phases` from COLONY_STATE.json and display:
612
-
613
- ```
614
- 📊🐜🗺️🐜📊 ═══════════════════════════════════════════════════
615
- C O L O N Y P L A N
616
- ═══════════════════════════════════════════════════ 📊🐜🗺️🐜📊
617
-
618
- 👑 Goal: {goal}
619
-
620
- {if plan was just generated:}
621
- 📊 Confidence: {confidence}%
622
- 🔄 Iterations: {iteration}
623
- {end if}
624
-
625
- ─────────────────────────────────────────────────────
626
-
627
- 📍 Phase {id}: {name} [{STATUS}]
628
- {description}
629
-
630
- 🐜 Tasks:
631
- {status_icon} {id}: {description}
632
-
633
- ✅ Success Criteria:
634
- • {criterion}
635
-
636
- ─────────────────────────────────────────────────────
637
- (repeat for each phase)
638
-
639
- 🐜 Next Steps:
640
- {Calculate first_incomplete_phase: iterate through phases, find first where status != 'completed'. Default to 1 if all complete or no phases. Look up its name from plan.phases[id].name.}
641
- /ant:build {first_incomplete_phase} 🔨 Phase {first_incomplete_phase}: {phase_name}
642
- /ant:focus "<area>" 🎯 Focus colony attention
643
- /ant:status 📊 View colony status
644
-
645
- 💾 Plan persisted — safe to /clear before building
646
- ```
647
-
648
- Status icons: pending = `[ ]`, in_progress = `[~]`, completed = `[✓]`
649
-
650
- ---
651
-
652
- ## Confidence Scoring Reference
653
-
654
- Each dimension rated 0-100%:
655
-
656
- | Dimension | What It Measures |
657
- |-----------|------------------|
658
- | Knowledge | Understanding of codebase structure, patterns, tech stack |
659
- | Requirements | Clarity of success criteria and acceptance conditions |
660
- | Risks | Identification of potential blockers and failure modes |
661
- | Dependencies | Understanding of what affects what, ordering constraints |
662
- | Effort | Ability to estimate relative complexity of tasks |
663
-
664
- **Overall** = weighted average (knowledge 25%, requirements 25%, risks 20%, dependencies 15%, effort 15%)
665
-
666
- **Target:** Use the selected planning depth target. Higher targets trade latency for stronger up-front plan quality.
667
-
668
- ---
669
-
670
- ## Auto-Termination Safeguards
671
-
672
- The planning loop terminates automatically without requiring user input:
673
-
674
- 1. **Confidence Threshold**: Loop exits when overall confidence reaches `{target_confidence}%`
675
-
676
- 2. **Hard Iteration Cap**: Maximum `{max_iterations}` iterations (2 subagents per iteration: 1 scout + 1 planner)
677
-
678
- 3. **Stall Detection**: If confidence improves < 5% for 2 consecutive iterations, auto-finalize current plan
679
-
680
- 4. **Single Scout Research**: One researcher per iteration (broad on iteration 1, gap-focused on 2+) — no parallel Alpha/Beta or synthesis agent
681
-
682
- 5. **Compressed Output**: Subagents limited to 5 findings max, 2-sentence summaries, compact JSON
683
-
684
- 6. **Escape Hatch**: `/ant:plan --accept` accepts current plan regardless of confidence