@apralabs/apra-fleet 0.4.0 → 0.4.2

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 (548) hide show
  1. package/README.md +159 -13
  2. package/dist/agents/backlog-groomer.md +31 -19
  3. package/dist/agents/ci-watcher.md +16 -1
  4. package/dist/agents/deployer.md +37 -47
  5. package/dist/agents/doer.md +147 -114
  6. package/dist/agents/harvester.md +41 -34
  7. package/dist/agents/integ-test-runner.md +98 -114
  8. package/dist/agents/kb-reconciler.md +205 -0
  9. package/dist/agents/plan-reviewer.md +45 -44
  10. package/dist/agents/planner.md +121 -50
  11. package/dist/agents/regression-test-runner.md +84 -81
  12. package/dist/agents/reviewer.md +118 -44
  13. package/dist/agents/schemas/doer-output.json +63 -3
  14. package/dist/agents/schemas/harvester-output.json +59 -2
  15. package/dist/agents/schemas/integ-test-runner-output.json +3 -3
  16. package/dist/agents/schemas/kb-reconciler-output.json +87 -0
  17. package/dist/agents/schemas/planner-output.json +65 -0
  18. package/dist/agents/schemas/regression-test-runner-output.json +4 -17
  19. package/dist/agents/schemas/reviewer-output.json +105 -8
  20. package/dist/cli/auth.d.ts.map +1 -1
  21. package/dist/cli/auth.js +1 -2
  22. package/dist/cli/auth.js.map +1 -1
  23. package/dist/cli/config.d.ts +3 -3
  24. package/dist/cli/config.d.ts.map +1 -1
  25. package/dist/cli/config.js +4 -13
  26. package/dist/cli/config.js.map +1 -1
  27. package/dist/cli/install.d.ts +1 -0
  28. package/dist/cli/install.d.ts.map +1 -1
  29. package/dist/cli/install.js +141 -44
  30. package/dist/cli/install.js.map +1 -1
  31. package/dist/cli/join.js +1 -1
  32. package/dist/cli/join.js.map +1 -1
  33. package/dist/cli/kb-commit.d.ts +12 -0
  34. package/dist/cli/kb-commit.d.ts.map +1 -0
  35. package/dist/cli/kb-commit.js +53 -0
  36. package/dist/cli/kb-commit.js.map +1 -0
  37. package/dist/cli/kb-directives.d.ts +17 -0
  38. package/dist/cli/kb-directives.d.ts.map +1 -0
  39. package/dist/cli/kb-directives.js +146 -0
  40. package/dist/cli/kb-directives.js.map +1 -0
  41. package/dist/cli/kb-import.d.ts +13 -0
  42. package/dist/cli/kb-import.d.ts.map +1 -0
  43. package/dist/cli/kb-import.js +56 -0
  44. package/dist/cli/kb-import.js.map +1 -0
  45. package/dist/cli/register-member.js +1 -1
  46. package/dist/cli/start.d.ts.map +1 -1
  47. package/dist/cli/start.js +7 -0
  48. package/dist/cli/start.js.map +1 -1
  49. package/dist/cli/uninstall.d.ts.map +1 -1
  50. package/dist/cli/uninstall.js +16 -3
  51. package/dist/cli/uninstall.js.map +1 -1
  52. package/dist/cli/watch.d.ts +76 -4
  53. package/dist/cli/watch.d.ts.map +1 -1
  54. package/dist/cli/watch.js +150 -17
  55. package/dist/cli/watch.js.map +1 -1
  56. package/dist/commands/kb-server.d.ts +8 -0
  57. package/dist/commands/kb-server.d.ts.map +1 -0
  58. package/dist/commands/kb-server.js +221 -0
  59. package/dist/commands/kb-server.js.map +1 -0
  60. package/dist/index.js +77 -2
  61. package/dist/index.js.map +1 -1
  62. package/dist/os/git-bash-candidates.d.ts +35 -0
  63. package/dist/os/git-bash-candidates.d.ts.map +1 -0
  64. package/dist/os/git-bash-candidates.js +46 -0
  65. package/dist/os/git-bash-candidates.js.map +1 -0
  66. package/dist/os/index.d.ts +13 -4
  67. package/dist/os/index.d.ts.map +1 -1
  68. package/dist/os/index.js +17 -2
  69. package/dist/os/index.js.map +1 -1
  70. package/dist/os/linux.d.ts +1 -0
  71. package/dist/os/linux.d.ts.map +1 -1
  72. package/dist/os/linux.js +19 -2
  73. package/dist/os/linux.js.map +1 -1
  74. package/dist/os/os-commands.d.ts +12 -0
  75. package/dist/os/os-commands.d.ts.map +1 -1
  76. package/dist/os/os-commands.js.map +1 -1
  77. package/dist/os/windows-gitbash.d.ts +93 -0
  78. package/dist/os/windows-gitbash.d.ts.map +1 -0
  79. package/dist/os/windows-gitbash.js +244 -0
  80. package/dist/os/windows-gitbash.js.map +1 -0
  81. package/dist/os/windows.d.ts +35 -0
  82. package/dist/os/windows.d.ts.map +1 -1
  83. package/dist/os/windows.js +93 -35
  84. package/dist/os/windows.js.map +1 -1
  85. package/dist/providers/agy.d.ts +15 -3
  86. package/dist/providers/agy.d.ts.map +1 -1
  87. package/dist/providers/agy.js +145 -11
  88. package/dist/providers/agy.js.map +1 -1
  89. package/dist/providers/claude.d.ts +14 -3
  90. package/dist/providers/claude.d.ts.map +1 -1
  91. package/dist/providers/claude.js +69 -22
  92. package/dist/providers/claude.js.map +1 -1
  93. package/dist/providers/codex.d.ts +14 -3
  94. package/dist/providers/codex.d.ts.map +1 -1
  95. package/dist/providers/codex.js +34 -8
  96. package/dist/providers/codex.js.map +1 -1
  97. package/dist/providers/copilot.d.ts +14 -3
  98. package/dist/providers/copilot.d.ts.map +1 -1
  99. package/dist/providers/copilot.js +33 -8
  100. package/dist/providers/copilot.js.map +1 -1
  101. package/dist/providers/email/headers.d.ts +15 -0
  102. package/dist/providers/email/headers.d.ts.map +1 -0
  103. package/dist/providers/email/headers.js +42 -0
  104. package/dist/providers/email/headers.js.map +1 -0
  105. package/dist/providers/email/index.d.ts +18 -0
  106. package/dist/providers/email/index.d.ts.map +1 -0
  107. package/dist/providers/email/index.js +60 -0
  108. package/dist/providers/email/index.js.map +1 -0
  109. package/dist/providers/email/provider.d.ts +49 -0
  110. package/dist/providers/email/provider.d.ts.map +1 -0
  111. package/dist/providers/email/provider.js +2 -0
  112. package/dist/providers/email/provider.js.map +1 -0
  113. package/dist/providers/email/sendgrid.d.ts +12 -0
  114. package/dist/providers/email/sendgrid.d.ts.map +1 -0
  115. package/dist/providers/email/sendgrid.js +67 -0
  116. package/dist/providers/email/sendgrid.js.map +1 -0
  117. package/dist/providers/email/smtp.d.ts +65 -0
  118. package/dist/providers/email/smtp.d.ts.map +1 -0
  119. package/dist/providers/email/smtp.js +373 -0
  120. package/dist/providers/email/smtp.js.map +1 -0
  121. package/dist/providers/index.d.ts +0 -1
  122. package/dist/providers/index.d.ts.map +1 -1
  123. package/dist/providers/index.js +0 -3
  124. package/dist/providers/index.js.map +1 -1
  125. package/dist/providers/none.d.ts +14 -3
  126. package/dist/providers/none.d.ts.map +1 -1
  127. package/dist/providers/none.js +26 -2
  128. package/dist/providers/none.js.map +1 -1
  129. package/dist/providers/opencode.d.ts +14 -3
  130. package/dist/providers/opencode.d.ts.map +1 -1
  131. package/dist/providers/opencode.js +60 -6
  132. package/dist/providers/opencode.js.map +1 -1
  133. package/dist/providers/provider.d.ts +91 -5
  134. package/dist/providers/provider.d.ts.map +1 -1
  135. package/dist/providers/provider.js +45 -1
  136. package/dist/providers/provider.js.map +1 -1
  137. package/dist/services/agent-provisioner.d.ts.map +1 -1
  138. package/dist/services/agent-provisioner.js +5 -8
  139. package/dist/services/agent-provisioner.js.map +1 -1
  140. package/dist/services/cloud/activity.js +2 -2
  141. package/dist/services/cloud/activity.js.map +1 -1
  142. package/dist/services/cloud/lifecycle.d.ts.map +1 -1
  143. package/dist/services/cloud/lifecycle.js +3 -0
  144. package/dist/services/cloud/lifecycle.js.map +1 -1
  145. package/dist/services/cloud/task-wrapper.d.ts +18 -0
  146. package/dist/services/cloud/task-wrapper.d.ts.map +1 -1
  147. package/dist/services/cloud/task-wrapper.js +157 -0
  148. package/dist/services/cloud/task-wrapper.js.map +1 -1
  149. package/dist/services/context-admission.d.ts.map +1 -1
  150. package/dist/services/context-admission.js +9 -7
  151. package/dist/services/context-admission.js.map +1 -1
  152. package/dist/services/credential-cleanup.d.ts.map +1 -1
  153. package/dist/services/credential-cleanup.js +22 -3
  154. package/dist/services/credential-cleanup.js.map +1 -1
  155. package/dist/services/github-app.d.ts.map +1 -1
  156. package/dist/services/github-app.js +11 -2
  157. package/dist/services/github-app.js.map +1 -1
  158. package/dist/services/knowledge/audn.d.ts +37 -0
  159. package/dist/services/knowledge/audn.d.ts.map +1 -0
  160. package/dist/services/knowledge/audn.js +219 -0
  161. package/dist/services/knowledge/audn.js.map +1 -0
  162. package/dist/services/knowledge/file-hash.d.ts +11 -0
  163. package/dist/services/knowledge/file-hash.d.ts.map +1 -0
  164. package/dist/services/knowledge/file-hash.js +123 -0
  165. package/dist/services/knowledge/file-hash.js.map +1 -0
  166. package/dist/services/knowledge/http-provider.d.ts +46 -0
  167. package/dist/services/knowledge/http-provider.d.ts.map +1 -0
  168. package/dist/services/knowledge/http-provider.js +254 -0
  169. package/dist/services/knowledge/http-provider.js.map +1 -0
  170. package/dist/services/knowledge/kb-providers.d.ts +15 -0
  171. package/dist/services/knowledge/kb-providers.d.ts.map +1 -0
  172. package/dist/services/knowledge/kb-providers.js +92 -0
  173. package/dist/services/knowledge/kb-providers.js.map +1 -0
  174. package/dist/services/knowledge/kb-scope-input.d.ts +5 -0
  175. package/dist/services/knowledge/kb-scope-input.d.ts.map +1 -0
  176. package/dist/services/knowledge/kb-scope-input.js +11 -0
  177. package/dist/services/knowledge/kb-scope-input.js.map +1 -0
  178. package/dist/services/knowledge/kb-service.d.ts +3 -0
  179. package/dist/services/knowledge/kb-service.d.ts.map +1 -0
  180. package/dist/services/knowledge/kb-service.js +2 -0
  181. package/dist/services/knowledge/kb-service.js.map +1 -0
  182. package/dist/services/knowledge/path-validation.d.ts +2 -0
  183. package/dist/services/knowledge/path-validation.d.ts.map +1 -0
  184. package/dist/services/knowledge/path-validation.js +13 -0
  185. package/dist/services/knowledge/path-validation.js.map +1 -0
  186. package/dist/services/knowledge/pre-init.d.ts +14 -0
  187. package/dist/services/knowledge/pre-init.d.ts.map +1 -0
  188. package/dist/services/knowledge/pre-init.js +147 -0
  189. package/dist/services/knowledge/pre-init.js.map +1 -0
  190. package/dist/services/knowledge/project-slug.d.ts +2 -0
  191. package/dist/services/knowledge/project-slug.d.ts.map +1 -0
  192. package/dist/services/knowledge/project-slug.js +49 -0
  193. package/dist/services/knowledge/project-slug.js.map +1 -0
  194. package/dist/services/knowledge/sqlite-provider.d.ts +147 -0
  195. package/dist/services/knowledge/sqlite-provider.d.ts.map +1 -0
  196. package/dist/services/knowledge/sqlite-provider.js +1646 -0
  197. package/dist/services/knowledge/sqlite-provider.js.map +1 -0
  198. package/dist/services/knowledge/types.d.ts +163 -0
  199. package/dist/services/knowledge/types.d.ts.map +1 -0
  200. package/dist/services/knowledge/types.js +9 -0
  201. package/dist/services/knowledge/types.js.map +1 -0
  202. package/dist/services/member-home.d.ts +89 -0
  203. package/dist/services/member-home.d.ts.map +1 -0
  204. package/dist/services/member-home.js +259 -0
  205. package/dist/services/member-home.js.map +1 -0
  206. package/dist/services/member-remote-url.d.ts +34 -0
  207. package/dist/services/member-remote-url.d.ts.map +1 -0
  208. package/dist/services/member-remote-url.js +39 -0
  209. package/dist/services/member-remote-url.js.map +1 -0
  210. package/dist/services/model-pricing.d.ts.map +1 -1
  211. package/dist/services/model-pricing.js +0 -5
  212. package/dist/services/model-pricing.js.map +1 -1
  213. package/dist/services/orphan-recovery.d.ts +9 -3
  214. package/dist/services/orphan-recovery.d.ts.map +1 -1
  215. package/dist/services/orphan-recovery.js +22 -8
  216. package/dist/services/orphan-recovery.js.map +1 -1
  217. package/dist/services/preflight-check.d.ts +56 -0
  218. package/dist/services/preflight-check.d.ts.map +1 -0
  219. package/dist/services/preflight-check.js +277 -0
  220. package/dist/services/preflight-check.js.map +1 -0
  221. package/dist/services/shell-probe.d.ts +131 -0
  222. package/dist/services/shell-probe.d.ts.map +1 -0
  223. package/dist/services/shell-probe.js +210 -0
  224. package/dist/services/shell-probe.js.map +1 -0
  225. package/dist/services/singleton.d.ts +2 -0
  226. package/dist/services/singleton.d.ts.map +1 -1
  227. package/dist/services/singleton.js +1 -1
  228. package/dist/services/singleton.js.map +1 -1
  229. package/dist/services/ssh.js +2 -2
  230. package/dist/services/ssh.js.map +1 -1
  231. package/dist/services/stall/find-log-file.d.ts.map +1 -1
  232. package/dist/services/stall/find-log-file.js +22 -16
  233. package/dist/services/stall/find-log-file.js.map +1 -1
  234. package/dist/services/stall/log-path-resolver.d.ts +11 -8
  235. package/dist/services/stall/log-path-resolver.d.ts.map +1 -1
  236. package/dist/services/stall/log-path-resolver.js +17 -40
  237. package/dist/services/stall/log-path-resolver.js.map +1 -1
  238. package/dist/services/stall/read-log-tail.d.ts.map +1 -1
  239. package/dist/services/stall/read-log-tail.js +6 -5
  240. package/dist/services/stall/read-log-tail.js.map +1 -1
  241. package/dist/services/stall/stall-detector.d.ts +32 -0
  242. package/dist/services/stall/stall-detector.d.ts.map +1 -1
  243. package/dist/services/stall/stall-detector.js +149 -6
  244. package/dist/services/stall/stall-detector.js.map +1 -1
  245. package/dist/services/stall/stall-poller.d.ts +34 -0
  246. package/dist/services/stall/stall-poller.d.ts.map +1 -1
  247. package/dist/services/stall/stall-poller.js +160 -35
  248. package/dist/services/stall/stall-poller.js.map +1 -1
  249. package/dist/services/strategy.d.ts +9 -0
  250. package/dist/services/strategy.d.ts.map +1 -1
  251. package/dist/services/strategy.js +41 -7
  252. package/dist/services/strategy.js.map +1 -1
  253. package/dist/services/tool-registry.d.ts.map +1 -1
  254. package/dist/services/tool-registry.js +87 -1
  255. package/dist/services/tool-registry.js.map +1 -1
  256. package/dist/services/user-config.js +1 -1
  257. package/dist/services/user-config.js.map +1 -1
  258. package/dist/services/vcs/azure-devops.d.ts +1 -1
  259. package/dist/services/vcs/azure-devops.d.ts.map +1 -1
  260. package/dist/services/vcs/azure-devops.js +105 -10
  261. package/dist/services/vcs/azure-devops.js.map +1 -1
  262. package/dist/services/vcs/bitbucket.d.ts.map +1 -1
  263. package/dist/services/vcs/bitbucket.js +16 -0
  264. package/dist/services/vcs/bitbucket.js.map +1 -1
  265. package/dist/services/vcs/github.d.ts.map +1 -1
  266. package/dist/services/vcs/github.js +56 -1
  267. package/dist/services/vcs/github.js.map +1 -1
  268. package/dist/services/vcs/types.d.ts +123 -2
  269. package/dist/services/vcs/types.d.ts.map +1 -1
  270. package/dist/services/version-check.d.ts +22 -0
  271. package/dist/services/version-check.d.ts.map +1 -0
  272. package/dist/services/version-check.js +103 -0
  273. package/dist/services/version-check.js.map +1 -0
  274. package/dist/skills/fleet-sprint-cli/SKILL.md +15 -3
  275. package/dist/skills/pm/SKILL.md +0 -1
  276. package/dist/skills/pm/beads.md +6 -0
  277. package/dist/skills/pm/cost.md +0 -1
  278. package/dist/skills/pm/fleet-addendum.md +6 -1
  279. package/dist/skills/pm/index.md +56 -0
  280. package/dist/skills/pm/kb-reconcile.md +132 -0
  281. package/dist/skills/pm/kb-review.md +109 -0
  282. package/dist/tools/check-status.d.ts +47 -0
  283. package/dist/tools/check-status.d.ts.map +1 -1
  284. package/dist/tools/check-status.js +245 -3
  285. package/dist/tools/check-status.js.map +1 -1
  286. package/dist/tools/child-id-allocator.d.ts +2 -2
  287. package/dist/tools/cloud-control.js +2 -2
  288. package/dist/tools/cloud-control.js.map +1 -1
  289. package/dist/tools/code-intelligence-codebase-memory.d.ts +11 -0
  290. package/dist/tools/code-intelligence-codebase-memory.d.ts.map +1 -0
  291. package/dist/tools/code-intelligence-codebase-memory.js +270 -0
  292. package/dist/tools/code-intelligence-codebase-memory.js.map +1 -0
  293. package/dist/tools/code-intelligence-freshness.d.ts +2 -0
  294. package/dist/tools/code-intelligence-freshness.d.ts.map +1 -0
  295. package/dist/tools/code-intelligence-freshness.js +26 -0
  296. package/dist/tools/code-intelligence-freshness.js.map +1 -0
  297. package/dist/tools/code-intelligence-gitnexus.d.ts +14 -0
  298. package/dist/tools/code-intelligence-gitnexus.d.ts.map +1 -0
  299. package/dist/tools/code-intelligence-gitnexus.js +475 -0
  300. package/dist/tools/code-intelligence-gitnexus.js.map +1 -0
  301. package/dist/tools/code-intelligence-kb-enrich.d.ts +2 -0
  302. package/dist/tools/code-intelligence-kb-enrich.d.ts.map +1 -0
  303. package/dist/tools/code-intelligence-kb-enrich.js +65 -0
  304. package/dist/tools/code-intelligence-kb-enrich.js.map +1 -0
  305. package/dist/tools/code-intelligence-reindex.d.ts +7 -0
  306. package/dist/tools/code-intelligence-reindex.d.ts.map +1 -0
  307. package/dist/tools/code-intelligence-reindex.js +106 -0
  308. package/dist/tools/code-intelligence-reindex.js.map +1 -0
  309. package/dist/tools/code-intelligence-telemetry.d.ts +5 -0
  310. package/dist/tools/code-intelligence-telemetry.d.ts.map +1 -0
  311. package/dist/tools/code-intelligence-telemetry.js +52 -0
  312. package/dist/tools/code-intelligence-telemetry.js.map +1 -0
  313. package/dist/tools/code-intelligence-tests.d.ts +2 -0
  314. package/dist/tools/code-intelligence-tests.d.ts.map +1 -0
  315. package/dist/tools/code-intelligence-tests.js +24 -0
  316. package/dist/tools/code-intelligence-tests.js.map +1 -0
  317. package/dist/tools/code-intelligence.d.ts +114 -0
  318. package/dist/tools/code-intelligence.d.ts.map +1 -0
  319. package/dist/tools/code-intelligence.js +124 -0
  320. package/dist/tools/code-intelligence.js.map +1 -0
  321. package/dist/tools/compose-permissions.d.ts +26 -0
  322. package/dist/tools/compose-permissions.d.ts.map +1 -1
  323. package/dist/tools/compose-permissions.js +257 -33
  324. package/dist/tools/compose-permissions.js.map +1 -1
  325. package/dist/tools/execute-command.d.ts +2 -0
  326. package/dist/tools/execute-command.d.ts.map +1 -1
  327. package/dist/tools/execute-command.js +114 -28
  328. package/dist/tools/execute-command.js.map +1 -1
  329. package/dist/tools/execute-prompt.d.ts +13 -1
  330. package/dist/tools/execute-prompt.d.ts.map +1 -1
  331. package/dist/tools/execute-prompt.js +310 -61
  332. package/dist/tools/execute-prompt.js.map +1 -1
  333. package/dist/tools/kb-capture.d.ts +53 -0
  334. package/dist/tools/kb-capture.d.ts.map +1 -0
  335. package/dist/tools/kb-capture.js +130 -0
  336. package/dist/tools/kb-capture.js.map +1 -0
  337. package/dist/tools/kb-context.d.ts +17 -0
  338. package/dist/tools/kb-context.d.ts.map +1 -0
  339. package/dist/tools/kb-context.js +29 -0
  340. package/dist/tools/kb-context.js.map +1 -0
  341. package/dist/tools/kb-export.d.ts +19 -0
  342. package/dist/tools/kb-export.d.ts.map +1 -0
  343. package/dist/tools/kb-export.js +344 -0
  344. package/dist/tools/kb-export.js.map +1 -0
  345. package/dist/tools/kb-feedback.d.ts +23 -0
  346. package/dist/tools/kb-feedback.d.ts.map +1 -0
  347. package/dist/tools/kb-feedback.js +43 -0
  348. package/dist/tools/kb-feedback.js.map +1 -0
  349. package/dist/tools/kb-freshness-sweep.d.ts +14 -0
  350. package/dist/tools/kb-freshness-sweep.d.ts.map +1 -0
  351. package/dist/tools/kb-freshness-sweep.js +29 -0
  352. package/dist/tools/kb-freshness-sweep.js.map +1 -0
  353. package/dist/tools/kb-harvest.d.ts +20 -0
  354. package/dist/tools/kb-harvest.d.ts.map +1 -0
  355. package/dist/tools/kb-harvest.js +143 -0
  356. package/dist/tools/kb-harvest.js.map +1 -0
  357. package/dist/tools/kb-import.d.ts +44 -0
  358. package/dist/tools/kb-import.d.ts.map +1 -0
  359. package/dist/tools/kb-import.js +239 -0
  360. package/dist/tools/kb-import.js.map +1 -0
  361. package/dist/tools/kb-invalidate.d.ts +19 -0
  362. package/dist/tools/kb-invalidate.d.ts.map +1 -0
  363. package/dist/tools/kb-invalidate.js +34 -0
  364. package/dist/tools/kb-invalidate.js.map +1 -0
  365. package/dist/tools/kb-list.d.ts +32 -0
  366. package/dist/tools/kb-list.d.ts.map +1 -0
  367. package/dist/tools/kb-list.js +43 -0
  368. package/dist/tools/kb-list.js.map +1 -0
  369. package/dist/tools/kb-promote.d.ts +20 -0
  370. package/dist/tools/kb-promote.d.ts.map +1 -0
  371. package/dist/tools/kb-promote.js +20 -0
  372. package/dist/tools/kb-promote.js.map +1 -0
  373. package/dist/tools/kb-query.d.ts +35 -0
  374. package/dist/tools/kb-query.d.ts.map +1 -0
  375. package/dist/tools/kb-query.js +111 -0
  376. package/dist/tools/kb-query.js.map +1 -0
  377. package/dist/tools/kb-reconcile-prefilter.d.ts +14 -0
  378. package/dist/tools/kb-reconcile-prefilter.d.ts.map +1 -0
  379. package/dist/tools/kb-reconcile-prefilter.js +26 -0
  380. package/dist/tools/kb-reconcile-prefilter.js.map +1 -0
  381. package/dist/tools/kb-resolve-contradiction.d.ts +23 -0
  382. package/dist/tools/kb-resolve-contradiction.d.ts.map +1 -0
  383. package/dist/tools/kb-resolve-contradiction.js +37 -0
  384. package/dist/tools/kb-resolve-contradiction.js.map +1 -0
  385. package/dist/tools/kb-session-prime.d.ts +26 -0
  386. package/dist/tools/kb-session-prime.d.ts.map +1 -0
  387. package/dist/tools/kb-session-prime.js +392 -0
  388. package/dist/tools/kb-session-prime.js.map +1 -0
  389. package/dist/tools/kb-setup.d.ts +20 -0
  390. package/dist/tools/kb-setup.d.ts.map +1 -0
  391. package/dist/tools/kb-setup.js +49 -0
  392. package/dist/tools/kb-setup.js.map +1 -0
  393. package/dist/tools/kb-stats.d.ts +20 -0
  394. package/dist/tools/kb-stats.d.ts.map +1 -0
  395. package/dist/tools/kb-stats.js +115 -0
  396. package/dist/tools/kb-stats.js.map +1 -0
  397. package/dist/tools/list-members.d.ts.map +1 -1
  398. package/dist/tools/list-members.js +6 -2
  399. package/dist/tools/list-members.js.map +1 -1
  400. package/dist/tools/member-detail.d.ts.map +1 -1
  401. package/dist/tools/member-detail.js +13 -3
  402. package/dist/tools/member-detail.js.map +1 -1
  403. package/dist/tools/member-reservation.d.ts.map +1 -1
  404. package/dist/tools/member-reservation.js +13 -1
  405. package/dist/tools/member-reservation.js.map +1 -1
  406. package/dist/tools/monitor-task.d.ts.map +1 -1
  407. package/dist/tools/monitor-task.js +38 -5
  408. package/dist/tools/monitor-task.js.map +1 -1
  409. package/dist/tools/provision-auth.d.ts.map +1 -1
  410. package/dist/tools/provision-auth.js +15 -8
  411. package/dist/tools/provision-auth.js.map +1 -1
  412. package/dist/tools/provision-vcs-auth.d.ts +5 -2
  413. package/dist/tools/provision-vcs-auth.d.ts.map +1 -1
  414. package/dist/tools/provision-vcs-auth.js +58 -52
  415. package/dist/tools/provision-vcs-auth.js.map +1 -1
  416. package/dist/tools/register-member.d.ts +21 -12
  417. package/dist/tools/register-member.d.ts.map +1 -1
  418. package/dist/tools/register-member.js +70 -3
  419. package/dist/tools/register-member.js.map +1 -1
  420. package/dist/tools/remove-member.d.ts.map +1 -1
  421. package/dist/tools/remove-member.js +19 -5
  422. package/dist/tools/remove-member.js.map +1 -1
  423. package/dist/tools/report-status.d.ts.map +1 -1
  424. package/dist/tools/report-status.js +2 -1
  425. package/dist/tools/report-status.js.map +1 -1
  426. package/dist/tools/revoke-vcs-auth.js +2 -2
  427. package/dist/tools/revoke-vcs-auth.js.map +1 -1
  428. package/dist/tools/send-email.d.ts +69 -0
  429. package/dist/tools/send-email.d.ts.map +1 -0
  430. package/dist/tools/send-email.js +177 -0
  431. package/dist/tools/send-email.js.map +1 -0
  432. package/dist/tools/setup-ssh-key.d.ts.map +1 -1
  433. package/dist/tools/setup-ssh-key.js +4 -1
  434. package/dist/tools/setup-ssh-key.js.map +1 -1
  435. package/dist/tools/stop-prompt.js +2 -2
  436. package/dist/tools/stop-prompt.js.map +1 -1
  437. package/dist/tools/update-agent-cli.js +2 -2
  438. package/dist/tools/update-agent-cli.js.map +1 -1
  439. package/dist/tools/update-member.d.ts +21 -12
  440. package/dist/tools/update-member.d.ts.map +1 -1
  441. package/dist/tools/update-member.js +43 -2
  442. package/dist/tools/update-member.js.map +1 -1
  443. package/dist/types.d.ts +12 -1
  444. package/dist/types.d.ts.map +1 -1
  445. package/dist/utils/agent-helpers.d.ts +36 -0
  446. package/dist/utils/agent-helpers.d.ts.map +1 -1
  447. package/dist/utils/agent-helpers.js +39 -1
  448. package/dist/utils/agent-helpers.js.map +1 -1
  449. package/dist/utils/platform.d.ts +7 -0
  450. package/dist/utils/platform.d.ts.map +1 -1
  451. package/dist/utils/platform.js +11 -1
  452. package/dist/utils/platform.js.map +1 -1
  453. package/dist/utils/prompt-errors.js +1 -1
  454. package/dist/utils/prompt-errors.js.map +1 -1
  455. package/dist/utils/session-caller.d.ts +28 -0
  456. package/dist/utils/session-caller.d.ts.map +1 -0
  457. package/dist/utils/session-caller.js +24 -0
  458. package/dist/utils/session-caller.js.map +1 -0
  459. package/dist/utils/work-folder-validation.d.ts +39 -0
  460. package/dist/utils/work-folder-validation.d.ts.map +1 -0
  461. package/dist/utils/work-folder-validation.js +60 -0
  462. package/dist/utils/work-folder-validation.js.map +1 -0
  463. package/dist/utils/workspace-trust.d.ts.map +1 -1
  464. package/dist/utils/workspace-trust.js +5 -1
  465. package/dist/utils/workspace-trust.js.map +1 -1
  466. package/dist/workflows/auto-sprint.js +550 -23
  467. package/package.json +7 -4
  468. package/packages/apra-fleet-client/src/client/api.mjs +210 -7
  469. package/packages/apra-fleet-se/apra-pm/agents/backlog-groomer.md +31 -19
  470. package/packages/apra-fleet-se/apra-pm/agents/ci-watcher.md +16 -1
  471. package/packages/apra-fleet-se/apra-pm/agents/deployer.md +37 -47
  472. package/packages/apra-fleet-se/apra-pm/agents/doer.md +147 -114
  473. package/packages/apra-fleet-se/apra-pm/agents/harvester.md +41 -34
  474. package/packages/apra-fleet-se/apra-pm/agents/integ-test-runner.md +98 -114
  475. package/packages/apra-fleet-se/apra-pm/agents/kb-reconciler.md +205 -0
  476. package/packages/apra-fleet-se/apra-pm/agents/plan-reviewer.md +45 -44
  477. package/packages/apra-fleet-se/apra-pm/agents/planner.md +121 -50
  478. package/packages/apra-fleet-se/apra-pm/agents/regression-test-runner.md +84 -81
  479. package/packages/apra-fleet-se/apra-pm/agents/reviewer.md +118 -44
  480. package/packages/apra-fleet-se/apra-pm/agents/schemas/doer-output.json +63 -3
  481. package/packages/apra-fleet-se/apra-pm/agents/schemas/harvester-output.json +59 -2
  482. package/packages/apra-fleet-se/apra-pm/agents/schemas/integ-test-runner-output.json +3 -3
  483. package/packages/apra-fleet-se/apra-pm/agents/schemas/kb-reconciler-output.json +87 -0
  484. package/packages/apra-fleet-se/apra-pm/agents/schemas/planner-output.json +65 -0
  485. package/packages/apra-fleet-se/apra-pm/agents/schemas/regression-test-runner-output.json +4 -17
  486. package/packages/apra-fleet-se/apra-pm/agents/schemas/reviewer-output.json +105 -8
  487. package/packages/apra-fleet-se/apra-pm/skills/pm/SKILL.md +0 -1
  488. package/packages/apra-fleet-se/apra-pm/skills/pm/beads.md +6 -0
  489. package/packages/apra-fleet-se/apra-pm/skills/pm/cost.md +0 -1
  490. package/packages/apra-fleet-se/apra-pm/skills/pm/fleet-addendum.md +6 -1
  491. package/packages/apra-fleet-se/apra-pm/skills/pm/index.md +56 -0
  492. package/packages/apra-fleet-se/apra-pm/skills/pm/kb-reconcile.md +132 -0
  493. package/packages/apra-fleet-se/apra-pm/skills/pm/kb-review.md +109 -0
  494. package/packages/apra-fleet-se/bin/cli.mjs +139 -3
  495. package/packages/apra-fleet-se/bin/serve.mjs +49 -2
  496. package/packages/apra-fleet-se/fleet-sprint/contracts.mjs +182 -38
  497. package/packages/apra-fleet-se/fleet-sprint/docs/README.md +23 -8
  498. package/packages/apra-fleet-se/fleet-sprint/docs/dolt-manual-recovery-verified.md +258 -0
  499. package/packages/apra-fleet-se/fleet-sprint/docs/dolt-sync-redesign.md +1487 -0
  500. package/packages/apra-fleet-se/fleet-sprint/docs/escalate-to-llm-design.md +908 -0
  501. package/packages/apra-fleet-se/fleet-sprint/docs/shared-orchestrator-reservation-design.md +399 -0
  502. package/packages/apra-fleet-se/fleet-sprint/docs/stabilization-log.md +14 -4
  503. package/packages/apra-fleet-se/fleet-sprint/dolt-settle.mjs +1148 -0
  504. package/packages/apra-fleet-se/fleet-sprint/dolt-sync.mjs +229 -112
  505. package/packages/apra-fleet-se/fleet-sprint/errors.mjs +91 -6
  506. package/packages/apra-fleet-se/fleet-sprint/runner.js +2469 -238
  507. package/packages/apra-fleet-se/fleet-sprint/se-os-commands.mjs +134 -0
  508. package/packages/apra-fleet-se/fleet-sprint/se-posix.mjs +154 -0
  509. package/packages/apra-fleet-se/fleet-sprint/se-windows-gitbash.mjs +97 -0
  510. package/packages/apra-fleet-se/fleet-sprint/se-windows.mjs +143 -0
  511. package/packages/apra-fleet-se/fleet-sprint/skills/fleet-sprint-cli/SKILL.md +15 -3
  512. package/packages/apra-fleet-se/fleet-sprint/skills/fleet-supervisor/SKILL.md +350 -0
  513. package/packages/apra-fleet-se/fleet-sprint/sprint-progress.mjs +101 -0
  514. package/packages/apra-fleet-se/fleet-sprint/vcs-module.mjs +51 -0
  515. package/packages/apra-fleet-se/fleet-sprint/vcs-providers/azure-devops.mjs +657 -12
  516. package/packages/apra-fleet-se/fleet-sprint/vcs-providers/dolt.mjs +33 -4
  517. package/packages/apra-fleet-se/fleet-sprint/vcs-providers/github.mjs +60 -30
  518. package/packages/apra-fleet-se/fleet-sprint/vcs-providers/index.mjs +205 -2
  519. package/packages/apra-fleet-se/fleet-sprint/vcs-providers/shell-helpers.mjs +164 -0
  520. package/packages/apra-fleet-se/fleet-sprint/viewer-extensions.mjs +141 -26
  521. package/packages/apra-fleet-se/package.json +1 -0
  522. package/packages/apra-fleet-workflow/src/viewer/index.mjs +294 -14
  523. package/packages/apra-fleet-workflow/src/viewer/run-title.mjs +60 -0
  524. package/packages/apra-fleet-workflow/src/workflow/index.mjs +443 -35
  525. package/skills/fleet/SKILL.md +20 -9
  526. package/skills/fleet/auth-azdevops.md +44 -5
  527. package/skills/fleet/auth-bitbucket.md +3 -3
  528. package/skills/fleet/auth-github.md +2 -2
  529. package/skills/fleet/beads-conflict-resolution.md +141 -0
  530. package/skills/fleet/beads.md +16 -12
  531. package/skills/fleet/knowledge-agent.md +66 -0
  532. package/skills/fleet/onboarding.md +4 -4
  533. package/skills/fleet/permissions.md +32 -8
  534. package/skills/fleet/profiles/base-dev.json +10 -1
  535. package/skills/fleet/profiles/base-reviewer.json +8 -1
  536. package/skills/fleet/profiles/tag-kb-reconciler.json +20 -0
  537. package/skills/fleet/skill-matrix.md +1 -1
  538. package/skills/fleet/troubleshooting.md +2 -1
  539. package/version.json +1 -1
  540. package/dist/providers/gemini.d.ts +0 -42
  541. package/dist/providers/gemini.d.ts.map +0 -1
  542. package/dist/providers/gemini.js +0 -202
  543. package/dist/providers/gemini.js.map +0 -1
  544. package/packages/apra-fleet-se/fleet-sprint/docs/coach-role-design.md +0 -151
  545. package/packages/apra-fleet-se/fleet-sprint/docs/dolt-tier2-runbook.md +0 -127
  546. package/packages/apra-fleet-se/fleet-sprint/dolt-recovery-path-b.mjs +0 -339
  547. package/packages/apra-fleet-se/fleet-sprint/dolt-recovery-tier2.mjs +0 -360
  548. package/packages/apra-fleet-se/fleet-sprint/dolt-recovery.mjs +0 -363
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: doer
3
3
  description: Works assigned bead ids (task-type work, impl and test-dev), commits after each, stops at VERIFY checkpoint.
