aether-colony 3.1.17 → 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 (378) hide show
  1. package/.aether/aether-utils.sh +5354 -0
  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 +211 -0
  72. package/.aether/docs/README.md +98 -0
  73. package/.aether/docs/caste-system.md +48 -0
  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 +1682 -0
  78. package/.aether/docs/command-playbooks/build-prep.md +283 -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 +1724 -0
  84. package/.aether/docs/command-playbooks/continue-gates.md +686 -0
  85. package/.aether/docs/command-playbooks/continue-verify.md +406 -0
  86. package/.aether/docs/context-continuity.md +84 -0
  87. package/{runtime → .aether/docs/disciplines}/DISCIPLINES.md +13 -11
  88. package/.aether/docs/error-codes.md +268 -0
  89. package/.aether/docs/known-issues.md +94 -0
  90. package/{runtime → .aether}/docs/pheromones.md +86 -6
  91. package/.aether/docs/plans/pheromone-display-plan.md +257 -0
  92. package/.aether/docs/queen-commands.md +98 -0
  93. package/.aether/docs/source-of-truth-map.md +132 -0
  94. package/.aether/docs/xml-utilities.md +47 -0
  95. package/{runtime → .aether}/exchange/pheromone-xml.sh +2 -1
  96. package/{runtime → .aether}/exchange/registry-xml.sh +7 -3
  97. package/{runtime → .aether}/exchange/wisdom-xml.sh +11 -4
  98. package/.aether/rules/aether-colony.md +144 -0
  99. package/.aether/schemas/example-prompt-builder.xml +234 -0
  100. package/.aether/scripts/incident-test-add.sh +47 -0
  101. package/.aether/scripts/weekly-audit.sh +79 -0
  102. package/.aether/skills/.index.json +649 -0
  103. package/.aether/skills/colony/.manifest.json +16 -0
  104. package/.aether/skills/colony/build-discipline/SKILL.md +78 -0
  105. package/.aether/skills/colony/colony-interaction/SKILL.md +56 -0
  106. package/.aether/skills/colony/colony-lifecycle/SKILL.md +77 -0
  107. package/.aether/skills/colony/colony-visuals/SKILL.md +112 -0
  108. package/.aether/skills/colony/context-management/SKILL.md +80 -0
  109. package/.aether/skills/colony/error-presentation/SKILL.md +99 -0
  110. package/.aether/skills/colony/pheromone-protocol/SKILL.md +79 -0
  111. package/.aether/skills/colony/pheromone-visibility/SKILL.md +81 -0
  112. package/.aether/skills/colony/state-safety/SKILL.md +84 -0
  113. package/.aether/skills/colony/worker-priming/SKILL.md +82 -0
  114. package/.aether/skills/domain/.manifest.json +24 -0
  115. package/.aether/skills/domain/README.md +33 -0
  116. package/.aether/skills/domain/django/SKILL.md +49 -0
  117. package/.aether/skills/domain/docker/SKILL.md +52 -0
  118. package/.aether/skills/domain/golang/SKILL.md +52 -0
  119. package/.aether/skills/domain/graphql/SKILL.md +51 -0
  120. package/.aether/skills/domain/html-css/SKILL.md +48 -0
  121. package/.aether/skills/domain/nextjs/SKILL.md +45 -0
  122. package/.aether/skills/domain/nodejs/SKILL.md +53 -0
  123. package/.aether/skills/domain/postgresql/SKILL.md +53 -0
  124. package/.aether/skills/domain/prisma/SKILL.md +59 -0
  125. package/.aether/skills/domain/python/SKILL.md +50 -0
  126. package/.aether/skills/domain/rails/SKILL.md +52 -0
  127. package/.aether/skills/domain/react/SKILL.md +45 -0
  128. package/.aether/skills/domain/rest-api/SKILL.md +58 -0
  129. package/.aether/skills/domain/svelte/SKILL.md +47 -0
  130. package/.aether/skills/domain/tailwind/SKILL.md +45 -0
  131. package/.aether/skills/domain/testing/SKILL.md +53 -0
  132. package/.aether/skills/domain/typescript/SKILL.md +58 -0
  133. package/.aether/skills/domain/vue/SKILL.md +49 -0
  134. package/.aether/templates/QUEEN.md.template +61 -0
  135. package/.aether/templates/colony-state-reset.jq.template +23 -0
  136. package/.aether/templates/colony-state.template.json +39 -0
  137. package/.aether/templates/constraints.template.json +9 -0
  138. package/.aether/templates/crowned-anthill.template.md +36 -0
  139. package/.aether/templates/handoff-build-error.template.md +30 -0
  140. package/.aether/templates/handoff-build-success.template.md +39 -0
  141. package/.aether/templates/handoff.template.md +40 -0
  142. package/.aether/templates/learning-observations.template.json +6 -0
  143. package/.aether/templates/midden.template.json +13 -0
  144. package/.aether/templates/pheromones.template.json +6 -0
  145. package/.aether/templates/session.template.json +9 -0
  146. package/{runtime → .aether}/utils/atomic-write.sh +68 -22
  147. package/{runtime → .aether}/utils/chamber-compare.sh +23 -10
  148. package/.aether/utils/chamber-utils.sh +440 -0
  149. package/.aether/utils/emoji-audit.sh +166 -0
  150. package/{runtime → .aether}/utils/error-handler.sh +34 -8
  151. package/.aether/utils/file-lock.sh +313 -0
  152. package/.aether/utils/flag.sh +267 -0
  153. package/.aether/utils/hive.sh +572 -0
  154. package/.aether/utils/learning.sh +1928 -0
  155. package/.aether/utils/midden.sh +342 -0
  156. package/.aether/utils/oracle/oracle.md +168 -0
  157. package/.aether/utils/oracle/oracle.sh +1023 -0
  158. package/.aether/utils/pheromone.sh +2029 -0
  159. package/.aether/utils/queen.sh +1698 -0
  160. package/.aether/utils/scan.sh +860 -0
  161. package/.aether/utils/semantic-cli.sh +415 -0
  162. package/.aether/utils/session.sh +552 -0
  163. package/.aether/utils/skills.sh +509 -0
  164. package/.aether/utils/spawn-tree.sh +260 -0
  165. package/.aether/utils/spawn.sh +260 -0
  166. package/.aether/utils/state-api.sh +199 -0
  167. package/{runtime → .aether}/utils/state-loader.sh +8 -6
  168. package/.aether/utils/suggest.sh +611 -0
  169. package/{runtime → .aether}/utils/swarm-display.sh +10 -1
  170. package/.aether/utils/swarm.sh +1004 -0
  171. package/{runtime → .aether}/utils/watch-spawn-tree.sh +11 -2
  172. package/{runtime → .aether}/utils/xml-compose.sh +9 -3
  173. package/.aether/utils/xml-convert.sh +277 -0
  174. package/{runtime → .aether}/utils/xml-core.sh +5 -9
  175. package/.aether/utils/xml-query.sh +201 -0
  176. package/.aether/utils/xml-utils.sh +110 -0
  177. package/{runtime → .aether}/workers.md +97 -81
  178. package/.claude/agents/ant/aether-ambassador.md +265 -0
  179. package/.claude/agents/ant/aether-archaeologist.md +327 -0
  180. package/.claude/agents/ant/aether-architect.md +236 -0
  181. package/.claude/agents/ant/aether-auditor.md +271 -0
  182. package/.claude/agents/ant/aether-builder.md +224 -0
  183. package/.claude/agents/ant/aether-chaos.md +269 -0
  184. package/.claude/agents/ant/aether-chronicler.md +305 -0
  185. package/.claude/agents/ant/aether-gatekeeper.md +330 -0
  186. package/.claude/agents/ant/aether-includer.md +374 -0
  187. package/.claude/agents/ant/aether-keeper.md +272 -0
  188. package/.claude/agents/ant/aether-measurer.md +322 -0
  189. package/.claude/agents/ant/aether-oracle.md +237 -0
  190. package/.claude/agents/ant/aether-probe.md +211 -0
  191. package/.claude/agents/ant/aether-queen.md +330 -0
  192. package/.claude/agents/ant/aether-route-setter.md +178 -0
  193. package/.claude/agents/ant/aether-sage.md +418 -0
  194. package/.claude/agents/ant/aether-scout.md +179 -0
  195. package/.claude/agents/ant/aether-surveyor-disciplines.md +417 -0
  196. package/.claude/agents/ant/aether-surveyor-nest.md +355 -0
  197. package/.claude/agents/ant/aether-surveyor-pathogens.md +289 -0
  198. package/.claude/agents/ant/aether-surveyor-provisions.md +360 -0
  199. package/.claude/agents/ant/aether-tracker.md +270 -0
  200. package/.claude/agents/ant/aether-watcher.md +280 -0
  201. package/.claude/agents/ant/aether-weaver.md +248 -0
  202. package/.claude/commands/ant/archaeology.md +16 -14
  203. package/.claude/commands/ant/build.md +43 -1028
  204. package/.claude/commands/ant/chaos.md +19 -23
  205. package/.claude/commands/ant/colonize.md +52 -31
  206. package/.claude/commands/ant/continue.md +40 -1016
  207. package/.claude/commands/ant/council.md +21 -18
  208. package/.claude/commands/ant/data-clean.md +81 -0
  209. package/.claude/commands/ant/dream.md +27 -15
  210. package/.claude/commands/ant/entomb.md +317 -225
  211. package/.claude/commands/ant/export-signals.md +57 -0
  212. package/.claude/commands/ant/feedback.md +48 -26
  213. package/.claude/commands/ant/flag.md +30 -10
  214. package/.claude/commands/ant/flags.md +34 -12
  215. package/.claude/commands/ant/focus.md +45 -19
  216. package/.claude/commands/ant/help.md +50 -8
  217. package/.claude/commands/ant/history.md +13 -0
  218. package/.claude/commands/ant/import-signals.md +71 -0
  219. package/.claude/commands/ant/init.md +345 -194
  220. package/.claude/commands/ant/insert-phase.md +101 -0
  221. package/.claude/commands/ant/interpret.md +26 -4
  222. package/.claude/commands/ant/lay-eggs.md +184 -127
  223. package/.claude/commands/ant/maturity.md +32 -11
  224. package/.claude/commands/ant/memory-details.md +77 -0
  225. package/.claude/commands/ant/migrate-state.md +20 -2
  226. package/.claude/commands/ant/oracle.md +337 -74
  227. package/.claude/commands/ant/organize.md +39 -25
  228. package/.claude/commands/ant/patrol.md +620 -0
  229. package/.claude/commands/ant/pause-colony.md +23 -27
  230. package/.claude/commands/ant/phase.md +40 -42
  231. package/.claude/commands/ant/pheromones.md +156 -0
  232. package/.claude/commands/ant/plan.md +185 -51
  233. package/.claude/commands/ant/preferences.md +65 -0
  234. package/.claude/commands/ant/redirect.md +45 -30
  235. package/.claude/commands/ant/resume-colony.md +51 -27
  236. package/.claude/commands/ant/resume.md +314 -94
  237. package/.claude/commands/ant/run.md +195 -0
  238. package/.claude/commands/ant/seal.md +650 -221
  239. package/.claude/commands/ant/skill-create.md +286 -0
  240. package/.claude/commands/ant/status.md +196 -31
  241. package/.claude/commands/ant/swarm.md +16 -46
  242. package/.claude/commands/ant/tunnels.md +280 -105
  243. package/.claude/commands/ant/update.md +73 -89
  244. package/.claude/commands/ant/verify-castes.md +100 -42
  245. package/.claude/commands/ant/watch.md +14 -12
  246. package/.opencode/agents/aether-ambassador.md +63 -20
  247. package/.opencode/agents/aether-archaeologist.md +29 -12
  248. package/.opencode/agents/aether-architect.md +103 -36
  249. package/.opencode/agents/aether-auditor.md +51 -18
  250. package/.opencode/agents/aether-builder.md +70 -20
  251. package/.opencode/agents/aether-chaos.md +29 -12
  252. package/.opencode/agents/aether-chronicler.md +60 -18
  253. package/.opencode/agents/aether-gatekeeper.md +27 -18
  254. package/.opencode/agents/aether-includer.md +27 -18
  255. package/.opencode/agents/aether-keeper.md +89 -18
  256. package/.opencode/agents/aether-measurer.md +27 -18
  257. package/.opencode/agents/aether-oracle.md +137 -0
  258. package/.opencode/agents/aether-probe.md +60 -18
  259. package/.opencode/agents/aether-queen.md +172 -24
  260. package/.opencode/agents/aether-route-setter.md +57 -12
  261. package/.opencode/agents/aether-sage.md +26 -18
  262. package/.opencode/agents/aether-scout.md +28 -20
  263. package/.opencode/agents/aether-surveyor-disciplines.md +59 -2
  264. package/.opencode/agents/aether-surveyor-nest.md +59 -2
  265. package/.opencode/agents/aether-surveyor-pathogens.md +57 -2
  266. package/.opencode/agents/aether-surveyor-provisions.md +59 -2
  267. package/.opencode/agents/aether-tracker.md +64 -18
  268. package/.opencode/agents/aether-watcher.md +66 -19
  269. package/.opencode/agents/aether-weaver.md +61 -18
  270. package/.opencode/commands/ant/archaeology.md +7 -14
  271. package/.opencode/commands/ant/build.md +437 -257
  272. package/.opencode/commands/ant/chaos.md +7 -24
  273. package/.opencode/commands/ant/colonize.md +8 -17
  274. package/.opencode/commands/ant/continue.md +661 -142
  275. package/.opencode/commands/ant/council.md +11 -22
  276. package/.opencode/commands/ant/data-clean.md +77 -0
  277. package/.opencode/commands/ant/dream.md +15 -17
  278. package/.opencode/commands/ant/entomb.md +133 -62
  279. package/.opencode/commands/ant/export-signals.md +54 -0
  280. package/.opencode/commands/ant/feedback.md +24 -5
  281. package/.opencode/commands/ant/flag.md +16 -4
  282. package/.opencode/commands/ant/flags.md +24 -10
  283. package/.opencode/commands/ant/focus.md +22 -5
  284. package/.opencode/commands/ant/help.md +41 -8
  285. package/.opencode/commands/ant/history.md +9 -0
  286. package/.opencode/commands/ant/import-signals.md +68 -0
  287. package/.opencode/commands/ant/init.md +374 -167
  288. package/.opencode/commands/ant/insert-phase.md +107 -0
  289. package/.opencode/commands/ant/interpret.md +16 -0
  290. package/.opencode/commands/ant/lay-eggs.md +184 -112
  291. package/.opencode/commands/ant/maturity.md +18 -2
  292. package/.opencode/commands/ant/memory-details.md +83 -0
  293. package/.opencode/commands/ant/migrate-state.md +12 -0
  294. package/.opencode/commands/ant/oracle.md +322 -67
  295. package/.opencode/commands/ant/organize.md +18 -16
  296. package/.opencode/commands/ant/patrol.md +626 -0
  297. package/.opencode/commands/ant/pause-colony.md +12 -29
  298. package/.opencode/commands/ant/phase.md +30 -40
  299. package/.opencode/commands/ant/pheromones.md +162 -0
  300. package/.opencode/commands/ant/plan.md +184 -56
  301. package/.opencode/commands/ant/preferences.md +71 -0
  302. package/.opencode/commands/ant/redirect.md +22 -5
  303. package/.opencode/commands/ant/resume-colony.md +38 -27
  304. package/.opencode/commands/ant/resume.md +385 -0
  305. package/.opencode/commands/ant/run.md +201 -0
  306. package/.opencode/commands/ant/seal.md +259 -45
  307. package/.opencode/commands/ant/skill-create.md +63 -0
  308. package/.opencode/commands/ant/status.md +135 -31
  309. package/.opencode/commands/ant/swarm.md +3 -345
  310. package/.opencode/commands/ant/tunnels.md +152 -9
  311. package/.opencode/commands/ant/update.md +70 -91
  312. package/.opencode/commands/ant/verify-castes.md +96 -42
  313. package/.opencode/commands/ant/watch.md +7 -0
  314. package/CHANGELOG.md +356 -0
  315. package/README.md +203 -573
  316. package/bin/cli.js +455 -527
  317. package/bin/generate-commands.js +186 -0
  318. package/bin/generate-commands.sh +127 -88
  319. package/bin/lib/init.js +13 -3
  320. package/bin/lib/spawn-logger.js +0 -15
  321. package/bin/lib/update-transaction.js +392 -140
  322. package/bin/npx-install.js +178 -0
  323. package/bin/sync-to-runtime.sh +5 -137
  324. package/bin/validate-package.sh +166 -0
  325. package/package.json +14 -7
  326. package/.opencode/agents/aether-guardian.md +0 -107
  327. package/.opencode/agents/workers.md +0 -1034
  328. package/bin/lib/model-profiles.js +0 -445
  329. package/bin/lib/model-verify.js +0 -288
  330. package/bin/lib/proxy-health.js +0 -253
  331. package/bin/lib/telemetry.js +0 -441
  332. package/runtime/CONTEXT.md +0 -160
  333. package/runtime/QUEEN_ANT_ARCHITECTURE.md +0 -402
  334. package/runtime/aether-utils.sh +0 -3879
  335. package/runtime/data/signatures.json +0 -41
  336. package/runtime/docs/AETHER-2.0-IMPLEMENTATION-PLAN.md +0 -1343
  337. package/runtime/docs/AETHER-PHEROMONE-SYSTEM-MASTER-SPEC.md +0 -2642
  338. package/runtime/docs/PHEROMONE-INJECTION.md +0 -240
  339. package/runtime/docs/PHEROMONE-INTEGRATION.md +0 -192
  340. package/runtime/docs/PHEROMONE-SYSTEM-DESIGN.md +0 -426
  341. package/runtime/docs/README.md +0 -94
  342. package/runtime/docs/VISUAL-OUTPUT-SPEC.md +0 -219
  343. package/runtime/docs/biological-reference.md +0 -272
  344. package/runtime/docs/codebase-review.md +0 -399
  345. package/runtime/docs/command-sync.md +0 -164
  346. package/runtime/docs/constraints.md +0 -116
  347. package/runtime/docs/implementation-learnings.md +0 -89
  348. package/runtime/docs/known-issues.md +0 -217
  349. package/runtime/docs/namespace.md +0 -148
  350. package/runtime/docs/pathogen-schema-example.json +0 -36
  351. package/runtime/docs/pathogen-schema.md +0 -111
  352. package/runtime/docs/planning-discipline.md +0 -159
  353. package/runtime/docs/progressive-disclosure.md +0 -184
  354. package/runtime/lib/queen-utils.sh +0 -729
  355. package/runtime/model-profiles.yaml +0 -100
  356. package/runtime/planning.md +0 -159
  357. package/runtime/recover.sh +0 -136
  358. package/runtime/templates/QUEEN.md.template +0 -79
  359. package/runtime/utils/chamber-utils.sh +0 -285
  360. package/runtime/utils/file-lock.sh +0 -122
  361. package/runtime/utils/spawn-tree.sh +0 -428
  362. package/runtime/utils/spawn-with-model.sh +0 -56
  363. package/runtime/utils/xml-utils.sh +0 -2196
  364. package/runtime/workers-new-castes.md +0 -516
  365. /package/{runtime → .aether/docs/disciplines}/coding-standards.md +0 -0
  366. /package/{runtime → .aether/docs/disciplines}/debugging.md +0 -0
  367. /package/{runtime → .aether/docs/disciplines}/learning.md +0 -0
  368. /package/{runtime → .aether/docs/disciplines}/tdd.md +0 -0
  369. /package/{runtime → .aether/docs/disciplines}/verification-loop.md +0 -0
  370. /package/{runtime → .aether/docs/disciplines}/verification.md +0 -0
  371. /package/{runtime → .aether}/schemas/aether-types.xsd +0 -0
  372. /package/{runtime → .aether}/schemas/colony-registry.xsd +0 -0
  373. /package/{runtime → .aether}/schemas/pheromone.xsd +0 -0
  374. /package/{runtime → .aether}/schemas/prompt.xsd +0 -0
  375. /package/{runtime → .aether}/schemas/queen-wisdom.xsd +0 -0
  376. /package/{runtime → .aether}/schemas/worker-priming.xsd +0 -0
  377. /package/{runtime → .aether}/utils/colorize-log.sh +0 -0
  378. /package/{runtime → .aether}/utils/queen-to-md.xsl +0 -0
