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,621 @@
1
+ name: "ant:patrol"
2
+ description: "🐜🔦 Patrol the colony — comprehensive pre-seal review of all work against the plan"
3
+ body: |
4
+ {{#claude}}
5
+ You are the **Queen**. Send patrol ants through the colony before sealing.
6
+ {{/claude}}
7
+ {{#opencode}}
8
+ You are the **Queen**. Run a comprehensive audit of the colony before sealing.
9
+ {{/opencode}}
10
+
11
+ ## Instructions
12
+
13
+ Parse `{{ARGUMENTS}}`:
14
+ - If contains `--no-visual`: set `visual_mode = false` (visual is ON by default)
15
+ - Otherwise: set `visual_mode = true`
16
+
17
+ <failure_modes>
18
+ ### State Read Failure
19
+ If COLONY_STATE.json is missing or unreadable:
20
+ - Report: "No colony initialized. Run /ant:init first."
21
+ - Stop immediately.
22
+
23
+ ### Test Command Failure
24
+ If npm test or bash test suites fail to run:
25
+ - Record the failure in the report as "Tests: UNABLE TO RUN"
26
+ - Continue with remaining audit steps (non-blocking)
27
+
28
+ ### Subagent Spawn Failure
29
+ If a scout or watcher agent fails to spawn:
30
+ - Fall back to running the verification inline (Queen does it directly)
31
+ - Note the fallback in the report
32
+ </failure_modes>
33
+
34
+ <success_criteria>
35
+ Command is complete when:
36
+ - All 8 audit steps have been executed
37
+ - completion-report.md is written to .aether/data/
38
+ - User sees formatted audit results with pass/fail indicators
39
+ - No files were modified except completion-report.md
40
+ </success_criteria>
41
+
42
+ <read_only>
43
+ Do not touch during audit (except completion-report.md):
44
+ - .aether/dreams/ (user notes)
45
+ - .aether/chambers/ (archived colonies)
46
+ - Source code files
47
+ - .env* files
48
+ - .claude/settings.json
49
+ - COLONY_STATE.json (read-only during audit)
50
+ - CLAUDE.md (read-only during audit)
51
+ </read_only>
52
+
53
+ ### Step 1: Load Colony State
54
+
55
+ Read these files in parallel using the Read tool:
56
+ - `.aether/data/COLONY_STATE.json`
57
+ - `CLAUDE.md`
58
+
59
+ If `COLONY_STATE.json` is missing or `goal: null`:
60
+ ```
61
+ No colony initialized. Run /ant:init first.
62
+ ```
63
+ Stop here.
64
+
65
+ Extract from COLONY_STATE.json:
66
+ - `goal` — colony objective
67
+ - `state` — current state (IDLE, READY, EXECUTING, PLANNING)
68
+ - `current_phase` — active phase number
69
+ - `plan.phases` — all phases with tasks and statuses
70
+ - `memory.instincts` — learned patterns
71
+ - `memory.phase_learnings` — phase-specific learnings
72
+ - `memory.decisions` — recorded decisions
73
+ - `events` — event log
74
+ - `milestone` — current milestone
75
+ - `initialized_at` — colony start time
76
+ - `version` — state version
77
+
78
+ Display audit header:
79
+ ```
80
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
81
+ C O L O N Y A U D I T
82
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
83
+
84
+ Goal: {goal}
85
+ Milestone: {milestone}
86
+ State: {state}
87
+ Auditing...
88
+ ```
89
+
90
+ Initialize tracking variables:
91
+ - `audit_issues = []` — list of issues found
92
+ - `audit_passes = 0` — count of checks that passed
93
+ - `audit_fails = 0` — count of checks that failed
94
+ - `audit_warnings = 0` — count of warnings
95
+
96
+ ### Step 2: Plan vs Reality Verification
97
+
98
+ Display: `Verifying plan against codebase...`
99
+
100
+ For each phase in `plan.phases`:
101
+
102
+ 1. **Check phase status:** Record whether status is "completed", "in_progress", or "pending"
103
+
104
+ 2. **Verify task evidence:** For each task in the phase:
105
+ - Parse the task description for verifiable claims:
106
+ - If description mentions "create" or "add" a file: use Glob to check the file exists
107
+ - If description mentions "subcommand" or "command": use Grep to search for it in the codebase
108
+ - If description mentions "update" or "modify" a file: use Glob to check the file exists
109
+ - If description mentions "test": use Glob to check test files exist
110
+ - Classify each task as:
111
+ - **VERIFIED** — evidence found in codebase
112
+ - **UNVERIFIABLE** — task description too vague to verify programmatically
113
+ - **MISSING** — task claims to create/modify something that doesn't exist
114
+
115
+ 3. **Compile results:**
116
+ ```
117
+ Phase {N}: {name} [{status}]
118
+ Tasks: {verified} verified | {unverifiable} unverifiable | {missing} missing evidence
119
+ {For each MISSING task: " MISSING: {task description}"}
120
+ ```
121
+
122
+ Track totals:
123
+ - `total_tasks`, `verified_tasks`, `unverifiable_tasks`, `missing_tasks`
124
+
125
+ If `missing_tasks > 0`: increment `audit_fails` and add to `audit_issues`
126
+ Otherwise: increment `audit_passes`
127
+
128
+ ### Step 3: Documentation Accuracy Audit
129
+
130
+ Display: `Auditing documentation accuracy...`
131
+
132
+ Spawn a **Watcher** using Task tool with `subagent_type="aether-watcher"`:
133
+
134
+ ```xml
135
+ <task>
136
+ <description>Documentation accuracy audit for colony pre-seal review</description>
137
+ <prompt>
138
+ You are a Watcher Ant performing a documentation accuracy audit.
139
+
140
+ Mission: Verify that key documentation files accurately reflect the current codebase state.
141
+
142
+ **IMPORTANT:** You are strictly read-only. Do not modify any files.
143
+
144
+ ## Checks to Perform
145
+
146
+ ### 1. Command Count Verification
147
+ - Count files in .claude/commands/ant/ (use Glob: .claude/commands/ant/*.md)
148
+ - Count files in .opencode/commands/ant/ (use Glob: .opencode/commands/ant/*.md)
149
+ - Read CLAUDE.md and find the claimed command count (look for "Slash commands" in Quick Reference table)
150
+ - Compare: do counts match claimed numbers?
151
+
152
+ ### 2. Agent Count Verification
153
+ - Count files in .claude/agents/ant/ (use Glob: .claude/agents/ant/*.md)
154
+ - Read CLAUDE.md and find the claimed agent count (look for "Agent definitions" in Quick Reference)
155
+ - Compare: do counts match?
156
+
157
+ ### 3. Version Consistency
158
+ - Read version from CLAUDE.md (look for "Current Version" in Quick Reference)
159
+ - Read version from package.json (if exists)
160
+ - Read version from .aether/docs/source-of-truth-map.md (if exists)
161
+ - Compare: are all versions consistent?
162
+
163
+ ### 4. Colony Rules Verification
164
+ - Read .claude/rules/aether-colony.md
165
+ - Check the "Available Commands" table — does it list all commands that exist in .claude/commands/ant/?
166
+ - Identify any commands that exist as files but are missing from the table
167
+ - Identify any commands listed in the table but missing as files
168
+
169
+ ### 5. Source of Truth Map Spot-Check
170
+ - Read .aether/docs/source-of-truth-map.md (if exists)
171
+ - Pick 3-5 entries and verify the claimed paths exist
172
+ - Report any broken references
173
+
174
+ ## Output
175
+
176
+ Return ONLY this JSON (no other text):
177
+ {
178
+ "ant_name": "audit-watcher",
179
+ "caste": "watcher",
180
+ "status": "completed",
181
+ "summary": "Documentation accuracy audit results",
182
+ "checks": [
183
+ {
184
+ "name": "command_count",
185
+ "status": "PASS|FAIL|WARN",
186
+ "expected": "value from docs",
187
+ "actual": "value from codebase",
188
+ "detail": "explanation"
189
+ },
190
+ {
191
+ "name": "agent_count",
192
+ "status": "PASS|FAIL|WARN",
193
+ "expected": "value from docs",
194
+ "actual": "value from codebase",
195
+ "detail": "explanation"
196
+ },
197
+ {
198
+ "name": "version_consistency",
199
+ "status": "PASS|FAIL|WARN",
200
+ "expected": "all same",
201
+ "actual": "list of versions found",
202
+ "detail": "explanation"
203
+ },
204
+ {
205
+ "name": "colony_rules_commands",
206
+ "status": "PASS|FAIL|WARN",
207
+ "expected": "all commands listed",
208
+ "actual": "missing or extra commands",
209
+ "detail": "explanation"
210
+ },
211
+ {
212
+ "name": "source_of_truth_map",
213
+ "status": "PASS|FAIL|WARN",
214
+ "expected": "all paths valid",
215
+ "actual": "broken paths if any",
216
+ "detail": "explanation"
217
+ }
218
+ ],
219
+ "accuracy_score": 0,
220
+ "blockers": []
221
+ }
222
+ </prompt>
223
+ </task>
224
+ ```
225
+
226
+ **FALLBACK:** If "Agent type not found", use general-purpose agent and inject role: "You are a Watcher Ant - quality specialist that validates accuracy and consistency."
227
+
228
+ **Parse Watcher output:**
229
+ Extract `checks` array and `accuracy_score`.
230
+
231
+ For each check:
232
+ - If `status == "PASS"`: increment `audit_passes`
233
+ - If `status == "FAIL"`: increment `audit_fails`, add to `audit_issues`
234
+ - If `status == "WARN"`: increment `audit_warnings`, add to `audit_issues`
235
+
236
+ Display:
237
+ ```
238
+ Documentation Accuracy:
239
+ {For each check: "[PASS|FAIL|WARN] {name}: {detail}"}
240
+ Score: {accuracy_score}%
241
+ ```
242
+
243
+ ### Step 4: Unresolved Issues Review
244
+
245
+ Display: `Reviewing unresolved issues...`
246
+
247
+ Run these commands in parallel using the Bash tool:
248
+
249
+ **Flags check:**
250
+ ```bash
251
+ bash .aether/aether-utils.sh flag-list 2>/dev/null || echo '{"result":{"flags":[]}}'
252
+ ```
253
+
254
+ **Midden check:**
255
+ ```bash
256
+ bash .aether/aether-utils.sh midden-recent-failures 2>/dev/null || echo '{"result":{"failures":[]}}'
257
+ ```
258
+
259
+ **Parse flag results:**
260
+ - Count unresolved flags by severity (blocker, high, medium, low)
261
+ - List any unresolved blockers with their titles
262
+
263
+ **Parse midden results:**
264
+ - Look for recurring patterns (same error type appearing 3+ times)
265
+ - List recurring failure patterns
266
+
267
+ Display:
268
+ ```
269
+ Unresolved Issues:
270
+ Flags: {blocker_count} blockers | {high_count} high | {medium_count} medium | {low_count} low
271
+ {For each unresolved blocker: " BLOCKER: {title}"}
272
+ Midden: {failure_count} recent failures | {recurring_count} recurring patterns
273
+ {For each recurring pattern: " RECURRING: {pattern}"}
274
+ ```
275
+
276
+ If `blocker_count > 0`: increment `audit_fails`, add blockers to `audit_issues`
277
+ If `recurring_count > 0`: increment `audit_warnings`, add to `audit_issues`
278
+ Otherwise: increment `audit_passes`
279
+
280
+ ### Step 5: Test Coverage Summary
281
+
282
+ Display: `Checking test coverage...`
283
+
284
+ {{#claude}}
285
+ **Count test files created during colony lifetime:**
286
+ {{/claude}}
287
+ {{#opencode}}
288
+ **Count test files:**
289
+ {{/opencode}}
290
+
291
+ Run using the Bash tool:
292
+ ```bash
293
+ # Count test files
294
+ test_count_unit=$(ls -1 tests/unit/*.test.sh 2>/dev/null | wc -l | tr -d ' ')
295
+ test_count_e2e=$(ls -1 tests/e2e/*.test.sh 2>/dev/null | wc -l | tr -d ' ')
296
+ test_count_js=$(find . -name "*.test.js" -o -name "*.test.ts" -o -name "*.spec.js" -o -name "*.spec.ts" 2>/dev/null | wc -l | tr -d ' ')
297
+ echo "unit=$test_count_unit"
298
+ echo "e2e=$test_count_e2e"
299
+ echo "js=$test_count_js"
300
+ echo "total=$((test_count_unit + test_count_e2e + test_count_js))"
301
+ ```
302
+
303
+ **Run test suites (capture counts, do not block on failure):**
304
+
305
+ Run using the Bash tool (with timeout 120000):
306
+ ```bash
307
+ npm test 2>&1 | tail -20
308
+ ```
309
+
310
+ Parse output for pass/fail counts. If command fails, record as "UNABLE TO RUN".
311
+
312
+ Run bash test suites if they exist:
313
+ ```bash
314
+ if [[ -f "tests/e2e/run-all-e2e.sh" ]]; then
315
+ bash tests/e2e/run-all-e2e.sh 2>&1 | tail -10
316
+ fi
317
+ ```
318
+
319
+ Display:
320
+ ```
321
+ Test Coverage:
322
+ Test files: {unit} unit | {e2e} e2e | {js} JS/TS
323
+ Results: {pass_count} passing | {fail_count} failing
324
+ {If any failing: " FAILING: {list of failing test names}"}
325
+ ```
326
+
327
+ If tests all pass: increment `audit_passes`
328
+ If any fail: increment `audit_fails`, add to `audit_issues`
329
+
330
+ ### Step 6: Colony Health Check
331
+
332
+ Display: `Checking colony health...`
333
+
334
+ **Expire stale pheromones:**
335
+ ```bash
336
+ bash .aether/aether-utils.sh pheromone-expire 2>/dev/null || true
337
+ ```
338
+
339
+ **Load memory metrics:**
340
+ ```bash
341
+ bash .aether/aether-utils.sh memory-metrics 2>/dev/null || echo '{}'
342
+ ```
343
+
344
+ **Load instincts:**
345
+ From COLONY_STATE.json `memory.instincts`:
346
+ - Count total instincts
347
+ - Count high-confidence instincts (>= 0.7)
348
+
349
+ **Count learnings:**
350
+ From COLONY_STATE.json `memory.phase_learnings`:
351
+ - Count total learnings
352
+
353
+ **Check event log for anomalies:**
354
+ From COLONY_STATE.json `events`:
355
+ - Count total events
356
+ - Look for error events (events containing "error" or "failed")
357
+ - Look for state corruption events
358
+
359
+ **Count pheromone signals:**
360
+ ```bash
361
+ bash .aether/aether-utils.sh pheromone-count 2>/dev/null || echo '{"result":{"count":0}}'
362
+ ```
363
+
364
+ Display:
365
+ ```
366
+ Colony Health:
367
+ Instincts: {total} ({high_confidence} strong)
368
+ Learnings: {learning_count}
369
+ Pheromones: {signal_count} active
370
+ Events: {event_count} total ({error_event_count} errors)
371
+ {If error_event_count > 0: " WARNING: {error_event_count} error events in log"}
372
+ ```
373
+
374
+ Increment `audit_passes` (health check is informational, not pass/fail)
375
+
376
+ ### Step 7: Generate Completion Report
377
+
378
+ Calculate colony age:
379
+ ```bash
380
+ initialized_at=$(jq -r '.initialized_at // empty' .aether/data/COLONY_STATE.json)
381
+ if [[ -n "$initialized_at" ]]; then
382
+ init_epoch=$(date -j -f "%Y-%m-%dT%H:%M:%SZ" "$initialized_at" +%s 2>/dev/null || echo 0)
383
+ now_epoch=$(date +%s)
384
+ if [[ "$init_epoch" -gt 0 ]]; then
385
+ colony_age_days=$(( (now_epoch - init_epoch) / 86400 ))
386
+ else
387
+ colony_age_days=0
388
+ fi
389
+ else
390
+ colony_age_days=0
391
+ fi
392
+ ```
393
+
394
+ Count phases completed:
395
+ ```bash
396
+ phases_completed=$(jq '[.plan.phases[] | select(.status == "completed")] | length' .aether/data/COLONY_STATE.json 2>/dev/null || echo "0")
397
+ total_phases=$(jq '.plan.phases | length' .aether/data/COLONY_STATE.json 2>/dev/null || echo "0")
398
+ ```
399
+
400
+ Determine recommendation:
401
+ - If `audit_fails == 0` and `audit_warnings == 0`: `recommendation = "READY TO SEAL"`
402
+ - If `audit_fails == 0` and `audit_warnings > 0`: `recommendation = "READY TO SEAL (with warnings)"`
403
+ - If `audit_fails > 0`: `recommendation = "ISSUES TO RESOLVE"`
404
+
405
+ Write `.aether/data/completion-report.md` using the Write tool:
406
+
407
+ ```markdown
408
+ # Colony Completion Report
409
+
410
+ **Generated:** {ISO-8601 timestamp}
411
+ **Colony Goal:** {goal}
412
+ **Milestone:** {milestone}
413
+ **Colony Age:** {colony_age_days} days
414
+
415
+ ---
416
+
417
+ ## Recommendation: {recommendation}
418
+
419
+ ---
420
+
421
+ ## Plan vs Reality
422
+
423
+ | Metric | Count |
424
+ |--------|-------|
425
+ | Total Tasks | {total_tasks} |
426
+ | Verified | {verified_tasks} |
427
+ | Unverifiable | {unverifiable_tasks} |
428
+ | Missing Evidence | {missing_tasks} |
429
+
430
+ **Phases:** {phases_completed} of {total_phases} completed
431
+
432
+ {For each phase:}
433
+ ### Phase {N}: {name} [{status}]
434
+ {For each MISSING task: "- MISSING: {description}"}
435
+ {If no missing: "All tasks verified or unverifiable."}
436
+
437
+ ---
438
+
439
+ ## Documentation Accuracy
440
+
441
+ **Score:** {accuracy_score}%
442
+
443
+ | Check | Status | Detail |
444
+ |-------|--------|--------|
445
+ {For each doc check: "| {name} | {status} | {detail} |"}
446
+
447
+ ---
448
+
449
+ ## Unresolved Issues
450
+
451
+ **Flags:** {blocker_count} blockers | {high_count} high | {medium_count} medium | {low_count} low
452
+
453
+ {For each unresolved blocker: "- BLOCKER: {title}"}
454
+
455
+ **Recurring Failures:** {recurring_count}
456
+ {For each recurring pattern: "- {pattern}"}
457
+
458
+ ---
459
+
460
+ ## Test Coverage
461
+
462
+ | Type | Count |
463
+ |------|-------|
464
+ | Unit Tests | {unit} |
465
+ | E2E Tests | {e2e} |
466
+ | JS/TS Tests | {js} |
467
+
468
+ **Results:** {pass_count} passing | {fail_count} failing
469
+
470
+ ---
471
+
472
+ ## Colony Health
473
+
474
+ | Metric | Value |
475
+ |--------|-------|
476
+ | Instincts | {total} ({high_confidence} strong) |
477
+ | Learnings | {learning_count} |
478
+ | Pheromones | {signal_count} active |
479
+ | Events | {event_count} ({error_event_count} errors) |
480
+
481
+ ---
482
+
483
+ ## Audit Summary
484
+
485
+ | Category | Result |
486
+ |----------|--------|
487
+ | Checks Passed | {audit_passes} |
488
+ | Checks Failed | {audit_fails} |
489
+ | Warnings | {audit_warnings} |
490
+
491
+ {If audit_issues is not empty:}
492
+ ### Issues to Address
493
+
494
+ {For each issue in audit_issues:}
495
+ - {issue description}
496
+ {end}
497
+ ```
498
+
499
+ ### Step 8: Display Results
500
+
501
+ Display the formatted audit summary:
502
+
503
+ ```
504
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
505
+ A U D I T R E S U L T S
506
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
507
+
508
+ Goal: {goal}
509
+ Colony Age: {colony_age_days} days
510
+ Milestone: {milestone}
511
+
512
+ Plan Verification
513
+ Phases: {phases_completed}/{total_phases} completed
514
+ Tasks: {verified_tasks} verified | {unverifiable_tasks} unverifiable | {missing_tasks} missing
515
+ {PASS or FAIL indicator}
516
+
517
+ Documentation Accuracy
518
+ Score: {accuracy_score}%
519
+ {For each check: "[PASS|FAIL|WARN] {name}"}
520
+ {PASS or FAIL indicator}
521
+
522
+ Unresolved Issues
523
+ Flags: {blocker_count} blockers | {high_count} high
524
+ Recurring failures: {recurring_count}
525
+ {PASS, WARN, or FAIL indicator}
526
+
527
+ Test Coverage
528
+ {pass_count} passing | {fail_count} failing
529
+ {PASS or FAIL indicator}
530
+
531
+ Colony Health
532
+ Instincts: {total} | Learnings: {learning_count} | Signals: {signal_count}
533
+
534
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
535
+ PASSED: {audit_passes} | FAILED: {audit_fails} | WARNINGS: {audit_warnings}
536
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
537
+ ```
538
+
539
+ **If recommendation is "READY TO SEAL":**
540
+ ```
541
+ Colony ready to seal.
542
+
543
+ Report: .aether/data/completion-report.md
544
+
545
+ Next:
546
+ /ant:seal Seal colony at Crowned Anthill
547
+ ```
548
+
549
+ **If recommendation is "READY TO SEAL (with warnings)":**
550
+ ```
551
+ Colony ready to seal (with warnings).
552
+
553
+ {For each warning: " WARNING: {description}"}
554
+
555
+ These warnings are non-blocking. You may seal or address them first.
556
+
557
+ Report: .aether/data/completion-report.md
558
+
559
+ Next:
560
+ /ant:seal Seal colony at Crowned Anthill
561
+ /ant:build <phase> Address remaining work
562
+ ```
563
+
564
+ **If recommendation is "ISSUES TO RESOLVE":**
565
+ ```
566
+ Issues found that should be addressed before sealing.
567
+
568
+ {For each issue with audit_fails: " ISSUE: {description}"}
569
+
570
+ Suggested actions:
571
+ {For each issue, suggest a concrete action:}
572
+ - Missing task evidence: Re-run the build or verify manually
573
+ - Documentation mismatch: Update docs to match reality
574
+ - Unresolved blockers: Run /ant:flags to review and resolve
575
+ - Failing tests: Fix tests before sealing
576
+ - Recurring failures: Investigate root cause via /ant:swarm
577
+
578
+ Report: .aether/data/completion-report.md
579
+
580
+ Next:
581
+ /ant:status Check colony status
582
+ /ant:build <phase> Address remaining work
583
+ /ant:flags Review unresolved flags
584
+ ```
585
+
586
+ ### Step 9: Log Activity
587
+
588
+ Run using the Bash tool:
589
+ ```bash
590
+ bash .aether/aether-utils.sh activity-log "COMPLETE" "queen" "Colony audit completed - {recommendation}"
591
+ ```
592
+
593
+ Display persistence confirmation:
594
+ ```
595
+ All state persisted. Safe to /clear context if needed.
596
+ Report: .aether/data/completion-report.md
597
+ Resume: /ant:resume-colony
598
+ ```
599
+
600
+ ### Edge Cases
601
+
602
+ **Colony has no plan (0 phases):**
603
+ - Skip Step 2 (plan verification)
604
+ - Note: "No plan generated. Skipping plan verification."
605
+ - Recommendation defaults to "ISSUES TO RESOLVE" with note about missing plan
606
+
607
+ **Colony is still EXECUTING:**
608
+ - Warn: "Colony is still executing. Audit results may be incomplete."
609
+ - Proceed with audit anyway (do not block)
610
+
611
+ **No test files found:**
612
+ - Report: "No test files detected."
613
+ - Count as a warning, not a failure
614
+
615
+ **COLONY_STATE.json version is old (< 3.0):**
616
+ - Proceed with available fields
617
+ - Note missing fields in report as "N/A (older state format)"
618
+
619
+ **Subagent spawn fails:**
620
+ - Fall back to running the documentation checks inline
621
+ - Note the fallback in the report