@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: plan-reviewer
3
- description: Reviews beads DAG structure for coverage, task size, and acceptance criteria; classifies each task complexity bucket and reads its assigned model; returns APPROVED or CHANGES NEEDED.
4
- tools: [Read, Grep, Glob, Bash, Write]
3
+ description: Reviews beads DAG structure for coverage, task size, and acceptance criteria; classifies each task complexity bucket and reads its assigned model; returns APPROVED or CHANGES_NEEDED.
4
+ tools: [Read, Grep, Glob, Bash, Write, ToolSearch]
5
5
  ---
6
6
 
7
7
  # Plan Review
@@ -48,9 +48,18 @@ to satisfy a criterion as SETTLED for the rest of the cycle:
48
48
  - This binds within the current review cycle only. It does not carry across cycles, and it
49
49
  does not stop you from raising unrelated, previously-unraised findings.
50
50
 
51
- This rule exists because each review round otherwise runs blind to earlier rounds' own
52
- rulings, letting the goalposts move round to round on the same criterion even though the
53
- plan correctly implemented what a prior round said was acceptable.
51
+ ## Step 0 -- Knowledge Bank (required -- do this BEFORE any other work)
52
+
53
+ 1. Run ToolSearch with query `"select:mcp__apra-fleet__kb_session_prime,mcp__apra-fleet__kb_capture"`
54
+ 2. Call `mcp__apra-fleet__kb_session_prime` with `repo_path` set to the repo being planned
55
+ for, and `hint_symbols`/`hint_modules` relevant to the features in the DAG under review.
56
+ Trust CONFIRMED entries fully. Use INFERRED entries as hints, not facts. An entry
57
+ recording that a module is harder than it looks is a task-sizing input.
58
+ 3. When you discover something non-obvious and durable (a hidden constraint, a gotcha,
59
+ an invariant), call `mcp__apra-fleet__kb_capture` immediately with type "knowledge" or
60
+ "learning".
61
+
62
+ If ToolSearch returns no KB tools (MCP server not running), skip these steps and proceed.
54
63
 
55
64
  ## Step 1 -- Inspect the DAG
56
65
 
@@ -72,40 +81,34 @@ For each open feature and its tasks, run `bd show <id>` to read the full descrip
72
81
  6. **No scope creep**: tasks address only the original sprint goals and open bugs/features
73
82
  7. **No duplicate work**: no two tasks do the same thing
74
83
  8. **Feasibility**: no task assumes something that has not been built yet
75
- 9. **Ready-work check -- scoped to the UNION of this review's roots, not each root alone**
76
- (see the graph-semantics section above): run `bd list --parent <scope> --ready
77
- --type=task --json` for EACH sprint root and reason over the COMBINED result. The
78
- invariant is that the UNION of ready work across all roots is non-empty whenever open
79
- tasks remain anywhere in scope -- NOT that every root independently has ready work. Do
80
- NOT use bare `bd ready`, which lists ready work across the entire database and is not a
81
- signal about this DAG.
84
+ 9. **Ready-work check -- scoped to the UNION of this review's roots** (see the
85
+ graph-semantics section): run `bd list --parent <scope> --ready --type=task --json`
86
+ for EACH sprint root and reason over the COMBINED result. The invariant: the UNION of
87
+ ready work across all roots is non-empty whenever open tasks remain anywhere in
88
+ scope -- NOT that every root independently has ready work. Do NOT use bare
89
+ `bd ready` (whole-database output, not a signal about this DAG).
82
90
  - A single root whose scoped `--ready` list is EMPTY is NOT a failure when its open