@@ -1,21 +1,12 @@
1
- # /ant:resume Resume Previous Session
2
-
3
- Resume work from where you left off after a context clear or new session start.
4
-
5
- ## When to Use
6
-
7
- - After running `/clear` and wanting to continue previous work
8
- - When opening a new Claude Code session with existing colony state
9
- - To check what you were working on and pick up where you left off
1
+ <!-- Generated from .aether/commands/resume.yaml - DO NOT EDIT DIRECTLY -->
2
+ ---
3
+ name: ant:resume
4
+ description: "Resume Previous Session"
5
+ ---
10
6
 
11
- ## What It Does
7
+ # /ant:resume Resume Previous Session
12
8
 
13
- 1. Reads `.aether/data/session.json` to understand previous activity
14
- 2. Reads `COLONY_STATE.json` to verify colony status
15
- 3. Checks `TO-DOs.md` for relevant pending work
16
- 4. Presents a summary and asks if you want to resume
17
- 5. If yes: Restores context and suggests next step
18
- 6. If no: Offers to start fresh with `/ant:init`
9
+ Resume work after `/clear` or in a new session. Reads colony state, detects codebase drift, and gives you a clear "do this next" recommendation.
19
10
 
20
11
  ## Usage
21
12
 
@@ -23,137 +14,366 @@ Resume work from where you left off after a context clear or new session start.
23
14
  /ant:resume
