aether-colony 5.0.0 → 5.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (317) hide show
  1. package/.aether/aether-utils.sh +3226 -3345
  2. package/.aether/agents-claude/aether-ambassador.md +265 -0
  3. package/.aether/agents-claude/aether-archaeologist.md +327 -0
  4. package/.aether/agents-claude/aether-architect.md +236 -0
  5. package/.aether/agents-claude/aether-auditor.md +271 -0
  6. package/.aether/agents-claude/aether-builder.md +224 -0
  7. package/.aether/agents-claude/aether-chaos.md +269 -0
  8. package/.aether/agents-claude/aether-chronicler.md +305 -0
  9. package/.aether/agents-claude/aether-gatekeeper.md +330 -0
  10. package/.aether/agents-claude/aether-includer.md +374 -0
  11. package/.aether/agents-claude/aether-keeper.md +272 -0
  12. package/.aether/agents-claude/aether-measurer.md +322 -0
  13. package/.aether/agents-claude/aether-oracle.md +237 -0
  14. package/.aether/agents-claude/aether-probe.md +211 -0
  15. package/.aether/agents-claude/aether-queen.md +330 -0
  16. package/.aether/agents-claude/aether-route-setter.md +178 -0
  17. package/.aether/agents-claude/aether-sage.md +418 -0
  18. package/.aether/agents-claude/aether-scout.md +179 -0
  19. package/.aether/agents-claude/aether-surveyor-disciplines.md +417 -0
  20. package/.aether/agents-claude/aether-surveyor-nest.md +355 -0
  21. package/.aether/agents-claude/aether-surveyor-pathogens.md +289 -0
  22. package/.aether/agents-claude/aether-surveyor-provisions.md +360 -0
  23. package/.aether/agents-claude/aether-tracker.md +270 -0
  24. package/.aether/agents-claude/aether-watcher.md +280 -0
  25. package/.aether/agents-claude/aether-weaver.md +248 -0
  26. package/.aether/commands/archaeology.yaml +653 -0
  27. package/.aether/commands/build.yaml +1221 -0
  28. package/.aether/commands/chaos.yaml +653 -0
  29. package/.aether/commands/colonize.yaml +442 -0
  30. package/.aether/commands/continue.yaml +1484 -0
  31. package/.aether/commands/council.yaml +509 -0
  32. package/.aether/commands/data-clean.yaml +80 -0
  33. package/.aether/commands/dream.yaml +275 -0
  34. package/.aether/commands/entomb.yaml +863 -0
  35. package/.aether/commands/export-signals.yaml +64 -0
  36. package/.aether/commands/feedback.yaml +158 -0
  37. package/.aether/commands/flag.yaml +160 -0
  38. package/.aether/commands/flags.yaml +177 -0
  39. package/.aether/commands/focus.yaml +112 -0
  40. package/.aether/commands/help.yaml +167 -0
  41. package/.aether/commands/history.yaml +137 -0
  42. package/.aether/commands/import-signals.yaml +79 -0
  43. package/.aether/commands/init.yaml +502 -0
  44. package/.aether/commands/insert-phase.yaml +102 -0
  45. package/.aether/commands/interpret.yaml +285 -0
  46. package/.aether/commands/lay-eggs.yaml +224 -0
  47. package/.aether/commands/maturity.yaml +122 -0
  48. package/.aether/commands/memory-details.yaml +74 -0
  49. package/.aether/commands/migrate-state.yaml +174 -0
  50. package/.aether/commands/oracle.yaml +1224 -0
  51. package/.aether/commands/organize.yaml +446 -0
  52. package/.aether/commands/patrol.yaml +621 -0
  53. package/.aether/commands/pause-colony.yaml +424 -0
  54. package/.aether/commands/phase.yaml +124 -0
  55. package/.aether/commands/pheromones.yaml +153 -0
  56. package/.aether/commands/plan.yaml +1364 -0
  57. package/.aether/commands/preferences.yaml +63 -0
  58. package/.aether/commands/quick.yaml +104 -0
  59. package/.aether/commands/redirect.yaml +123 -0
  60. package/.aether/commands/resume-colony.yaml +375 -0
  61. package/.aether/commands/resume.yaml +407 -0
  62. package/.aether/commands/run.yaml +229 -0
  63. package/.aether/commands/seal.yaml +1214 -0
  64. package/.aether/commands/skill-create.yaml +337 -0
  65. package/.aether/commands/status.yaml +408 -0
  66. package/.aether/commands/swarm.yaml +352 -0
  67. package/.aether/commands/tunnels.yaml +814 -0
  68. package/.aether/commands/update.yaml +131 -0
  69. package/.aether/commands/verify-castes.yaml +159 -0
  70. package/.aether/commands/watch.yaml +454 -0
  71. package/.aether/docs/INCIDENT_TEMPLATE.md +32 -0
  72. package/.aether/docs/QUEEN-SYSTEM.md +11 -11
  73. package/.aether/docs/README.md +32 -2
  74. package/.aether/docs/command-playbooks/README.md +23 -0
  75. package/.aether/docs/command-playbooks/build-complete.md +349 -0
  76. package/.aether/docs/command-playbooks/build-context.md +282 -0
  77. package/.aether/docs/command-playbooks/build-full.md +1683 -0
  78. package/.aether/docs/command-playbooks/build-prep.md +284 -0
  79. package/.aether/docs/command-playbooks/build-verify.md +405 -0
  80. package/.aether/docs/command-playbooks/build-wave.md +749 -0
  81. package/.aether/docs/command-playbooks/continue-advance.md +524 -0
  82. package/.aether/docs/command-playbooks/continue-finalize.md +447 -0
  83. package/.aether/docs/command-playbooks/continue-full.md +1725 -0
  84. package/.aether/docs/command-playbooks/continue-gates.md +686 -0
  85. package/.aether/docs/command-playbooks/continue-verify.md +407 -0
  86. package/.aether/docs/context-continuity.md +84 -0
  87. package/.aether/docs/disciplines/DISCIPLINES.md +9 -7
  88. package/.aether/docs/error-codes.md +1 -1
  89. package/.aether/docs/known-issues.md +34 -173
  90. package/.aether/docs/pheromones.md +86 -6
  91. package/.aether/docs/plans/pheromone-display-plan.md +257 -0
  92. package/.aether/docs/queen-commands.md +10 -9
  93. package/.aether/docs/source-of-truth-map.md +132 -0
  94. package/.aether/docs/xml-utilities.md +47 -0
  95. package/.aether/rules/aether-colony.md +23 -13
  96. package/.aether/scripts/incident-test-add.sh +47 -0
  97. package/.aether/scripts/weekly-audit.sh +79 -0
  98. package/.aether/skills/.index.json +649 -0
  99. package/.aether/skills/colony/.manifest.json +16 -0
  100. package/.aether/skills/colony/build-discipline/SKILL.md +78 -0
  101. package/.aether/skills/colony/colony-interaction/SKILL.md +56 -0
  102. package/.aether/skills/colony/colony-lifecycle/SKILL.md +77 -0
  103. package/.aether/skills/colony/colony-visuals/SKILL.md +112 -0
  104. package/.aether/skills/colony/context-management/SKILL.md +80 -0
  105. package/.aether/skills/colony/error-presentation/SKILL.md +99 -0
  106. package/.aether/skills/colony/pheromone-protocol/SKILL.md +79 -0
  107. package/.aether/skills/colony/pheromone-visibility/SKILL.md +81 -0
  108. package/.aether/skills/colony/state-safety/SKILL.md +84 -0
  109. package/.aether/skills/colony/worker-priming/SKILL.md +82 -0
  110. package/.aether/skills/domain/.manifest.json +24 -0
  111. package/.aether/skills/domain/README.md +33 -0
  112. package/.aether/skills/domain/django/SKILL.md +49 -0
  113. package/.aether/skills/domain/docker/SKILL.md +52 -0
  114. package/.aether/skills/domain/golang/SKILL.md +52 -0
  115. package/.aether/skills/domain/graphql/SKILL.md +51 -0
  116. package/.aether/skills/domain/html-css/SKILL.md +48 -0
  117. package/.aether/skills/domain/nextjs/SKILL.md +45 -0
  118. package/.aether/skills/domain/nodejs/SKILL.md +53 -0
  119. package/.aether/skills/domain/postgresql/SKILL.md +53 -0
  120. package/.aether/skills/domain/prisma/SKILL.md +59 -0
  121. package/.aether/skills/domain/python/SKILL.md +50 -0
  122. package/.aether/skills/domain/rails/SKILL.md +52 -0
  123. package/.aether/skills/domain/react/SKILL.md +45 -0
  124. package/.aether/skills/domain/rest-api/SKILL.md +58 -0
  125. package/.aether/skills/domain/svelte/SKILL.md +47 -0
  126. package/.aether/skills/domain/tailwind/SKILL.md +45 -0
  127. package/.aether/skills/domain/testing/SKILL.md +53 -0
  128. package/.aether/skills/domain/typescript/SKILL.md +58 -0
  129. package/.aether/skills/domain/vue/SKILL.md +49 -0
  130. package/.aether/templates/QUEEN.md.template +23 -41
  131. package/.aether/templates/colony-state-reset.jq.template +1 -0
  132. package/.aether/templates/colony-state.template.json +4 -0
  133. package/.aether/templates/learning-observations.template.json +6 -0
  134. package/.aether/templates/midden.template.json +13 -0
  135. package/.aether/templates/pheromones.template.json +6 -0
  136. package/.aether/templates/session.template.json +9 -0
  137. package/.aether/utils/atomic-write.sh +63 -17
  138. package/.aether/utils/chamber-utils.sh +145 -2
  139. package/.aether/utils/council.sh +425 -0
  140. package/.aether/utils/emoji-audit.sh +166 -0
  141. package/.aether/utils/error-handler.sh +21 -7
  142. package/.aether/utils/file-lock.sh +182 -27
  143. package/.aether/utils/flag.sh +278 -0
  144. package/.aether/utils/hive.sh +572 -0
  145. package/.aether/utils/immune.sh +508 -0
  146. package/.aether/utils/learning.sh +1928 -0
  147. package/.aether/utils/midden.sh +520 -0
  148. package/.aether/utils/oracle/oracle.md +168 -0
  149. package/.aether/utils/oracle/oracle.sh +1023 -0
  150. package/.aether/utils/pheromone.sh +2029 -0
  151. package/.aether/utils/queen.sh +1710 -0
  152. package/.aether/utils/scan.sh +860 -0
  153. package/.aether/utils/semantic-cli.sh +10 -8
  154. package/.aether/utils/session.sh +816 -0
  155. package/.aether/utils/skills.sh +509 -0
  156. package/.aether/utils/spawn-tree.sh +103 -271
  157. package/.aether/utils/spawn.sh +260 -0
  158. package/.aether/utils/state-api.sh +389 -0
  159. package/.aether/utils/state-loader.sh +8 -6
  160. package/.aether/utils/suggest.sh +611 -0
  161. package/.aether/utils/swarm-display.sh +10 -1
  162. package/.aether/utils/swarm.sh +1004 -0
  163. package/.aether/utils/watch-spawn-tree.sh +11 -2
  164. package/.aether/utils/xml-compose.sh +2 -2
  165. package/.aether/utils/xml-convert.sh +9 -5
  166. package/.aether/utils/xml-core.sh +5 -9
  167. package/.aether/utils/xml-query.sh +4 -4
  168. package/.aether/workers.md +86 -67
  169. package/.claude/agents/ant/aether-ambassador.md +2 -1
  170. package/.claude/agents/ant/aether-archaeologist.md +6 -1
  171. package/.claude/agents/ant/aether-architect.md +236 -0
  172. package/.claude/agents/ant/aether-auditor.md +6 -1
  173. package/.claude/agents/ant/aether-builder.md +38 -1
  174. package/.claude/agents/ant/aether-chaos.md +2 -1
  175. package/.claude/agents/ant/aether-chronicler.md +1 -0
  176. package/.claude/agents/ant/aether-gatekeeper.md +6 -1
  177. package/.claude/agents/ant/aether-includer.md +1 -0
  178. package/.claude/agents/ant/aether-keeper.md +1 -0
  179. package/.claude/agents/ant/aether-measurer.md +6 -1
  180. package/.claude/agents/ant/aether-oracle.md +237 -0
  181. package/.claude/agents/ant/aether-probe.md +2 -1
  182. package/.claude/agents/ant/aether-queen.md +6 -1
  183. package/.claude/agents/ant/aether-route-setter.md +6 -1
  184. package/.claude/agents/ant/aether-sage.md +68 -3
  185. package/.claude/agents/ant/aether-scout.md +38 -1
  186. package/.claude/agents/ant/aether-surveyor-disciplines.md +2 -1
  187. package/.claude/agents/ant/aether-surveyor-nest.md +2 -1
  188. package/.claude/agents/ant/aether-surveyor-pathogens.md +2 -1
  189. package/.claude/agents/ant/aether-surveyor-provisions.md +2 -1
  190. package/.claude/agents/ant/aether-tracker.md +6 -1
  191. package/.claude/agents/ant/aether-watcher.md +37 -1
  192. package/.claude/agents/ant/aether-weaver.md +2 -1
  193. package/.claude/commands/ant/archaeology.md +1 -8
  194. package/.claude/commands/ant/build.md +43 -1159
  195. package/.claude/commands/ant/chaos.md +1 -14
  196. package/.claude/commands/ant/colonize.md +3 -14
  197. package/.claude/commands/ant/continue.md +40 -1026
  198. package/.claude/commands/ant/council.md +213 -15
  199. package/.claude/commands/ant/data-clean.md +81 -0
  200. package/.claude/commands/ant/dream.md +12 -9
  201. package/.claude/commands/ant/entomb.md +62 -87
  202. package/.claude/commands/ant/export-signals.md +57 -0
  203. package/.claude/commands/ant/feedback.md +18 -0
  204. package/.claude/commands/ant/flag.md +12 -0
  205. package/.claude/commands/ant/flags.md +22 -8
  206. package/.claude/commands/ant/focus.md +18 -0
  207. package/.claude/commands/ant/help.md +40 -8
  208. package/.claude/commands/ant/history.md +3 -0
  209. package/.claude/commands/ant/import-signals.md +71 -0
  210. package/.claude/commands/ant/init.md +349 -191
  211. package/.claude/commands/ant/insert-phase.md +105 -0
  212. package/.claude/commands/ant/interpret.md +11 -0
  213. package/.claude/commands/ant/lay-eggs.md +167 -158
  214. package/.claude/commands/ant/maturity.md +22 -11
  215. package/.claude/commands/ant/memory-details.md +77 -0
  216. package/.claude/commands/ant/migrate-state.md +6 -0
  217. package/.claude/commands/ant/oracle.md +317 -62
  218. package/.claude/commands/ant/organize.md +10 -5
  219. package/.claude/commands/ant/patrol.md +620 -0
  220. package/.claude/commands/ant/pause-colony.md +8 -22
  221. package/.claude/commands/ant/phase.md +26 -37
  222. package/.claude/commands/ant/pheromones.md +156 -0
  223. package/.claude/commands/ant/plan.md +199 -50
  224. package/.claude/commands/ant/preferences.md +65 -0
  225. package/.claude/commands/ant/quick.md +100 -0
  226. package/.claude/commands/ant/redirect.md +18 -0
  227. package/.claude/commands/ant/resume-colony.md +37 -22
  228. package/.claude/commands/ant/resume.md +60 -7
  229. package/.claude/commands/ant/run.md +231 -0
  230. package/.claude/commands/ant/seal.md +506 -78
  231. package/.claude/commands/ant/skill-create.md +286 -0
  232. package/.claude/commands/ant/status.md +171 -1
  233. package/.claude/commands/ant/swarm.md +11 -23
  234. package/.claude/commands/ant/tunnels.md +1 -0
  235. package/.claude/commands/ant/update.md +58 -135
  236. package/.claude/commands/ant/verify-castes.md +90 -42
  237. package/.claude/commands/ant/watch.md +1 -0
  238. package/.opencode/agents/aether-ambassador.md +1 -1
  239. package/.opencode/agents/aether-architect.md +133 -0
  240. package/.opencode/agents/aether-builder.md +3 -3
  241. package/.opencode/agents/aether-oracle.md +137 -0
  242. package/.opencode/agents/aether-queen.md +1 -1
  243. package/.opencode/agents/aether-route-setter.md +1 -1
  244. package/.opencode/agents/aether-scout.md +1 -1
  245. package/.opencode/agents/aether-surveyor-disciplines.md +6 -1
  246. package/.opencode/agents/aether-surveyor-nest.md +6 -1
  247. package/.opencode/agents/aether-surveyor-pathogens.md +6 -1
  248. package/.opencode/agents/aether-surveyor-provisions.md +6 -1
  249. package/.opencode/agents/aether-tracker.md +1 -1
  250. package/.opencode/agents/aether-watcher.md +1 -1
  251. package/.opencode/agents/aether-weaver.md +1 -1
  252. package/.opencode/commands/ant/archaeology.md +7 -14
  253. package/.opencode/commands/ant/build.md +54 -88
  254. package/.opencode/commands/ant/chaos.md +7 -24
  255. package/.opencode/commands/ant/colonize.md +10 -17
  256. package/.opencode/commands/ant/continue.md +595 -66
  257. package/.opencode/commands/ant/council.md +150 -18
  258. package/.opencode/commands/ant/data-clean.md +77 -0
  259. package/.opencode/commands/ant/dream.md +15 -17
  260. package/.opencode/commands/ant/entomb.md +28 -18
  261. package/.opencode/commands/ant/export-signals.md +54 -0
  262. package/.opencode/commands/ant/feedback.md +24 -5
  263. package/.opencode/commands/ant/flag.md +16 -4
  264. package/.opencode/commands/ant/flags.md +24 -10
  265. package/.opencode/commands/ant/focus.md +22 -5
  266. package/.opencode/commands/ant/help.md +41 -8
  267. package/.opencode/commands/ant/history.md +9 -0
  268. package/.opencode/commands/ant/import-signals.md +68 -0
  269. package/.opencode/commands/ant/init.md +396 -154
  270. package/.opencode/commands/ant/insert-phase.md +111 -0
  271. package/.opencode/commands/ant/interpret.md +16 -0
  272. package/.opencode/commands/ant/lay-eggs.md +184 -112
  273. package/.opencode/commands/ant/maturity.md +18 -2
  274. package/.opencode/commands/ant/memory-details.md +83 -0
  275. package/.opencode/commands/ant/migrate-state.md +12 -0
  276. package/.opencode/commands/ant/oracle.md +322 -67
  277. package/.opencode/commands/ant/organize.md +14 -12
  278. package/.opencode/commands/ant/patrol.md +626 -0
  279. package/.opencode/commands/ant/pause-colony.md +12 -29
  280. package/.opencode/commands/ant/phase.md +30 -40
  281. package/.opencode/commands/ant/pheromones.md +162 -0
  282. package/.opencode/commands/ant/plan.md +210 -57
  283. package/.opencode/commands/ant/preferences.md +71 -0
  284. package/.opencode/commands/ant/quick.md +91 -0
  285. package/.opencode/commands/ant/redirect.md +22 -5
  286. package/.opencode/commands/ant/resume-colony.md +41 -29
  287. package/.opencode/commands/ant/resume.md +80 -20
  288. package/.opencode/commands/ant/run.md +237 -0
  289. package/.opencode/commands/ant/seal.md +230 -25
  290. package/.opencode/commands/ant/skill-create.md +63 -0
  291. package/.opencode/commands/ant/status.md +125 -30
  292. package/.opencode/commands/ant/swarm.md +3 -345
  293. package/.opencode/commands/ant/tunnels.md +3 -9
  294. package/.opencode/commands/ant/update.md +63 -127
  295. package/.opencode/commands/ant/verify-castes.md +96 -42
  296. package/.opencode/commands/ant/watch.md +7 -0
  297. package/CHANGELOG.md +368 -1
  298. package/README.md +195 -324
  299. package/bin/cli.js +236 -429
  300. package/bin/generate-commands.js +186 -0
  301. package/bin/generate-commands.sh +128 -89
  302. package/bin/lib/spawn-logger.js +0 -15
  303. package/bin/lib/update-transaction.js +285 -35
  304. package/bin/npx-install.js +178 -0
  305. package/bin/validate-package.sh +85 -3
  306. package/package.json +16 -4
  307. package/.aether/CONTEXT.md +0 -160
  308. package/.aether/docs/QUEEN.md +0 -84
  309. package/.aether/exchange/colony-registry.xml +0 -11
  310. package/.aether/exchange/pheromones.xml +0 -87
  311. package/.aether/exchange/queen-wisdom.xml +0 -14
  312. package/.aether/model-profiles.yaml +0 -100
  313. package/.aether/utils/spawn-with-model.sh +0 -56
  314. package/bin/lib/model-profiles.js +0 -445
  315. package/bin/lib/model-verify.js +0 -288
  316. package/bin/lib/proxy-health.js +0 -253
  317. package/bin/lib/telemetry.js +0 -441
