agent-bober 0.11.6 → 0.15.0

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 (570) hide show
  1. package/CHANGELOG.md +311 -0
  2. package/README.md +124 -9
  3. package/agents/bober-architect.md +38 -0
  4. package/agents/bober-code-reviewer.md +236 -0
  5. package/agents/bober-curator.md +37 -0
  6. package/agents/bober-deployer.md +267 -0
  7. package/agents/bober-diagnoser.md +289 -0
  8. package/agents/bober-evaluator.md +127 -1
  9. package/agents/bober-generator.md +122 -3
  10. package/agents/bober-planner.md +293 -32
  11. package/agents/bober-postmortemer.md +185 -0
  12. package/agents/bober-researcher.md +38 -0
  13. package/dist/cli/commands/approve.d.ts +17 -0
  14. package/dist/cli/commands/approve.d.ts.map +1 -0
  15. package/dist/cli/commands/approve.js +64 -0
  16. package/dist/cli/commands/approve.js.map +1 -0
  17. package/dist/cli/commands/audit-show.d.ts +14 -0
  18. package/dist/cli/commands/audit-show.d.ts.map +1 -0
  19. package/dist/cli/commands/audit-show.js +85 -0
  20. package/dist/cli/commands/audit-show.js.map +1 -0
  21. package/dist/cli/commands/config.d.ts +10 -0
  22. package/dist/cli/commands/config.d.ts.map +1 -0
  23. package/dist/cli/commands/config.js +73 -0
  24. package/dist/cli/commands/config.js.map +1 -0
  25. package/dist/cli/commands/eval.js +6 -6
  26. package/dist/cli/commands/eval.js.map +1 -1
  27. package/dist/cli/commands/graph.d.ts +8 -0
  28. package/dist/cli/commands/graph.d.ts.map +1 -0
  29. package/dist/cli/commands/graph.js +219 -0
  30. package/dist/cli/commands/graph.js.map +1 -0
  31. package/dist/cli/commands/impact.d.ts +19 -0
  32. package/dist/cli/commands/impact.d.ts.map +1 -0
  33. package/dist/cli/commands/impact.js +191 -0
  34. package/dist/cli/commands/impact.js.map +1 -0
  35. package/dist/cli/commands/incident.d.ts +19 -0
  36. package/dist/cli/commands/incident.d.ts.map +1 -0
  37. package/dist/cli/commands/incident.js +324 -0
  38. package/dist/cli/commands/incident.js.map +1 -0
  39. package/dist/cli/commands/init.js +82 -3
  40. package/dist/cli/commands/init.js.map +1 -1
  41. package/dist/cli/commands/list-approvals.d.ts +16 -0
  42. package/dist/cli/commands/list-approvals.d.ts.map +1 -0
  43. package/dist/cli/commands/list-approvals.js +57 -0
  44. package/dist/cli/commands/list-approvals.js.map +1 -0
  45. package/dist/cli/commands/onboard.d.ts +3 -0
  46. package/dist/cli/commands/onboard.d.ts.map +1 -0
  47. package/dist/cli/commands/onboard.js +190 -0
  48. package/dist/cli/commands/onboard.js.map +1 -0
  49. package/dist/cli/commands/plan.d.ts +12 -0
  50. package/dist/cli/commands/plan.d.ts.map +1 -1
  51. package/dist/cli/commands/plan.js +232 -37
  52. package/dist/cli/commands/plan.js.map +1 -1
  53. package/dist/cli/commands/playbook.d.ts +17 -0
  54. package/dist/cli/commands/playbook.d.ts.map +1 -0
  55. package/dist/cli/commands/playbook.js +123 -0
  56. package/dist/cli/commands/playbook.js.map +1 -0
  57. package/dist/cli/commands/postmortem.d.ts +12 -0
  58. package/dist/cli/commands/postmortem.d.ts.map +1 -0
  59. package/dist/cli/commands/postmortem.js +67 -0
  60. package/dist/cli/commands/postmortem.js.map +1 -0
  61. package/dist/cli/commands/reject.d.ts +17 -0
  62. package/dist/cli/commands/reject.d.ts.map +1 -0
  63. package/dist/cli/commands/reject.js +52 -0
  64. package/dist/cli/commands/reject.js.map +1 -0
  65. package/dist/cli/commands/rollback.d.ts +21 -0
  66. package/dist/cli/commands/rollback.d.ts.map +1 -0
  67. package/dist/cli/commands/rollback.js +90 -0
  68. package/dist/cli/commands/rollback.js.map +1 -0
  69. package/dist/cli/commands/run.d.ts +9 -0
  70. package/dist/cli/commands/run.d.ts.map +1 -1
  71. package/dist/cli/commands/run.js +31 -2
  72. package/dist/cli/commands/run.js.map +1 -1
  73. package/dist/cli/commands/sprint.d.ts.map +1 -1
  74. package/dist/cli/commands/sprint.js +8 -8
  75. package/dist/cli/commands/sprint.js.map +1 -1
  76. package/dist/cli/commands/telemetry.d.ts +16 -0
  77. package/dist/cli/commands/telemetry.d.ts.map +1 -0
  78. package/dist/cli/commands/telemetry.js +152 -0
  79. package/dist/cli/commands/telemetry.js.map +1 -0
  80. package/dist/cli/commands/worktree.d.ts +12 -0
  81. package/dist/cli/commands/worktree.d.ts.map +1 -0
  82. package/dist/cli/commands/worktree.js +57 -0
  83. package/dist/cli/commands/worktree.js.map +1 -0
  84. package/dist/cli/index.js +73 -2
  85. package/dist/cli/index.js.map +1 -1
  86. package/dist/config/defaults.d.ts.map +1 -1
  87. package/dist/config/defaults.js +27 -0
  88. package/dist/config/defaults.js.map +1 -1
  89. package/dist/config/index.d.ts +1 -1
  90. package/dist/config/index.d.ts.map +1 -1
  91. package/dist/config/index.js +4 -0
  92. package/dist/config/index.js.map +1 -1
  93. package/dist/config/loader.d.ts.map +1 -1
  94. package/dist/config/loader.js +18 -1
  95. package/dist/config/loader.js.map +1 -1
  96. package/dist/config/schema.d.ts +1016 -96
  97. package/dist/config/schema.d.ts.map +1 -1
  98. package/dist/config/schema.js +147 -0
  99. package/dist/config/schema.js.map +1 -1
  100. package/dist/contracts/eval-result.d.ts +38 -38
  101. package/dist/contracts/index.d.ts +2 -2
  102. package/dist/contracts/index.d.ts.map +1 -1
  103. package/dist/contracts/index.js +8 -4
  104. package/dist/contracts/index.js.map +1 -1
  105. package/dist/contracts/spec.d.ts +335 -40
  106. package/dist/contracts/spec.d.ts.map +1 -1
  107. package/dist/contracts/spec.js +210 -18
  108. package/dist/contracts/spec.js.map +1 -1
  109. package/dist/contracts/sprint-contract.d.ts +155 -88
  110. package/dist/contracts/sprint-contract.d.ts.map +1 -1
  111. package/dist/contracts/sprint-contract.js +176 -29
  112. package/dist/contracts/sprint-contract.js.map +1 -1
  113. package/dist/evaluators/builtin/api-check.js +1 -1
  114. package/dist/evaluators/builtin/api-check.js.map +1 -1
  115. package/dist/graph/artifact-store.d.ts +14 -0
  116. package/dist/graph/artifact-store.d.ts.map +1 -0
  117. package/dist/graph/artifact-store.js +100 -0
  118. package/dist/graph/artifact-store.js.map +1 -0
  119. package/dist/graph/cli.d.ts +49 -0
  120. package/dist/graph/cli.d.ts.map +1 -0
  121. package/dist/graph/cli.js +140 -0
  122. package/dist/graph/cli.js.map +1 -0
  123. package/dist/graph/client.d.ts +64 -0
  124. package/dist/graph/client.d.ts.map +1 -0
  125. package/dist/graph/client.js +216 -0
  126. package/dist/graph/client.js.map +1 -0
  127. package/dist/graph/fallback.d.ts +13 -0
  128. package/dist/graph/fallback.d.ts.map +1 -0
  129. package/dist/graph/fallback.js +57 -0
  130. package/dist/graph/fallback.js.map +1 -0
  131. package/dist/graph/hook-handler.d.ts +50 -0
  132. package/dist/graph/hook-handler.d.ts.map +1 -0
  133. package/dist/graph/hook-handler.js +217 -0
  134. package/dist/graph/hook-handler.js.map +1 -0
  135. package/dist/graph/incidents.d.ts +59 -0
  136. package/dist/graph/incidents.d.ts.map +1 -0
  137. package/dist/graph/incidents.js +22 -0
  138. package/dist/graph/incidents.js.map +1 -0
  139. package/dist/graph/mcp-client.d.ts +51 -0
  140. package/dist/graph/mcp-client.d.ts.map +1 -0
  141. package/dist/graph/mcp-client.js +285 -0
  142. package/dist/graph/mcp-client.js.map +1 -0
  143. package/dist/graph/onboarding-composer.d.ts +30 -0
  144. package/dist/graph/onboarding-composer.d.ts.map +1 -0
  145. package/dist/graph/onboarding-composer.js +275 -0
  146. package/dist/graph/onboarding-composer.js.map +1 -0
  147. package/dist/graph/pipeline-lifecycle.d.ts +86 -0
  148. package/dist/graph/pipeline-lifecycle.d.ts.map +1 -0
  149. package/dist/graph/pipeline-lifecycle.js +329 -0
  150. package/dist/graph/pipeline-lifecycle.js.map +1 -0
  151. package/dist/graph/preflight-budgets.d.ts +52 -0
  152. package/dist/graph/preflight-budgets.d.ts.map +1 -0
  153. package/dist/graph/preflight-budgets.js +78 -0
  154. package/dist/graph/preflight-budgets.js.map +1 -0
  155. package/dist/graph/preflight-injector.d.ts +116 -0
  156. package/dist/graph/preflight-injector.d.ts.map +1 -0
  157. package/dist/graph/preflight-injector.js +538 -0
  158. package/dist/graph/preflight-injector.js.map +1 -0
  159. package/dist/graph/prereq.d.ts +12 -0
  160. package/dist/graph/prereq.d.ts.map +1 -0
  161. package/dist/graph/prereq.js +61 -0
  162. package/dist/graph/prereq.js.map +1 -0
  163. package/dist/graph/prompts.d.ts +42 -0
  164. package/dist/graph/prompts.d.ts.map +1 -0
  165. package/dist/graph/prompts.js +80 -0
  166. package/dist/graph/prompts.js.map +1 -0
  167. package/dist/graph/sandbox.d.ts +19 -0
  168. package/dist/graph/sandbox.d.ts.map +1 -0
  169. package/dist/graph/sandbox.js +25 -0
  170. package/dist/graph/sandbox.js.map +1 -0
  171. package/dist/graph/token-usage.d.ts +21 -0
  172. package/dist/graph/token-usage.d.ts.map +1 -0
  173. package/dist/graph/token-usage.js +22 -0
  174. package/dist/graph/token-usage.js.map +1 -0
  175. package/dist/graph/types.d.ts +129 -0
  176. package/dist/graph/types.d.ts.map +1 -0
  177. package/dist/graph/types.js +12 -0
  178. package/dist/graph/types.js.map +1 -0
  179. package/dist/incident/orchestrator.d.ts +168 -0
  180. package/dist/incident/orchestrator.d.ts.map +1 -0
  181. package/dist/incident/orchestrator.js +279 -0
  182. package/dist/incident/orchestrator.js.map +1 -0
  183. package/dist/incident/playbook-search.d.ts +67 -0
  184. package/dist/incident/playbook-search.d.ts.map +1 -0
  185. package/dist/incident/playbook-search.js +288 -0
  186. package/dist/incident/playbook-search.js.map +1 -0
  187. package/dist/incident/postmortem.d.ts +44 -0
  188. package/dist/incident/postmortem.d.ts.map +1 -0
  189. package/dist/incident/postmortem.js +486 -0
  190. package/dist/incident/postmortem.js.map +1 -0
  191. package/dist/incident/resolution-verify.d.ts +186 -0
  192. package/dist/incident/resolution-verify.d.ts.map +1 -0
  193. package/dist/incident/resolution-verify.js +210 -0
  194. package/dist/incident/resolution-verify.js.map +1 -0
  195. package/dist/incident/rollback.d.ts +137 -0
  196. package/dist/incident/rollback.d.ts.map +1 -0
  197. package/dist/incident/rollback.js +328 -0
  198. package/dist/incident/rollback.js.map +1 -0
  199. package/dist/incident/timeline.d.ts +147 -0
  200. package/dist/incident/timeline.d.ts.map +1 -0
  201. package/dist/incident/timeline.js +452 -0
  202. package/dist/incident/timeline.js.map +1 -0
  203. package/dist/incident/types.d.ts +335 -0
  204. package/dist/incident/types.d.ts.map +1 -0
  205. package/dist/incident/types.js +158 -0
  206. package/dist/incident/types.js.map +1 -0
  207. package/dist/index.d.ts +3 -3
  208. package/dist/index.d.ts.map +1 -1
  209. package/dist/index.js +3 -3
  210. package/dist/index.js.map +1 -1
  211. package/dist/mcp/event-stream.d.ts +46 -0
  212. package/dist/mcp/event-stream.d.ts.map +1 -0
  213. package/dist/mcp/event-stream.js +421 -0
  214. package/dist/mcp/event-stream.js.map +1 -0
  215. package/dist/mcp/external-client.d.ts +38 -0
  216. package/dist/mcp/external-client.d.ts.map +1 -0
  217. package/dist/mcp/external-client.js +121 -0
  218. package/dist/mcp/external-client.js.map +1 -0
  219. package/dist/mcp/run-manager.d.ts +74 -9
  220. package/dist/mcp/run-manager.d.ts.map +1 -1
  221. package/dist/mcp/run-manager.js +127 -31
  222. package/dist/mcp/run-manager.js.map +1 -1
  223. package/dist/mcp/server.d.ts.map +1 -1
  224. package/dist/mcp/server.js +56 -0
  225. package/dist/mcp/server.js.map +1 -1
  226. package/dist/mcp/tools/abort-run.d.ts +2 -0
  227. package/dist/mcp/tools/abort-run.d.ts.map +1 -0
  228. package/dist/mcp/tools/abort-run.js +62 -0
  229. package/dist/mcp/tools/abort-run.js.map +1 -0
  230. package/dist/mcp/tools/anchor.js +1 -1
  231. package/dist/mcp/tools/anchor.js.map +1 -1
  232. package/dist/mcp/tools/approve-checkpoint.d.ts +2 -0
  233. package/dist/mcp/tools/approve-checkpoint.d.ts.map +1 -0
  234. package/dist/mcp/tools/approve-checkpoint.js +70 -0
  235. package/dist/mcp/tools/approve-checkpoint.js.map +1 -0
  236. package/dist/mcp/tools/brownfield.js +1 -1
  237. package/dist/mcp/tools/brownfield.js.map +1 -1
  238. package/dist/mcp/tools/contracts.js +2 -2
  239. package/dist/mcp/tools/contracts.js.map +1 -1
  240. package/dist/mcp/tools/eval.js +8 -8
  241. package/dist/mcp/tools/eval.js.map +1 -1
  242. package/dist/mcp/tools/get-project-state.d.ts +2 -0
  243. package/dist/mcp/tools/get-project-state.d.ts.map +1 -0
  244. package/dist/mcp/tools/get-project-state.js +107 -0
  245. package/dist/mcp/tools/get-project-state.js.map +1 -0
  246. package/dist/mcp/tools/get-run-status.d.ts +2 -0
  247. package/dist/mcp/tools/get-run-status.d.ts.map +1 -0
  248. package/dist/mcp/tools/get-run-status.js +40 -0
  249. package/dist/mcp/tools/get-run-status.js.map +1 -0
  250. package/dist/mcp/tools/graph-schemas.d.ts +100 -0
  251. package/dist/mcp/tools/graph-schemas.d.ts.map +1 -0
  252. package/dist/mcp/tools/graph-schemas.js +39 -0
  253. package/dist/mcp/tools/graph-schemas.js.map +1 -0
  254. package/dist/mcp/tools/graph.d.ts +19 -0
  255. package/dist/mcp/tools/graph.d.ts.map +1 -0
  256. package/dist/mcp/tools/graph.js +263 -0
  257. package/dist/mcp/tools/graph.js.map +1 -0
  258. package/dist/mcp/tools/incident.d.ts +2 -0
  259. package/dist/mcp/tools/incident.d.ts.map +1 -0
  260. package/dist/mcp/tools/incident.js +246 -0
  261. package/dist/mcp/tools/incident.js.map +1 -0
  262. package/dist/mcp/tools/index.d.ts +38 -18
  263. package/dist/mcp/tools/index.d.ts.map +1 -1
  264. package/dist/mcp/tools/index.js +74 -18
  265. package/dist/mcp/tools/index.js.map +1 -1
  266. package/dist/mcp/tools/list-active-runs.d.ts +2 -0
  267. package/dist/mcp/tools/list-active-runs.d.ts.map +1 -0
  268. package/dist/mcp/tools/list-active-runs.js +35 -0
  269. package/dist/mcp/tools/list-active-runs.js.map +1 -0
  270. package/dist/mcp/tools/list-pending-approvals.d.ts +2 -0
  271. package/dist/mcp/tools/list-pending-approvals.d.ts.map +1 -0
  272. package/dist/mcp/tools/list-pending-approvals.js +40 -0
  273. package/dist/mcp/tools/list-pending-approvals.js.map +1 -0
  274. package/dist/mcp/tools/list-projects.d.ts +2 -0
  275. package/dist/mcp/tools/list-projects.d.ts.map +1 -0
  276. package/dist/mcp/tools/list-projects.js +101 -0
  277. package/dist/mcp/tools/list-projects.js.map +1 -0
  278. package/dist/mcp/tools/list-specs.d.ts +2 -0
  279. package/dist/mcp/tools/list-specs.d.ts.map +1 -0
  280. package/dist/mcp/tools/list-specs.js +48 -0
  281. package/dist/mcp/tools/list-specs.js.map +1 -0
  282. package/dist/mcp/tools/plan.d.ts.map +1 -1
  283. package/dist/mcp/tools/plan.js +40 -14
  284. package/dist/mcp/tools/plan.js.map +1 -1
  285. package/dist/mcp/tools/playbook.d.ts +2 -0
  286. package/dist/mcp/tools/playbook.d.ts.map +1 -0
  287. package/dist/mcp/tools/playbook.js +104 -0
  288. package/dist/mcp/tools/playbook.js.map +1 -0
  289. package/dist/mcp/tools/postmortem.d.ts +2 -0
  290. package/dist/mcp/tools/postmortem.d.ts.map +1 -0
  291. package/dist/mcp/tools/postmortem.js +75 -0
  292. package/dist/mcp/tools/postmortem.js.map +1 -0
  293. package/dist/mcp/tools/react.js +1 -1
  294. package/dist/mcp/tools/react.js.map +1 -1
  295. package/dist/mcp/tools/reject-checkpoint.d.ts +2 -0
  296. package/dist/mcp/tools/reject-checkpoint.d.ts.map +1 -0
  297. package/dist/mcp/tools/reject-checkpoint.js +79 -0
  298. package/dist/mcp/tools/reject-checkpoint.js.map +1 -0
  299. package/dist/mcp/tools/rollback.d.ts +2 -0
  300. package/dist/mcp/tools/rollback.d.ts.map +1 -0
  301. package/dist/mcp/tools/rollback.js +78 -0
  302. package/dist/mcp/tools/rollback.js.map +1 -0
  303. package/dist/mcp/tools/run-in-worktree.d.ts +2 -0
  304. package/dist/mcp/tools/run-in-worktree.d.ts.map +1 -0
  305. package/dist/mcp/tools/run-in-worktree.js +90 -0
  306. package/dist/mcp/tools/run-in-worktree.js.map +1 -0
  307. package/dist/mcp/tools/run.js +1 -1
  308. package/dist/mcp/tools/run.js.map +1 -1
  309. package/dist/mcp/tools/solidity.js +1 -1
  310. package/dist/mcp/tools/solidity.js.map +1 -1
  311. package/dist/mcp/tools/sprint.d.ts.map +1 -1
  312. package/dist/mcp/tools/sprint.js +11 -11
  313. package/dist/mcp/tools/sprint.js.map +1 -1
  314. package/dist/mcp/tools/status.d.ts.map +1 -1
  315. package/dist/mcp/tools/status.js +11 -0
  316. package/dist/mcp/tools/status.js.map +1 -1
  317. package/dist/mcp/tools/subscribe-events.d.ts +2 -0
  318. package/dist/mcp/tools/subscribe-events.d.ts.map +1 -0
  319. package/dist/mcp/tools/subscribe-events.js +48 -0
  320. package/dist/mcp/tools/subscribe-events.js.map +1 -0
  321. package/dist/mcp/tools/unsubscribe-events.d.ts +2 -0
  322. package/dist/mcp/tools/unsubscribe-events.d.ts.map +1 -0
  323. package/dist/mcp/tools/unsubscribe-events.js +45 -0
  324. package/dist/mcp/tools/unsubscribe-events.js.map +1 -0
  325. package/dist/orchestrator/agent-loader.d.ts +16 -0
  326. package/dist/orchestrator/agent-loader.d.ts.map +1 -1
  327. package/dist/orchestrator/agent-loader.js +16 -0
  328. package/dist/orchestrator/agent-loader.js.map +1 -1
  329. package/dist/orchestrator/architect-agent.d.ts.map +1 -1
  330. package/dist/orchestrator/architect-agent.js +37 -8
  331. package/dist/orchestrator/architect-agent.js.map +1 -1
  332. package/dist/orchestrator/checkpoints/audit.d.ts +128 -0
  333. package/dist/orchestrator/checkpoints/audit.d.ts.map +1 -0
  334. package/dist/orchestrator/checkpoints/audit.js +272 -0
  335. package/dist/orchestrator/checkpoints/audit.js.map +1 -0
  336. package/dist/orchestrator/checkpoints/feedback-router.d.ts +213 -0
  337. package/dist/orchestrator/checkpoints/feedback-router.d.ts.map +1 -0
  338. package/dist/orchestrator/checkpoints/feedback-router.js +438 -0
  339. package/dist/orchestrator/checkpoints/feedback-router.js.map +1 -0
  340. package/dist/orchestrator/checkpoints/index.d.ts +11 -0
  341. package/dist/orchestrator/checkpoints/index.d.ts.map +1 -0
  342. package/dist/orchestrator/checkpoints/index.js +12 -0
  343. package/dist/orchestrator/checkpoints/index.js.map +1 -0
  344. package/dist/orchestrator/checkpoints/mechanisms/cli.d.ts +35 -0
  345. package/dist/orchestrator/checkpoints/mechanisms/cli.d.ts.map +1 -0
  346. package/dist/orchestrator/checkpoints/mechanisms/cli.js +153 -0
  347. package/dist/orchestrator/checkpoints/mechanisms/cli.js.map +1 -0
  348. package/dist/orchestrator/checkpoints/mechanisms/disk.d.ts +34 -0
  349. package/dist/orchestrator/checkpoints/mechanisms/disk.d.ts.map +1 -0
  350. package/dist/orchestrator/checkpoints/mechanisms/disk.js +139 -0
  351. package/dist/orchestrator/checkpoints/mechanisms/disk.js.map +1 -0
  352. package/dist/orchestrator/checkpoints/mechanisms/pr.d.ts +141 -0
  353. package/dist/orchestrator/checkpoints/mechanisms/pr.d.ts.map +1 -0
  354. package/dist/orchestrator/checkpoints/mechanisms/pr.js +445 -0
  355. package/dist/orchestrator/checkpoints/mechanisms/pr.js.map +1 -0
  356. package/dist/orchestrator/checkpoints/noop.d.ts +12 -0
  357. package/dist/orchestrator/checkpoints/noop.d.ts.map +1 -0
  358. package/dist/orchestrator/checkpoints/noop.js +13 -0
  359. package/dist/orchestrator/checkpoints/noop.js.map +1 -0
  360. package/dist/orchestrator/checkpoints/registry.d.ts +48 -0
  361. package/dist/orchestrator/checkpoints/registry.d.ts.map +1 -0
  362. package/dist/orchestrator/checkpoints/registry.js +89 -0
  363. package/dist/orchestrator/checkpoints/registry.js.map +1 -0
  364. package/dist/orchestrator/checkpoints/renderers/_util.d.ts +50 -0
  365. package/dist/orchestrator/checkpoints/renderers/_util.d.ts.map +1 -0
  366. package/dist/orchestrator/checkpoints/renderers/_util.js +137 -0
  367. package/dist/orchestrator/checkpoints/renderers/_util.js.map +1 -0
  368. package/dist/orchestrator/checkpoints/renderers/code-review.d.ts +15 -0
  369. package/dist/orchestrator/checkpoints/renderers/code-review.d.ts.map +1 -0
  370. package/dist/orchestrator/checkpoints/renderers/code-review.js +66 -0
  371. package/dist/orchestrator/checkpoints/renderers/code-review.js.map +1 -0
  372. package/dist/orchestrator/checkpoints/renderers/curator-briefing.d.ts +15 -0
  373. package/dist/orchestrator/checkpoints/renderers/curator-briefing.d.ts.map +1 -0
  374. package/dist/orchestrator/checkpoints/renderers/curator-briefing.js +40 -0
  375. package/dist/orchestrator/checkpoints/renderers/curator-briefing.js.map +1 -0
  376. package/dist/orchestrator/checkpoints/renderers/eval-result.d.ts +15 -0
  377. package/dist/orchestrator/checkpoints/renderers/eval-result.d.ts.map +1 -0
  378. package/dist/orchestrator/checkpoints/renderers/eval-result.js +54 -0
  379. package/dist/orchestrator/checkpoints/renderers/eval-result.js.map +1 -0
  380. package/dist/orchestrator/checkpoints/renderers/generator-diff.d.ts +49 -0
  381. package/dist/orchestrator/checkpoints/renderers/generator-diff.d.ts.map +1 -0
  382. package/dist/orchestrator/checkpoints/renderers/generator-diff.js +154 -0
  383. package/dist/orchestrator/checkpoints/renderers/generator-diff.js.map +1 -0
  384. package/dist/orchestrator/checkpoints/renderers/pipeline-summary.d.ts +15 -0
  385. package/dist/orchestrator/checkpoints/renderers/pipeline-summary.d.ts.map +1 -0
  386. package/dist/orchestrator/checkpoints/renderers/pipeline-summary.js +59 -0
  387. package/dist/orchestrator/checkpoints/renderers/pipeline-summary.js.map +1 -0
  388. package/dist/orchestrator/checkpoints/renderers/plan.d.ts +15 -0
  389. package/dist/orchestrator/checkpoints/renderers/plan.d.ts.map +1 -0
  390. package/dist/orchestrator/checkpoints/renderers/plan.js +34 -0
  391. package/dist/orchestrator/checkpoints/renderers/plan.js.map +1 -0
  392. package/dist/orchestrator/checkpoints/renderers/registry.d.ts +43 -0
  393. package/dist/orchestrator/checkpoints/renderers/registry.d.ts.map +1 -0
  394. package/dist/orchestrator/checkpoints/renderers/registry.js +83 -0
  395. package/dist/orchestrator/checkpoints/renderers/registry.js.map +1 -0
  396. package/dist/orchestrator/checkpoints/renderers/research.d.ts +15 -0
  397. package/dist/orchestrator/checkpoints/renderers/research.d.ts.map +1 -0
  398. package/dist/orchestrator/checkpoints/renderers/research.js +39 -0
  399. package/dist/orchestrator/checkpoints/renderers/research.js.map +1 -0
  400. package/dist/orchestrator/checkpoints/renderers/sprint-contract.d.ts +20 -0
  401. package/dist/orchestrator/checkpoints/renderers/sprint-contract.d.ts.map +1 -0
  402. package/dist/orchestrator/checkpoints/renderers/sprint-contract.js +57 -0
  403. package/dist/orchestrator/checkpoints/renderers/sprint-contract.js.map +1 -0
  404. package/dist/orchestrator/checkpoints/renderers/sprint-summary.d.ts +15 -0
  405. package/dist/orchestrator/checkpoints/renderers/sprint-summary.d.ts.map +1 -0
  406. package/dist/orchestrator/checkpoints/renderers/sprint-summary.js +38 -0
  407. package/dist/orchestrator/checkpoints/renderers/sprint-summary.js.map +1 -0
  408. package/dist/orchestrator/checkpoints/sites.d.ts +22 -0
  409. package/dist/orchestrator/checkpoints/sites.d.ts.map +1 -0
  410. package/dist/orchestrator/checkpoints/sites.js +57 -0
  411. package/dist/orchestrator/checkpoints/sites.js.map +1 -0
  412. package/dist/orchestrator/checkpoints/types.d.ts +51 -0
  413. package/dist/orchestrator/checkpoints/types.d.ts.map +1 -0
  414. package/dist/orchestrator/checkpoints/types.js +9 -0
  415. package/dist/orchestrator/checkpoints/types.js.map +1 -0
  416. package/dist/orchestrator/code-reviewer-agent.d.ts +50 -0
  417. package/dist/orchestrator/code-reviewer-agent.d.ts.map +1 -0
  418. package/dist/orchestrator/code-reviewer-agent.js +283 -0
  419. package/dist/orchestrator/code-reviewer-agent.js.map +1 -0
  420. package/dist/orchestrator/context-handoff.d.ts +484 -224
  421. package/dist/orchestrator/context-handoff.d.ts.map +1 -1
  422. package/dist/orchestrator/context-handoff.js +32 -12
  423. package/dist/orchestrator/context-handoff.js.map +1 -1
  424. package/dist/orchestrator/curator-agent.d.ts.map +1 -1
  425. package/dist/orchestrator/curator-agent.js +63 -12
  426. package/dist/orchestrator/curator-agent.js.map +1 -1
  427. package/dist/orchestrator/deploy/classify.d.ts +31 -0
  428. package/dist/orchestrator/deploy/classify.d.ts.map +1 -0
  429. package/dist/orchestrator/deploy/classify.js +109 -0
  430. package/dist/orchestrator/deploy/classify.js.map +1 -0
  431. package/dist/orchestrator/deploy/execute.d.ts +45 -0
  432. package/dist/orchestrator/deploy/execute.d.ts.map +1 -0
  433. package/dist/orchestrator/deploy/execute.js +146 -0
  434. package/dist/orchestrator/deploy/execute.js.map +1 -0
  435. package/dist/orchestrator/deploy/executor.d.ts +22 -0
  436. package/dist/orchestrator/deploy/executor.d.ts.map +1 -0
  437. package/dist/orchestrator/deploy/executor.js +31 -0
  438. package/dist/orchestrator/deploy/executor.js.map +1 -0
  439. package/dist/orchestrator/deploy/index.d.ts +21 -0
  440. package/dist/orchestrator/deploy/index.d.ts.map +1 -0
  441. package/dist/orchestrator/deploy/index.js +21 -0
  442. package/dist/orchestrator/deploy/index.js.map +1 -0
  443. package/dist/orchestrator/deploy/resolve.d.ts +51 -0
  444. package/dist/orchestrator/deploy/resolve.d.ts.map +1 -0
  445. package/dist/orchestrator/deploy/resolve.js +53 -0
  446. package/dist/orchestrator/deploy/resolve.js.map +1 -0
  447. package/dist/orchestrator/deploy/spawn.d.ts +60 -0
  448. package/dist/orchestrator/deploy/spawn.d.ts.map +1 -0
  449. package/dist/orchestrator/deploy/spawn.js +62 -0
  450. package/dist/orchestrator/deploy/spawn.js.map +1 -0
  451. package/dist/orchestrator/deploy/types.d.ts +98 -0
  452. package/dist/orchestrator/deploy/types.d.ts.map +1 -0
  453. package/dist/orchestrator/deploy/types.js +39 -0
  454. package/dist/orchestrator/deploy/types.js.map +1 -0
  455. package/dist/orchestrator/evaluator-agent.d.ts.map +1 -1
  456. package/dist/orchestrator/evaluator-agent.js +23 -10
  457. package/dist/orchestrator/evaluator-agent.js.map +1 -1
  458. package/dist/orchestrator/generator-agent.d.ts.map +1 -1
  459. package/dist/orchestrator/generator-agent.js +24 -11
  460. package/dist/orchestrator/generator-agent.js.map +1 -1
  461. package/dist/orchestrator/model-resolver.d.ts.map +1 -1
  462. package/dist/orchestrator/model-resolver.js +4 -2
  463. package/dist/orchestrator/model-resolver.js.map +1 -1
  464. package/dist/orchestrator/observability/index.d.ts +12 -0
  465. package/dist/orchestrator/observability/index.d.ts.map +1 -0
  466. package/dist/orchestrator/observability/index.js +12 -0
  467. package/dist/orchestrator/observability/index.js.map +1 -0
  468. package/dist/orchestrator/observability/merge.d.ts +73 -0
  469. package/dist/orchestrator/observability/merge.d.ts.map +1 -0
  470. package/dist/orchestrator/observability/merge.js +110 -0
  471. package/dist/orchestrator/observability/merge.js.map +1 -0
  472. package/dist/orchestrator/pipeline.d.ts +28 -0
  473. package/dist/orchestrator/pipeline.d.ts.map +1 -1
  474. package/dist/orchestrator/pipeline.js +223 -30
  475. package/dist/orchestrator/pipeline.js.map +1 -1
  476. package/dist/orchestrator/planner-agent.d.ts +21 -1
  477. package/dist/orchestrator/planner-agent.d.ts.map +1 -1
  478. package/dist/orchestrator/planner-agent.js +16 -6
  479. package/dist/orchestrator/planner-agent.js.map +1 -1
  480. package/dist/orchestrator/research-agent.d.ts.map +1 -1
  481. package/dist/orchestrator/research-agent.js +46 -9
  482. package/dist/orchestrator/research-agent.js.map +1 -1
  483. package/dist/orchestrator/tools/handlers.d.ts +2 -0
  484. package/dist/orchestrator/tools/handlers.d.ts.map +1 -1
  485. package/dist/orchestrator/tools/handlers.js +1 -1
  486. package/dist/orchestrator/tools/handlers.js.map +1 -1
  487. package/dist/orchestrator/tools/index.d.ts +84 -1
  488. package/dist/orchestrator/tools/index.d.ts.map +1 -1
  489. package/dist/orchestrator/tools/index.js +164 -1
  490. package/dist/orchestrator/tools/index.js.map +1 -1
  491. package/dist/orchestrator/worktree.d.ts +18 -0
  492. package/dist/orchestrator/worktree.d.ts.map +1 -0
  493. package/dist/orchestrator/worktree.js +129 -0
  494. package/dist/orchestrator/worktree.js.map +1 -0
  495. package/dist/providers/anthropic.d.ts +8 -1
  496. package/dist/providers/anthropic.d.ts.map +1 -1
  497. package/dist/providers/anthropic.js +86 -5
  498. package/dist/providers/anthropic.js.map +1 -1
  499. package/dist/providers/factory.d.ts.map +1 -1
  500. package/dist/providers/factory.js +35 -2
  501. package/dist/providers/factory.js.map +1 -1
  502. package/dist/providers/google.d.ts.map +1 -1
  503. package/dist/providers/google.js +5 -0
  504. package/dist/providers/google.js.map +1 -1
  505. package/dist/providers/index.d.ts +1 -1
  506. package/dist/providers/index.d.ts.map +1 -1
  507. package/dist/providers/index.js.map +1 -1
  508. package/dist/providers/openai.d.ts.map +1 -1
  509. package/dist/providers/openai.js +4 -0
  510. package/dist/providers/openai.js.map +1 -1
  511. package/dist/providers/types.d.ts +25 -2
  512. package/dist/providers/types.d.ts.map +1 -1
  513. package/dist/state/approval-state.d.ts +74 -0
  514. package/dist/state/approval-state.d.ts.map +1 -0
  515. package/dist/state/approval-state.js +127 -0
  516. package/dist/state/approval-state.js.map +1 -0
  517. package/dist/state/history.d.ts.map +1 -1
  518. package/dist/state/history.js +3 -3
  519. package/dist/state/history.js.map +1 -1
  520. package/dist/state/index.d.ts +3 -0
  521. package/dist/state/index.d.ts.map +1 -1
  522. package/dist/state/index.js +4 -1
  523. package/dist/state/index.js.map +1 -1
  524. package/dist/state/plan-state.js +1 -1
  525. package/dist/state/plan-state.js.map +1 -1
  526. package/dist/state/review-state.d.ts +15 -0
  527. package/dist/state/review-state.d.ts.map +1 -0
  528. package/dist/state/review-state.js +51 -0
  529. package/dist/state/review-state.js.map +1 -0
  530. package/dist/state/run-state.d.ts +39 -0
  531. package/dist/state/run-state.d.ts.map +1 -0
  532. package/dist/state/run-state.js +101 -0
  533. package/dist/state/run-state.js.map +1 -0
  534. package/dist/state/sprint-state.d.ts +9 -2
  535. package/dist/state/sprint-state.d.ts.map +1 -1
  536. package/dist/state/sprint-state.js +25 -11
  537. package/dist/state/sprint-state.js.map +1 -1
  538. package/dist/telemetry/emit.d.ts +41 -0
  539. package/dist/telemetry/emit.d.ts.map +1 -0
  540. package/dist/telemetry/emit.js +65 -0
  541. package/dist/telemetry/emit.js.map +1 -0
  542. package/dist/utils/git.d.ts +27 -0
  543. package/dist/utils/git.d.ts.map +1 -1
  544. package/dist/utils/git.js +50 -0
  545. package/dist/utils/git.js.map +1 -1
  546. package/hooks/hooks.json +17 -1
  547. package/hooks/session-start +42 -0
  548. package/package.json +6 -2
  549. package/scripts/check-prereqs.sh +12 -0
  550. package/scripts/e2e-graph-smoke.sh +167 -0
  551. package/scripts/graph-hook.mjs +151 -0
  552. package/scripts/migrate-specs.mjs +127 -0
  553. package/scripts/run-kpi-gate.mjs +245 -0
  554. package/scripts/sync-skills.mjs +99 -0
  555. package/skills/bober.code-review/SKILL.md +186 -0
  556. package/skills/bober.debug/SKILL.md +300 -0
  557. package/skills/bober.deploy/SKILL.md +262 -0
  558. package/skills/bober.diagnose/SKILL.md +254 -0
  559. package/skills/bober.graph/SKILL.md +85 -0
  560. package/skills/bober.impact/SKILL.md +101 -0
  561. package/skills/bober.incident/SKILL.md +245 -0
  562. package/skills/bober.onboard/SKILL.md +84 -0
  563. package/skills/bober.plan/SKILL.md +51 -0
  564. package/skills/bober.plan/references/spec-schema.md +31 -4
  565. package/skills/bober.postmortem/SKILL.md +231 -0
  566. package/skills/bober.run/SKILL.md +41 -7
  567. package/skills/bober.runbook/SKILL.md +335 -0
  568. package/skills/bober.sprint/SKILL.md +6 -259
  569. package/skills/bober.using-bober/SKILL.md +133 -0
  570. package/skills/bober.verify/SKILL.md +143 -0
