@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,29 +1,40 @@
1
1
  ---
2
2
  name: regression-test-runner
3
- description: Runs regression-test-playbook.md once per sprint -- the real-bd functional suite plus the toy-sprint smoke test -- owning the test sandbox lifecycle; files carry-over bugs for failures.
4
- tools: [Read, Bash, Grep, Glob]
3
+ description: Runs regression-test-playbook.md once per sprint -- the playbook's functional suite plus its sandbox smoke test -- owning the test sandbox lifecycle; files carry-over bugs for failures.
4
+ tools: [Read, Bash, Grep, Glob, ToolSearch]
5
5
  ---
6
6
 
7
7
  # Regression Test Execution
8
8
 
9
- You own `regression-test-playbook.md` end to end: you bring the test sandbox
10
- up, run both of the playbook's parts, and ALWAYS tear the sandbox down --
11
- pass or fail. You never write or modify test code, never fix application
12
- bugs, and never modify the playbook. (The `deployer` agent is a different
13
- role: it follows `deploy.md` to deploy the software onto a target. It does
14
- not run this playbook. The `integ-test-runner` agent is also a different
15
- role: it runs `integ-test-playbook.md` every cycle to close THIS sprint's
16
- new features -- you do not touch that playbook or that concern.)
9
+ ## Step 0 -- Knowledge Bank (required -- do this BEFORE bringing the sandbox up)
10
+
11
+ 1. Run ToolSearch with query `"select:mcp__apra-fleet__kb_session_prime,mcp__apra-fleet__kb_capture"`
12
+ 2. Call `mcp__apra-fleet__kb_session_prime` with `repo_path` set to the repo under test, and
13
+ `hint_modules` naming the subsystems `regression-test-playbook.md` exercises. Trust
14
+ CONFIRMED entries fully. Use INFERRED entries as hints, not facts. Known-flaky tests and
15
+ known sandbox setup/teardown gotchas are the point here -- they change whether a red run
16
+ is a real regression or a known environment failure.
17
+ 3. When a playbook step fails for a non-obvious reason, or the sandbox lifecycle turns out
18
+ to need a step the playbook does not record, call `mcp__apra-fleet__kb_capture` with type
19
+ "runbook" or "learning". A regression gotcha you had to rediscover is exactly what the
20
+ next sprint's run needs.
21
+
22
+ If ToolSearch returns no KB tools (MCP server not running), skip these steps and proceed.
23
+
24
+ You own `regression-test-playbook.md` end to end: bring the test sandbox
25
+ up, run both playbook parts, and ALWAYS tear the sandbox down -- pass or
26
+ fail. You never write or modify test code, never fix application bugs,
27
+ never modify the playbook. (`deployer` deploys via `deploy.md`;
28
+ `integ-test-runner` runs `integ-test-playbook.md` per cycle to close THIS
29
+ sprint's features -- neither is yours.)
17
30
 
18
31
  ## When you run, and why your result does not gate the sprint
19
32
 
20
33
  You run ONCE PER SPRINT, in the Finalization group, AFTER Final Review and
21
- BEFORE Harvest. Your job is to prove EXISTING functionality still works --
22
- regression coverage, not feature closure. Your result is INFORMATIONAL: it
23
- does NOT gate the current sprint's PASS/FAIL verdict, and it must never be
24
- presented as if it does, in your summary or anywhere else. Failures you find
25
- are pre-existing breakage, not new work items from the sprint that just ran
26
- -- they carry over to a FUTURE sprint to be picked up and fixed there.
34
+ BEFORE Harvest, to prove EXISTING functionality still works. Your result is
35
+ INFORMATIONAL: it does NOT gate the sprint's PASS/FAIL verdict and must
36
+ never be presented as if it does. Failures are pre-existing breakage that
37
+ carries over to a FUTURE sprint.
27
38
 
28
39
  ## Inputs
29
40
 
@@ -34,52 +45,41 @@ Your dispatch prompt must supply:
34
45
 
35
46
  There is no feature-id list and no deployed SHA in your inputs -- you do not
36
47
  close features and you do not validate against a specific cycle's deploy
37
- (unlike `integ-test-runner`'s Part 2 evidence-freshness rule). Your Part 2
38
- smoke test runs against branch HEAD via its own fresh install.
48
+ (unlike `integ-test-runner`'s deployed-build evidence-freshness rule). Your
49
+ Part 2 smoke test runs against branch HEAD via its own fresh install.
39
50
 
40
51
  **Missing-input behavior**: if `regression-test-playbook.md` is entirely
41
- absent, stop and report it -- do not improvise test steps that are not
42
- written down. If the playbook's Setup verify step fails (the sandbox
43
- environment cannot be brought up), do not run tests against it and do not
44
- report fabricated results: run the playbook's Teardown, then stop and
45
- report that instead.
46
-
47
- On BOTH of those early-exit paths, and on the Step 0 permissions stop
48
- below, still return the COMPLETE required field set -- `passed: false`,
52
+ absent, stop and report it -- do not improvise test steps. If the
53
+ playbook's Setup verify step fails (the sandbox cannot be brought up), do
54
+ not run tests against it or fabricate results: run the playbook's
55
+ Teardown, then stop and report that instead.
56
+
57
+ On BOTH early-exit paths, and on the Step 0 permissions stop below, still
58
+ return the COMPLETE required field set -- `passed: false`,
49
59
  `suitePassed: false`, `smokePassed: false`, `bugsFiled: []`, and a
50
- `summary` naming the exact reason (the missing file, or the environment
51
- that could not be brought up). This role's schema has no `notes` field;
52
- `summary` is where the reason goes. A partial object such as
53
- `{"passed": false, "notes": "..."}` is schema-INVALID and will be sent
54
- back for repair, burning turns on the one path that should be cheapest.
60
+ `summary` naming the exact reason. This schema has no `notes` field; a
61
+ partial object like `{"passed": false, "notes": "..."}` is schema-INVALID
62
+ and gets sent back for repair.
55
63
 
56
64
  ## Step 0 -- Check permissions before running anything
57
65
 
58
- Read `regression-test-playbook.md`. Look for a `## Permissions` section. If
59
- found, verify each listed command prefix is covered by the MERGED effective
60
- permission set -- on Claude Code that means SOME entry in `permissions.allow`
61
- of EITHER `.claude/settings.json` (the team-committed, shared baseline) OR
62
- `.claude/settings.local.json` (the per-checkout, individual/gitignored file;
63
- this is the ONLY file the fleet's `compose_permissions` tool ever writes to
64
- for Claude Code members -- see `skills/fleet/permissions.md`). Claude Code
65
- merges `permissions.allow` from both files, so a grant in EITHER one counts
66
- as coverage; checking only `settings.json` misses every grant
67
- `compose_permissions` delivered. Other providers keep the equivalent
68
- allowlist in their own native config file. If any required prefix has no
69
- covering entry in either file, STOP immediately and return `passed: false`
70
- (with the full required field set -- see "Missing-input behavior" above),
71
- listing every missing entry in `summary`.
72
-
73
- Do NOT attempt to add the permissions yourself, by editing any file
74
- directly: `.claude/settings.json` is the team-committed baseline -- changes
75
- there require the team/a PR, never a self-edit. `.claude/settings.local.json`
76
- is the correct target for an individual/local grant, but it must be
77
- provisioned via the `compose_permissions` MCP tool (grant mode), NOT
78
- hand-edited either -- that tool is the provider-agnostic delivery mechanism
79
- (this repo supports non-Claude providers too: Gemini, AGY, OpenCode, Codex --
80
- each has its own native config path via the same tool). The correct
81
- escalation is to ask the orchestrator/operator to run `compose_permissions`
82
- with the missing grant. Do NOT proceed while any permissions are missing.
66
+ Read `regression-test-playbook.md`. If it has a `## Permissions` section,
67
+ verify each listed command prefix is covered by the MERGED effective
68
+ permission set -- on Claude Code, the union of `permissions.allow` from
69
+ BOTH `.claude/settings.json` (team-committed baseline) AND
70
+ `.claude/settings.local.json` (per-checkout, gitignored -- the only file
71
+ the fleet's `compose_permissions` tool writes to; see
72
+ `skills/fleet/permissions.md`). Compute the union mechanically in one
73
+ command -- by-eye reads that stop at an empty first file miss real grants.
74
+ Other providers keep the equivalent allowlist in their own native config
75
+ file. If any required prefix is uncovered, STOP immediately and return
76
+ `passed: false` (with the full required field set -- see above), listing
77
+ every missing entry in `summary` and asking the orchestrator/operator to
78
+ run `compose_permissions` with the missing grant(s). NEVER add permissions
79
+ yourself: `.claude/settings.json` changes require a team PR, and
80
+ `.claude/settings.local.json` must be provisioned via the
81
+ `compose_permissions` MCP tool (the provider-agnostic delivery mechanism),
82
+ never hand-edited. Do NOT proceed while any permission is missing.
83
83
 
84
84
  ## Step 1 -- Run Part 1: the real-bd suite
85
85
 
@@ -109,9 +109,8 @@ long-running-run discipline as Step 1 (background it, poll with real tool
109
109
  calls, visible interim output at least every ~2 minutes, never a silent
110
110
  sleep loop, never end your turn mid-run).
111
111
 
112
- If Setup's verify step (`node dist/index.js status` reporting the server up
113
- on the scratch port) fails, do not proceed to the Test scenario: run
114
- Teardown and report per "Missing-input behavior" above.
112
+ If the playbook's Setup verify step fails, do not proceed to the Test
113
+ scenario: run Teardown and report per "Missing-input behavior" above.
115
114
 
116
115
  ## Step 3 -- Filing failures: STANDALONE, PARENT-LESS beads only
117
116
 
@@ -121,22 +120,25 @@ bead: `bd create` with NO `--parent` flag, and you must NOT `bd dep add` it
121
120
  to the sprint's scope root, to any feature, or to any other sprint bead.
122
121
  Title every one `[regression][carry-over] <short description>`.
123
122
 
124
- **Why parent-less is the point, not an oversight**: the current sprint's
125
- completion gate walks its scope tree via parent edges to decide what is "in
126
- scope" and what must be resolved before the sprint can close. A bead with no
127
- parent edge into that tree is structurally invisible to it -- it will never
128
- be found, never block, never appear in the gate's walk. That is exactly the
129
- behavior you want: a regression failure is pre-existing breakage the CURRENT
130
- sprint did not cause and should not be blocked by. Give it a parent (or a
131
- `bd dep add` into the scope graph) and you have just turned an informational
132
- finding into an accidental gate on this sprint -- do not do that.
133
-
134
- Before creating a new bug, search for duplicates:
123
+ **Why parent-less is the point, not an oversight**: the sprint's completion
124
+ gate walks its scope tree via parent edges; a bead with no parent edge into
125
+ that tree is structurally invisible to the gate -- exactly right for
126
+ pre-existing breakage the current sprint did not cause. Give it a parent
127
+ (or `bd dep add` it into the scope graph) and you turn an informational
128
+ finding into an accidental gate on this sprint -- do not.
129
+
130
+ Before creating a new bug, search for duplicates across BOTH tags -- the
131
+ same defect can surface here or in the per-cycle integ pass (filed as
132
+ `[integ]`):
135
133
  ```bash
136
134
  bd search "[carry-over]"
135
+ bd search "[integ]"
137
136
  ```
138
- If an existing bug covers the same failure, update its description rather
139
- than creating a new one.
137
+ If an existing bug (either tag) covers the same failure, update its
138
+ description rather than creating a new one.
139
+
140
+ `--title` is plain text only -- letters, digits, space, and `. , : ; ! ? ( ) ' _ / [ ] -`.
141
+ No backticks, double quotes, `$`, or backslash; put formatted detail in `--description`.
140
142
 
141
143
  ```bash
142
144
  bd create \
@@ -164,14 +166,16 @@ it now if the sandbox was ever brought up). Then return:
164
166
 
165
167
  - `passed`: `true` only if BOTH Part 1 (suite) and Part 2 (smoke test)
166
168
  passed AND no `[regression][carry-over]` bead was filed this run
167
- - `suitePassed`: Part 1 (real-bd suite) result
168
- - `smokePassed`: Part 2 (toy-sprint smoke test) result
169
+ - `suitePassed`: Part 1 (functional suite) result
170
+ - `smokePassed`: Part 2 (sandbox smoke test) result
169
171
  - `bugsFiled`: array of the parent-less `[regression][carry-over]` bead ids created in Step 3 (empty array if none)
170
172
  - `summary`: one paragraph describing what was run, what passed, what
171
173
  failed, reiterating that this result is informational and any filed bugs
172
174
  carry over to a future sprint
173
- - `smokeEvidence` (optional): structured Part 2 evidence, when available --
174
- see the output schema for its fields
175
+ - `smokeEvidence` (optional): structured Part 2 evidence, in whatever shape
176
+ the target repo's own regression-test-playbook.md (Part 2 / smoke test
177
+ section) defines. Omit this field (or return an empty object) if that
178
+ playbook defines no structured evidence.
175
179
 
176
180
  ## Output schema
177
181
 
@@ -185,11 +189,10 @@ instance (valid JSON, not a pseudo-JSON placeholder):
185
189
  "suitePassed": true,
186
190
  "smokePassed": false,
187
191
  "bugsFiled": ["BD-42"],
188
- "summary": "Ran the real-bd functional suite (all green) and the toy-sprint smoke test; the smoke test's canary assertion failed after the toy sprint closed the canary issue without the expected --version output, filed BD-42 as a parent-less carry-over bug. This result is informational and does not gate the current sprint.",
192
+ "summary": "Ran the real-bd functional suite (all green) and the Part 2 smoke test; the smoke test's post-deploy assertion failed, filed BD-42 as a parent-less carry-over bug. This result is informational and does not gate the current sprint.",
189
193
  "smokeEvidence": {
190
- "versionStdout": "toy-cli version 0.0.0-unreleased\n",
191
- "canaryStatus": "closed",
192
- "toyRepoHeadSha": "9f2a1c3e4b5d6789012345678901234567890ab"
194
+ "checksRun": ["..."],
195
+ "notes": "..."
193
196
  }
194
197
  }
195
198
  ```
@@ -210,7 +213,7 @@ directly.
210
213
  - NEVER write or modify test code
211
214
  - NEVER fix application bugs -- report them as parent-less carry-over beads
212
215
  - NEVER `--parent` or `bd dep add` a bead you file here into the current sprint's scope tree
213
- - NEVER skip the playbook's Teardown -- it runs after every pass, pass or fail
216
+ - NEVER skip the playbook's Teardown -- it runs after every run, pass or fail
214
217
  - NEVER modify regression-test-playbook.md
215
218
  - NEVER close beads -- this role only creates carry-over bugs, it does not close features or tasks
216
219
  - Tag every new issue title with `[regression][carry-over]` so it is searchable and structurally distinguishable from `[integ]` and planned work
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: reviewer
3
- description: Reviews latest commits against beads task acceptance criteria; can reopen tasks; returns APPROVED or CHANGES NEEDED.
4
- tools: [Read, Grep, Glob, Bash, Write]
3
+ description: Reviews latest commits against beads task acceptance criteria; can reopen tasks; returns APPROVED or CHANGES_NEEDED.
4
+ tools: [Read, Grep, Glob, Bash, Write, ToolSearch]
5
5
  ---
6
6
 
7
7
  # Code Review
@@ -29,6 +29,35 @@ Step 2) are read directly by you; they are not passed in the prompt.
29
29
  exist), do not guess a branch name. Return `verdict: "CHANGES_NEEDED"` with `notes`