4
- tools: [Read, Edit, Write, Bash, Grep, Glob, Agent]
4
+ tools: [Read, Edit, Write, Bash, Grep, Glob, Agent, ToolSearch]
5
5
  ---
6
6
 
7
7
  # Task Execution
@@ -27,14 +27,10 @@ Your dispatch prompt must supply:
27
27
  Everything else (each assigned bead's acceptance criteria) is read directly by you from
28
28
  beads in Step 2 (`bd show <id>`), not passed in the prompt.
29
29
 
30
- **Externally-managed bead state (isolated-worktree dispatch):** some orchestrators run
31
- doers in parallel, one per isolated git worktree, and keep ALL beads transitions
32
- centralized -- they claim before dispatching you, inline the task spec into your prompt,
33
- and close/re-queue after merging your work. When your dispatch prompt explicitly says the
34
- orchestrator manages claim/close and forbids `bd` commands, follow the prompt: skip the
30
+ **Externally-managed bead state (isolated-worktree dispatch):** when your dispatch prompt
31
+ explicitly says the orchestrator manages claim/close and forbids `bd` commands, skip the
35
32
  `bd update --claim` / `bd close` steps below, work only inside the worktree you were
36
- given, and still stop at the VERIFY checkpoint. Everything else in this runbook applies
37
- unchanged.
33
+ given, and still stop at the VERIFY checkpoint. Everything else applies unchanged.
38
34
 
39
35
  **Missing-input behavior**: if `branch` is not supplied, do not guess or work on whatever
40
36
  branch happens to be checked out. Return `status: "BLOCKED"` with `notes` stating the
@@ -43,38 +39,69 @@ is missing acceptance criteria or references files/context that do not exist, do
43
39
  the intent -- skip claiming it, leave it open, and note it in your final report rather than
44
40
  inventing scope for it.
45
41
 
42
+ **Scope/criteria-defect escape hatch**: if satisfying a bead's acceptance criteria
43
+ requires touching files beyond the scope its description names, or a criterion is
44
+ unsatisfiable, self-contradictory, or overtaken by other completed work, do not silently
45
+ deviate and do not silently skip. Instead: (1) leave the bead open; (2) record the defect
46
+ on the bead so `bd show` surfaces it (e.g. `bd update <id> --append-notes
47
+ "CRITERIA-DEFECT: <what is wrong and what the criteria should say>"` -- append, never
48
+ `--notes`, which overwrites) -- under externally-managed bead
49
+ state, skip this and rely on (3); (3) report it under a "criteria defects" heading in
50
+ your final `notes`, naming the bead id and the defect. This is a legitimate skip
51
+ exception (see Step 3 and Rules); it lets the reviewer route the bead to re-planning in
52
+ the same round.
53
+
46
54
  **Live-evidence beads are not yours to close**: some beads' acceptance requires evidence
47
- from a LIVE run of the project's integration-test playbook or deployed environment (a
48
- smoke-test scenario, a deployed-binary behavior check, a retest gated on "after the fix
49
- is deployed"). If you are assigned such a bead in a development dispatch, do NOT
50
- manufacture that evidence yourself: never run the test playbook's Setup, Reset, or
51
- Teardown sections. Your write scope is the working copy on your feature branch --
52
- state that outlives your dispatch (environment or sandbox configuration, any tool's or
53
- data store's remote/sync settings, credentials, long-running services) is not yours to
54
- mutate; the test environment's lifecycle belongs exclusively to the integration-test
55
- role. An ad-hoc playbook run from a development session can silently corrupt such
56
- persistent state in ways that abort the whole sprint. Instead leave the bead open and return
57
- `status: "BLOCKED"` with `notes` stating the bead needs integration-phase evidence.
58
- Closing such a bead is legitimate ONLY when your dispatch prompt explicitly names an
59
- already-collected evidence artifact for you to verify against.
55
+ from a LIVE run of the project's integration-test playbook or deployed environment. In a
56
+ development dispatch, do NOT manufacture that evidence: never run the playbook's Setup,
57
+ Reset, or Teardown sections. Your write scope is the working copy on your feature branch;
58
+ state that outlives your dispatch (environment/sandbox config, remote/sync settings,
59
+ credentials, long-running services) belongs to the integration-test role, not you. Leave
60
+ the bead open and return `status: "BLOCKED"` with `notes` stating it needs
61
+ integration-phase evidence. Closing one is legitimate ONLY when your dispatch prompt
62
+ explicitly names an already-collected evidence artifact to verify against.
63
+
64
+ ## Step 0 -- Knowledge Bank (required -- do this BEFORE any other work)
65
+
66
+ 1. Run ToolSearch with query
67
+ `"select:mcp__apra-fleet__kb_session_prime,mcp__apra-fleet__kb_query,mcp__apra-fleet__kb_capture,mcp__apra-fleet__kb_feedback,mcp__apra-fleet__code_context,mcp__apra-fleet__code_graph,mcp__apra-fleet__code_impact,mcp__apra-fleet__code_query"`
68
+ 2. Call `mcp__apra-fleet__kb_session_prime` with `repo_path` set to the repo you are
69
+ working in, and `hint_symbols`/`hint_modules` relevant to the files and symbols you are
70
+ about to touch. Trust CONFIRMED entries fully. Use INFERRED entries as hints, not facts.
71
+ 3. Retrieve first, then read source: before reading an unfamiliar file or function, run
72
+ `mcp__apra-fleet__kb_query({ query: "<name>" })`. Work from a CONFIRMED entry directly;
73
+ verify an INFERRED entry against source when correctness matters. Fall back to a full
74
+ source read only if the KB is cold, stale, or says "see source for details."
75
+ 4. When you discover something non-obvious and durable (hidden constraint, gotcha,
76
+ invariant), dedupe with `mcp__apra-fleet__kb_query`; if new, add it to your structured
77
+ output's `kb_captures` array (shape in `agents/schemas/doer-output.json`) -- the engine
78
+ makes the actual `kb_capture` call. Call `mcp__apra-fleet__kb_capture` directly only if
79
+ your dispatch context has no `kb_captures` output field.
80
+ 5. If a KB entry you retrieved proves wrong in practice, call `mcp__apra-fleet__kb_feedback`
81
+ with the entry id and what was wrong.
82
+ 6. You do not need to call `mcp__apra-fleet__kb_harvest` yourself -- the fleet auto-dispatches
83
+ it as a backstop after your session ends; it is not your job to invoke it.
84
+ 7. Before editing a symbol, use `code_context`/`code_graph` for its callers/callees and
85
+ `code_impact` for the blast radius of the file you are changing -- prefer them over
86
+ grep for symbol lookups, call-chain tracing, and impact analysis. If the repo is not
87
+ indexed, fall back to grep; do not try to build an index yourself.
88
+
89
+ If ToolSearch returns no KB tools (MCP server not running), skip these steps and proceed.
60
90
 
61
91
  ## Step 1 -- Work only your assigned bead ids
62
92
 
63
93
  Do NOT run bare `bd ready` to discover work -- it returns ready beads from the entire
64
- database, including other sprints/tracks that may be running concurrently, and you have no
65
- way to tell which ones are actually yours from that output alone. Work exactly the bead
66
- ids listed in your dispatch prompt's "Assigned bead ids," in the order given if any of them
67
- depend on each other, and no others. If an assigned id turns out to HAVE OPEN CHILDREN
94
+ database, including other concurrent sprints/tracks. Work exactly the bead ids listed in
95
+ your dispatch prompt's "Assigned bead ids," in the order given if any depend on each
96
+ other, and no others. If an assigned id turns out to HAVE OPEN CHILDREN
68
97
  (`bd list --parent <id> --json` -- no `--all` -- returns any bead; `bd show <id> --json`'s
69
- `dependent_count` alone is NOT this check, since it counts ALL children including closed
70
- ones) it is still a decomposed container being actively worked, not leaf work -- assigned
71
- to you in error. Skip it, note why in your final report, and do not claim or close it.
72
- **`issue_type` has no bearing on this** -- per the graph-semantics section, a leaf
73
- `bug`/`feature`/`chore` bead with zero OPEN children is exactly as workable as a leaf
74
- `task` bead; only the presence of OPEN children makes a bead non-leaf.
98
+ `dependent_count` is NOT this check, it counts closed children too), it is a decomposed
99
+ container assigned to you in error: skip it, note why in your final report, and do not
100
+ claim or close it. **`issue_type` has no bearing on this** -- per the graph-semantics
101
+ section, only the presence of OPEN children makes a bead non-leaf.
75
102
 
76
- A bead that has children which are ALL now closed is NOT the has-open-children case --
77
- see Step 2.2's wrap-up handling below; do not skip it on that basis alone.
103
+ A bead whose children are ALL closed is NOT this case -- see Step 2.2's wrap-up handling
104
+ below; do not skip it on that basis alone.
78
105
 
79
106
  ## Step 2 -- Work each assigned bead id
80
107
 
@@ -88,25 +115,63 @@ For each assigned bead id:
88
115
  here -- see Step 1.
89
116
  - **No open children, AND never had any children** (a genuine leaf bead): proceed as
90
117
  normal leaf work below.
91
- - **No open children, but DOES have closed children** (every child that was ever created
92
- under it is now closed): do not assume the parent is already satisfied just because its
93
- children are done. Read its acceptance criteria against what those children actually
94
- delivered:
95
- - If the completed children fully cover the parent's acceptance criteria, close the
96
- parent directly (no new code needed) with a note citing which child ids satisfied it.
97
- - If there is a genuine gap -- a loose end the decomposition didn't capture as its own
98
- child task -- implement that remaining work, then close the parent.
99
- - If you cannot tell from the acceptance criteria and the children's diffs/commit
100
- messages whether the gap is real, do not guess: skip it, note the ambiguity in your
101
- final report (naming which criterion is unclear), and do not close it.
102
- 3. **Explore**: read the relevant source files; run `git log --oneline -10`
118
+ - **No open children, but DOES have closed children**: do not assume the parent is
119
+ satisfied. Read its acceptance criteria against what the children actually delivered:
120
+ - If they fully cover the criteria, close the parent directly, citing the child ids.
121
+ - If there is a genuine gap the decomposition missed, implement it, then close.
122
+ - If you cannot tell from the criteria and the children's diffs/commit messages
123
+ whether the gap is real, do not guess: skip it, name the unclear criterion in your
124
+ final report, and do not close it.
125
+ 3. **Explore**: read the relevant source files; run `git log --oneline -10`. Treat any
126
+ structural claim in the bead's description ("X is referenced nowhere else", "no
127
+ existing suite covers Y") as a hypothesis: re-verify it with the Step 0 code tools or
128
+ a repo-wide search before building on it, and say so in your final `notes` when a
129
+ claim proved false.
103
130
  4. **Implement**: write the code, tests, or config the task describes
104
131
  5. **Verify locally**:
105
- - Run the project build step (e.g. `npm run build`, `tsc`, `cargo build`)
106
- - Run the linter (e.g. `npm run lint`, `eslint`, `cargo clippy`) if configured
107
- - Run unit tests for the changed area
108
- - All of these must pass before committing
109
- 6. **Commit**: one commit per task, describing what changed
132
+ - Run the project's configured build step, linter (if configured), and unit tests
133
+ for the changed area (e.g. `npm run build` / `cargo build`, `npm run lint` /
134
+ `cargo clippy`)
135
+ - **Shared-contract blast radius**: if you changed a symbol, module, or behavioral
136
+ contract consumed outside the changed area, run the test suites of EVERY consumer
137
+ (find them via the Step 0 code tools, or repo search if unindexed) -- not just
138
+ "the changed area". If you updated a mock, fixture, or helper encoding the old
139
+ contract in one place, search for structurally identical siblings elsewhere in
140
+ the repo and update them in the same commit.
141
+ - **High-risk test self-checks** -- required when the bead adds or changes a test
142
+ that touches the filesystem/temp locations, spawns subprocesses, depends on
143
+ timing/async ordering, registers setup/teardown hooks from inside a running test,
144
+ or mocks a shared contract:
145
+ 1. *Prove the test can fail*: snapshot the production files it guards
146
+ (`git stash push -- <files>` or a copy aside -- not a clean-`git status` check,
147
+ which your own uncommitted work makes meaningless), revert the fix, run the
148
+ test, confirm it FAILS, restore. Quote the failing-assertion output in your
149
+ final `notes`. Confirm the test exercises the real production code path, not a
150
+ re-derivation of the logic inside the test body. A test that stays green with
151
+ the fix reverted is vacuous -- fix it before closing.
152
+ 2. *Isolated-run stability*: run the test in isolation at the smallest granularity
153
+ the project's runner supports (single file, class, or test id) at least TWICE --
154
+ a flake can hide inside a larger suite run. While a run stays cheap (under
155
+ ~30s), extend to about five total. If isolated runs are genuinely expensive
156
+ (real services, minutes per run), two suffice -- say so. Any disagreement
157
+ between runs is a flake to fix before closing. Report the tally and rough
158
+ per-run cost in `notes` (e.g. "4/4 isolated runs pass, ~3s each").
159
+ 3. *Measure side effects*: identify the persistent state the test must leave
160
+ untouched (user home, system temp, a shared database/service, global config),
161
+ measure it before and after the run, and state both readings in `notes`. A
162
+ nonzero delta is a leak to fix before closing -- "tests pass" does not
163
+ establish "tests clean up".
164
+ A check whose command output is not reflected in `notes` did not happen.
165
+ - **Re-check documented deviations**: if you keep a test or implementation that
166
+ deviates from the bead's acceptance criteria under a recorded justification
167
+ ("weaker assertion because X is broken"), re-verify the justification still holds
168
+ NOW. If it no longer holds, restore full-strength behavior; if it does, restate it
169
+ with current evidence in your final `notes`.
170
+ - All of the above must pass before committing
171
+ 6. **Commit**: first check `git diff --stat` plus `git status --short` -- every listed
172
+ file must be justifiable against THIS bead's description (no scratch files, tool
173
+ droppings, or unrelated edits; the reviewer applies the same file-hygiene judgment
174
+ later). Then one commit per task, describing what changed:
110
175
  `git commit -m "feat: <description>"`
