aether-colony 5.0.0 → 5.1.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 (312) hide show
  1. package/.aether/aether-utils.sh +3150 -3349
  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 +438 -0
  30. package/.aether/commands/continue.yaml +1484 -0
  31. package/.aether/commands/council.yaml +304 -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 +469 -0
  44. package/.aether/commands/insert-phase.yaml +98 -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 +1313 -0
  57. package/.aether/commands/preferences.yaml +63 -0
  58. package/.aether/commands/redirect.yaml +123 -0
  59. package/.aether/commands/resume-colony.yaml +373 -0
  60. package/.aether/commands/resume.yaml +398 -0
  61. package/.aether/commands/run.yaml +193 -0
  62. package/.aether/commands/seal.yaml +1205 -0
  63. package/.aether/commands/skill-create.yaml +337 -0
  64. package/.aether/commands/status.yaml +364 -0
  65. package/.aether/commands/swarm.yaml +352 -0
  66. package/.aether/commands/tunnels.yaml +814 -0
  67. package/.aether/commands/update.yaml +131 -0
  68. package/.aether/commands/verify-castes.yaml +159 -0
  69. package/.aether/commands/watch.yaml +454 -0
  70. package/.aether/docs/INCIDENT_TEMPLATE.md +32 -0
  71. package/.aether/docs/QUEEN-SYSTEM.md +11 -11
  72. package/.aether/docs/README.md +32 -2
  73. package/.aether/docs/command-playbooks/README.md +23 -0
  74. package/.aether/docs/command-playbooks/build-complete.md +349 -0
  75. package/.aether/docs/command-playbooks/build-context.md +282 -0
  76. package/.aether/docs/command-playbooks/build-full.md +1682 -0
  77. package/.aether/docs/command-playbooks/build-prep.md +283 -0
  78. package/.aether/docs/command-playbooks/build-verify.md +405 -0
  79. package/.aether/docs/command-playbooks/build-wave.md +749 -0
  80. package/.aether/docs/command-playbooks/continue-advance.md +524 -0
  81. package/.aether/docs/command-playbooks/continue-finalize.md +447 -0
  82. package/.aether/docs/command-playbooks/continue-full.md +1724 -0
  83. package/.aether/docs/command-playbooks/continue-gates.md +686 -0
  84. package/.aether/docs/command-playbooks/continue-verify.md +406 -0
  85. package/.aether/docs/context-continuity.md +84 -0
  86. package/.aether/docs/disciplines/DISCIPLINES.md +9 -7
  87. package/.aether/docs/error-codes.md +1 -1
  88. package/.aether/docs/known-issues.md +34 -173
  89. package/.aether/docs/pheromones.md +86 -6
  90. package/.aether/docs/plans/pheromone-display-plan.md +257 -0
  91. package/.aether/docs/queen-commands.md +10 -9
  92. package/.aether/docs/source-of-truth-map.md +132 -0
  93. package/.aether/docs/xml-utilities.md +47 -0
  94. package/.aether/rules/aether-colony.md +23 -13
  95. package/.aether/scripts/incident-test-add.sh +47 -0
  96. package/.aether/scripts/weekly-audit.sh +79 -0
  97. package/.aether/skills/.index.json +649 -0
  98. package/.aether/skills/colony/.manifest.json +16 -0
  99. package/.aether/skills/colony/build-discipline/SKILL.md +78 -0
  100. package/.aether/skills/colony/colony-interaction/SKILL.md +56 -0
  101. package/.aether/skills/colony/colony-lifecycle/SKILL.md +77 -0
  102. package/.aether/skills/colony/colony-visuals/SKILL.md +112 -0
  103. package/.aether/skills/colony/context-management/SKILL.md +80 -0
  104. package/.aether/skills/colony/error-presentation/SKILL.md +99 -0
  105. package/.aether/skills/colony/pheromone-protocol/SKILL.md +79 -0
  106. package/.aether/skills/colony/pheromone-visibility/SKILL.md +81 -0
  107. package/.aether/skills/colony/state-safety/SKILL.md +84 -0
  108. package/.aether/skills/colony/worker-priming/SKILL.md +82 -0
  109. package/.aether/skills/domain/.manifest.json +24 -0
  110. package/.aether/skills/domain/README.md +33 -0
  111. package/.aether/skills/domain/django/SKILL.md +49 -0
  112. package/.aether/skills/domain/docker/SKILL.md +52 -0
  113. package/.aether/skills/domain/golang/SKILL.md +52 -0
  114. package/.aether/skills/domain/graphql/SKILL.md +51 -0
  115. package/.aether/skills/domain/html-css/SKILL.md +48 -0
  116. package/.aether/skills/domain/nextjs/SKILL.md +45 -0
  117. package/.aether/skills/domain/nodejs/SKILL.md +53 -0
  118. package/.aether/skills/domain/postgresql/SKILL.md +53 -0
  119. package/.aether/skills/domain/prisma/SKILL.md +59 -0
  120. package/.aether/skills/domain/python/SKILL.md +50 -0
  121. package/.aether/skills/domain/rails/SKILL.md +52 -0
  122. package/.aether/skills/domain/react/SKILL.md +45 -0
  123. package/.aether/skills/domain/rest-api/SKILL.md +58 -0
  124. package/.aether/skills/domain/svelte/SKILL.md +47 -0
  125. package/.aether/skills/domain/tailwind/SKILL.md +45 -0
  126. package/.aether/skills/domain/testing/SKILL.md +53 -0
  127. package/.aether/skills/domain/typescript/SKILL.md +58 -0
  128. package/.aether/skills/domain/vue/SKILL.md +49 -0
  129. package/.aether/templates/QUEEN.md.template +23 -41
  130. package/.aether/templates/colony-state-reset.jq.template +1 -0
  131. package/.aether/templates/colony-state.template.json +4 -0
  132. package/.aether/templates/learning-observations.template.json +6 -0
  133. package/.aether/templates/midden.template.json +13 -0
  134. package/.aether/templates/pheromones.template.json +6 -0
  135. package/.aether/templates/session.template.json +9 -0
  136. package/.aether/utils/atomic-write.sh +63 -17
  137. package/.aether/utils/chamber-utils.sh +145 -2
  138. package/.aether/utils/emoji-audit.sh +166 -0
  139. package/.aether/utils/error-handler.sh +21 -7
  140. package/.aether/utils/file-lock.sh +182 -27
  141. package/.aether/utils/flag.sh +267 -0
  142. package/.aether/utils/hive.sh +572 -0
  143. package/.aether/utils/learning.sh +1928 -0
  144. package/.aether/utils/midden.sh +342 -0
  145. package/.aether/utils/oracle/oracle.md +168 -0
  146. package/.aether/utils/oracle/oracle.sh +1023 -0
  147. package/.aether/utils/pheromone.sh +2029 -0
  148. package/.aether/utils/queen.sh +1698 -0
  149. package/.aether/utils/scan.sh +860 -0
  150. package/.aether/utils/semantic-cli.sh +10 -8
  151. package/.aether/utils/session.sh +552 -0
  152. package/.aether/utils/skills.sh +509 -0
  153. package/.aether/utils/spawn-tree.sh +103 -271
  154. package/.aether/utils/spawn.sh +260 -0
  155. package/.aether/utils/state-api.sh +199 -0
  156. package/.aether/utils/state-loader.sh +8 -6
  157. package/.aether/utils/suggest.sh +611 -0
  158. package/.aether/utils/swarm-display.sh +10 -1
  159. package/.aether/utils/swarm.sh +1004 -0
  160. package/.aether/utils/watch-spawn-tree.sh +11 -2
  161. package/.aether/utils/xml-compose.sh +2 -2
  162. package/.aether/utils/xml-convert.sh +9 -5
  163. package/.aether/utils/xml-core.sh +5 -9
  164. package/.aether/utils/xml-query.sh +4 -4
  165. package/.aether/workers.md +86 -67
  166. package/.claude/agents/ant/aether-ambassador.md +2 -1
  167. package/.claude/agents/ant/aether-archaeologist.md +6 -1
  168. package/.claude/agents/ant/aether-architect.md +236 -0
  169. package/.claude/agents/ant/aether-auditor.md +6 -1
  170. package/.claude/agents/ant/aether-builder.md +38 -1
  171. package/.claude/agents/ant/aether-chaos.md +2 -1
  172. package/.claude/agents/ant/aether-chronicler.md +1 -0
  173. package/.claude/agents/ant/aether-gatekeeper.md +6 -1
  174. package/.claude/agents/ant/aether-includer.md +1 -0
  175. package/.claude/agents/ant/aether-keeper.md +1 -0
  176. package/.claude/agents/ant/aether-measurer.md +6 -1
  177. package/.claude/agents/ant/aether-oracle.md +237 -0
  178. package/.claude/agents/ant/aether-probe.md +2 -1
  179. package/.claude/agents/ant/aether-queen.md +6 -1
  180. package/.claude/agents/ant/aether-route-setter.md +6 -1
  181. package/.claude/agents/ant/aether-sage.md +68 -3
  182. package/.claude/agents/ant/aether-scout.md +38 -1
  183. package/.claude/agents/ant/aether-surveyor-disciplines.md +2 -1
  184. package/.claude/agents/ant/aether-surveyor-nest.md +2 -1
  185. package/.claude/agents/ant/aether-surveyor-pathogens.md +2 -1
  186. package/.claude/agents/ant/aether-surveyor-provisions.md +2 -1
  187. package/.claude/agents/ant/aether-tracker.md +6 -1
  188. package/.claude/agents/ant/aether-watcher.md +37 -1
  189. package/.claude/agents/ant/aether-weaver.md +2 -1
  190. package/.claude/commands/ant/archaeology.md +1 -8
  191. package/.claude/commands/ant/build.md +43 -1159
  192. package/.claude/commands/ant/chaos.md +1 -14
  193. package/.claude/commands/ant/colonize.md +1 -14
  194. package/.claude/commands/ant/continue.md +40 -1026
  195. package/.claude/commands/ant/council.md +9 -16
  196. package/.claude/commands/ant/data-clean.md +81 -0
  197. package/.claude/commands/ant/dream.md +12 -9
  198. package/.claude/commands/ant/entomb.md +62 -87
  199. package/.claude/commands/ant/export-signals.md +57 -0
  200. package/.claude/commands/ant/feedback.md +18 -0
  201. package/.claude/commands/ant/flag.md +12 -0
  202. package/.claude/commands/ant/flags.md +22 -8
  203. package/.claude/commands/ant/focus.md +18 -0
  204. package/.claude/commands/ant/help.md +40 -8
  205. package/.claude/commands/ant/history.md +3 -0
  206. package/.claude/commands/ant/import-signals.md +71 -0
  207. package/.claude/commands/ant/init.md +316 -191
  208. package/.claude/commands/ant/insert-phase.md +101 -0
  209. package/.claude/commands/ant/interpret.md +11 -0
  210. package/.claude/commands/ant/lay-eggs.md +167 -158
  211. package/.claude/commands/ant/maturity.md +22 -11
  212. package/.claude/commands/ant/memory-details.md +77 -0
  213. package/.claude/commands/ant/migrate-state.md +6 -0
  214. package/.claude/commands/ant/oracle.md +317 -62
  215. package/.claude/commands/ant/organize.md +10 -5
  216. package/.claude/commands/ant/patrol.md +620 -0
  217. package/.claude/commands/ant/pause-colony.md +8 -22
  218. package/.claude/commands/ant/phase.md +26 -37
  219. package/.claude/commands/ant/pheromones.md +156 -0
  220. package/.claude/commands/ant/plan.md +175 -52
  221. package/.claude/commands/ant/preferences.md +65 -0
  222. package/.claude/commands/ant/redirect.md +18 -0
  223. package/.claude/commands/ant/resume-colony.md +34 -20
  224. package/.claude/commands/ant/resume.md +51 -7
  225. package/.claude/commands/ant/run.md +195 -0
  226. package/.claude/commands/ant/seal.md +497 -78
  227. package/.claude/commands/ant/skill-create.md +286 -0
  228. package/.claude/commands/ant/status.md +127 -1
  229. package/.claude/commands/ant/swarm.md +11 -23
  230. package/.claude/commands/ant/tunnels.md +1 -0
  231. package/.claude/commands/ant/update.md +58 -135
  232. package/.claude/commands/ant/verify-castes.md +90 -42
  233. package/.claude/commands/ant/watch.md +1 -0
  234. package/.opencode/agents/aether-ambassador.md +1 -1
  235. package/.opencode/agents/aether-architect.md +133 -0
  236. package/.opencode/agents/aether-builder.md +3 -3
  237. package/.opencode/agents/aether-oracle.md +137 -0
  238. package/.opencode/agents/aether-queen.md +1 -1
  239. package/.opencode/agents/aether-route-setter.md +1 -1
  240. package/.opencode/agents/aether-scout.md +1 -1
  241. package/.opencode/agents/aether-surveyor-disciplines.md +6 -1
  242. package/.opencode/agents/aether-surveyor-nest.md +6 -1
  243. package/.opencode/agents/aether-surveyor-pathogens.md +6 -1
  244. package/.opencode/agents/aether-surveyor-provisions.md +6 -1
  245. package/.opencode/agents/aether-tracker.md +1 -1
  246. package/.opencode/agents/aether-watcher.md +1 -1
  247. package/.opencode/agents/aether-weaver.md +1 -1
  248. package/.opencode/commands/ant/archaeology.md +7 -14
  249. package/.opencode/commands/ant/build.md +54 -88
  250. package/.opencode/commands/ant/chaos.md +7 -24
  251. package/.opencode/commands/ant/colonize.md +8 -17
  252. package/.opencode/commands/ant/continue.md +595 -66
  253. package/.opencode/commands/ant/council.md +11 -22
  254. package/.opencode/commands/ant/data-clean.md +77 -0
  255. package/.opencode/commands/ant/dream.md +15 -17
  256. package/.opencode/commands/ant/entomb.md +28 -18
  257. package/.opencode/commands/ant/export-signals.md +54 -0
  258. package/.opencode/commands/ant/feedback.md +24 -5
  259. package/.opencode/commands/ant/flag.md +16 -4
  260. package/.opencode/commands/ant/flags.md +24 -10
  261. package/.opencode/commands/ant/focus.md +22 -5
  262. package/.opencode/commands/ant/help.md +41 -8
  263. package/.opencode/commands/ant/history.md +9 -0
  264. package/.opencode/commands/ant/import-signals.md +68 -0
  265. package/.opencode/commands/ant/init.md +365 -156
  266. package/.opencode/commands/ant/insert-phase.md +107 -0
  267. package/.opencode/commands/ant/interpret.md +16 -0
  268. package/.opencode/commands/ant/lay-eggs.md +184 -112
  269. package/.opencode/commands/ant/maturity.md +18 -2
  270. package/.opencode/commands/ant/memory-details.md +83 -0
  271. package/.opencode/commands/ant/migrate-state.md +12 -0
  272. package/.opencode/commands/ant/oracle.md +322 -67
  273. package/.opencode/commands/ant/organize.md +14 -12
  274. package/.opencode/commands/ant/patrol.md +626 -0
  275. package/.opencode/commands/ant/pause-colony.md +12 -29
  276. package/.opencode/commands/ant/phase.md +30 -40
  277. package/.opencode/commands/ant/pheromones.md +162 -0
  278. package/.opencode/commands/ant/plan.md +184 -56
  279. package/.opencode/commands/ant/preferences.md +71 -0
  280. package/.opencode/commands/ant/redirect.md +22 -5
  281. package/.opencode/commands/ant/resume-colony.md +38 -27
  282. package/.opencode/commands/ant/resume.md +71 -20
  283. package/.opencode/commands/ant/run.md +201 -0
  284. package/.opencode/commands/ant/seal.md +230 -25
  285. package/.opencode/commands/ant/skill-create.md +63 -0
  286. package/.opencode/commands/ant/status.md +124 -31
  287. package/.opencode/commands/ant/swarm.md +3 -345
  288. package/.opencode/commands/ant/tunnels.md +3 -9
  289. package/.opencode/commands/ant/update.md +63 -127
  290. package/.opencode/commands/ant/verify-castes.md +96 -42
  291. package/.opencode/commands/ant/watch.md +7 -0
  292. package/CHANGELOG.md +278 -1
  293. package/README.md +188 -340
  294. package/bin/cli.js +236 -429
  295. package/bin/generate-commands.js +186 -0
  296. package/bin/generate-commands.sh +128 -89
  297. package/bin/lib/spawn-logger.js +0 -15
  298. package/bin/lib/update-transaction.js +285 -35
  299. package/bin/npx-install.js +178 -0
  300. package/bin/validate-package.sh +85 -3
  301. package/package.json +7 -3
  302. package/.aether/CONTEXT.md +0 -160
  303. package/.aether/docs/QUEEN.md +0 -84
  304. package/.aether/exchange/colony-registry.xml +0 -11
  305. package/.aether/exchange/pheromones.xml +0 -87
  306. package/.aether/exchange/queen-wisdom.xml +0 -14
  307. package/.aether/model-profiles.yaml +0 -100
  308. package/.aether/utils/spawn-with-model.sh +0 -56
  309. package/bin/lib/model-profiles.js +0 -445
  310. package/bin/lib/model-verify.js +0 -288
  311. package/bin/lib/proxy-health.js +0 -253
  312. package/bin/lib/telemetry.js +0 -441