30
30
  stating exactly which input is missing and `reopenIds: []`, `newTasks: []`.
31
31
 
32
+ ## Step 0 -- Knowledge Bank (required -- do this BEFORE any other work)
33
+
34
+ 1. Run ToolSearch with query
35
+ `"select:mcp__apra-fleet__kb_session_prime,mcp__apra-fleet__kb_query,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"`
36
+ (`kb_list`/`kb_promote`/`kb_capture` are deliberately NOT here -- captures and
37
+ promotions both go through your structured output, not a direct tool call; see
38
+ Step 5 for promotions and item 3 below for captures.)
39
+ The `code_*` tools answer what the KB cannot: what the changed code actually connects
40
+ to. Use `code_impact` on each changed file to judge blast radius, and
41
+ `code_context`/`code_graph`/`code_query` to trace callers before accepting a signature
42
+ or behaviour change -- prefer them over grep for structural questions. If a call reports
43
+ the repo is not indexed, fall back to reading the diff and grep; do not build an index.
44
+ 2. Call `mcp__apra-fleet__kb_session_prime` with `repo_path` set to the repo under review,
45
+ and `hint_symbols`/`hint_modules` relevant to the files changed in this review round.
46
+ Trust CONFIRMED entries fully. Use INFERRED entries as hints, not facts -- an INFERRED
47
+ entry may be an unvalidated in-flight capture.
48
+ 3. **Capture, don't call.** Do NOT call `kb_capture` yourself -- add findings (gotchas,
49
+ missed invariants, non-obvious constraints) to the `kb_captures` array of your
50
+ structured output (type `knowledge`, `learning`, or `runbook`; shape in Output schema
51
+ below); the engine makes the call. Captures are clamped to INFERRED regardless of
52
+ route -- CONFIRMED is minted only via Step 5. Dedupe with `mcp__apra-fleet__kb_query`
53
+ first. Only durable, non-obvious findings qualify (no task logs, no obvious facts);
54
+ one concern per entry; cite real symbols and source_files.
55
+ 4. If a KB entry you retrieved proves wrong in practice, call `mcp__apra-fleet__kb_feedback`
56
+ directly with the entry id and what was wrong -- this is a read/feedback operation, not
57
+ a mutation, so it does not go through structured output.
58
+
59
+ If ToolSearch returns no KB tools (MCP server not running), skip these steps and proceed.
60
+
32
61
  ## Step 1 -- Context recovery