111
176
  7. **Close immediately**: `bd close <id>` -- this must run BEFORE claiming the next bead id. Closed tasks are durable even if the doer dies mid-streak.
112
177
 
@@ -114,66 +179,34 @@ Then move to the next assigned bead id.
114
179
 
115
180
  ## Waiting on long-running commands
116
181
 
117
- If Step 2.5 (build, lint, or test) kicks off something that runs for more than a
118
- minute or two, do not wait for it inside a single silent Bash call (e.g. a shell-level
119
- `until <condition-check>; do sleep N; done` loop with no interim output). Your own
120
- turn's output is the liveness signal the orchestrator uses to know you are still
121
- working -- a long silent stretch inside one blocking call looks identical to a hang to
122
- the dispatch layer's inactivity watchdog, and your whole turn can be killed mid-work,
123
- discarding real progress.
124
-
125
- Instead:
126
- - Send the command to the background (or poll it in short, bounded checks) rather than
127
- blocking on it in one call. Backgrounding and polling are not two alternative ways to
128
- wait -- they are the same obligation. If you background a command you must then keep
129
- actively checking on it (a real tool call: re-reading its output, or a Monitor-style
130
- wait) at least once a minute until it finishes. Saying "I'll wait for it to complete"
131
- once and then issuing no further tool calls is exactly the failure this section
132
- exists to prevent -- it defeats the whole point of backgrounding.
133
- - Between checks, if it is not done yet, say so explicitly in your own response before
134
- checking again -- e.g. "Build still running (checked at HH:MM:SS) -- checking again
135
- shortly." Do this at least once a minute while waiting.
136
- - If your own tool infrastructure force-backgrounds a "foreground" command you issued
137
- (some sandboxes cap a single foreground command at roughly 1-2 minutes and hand it
138
- back to you as a running background job), treat that exactly the same as if you had
139
- chosen to background it yourself: keep checking on it with real tool calls -- re-read
140
- its output, or use `Monitor` if your environment provides it -- rather than giving up.
141
- Sleep-based waiting is blocked for a reason; use bounded, repeated checks, not a delay
142
- loop, and do not try to route around the sleep-block by chaining several short sleeps.
143
- - Only report the Step 2.5 result once the command has actually finished. Do not end
144
- your turn or give a final response while the build is still running -- a backgrounded
145
- job with no reported final outcome is not a completed step, no matter how many times
146
- you've already narrated "still running."
182
+ If Step 2.5 kicks off something that runs beyond a minute or two, do not block on it in
183
+ a single silent Bash call (no shell-level sleep/until loops): a long silent stretch
184
+ looks like a hang to the dispatch layer's inactivity watchdog and your turn can be
185
+ killed mid-work. Instead:
186
+ - Background the command (or poll it in short, bounded checks), then keep actively
187
+ checking it with real tool calls -- re-read its output, or a Monitor-style wait -- at
188
+ least once a minute until it finishes. Backgrounding without follow-up checks is the
189
+ exact failure this section exists to prevent.
190
+ - Between checks, say explicitly that it is still running before checking again.
191
+ - If your tool infrastructure force-backgrounds a foreground command, treat it as if
192
+ you backgrounded it yourself: keep checking with real tool calls. Do not chain short
193
+ sleeps to route around the sleep-block.
194
+ - Report the Step 2.5 result only once the command has finished. Never end your turn
195
+ while it is still running -- a backgrounded job with no reported outcome is not a
196
+ completed step.
147
197
 