@@ -1,6 +1,6 @@
1
1
  import { readFile, writeFile, readdir } from "node:fs/promises";
2
2
  import { join } from "node:path";
3
- import { SprintContractSchema, } from "../contracts/sprint-contract.js";
3
+ import { SprintContractSchema, findPrecisionIssues, } from "../contracts/sprint-contract.js";
4
4
  import { ensureDir } from "./helpers.js";
5
5
  const CONTRACTS_DIR = ".bober/contracts";
6
6
  function contractsDir(projectRoot) {
@@ -11,20 +11,33 @@ function contractPath(projectRoot, id) {
11
11
  const safeId = id.replace(/[^a-zA-Z0-9_-]/g, "_");
12
12
  return join(contractsDir(projectRoot), `${safeId}.json`);
13
13
  }
14
+ function formatZodIssues(error) {
15
+ return error.issues
16
+ .map((i) => ` - ${i.path.join(".")}: ${i.message}`)
17
+ .join("\n");
18
+ }
14
19
  /**
15
20
  * Save a sprint contract to disk.
16
- * Overwrites any existing contract with the same id.
21
+ * Overwrites any existing contract with the same contractId.
22
+ *
23
+ * Validates the contract against the schema and the precision quality gate.
24
+ * Throws on either failure — partial or vague contracts are not silently saved.
17
25
  */
18
26
  export async function saveContract(projectRoot, contract) {
19
27
  await ensureDir(contractsDir(projectRoot));
20
28
  const validation = SprintContractSchema.safeParse(contract);
21
29
  if (!validation.success) {
22
- const issues = validation.error.issues
23
- .map((i) => ` - ${i.path.join(".")}: ${i.message}`)
30
+ throw new Error(`Invalid contract:\n${formatZodIssues(validation.error)}`);
31
+ }
32
+ // Quality gate: vague phrases the schema can't express via min-length alone.
33
+ const precisionIssues = findPrecisionIssues(validation.data);
34
+ if (precisionIssues.length > 0) {
35
+ const formatted = precisionIssues
36
+ .map((i) => ` - ${i.field}: ${i.message}`)
24
37
  .join("\n");
25
- throw new Error(`Invalid contract:\n${issues}`);
38
+ throw new Error(`Contract "${contract.contractId}" failed precision gate:\n${formatted}`);
26
39
  }
27
- const filePath = contractPath(projectRoot, contract.id);
40
+ const filePath = contractPath(projectRoot, contract.contractId);
28
41
  await writeFile(filePath, JSON.stringify(contract, null, 2), "utf-8");
29
42
  }
30
43
  /**
@@ -49,15 +62,16 @@ export async function loadContract(projectRoot, id) {
49
62
  }
50
63
  const result = SprintContractSchema.safeParse(parsed);
51
64
  if (!result.success) {
52
- const issues = result.error.issues
53
- .map((i) => ` - ${i.path.join(".")}: ${i.message}`)
54
- .join("\n");
55
- throw new Error(`Contract "${id}" failed validation:\n${issues}`);
65
+ throw new Error(`Contract "${id}" failed validation:\n${formatZodIssues(result.error)}`);
56
66
  }
57
67
  return result.data;
58
68
  }
59
69
  /**
60
70
  * List all saved contracts, sorted by filename.
71
+ *
72
+ * Files that fail validation are skipped silently — to surface validation
73
+ * errors, use `loadContract` directly. (Skipping is intentional here so that
74
+ * a single bad file doesn't break listing for the rest.)
61
75
  */
62
76
  export async function listContracts(projectRoot) {
63
77
  const dir = contractsDir(projectRoot);
@@ -90,7 +104,7 @@ export async function listContracts(projectRoot) {
90
104
  return contracts;
91
105
  }
92
106
  /**
93
- * Update an existing contract (save with the same id).
107
+ * Update an existing contract (save with the same contractId).
94
108
  */
95
109
  export async function updateContract(projectRoot, contract) {
96
110
  await saveContract(projectRoot, contract);
@@ -1 +1 @@
1
- {"version":3,"file":"sprint-state.js","sourceRoot":"","sources":["../../src/state/sprint-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EACL,oBAAoB,GAErB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,aAAa,GAAG,kBAAkB,CAAC;AAEzC,SAAS,YAAY,CAAC,WAAmB;IACvC,OAAO,IAAI,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;AAC1C,CAAC;AAED,SAAS,YAAY,CAAC,WAAmB,EAAE,EAAU;IACnD,wCAAwC;IACxC,MAAM,MAAM,GAAG,EAAE,CAAC,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC;IAClD,OAAO,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,EAAE,GAAG,MAAM,OAAO,CAAC,CAAC;AAC3D,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,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AAK,UAAU,cAAc,CAClC,WAAmB,EACnB,QAAwB;IAExB,MAAM,YAAY,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;AAC5C,CAAC"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Opt-in local-only telemetry event emitter (Sprint 28).
3
+ *
4
+ * When config.telemetry.enabled === true, appends one newline-terminated JSON
5
+ * line to .bober/telemetry/<YYYY-MM-DD>.jsonl. When disabled (default), emit()
6
+ * is a no-op and performs ZERO file IO.
7
+ *
8
+ * File is created with mode 0600 on first append via fs.open(O_WRONLY|O_APPEND|
9
+ * O_CREAT). Mirrors the Sprint 13 audit pattern verbatim (see audit.ts:86 for
10
+ * the rationale on why fs.appendFile is NOT used).
11
+ *
12
+ * NETWORK EGRESS: forbidden by design. No import of node:http, node:https,
13
+ * node:net, node:tls, undici, or fetch — enforced by ESLint no-restricted-imports
14
+ * rule scoped to src/telemetry/** in eslint.config.js.
15
+ *
16
+ * PRIVACY: event payloads MUST be IDs / counts / enum outcomes only. NEVER pass
17
+ * user-content strings (feedbackText, prompts, file contents, MCP response
18
+ * bodies). Reviewers grep `emit(` across src/ to enforce this discipline.
19
+ *
20
+ * Sprint 28 — src/telemetry/emit.ts
21
+ */
22
+ import type { BoberConfig } from "../config/schema.js";
23
+ export type TelemetryEventType = "checkpoint-approved" | "checkpoint-rejected" | "checkpoint-edited" | "sprint-pass" | "sprint-fail-retry" | "incident-resolved" | "incident-aborted" | "agent-spawn" | "agent-error";
24
+ /** Allowed payload fields. NO string values from user input. */
25
+ export interface TelemetryEventData {
26
+ runId?: string;
27
+ incidentId?: string;
28
+ specId?: string;
29
+ sprintId?: string;
30
+ contractId?: string;
31
+ agentName?: string;
32
+ checkpointId?: string;
33
+ iteration?: number;
34
+ durationMs?: number;
35
+ outcome?: string;
36
+ retryCount?: number;
37
+ errorKind?: string;
38
+ }
39
+ /** Emit a telemetry event. No-op when telemetry.enabled !== true. */
40
+ export declare function emit(projectRoot: string, config: BoberConfig, eventType: TelemetryEventType, data?: TelemetryEventData): Promise<void>;
41
+ //# sourceMappingURL=emit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emit.d.ts","sourceRoot":"","sources":["../../src/telemetry/emit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAMH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGvD,MAAM,MAAM,kBAAkB,GAC1B,qBAAqB,GACrB,qBAAqB,GACrB,mBAAmB,GACnB,aAAa,GACb,mBAAmB,GACnB,mBAAmB,GACnB,kBAAkB,GAClB,aAAa,GACb,aAAa,CAAC;AAElB,gEAAgE;AAChE,MAAM,WAAW,kBAAkB;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAaD,qEAAqE;AACrE,wBAAsB,IAAI,CACxB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,WAAW,EACnB,SAAS,EAAE,kBAAkB,EAC7B,IAAI,GAAE,kBAAuB,GAC5B,OAAO,CAAC,IAAI,CAAC,CAgCf"}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Opt-in local-only telemetry event emitter (Sprint 28).
3
+ *
4
+ * When config.telemetry.enabled === true, appends one newline-terminated JSON
5
+ * line to .bober/telemetry/<YYYY-MM-DD>.jsonl. When disabled (default), emit()
6
+ * is a no-op and performs ZERO file IO.
7
+ *
8
+ * File is created with mode 0600 on first append via fs.open(O_WRONLY|O_APPEND|
9
+ * O_CREAT). Mirrors the Sprint 13 audit pattern verbatim (see audit.ts:86 for
10
+ * the rationale on why fs.appendFile is NOT used).
11
+ *
12
+ * NETWORK EGRESS: forbidden by design. No import of node:http, node:https,
13
+ * node:net, node:tls, undici, or fetch — enforced by ESLint no-restricted-imports
14
+ * rule scoped to src/telemetry/** in eslint.config.js.
15
+ *
16
+ * PRIVACY: event payloads MUST be IDs / counts / enum outcomes only. NEVER pass
17
+ * user-content strings (feedbackText, prompts, file contents, MCP response
18
+ * bodies). Reviewers grep `emit(` across src/ to enforce this discipline.
19
+ *
20
+ * Sprint 28 — src/telemetry/emit.ts
21
+ */
22
+ import { open, mkdir } from "node:fs/promises";
23
+ import { constants } from "node:fs";
24
+ import { join } from "node:path";
25
+ import { logger } from "../utils/logger.js";
26
+ const writeChain = new Map();
27
+ function telemetryDir(projectRoot) {
28
+ return join(projectRoot, ".bober", "telemetry");
29
+ }
30
+ function telemetryPath(projectRoot) {
31
+ const date = new Date().toISOString().slice(0, 10); // YYYY-MM-DD
32
+ return join(telemetryDir(projectRoot), `${date}.jsonl`);
33
+ }
34
+ /** Emit a telemetry event. No-op when telemetry.enabled !== true. */
35
+ export async function emit(projectRoot, config, eventType, data = {}) {
36
+ if (config.telemetry?.enabled !== true)
37
+ return;
38
+ const event = {
39
+ timestamp: new Date().toISOString(),
40
+ eventType,
41
+ ...data,
42
+ };
43
+ const filePath = telemetryPath(projectRoot);
44
+ const prev = writeChain.get(filePath) ?? Promise.resolve();
45
+ const next = prev
46
+ .then(async () => {
47
+ await mkdir(telemetryDir(projectRoot), { recursive: true });
48
+ const flags = constants.O_WRONLY | constants.O_APPEND | constants.O_CREAT;
49
+ const fh = await open(filePath, flags, 0o600);
50
+ try {
51
+ // Guarantee mode 0600 even if umask would have reduced it.
52
+ await fh.chmod(0o600);
53
+ await fh.write(JSON.stringify(event) + "\n");
54
+ }
55
+ finally {
56
+ await fh.close();
57
+ }
58
+ })
59
+ .catch((err) => {
60
+ logger.warn(`[telemetry] Failed to emit ${eventType}: ${err instanceof Error ? err.message : String(err)}`);
61
+ });
62
+ writeChain.set(filePath, next);
63
+ return next;
64
+ }
65
+ //# sourceMappingURL=emit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emit.js","sourceRoot":"","sources":["../../src/telemetry/emit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AA6B5C,MAAM,UAAU,GAAG,IAAI,GAAG,EAAyB,CAAC;AAEpD,SAAS,YAAY,CAAC,WAAmB;IACvC,OAAO,IAAI,CAAC,WAAW,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC;AAClD,CAAC;AAED,SAAS,aAAa,CAAC,WAAmB;IACxC,MAAM,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa;IACjE,OAAO,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,EAAE,GAAG,IAAI,QAAQ,CAAC,CAAC;AAC1D,CAAC;AAED,qEAAqE;AACrE,MAAM,CAAC,KAAK,UAAU,IAAI,CACxB,WAAmB,EACnB,MAAmB,EACnB,SAA6B,EAC7B,OAA2B,EAAE;IAE7B,IAAI,MAAM,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI;QAAE,OAAO;IAE/C,MAAM,KAAK,GAAG;QACZ,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACnC,SAAS;QACT,GAAG,IAAI;KACR,CAAC;IAEF,MAAM,QAAQ,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC;IAE5C,MAAM,IAAI,GAAG,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3D,MAAM,IAAI,GAAG,IAAI;SACd,IAAI,CAAC,KAAK,IAAI,EAAE;QACf,MAAM,KAAK,CAAC,YAAY,CAAC,WAAW,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC5D,MAAM,KAAK,GAAG,SAAS,CAAC,QAAQ,GAAG,SAAS,CAAC,QAAQ,GAAG,SAAS,CAAC,OAAO,CAAC;QAC1E,MAAM,EAAE,GAAG,MAAM,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QAC9C,IAAI,CAAC;YACH,2DAA2D;YAC3D,MAAM,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACtB,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;QAC/C,CAAC;gBAAS,CAAC;YACT,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC;QACnB,CAAC;IACH,CAAC,CAAC;SACD,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;QACtB,MAAM,CAAC,IAAI,CACT,8BAA8B,SAAS,KAAK,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAC/F,CAAC;IACJ,CAAC,CAAC,CAAC;IACL,UAAU,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IAC/B,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -26,6 +26,33 @@ export declare function getDiff(cwd: string, since?: string): Promise<string>;
26
26
  * Check whether the working tree has uncommitted changes (staged or unstaged).
27
27
  */
28
28
  export declare function hasUncommittedChanges(cwd: string): Promise<boolean>;
29
+ /**
30
+ * Add a new git worktree at the given path on a new branch.
31
+ *
32
+ * Shells out to: git worktree add <path> -b <branch> [<baseBranch>]
33
+ * Throws on non-zero exit (a failed worktree-add must surface as an error).
34
+ */
35
+ export declare function addWorktree(projectRoot: string, worktreePath: string, branch: string, baseBranch?: string): Promise<void>;
36
+ /**
37
+ * Remove a git worktree by path.
38
+ *
39
+ * Shells out to: git worktree remove [-f] <path>
40
+ * Uses reject: false so that removing a worktree that no longer exists
41
+ * does not crash cleanup paths.
42
+ */
43
+ export declare function removeWorktree(projectRoot: string, worktreePath: string, force?: boolean): Promise<void>;
44
+ /**
45
+ * Check whether the working tree is clean (no staged or unstaged changes).
46
+ *
47
+ * Returns { clean: true, dirtyFiles: [] } when the tree is clean.
48
+ * Returns { clean: false, dirtyFiles: [...] } listing each dirty path
49
+ * (parsed from `git status --porcelain` — columns 0-1 are the XY status
50
+ * codes, column 2 is a space, then the path starts at column 3).
51
+ */
52
+ export declare function isClean(cwd: string): Promise<{
53
+ clean: boolean;
54
+ dirtyFiles: string[];
55
+ }>;
29
56
  /**
30
57
  * Stash any current changes, run the provided function, then restore.
31
58
  *
@@ -1 +1 @@
1
- {"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../src/utils/git.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAKnE;AAED;;GAEG;AACH,wBAAsB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE3E;AAED;;;;GAIG;AACH,wBAAsB,SAAS,CAC7B,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,CAAC,CAQjB;AAED;;;;GAIG;AACH,wBAAsB,eAAe,CACnC,GAAG,EAAE,MAAM,EACX,KAAK,CAAC,EAAE,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,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,MAAM,EACd,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC,CAIf;AAED;;;;;;GAMG;AACH,wBAAsB,cAAc,CAClC,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,KAAK,CAAC,EAAE,OAAO,GACd,OAAO,CAAC,IAAI,CAAC,CAKf;AAED;;;;;;;GAOG;AACH,wBAAsB,OAAO,CAC3B,GAAG,EAAE,MAAM,GACV,OAAO,CAAC;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,UAAU,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CAenD;AAED;;;;GAIG;AACH,wBAAsB,eAAe,CAAC,CAAC,EACrC,GAAG,EAAE,MAAM,EACX,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GACnB,OAAO,CAAC,CAAC,CAAC,CAcZ"}
package/dist/utils/git.js CHANGED
@@ -62,6 +62,56 @@ export async function hasUncommittedChanges(cwd) {
62
62
  });
63
63
  return stdout.trim().length > 0;
64
64
  }
65
+ /**
66
+ * Add a new git worktree at the given path on a new branch.
67
+ *
68
+ * Shells out to: git worktree add <path> -b <branch> [<baseBranch>]
69
+ * Throws on non-zero exit (a failed worktree-add must surface as an error).
70
+ */
71
+ export async function addWorktree(projectRoot, worktreePath, branch, baseBranch) {
72
+ const args = ["worktree", "add", worktreePath, "-b", branch];
73
+ if (baseBranch)
74
+ args.push(baseBranch);
75
+ await execa("git", args, { cwd: projectRoot });
76
+ }
77
+ /**
78
+ * Remove a git worktree by path.
79
+ *
80
+ * Shells out to: git worktree remove [-f] <path>
81
+ * Uses reject: false so that removing a worktree that no longer exists
82
+ * does not crash cleanup paths.
83
+ */
84
+ export async function removeWorktree(projectRoot, worktreePath, force) {
85
+ const args = ["worktree", "remove"];
86
+ if (force)
87
+ args.push("-f");
88
+ args.push(worktreePath);
89
+ await execa("git", args, { cwd: projectRoot, reject: false });
90
+ }
91
+ /**
92
+ * Check whether the working tree is clean (no staged or unstaged changes).
93
+ *
94
+ * Returns { clean: true, dirtyFiles: [] } when the tree is clean.
95
+ * Returns { clean: false, dirtyFiles: [...] } listing each dirty path
96
+ * (parsed from `git status --porcelain` — columns 0-1 are the XY status
97
+ * codes, column 2 is a space, then the path starts at column 3).
98
+ */
99
+ export async function isClean(cwd) {
100
+ const { stdout } = await execa("git", ["status", "--porcelain"], {
101
+ cwd,
102
+ reject: false,
103
+ });
104
+ const lines = stdout
105
+ .split("\n")
106
+ .map((l) => l.trim())
107
+ .filter(Boolean);
108
+ if (lines.length === 0) {
109
+ return { clean: true, dirtyFiles: [] };
110
+ }
111
+ // Porcelain format: "XY path" — strip the leading "XY " (3 chars)
112
+ const dirtyFiles = lines.map((l) => l.slice(3).trim());
113
+ return { clean: false, dirtyFiles };
114
+ }
65
115
  /**
66
116
  * Stash any current changes, run the provided function, then restore.
67
117
  *
@@ -1 +1 @@
1
- {"version":3,"file":"git.js","sourceRoot":"","sources":["../../src/utils/git.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAE9B,sEAAsE;AAEtE;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,GAAW;IAChD,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,KAAK,CAAC,KAAK,EAAE,CAAC,WAAW,EAAE,cAAc,EAAE,MAAM,CAAC,EAAE;QAC3E,GAAG;KACJ,CAAC,CAAC;IACH,OAAO,MAAM,CAAC,IAAI,EAAE,CAAC;AACvB,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,GAAW,EAAE,IAAY;IAC1D,MAAM,KAAK,CAAC,KAAK,EAAE,CAAC,UAAU,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;AACxD,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,C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AE,CAAC;YACV,MAAM,KAAK,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;QAC/D,CAAC;IACH,CAAC;AACH,CAAC"}
package/hooks/hooks.json CHANGED
@@ -1,9 +1,25 @@
1
1
  {
2
2
  "hooks": {
3
+ "SessionStart": [
4
+ {
5
+ "matcher": "startup|clear|compact",
6
+ "hooks": [
7
+ {
8
+ "type": "command",
9
+ "command": "${CLAUDE_PLUGIN_ROOT:-.}/hooks/session-start",
10
+ "async": false
11
+ }
12
+ ]
13
+ }
14
+ ],
3
15
  "PostToolUse": [
4
16
  {
5
17
  "matcher": "Edit|Write",
6
- "command": "echo 'Files modified \u2014 run /bober:eval to verify'"
18
+ "command": "echo 'Files modified run /bober:eval to verify'"
19
+ },
20
+ {
21
+ "matcher": "Edit|Write",
22
+ "command": "node scripts/graph-hook.mjs"
7
23
  }
8
24
  ]
9
25
  }
@@ -0,0 +1,42 @@
1
+ #!/usr/bin/env bash
2
+ # session-start — SessionStart hook for agent-bober
3
+ # Injects the bober.using-bober bootstrap skill into the model's first-turn context.
4
+ #
5
+ # Structural pattern from obra/superpowers (MIT). https://github.com/obra/superpowers
6
+
7
+ set -euo pipefail
8
+
9
+ # Determine project root directory
10
+ PROJECT_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
11
+
12
+ # Read bober.using-bober skill content
13
+ using_bober_content=$(cat "${PROJECT_ROOT}/skills/bober.using-bober/SKILL.md" 2>&1 || echo "Error reading bober.using-bober skill")
14
+
15
+ # Escape string for JSON embedding using bash parameter substitution.
16
+ # Each ${s//old/new} is a single C-level pass - orders of magnitude
17
+ # faster than the character-by-character loop this replaces.
18
+ escape_for_json() {
19
+ local s="$1"
20
+ s="${s//\\/\\\\}"
21
+ s="${s//\"/\\\"}"
22
+ s="${s//$'\n'/\\n}"
23
+ s="${s//$'\r'/\\r}"
24
+ s="${s//$'\t'/\\t}"
25
+ printf '%s' "$s"
26
+ }
27
+
28
+ using_bober_escaped=$(escape_for_json "$using_bober_content")
29
+ session_context="<EXTREMELY_IMPORTANT>\nYou are agent-bober.\n\n**Below is the full content of your 'bober-using-bober' skill - your introduction to using bober skills. For all other skills, use the 'Skill' tool:**\n\n${using_bober_escaped}\n\n</EXTREMELY_IMPORTANT>"
30
+
31
+ # Output context injection as JSON.
32
+ # Uses printf instead of heredoc to work around bash 5.3+ heredoc hang.
33
+ # See: https://github.com/obra/superpowers/issues/571
34
+ if [ -n "${CURSOR_PLUGIN_ROOT:-}" ]; then
35
+ printf '{\n "additional_context": "%s"\n}\n' "$session_context"
36
+ elif [ -n "${CLAUDE_PLUGIN_ROOT:-}" ] && [ -z "${COPILOT_CLI:-}" ]; then
37
+ printf '{\n "hookSpecificOutput": {\n "hookEventName": "SessionStart",\n "additionalContext": "%s"\n }\n}\n' "$session_context"
38
+ else
39
+ printf '{\n "additionalContext": "%s"\n}\n' "$session_context"
40
+ fi
41
+
42
+ exit 0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-bober",
3
- "version": "0.11.6",
3
+ "version": "0.15.0",
4
4
  "description": "Multi-agent harness for building applications autonomously with any LLM. Researcher, Planner, Curator, Generator, Evaluator pipeline. Supports Claude, GPT, Gemini, Ollama. MCP server for Cursor/Windsurf.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -53,10 +53,11 @@
53
53
  "templates/",
54
54
  ".claude-plugin/",
55
55
  "README.md",
56
+ "CHANGELOG.md",
56
57
  "LICENSE"
57
58
  ],
58
59
  "dependencies": {
59
- "@anthropic-ai/sdk": "^0.39.0",
60
+ "@anthropic-ai/sdk": "^0.100.1",
60
61
  "@modelcontextprotocol/sdk": "^1.28.0",
61
62
  "chalk": "^5.4.1",
62
63
  "commander": "^13.1.0",
@@ -64,6 +65,7 @@
64
65
  "glob": "^11.0.1",
65
66
  "ora": "^8.1.1",
66
67
  "prompts": "^2.4.2",
68
+ "semver": "^7.8.1",
67
69
  "zod": "^3.24.2"
68
70
  },
69
71
  "peerDependencies": {
@@ -82,9 +84,11 @@
82
84
  "@eslint/js": "^10.0.1",
83
85
  "@types/node": "^22.13.0",
84
86
  "@types/prompts": "^2.4.9",
87
+ "@types/semver": "^7.7.1",
85
88
  "@typescript-eslint/eslint-plugin": "^8.22.0",
86
89
  "@typescript-eslint/parser": "^8.22.0",
87
90
  "eslint": "^9.19.0",
91
+ "markdownlint-cli": "^0.48.0",
88
92
  "typescript": "^5.7.3",
89
93
  "vitest": "^3.0.5"
90
94
  }
@@ -54,6 +54,18 @@ else
54
54
  add_check "{\"name\":\"bober_dir\",\"status\":\"missing\",\"path\":\".bober/\",\"message\":\"No .bober/ directory. Run /bober-plan first.\"}"
55
55
  fi
56
56
 
57
+ # ── Optional check: tokensave (only if installed) ─────────────────
58
+ if command -v agent-bober &>/dev/null; then
59
+ ts_json=$(agent-bober graph check-prereq 2>/dev/null || echo '{"ok":false,"reason":"MISSING","hint":"agent-bober graph check-prereq failed"}')
60
+ # Normalize to the {name,status} shape used by other checks
61
+ if echo "$ts_json" | grep -q '"ok":true'; then
62
+ add_check "{\"name\":\"tokensave\",\"status\":\"ok\",\"detail\":$ts_json}"
63
+ else
64
+ # Tokensave missing is NOT a hard blocker for any current command — emit info-only
65
+ CHECKS+=("{\"name\":\"tokensave\",\"status\":\"optional\",\"detail\":$ts_json}")
66
+ fi
67
+ fi
68
+
57
69
  # ── Command-specific checks ───────────────────────────────────────
58
70
 
59
71
  case "$COMMAND" in
@@ -0,0 +1,167 @@
1
+ #!/usr/bin/env bash
2
+ # e2e-graph-smoke.sh — end-to-end smoke test for the tokensave graph integration.
3
+ #
4
+ # Prerequisites:
5
+ # - tokensave >= 6.0.0-beta.1 installed and on PATH
6
+ # - npm + node >= 18
7
+ #
8
+ # This script is gated in CI by checking for the tokensave binary.
9
+ # If tokensave is not available, the script exits 0 (skip, not fail).
10
+ #
11
+ # Usage:
12
+ # bash scripts/e2e-graph-smoke.sh
13
+ #
14
+ # The script:
15
+ # 1. Verifies tokensave is available
16
+ # 2. Builds the project
17
+ # 3. Creates a temp directory with a minimal project
18
+ # 4. Runs agent-bober init (brownfield) to get bober.config.json with graph.enabled=true
19
+ # 5. Runs agent-bober graph init
20
+ # 6. Runs agent-bober graph status — asserts ready=true in JSON output
21
+ # 7. Runs agent-bober onboard — asserts 5 files written
22
+ # 8. Runs agent-bober impact sandboxPath — asserts .bober/graph/impact/sandboxpath.md exists
23
+ # 9. Cleans up
24
+
25
+ set -euo pipefail
26
+
27
+ # ── Colors ────────────────────────────────────────────────────────────────────
28
+ RED='\033[0;31m'
29
+ GREEN='\033[0;32m'
30
+ CYAN='\033[0;36m'
31
+ YELLOW='\033[1;33m'
32
+ NC='\033[0m' # No Color
33
+
34
+ info() { echo -e "${CYAN}[smoke]${NC} $*"; }
35
+ ok() { echo -e "${GREEN}[OK]${NC} $*"; }
36
+ warn() { echo -e "${YELLOW}[SKIP]${NC} $*"; }
37
+ fail() { echo -e "${RED}[FAIL]${NC} $*" >&2; exit 1; }
38
+
39
+ # ── Gate: tokensave must be available ─────────────────────────────────────────
40
+ if ! command -v tokensave &>/dev/null; then
41
+ warn "tokensave binary not found — skipping e2e smoke test (install with: brew install aovestdipaperino/tap/tokensave)"
42
+ exit 0
43
+ fi
44
+
45
+ TOKENSAVE_VERSION=$(tokensave --version 2>&1 | head -1 || echo "unknown")
46
+ info "tokensave found: ${TOKENSAVE_VERSION}"
47
+
48
+ # ── Step 1: Build the project ─────────────────────────────────────────────────
49
+ REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
50
+ info "Building agent-bober from ${REPO_ROOT}..."
51
+ cd "${REPO_ROOT}"
52
+ npm run build 2>&1 | tail -5
53
+ ok "Build complete"
54
+
55
+ # ── Step 2: Create a temp test project ────────────────────────────────────────
56
+ TMP_DIR="$(mktemp -d)"
57
+ trap 'rm -rf "${TMP_DIR}"' EXIT
58
+ info "Temp project: ${TMP_DIR}"
59
+
60
+ # Initialise a minimal git repo so agent-bober can detect project root
61
+ cd "${TMP_DIR}"
62
+ git init -q
63
+ git commit --allow-empty -m "init" -q
64
+
65
+ # Write a minimal bober.config.json with graph.enabled=true
66
+ cat > bober.config.json <<'EOF'
67
+ {
68
+ "project": { "name": "smoke-test", "mode": "brownfield" },
69
+ "planner": { "model": "sonnet" },
70
+ "generator": { "model": "sonnet" },
71
+ "evaluator": { "strategies": [] },
72
+ "graph": { "enabled": true, "languageTier": "core" }
73
+ }
74
+ EOF
75
+
76
+ # Add a minimal TypeScript source file
77
+ mkdir -p src
78
+ cat > src/index.ts <<'EOF'
79
+ export function sandboxPath(root: string, p: string): string {
80
+ return `${root}/${p}`;
81
+ }
82
+ EOF
83
+
84
+ # Write a package.json so tokensave knows it is a Node project
85
+ cat > package.json <<'EOF'
86
+ { "name": "smoke-test", "version": "1.0.0" }
87
+ EOF
88
+
89
+ ok "Temp project created"
90
+
91
+ # ── Step 3: Link or use agent-bober ───────────────────────────────────────────
92
+ BOBER_BIN="${REPO_ROOT}/node_modules/.bin/agent-bober"
93
+ if [[ ! -f "${BOBER_BIN}" ]]; then
94
+ # If running from a global install
95
+ BOBER_BIN="agent-bober"
96
+ fi
97
+
98
+ # Use the built binary directly for hermetic execution
99
+ NODE_BIN="node ${REPO_ROOT}/dist/cli/index.js"
100
+
101
+ run_bober() {
102
+ ${NODE_BIN} "$@"
103
+ }
104
+
105
+ # ── Step 4: graph init ────────────────────────────────────────────────────────
106
+ info "Running: agent-bober graph init"
107
+ run_bober graph init
108
+ ok "graph init succeeded"
109
+
110
+ # ── Step 5: graph status ──────────────────────────────────────────────────────
111
+ info "Running: agent-bober graph status --json"
112
+ STATUS_JSON="$(run_bober graph status --json)"
113
+ info "Status output: ${STATUS_JSON}"
114
+
115
+ # The graph may not be 'ready' if tokensave hasn't fully indexed in CI,
116
+ # but the command should succeed (exit 0) and produce valid JSON.
117
+ echo "${STATUS_JSON}" | node -e "
118
+ const d = JSON.parse(require('fs').readFileSync('/dev/stdin','utf8'));
119
+ if (typeof d.indexedFileCount !== 'number') { console.error('Missing indexedFileCount'); process.exit(1); }
120
+ if (typeof d.stale !== 'boolean') { console.error('Missing stale'); process.exit(1); }
121
+ console.log('JSON shape OK');
122
+ " || fail "graph status --json produced invalid JSON"
123
+
124
+ ok "graph status succeeded"
125
+
126
+ # ── Step 6: onboard ───────────────────────────────────────────────────────────
127
+ info "Running: agent-bober onboard"
128
+ # onboard requires a live graph engine; run it and check artifacts
129
+ run_bober onboard || warn "onboard exited non-zero (graph may not be fully ready)"
130
+
131
+ ONBOARD_DIR="${TMP_DIR}/.bober/onboarding"
132
+ if [[ -d "${ONBOARD_DIR}" ]]; then
133
+ ARTIFACT_COUNT="$(ls "${ONBOARD_DIR}"/*.md 2>/dev/null | wc -l | tr -d ' ')"
134
+ if [[ "${ARTIFACT_COUNT}" -eq 5 ]]; then
135
+ ok "onboard wrote 5 artifacts"
136
+ else
137
+ warn "onboard wrote ${ARTIFACT_COUNT}/5 artifacts (graph may be warming up)"
138
+ fi
139
+ else
140
+ warn "onboard directory not created (graph engine may not be ready)"
141
+ fi
142
+
143
+ # ── Step 7: impact ────────────────────────────────────────────────────────────
144
+ info "Running: agent-bober impact sandboxPath"
145
+ run_bober impact sandboxPath || warn "impact exited non-zero (graph may not be fully ready)"
146
+
147
+ IMPACT_FILE="${TMP_DIR}/.bober/graph/impact/sandboxpath.md"
148
+ if [[ -f "${IMPACT_FILE}" ]]; then
149
+ ok "impact report written: .bober/graph/impact/sandboxpath.md"
150
+ # Verify required sections
151
+ if grep -q "^# Impact: sandboxPath" "${IMPACT_FILE}" && \
152
+ grep -q "^## Affected symbols" "${IMPACT_FILE}" && \
153
+ grep -q "^## Tests covering this symbol" "${IMPACT_FILE}"; then
154
+ ok "impact report has all required sections"
155
+ else
156
+ fail "impact report is missing required sections"
157
+ fi
158
+ else
159
+ warn "impact file not created (graph engine may not be ready)"
160
+ fi
161
+
162
+ # ── Done ──────────────────────────────────────────────────────────────────────
163
+ echo ""
164
+ ok "e2e-graph-smoke.sh completed"
165
+ echo ""
166
+ echo " Temp project: ${TMP_DIR} (cleaned up)"
167
+ echo " Tokensave: ${TOKENSAVE_VERSION}"