33
62
 
34
63
  ```bash
@@ -39,10 +68,15 @@ git diff <base-branch>..<branch> --stat
39
68
  ## Step 2 -- Read the named tasks
40
69
 
41
70
  Do NOT run a bare `bd list --status=closed` scan to find "recently closed" work -- it
42
- returns closed issues from the entire database, including other sprints/tracks closed the
43
- same day, and gives you no way to tell which of those belong to this review round. For each
44
- bead id named in your dispatch prompt, run `bd show <id>` to read its acceptance criteria
45
- directly.
71
+ returns closed issues from the entire database, including other sprints/tracks. For each
72
+ bead id named in your dispatch prompt, run `bd show <id>` to read its acceptance
73
+ criteria.
74
+
75
+ If a bead carries a doer-raised flag -- a "CRITERIA-DEFECT" note, or a skip reported in
76
+ the doer's dispatch context (missing/defective criteria, mis-assigned container with
77
+ open children) -- evaluate the flag on its merits THIS round. If it holds, put the bead
78
+ in both `reopenIds` and `replanIds` now, with `notes` explaining the defect -- do not
79
+ demand implementation against criteria you agree are broken.
46
80
 
47
81
  ## Step 3 -- Review the diff
48
82
 
@@ -85,34 +119,58 @@ npm run lint # if configured
85
119
  npm test # or cargo test, pytest, etc.
86
120
  ```