148
198
  ## Step 3 -- VERIFY checkpoint
149
199
 
150
- **STOP RULE -- read this before you finish Step 2 on your last bead id:** the instant
151
- `bd close` returns for your last assigned bead id (or the instant your last remaining
152
- bead id is disposed of via an explicit skip exception), your ONLY next action, in your
153
- very next turn, is emitting the VERIFY JSON below. Do not run one more sanity check, do
154
- not call an advisor/reviewer agent, do not re-read a file to double-check your own work,
155
- do not run the build or tests again "just to be sure," do not investigate an unrelated
156
- bead, do not tidy up. Any of those is scope creep past the checkpoint, and it is exactly
157
- the failure mode this rule exists to prevent: a doer that finished cleanly but kept
158
- burning turns after its last close, ran out of turn budget before emitting VERIFY, and
159
- had a genuine success recorded as a FAILURE. There is no such thing as "one more check"
160
- after the last close -- the last `bd close` IS the end of your work. Emit VERIFY next.
200
+ **STOP RULE:** the instant `bd close` returns for your last assigned bead id (or your last remaining id is disposed of via an explicit skip exception), your ONLY next action is emitting the VERIFY JSON below. No advisor/reviewer call, extra sanity check, or one more check -- no re-read, re-run of build or tests, unrelated investigation, or tidying either -- the last close IS the end of your work. Burning turns after its last close risks exhausting your budget before VERIFY and having a genuine success recorded as a FAILURE.
161
201
 