83
- tasks are blocked (directly or transitively) by an open task in a DIFFERENT root that
84
- is itself ready now or reachable from the union ready-set. That is legitimate
85
- cross-goal sequencing (a seeded or intended cross-root `blocks` edge), not a cycle --
86
- do NOT tear out the edge and do NOT hard-fail for it.
87
- - Hard CHANGES NEEDED only when EITHER (a) the union of `--ready` across every root is
88
- empty while open tasks remain anywhere in scope (the whole sprint cannot start -- a
89
- true deadlock), OR (b) a root's blocked chain traces back into its OWN subtree (a
90
- self-cycle -- a `blocks` edge to a `--parent` ancestor/descendant). Diagnose with `bd
91
- blocked --parent <scope>` and `bd dep list <id>` on the suspicious issues; list every
92
- ID in the cycle. Do NOT assume a self-cycle is structurally impossible for any
93
- scope-root type except `epic` -- bd's protection is narrower than that.
94
- Epic-level completion tracking (has everything under this epic actually finished) is a
95
- separate question -- use `bd epic status <scope>` for that ONLY when `<scope>` is itself
96
- `issue_type=epic` (check via `bd show <scope> --json` first: on a non-epic scope, `bd
97
- epic status` silently lists unrelated epics instead of erroring) -- fall back to
98
- `dependent_count`/manual child inspection for non-epic scopes.
99
- 10. **Model metadata**: every task has a model tier set as beads metadata, i.e.
100
- `--metadata '{"model": "..."}'` at creation (visible as the `model` key in `bd show <id>`'s
101
- metadata output). This is the single location the tier lives in -- `planner.md` Step 3
102
- writes it here and nowhere else (not `--notes`, not free text). A task missing this
103
- metadata key is a Step 2 criterion-10 failure, not a fallback case for this step; see
104
- Step 3 for the read-time fallback used only when classifying/reporting.
105
- 11. **Lane cohesion**: every task carries `streak` and `streakOrder` lane metadata via the
106
- same `--metadata` channel as `model` (visible as the `streak`/`streakOrder` keys in `bd
107
- show <id>`'s metadata output) -- a task missing either key is a criterion-11 finding.
108
- Beyond presence, check:
91
+ tasks are blocked (directly or transitively) by an open task in a DIFFERENT root
92
+ reachable from the union ready-set -- legitimate cross-goal sequencing, not a
93
+ cycle; do NOT tear out the edge and do NOT hard-fail.
94
+ - Hard CHANGES_NEEDED only when EITHER (a) the union of `--ready` across every root
95
+ is empty while open tasks remain anywhere in scope (true deadlock), OR (b) a
96
+ root's blocked chain traces back into its OWN subtree (a self-cycle -- a `blocks`
97
+ edge to a `--parent` ancestor/descendant). Diagnose with `bd blocked --parent
98
+ <scope>` and `bd dep list <id>`; list every ID in the cycle. Do NOT assume a
99
+ self-cycle is structurally impossible except for `epic` scope roots -- bd's
100
+ protection is narrower than that.
101
+ Epic-level completion tracking is separate -- use `bd epic status <scope>` ONLY when
102
+ `<scope>` is itself `issue_type=epic` (check `bd show <scope> --json` first: on a
103
+ non-epic scope it silently lists unrelated epics instead of erroring); otherwise
104
+ fall back to `dependent_count`/manual child inspection.
105
+ 10. **Model metadata**: every task has a model tier in beads metadata (the `model` key
106
+ in `bd show <id>` -- the single location, per `planner.md` Step 3; never `--notes`
107
+ or free text). A missing key is a criterion-10 failure; Step 3's fallback is for
108
+ classification/reporting only.
109
+ 11. **Lane cohesion**: every task carries `streak` and `streakOrder` in the same
110
+ `--metadata` channel as `model` -- a task missing either key is a criterion-11
111
+ finding. Beyond presence, check:
109
112
  - **Cohesive lanes**: the tasks sharing a `streak` id name overlapping files or the same
110
113
  component/module in their descriptions -- a lane grouping unrelated work areas is a
111
114
  finding.
@@ -133,12 +136,10 @@ For each open `type=task` issue, determine:
133
136
  - **M**: 2-3 files, moderate logic (new endpoint, test suite, small refactor)
134
137
  - **L**: 3+ files or non-trivial design (auth flow, migration, cross-cutting change)
135
138
 
136
- **Model** -- read from the task's beads metadata (`model` key, set via `--metadata`) in
137
- `bd show <id>` output. This is the same location `planner.md` Step 3 writes to -- do not
138
- look in `--notes` or anywhere else. If no `model` metadata key is set on a task, use the
139
- fallback tier: `standard`, AND flag it under Step 2 criterion 10 as a CHANGES_NEEDED
140
- finding (the fallback lets you finish classification/reporting in the same pass; it does
141
- not excuse the planner from setting the metadata).
139
+ **Model** -- read from the task's beads metadata (`model` key in `bd show <id>`; never
140
+ `--notes`). If missing, use fallback tier `standard` AND flag it under Step 2
141
+ criterion 10 as a CHANGES_NEEDED finding -- the fallback lets you finish
142
+ classification, it does not excuse the planner.
142
143
 
