@apralabs/apra-fleet 0.4.1 → 0.4.3

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