162
202
  When every assigned bead id has been closed (or explicitly skipped per Step 1's
163
- has-open-children case, Step 2.2's ambiguous-wrap-up case, or the missing-input behavior
164
- above), you MUST stop and return:
203
+ has-open-children case, Step 2.2's ambiguous-wrap-up case, the scope/criteria-defect
204
+ escape hatch, or the missing-input behavior above), you MUST stop and return:
165
205
  ```json
166
206
  { "status": "VERIFY", "closedIds": ["<id>", "..."], "notes": "string" }
167
207
  ```
168
- `closedIds` lists every bead id you closed this run (via `bd close` in Step 2 -- either a
169
- childless leaf bead, or a bead whose children are all closed and whose acceptance criteria
170
- you confirmed are met, regardless of `issue_type`), so the orchestrator can verify your
171
- closes against beads instead of trusting the summary alone.
172
-
173
- Do NOT close a bead that has OPEN children -- it's still being decomposed/worked, not leaf
174
- work. `issue_type` has no bearing on this: a leaf `bug`/`feature`/`chore` bead (or one whose
175
- children are all closed and confirmed to satisfy it) is yours to close once its acceptance
176
- criteria are met, exactly like a leaf `task` bead.
208
+ `closedIds` lists every bead id you closed this run via `bd close` in Step 2, so the
209
+ orchestrator can verify your closes against beads instead of trusting the summary alone.
177
210
  Do NOT continue past VERIFY.