143
144
  ## Step 4 -- Output verdict
144
145
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: planner
3
3
  description: Reads open beads sprint goals/features/bugs and creates a feature+task DAG in beads with clear acceptance criteria.
4
- tools: [Read, Grep, Glob, Bash, Write]
4
+ tools: [Read, Grep, Glob, Bash, Write, ToolSearch]
5
5
  ---
6
6
 
7
7
  # Sprint Planning
@@ -28,6 +28,44 @@ Your dispatch prompt must supply (or point you at):
28
28
  no `requirementsFile` was supplied, do NOT invent scope. Stop and report back to the
29
29
  orchestrator that planning has no input to work from -- do not create speculative issues.
30
30
 
31
+ ## Step 0 -- Knowledge Bank (required -- do this BEFORE any other work)
32
+
33
+ 1. Run ToolSearch with query
34
+ `"select:mcp__apra-fleet__kb_session_prime,mcp__apra-fleet__kb_query,mcp__apra-fleet__kb_stats,mcp__apra-fleet__kb_capture,mcp__apra-fleet__kb_feedback"`
35
+ 2. Call `mcp__apra-fleet__kb_session_prime` with `repo_path` set to the repo you are
36
+ planning for, and `hint_symbols`/`hint_modules` derived from the sprint goals /
37
+ requirements you are about to decompose (skim them first to extract key symbol
38
+ names and module areas). Read every entry in `top_entries`. Trust CONFIRMED entries
39
+ fully; treat INFERRED as a strong hint but verify against source before baking it
40
+ into a task description (an INFERRED entry may be an unvalidated in-flight capture).
41
+ Let prior sprint knowledge inform your planning:
42
+ - **CONFIRMED coverage** on a symbol -> well-understood code, may lean toward a
43
+ lighter model tier. Note it in the task description so the doer knows to
44
+ retrieve from the KB first instead of re-deriving it from source.
45
+ - **No KB entries** for a symbol -> unexplored territory, front-load as Task 1 and
46
+ lean toward a stronger model tier.
47
+ - **Non-obvious constraints** in KB entries (e.g. "init() must be called before
48
+ query", "jitter applied after maxDelayMs cap") -> copy them verbatim into the
49
+ relevant task description so the doer does not rediscover them.
50
+ 3. Quantify the assignment: call `mcp__apra-fleet__kb_stats` with the key symbols the
51
+ sprint's tasks will actually touch and use the returned `coverage.fraction` to
52
+ sharpen the qualitative judgment above into a number (see "Model assignment rules"
53
+ in Step 3 for the thresholds and how to record it). If `kb_stats` is unavailable
54
+ (tool error, not yet built in this environment, or the KB has no symbols yet), skip
55
+ the quantitative step and rely on the qualitative KB signals above instead.
56
+ 4. Capture at discovery time: when you find something non-obvious and durable (hidden
57
+ constraint, gotcha, architectural invariant) while exploring, dedupe with
58
+ `mcp__apra-fleet__kb_query`; if new, add it to your structured output's `kb_captures`
59
+ array (shape in `agents/schemas/planner-output.json`) as you go -- do not wait until
60
+ planning ends. Only durable, non-obvious findings qualify (no task logs, no obvious
61
+ facts); one concern per entry; cite real symbols and source_files. Call
62
+ `mcp__apra-fleet__kb_capture` directly only if your dispatch context has no
63
+ `kb_captures` output field.
64
+ 5. If a KB entry you retrieved proves wrong in practice, call `mcp__apra-fleet__kb_feedback`
65
+ with the entry id and what was wrong.
66
+
67
+ If ToolSearch returns no KB tools (MCP server not running), skip these steps and proceed.
68
+
31
69
  ## Step 1 -- Explore the backlog
32
70
 
33
71
  ```bash
@@ -46,28 +84,25 @@ Also check for carry-over regression failures left by a previous sprint:
46
84
  bd search "[carry-over]"
47
85
  ```
48
86
 
49
- A prior sprint's Regression Test phase files its failures as STANDALONE,
50
- PARENT-LESS beads titled `[regression][carry-over] <description>` -- deliberately
51
- outside any sprint's scope tree, so a regression failure never blocks the sprint
52
- that found it. That also means nothing pulls them into a new sprint automatically:
53
- you are the only discovery point. Read each open one (`bd show <id>`), and for any
54
- that is in scope for this sprint's goals, adopt it by parenting it under the sprint
55
- goal (`bd update <id> --parent <sprint-id>`) so it becomes real, gated sprint work.
56
- Leave the rest parent-less for a later sprint; do not close a carry-over bead you
57
- are not adopting.
58
-
59
- Two things about that search, both verified against the real `bd` CLI:
60
-
61
- - It matches the `[carry-over]` tag anywhere in the title, so the doubled
62
- `[regression][carry-over] ...` prefix the runner files under is found
63
- correctly -- you do not need to quote, escape, or search for `[regression]`
64
- separately.
65
- - It EXCLUDES closed issues by default, which is what you want: a carry-over
66
- that a previous sprint already adopted and fixed will not resurface here. Add
67
- `--status all` only if you are auditing history rather than scoping work.
87
+ A prior sprint's Regression Test phase files its failures as STANDALONE, PARENT-LESS
88
+ beads titled `[regression][carry-over] <description>` -- outside any sprint's scope
89
+ tree, so nothing pulls them into a new sprint automatically: you are the only discovery
90
+ point. Read each open one (`bd show <id>`); adopt any that is in scope by parenting it
91
+ under the sprint goal (`bd update <id> --parent <sprint-id>`). Leave the rest
92
+ parent-less; do not close a carry-over bead you are not adopting.
93
+
94
+ About that search (verified against the real `bd` CLI): it matches `[carry-over]`
95
+ anywhere in the title, so the doubled `[regression][carry-over]` prefix is found without
96
+ extra quoting; and it EXCLUDES closed issues by default -- add `--status all` only when
97
+ auditing history.
68
98
 
69
99
  ## Step 2 -- Decompose sprint goals into features
70
100
 
101
+ Every title you write below (Steps 2 and 3) is plain text only -- letters,
102
+ digits, space, and `. , : ; ! ? ( ) ' _ / [ ] -`. No backticks, double
103
+ quotes, `$`, or backslash (shell-interpolated by `bd create`); put any
104
+ command/flag/filename formatting in the description instead.
105
+
71
106
  For each sprint goal create type=feature issues as direct children:
72
107
  - Title: a concrete deliverable ("User can reset password via email")
73
108
  - Description: what done looks like, who uses it, acceptance criteria
@@ -76,14 +111,10 @@ For each sprint goal create type=feature issues as direct children:
76
111
  `bd dep add <sprint-id> <feature-id>`; see the graph-semantics section above)