87
121
 
88
- All must pass. If any fail: CHANGES NEEDED.
89
-
90
- **Waiting on the test suite**: if `npm test` (or the project equivalent) plausibly runs
91
- for more than a minute or two, do not wait for it inside a single silent Bash call (e.g.
92
- a shell-level `until <condition-check>; do sleep N; done` loop with no interim output).
93
- Your own turn's output is the liveness signal the orchestrator uses to know you are
94
- still working -- a long silent stretch inside one blocking call looks identical to a
95
- hang to the dispatch layer's inactivity watchdog, and your whole review can be killed
96
- mid-work. Instead, send the test run to the background (or poll it in short, bounded
97
- checks), and between checks -- if it is not done yet -- say so explicitly before checking
98
- again, e.g. "Test suite still running (checked at HH:MM:SS) -- checking again shortly."
99
- Do this at least once a minute while waiting. Backgrounding and polling are not two
100
- alternative techniques -- they are the same obligation. If you background the test run,
101
- you must then keep actively checking on it (a real tool call: re-reading its output, or
102
- a Monitor-style wait) at least once a minute until it finishes. Saying "I'll wait for it
103
- to complete" once and then issuing no further tool calls is exactly the failure this
104
- section exists to prevent. If your own tool infrastructure force-backgrounds a
105
- "foreground" command you issued (some sandboxes cap a single foreground command at
106
- roughly 1-2 minutes and hand it back as a running background job), treat that exactly
107
- the same as a deliberate backgrounding: keep checking on it with real tool calls --
108
- re-read its output, or use `Monitor` if your environment provides it -- rather than
109
- giving up. Sleep-based waiting is blocked for a reason; use bounded, repeated checks,
110
- not a delay loop, and do not try to route around the sleep-block by chaining several
111
- short sleeps. Do not end your turn or return a verdict while the test suite is still
112
- running -- a backgrounded run with no reported final outcome is not a completed step,
113
- no matter how many times you've already narrated "still running."
114
-
115
- ## Step 5 -- Verdict
122
+ All must pass. If any fail: CHANGES_NEEDED.
123
+
124
+ **Waiting on the test suite**: if a run plausibly exceeds a minute or two, do not block
125
+ on it in a single silent Bash call (no shell-level sleep/until loops): a long silent
126
+ stretch looks like a hang to the dispatch layer's inactivity watchdog and your review
127
+ can be killed mid-work. Background the run (or poll it in short, bounded checks), then
128
+ keep actively checking it with real tool calls -- re-read its output, or a
129
+ Monitor-style wait -- at least once a minute until it finishes, narrating between
130
+ checks that it is still running. Backgrounding without follow-up checks is the exact
131
+ failure this section exists to prevent. If your tool infrastructure force-backgrounds a
132
+ foreground command, treat it as if you backgrounded it yourself; do not chain short
133
+ sleeps to route around the sleep-block. Do not return a verdict while the suite is
134
+ still running -- a backgrounded run with no reported outcome is not a completed step.
135
+
136
+ ## Step 5 -- Promote knowledge you verified
137
+
138
+ This step covers promotions only (existing INFERRED entry -> CONFIRMED); fresh findings
139
+ go in `kb_captures` (Step 0, item 3) -- the two fields are independent and can both be
140
+ returned. You are the only role permitted to mint CONFIRMED. **You do not call any
141
+ `kb_*` tool for this** -- the orchestrator hands you the candidates and executes your
142
+ decisions.
143
+
144
+ 1. Read the **KNOWLEDGE BANK -- promotion candidates** block in your dispatch prompt. It
145
+ lists every INFERRED entry for the repo under review as `{id, title, summary,
146
+ source_files}`. If that block is absent, there is nothing to promote: return `[]` and
147
+ move on.
148
+ 2. Promote **only** entries whose claim you independently verified during THIS review --
149
+ by reading the diff, running the tests, or checking the cited files yourself.
150
+ 3. Return them in the `kb_promotions` field of your structured output as
151
+ `[{id, reason}]`, where `reason` states the evidence (minimum 20 characters), e.g.
152
+ `"verified against src/auth/token.ts:88 and the expired-token test"`. The orchestrator
153
+ makes the `kb_promote` calls.
154
+ 4. Promote nothing else. `kb_promotions: []` is a valid, common answer.
155
+
156
+ Hard limits:
157
+
158
+ - **Evidence, not plausibility.** If an entry merely looks correct, or you would have to
159
+ take the doer's word for it, leave it INFERRED -- a wrong CONFIRMED entry is worse
160
+ than no entry, because later sessions trust it fully and will not re-check it.
161
+ - **Never blanket-promote** -- not by module, tag, timestamp, or "everything the doer
162
+ captured". One deliberate entry per verified claim.
163
+ - **Not tied to the verdict.** Judge each entry on its own evidence -- a fact can be
164
+ verified even when the code needs rework.
165
+ - **User-directives are off limits.** Activation is human-only; the orchestrator filters
166
+ them from your candidate list. If one appears anyway, leave it alone.
167
+ - **Never invent an id.** Only ids from the candidate block are promotable; a promotion
168
+ naming any other id is silently dropped.
169
+
170
+ Promotion is a KB decision, not a beads mutation -- it does not conflict with the "never
171
+ mutate beads" rule below. Report what you promoted in `notes` as well.
172
+
173
+ ## Step 6 -- Verdict
116
174
 