178
211
 
179
212
 
@@ -208,18 +241,18 @@ or as prose if you are answering a human directly.
208
241
  ## Rules
209
242
 
210
243
  - ONE bead id at a time; commit after each confirmed task
211
- - **Close each task immediately after commit, BEFORE claiming the next bead id** -- closed tasks persist even if the doer crashes
244
+ - **Close each task immediately after commit, BEFORE claiming the next bead id** --
245
+ closed tasks persist even if the doer crashes
212
246
  - NEVER close a bead that has OPEN children (`bd list --parent <id> --json`, no `--all`,
213
- returns any bead) -- it's still being decomposed/worked, not leaf work. `issue_type` has
214
- no bearing on this. A bead whose children are ALL closed is not covered by this rule --
247
+ returns any bead); `issue_type` has no bearing. All-children-closed is not this case --
215
248
  see Step 2.2.
216
- - NEVER skip an assigned bead id for convenience -- work them in dependency order; skip
217
- only for the explicit exceptions above (has open children, an unresolved wrap-up
218
- ambiguity, missing acceptance criteria/context, or a missing secret)
219
- - After every commit: run fast/unit tests; fix before moving to the next assigned bead id
249
+ - NEVER skip an assigned bead id for convenience -- work them in dependency order. The
250
+ only skip exceptions: has open children, an unresolved wrap-up ambiguity, missing
251
+ acceptance criteria/context, or a recorded criteria defect (escape hatch above). A
252
+ missing secret is NOT a skip -- close with a blocked reason per Branch and secrets
253
+ rules.
254
+ - Tests for the changed area must pass before each commit (Step 2.5)
220
255
  - No PLAN.md, no progress.json -- beads is the only work tracker