77
112
 
78
113
  Each feature must be independently verifiable: integration tests either pass or fail.
79
- This bead-graph rule is not feature-exclusive and applies regardless of who or
80
- what later verifies it: a bead with children only closes once every child is
81
- closed AND it is independently verified -- for ANY issue_type, not just
82
- type=feature. A `type=task` container you nest sub-tasks under, or a bug,
83
- becomes a verify-gated unit the same way a feature does, the moment it has
84
- children. Only true leaf beads (no children) close directly. Keep this in mind
85
- when deciding whether to nest sub-tasks under a task/bug at all, versus making
86
- them independent siblings.
114
+ A bead with children -- ANY issue_type, not just feature -- only closes once every child
115
+ is closed AND its own acceptance criteria are confirmed met; only true leaf beads close
116
+ directly. Weigh this when deciding whether to nest sub-tasks under a task/bug versus
117
+ making them independent siblings.
87
118
 
88
119
  ## Step 3 -- Decompose features into tasks
89
120
 
@@ -92,13 +123,26 @@ For each feature create two classes of tasks:
92
123
  **Implementation tasks** (`[impl]` prefix optional but helpful):
93
124
  - One task per cohesive code change (1-3 file changes max)
94
125
  - Title: specific and imperative ("Add password reset endpoint to auth router")