@@ -0,0 +1,407 @@
1
+ ---
2
+ name: ant:continue
3
+ description: "➡️🐜🚪🐜➡️ Detect build completion, reconcile state, and advance to next phase"
4
+ ---
5
+
6
+ You are the **Queen Ant Colony**. Reconcile completed work and advance to the next phase.
7
+
8
+ ## Instructions
9
+
10
+ Parse `$ARGUMENTS`:
11
+ - If contains `--no-visual`: set `visual_mode = false` (visual is ON by default)
12
+ - Otherwise: set `visual_mode = true`
13
+
14
+ ### Step 1: Read State
15
+
16
+ Read `.aether/data/COLONY_STATE.json`.
17
+
18
+ **Auto-upgrade old state:**
19
+ If `version` field is missing, "1.0", or "2.0":
20
+ 1. Preserve: `goal`, `state`, `current_phase`, `plan.phases`
21
+ 2. Write upgraded v3.0 state (same structure as /ant:init but preserving data)
22
+ 3. Output: `State auto-upgraded to v3.0`
23
+ 4. Continue with command.
24
+
25
+ Extract: `goal`, `state`, `current_phase`, `plan.phases`, `errors`, `memory`, `events`, `build_started_at`.
26
+
27
+ **Validation:**
28
+ - If `goal: null` -> output "No colony initialized. Run /ant:init first." and stop.
29
+ - If `milestone` == `"Crowned Anthill"` -> output "This colony has been sealed. Start a new colony with `/ant:init \"new goal\"`." and stop.
30
+ - If `plan.phases` is empty -> output "No project plan. Run /ant:plan first." and stop.
31
+
32
+ ### Step 1.5: Load State and Show Resumption Context
33
+
34
+ Run using the Bash tool with description "Loading colony state...": `bash .aether/aether-utils.sh load-state`
35
+
36
+ If successful and goal is not null:
37
+ 1. Extract current_phase from state
38
+ 2. Get phase name from plan.phases[current_phase - 1].name (or "(unnamed)")
39
+ 3. Display brief resumption context:
40
+ ```
41
+ 🔄 Resuming: Phase X - Name
42
+ ```
43
+
44
+ If .aether/HANDOFF.md exists (detected in load-state output):
45
+ - Display "Resuming from paused session"
46
+ - Read .aether/HANDOFF.md for additional context
47
+ - Remove .aether/HANDOFF.md after display (cleanup)
48
+
49
+ Run using the Bash tool with description "Releasing colony lock...": `bash .aether/aether-utils.sh unload-state` to release lock.
50
+
51
+ **Error handling:**
52
+ - If E_FILE_NOT_FOUND: "No colony initialized. Run /ant:init first." and stop
53
+ - If validation error: Display error details with recovery suggestion and stop
54
+ - For other errors: Display generic error and suggest /ant:status for diagnostics
55
+
56
+ **Completion Detection:**
57
+
58
+ If `state == "EXECUTING"`:
59
+ 1. Check if `build_started_at` exists
60
+ 2. Look for phase completion evidence:
61
+ - Activity log entries showing task completion
62
+ - Files created/modified matching phase tasks
63
+ 3. If no evidence and build started > 30 min ago:
64
+ - Display "Stale EXECUTING state. Build may have been interrupted."
65
+ - Offer: continue anyway or rollback to git checkpoint
66
+ - Rollback procedure: `git stash list | grep "aether-checkpoint"` to find ref, then `git stash pop <ref>` to restore
67
+
68
+ If `state != "EXECUTING"`:
69
+ - Normal continue flow (no build to reconcile)
70
+
71
+ ### Step 1.5.2: Load Survey Context (Non-blocking)
72
+
73
+ Run using the Bash tool with description "Checking survey context...":
74
+ ```bash
75
+ survey_check=$(bash .aether/aether-utils.sh survey-verify 2>/dev/null || true)
76
+ survey_docs=$(ls -1 .aether/data/survey/*.md 2>/dev/null | wc -l | tr -d ' ')
77
+ survey_latest=$(ls -t .aether/data/survey/*.md 2>/dev/null | head -1)
78
+ if [[ -n "$survey_latest" ]]; then
79
+ now_epoch=$(date +%s)
80
+ modified_epoch=$(stat -f %m "$survey_latest" 2>/dev/null || stat -c %Y "$survey_latest" 2>/dev/null || echo 0)
81
+ survey_age_days=$(( (now_epoch - modified_epoch) / 86400 ))
82
+ else
83
+ survey_age_days=-1
84
+ fi
85
+ echo "{\"docs\":$survey_docs,\"age_days\":$survey_age_days,\"verify\":$survey_check}"
86
+ ```
87
+
88
+ Interpretation:
89
+ - If survey docs are missing (`docs == 0`), continue without blocking and display:
90
+ `🗺️ Survey: not found (run /ant:colonize for stronger context)`
91
+ - If survey exists but is stale (`age_days > 14`), continue without blocking and display:
92
+ `🗺️ Survey: {docs} docs loaded ({age_days}d old, consider /ant:colonize --force-resurvey)`
93
+ - Otherwise display:
94
+ `🗺️ Survey: {docs} docs loaded ({age_days}d old)`
95
+
96
+ Use this survey status as advisory context for the verification report only.
97
+
98
+ ### Step 1.5: Verification Loop Gate (MANDATORY)
99
+
100
+ **The Iron Law:** No phase advancement without fresh verification evidence.
101
+
102
+ Before ANY phase can advance, execute the 6-phase verification loop. See `.aether/docs/disciplines/verification-loop.md` for full reference.
103
+
104
+ #### 1. Command Resolution (Priority Chain)
105
+
106
+ Resolve each command (build, test, types, lint) using this priority chain. Stop at the first source that provides a value for each command:
107
+
108
+ **Priority 1 — CLAUDE.md (System Context):**
109
+ Check the CLAUDE.md instructions already loaded in your system context for explicit build, test, type-check, or lint commands. These are authoritative and override all other sources.
110
+
111
+ **Priority 2 — codebase.md `## Commands`:**
112
+ Read `.aether/data/codebase.md` and look for the `## Commands` section. Use any commands listed there for slots not yet filled by Priority 1.
113
+
114
+ **Priority 3 — Fallback Heuristic Table:**
115
+ For any commands still unresolved, check for these files in order, use first match:
116
+
117
+ | File | Build | Test | Types | Lint |
118
+ |------|-------|------|-------|------|
119
+ | `package.json` | `npm run build` | `npm test` | `npx tsc --noEmit` | `npm run lint` |
120
+ | `Cargo.toml` | `cargo build` | `cargo test` | (built-in) | `cargo clippy` |
121
+ | `go.mod` | `go build ./...` | `go test ./...` | `go vet ./...` | `golangci-lint run` |
122
+ | `pyproject.toml` | `python -m build` | `pytest` | `pyright .` | `ruff check .` |
123
+ | `Makefile` | `make build` | `make test` | (check targets) | `make lint` |
124
+
125
+ If no build system detected, skip build/test/type/lint checks but still verify success criteria.
126
+
127
+ #### 2. Run 6-Phase Verification Loop
128
+
129
+ Execute all applicable phases and capture output:
130
+
131
+ ```
132
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
133
+ 👁️🐜 V E R I F I C A T I O N L O O P
134
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
135
+ Phase {id} — Checking colony work...
136
+ ```
137
+
138
+ **Phase 1: Build Check** (if command exists):
139
+ Run using the Bash tool with description "Running build check...": `{build_command} 2>&1 | tail -30`
140
+ Record: exit code, any errors. **STOP if fails.**
141
+
142
+ **Phase 2: Type Check** (if command exists):
143
+ Run using the Bash tool with description "Running type check...": `{type_command} 2>&1 | head -30`
144
+ Record: error count. Report all type errors.
145
+
146
+ **Phase 3: Lint Check** (if command exists):
147
+ Run using the Bash tool with description "Running lint check...": `{lint_command} 2>&1 | head -30`
148
+ Record: warning count, error count.
149
+
150
+ **Phase 4: Test Check** (if command exists):
151
+ Run using the Bash tool with description "Running test suite...": `{test_command} 2>&1 | tail -50`
152
+ Record: pass count, fail count, exit code. **STOP if fails.**
153
+
154
+ **IMPORTANT:** Store the test command exit code in a variable (e.g., `test_exit_code`) for use in Step 1.5.3 verify-claims.
155
+
156
+ **Coverage Check** (if coverage command exists):
157
+ Run using the Bash tool with description "Checking test coverage...": `{coverage_command} # e.g., npm run test:coverage`
158
+ Record: coverage percentage (target: 80%+ for new code)
159
+
160
+ #### Step 1.5.1: Probe Coverage Agent (Conditional)
161
+
162
+ **Test coverage improvement — runs when coverage < 80% AND tests pass.**
163
+
164
+ 1. **Check coverage threshold condition:**
165
+ - Coverage data is already available from Phase 4 coverage check
166
+ - If tests failed: Skip Probe silently (coverage data unreliable)
167
+ - If coverage_percent >= 80%: Skip Probe silently, continue to Phase 5
168
+ - If coverage_percent < 80% AND tests passed: Proceed to spawn Probe
169
+
170
+ 2. **If skipping Probe:**
171
+ ```
172
+ 🧪🐜 Probe: Coverage at {coverage_percent}% — {reason_for_skip}
173
+ ```
174
+ Continue to Phase 5: Secrets Scan.
175
+
176
+ 3. **If spawning Probe:**
177
+
178
+ a. Generate Probe name and dispatch:
179
+ Run using the Bash tool with description "Generating Probe name...": `probe_name=$(bash .aether/aether-utils.sh generate-ant-name "probe" | jq -r '.result') && bash .aether/aether-utils.sh spawn-log "Queen" "probe" "$probe_name" "Coverage improvement: ${coverage_percent}%" && echo "{\"name\":\"$probe_name\"}"`
180
+
181
+ b. Display:
182
+ ```
183
+ ━━━ 🧪🐜 P R O B E ━━━
184
+ ──── 🧪🐜 Spawning {probe_name} — Coverage improvement ────
185
+ ```
186
+
187
+ d. Determine uncovered files:
188
+ Run using the Bash tool with description "Getting modified source files...": `modified_source_files=$(git diff --name-only HEAD~1 2>/dev/null || git diff --name-only) && source_files=$(echo "$modified_source_files" | grep -v "\.test\." | grep -v "\.spec\." | grep -v "__tests__") && echo "$source_files"`
189
+
190
+ e. Spawn Probe agent:
191
+
192
+ Use the Task tool with subagent_type="aether-probe" (if available; otherwise use general-purpose and inject the Probe role from `.opencode/agents/aether-probe.md`):
193
+
194
+ ```xml
195
+ <mission>
196
+ Improve test coverage for uncovered code paths in the modified files.
197
+ </mission>
198
+
199
+ <work>
200
+ 1. Analyze the modified source files for uncovered branches and edge cases
201
+ 2. Identify which paths lack test coverage
202
+ 3. Generate test cases that exercise uncovered code paths
203
+ 4. Run the new tests to verify they pass
204
+ 5. Report coverage improvements and edge cases discovered
205
+ </work>
206
+
207
+ <context>
208
+ Current coverage: {coverage_percent}%
209
+ Target coverage: 80%
210
+ Modified source files: {modified_source_files}
211
+ </context>
212
+
213
+ <constraints>
214
+ - Test files ONLY — never modify source code
215
+ - Follow existing test conventions in the codebase
216
+ - Do NOT delete or modify existing tests
217
+ </constraints>
218
+
219
+ <output>
220
+ Provide JSON output matching this schema:
221
+ {
222
+ "ant_name": "your probe name",
223
+ "caste": "probe",
224
+ "status": "completed" | "failed" | "blocked",
225
+ "summary": "Brief summary of coverage improvements",
226
+ "coverage": {
227
+ "lines": 0,
228
+ "branches": 0,
229
+ "functions": 0
230
+ },
231
+ "tests_added": ["file1.test.js", "file2.test.js"],
232
+ "edge_cases_discovered": ["edge case 1", "edge case 2"],
233
+ "mutation_score": 0,
234
+ "weak_spots": [],
235
+ "blockers": []
236
+ }
237
+ </output>
238
+ ```
239
+
240
+ f. Parse Probe JSON output and log completion:
241
+ Extract: `tests_added`, `coverage.lines`, `coverage.branches`, `coverage.functions`, `edge_cases_discovered`, `mutation_score`
242
+
243
+ Run using the Bash tool with description "Logging Probe completion...": `bash .aether/aether-utils.sh spawn-complete "$probe_name" "completed" "{\"tests_added\":${#tests_added[@]},\"coverage\":{\"lines\":${coverage_lines},\"branches\":${coverage_branches},\"functions\":${coverage_functions}}}"`
244
+
245
+ g. Log findings to midden:
246
+ Run using the Bash tool with description "Logging Probe findings to midden...": `bash .aether/aether-utils.sh midden-write "coverage" "Probe generated tests, coverage: ${coverage_lines}%/${coverage_branches}%/${coverage_functions}%" "probe"`
247
+
248
+ If edge cases found:
249
+ Run using the Bash tool with description "Logging edge cases to midden...": `bash .aether/aether-utils.sh midden-write "edge_cases" "Found ${#edge_cases_discovered[@]} edge cases" "probe"`
250
+
251
+ 4. **NON-BLOCKING continuation:**
252
+ Display Probe findings summary:
253
+ ```
254
+ 🧪🐜 Probe complete — Findings logged to midden, continuing verification...
255
+ Tests added: {count}
256
+ Edge cases discovered: {count}
257
+ ```
258
+
259
+ **CRITICAL:** ALWAYS continue to Phase 5 (Secrets Scan) regardless of Probe results. Probe is strictly non-blocking — phase advancement continues even if Probe cannot improve coverage.
260
+
261
+ 5. **Record Probe status for verification report:**
262
+ Set `probe_status = "ACTIVE"` and store tests_added count and edge_cases count for the verification report.
263
+
264
+ **Phase 5: Secrets Scan** (basic grep-based secret detection):
265
+ Run using the Bash tool with description "Scanning for exposed secrets...": `grep -rn "sk-\|api_key\|password\s*=" --include="*.ts" --include="*.js" --include="*.py" src/ 2>/dev/null | head -10`
266
+ Run using the Bash tool with description "Scanning for debug artifacts...": `grep -rn "console\.log\|debugger" --include="*.ts" --include="*.tsx" --include="*.js" src/ 2>/dev/null | head -10`
267
+ Record: potential secrets (critical), debug artifacts (warning).
268
+
269
+ Note: Professional security scanning happens in Step 1.8 (Gatekeeper for CVEs) and Step 1.9 (Auditor for code quality).
270
+
271
+ **Phase 6: Diff Review**:
272
+ Run using the Bash tool with description "Reviewing file changes...": `git diff --stat`
273
+ Review changed files for unintended modifications.
274
+
275
+ **Success Criteria Check:**
276
+ Read phase success criteria from `plan.phases[current].success_criteria`.
277
+ For EACH criterion:
278
+ 1. Identify what proves it (file exists? test passes? output shows X?)
279
+ 2. Run the check
280
+ 3. Record evidence or gap
281
+
282
+ Display:
283
+ ```
284
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
285
+ 👁️🐜 V E R I F I C A T I O N R E P O R T
286
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
287
+
288
+ 🔨 Build [PASS/FAIL/SKIP]
289
+ 🔍 Types [PASS/FAIL/SKIP] (X errors)
290
+ 🧹 Lint [PASS/FAIL/SKIP] (X warnings)
291
+ 🧪 Tests [PASS/FAIL/SKIP] (X/Y passed)
292
+ Coverage {percent}% (target: 80%)
293
+ 🧪 Probe [ACTIVE/SKIP] (tests added: X, edge cases: Y)
294
+ 🔒 Secrets [PASS/FAIL] (X issues)
295
+ 📦 Gatekeeper [PASS/WARN/SKIP] (X critical, X high)
296
+ 👥 Auditor [PASS/FAIL] (score: X/100)
297
+ 📋 Diff [X files changed]
298
+
299
+ ──────────────────────────────────────────────────
300
+ 🐜 Success Criteria
301
+ ──────────────────────────────────────────────────
302
+ ✅ {criterion 1}: {specific evidence}
303
+ ✅ {criterion 2}: {specific evidence}
304
+ ❌ {criterion 3}: {what's missing}
305
+
306
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
307
+ Overall: READY / NOT READY
308
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
309
+ ```
310
+
311
+ #### 3. Gate Decision
312
+
313
+ **If NOT READY (any of: build fails, tests fail, critical security issues, success criteria unmet):**
314
+
315
+ ```
316
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
317
+ ⛔🐜 V E R I F I C A T I O N F A I L E D
318
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
319
+
320
+ Phase {id} cannot advance until issues are resolved.
321
+
322
+ 🚨 Issues Found:
323
+ {list each failure with specific evidence}
324
+
325
+ 🔧 Required Actions:
326
+ 1. Fix the issues listed above
327
+ 2. Run /ant:continue again to re-verify
328
+
329
+ The phase will NOT advance until verification passes.
330
+ ```
331
+
332
+ **CRITICAL:** Do NOT proceed to Step 2. Do NOT advance the phase.
333
+ Do NOT offer workarounds. Verification is mandatory.
334
+
335
+ Use AskUserQuestion to confirm they understand what needs to be fixed:
336
+ - Show the specific failures
337
+ - Ask if they want to fix now or need help
338
+
339
+ **If READY (all checks pass with evidence):**
340
+
341
+ ```
342
+ ✅🐜 VERIFICATION PASSED
343
+
344
+ All checks completed with evidence:
345
+ {list each check and its evidence}
346
+
347
+ Proceeding to gate checks...
348
+ ```
349
+
350
+ Continue to Step 1.5.3.
351
+
352
+ ### Step 1.5.3: Verify Worker Claims (MANDATORY)
353
+
354
+ Cross-reference worker claims against reality. This step catches fabricated success claims.
355
+
356
+ **Always runs. No skip flag.**
357
+
358
+ 1. Check if `.aether/data/last-build-claims.json` exists.
359
+ - If not found: Display "No builder claims file found -- skipping file verification" and continue to Step 1.6. (This handles first-time runs and manual builds.)
360
+
361
+ 2. Capture the test exit code from Phase 4 of the verification loop (stored in `test_exit_code` variable during Phase 4 execution above).
362
+
363
+ 3. Run verification:
364
+ Run using the Bash tool with description "Verifying worker claims...":
365
+ ```bash
366
+ bash .aether/aether-utils.sh verify-claims ".aether/data/last-build-claims.json" "<watcher_json_or_path>" "<test_exit_code>"
367
+ ```
368
+
369
+ For the watcher JSON: use the Watcher output from the most recent build (if available in COLONY_STATE.json events or build synthesis). If no Watcher output is available, pass `'{"verification_passed":true}'` as default (conservative -- only test exit code mismatch can trigger).
370
+
371
+ 4. Parse the result:
372
+
373
+ **If verification_status is "passed":**
374
+ ```
375
+ Verification passed
376
+ ```
377
+ Continue to Step 1.6.
378
+
379
+ **If verification_status is "blocked" AND this is the first attempt (retry_count == 0):**
380
+ Display each mismatch as a plain one-liner:
381
+ ```
382
+ Verification issue: Worker claimed src/api/auth.ts was created, but file does not exist.
383
+ Retrying build for current phase...
384
+ ```
385
+
386
+ Log a flag for each mismatch:
387
+ Run using the Bash tool with description "Flagging verification mismatch...":
388
+ ```bash
389
+ bash .aether/aether-utils.sh flag-create "Verification mismatch: <summary>" --type blocker
390
+ ```
391
+
392
+ **Auto-retry once** (locked decision):
393
+ - Re-run `/ant:build <current_phase>` for the current phase
394
+ - After retry build completes, re-run the verification loop from Phase 1
395
+ - If verify-claims passes on retry: Display "Retrying... passed on retry" and continue to Step 1.6
396
+ - If verify-claims still blocked on retry: proceed to hard stop below
397
+
398
+ **If verification_status is "blocked" AND retry_count >= 1 (retry already attempted):**
399
+ ```
400
+ Verification failed after retry.
401
+ <plain summary of each mismatch>
402
+ Phase will NOT advance. Fix the issues and run /ant:continue again.
403
+ ```
404
+
405
+ **CRITICAL:** Do NOT proceed to Step 1.6. Do NOT advance the phase. The verification failure is a hard block just like a test failure.
406
+
407
+ Continue to Step 1.6.
@@ -0,0 +1,84 @@
1
+ # Context Continuity Plan
2
+
3
+ Updated: 2026-03-24
4
+
5
+ ## Goal
6
+
7
+ Keep colony context stable across sessions and long conversations without high token cost.
8
+
9
+ ## Design Principles
10
+
11
+ 1. Retrieval-first, not full-history injection.
12
+ 2. Hard token budgets on injected context.
13
+ 3. Derived context files are caches, never source-of-truth.
14
+ 4. Promotion and pheromone emission are deterministic and auditable.
15
+
16
+ ## Definitive Implementation Plan
17
+
18
+ ### Phase 1: Low-Token Context Backbone (implemented)
19
+
20
+ 1. Add `context-capsule` runtime command in `.aether/aether-utils.sh`.
21
+ 2. Generate compact capsule from:
22
+ - `COLONY_STATE.json` (goal, phase, decisions, next action)
23
+ - `pheromones.json` (priority-sorted active signals)
24
+ - `flags.json` (open blockers/issues)
25
+ - `rolling-summary.log` (latest narrative entries)
26
+ 3. Enforce compact limits (`max-signals`, `max-decisions`, `max-risks`, `max-words`).
27
+ 4. Add `rolling-summary` runtime command:
28
+ - `add <event> <summary> [source]`
29
+ - `read [--json]`
30
+ - keep last 15 entries only.
31
+ 5. Extend `memory-capture` to:
32
+ - support `resolution` events,
33
+ - append each captured event to rolling summary.
34
+ 6. Extend `pheromone-prime`:
35
+ - `--compact`,
36
+ - `--max-signals`,
37
+ - `--max-instincts`,
38
+ - include `POSITION` signals in output.
39
+ 7. Extend `colony-prime --compact`:
40
+ - use compact pheromone priming,
41
+ - append `context-capsule` block to prompt payload.
42
+
43
+ ### Phase 2: Injection Wiring (implemented for critical flows)
44
+
45
+ 1. Build flow:
46
+ - `build-context.md` now calls `colony-prime --compact`.
47
+ - Worker prompt context now includes capsule + top signals via `prompt_section`.
48
+ 2. Planning flow:
49
+ - `/ant:plan` (Claude/OpenCode) now loads `context-capsule --compact --json`.
50
+ - Scout + Route-Setter prompts include `context_capsule_prompt`.
51
+ 3. Continue flow:
52
+ - `continue-advance.md` now records recurring pattern resolution candidates through `memory-capture "resolution"`.
53
+
54
+ ### Phase 3: Promotion Intelligence (planned, not yet implemented)
55
+
56
+ 1. Add explicit recurrence-based promotion reasons in `learning-promote-auto` output.
57
+ 2. Add deterministic “failure signature -> resolution signature” matching.
58
+ 3. Promote matched recurring fixes to QUEEN wisdom faster than generic patterns.
59
+
60
+ ### Phase 4: Session-Wide Coverage (planned, not yet implemented)
61
+
62
+ 1. Inject `context-capsule` into remaining long-running orchestration commands:
63
+ - `/ant:continue`,
64
+ - `/ant:resume`,
65
+ - `/ant:swarm`,
66
+ - `/ant:oracle`.
67
+ 2. Add per-command context budget checks and fallback degradation order.
68
+
69
+ ## Current Runtime Surfaces
70
+
71
+ - `context-capsule`
72
+ - `rolling-summary`
73
+ - `pheromone-prime --compact`
74
+ - `colony-prime --compact`
75
+ - `memory-capture` (`resolution` + rolling summary append)
76
+
77
+ ## Verification
78
+
79
+ Unit coverage added in `tests/unit/context-continuity.test.js`:
80
+
81
+ 1. Capsule generation and next-action extraction.
82
+ 2. Compact priming signal cap behavior.
83
+ 3. Rolling summary retention cap (15 entries).
84
+ 4. Memory capture -> rolling summary integration.
@@ -1,10 +1,10 @@
1
1
  # Aether Colony Disciplines