24
15
  ```
25
16
 
26
- ## Session Recovery Flow
17
+ ---
18
+
19
+ ## Implementation
27
20
 
28
- ### Step 1: Check for Existing Session
21
+ Execute the following steps in order when the user runs `/ant:resume`.
29
22
 
23
+ ---
24
+
25
+ ### Step 1: Read Session State
26
+
27
+ Run using the Bash tool with description "Restoring colony session..."::
30
28
  ```bash
31
29
  bash .aether/aether-utils.sh session-read
32
30
  ```
33
31
 
34
- Check if session exists and whether it's stale (> 24 hours old).
32
+ Parse the JSON result.
35
33
 
36
- ### Step 2: If No Session Found
34
+ - If `exists` is `false`: display the following and **stop**:
37
35
 
38
- Display:
39
36
  ```
40
- 📋 SESSION RESUME
37
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
38
+
39
+ RESUME SESSION
41
40
 
42
41
  No previous session found.
43
42
 
44
- Would you like to:
45
- 1. Start a new colony with /ant:init
46
- 2. Check status with /ant:status
47
- 3. View existing colonies with /ant:history
43
+ Start fresh: /ant:init "your goal"
44
+ Or check: /ant:status
45
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
46
+
48
47
  ```
49
48
 
50
- Offer to run `/ant:init` to start fresh.
49
+ - If `exists` is `true`: extract from the session data:
50
+ - `colony_goal`
51
+ - `current_phase`
52
+ - `last_command`
53
+ - `suggested_next`
54
+ - `baseline_commit`
55
+ - `session_id`
56
+
57
+ ---
58
+
59
+ ### Step 2: Read COLONY_STATE.json (Authoritative Source)
51
60
 
52
- ### Step 3: If Session Exists
61
+ Use the Read tool to read `.aether/data/COLONY_STATE.json`.
53
62
 
54
- Read session data and colony state, then present summary:
63
+ COLONY_STATE.json is the authoritative source for goal and state (session.json may be stale). Extract:
64
+ - `goal` (use this as authoritative, overriding session.json colony_goal)
65
+ - `state` (READY, PLANNING, EXECUTING, PAUSED)
66
+ - `current_phase`
67
+ - `plan.phases` (array with id, name, status for each phase)
68
+ - `plan.generated_at`
69
+ - `memory.decisions` (flat list — do NOT distinguish user vs Claude origin)
70
+ - `events` (last 5 for recent activity context)
71
+
72
+ If the file is missing or the JSON cannot be parsed, **stop immediately** and display:
55
73
 
56
74
  ```