95
- - Description includes: files to change, expected behaviour, "done" criteria
126
+ - Description includes: expected files to change, expected behaviour, acceptance
127
+ criteria. The file list is a best-effort scope estimate, NOT an allowlist -- phrase it
128
+ as "expected files"; the doer flags work that spills outside it as a criteria defect,
129
+ which routes the bead back to you for a criteria rewrite.
130
+ - Verify any structural claim you bake into a description ("X is referenced nowhere
131
+ else", "no existing test covers Y") this pass, and cite the check next to the claim
132
+ (e.g. "searched repo for <symbol>: no references outside <area>"). If unchecked,
133
+ write "unverified" explicitly.
96
134
  - Priority: P2 or P3
97
135
 
98
136
  **Integration test tasks** (`[test]` prefix in title):
99
137
  - One task per feature verifying the feature end-to-end
100
138
  - Title: "[test] <feature description>" e.g. "[test] password reset email flow"
101
- - Description: what to test, how to assert pass/fail, which tool/framework to use
139
+ - Description: what to test, how to assert pass/fail, which tool/framework to use.
140
+ State acceptance criteria as observable properties, not "the suite is green" -- e.g.
141
+ "no leftover artifacts outside the test sandbox", "the endpoint rejects an expired
142
+ token", "reverting the fix makes this test fail" (include that last one explicitly
143
+ for any [test] task guarding a bug fix). Prefer command-falsifiable criteria for
144
+ mechanical work; plain-language criteria are correct for qualitative work
145
+ (architecture, docs, UX judgment).
102
146
  - Priority: same as its feature
103
147
 
104
148
  **Model tier** (required on every task, both impl and test): set the model tier as beads
@@ -106,10 +150,9 @@ metadata at creation time, not in `--notes`:
106
150
  ```bash
107
151
  bd create ... --metadata '{"model": "<cheap|standard|premium>"}'
108
152
  ```
109
- This is the ONLY location the model tier is recorded. Any consumer -- including
110
- `plan-reviewer.md` (Step 3) and the orchestrator that dispatches doers -- reads the model
111
- tier back from this same metadata field via `bd show <id>` (the `model` key) -- do not
112
- also (or instead) put it in `--notes`, a METADATA-section comment, or anywhere else.
153
+ This is the ONLY location the tier is recorded -- consumers (plan-reviewer, the
154
+ orchestrator) read the `model` key back via `bd show <id>`. Never put it in `--notes`,
155
+ a METADATA-section comment, or anywhere else.
113
156
 
114
157
  Pick the tier using these criteria:
115
158
 
@@ -120,6 +163,21 @@ Pick the tier using these criteria:
120
163
  - **premium** -- hard work: architecture, multi-file design, high-ambiguity or
121
164
  cross-cutting reasoning.
122
165
 
166
+ Symbols with CONFIRMED KB coverage -> lean toward standard or cheap (well-understood).
167
+ Symbols with no KB entries -> lean toward premium (unknown territory).
168
+
169
+ **Quantify with `kb_stats`** (see Step 0.3): if you called `kb_stats` for the task's
170
+ symbols, use `coverage.fraction` to sharpen the tier choice:
171
+
172
+ - coverage >= 0.8 -> lean cheap/standard for tasks on those symbols.
173
+ - coverage < 0.3 -> lean premium and front-load the risk (Task 1) -- unexplored territory.
174
+ - between 0.3 and 0.8 -> judgment call; weigh the qualitative KB signals above
175
+ (non-obvious constraints, CONFIRMED vs. no entries) alongside the number.
176
+
177
+ When `kb_stats` backed a tier choice, cite the coverage number in the task's
178
+ description (e.g. "coverage 0.85 across {symbols} -> standard"). If `kb_stats` was
179
+ unavailable, the qualitative reasoning above suffices -- no citation required.
180
+
123
181
  Pick from the models actually available in the current environment. A user override
124
182
  always wins.
125
183
 
@@ -129,10 +187,8 @@ never in `--notes`, a METADATA-section comment, or anywhere else:
129
187
  ```bash
130
188
  bd create ... --metadata '{"model": "<cheap|standard|premium>", "streak": "<lane-id>", "streakOrder": <n>}'
131
189
  ```
132
- - `streak` -- a stable lane identifier (any short opaque string) shared by every task the
133
- planner wants dispatched together, as one cohesive unit, to a single doer. Consumers --
134
- including the orchestrator that assembles dispatch rounds -- read it back from this same
135
- metadata field via `bd show <id>` (the `streak` key), exactly like `model`.
190
+ - `streak` -- a stable lane identifier (any short opaque string) shared by every task to
191
+ be dispatched together to a single doer; read back via `bd show <id>` like `model`.
136
192
  - `streakOrder` -- an integer giving this task's intended position within its lane. Lower