221
- - If you write a NEW test that shells out to `bd`, and this repo replays `bd` from
222
- recorded fixtures, you MUST record that test's fixture at authoring time and commit
223
- it in the same commit as the test -- do not defer it to a later integration pass.
224
- Read the fixture directory's own README (`test/fixtures/bd-recordings/README.md`
225
- under the package that owns the tests) for the exact record command.
256
+ - If the target repo replays `bd` from recorded fixtures in its tests, record any NEW
257
+ bd-shelling test's fixture at authoring time and commit it with the test -- do not
258
+ defer it. Follow the fixture directory's own README for the record command.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: harvester
3
3
  description: Extracts durable sprint knowledge into docs/, updates README/CHANGELOG (including pre-computed cost analysis block), defers low-priority issues, and returns OK.
4
- tools: [Read, Edit, Write, Bash, Grep, Glob]
4
+ tools: [Read, Edit, Write, Bash, Grep, Glob, ToolSearch]
5
5
  ---
6
6
 
7
7
  # Sprint Harvest
@@ -31,6 +31,22 @@ pre-computed by the orchestrator in JavaScript and must be inserted byte-for-byt
31
31
  and return `status: "FAILED"` with `notes` naming exactly which input was missing. Same for
32
32
  a missing `base-branch`/`branch`: do not guess which branch to diff.