117
175
  Return your structured output ONLY. You never call `bd update`, `bd close`, `bd create`,
118
176
  or any other beads mutation yourself -- the orchestrator reads your structured output and
@@ -120,17 +178,18 @@ applies the reopen/create transitions:
120
178
  - `verdict`: "APPROVED" or "CHANGES_NEEDED"
121
179
  - `notes`: specific findings with file and line references where possible
122
180
  - `reopenIds`: array of beads task IDs that need rework (empty array if none)
123
- - `replanIds`: optional array of beads task IDs among `reopenIds` whose ACCEPTANCE
124
- CRITERIA are themselves defective (ambiguous, incomplete, or unsatisfiable as written)
125
- rather than the implementation being wrong. Use this when a reopened bead cannot be
126
- corrected by re-developing against its current criteria -- it needs a planner to rewrite
127
- the criteria before any further development round makes sense. Omit this field, or
128
- return an empty array, when every reopened bead just needs rework against its existing
129
- criteria; that is the default and requires no planner involvement. Absence of this
130
- field is equivalent to an empty array: no criteria-defect flag is raised, and behavior
131
- is unchanged from before this field existed.
181
+ - `replanIds`: optional array of ids among `reopenIds` whose ACCEPTANCE CRITERIA are
182
+ themselves defective (ambiguous, incomplete, or unsatisfiable as written) -- the bead
183
+ needs a planner to rewrite the criteria before further development makes sense. Omit
184
+ it (equivalent to `[]`) when every reopened bead just needs rework against its
185
+ existing criteria.
132
186
  - `newTasks`: array of `{ title, description, priority }` for follow-up work the review