57
- 📋 SESSION RESUME
75
+ State file missing or corrupted.
58
76
 
59
- You were working on: {colony_goal}
60
- Current Phase: {current_phase} ({current_milestone})
61
- Last Command: {last_command}
62
- Last Active: {hours_ago} hours ago
63
- Suggested Next: {suggested_next}
77
+ Options:
78
+ 1. Start fresh with /ant:init "goal"
79
+ 2. Try to recover (I'll look for backup files)
80
+
81
+ What would you like to do?
82
+ ```
83
+
84
+ Do NOT proceed with stale or fabricated data.
85
+
86
+ ---
87
+
88
+ ### Step 3: Read Pheromone Signals
89
+
90
+
91
+ Use the Read tool to read `.aether/data/constraints.json`.
92
+
93
+ Extract the following top-level keys:
94
+ - `focus` array — active focus signals (if key missing, treat as empty array)
95
+ - `constraints` array — active redirect/constraint signals (if key missing, treat as empty array)
96
+
97
+ If the file is missing: skip silently (no pheromones active).
98
+
99
+ Pheromones persist until explicitly cleared — no decay.
100
+
101
+
102
+
103
+ ---
104
+
105
+ ### Step 4: Read CONTEXT.md
106
+
107
+ Use the Read tool to read `.aether/CONTEXT.md` if it exists.
108
+
109
+ If missing: fall back to COLONY_STATE.json for narrative context. Note: "Context document not found — reconstructing from state."
110
+
111
+ ---
112
+
113
+ ### Step 5: Drift Detection
114
+
115
+ Extract `baseline_commit` from the session.json data read in Step 1.
116
+
117
+ ```bash
118
+ current_commit=$(git rev-parse HEAD 2>/dev/null || echo "")
119
+ ```
120
+
121
+ If `baseline_commit` is non-empty and differs from `current_commit`:
122
+
123
+ ```bash
124
+ commit_count=$(git rev-list --count "$baseline_commit..HEAD" 2>/dev/null || echo "0")
125
+ changed_count=$(git diff --stat "$baseline_commit" HEAD 2>/dev/null | tail -1 | grep -oE '[0-9]+ file' | grep -oE '[0-9]+' || echo "0")
126
+ ```
127
+
128
+ Store `drift_detected=true`, `commit_count`, `changed_count` for dashboard rendering.
129
+
130
+ If `baseline_commit` is empty or matches `current_commit`: set `drift_detected=false`.
131
+
132
+ Restore identically regardless of time elapsed — no warnings about session age.
133
+
134
+ ---
135
+
136
+ ### Step 6: Compute Workflow Position and Next-Step Guidance
137
+
138
+ Compute `suggested_next` dynamically from COLONY_STATE.json data. Do not use the static value from session.json.
139
+
140
+ Use this decision tree:
141
+
142
+ ```
143
+ Case 1 — No plan created yet:
144
+ Check: plan.phases is empty AND plan.generated_at is null
145
+ recommended = "/ant:plan"
146
+ reason = "No plan created yet"
147
+ alternatives = ["/ant:colonize — analyze codebase first"]
148
+
149
+ Case 2 — Plan ready, first phase not started:
150
+ Check: plan.phases is not empty AND state == "READY" AND current_phase == 0
151
+ recommended = "/ant:build 1"
152
+ reason = "Plan ready, first phase not started"
153
+ alternatives = ["/ant:plan — review or regenerate plan"]
154
+
155
+ Case 3 — Build in progress:
156
+ Check: state == "EXECUTING"
157
+ recommended = "/ant:continue"
158
+ reason = "Build in progress"
159
+ alternatives = ["/ant:build {current_phase} — rebuild current phase", "/ant:flags — check for blockers"]
160
+
161
+ Case 4 — Phase complete, next phase available:
162
+ Check: state == "READY" AND current_phase > 0 AND current_phase < plan.phases.length
163
+ next = current_phase + 1
164
+ recommended = "/ant:build {next}"
165
+ reason = "Phase {current_phase} complete, ready for next"
166
+ alternatives = ["/ant:plan — regenerate plan", "/ant:phase {next} — preview next phase"]
167
+
168
+ Case 5 — All phases complete:
169
+ Check: state == "READY" AND current_phase > 0 AND current_phase >= plan.phases.length
170
+ recommended = "/ant:seal"
171
+ reason = "All phases complete"
172
+ alternatives = ["/ant:status — view final state"]
173
+
174
+ Case 6 — Colony paused:
175
+ Check: state == "PAUSED"
176
+ recommended = "/ant:resume-colony"
177
+ reason = "Colony is paused"
178
+ alternatives = ["/ant:status — check state first"]
179
+
180
+ Default:
181
+ recommended = "/ant:status"
182
+ reason = "Check colony status"
183
+ alternatives = []
184
+ ```
64
185
 
65
- Active TODOs:
66
- - {todo1}
67
- - {todo2}
186
+ ---
68
187
 
69
- Would you like to resume this work?
188
+ ### Step 7: Workflow-Step Blocking (Early-Return Guards)
189
+
190
+ Run these guards BEFORE rendering the dashboard. If a blocking condition is detected, output the block message and STOP. Do not render the dashboard. Do not offer alternative commands.
191
+
192
+ **BLOCK CONDITION 1: No plan exists**
193
+
194
+ Check: plan.phases is empty AND plan.generated_at is null
195
+
196
+ Output and STOP:
197
+
198
+ ```
199
+ BLOCKED: No plan exists yet.
200
+ Required: Run /ant:plan to create a build plan.
201
+ Goal: {goal}
202
+ ```
203
+
204
+ Stop here — do not continue to Step 8 or render the dashboard.
205
+
206
+ ---
207
+
208
+ **BLOCK CONDITION 2: Plan attempted but failed**
209
+
210
+ Check: plan.phases is empty AND plan.generated_at is not null
211
+
212
+ Output and STOP:
213
+
214
+ ```
215
+ BLOCKED: Plan was attempted but has no phases.
216
+ Required: Run /ant:plan to regenerate the plan.
217
+ Goal: {goal}
70
218
  ```
71
219
 
72
- Use `AskUserQuestion` to present options:
73
- - **Yes, resume** — Continue where you left off
74
- - **Show details** — See full colony state first
75
- - **No, start fresh** — Clear session and start new
220
+ Stop here — do not continue to Step 8 or render the dashboard.
221
+
222
+ ---
76
223
 
77
- ### Step 4: If User Chooses "Yes, resume"
224
+ **BLOCK CONDITION 3: Build interrupted**
78
225
 
79
- 1. Mark session as resumed:
80
- ```bash
81
- bash .aether/aether-utils.sh session-mark-resumed
82
- ```
226
+ Check: state == "EXECUTING" AND the last 3 events show no recent build activity
83
227
 
84
- 2. Present context summary:
85
- ```
86
- 🔄 Resuming Session
228
+ Output and STOP:
87
229
 
88
- Colony: {goal}
89
- Phase: {phase} - {milestone}
90
- Context restored.
230
+ ```
231
+ BLOCKED: Build may have been interrupted.
232
+ Required: Run /ant:continue to check and advance.
233
+ Goal: {goal}
234
+ ```
91
235
 
92
- Next suggested step: {suggested_next}
93
- ```
236
+ Stop here do not continue to Step 8 or render the dashboard.
94
237
 
95
- 3. Run the suggested command or present further options based on state.
238
+ ---
96
239
 
97
- ### Step 5: If User Chooses "Show details"
240
+ ### Step 8: Render Dashboard
241
+
242
+ Lead with the next-step recommendation. Context follows underneath ("straight to action" ordering).
98
243
 
99
- Display:
100
244
  ```
101
- 📊 Colony Details
245
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
246
+
247
+ RESUME SESSION
248
+
249
+ Next: {recommended}
250
+ {reason}
251
+ {if alternatives exist:}
252
+ Also: {alternatives, comma-separated}
253
+ {end}
254
+
255
+ {if drift_detected:}
256
+ Note: Codebase changed since last session ({commit_count} commit(s), {changed_count} file(s) modified)
257
+ {end}
102
258
 
103
259
  Goal: {goal}
104
260
  State: {state}
105
- Phase: {phase}
106
- Milestone: {milestone}
261
+ Phase: {current_phase}/{total_phases}
107
262
 
108
- Recent Activity (from activity.log):
109
- {last 5 entries}
263
+ Phase Progress:
264
+ {for each phase in plan.phases:}
265
+ [{status_icon}] Phase {id}: {name}
266
+ {end}
267
+ ```
110
268
 
111
- Pending TODOs:
112
- {todos}
269
+ Status icons:
270
+ - completed: `v` (checkmark)
271
+ - in_progress: `~` (tilde)
272
+ - pending: ` ` (space)
113
273
 
114
- [Present Yes/No choice to resume]
115
274
  ```
275
+ {if memory.decisions is not empty:}
276
+ Recent Decisions:
277
+ {for each of the last 5 decisions:}
278
+ - {decision text}
279
+ {end}
280
+ {end}
116
281
 
117
- ### Step 6: If User Chooses "No, start fresh"
282
+ {if signals array from Step 3 is not empty:}
283
+ Active Signals:
118
284
 
119
- 1. Clear the session:
120
- ```bash
121
- bash .aether/aether-utils.sh session-clear
122
- ```
285
+ {for each focus signal:}
286
+ FOCUS: {focus text}
287
+ {end}
288
+ {for each constraint signal:}
289
+ REDIRECT: {constraint text}
290
+ {end}
123
291
 
124
- 2. Offer:
125
- ```
126
- Session cleared.
127
292
 
128
- Start fresh with:
129
- - /ant:init "your new goal"
130
- - /ant:status (to check other colonies)
131
- ```
293
+ {end}
294
+ ```
132
295
 
133
- ## Integration with Colony Commands
296
+ ---
134
297
 
135
- All `/ant:*` commands should update the session after execution:
298
+ ### Step 8.5: Display Memory Health (Secondary)
136
299
 
300
+ Run using the Bash tool with description "Loading memory health..."::
137
301
  ```bash
138
- # Example: After /ant:build completes
139
- bash .aether/aether-utils.sh session-update "/ant:build $phase" "/ant:continue" "Completed phase $phase"
302
+ bash .aether/aether-utils.sh resume-dashboard
140
303
  ```
141
304
 
142
- This ensures session.json is always current for resume functionality.
305
+ Extract memory_health from the JSON result:
306
+ - wisdom_count
307
+ - pending_promotions
308
+ - recent_failures
143
309
 
144
- ## Session File Location
310
+ Display after the main dashboard:
311
+ ```
312
+ 📊 Memory Health
313
+ Wisdom: {wisdom_count} entries | Pending: {pending_promotions} promotions | Failures: {recent_failures} recent
145
314
 
146
- `.aether/data/session.json`
315
+ Run /ant:memory-details for full breakdown
316
+ ```
147
317
 
148
- This file persists across context clears and Claude Code sessions.
318
+ If all counts are 0, show:
319
+ ```
320
+ 📊 Memory Health
321
+ No accumulated wisdom yet. Complete phases to build colony memory.
322
+ ```
149
323
 
150
- ## Stale Session Detection
324
+ Last Command: {last_command}
325
+ Session: {session_id}
326
+ ```
151
327
 
152
- Sessions older than 24 hours are marked "stale":
153
- - User is warned: "This session is X days old"
154
- - Given option to resume anyway or start fresh
155
- - Helps prevent accidentally resuming ancient work
328
+ ---
329
+
330
+ ### Step 9: Mark Session Resumed
331
+
332
+ Run using the Bash tool with description "Marking session as resumed..."::
333
+ ```bash
334
+ bash .aether/aether-utils.sh session-mark-resumed
335
+ ```
336
+
337
+ ### Step 10: Next Up
338
+
339
+ Generate the state-based Next Up block by Run using the Bash tool with description "Generating Next Up suggestions..."::
340
+ ```bash
341
+ state=$(jq -r '.state // "IDLE"' .aether/data/COLONY_STATE.json)
342
+ current_phase=$(jq -r '.current_phase // 0' .aether/data/COLONY_STATE.json)
343
+ total_phases=$(jq -r '.plan.phases | length' .aether/data/COLONY_STATE.json)
344
+ bash .aether/aether-utils.sh print-next-up "$state" "$current_phase" "$total_phases"
345
+ ```
346
+
347
+ ---
348
+
349
+ ## Error Handling Reference
350
+
351
+ | Condition | Response |
352
+ |-----------|----------|
353
+ | session.json missing (exists=false) | "No previous session found" — offer /ant:init and /ant:status |
354
+ | COLONY_STATE.json missing or corrupted | Pause, ask user: start fresh or recover |
355
+
356
+ | constraints.json missing | Skip silently (no pheromones) |
357
+
358
+
359
+ | CONTEXT.md missing | Fall back to COLONY_STATE.json narrative |
360
+ | No plan phases, no generated_at | BLOCK — redirect to /ant:plan |
361
+ | Plan attempted but no phases | BLOCK — redirect to /ant:plan |
362
+ | State EXECUTING, events show no activity | BLOCK — redirect to /ant:continue |
363
+ | baseline_commit matches current HEAD | No drift warning shown |
364
+ | baseline_commit differs from current HEAD | Show informational drift note |
365
+
366
+ ---
367
+
368
+ ## Key Constraints
369
+
370
+
371
+ - Use Read tool for COLONY_STATE.json and constraints.json (not bash cat/jq).
156
372
 
157
- ## Implementation
158
373
 
159
- Execute this flow when user runs `/ant:resume`.
374
+ - Use Bash tool only for aether-utils.sh commands and git commands
375
+ - Handle ALL missing/corrupted file cases gracefully
376
+ - Time-agnostic: restore identically regardless of how long ago the session was
377
+ - Decisions shown as flat list — no user vs Claude distinction
378
+ - Blocking guards run BEFORE dashboard rendering (early-return pattern)
379
+ - Drift detection is informational only — not alarming, not a blocker
@@ -0,0 +1,195 @@
1
+ <!-- Generated from .aether/commands/run.yaml - DO NOT EDIT DIRECTLY -->
2
+ ---
3
+ name: ant:run
4
+ description: "Autopilot — builds, verifies, learns, and advances through phases automatically with smart pausing"
5
+ ---
6
+
7
+ You are the **Queen**. Execute `/ant:run` — the adaptive autopilot loop.
8
+
9
+ The arguments are: `$ARGUMENTS`
10
+
11
+ ## Purpose
12
+
13
+ This command automates the build-continue-advance cycle across multiple phases.
14
+ It reads and executes the same playbooks used by `/ant:build` and `/ant:continue`,
15
+ chaining them in a loop with intelligent pause conditions.
16
+
17
+ ## Rules
18
+
19
+ 1. Do **not** invoke nested slash commands (`/ant:build`, `/ant:continue`, etc.).
20
+ 2. Use the Read tool to load each playbook file, then execute it inline.
21
+ 3. Preserve variables/results from prior stages and pass them forward.
22
+ 4. Stop immediately on any pause condition (defined below).
23
+ 5. Keep existing behavior and output format from the playbooks.
24
+ 6. Log `autopilot_advance` events after each successful phase transition.
25
+
26
+ ## Arguments
27
+
28
+ Parse `$ARGUMENTS` for:
29
+ - `--max-phases N` — Max phases to process (default: all remaining)
30
+ - `--replan-interval N` — Pause for replan suggestion every N phases (default: 2)
31
+ - `--continue` — Resume after a replan pause without replanning
32
+ - `--dry-run` — Preview plan without executing
33
+ - `--verbose` / `-v`, `--no-visual`, `--no-suggest` — Pass through to playbooks
34
+
35
+ ```
36
+ /ant:run Run all remaining phases
37
+ /ant:run --max-phases 2 Run at most 2 phases then stop
38
+ /ant:run --replan-interval 3 Suggest replan every 3 phases instead of 2
39
+ /ant:run --continue Resume after replan pause without replanning
40
+ /ant:run --dry-run Preview the autopilot plan
41
+ /ant:run --max-phases 3 -v Run 3 phases with verbose output
42
+ ```
43
+
44
+ ## Dry Run Mode
45
+
46
+ If `--dry-run`: read COLONY_STATE.json, list remaining incomplete phases
47
+ (applying `--max-phases` cap), display the plan, then stop without executing.
48
+
49
+ ```
50
+ ━━━ A U T O P I L O T P R E V I E W ━━━
51
+ Goal: {goal} | Current: Phase {N} | Remaining: {count} | Max: {max or "all"}
52
+
53
+ Phase {id}: {name} ({task_count} tasks) -> build -> continue -> advance
54
+ ...
55
+
56
+ Pause triggers: test failures, critical Chaos findings, new blockers,
57
+ security gate failures, quality gate failures, runtime verification needed,
58
+ replan suggestion (every {replan_interval} phases)
59
+ ```
60
+
61
+ ## Autopilot Loop
62
+
63
+ ### Step 0: Initialize
64
+
65
+ 1. Read `.aether/data/COLONY_STATE.json`; validate goal + plan.phases exist
66
+ 2. Determine remaining incomplete phases; apply `--max-phases` cap
67
+ 3. Set `phases_completed = 0`, `autopilot_start = $(date +%s)`
68
+ 4. Record pre-build blocker count: `bash .aether/aether-utils.sh flag-check-blockers {phase}`
69
+ 5. Display: `AUTOPILOT ENGAGED | Goal: {goal} | Phase {N} | Max: {max or "all"}`
70
+
71
+ ### Step 1: Build Phase
72
+
73
+ Execute build playbooks in order, carrying cross-stage state
74
+ (`phase_id`, `visual_mode`, `verbose_mode`, `suggest_enabled`,
75
+ `prompt_section`, `wave_results`,
76
+ `verification_status`, `synthesis_status`, `next_action`):
77
+
78
+ 1. `.aether/docs/command-playbooks/build-prep.md`
79
+ 2. `.aether/docs/command-playbooks/build-context.md`
80
+ 3. `.aether/docs/command-playbooks/build-wave.md`
81
+ 4. `.aether/docs/command-playbooks/build-verify.md`
82
+ 5. `.aether/docs/command-playbooks/build-complete.md`
83
+
84
+ Capture the synthesis result for pause evaluation.
85
+
86
+ ### Step 2: Build Pause Check
87
+
88
+ **PAUSE if ANY of these are true** (display reason, log event, STOP):
89
+
90
+ | # | Condition | Source |
91
+ |---|-----------|--------|
92
+ | 1 | Watcher `verification_passed == false` | build-verify synthesis |
93
+ | 2 | Any Chaos finding severity `critical` or `high` | build-verify synthesis |
94
+ | 3 | New blocker flags created (count increased since Step 0.4) | flag-check-blockers |
95
+
96
+ On pause, display the AUTOPILOT PAUSED banner with reason, affected phase,
97
+ specific issues, and instruction: "Fix issues, then run /ant:run to resume."
98
+ Log: `"<timestamp>|autopilot_paused|run|Paused at Phase {id}: {reason}"`
99
+
100
+ **If no pause:** proceed to Step 3.
101
+
102
+ ### Step 3: Continue (Verify + Advance)
103
+
104
+ Execute continue playbooks in order, carrying cross-stage state
105
+ (`visual_mode`, `state`, `current_phase`, `verification_results`,
106
+ `gate_results`, `advancement_result`, `next_phase_id`, `completion_state`):
107
+
108
+ 1. `.aether/docs/command-playbooks/continue-verify.md`
109
+ 2. `.aether/docs/command-playbooks/continue-gates.md`
110
+ 3. `.aether/docs/command-playbooks/continue-advance.md`
111
+ 4. `.aether/docs/command-playbooks/continue-finalize.md`
112
+
113
+ **Autopilot override for runtime verification (Step 1.11 in continue-gates):**
114
+ Skip the AskUserQuestion prompt. Instead, auto-PAUSE with reason
115
+ "Runtime verification required" so the user can test manually before resuming.
116
+
117
+ ### Step 4: Continue Pause Check
118
+
119
+ **PAUSE if ANY of these are true:**
120
+
121
+ | # | Condition | Source |
122
+ |---|-----------|--------|
123
+ | 4 | Verification loop reported NOT READY | continue-verify |
124
+ | 5 | Gatekeeper found critical CVEs | continue-gates |
125
+ | 6 | Auditor critical findings or score < 60 | continue-gates |
126
+ | 7 | Unresolved blocker flags remain | continue-gates |
127
+ | 8 | Runtime verification needed | continue-gates Step 1.11 |
128
+ | 9 | All phases complete (no next phase) | continue-advance |
129
+ | 10 | Replan trigger fires (unless `--continue`) | autopilot-check-replan (Step 5.5) |
130
+
131
+ For condition 9: jump to Step 6 (celebration). For condition 10: PAUSE with
132
+ replan suggestion (see Step 5.5). For all others: PAUSE with reason, log event, STOP.
133
+
134
+ **If no pause:** proceed to Step 5.
135
+
136
+ ### Step 5: Auto-Advance and Loop
137
+
138
+ 1. Increment `phases_completed`
139
+ 2. Update autopilot state: `bash .aether/aether-utils.sh autopilot-update --action advance --phase {next} --result success`
140
+ 3. Log: `"<timestamp>|autopilot_advance|run|Phase {prev} -> {next} ({phases_completed}/{max})"`
141
+ 4. Display: `--- Autopilot: Phase {prev} done -> Phase {next} ({N}/{max}) ---`
142
+ 5. **Replan check** (see Step 5.5)
143
+ 6. If `phases_completed >= max_phases` or no incomplete phases: go to Step 6
144
+ 7. Otherwise: update `current_phase`, return to Step 1
145
+
146
+ ### Step 5.5: Replan Trigger Check
147
+
148
+ After each successful phase advance, check if a replan pause should fire:
149
+
150
+ ```bash
151
+ bash .aether/aether-utils.sh autopilot-check-replan --interval {replan_interval}
152
+ ```
153
+
154
+ If `--continue` flag was passed: skip this check entirely (user dismissed replan).
155
+
156
+ If `result.should_replan == true`: **PAUSE** with replan suggestion banner:
157
+
158
+ ```
159
+ ━━━ R E P L A N S U G G E S T E D ━━━
160
+ Phases auto-completed: {N} | Learnings accumulated: {learnings_since_last}
161
+
162
+ The colony has completed {N} phases since the last plan review.
163
+ New learnings may have changed the optimal path forward.
164
+
165
+ Options:
166
+ /ant:plan Regenerate phases with current learnings
167
+ /ant:run --continue Dismiss and continue without replanning
168
+ ```
169
+
170
+ Log: `"<timestamp>|autopilot_replan_pause|run|Replan suggested after {N} phases ({learnings} learnings)"`
171
+
172
+ If `result.should_replan == false`: proceed normally (no pause).
173
+
174
+ ### Step 6: Final Summary
175
+
176
+ ```
177
+ ━━━ A U T O P I L O T C O M P L E T E ━━━
178
+ Phases completed: {N} | Elapsed: {Xm Ys} | Now at: Phase {current}
179
+
180
+ {all complete} -> Colony goal achieved! Run /ant:seal
181
+ {max reached} -> Run /ant:run to continue
182
+ {replan} -> Run /ant:plan to replan, or /ant:run --continue to dismiss
183
+ {paused} -> Fix {reason}, then /ant:run to resume
184
+ ```
185
+
186
+ Update session:
187
+ `bash .aether/aether-utils.sh session-update "/ant:run" "/ant:run" "Autopilot: {N} phases, now Phase {current}"`
188
+
189
+ ## Execution Contract
190
+
191
+ For each playbook stage: Read file, execute inline, track `{stage_name, status, key_outputs}`.
192
+ If `status == failed`: evaluate pause conditions. Pause = graceful stop with saved state.
193
+ Hard failure (e.g., state corruption) = halt immediately, no recovery attempt.
194
+
195
+ On every pause: save COLONY_STATE.json, log event, update session, display resume instructions.