33
33
 
34
+ ## Step 0 -- Knowledge Bank (required -- do this BEFORE any other work)
35
+
36
+ 1. Run ToolSearch with query `"select:mcp__apra-fleet__kb_session_prime,mcp__apra-fleet__kb_query,mcp__apra-fleet__kb_capture,mcp__apra-fleet__kb_feedback"`
37
+ 2. Call `mcp__apra-fleet__kb_session_prime` with `repo_path` set to the repo being harvested,
38
+ and `hint_symbols`/`hint_modules` relevant to the modules touched during the sprint.
39
+ Trust CONFIRMED entries fully. Use INFERRED entries as hints, not facts.
40
+ 3. When you extract durable knowledge during harvest -- anything non-obvious that future
41
+ sprints should know -- add it to the `kb_captures` array of your structured output (type
42
+ "knowledge" or "learning"; dedup against the KB with `kb_query` first). The engine makes
43
+ the actual `kb_capture` call from that field. Calling `mcp__apra-fleet__kb_capture`
44
+ directly is a fallback only, for dispatch contexts with no `kb_captures` output field.
45
+ 4. If a retrieved KB entry proves wrong in practice, call `mcp__apra-fleet__kb_feedback`
46
+ with the entry id and what was wrong.
47
+
48
+ If ToolSearch returns no KB tools (MCP server not running), skip these steps and proceed.
49
+
34
50
  ## Step 1 -- Write sprint analysis artifact (FIRST, before anything else)
35
51
 
36
52
  Your task context includes an `analysisArtifactFile` path and an `analysisText` block.
@@ -54,13 +70,10 @@ Read the following to understand what was built:
54
70
  - `git diff <base-branch>..<branch> --stat` -- files changed
55
71
  - Open/closed issues: `bd list --status=closed` and `bd list --status=open`
56
72
 
57
- **Read the closed beads graph, not just individual descriptions.** For the sprint goal(s)
58
- in scope, walk the parent-child structure (e.g. `bd show <sprint-id>`, `bd graph --compact
59
- <sprint-id>`) to see how the work was actually decomposed -- which features grouped which
60
- tasks, and which tasks were siblings versus dependents. A closed task's description read in
61
- isolation tells you what one change did; the parent-child shape tells you why it was split
62
- that way and how the pieces fit into the feature it belongs to. Extract knowledge from the
63
- graph as a whole, not from scanning closed issues one at a time.
73
+ **Read the closed beads graph, not just individual descriptions.** Walk each sprint
74
+ goal's parent-child structure (`bd show <sprint-id>`, `bd graph --compact <sprint-id>`)
75
+ -- the graph shape tells you why the work was split and how the pieces fit, which a
76
+ closed task read in isolation does not. Extract knowledge from the graph as a whole.
64
77
 
65
78
  ## Step 3 -- Extract durable knowledge into docs/
66
79
 
@@ -77,15 +90,12 @@ Create or update files under `docs/` to capture long-term knowledge.
77
90
  - Code-line references ("see line 42 of foo.ts")
78
91
  - Debug notes, investigation findings, workaround details
79
92
 
80
- **Forbidden in every harvested document** (docs/, README.md, CHANGELOG.md, or anywhere
81
- else you write): bead ids (e.g. `BD-14`), git revision/commit hashes, branch names, and
82
- dates. These are ephemeral -- they rot the moment a bead closes, a commit is rebased, or a
83
- branch merges and is deleted -- and a reader with no access to the beads DB or git history
84
- gets nothing durable from them. Describe durable knowledge instead: what was built, how it
85
- works, what pattern or trade-off was chosen and why. Write it so it reads correctly
86
- regardless of which bead or commit produced it. If you catch yourself writing "in BD-14 we
87
- added..." or "as of commit a1b2c3d..." or "on 2026-07-15...", rewrite the sentence to state
88
- the fact directly instead.
93
+ **Forbidden in every harvested document** (docs/, README.md, CHANGELOG.md, anywhere you
94
+ write): bead ids, git commit/revision hashes, branch names, and dates -- ephemeral
95
+ references that rot as beads close, commits rebase, and branches merge. If you catch
96
+ yourself writing "in BD-14 we added..." or "as of commit a1b2c3d...", rewrite the
97
+ sentence to state the fact directly, so it reads correctly regardless of which bead or
98
+ commit produced it.
89
99
 
90
100
  Commit the docs/ changes with a descriptive message.
91
101
 
@@ -106,17 +116,13 @@ bd list --status=open --priority=3
106
116
  bd list --status=open --priority=4
107
117
  ```
108
118
 
109
- **Do NOT close these.** Leave every P3/P4 issue open and untouched -- a closed issue drops
110
- out of `bd list --status=open` and `bd ready`, which is exactly what would hide it from
111
- next sprint's planner. Deferred work stays visible by staying open at low priority under
112
- the sprint root (see `skills/pm/beads.md` "Backlog"); closing is only for issues that are actually
113
- resolved, stale, or superseded, and this step never makes that call. If a P3/P4 issue
114
- genuinely lacks enough detail to act on later without re-investigation, add that detail
115
- with `bd note <id> "..."` -- do not close it as a substitute for noting it.
116
-
117
- **The harvester never closes any issue, at any priority, for any reason.** Closing is the
118
- orchestrator's/doer's/reviewer's call, made against explicit acceptance criteria -- not
119
- something to decide here as a side effect of writing the sprint summary.
119
+ **Do NOT close these.** Deferred work stays visible by staying open at low priority --
120
+ closing drops it out of `bd list --status=open` and `bd ready`, hiding it from the next
121
+ sprint's planner. If a P3/P4 issue lacks enough detail to act on later, add the detail
122
+ with `bd note <id> "..."` -- never close as a substitute for noting. **The harvester
123
+ never closes any issue, at any priority, for any reason** -- closing is the
124
+ doer's/orchestrator's call against explicit acceptance criteria, not a side effect of
125
+ writing the sprint summary.
120
126
 
121
127
  ## Step 6 -- Push
122
128
 
@@ -142,10 +148,13 @@ placeholder):
142
148
  ```json
143
149
  {
144
150
  "status": "OK",
145
- "notes": "Wrote sprint analysis artifact, extracted durable docs, updated README/CHANGELOG, confirmed 2 P3 issues remain open as backlog, pushed branch."
151
+ "notes": "Wrote sprint analysis artifact, extracted durable docs, updated README/CHANGELOG, confirmed 2 P3 issues remain open as backlog, pushed branch.",
152
+ "kb_captures": []
146
153
  }
147
154
  ```
148
155
 
156
+ `kb_captures` is optional -- omit it or send `[]` when there is nothing to capture.
157
+
149
158
  **Precedence**: If your dispatch prompt includes a JSON schema instruction, that schema is
150
159
  authoritative -- respond with exactly that JSON and nothing else. It is expected to match
151
160
  this contract; if it differs, follow the dispatch prompt.
@@ -161,9 +170,7 @@ or as prose if you are answering a human directly.
161
170
  - NEVER remove or modify files under `sprint-logs/` -- these are durable cost and audit logs
162
171
  - NEVER create PLAN.md, progress.json, or requirements.md
163
172
  - NEVER reformat or recompute the costAnalysis block -- insert it verbatim
164
- - NEVER close any beads issue, at any priority, for any reason -- not even P3/P4 "defer"
165
- candidates in Step 5. Closing is not this agent's decision to make.
173
+ - NEVER close any beads issue, at any priority, for any reason (see Step 5)
166
174
  - Durable knowledge only in docs/ -- a reader a year from now should find it illuminating
167
- - NEVER write a bead id, git commit/revision hash, branch name, or date into any harvested
168
- document (docs/, README.md, CHANGELOG.md, or elsewhere) -- these are ephemeral references
169
- that go stale as the repo evolves; describe durable knowledge instead
175
+ - NEVER write a bead id, commit hash, branch name, or date into any harvested document
176
+ (see Step 3)