2
2
 
3
- **Updated:** 2025-02-07
3
+ **Updated:** 2026-03-24
4
4
 
5
5
  ## Overview
6
6
 
7
- The Aether ant colony system includes 8 integrated disciplines that govern worker behavior. These disciplines are infused directly into worker prompts and command execution.
7
+ The Aether ant colony system includes 7 disciplines (6 core + 1 role-specific) that govern worker behavior. These disciplines are infused directly into worker prompts and command execution.
8
8
 
9
9
  ## Honest Execution Model
10
10
 
@@ -36,7 +36,7 @@ The Aether ant colony system includes 8 integrated disciplines that govern worke
36
36
 
37
37
  | Discipline | File | Applies To |
38
38
  |-----------|------|------------|
39
- | Planning | `planning.md` | Route-Setter |
39
+ | Planning | `planning.md` (planned, not yet created) | Route-Setter |
40
40
 
41
41
  ## Learning Validation
42
42
 
@@ -77,15 +77,17 @@ No workarounds. Fix issues and re-run.
77
77
  .aether/
78
78
  ├── workers.md # Worker roles + honest execution model
79
79
  ├── docs/disciplines/
80
- │ ├── verification.md # Evidence before claims
81
- │ ├── verification-loop.md # 6-phase quality gate
80
+ │ ├── coding-standards.md # Code quality rules
82
81
  │ ├── debugging.md # Systematic debugging
83
- │ ├── tdd.md # Test-driven development
84
82
  │ ├── learning.md # Colony learning system
85
- │ ├── coding-standards.md # Code quality rules
83
+ │ ├── tdd.md # Test-driven development
84
+ │ ├── verification.md # Evidence before claims
85
+ │ ├── verification-loop.md # 6-phase quality gate
86
86
  │ └── DISCIPLINES.md # This file
87
87
  ```
88
88
 
89
+ Note: `planning.md` is referenced in the Role-Specific Disciplines table above but has not yet been created.
90
+
89
91
  ## Reinstall After Updates
90
92
 
91
93
  ```bash
@@ -265,4 +265,4 @@ json_err "$E_FILE_NOT_FOUND" "flags.json not found"
265
265
 
266
266
  ---
267
267
 
268
- *Last updated: 2026-02-19*
268
+ *Last updated: 2026-03-29*