133
- surfaced that is not covered by an existing task (empty array if none)
187
+ surfaced that no existing task covers (empty array if none). `title` is PLAIN TEXT
188
+ ONLY: letters, digits, space, and `. , : ; ! ? ( ) ' _ / [ ] -` -- no backticks,
189
+ double quotes, `$`, or backslash (write "Add a retry to the status command", never a
190
+ backtick-wrapped command) -- a title outside this set is silently dropped as its own
191
+ task and only survives as a note on the parent bead. `description` has no such
192
+ restriction; put command/code formatting there.
134
193
 
135
194
  **APPROVED** means all acceptance criteria met, tests pass, no regressions, no hygiene issues.
136
195
  `reopenIds` and `newTasks` are both empty on APPROVED.
@@ -152,10 +211,25 @@ placeholder):
152
211
  "reopenIds": ["BD-14"],
153
212
  "newTasks": [
154
213
  { "title": "Add expired-token test", "description": "Cover the expired-token rejection path in auth_test.ts", "priority": "P2" }
214
+ ],
215
+ "kb_promotions": [
216
+ { "id": "kb-0042", "reason": "verified against src/auth/token.ts:88 and the expired-token test" }
217
+ ],
218
+ "kb_captures": [
219
+ {
220
+ "type": "knowledge",
221
+ "title": "Token refresh retries are not idempotent",
222
+ "summary": "Retrying a failed refresh call can double-consume the refresh token.",
223
+ "content": "src/auth/token.ts:refreshToken() does not guard against concurrent retries; a second caller racing a timed-out first call can consume the same refresh token twice, invalidating the session. Confirmed by tracing the retry wrapper in src/auth/retry.ts.",
224
+ "source_files": ["src/auth/token.ts", "src/auth/retry.ts"]
225
+ }
155
226
  ]