@@ -0,0 +1,406 @@
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 `plan.phases` is empty -> output "No project plan. Run /ant:plan first." and stop.
30
+
31
+ ### Step 1.5: Load State and Show Resumption Context
32
+
33
+ Run using the Bash tool with description "Loading colony state...": `bash .aether/aether-utils.sh load-state`
34
+
35
+ If successful and goal is not null:
36
+ 1. Extract current_phase from state
37
+ 2. Get phase name from plan.phases[current_phase - 1].name (or "(unnamed)")
38
+ 3. Display brief resumption context:
39
+ ```
40
+ 🔄 Resuming: Phase X - Name
41
+ ```
42
+
43
+ If .aether/HANDOFF.md exists (detected in load-state output):
44
+ - Display "Resuming from paused session"
45
+ - Read .aether/HANDOFF.md for additional context
46
+ - Remove .aether/HANDOFF.md after display (cleanup)
47
+
48
+ Run using the Bash tool with description "Releasing colony lock...": `bash .aether/aether-utils.sh unload-state` to release lock.
49
+
50
+ **Error handling:**
51
+ - If E_FILE_NOT_FOUND: "No colony initialized. Run /ant:init first." and stop
52
+ - If validation error: Display error details with recovery suggestion and stop
53
+ - For other errors: Display generic error and suggest /ant:status for diagnostics
54
+
55
+ **Completion Detection:**
56
+
57
+ If `state == "EXECUTING"`:
58
+ 1. Check if `build_started_at` exists
59
+ 2. Look for phase completion evidence:
60
+ - Activity log entries showing task completion
61
+ - Files created/modified matching phase tasks
62
+ 3. If no evidence and build started > 30 min ago:
63
+ - Display "Stale EXECUTING state. Build may have been interrupted."
64
+ - Offer: continue anyway or rollback to git checkpoint
65
+ - Rollback procedure: `git stash list | grep "aether-checkpoint"` to find ref, then `git stash pop <ref>` to restore
66
+
67
+ If `state != "EXECUTING"`:
68
+ - Normal continue flow (no build to reconcile)
69
+
70
+ ### Step 1.5.2: Load Survey Context (Non-blocking)
71
+
72
+ Run using the Bash tool with description "Checking survey context...":
73
+ ```bash
74
+ survey_check=$(bash .aether/aether-utils.sh survey-verify 2>/dev/null || true)
75
+ survey_docs=$(ls -1 .aether/data/survey/*.md 2>/dev/null | wc -l | tr -d ' ')
76
+ survey_latest=$(ls -t .aether/data/survey/*.md 2>/dev/null | head -1)
77
+ if [[ -n "$survey_latest" ]]; then
78
+ now_epoch=$(date +%s)
79
+ modified_epoch=$(stat -f %m "$survey_latest" 2>/dev/null || stat -c %Y "$survey_latest" 2>/dev/null || echo 0)
80
+ survey_age_days=$(( (now_epoch - modified_epoch) / 86400 ))
81
+ else
82
+ survey_age_days=-1
83
+ fi
84
+ echo "{\"docs\":$survey_docs,\"age_days\":$survey_age_days,\"verify\":$survey_check}"
85
+ ```
86
+
87
+ Interpretation:
88
+ - If survey docs are missing (`docs == 0`), continue without blocking and display:
89
+ `🗺️ Survey: not found (run /ant:colonize for stronger context)`
90
+ - If survey exists but is stale (`age_days > 14`), continue without blocking and display:
91
+ `🗺️ Survey: {docs} docs loaded ({age_days}d old, consider /ant:colonize --force-resurvey)`
92
+ - Otherwise display:
93
+ `🗺️ Survey: {docs} docs loaded ({age_days}d old)`
94
+
95
+ Use this survey status as advisory context for the verification report only.
96
+
97
+ ### Step 1.5: Verification Loop Gate (MANDATORY)
98
+
99
+ **The Iron Law:** No phase advancement without fresh verification evidence.
100
+
101
+ Before ANY phase can advance, execute the 6-phase verification loop. See `.aether/docs/disciplines/verification-loop.md` for full reference.
102
+
103
+ #### 1. Command Resolution (Priority Chain)
104
+
105
+ Resolve each command (build, test, types, lint) using this priority chain. Stop at the first source that provides a value for each command:
106
+
107
+ **Priority 1 — CLAUDE.md (System Context):**
108
+ 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.
109
+
110
+ **Priority 2 — codebase.md `## Commands`:**
111
+ Read `.aether/data/codebase.md` and look for the `## Commands` section. Use any commands listed there for slots not yet filled by Priority 1.
112
+
113
+ **Priority 3 — Fallback Heuristic Table:**
114
+ For any commands still unresolved, check for these files in order, use first match:
115
+
116
+ | File | Build | Test | Types | Lint |
117
+ |------|-------|------|-------|------|
118
+ | `package.json` | `npm run build` | `npm test` | `npx tsc --noEmit` | `npm run lint` |
119
+ | `Cargo.toml` | `cargo build` | `cargo test` | (built-in) | `cargo clippy` |
120
+ | `go.mod` | `go build ./...` | `go test ./...` | `go vet ./...` | `golangci-lint run` |
121
+ | `pyproject.toml` | `python -m build` | `pytest` | `pyright .` | `ruff check .` |
122
+ | `Makefile` | `make build` | `make test` | (check targets) | `make lint` |
123
+
124
+ If no build system detected, skip build/test/type/lint checks but still verify success criteria.
125
+
126
+ #### 2. Run 6-Phase Verification Loop
127
+
128
+ Execute all applicable phases and capture output:
129
+
130
+ ```
131
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
132
+ 👁️🐜 V E R I F I C A T I O N L O O P
133
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
134
+ Phase {id} — Checking colony work...
135
+ ```
136
+
137
+ **Phase 1: Build Check** (if command exists):
138
+ Run using the Bash tool with description "Running build check...": `{build_command} 2>&1 | tail -30`
139
+ Record: exit code, any errors. **STOP if fails.**
140
+
141
+ **Phase 2: Type Check** (if command exists):
142
+ Run using the Bash tool with description "Running type check...": `{type_command} 2>&1 | head -30`
143
+ Record: error count. Report all type errors.
144
+
145
+ **Phase 3: Lint Check** (if command exists):
146
+ Run using the Bash tool with description "Running lint check...": `{lint_command} 2>&1 | head -30`
147
+ Record: warning count, error count.
148
+
149
+ **Phase 4: Test Check** (if command exists):
150
+ Run using the Bash tool with description "Running test suite...": `{test_command} 2>&1 | tail -50`
151
+ Record: pass count, fail count, exit code. **STOP if fails.**
152
+
153
+ **IMPORTANT:** Store the test command exit code in a variable (e.g., `test_exit_code`) for use in Step 1.5.3 verify-claims.
154
+
155
+ **Coverage Check** (if coverage command exists):
156
+ Run using the Bash tool with description "Checking test coverage...": `{coverage_command} # e.g., npm run test:coverage`
157
+ Record: coverage percentage (target: 80%+ for new code)
158
+
159
+ #### Step 1.5.1: Probe Coverage Agent (Conditional)
160
+
161
+ **Test coverage improvement — runs when coverage < 80% AND tests pass.**
162
+
163
+ 1. **Check coverage threshold condition:**
164
+ - Coverage data is already available from Phase 4 coverage check
165
+ - If tests failed: Skip Probe silently (coverage data unreliable)
166
+ - If coverage_percent >= 80%: Skip Probe silently, continue to Phase 5
167
+ - If coverage_percent < 80% AND tests passed: Proceed to spawn Probe
168
+
169
+ 2. **If skipping Probe:**
170
+ ```
171
+ 🧪🐜 Probe: Coverage at {coverage_percent}% — {reason_for_skip}
172
+ ```
173
+ Continue to Phase 5: Secrets Scan.
174
+
175
+ 3. **If spawning Probe:**
176
+
177
+ a. Generate Probe name and dispatch:
178
+ 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\"}"`
179
+
180
+ b. Display:
181
+ ```
182
+ ━━━ 🧪🐜 P R O B E ━━━
183
+ ──── 🧪🐜 Spawning {probe_name} — Coverage improvement ────
184
+ ```
185
+
186
+ d. Determine uncovered files:
187
+ 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"`
188
+
189
+ e. Spawn Probe agent:
190
+
191
+ 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`):
192
+
193
+ ```xml
194
+ <mission>
195
+ Improve test coverage for uncovered code paths in the modified files.
196
+ </mission>
197
+
198
+ <work>
199
+ 1. Analyze the modified source files for uncovered branches and edge cases
200
+ 2. Identify which paths lack test coverage
201
+ 3. Generate test cases that exercise uncovered code paths
202
+ 4. Run the new tests to verify they pass
203
+ 5. Report coverage improvements and edge cases discovered
204
+ </work>
205
+
206
+ <context>
207
+ Current coverage: {coverage_percent}%
208
+ Target coverage: 80%
209
+ Modified source files: {modified_source_files}
210
+ </context>
211
+
212
+ <constraints>
213
+ - Test files ONLY — never modify source code
214
+ - Follow existing test conventions in the codebase
215
+ - Do NOT delete or modify existing tests
216
+ </constraints>
217
+
218
+ <output>
219
+ Provide JSON output matching this schema:
220
+ {
221
+ "ant_name": "your probe name",
222
+ "caste": "probe",
223
+ "status": "completed" | "failed" | "blocked",
224
+ "summary": "Brief summary of coverage improvements",
225
+ "coverage": {
226
+ "lines": 0,
227
+ "branches": 0,
228
+ "functions": 0
229
+ },
230
+ "tests_added": ["file1.test.js", "file2.test.js"],
231
+ "edge_cases_discovered": ["edge case 1", "edge case 2"],
232
+ "mutation_score": 0,
233
+ "weak_spots": [],
234
+ "blockers": []
235
+ }
236
+ </output>
237
+ ```
238
+
239
+ f. Parse Probe JSON output and log completion:
240
+ Extract: `tests_added`, `coverage.lines`, `coverage.branches`, `coverage.functions`, `edge_cases_discovered`, `mutation_score`
241
+
242
+ 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}}}"`
243
+
244
+ g. Log findings to midden:
245
+ 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"`
246
+
247
+ If edge cases found:
248
+ 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"`
249
+
250
+ 4. **NON-BLOCKING continuation:**
251
+ Display Probe findings summary:
252
+ ```
253
+ 🧪🐜 Probe complete — Findings logged to midden, continuing verification...
254
+ Tests added: {count}
255
+ Edge cases discovered: {count}
256
+ ```
257
+
258
+ **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.
259
+
260
+ 5. **Record Probe status for verification report:**
261
+ Set `probe_status = "ACTIVE"` and store tests_added count and edge_cases count for the verification report.
262
+
263
+ **Phase 5: Secrets Scan** (basic grep-based secret detection):
264
+ 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`
265
+ 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`
266
+ Record: potential secrets (critical), debug artifacts (warning).
267
+
268
+ Note: Professional security scanning happens in Step 1.8 (Gatekeeper for CVEs) and Step 1.9 (Auditor for code quality).
269
+
270
+ **Phase 6: Diff Review**:
271
+ Run using the Bash tool with description "Reviewing file changes...": `git diff --stat`
272
+ Review changed files for unintended modifications.
273
+
274
+ **Success Criteria Check:**
275
+ Read phase success criteria from `plan.phases[current].success_criteria`.
276
+ For EACH criterion:
277
+ 1. Identify what proves it (file exists? test passes? output shows X?)
278
+ 2. Run the check
279
+ 3. Record evidence or gap
280
+
281
+ Display:
282
+ ```
283
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
284
+ 👁️🐜 V E R I F I C A T I O N R E P O R T
285
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
286
+
287
+ 🔨 Build [PASS/FAIL/SKIP]
288
+ 🔍 Types [PASS/FAIL/SKIP] (X errors)
289
+ 🧹 Lint [PASS/FAIL/SKIP] (X warnings)
290
+ 🧪 Tests [PASS/FAIL/SKIP] (X/Y passed)
291
+ Coverage {percent}% (target: 80%)
292
+ 🧪 Probe [ACTIVE/SKIP] (tests added: X, edge cases: Y)
293
+ 🔒 Secrets [PASS/FAIL] (X issues)
294
+ 📦 Gatekeeper [PASS/WARN/SKIP] (X critical, X high)
295
+ 👥 Auditor [PASS/FAIL] (score: X/100)
296
+ 📋 Diff [X files changed]
297
+
298
+ ──────────────────────────────────────────────────
299
+ 🐜 Success Criteria
300
+ ──────────────────────────────────────────────────
301
+ ✅ {criterion 1}: {specific evidence}
302
+ ✅ {criterion 2}: {specific evidence}
303
+ ❌ {criterion 3}: {what's missing}
304
+
305
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
306
+ Overall: READY / NOT READY
307
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
308
+ ```
309
+
310
+ #### 3. Gate Decision
311
+
312
+ **If NOT READY (any of: build fails, tests fail, critical security issues, success criteria unmet):**
313
+
314
+ ```
315
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
316
+ ⛔🐜 V E R I F I C A T I O N F A I L E D
317
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
318
+
319
+ Phase {id} cannot advance until issues are resolved.
320
+
321
+ 🚨 Issues Found:
322
+ {list each failure with specific evidence}
323
+
324
+ 🔧 Required Actions:
325
+ 1. Fix the issues listed above
326
+ 2. Run /ant:continue again to re-verify
327
+
328
+ The phase will NOT advance until verification passes.
329
+ ```
330
+
331
+ **CRITICAL:** Do NOT proceed to Step 2. Do NOT advance the phase.
332
+ Do NOT offer workarounds. Verification is mandatory.
333
+
334
+ Use AskUserQuestion to confirm they understand what needs to be fixed:
335
+ - Show the specific failures
336
+ - Ask if they want to fix now or need help
337
+
338
+ **If READY (all checks pass with evidence):**
339
+
340
+ ```
341
+ ✅🐜 VERIFICATION PASSED
342
+
343
+ All checks completed with evidence:
344
+ {list each check and its evidence}
345
+
346
+ Proceeding to gate checks...
347
+ ```
348
+
349
+ Continue to Step 1.5.3.
350
+
351
+ ### Step 1.5.3: Verify Worker Claims (MANDATORY)
352
+
353
+ Cross-reference worker claims against reality. This step catches fabricated success claims.
354
+
355
+ **Always runs. No skip flag.**
356
+
357
+ 1. Check if `.aether/data/last-build-claims.json` exists.
358
+ - 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.)
359
+
360
+ 2. Capture the test exit code from Phase 4 of the verification loop (stored in `test_exit_code` variable during Phase 4 execution above).
361
+
362
+ 3. Run verification:
363
+ Run using the Bash tool with description "Verifying worker claims...":
364
+ ```bash
365
+ bash .aether/aether-utils.sh verify-claims ".aether/data/last-build-claims.json" "<watcher_json_or_path>" "<test_exit_code>"
366
+ ```
367
+
368
+ 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).
369
+
370
+ 4. Parse the result:
371
+
372
+ **If verification_status is "passed":**
373
+ ```
374
+ Verification passed
375
+ ```
376
+ Continue to Step 1.6.
377
+
378
+ **If verification_status is "blocked" AND this is the first attempt (retry_count == 0):**
379
+ Display each mismatch as a plain one-liner:
380
+ ```
381
+ Verification issue: Worker claimed src/api/auth.ts was created, but file does not exist.
382
+ Retrying build for current phase...
383
+ ```
384
+
385
+ Log a flag for each mismatch:
386
+ Run using the Bash tool with description "Flagging verification mismatch...":
387
+ ```bash
388
+ bash .aether/aether-utils.sh flag-create "Verification mismatch: <summary>" --type blocker
389
+ ```
390
+
391
+ **Auto-retry once** (locked decision):
392
+ - Re-run `/ant:build <current_phase>` for the current phase
393
+ - After retry build completes, re-run the verification loop from Phase 1
394
+ - If verify-claims passes on retry: Display "Retrying... passed on retry" and continue to Step 1.6
395
+ - If verify-claims still blocked on retry: proceed to hard stop below
396
+
397
+ **If verification_status is "blocked" AND retry_count >= 1 (retry already attempted):**
398
+ ```
399
+ Verification failed after retry.
400
+ <plain summary of each mismatch>
401
+ Phase will NOT advance. Fix the issues and run /ant:continue again.
402
+ ```
403
+
404
+ **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.
405
+
406
+ 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*