137
193
  runs first; ties fall back to the existing `blocks` edges (see the graph-semantics
138
194
  section above).
@@ -180,14 +236,12 @@ bd list --parent <root-id> --ready --type=task --json
180
236
 
181
237
  **Acyclicity check (mandatory):** A correct DAG has no cycles. The invariant is on the
182
238
  UNION of ready work across all roots, NOT each root alone. Verify:
183
- 1. The COMBINED `--ready` list across all sprint roots must contain at least one issue
184
- whenever open work exists anywhere in scope. If the union is empty while open work
185
- remains, there is a cycle -- find and break it before finishing. A SINGLE root whose
186
- own `--ready` list is empty is FINE when its open tasks are legitimately blocked by an
187
- open task in a DIFFERENT root (a cross-goal ordering edge) -- that is not a cycle, do
188
- NOT remove the edge. (A bare `bd ready` is NOT a valid substitute -- it returns
189
- project-wide results and will show unrelated ready work even when your entire sprint
190
- scope is deadlocked.)
239
+ 1. The COMBINED `--ready` list across all sprint roots must be non-empty whenever open
240
+ work exists anywhere in scope; if empty, there is a cycle -- find and break it before
241
+ finishing. A SINGLE root with an empty `--ready` list is FINE when its open tasks are
242
+ blocked by an open task in a DIFFERENT root (cross-goal ordering, not a cycle -- do
243
+ NOT remove the edge). Bare `bd ready` is NOT a substitute -- it shows unrelated
244
+ project-wide work even when your entire scope is deadlocked.
191
245
  2. A feature/task must NEVER have a `blocks` edge to or from its own `--parent`
192
246
  ancestor/descendant -- see the graph-semantics section above. Only `parent-child` edges
193
247
  (via `--parent`) should exist between a bead and its parent; `blocks` edges belong only
@@ -208,6 +262,9 @@ Also check each open feature:
208
262
  - Every task has a model tier set via `--metadata '{"model": "..."}'` (see Step 3)?
209
263
  - Every task carries `streak` and `streakOrder` lane metadata (see Step 3)? Impl/test
210
264
  pairs and mutex-resource members co-laned, and no lane's effort exceeds the threshold?
265
+ - Where `kb_stats` backed a model tier choice, does the task description cite the
266
+ coverage number (see Step 3)? Not required for tiers set on qualitative KB signals
267
+ alone or when `kb_stats` was unavailable.
211
268
 
212
269
  Fix any gaps, then confirm you are done.
213
270
 
@@ -221,10 +278,24 @@ If features and tasks already exist in beads from a prior planning pass:
221
278
 
222
279
  ## Output schema
223
280
 
224
- `planner` has no structured output contract -- its output IS the beads DAG (issues,
225
- acceptance criteria, model-tier metadata, dependency edges), which `plan-reviewer`
226
- evaluates against its own Output schema (see `plan-reviewer.md` and its sibling
227
- `agents/schemas/plan-reviewer-output.json`).
281
+ Your PRIMARY output is the beads DAG (issues, acceptance criteria, model-tier metadata,
282
+ dependency edges), which `plan-reviewer` evaluates against its own Output schema (see
283
+ `plan-reviewer.md` and its sibling `agents/schemas/plan-reviewer-output.json`).
284
+
285
+ In addition, return a structured result matching the sibling file
286
+ `agents/schemas/planner-output.json`: `status` (`OK` or `BLOCKED`), `notes`, the
287
+ `featureIds`/`taskIds` you created or updated this round, and an optional `kb_captures`
288
+ array (see Step 0.4 -- omit or send `[]` to capture nothing). Example instance:
289
+
290
+ ```json
291
+ {
292
+ "status": "OK",
293
+ "notes": "Created 2 features, 6 tasks across 3 streak lanes.",
294
+ "featureIds": ["BD-20", "BD-21"],
295
+ "taskIds": ["BD-22", "BD-23", "BD-24", "BD-25", "BD-26", "BD-27"],
296
+ "kb_captures": []
297
+ }
298
+ ```
228
299
 
229
300
  ## Rules
230
301