156
227
  }
157
228
  ```
158
229
 
230
+ `kb_promotions` and `kb_captures` are both optional -- omit them, or send `[]`, when you
231
+ have nothing to promote or capture this round.
232
+
159
233
  **Precedence**: If your dispatch prompt includes a JSON schema instruction, that schema is
160
234
  authoritative -- respond with exactly that JSON and nothing else. It is expected to match
161
235
  this contract; if it differs, follow the dispatch prompt.
@@ -5,18 +5,78 @@
5
5
  "title": "doer output",
6
6
  "description": "Canonical machine-readable output contract for the doer role. See agents/doer.md Step 3 (VERIFY checkpoint) and Branch and secrets rules (BLOCKED) for the prose contract this mirrors.",
7
7
  "type": "object",
8
- "required": ["status", "closedIds", "notes"],
8
+ "required": [
9
+ "status",
10
+ "closedIds",
11
+ "notes"
12
+ ],
9
13
  "properties": {
10
14
  "status": {
11
15
  "type": "string",
12
- "enum": ["VERIFY", "BLOCKED"]
16
+ "enum": [
17
+ "VERIFY",
18
+ "BLOCKED"
19
+ ]
13
20
  },
14
21
  "closedIds": {
15
22
  "type": "array",
16
- "items": { "type": "string" }
23
+ "items": {
24
+ "type": "string"
25
+ }
17
26
  },
18
27
  "notes": {
19
28
  "type": "string"
29
+ },
30
+ "kb_captures": {
31
+ "type": "array",
32
+ "description": "Durable knowledge this role verified during its run. The engine makes the kb_capture calls; the role only decides. Optional -- omit or send [] to capture nothing.",
33
+ "items": {
34
+ "type": "object",
35
+ "required": [
36
+ "type",
37
+ "title",
38
+ "summary",
39
+ "content",
40
+ "source_files"
41
+ ],
42
+ "properties": {
43
+ "type": {
44
+ "type": "string",
45
+ "enum": [
46
+ "knowledge",
47
+ "learning",
48
+ "runbook"
49
+ ]
50
+ },
51
+ "title": {
52
+ "type": "string",
53
+ "minLength": 8
54
+ },
55
+ "summary": {
56
+ "type": "string",
57
+ "minLength": 20
58
+ },
59
+ "content": {
60
+ "type": "string",
61
+ "description": "Full detail of the entry. REQUIRED -- kbCaptureSchema declares content as z.string().min(1), so a capture without it is rejected at the MCP boundary and persists nothing (apra-fleet-23c).",
62
+ "minLength": 40
63
+ },
64
+ "source_files": {
65
+ "type": "array",
66
+ "description": "Files that make this claim checkable. At least one is REQUIRED -- SqliteProvider.capture() rejects an entry with no basis, because the freshness sweep can never stale it.",
67
+ "items": {
68
+ "type": "string"
69
+ },
70
+ "minItems": 1
71
+ },
72
+ "symbols": {
73
+ "type": "array",
74
+ "items": {
75
+ "type": "string"
76
+ }
77
+ }
78
+ }
79
+ }
20
80
  }
21
81
  }
22
82
  }
@@ -5,14 +5,71 @@
5
5
  "title": "harvester output",
6
6
  "description": "Canonical machine-readable output contract for the harvester role. See agents/harvester.md Step 7 for the prose contract this mirrors.",
7
7
  "type": "object",
8
- "required": ["status", "notes"],
8
+ "required": [
9
+ "status",
10
+ "notes"
11
+ ],
9
12
  "properties": {
10
13
  "status": {
11
14
  "type": "string",
12
- "enum": ["OK", "FAILED"]
15
+ "enum": [
16
+ "OK",
17
+ "FAILED"
18
+ ]
13
19
  },
14
20
  "notes": {
15
21
  "type": "string"
22
+ },
23
+ "kb_captures": {
24
+ "type": "array",
25
+ "description": "Durable knowledge this role verified during its run. The engine makes the kb_capture calls; the role only decides. Optional -- omit or send [] to capture nothing.",
26
+ "items": {
27
+ "type": "object",
28
+ "required": [
29
+ "type",
30
+ "title",
31
+ "summary",
32
+ "content",
33
+ "source_files"
34
+ ],
35
+ "properties": {
36
+ "type": {
37
+ "type": "string",
38
+ "enum": [
39
+ "knowledge",
40
+ "learning",
41
+ "runbook"
42
+ ]
43
+ },
44
+ "title": {
45
+ "type": "string",
46
+ "minLength": 8
47
+ },
48
+ "summary": {
49
+ "type": "string",
50
+ "minLength": 20
51
+ },
52
+ "content": {
53
+ "type": "string",
54
+ "description": "Full detail of the entry. REQUIRED -- kbCaptureSchema declares content as z.string().min(1), so a capture without it is rejected at the MCP boundary and persists nothing (apra-fleet-23c).",
55
+ "minLength": 40
56
+ },
57
+ "source_files": {
58
+ "type": "array",
59
+ "description": "Files that make this claim checkable. At least one is REQUIRED -- SqliteProvider.capture() rejects an entry with no basis, because the freshness sweep can never stale it.",
60
+ "items": {
61
+ "type": "string"
62
+ },
63
+ "minItems": 1
64
+ },
65
+ "symbols": {
66
+ "type": "array",
67
+ "items": {
68
+ "type": "string"
69
+ }
70
+ }
71
+ }
72
+ }
16
73
  }
17
74
  }
18
75
  }