agent-bober 0.17.0 → 0.18.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 (364) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/CHANGELOG.md +25 -0
  4. package/README.md +169 -6
  5. package/dist/chat/answerer.d.ts +17 -0
  6. package/dist/chat/answerer.d.ts.map +1 -0
  7. package/dist/chat/answerer.js +52 -0
  8. package/dist/chat/answerer.js.map +1 -0
  9. package/dist/chat/approval-cursor.d.ts +25 -0
  10. package/dist/chat/approval-cursor.d.ts.map +1 -0
  11. package/dist/chat/approval-cursor.js +61 -0
  12. package/dist/chat/approval-cursor.js.map +1 -0
  13. package/dist/chat/approval-reader.d.ts +11 -0
  14. package/dist/chat/approval-reader.d.ts.map +1 -0
  15. package/dist/chat/approval-reader.js +20 -0
  16. package/dist/chat/approval-reader.js.map +1 -0
  17. package/dist/chat/careful-sidecar.d.ts +15 -0
  18. package/dist/chat/careful-sidecar.d.ts.map +1 -0
  19. package/dist/chat/careful-sidecar.js +39 -0
  20. package/dist/chat/careful-sidecar.js.map +1 -0
  21. package/dist/chat/chat-session.d.ts +129 -0
  22. package/dist/chat/chat-session.d.ts.map +1 -0
  23. package/dist/chat/chat-session.js +470 -0
  24. package/dist/chat/chat-session.js.map +1 -0
  25. package/dist/chat/completion-tailer.d.ts +27 -0
  26. package/dist/chat/completion-tailer.d.ts.map +1 -0
  27. package/dist/chat/completion-tailer.js +187 -0
  28. package/dist/chat/completion-tailer.js.map +1 -0
  29. package/dist/chat/conversation-store.d.ts +22 -0
  30. package/dist/chat/conversation-store.d.ts.map +1 -0
  31. package/dist/chat/conversation-store.js +66 -0
  32. package/dist/chat/conversation-store.js.map +1 -0
  33. package/dist/chat/cursor-store.d.ts +23 -0
  34. package/dist/chat/cursor-store.d.ts.map +1 -0
  35. package/dist/chat/cursor-store.js +42 -0
  36. package/dist/chat/cursor-store.js.map +1 -0
  37. package/dist/chat/pid-sidecar.d.ts +22 -0
  38. package/dist/chat/pid-sidecar.d.ts.map +1 -0
  39. package/dist/chat/pid-sidecar.js +42 -0
  40. package/dist/chat/pid-sidecar.js.map +1 -0
  41. package/dist/chat/roster-reader.d.ts +16 -0
  42. package/dist/chat/roster-reader.d.ts.map +1 -0
  43. package/dist/chat/roster-reader.js +39 -0
  44. package/dist/chat/roster-reader.js.map +1 -0
  45. package/dist/chat/run-spawner.d.ts +71 -0
  46. package/dist/chat/run-spawner.d.ts.map +1 -0
  47. package/dist/chat/run-spawner.js +121 -0
  48. package/dist/chat/run-spawner.js.map +1 -0
  49. package/dist/chat/slash-commands.d.ts +36 -0
  50. package/dist/chat/slash-commands.d.ts.map +1 -0
  51. package/dist/chat/slash-commands.js +133 -0
  52. package/dist/chat/slash-commands.js.map +1 -0
  53. package/dist/chat/steer-cleanup.d.ts +12 -0
  54. package/dist/chat/steer-cleanup.d.ts.map +1 -0
  55. package/dist/chat/steer-cleanup.js +60 -0
  56. package/dist/chat/steer-cleanup.js.map +1 -0
  57. package/dist/chat/turn-classifier.d.ts +43 -0
  58. package/dist/chat/turn-classifier.d.ts.map +1 -0
  59. package/dist/chat/turn-classifier.js +150 -0
  60. package/dist/chat/turn-classifier.js.map +1 -0
  61. package/dist/cli/commands/blackboard.d.ts +33 -0
  62. package/dist/cli/commands/blackboard.d.ts.map +1 -0
  63. package/dist/cli/commands/blackboard.js +114 -0
  64. package/dist/cli/commands/blackboard.js.map +1 -0
  65. package/dist/cli/commands/chat.d.ts +13 -0
  66. package/dist/cli/commands/chat.d.ts.map +1 -0
  67. package/dist/cli/commands/chat.js +43 -0
  68. package/dist/cli/commands/chat.js.map +1 -0
  69. package/dist/cli/commands/evolve.d.ts +18 -0
  70. package/dist/cli/commands/evolve.d.ts.map +1 -0
  71. package/dist/cli/commands/evolve.js +72 -0
  72. package/dist/cli/commands/evolve.js.map +1 -0
  73. package/dist/cli/commands/facts.d.ts +15 -0
  74. package/dist/cli/commands/facts.d.ts.map +1 -0
  75. package/dist/cli/commands/facts.js +213 -0
  76. package/dist/cli/commands/facts.js.map +1 -0
  77. package/dist/cli/commands/init.d.ts +9 -0
  78. package/dist/cli/commands/init.d.ts.map +1 -1
  79. package/dist/cli/commands/init.js +1 -1
  80. package/dist/cli/commands/init.js.map +1 -1
  81. package/dist/cli/commands/medical.d.ts +24 -0
  82. package/dist/cli/commands/medical.d.ts.map +1 -0
  83. package/dist/cli/commands/medical.js +132 -0
  84. package/dist/cli/commands/medical.js.map +1 -0
  85. package/dist/cli/commands/memory.d.ts +2 -1
  86. package/dist/cli/commands/memory.d.ts.map +1 -1
  87. package/dist/cli/commands/memory.js +94 -7
  88. package/dist/cli/commands/memory.js.map +1 -1
  89. package/dist/cli/commands/plan.d.ts.map +1 -1
  90. package/dist/cli/commands/plan.js +29 -3
  91. package/dist/cli/commands/plan.js.map +1 -1
  92. package/dist/cli/commands/replay.d.ts +17 -0
  93. package/dist/cli/commands/replay.d.ts.map +1 -0
  94. package/dist/cli/commands/replay.js +261 -0
  95. package/dist/cli/commands/replay.js.map +1 -0
  96. package/dist/cli/commands/run.d.ts +9 -0
  97. package/dist/cli/commands/run.d.ts.map +1 -1
  98. package/dist/cli/commands/run.js +27 -1
  99. package/dist/cli/commands/run.js.map +1 -1
  100. package/dist/cli/commands/sprint.d.ts.map +1 -1
  101. package/dist/cli/commands/sprint.js +17 -3
  102. package/dist/cli/commands/sprint.js.map +1 -1
  103. package/dist/cli/commands/update.d.ts +18 -0
  104. package/dist/cli/commands/update.d.ts.map +1 -0
  105. package/dist/cli/commands/update.js +81 -0
  106. package/dist/cli/commands/update.js.map +1 -0
  107. package/dist/cli/index.js +15 -0
  108. package/dist/cli/index.js.map +1 -1
  109. package/dist/config/defaults.d.ts.map +1 -1
  110. package/dist/config/defaults.js +8 -0
  111. package/dist/config/defaults.js.map +1 -1
  112. package/dist/config/role-providers.d.ts +1 -1
  113. package/dist/config/role-providers.d.ts.map +1 -1
  114. package/dist/config/role-providers.js +6 -1
  115. package/dist/config/role-providers.js.map +1 -1
  116. package/dist/config/schema.d.ts +467 -222
  117. package/dist/config/schema.d.ts.map +1 -1
  118. package/dist/config/schema.js +25 -0
  119. package/dist/config/schema.js.map +1 -1
  120. package/dist/contracts/eval-result.d.ts +84 -84
  121. package/dist/contracts/spec.d.ts +28 -28
  122. package/dist/contracts/sprint-contract.d.ts +4 -4
  123. package/dist/fleet/critic-deep.d.ts +53 -0
  124. package/dist/fleet/critic-deep.d.ts.map +1 -0
  125. package/dist/fleet/critic-deep.js +199 -0
  126. package/dist/fleet/critic-deep.js.map +1 -0
  127. package/dist/fleet/decomposer-deep-constants.d.ts +4 -0
  128. package/dist/fleet/decomposer-deep-constants.d.ts.map +1 -0
  129. package/dist/fleet/decomposer-deep-constants.js +14 -0
  130. package/dist/fleet/decomposer-deep-constants.js.map +1 -0
  131. package/dist/fleet/decomposer-deep-types.d.ts +8 -0
  132. package/dist/fleet/decomposer-deep-types.d.ts.map +1 -0
  133. package/dist/fleet/decomposer-deep-types.js +9 -0
  134. package/dist/fleet/decomposer-deep-types.js.map +1 -0
  135. package/dist/fleet/decomposer-deep.d.ts +51 -0
  136. package/dist/fleet/decomposer-deep.d.ts.map +1 -0
  137. package/dist/fleet/decomposer-deep.js +261 -0
  138. package/dist/fleet/decomposer-deep.js.map +1 -0
  139. package/dist/fleet/decomposer.d.ts +22 -0
  140. package/dist/fleet/decomposer.d.ts.map +1 -0
  141. package/dist/fleet/decomposer.js +144 -0
  142. package/dist/fleet/decomposer.js.map +1 -0
  143. package/dist/fleet/index.d.ts +93 -0
  144. package/dist/fleet/index.d.ts.map +1 -1
  145. package/dist/fleet/index.js +230 -2
  146. package/dist/fleet/index.js.map +1 -1
  147. package/dist/fleet/manifest-write.d.ts +30 -0
  148. package/dist/fleet/manifest-write.d.ts.map +1 -0
  149. package/dist/fleet/manifest-write.js +90 -0
  150. package/dist/fleet/manifest-write.js.map +1 -0
  151. package/dist/fleet/manifest.d.ts +6 -6
  152. package/dist/fleet/shared-blackboard.d.ts +51 -0
  153. package/dist/fleet/shared-blackboard.d.ts.map +1 -0
  154. package/dist/fleet/shared-blackboard.js +79 -0
  155. package/dist/fleet/shared-blackboard.js.map +1 -0
  156. package/dist/fleet/synthesis.d.ts +16 -0
  157. package/dist/fleet/synthesis.d.ts.map +1 -0
  158. package/dist/fleet/synthesis.js +22 -0
  159. package/dist/fleet/synthesis.js.map +1 -0
  160. package/dist/fleet/tier-policy.d.ts +18 -0
  161. package/dist/fleet/tier-policy.d.ts.map +1 -0
  162. package/dist/fleet/tier-policy.js +53 -0
  163. package/dist/fleet/tier-policy.js.map +1 -0
  164. package/dist/fleet/tool-role-guard.d.ts +24 -0
  165. package/dist/fleet/tool-role-guard.d.ts.map +1 -0
  166. package/dist/fleet/tool-role-guard.js +55 -0
  167. package/dist/fleet/tool-role-guard.js.map +1 -0
  168. package/dist/incident/resolution-verify.d.ts +4 -4
  169. package/dist/incident/types.d.ts +8 -8
  170. package/dist/mcp/run-manager.d.ts +9 -1
  171. package/dist/mcp/run-manager.d.ts.map +1 -1
  172. package/dist/mcp/run-manager.js.map +1 -1
  173. package/dist/medical/adapters/apple-health.d.ts +32 -0
  174. package/dist/medical/adapters/apple-health.d.ts.map +1 -0
  175. package/dist/medical/adapters/apple-health.js +100 -0
  176. package/dist/medical/adapters/apple-health.js.map +1 -0
  177. package/dist/medical/audit.d.ts +31 -0
  178. package/dist/medical/audit.d.ts.map +1 -0
  179. package/dist/medical/audit.js +56 -0
  180. package/dist/medical/audit.js.map +1 -0
  181. package/dist/medical/consent.d.ts +37 -0
  182. package/dist/medical/consent.d.ts.map +1 -0
  183. package/dist/medical/consent.js +73 -0
  184. package/dist/medical/consent.js.map +1 -0
  185. package/dist/medical/disclaimer.d.ts +11 -0
  186. package/dist/medical/disclaimer.d.ts.map +1 -0
  187. package/dist/medical/disclaimer.js +21 -0
  188. package/dist/medical/disclaimer.js.map +1 -0
  189. package/dist/medical/egress.d.ts +30 -0
  190. package/dist/medical/egress.d.ts.map +1 -0
  191. package/dist/medical/egress.js +50 -0
  192. package/dist/medical/egress.js.map +1 -0
  193. package/dist/medical/engine.d.ts +73 -0
  194. package/dist/medical/engine.d.ts.map +1 -0
  195. package/dist/medical/engine.js +333 -0
  196. package/dist/medical/engine.js.map +1 -0
  197. package/dist/medical/guardrails.d.ts +47 -0
  198. package/dist/medical/guardrails.d.ts.map +1 -0
  199. package/dist/medical/guardrails.js +92 -0
  200. package/dist/medical/guardrails.js.map +1 -0
  201. package/dist/medical/health-store.d.ts +80 -0
  202. package/dist/medical/health-store.d.ts.map +1 -0
  203. package/dist/medical/health-store.js +204 -0
  204. package/dist/medical/health-store.js.map +1 -0
  205. package/dist/medical/inference.d.ts +22 -0
  206. package/dist/medical/inference.d.ts.map +1 -0
  207. package/dist/medical/inference.js +39 -0
  208. package/dist/medical/inference.js.map +1 -0
  209. package/dist/medical/ingestion.d.ts +33 -0
  210. package/dist/medical/ingestion.d.ts.map +1 -0
  211. package/dist/medical/ingestion.js +52 -0
  212. package/dist/medical/ingestion.js.map +1 -0
  213. package/dist/medical/numerics.d.ts +66 -0
  214. package/dist/medical/numerics.d.ts.map +1 -0
  215. package/dist/medical/numerics.js +216 -0
  216. package/dist/medical/numerics.js.map +1 -0
  217. package/dist/medical/red-flag.d.ts +42 -0
  218. package/dist/medical/red-flag.d.ts.map +1 -0
  219. package/dist/medical/red-flag.js +161 -0
  220. package/dist/medical/red-flag.js.map +1 -0
  221. package/dist/medical/refusal.d.ts +46 -0
  222. package/dist/medical/refusal.d.ts.map +1 -0
  223. package/dist/medical/refusal.js +131 -0
  224. package/dist/medical/refusal.js.map +1 -0
  225. package/dist/medical/retrieval/grounding-critic.d.ts +34 -0
  226. package/dist/medical/retrieval/grounding-critic.d.ts.map +1 -0
  227. package/dist/medical/retrieval/grounding-critic.js +153 -0
  228. package/dist/medical/retrieval/grounding-critic.js.map +1 -0
  229. package/dist/medical/retrieval/literature.d.ts +78 -0
  230. package/dist/medical/retrieval/literature.d.ts.map +1 -0
  231. package/dist/medical/retrieval/literature.js +292 -0
  232. package/dist/medical/retrieval/literature.js.map +1 -0
  233. package/dist/medical/retrieval/medline-source.d.ts +72 -0
  234. package/dist/medical/retrieval/medline-source.d.ts.map +1 -0
  235. package/dist/medical/retrieval/medline-source.js +120 -0
  236. package/dist/medical/retrieval/medline-source.js.map +1 -0
  237. package/dist/medical/team.d.ts +15 -0
  238. package/dist/medical/team.d.ts.map +1 -0
  239. package/dist/medical/team.js +44 -0
  240. package/dist/medical/team.js.map +1 -0
  241. package/dist/medical/types.d.ts +175 -0
  242. package/dist/medical/types.d.ts.map +1 -0
  243. package/dist/medical/types.js +8 -0
  244. package/dist/medical/types.js.map +1 -0
  245. package/dist/medical/whoop/whoop-client.d.ts +114 -0
  246. package/dist/medical/whoop/whoop-client.d.ts.map +1 -0
  247. package/dist/medical/whoop/whoop-client.js +226 -0
  248. package/dist/medical/whoop/whoop-client.js.map +1 -0
  249. package/dist/medical/whoop/whoop-sync.d.ts +25 -0
  250. package/dist/medical/whoop/whoop-sync.d.ts.map +1 -0
  251. package/dist/medical/whoop/whoop-sync.js +97 -0
  252. package/dist/medical/whoop/whoop-sync.js.map +1 -0
  253. package/dist/medical/whoop/whoop-token.d.ts +44 -0
  254. package/dist/medical/whoop/whoop-token.d.ts.map +1 -0
  255. package/dist/medical/whoop/whoop-token.js +66 -0
  256. package/dist/medical/whoop/whoop-token.js.map +1 -0
  257. package/dist/orchestrator/context-handoff.d.ts +60 -60
  258. package/dist/orchestrator/contract-materialization.d.ts +33 -0
  259. package/dist/orchestrator/contract-materialization.d.ts.map +1 -0
  260. package/dist/orchestrator/contract-materialization.js +113 -0
  261. package/dist/orchestrator/contract-materialization.js.map +1 -0
  262. package/dist/orchestrator/memory/distill.d.ts +4 -1
  263. package/dist/orchestrator/memory/distill.d.ts.map +1 -1
  264. package/dist/orchestrator/memory/distill.js +41 -1
  265. package/dist/orchestrator/memory/distill.js.map +1 -1
  266. package/dist/orchestrator/memory/fact-detector.d.ts +61 -0
  267. package/dist/orchestrator/memory/fact-detector.d.ts.map +1 -0
  268. package/dist/orchestrator/memory/fact-detector.js +153 -0
  269. package/dist/orchestrator/memory/fact-detector.js.map +1 -0
  270. package/dist/orchestrator/memory/fact-judge.d.ts +19 -0
  271. package/dist/orchestrator/memory/fact-judge.d.ts.map +1 -0
  272. package/dist/orchestrator/memory/fact-judge.js +121 -0
  273. package/dist/orchestrator/memory/fact-judge.js.map +1 -0
  274. package/dist/orchestrator/memory/fact-retrieve.d.ts +52 -0
  275. package/dist/orchestrator/memory/fact-retrieve.d.ts.map +1 -0
  276. package/dist/orchestrator/memory/fact-retrieve.js +117 -0
  277. package/dist/orchestrator/memory/fact-retrieve.js.map +1 -0
  278. package/dist/orchestrator/memory/hygiene.d.ts +66 -0
  279. package/dist/orchestrator/memory/hygiene.d.ts.map +1 -0
  280. package/dist/orchestrator/memory/hygiene.js +153 -0
  281. package/dist/orchestrator/memory/hygiene.js.map +1 -0
  282. package/dist/orchestrator/memory/reconcile.d.ts +47 -0
  283. package/dist/orchestrator/memory/reconcile.d.ts.map +1 -0
  284. package/dist/orchestrator/memory/reconcile.js +116 -0
  285. package/dist/orchestrator/memory/reconcile.js.map +1 -0
  286. package/dist/orchestrator/memory/retrieve.d.ts +5 -3
  287. package/dist/orchestrator/memory/retrieve.d.ts.map +1 -1
  288. package/dist/orchestrator/memory/retrieve.js +9 -6
  289. package/dist/orchestrator/memory/retrieve.js.map +1 -1
  290. package/dist/orchestrator/pipeline.d.ts +19 -3
  291. package/dist/orchestrator/pipeline.d.ts.map +1 -1
  292. package/dist/orchestrator/pipeline.js +63 -52
  293. package/dist/orchestrator/pipeline.js.map +1 -1
  294. package/dist/orchestrator/planner-agent.d.ts.map +1 -1
  295. package/dist/orchestrator/planner-agent.js +16 -1
  296. package/dist/orchestrator/planner-agent.js.map +1 -1
  297. package/dist/orchestrator/selfimprove/eval-guards.d.ts +51 -0
  298. package/dist/orchestrator/selfimprove/eval-guards.d.ts.map +1 -0
  299. package/dist/orchestrator/selfimprove/eval-guards.js +120 -0
  300. package/dist/orchestrator/selfimprove/eval-guards.js.map +1 -0
  301. package/dist/orchestrator/selfimprove/gepa.d.ts +74 -0
  302. package/dist/orchestrator/selfimprove/gepa.d.ts.map +1 -0
  303. package/dist/orchestrator/selfimprove/gepa.js +227 -0
  304. package/dist/orchestrator/selfimprove/gepa.js.map +1 -0
  305. package/dist/orchestrator/selfimprove/replay-harness.d.ts +65 -0
  306. package/dist/orchestrator/selfimprove/replay-harness.d.ts.map +1 -0
  307. package/dist/orchestrator/selfimprove/replay-harness.js +134 -0
  308. package/dist/orchestrator/selfimprove/replay-harness.js.map +1 -0
  309. package/dist/orchestrator/selfimprove/replay-store.d.ts +45 -0
  310. package/dist/orchestrator/selfimprove/replay-store.d.ts.map +1 -0
  311. package/dist/orchestrator/selfimprove/replay-store.js +119 -0
  312. package/dist/orchestrator/selfimprove/replay-store.js.map +1 -0
  313. package/dist/orchestrator/selfimprove/replay-types.d.ts +32 -0
  314. package/dist/orchestrator/selfimprove/replay-types.d.ts.map +1 -0
  315. package/dist/orchestrator/selfimprove/replay-types.js +15 -0
  316. package/dist/orchestrator/selfimprove/replay-types.js.map +1 -0
  317. package/dist/orchestrator/workflow/engine.d.ts +3 -1
  318. package/dist/orchestrator/workflow/engine.d.ts.map +1 -1
  319. package/dist/orchestrator/workflow/selector.d.ts +18 -0
  320. package/dist/orchestrator/workflow/selector.d.ts.map +1 -1
  321. package/dist/orchestrator/workflow/selector.js +41 -0
  322. package/dist/orchestrator/workflow/selector.js.map +1 -1
  323. package/dist/orchestrator/workflow/ts-engine.d.ts +3 -1
  324. package/dist/orchestrator/workflow/ts-engine.d.ts.map +1 -1
  325. package/dist/orchestrator/workflow/ts-engine.js +2 -2
  326. package/dist/orchestrator/workflow/ts-engine.js.map +1 -1
  327. package/dist/orchestrator/workflow/workflow-engine.d.ts +3 -1
  328. package/dist/orchestrator/workflow/workflow-engine.d.ts.map +1 -1
  329. package/dist/orchestrator/workflow/workflow-engine.js +3 -3
  330. package/dist/orchestrator/workflow/workflow-engine.js.map +1 -1
  331. package/dist/state/facts.d.ts +110 -0
  332. package/dist/state/facts.d.ts.map +1 -0
  333. package/dist/state/facts.js +208 -0
  334. package/dist/state/facts.js.map +1 -0
  335. package/dist/state/guidance.d.ts +37 -0
  336. package/dist/state/guidance.d.ts.map +1 -0
  337. package/dist/state/guidance.js +144 -0
  338. package/dist/state/guidance.js.map +1 -0
  339. package/dist/state/history.d.ts +2 -2
  340. package/dist/state/index.d.ts +1 -1
  341. package/dist/state/index.d.ts.map +1 -1
  342. package/dist/state/index.js +1 -1
  343. package/dist/state/index.js.map +1 -1
  344. package/dist/state/memory.d.ts +43 -11
  345. package/dist/state/memory.d.ts.map +1 -1
  346. package/dist/state/memory.js +93 -15
  347. package/dist/state/memory.js.map +1 -1
  348. package/dist/state/pause.d.ts +47 -0
  349. package/dist/state/pause.d.ts.map +1 -0
  350. package/dist/state/pause.js +146 -0
  351. package/dist/state/pause.js.map +1 -0
  352. package/dist/state/sprint-state.d.ts +8 -0
  353. package/dist/state/sprint-state.d.ts.map +1 -1
  354. package/dist/state/sprint-state.js +32 -1
  355. package/dist/state/sprint-state.js.map +1 -1
  356. package/dist/teams/registry.d.ts +16 -0
  357. package/dist/teams/registry.d.ts.map +1 -0
  358. package/dist/teams/registry.js +53 -0
  359. package/dist/teams/registry.js.map +1 -0
  360. package/dist/teams/types.d.ts +25 -0
  361. package/dist/teams/types.d.ts.map +1 -0
  362. package/dist/teams/types.js +2 -0
  363. package/dist/teams/types.js.map +1 -0
  364. package/package.json +3 -1
@@ -70,8 +70,8 @@ export declare const ClarificationQuestionSchema: z.ZodObject<{
70
70
  */
71
71
  ambiguityWeight: z.ZodOptional<z.ZodNumber>;
72
72
  }, "strip", z.ZodTypeAny, {
73
- questionId: string;
74
73
  category: "other" | "scope" | "user-personas" | "data-model" | "tech-constraints" | "design-ux" | "integrations" | "non-functional" | "error-handling" | "integration-risk" | "pattern-conflict" | "regression-risk";
74
+ questionId: string;
75
75
  question: string;
76
76
  options?: {
77
77
  description: string;
@@ -80,8 +80,8 @@ export declare const ClarificationQuestionSchema: z.ZodObject<{
80
80
  recommendation?: string | undefined;
81
81
  ambiguityWeight?: number | undefined;
82
82
  }, {
83
- questionId: string;
84
83
  category: "other" | "scope" | "user-personas" | "data-model" | "tech-constraints" | "design-ux" | "integrations" | "non-functional" | "error-handling" | "integration-risk" | "pattern-conflict" | "regression-risk";
84
+ questionId: string;
85
85
  question: string;
86
86
  options?: {
87
87
  description: string;
@@ -100,15 +100,15 @@ export declare const ResolvedClarificationSchema: z.ZodObject<{
100
100
  /** Who answered: "user" (interactive) or "planner" (autonomous self-answer) */
101
101
  resolvedBy: z.ZodDefault<z.ZodEnum<["user", "planner"]>>;
102
102
  }, "strip", z.ZodTypeAny, {
103
- questionId: string;
104
103
  answer: string;
104
+ questionId: string;
105
105
  resolvedAt: string;
106
- resolvedBy: "planner" | "user";
106
+ resolvedBy: "user" | "planner";
107
107
  }, {
108
- questionId: string;
109
108
  answer: string;
109
+ questionId: string;
110
110
  resolvedAt: string;
111
- resolvedBy?: "planner" | "user" | undefined;
111
+ resolvedBy?: "user" | "planner" | undefined;
112
112
  }>;
113
113
  export type ResolvedClarification = z.infer<typeof ResolvedClarificationSchema>;
114
114
  export declare const FeatureSpecSchema: z.ZodObject<{
@@ -128,7 +128,7 @@ export declare const FeatureSpecSchema: z.ZodObject<{
128
128
  priority: "must-have" | "should-have" | "nice-to-have";
129
129
  acceptanceCriteria: string[];
130
130
  dependencies: string[];
131
- estimatedComplexity?: "medium" | "low" | "high" | undefined;
131
+ estimatedComplexity?: "high" | "medium" | "low" | undefined;
132
132
  estimatedSprints?: number | undefined;
133
133
  }, {
134
134
  description: string;
@@ -137,7 +137,7 @@ export declare const FeatureSpecSchema: z.ZodObject<{
137
137
  priority: "must-have" | "should-have" | "nice-to-have";
138
138
  acceptanceCriteria: string[];
139
139
  dependencies?: string[] | undefined;
140
- estimatedComplexity?: "medium" | "low" | "high" | undefined;
140
+ estimatedComplexity?: "high" | "medium" | "low" | undefined;
141
141
  estimatedSprints?: number | undefined;
142
142
  }>;
143
143
  export type FeatureSpec = z.infer<typeof FeatureSpecSchema>;
@@ -165,7 +165,7 @@ export declare const PlanSpecSchema: z.ZodObject<{
165
165
  priority: "must-have" | "should-have" | "nice-to-have";
166
166
  acceptanceCriteria: string[];
167
167
  dependencies: string[];
168
- estimatedComplexity?: "medium" | "low" | "high" | undefined;
168
+ estimatedComplexity?: "high" | "medium" | "low" | undefined;
169
169
  estimatedSprints?: number | undefined;
170
170
  }, {
171
171
  description: string;
@@ -174,7 +174,7 @@ export declare const PlanSpecSchema: z.ZodObject<{
174
174
  priority: "must-have" | "should-have" | "nice-to-have";
175
175
  acceptanceCriteria: string[];
176
176
  dependencies?: string[] | undefined;
177
- estimatedComplexity?: "medium" | "low" | "high" | undefined;
177
+ estimatedComplexity?: "high" | "medium" | "low" | undefined;
178
178
  estimatedSprints?: number | undefined;
179
179
  }>, "many">;
180
180
  assumptions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
@@ -211,8 +211,8 @@ export declare const PlanSpecSchema: z.ZodObject<{
211
211
  */
212
212
  ambiguityWeight: z.ZodOptional<z.ZodNumber>;
213
213
  }, "strip", z.ZodTypeAny, {
214
- questionId: string;
215
214
  category: "other" | "scope" | "user-personas" | "data-model" | "tech-constraints" | "design-ux" | "integrations" | "non-functional" | "error-handling" | "integration-risk" | "pattern-conflict" | "regression-risk";
215
+ questionId: string;
216
216
  question: string;
217
217
  options?: {
218
218
  description: string;
@@ -221,8 +221,8 @@ export declare const PlanSpecSchema: z.ZodObject<{
221
221
  recommendation?: string | undefined;
222
222
  ambiguityWeight?: number | undefined;
223
223
  }, {
224
- questionId: string;
225
224
  category: "other" | "scope" | "user-personas" | "data-model" | "tech-constraints" | "design-ux" | "integrations" | "non-functional" | "error-handling" | "integration-risk" | "pattern-conflict" | "regression-risk";
225
+ questionId: string;
226
226
  question: string;
227
227
  options?: {
228
228
  description: string;
@@ -241,15 +241,15 @@ export declare const PlanSpecSchema: z.ZodObject<{
241
241
  /** Who answered: "user" (interactive) or "planner" (autonomous self-answer) */
242
242
  resolvedBy: z.ZodDefault<z.ZodEnum<["user", "planner"]>>;
243
243
  }, "strip", z.ZodTypeAny, {
244
- questionId: string;
245
244
  answer: string;
245
+ questionId: string;
246
246
  resolvedAt: string;
247
- resolvedBy: "planner" | "user";
247
+ resolvedBy: "user" | "planner";
248
248
  }, {
249
- questionId: string;
250
249
  answer: string;
250
+ questionId: string;
251
251
  resolvedAt: string;
252
- resolvedBy?: "planner" | "user" | undefined;
252
+ resolvedBy?: "user" | "planner" | undefined;
253
253
  }>, "many">>;
254
254
  techStack: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
255
255
  techNotes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -261,8 +261,9 @@ export declare const PlanSpecSchema: z.ZodObject<{
261
261
  updatedAt: z.ZodString;
262
262
  completedAt: z.ZodOptional<z.ZodString>;
263
263
  }, "strip", z.ZodTypeAny, {
264
+ createdAt: string;
265
+ status: "completed" | "draft" | "needs-clarification" | "ready" | "in-progress" | "abandoned";
264
266
  mode: "greenfield" | "brownfield";
265
- status: "draft" | "needs-clarification" | "ready" | "in-progress" | "completed" | "abandoned";
266
267
  description: string;
267
268
  specId: string;
268
269
  version: number;
@@ -274,14 +275,14 @@ export declare const PlanSpecSchema: z.ZodObject<{
274
275
  priority: "must-have" | "should-have" | "nice-to-have";
275
276
  acceptanceCriteria: string[];
276
277
  dependencies: string[];
277
- estimatedComplexity?: "medium" | "low" | "high" | undefined;
278
+ estimatedComplexity?: "high" | "medium" | "low" | undefined;
278
279
  estimatedSprints?: number | undefined;
279
280
  }[];
280
281
  assumptions: string[];
281
282
  outOfScope: string[];
282
283
  clarificationQuestions: {
283
- questionId: string;
284
284
  category: "other" | "scope" | "user-personas" | "data-model" | "tech-constraints" | "design-ux" | "integrations" | "non-functional" | "error-handling" | "integration-risk" | "pattern-conflict" | "regression-risk";
285
+ questionId: string;
285
286
  question: string;
286
287
  options?: {
287
288
  description: string;
@@ -291,15 +292,14 @@ export declare const PlanSpecSchema: z.ZodObject<{
291
292
  ambiguityWeight?: number | undefined;
292
293
  }[];
293
294
  resolvedClarifications: {
294
- questionId: string;
295
295
  answer: string;
296
+ questionId: string;
296
297
  resolvedAt: string;
297
- resolvedBy: "planner" | "user";
298
+ resolvedBy: "user" | "planner";
298
299
  }[];
299
300
  techStack: string[];
300
301
  nonFunctionalRequirements: unknown[];
301
302
  constraints: string[];
302
- createdAt: string;
303
303
  updatedAt: string;
304
304
  ambiguityScore?: number | undefined;
305
305
  techNotes?: Record<string, unknown> | undefined;
@@ -307,8 +307,9 @@ export declare const PlanSpecSchema: z.ZodObject<{
307
307
  metadata?: Record<string, unknown> | undefined;
308
308
  completedAt?: string | undefined;
309
309
  }, {
310
+ createdAt: string;
311
+ status: "completed" | "draft" | "needs-clarification" | "ready" | "in-progress" | "abandoned";
310
312
  mode: "greenfield" | "brownfield";
311
- status: "draft" | "needs-clarification" | "ready" | "in-progress" | "completed" | "abandoned";
312
313
  description: string;
313
314
  specId: string;
314
315
  title: string;
@@ -319,18 +320,17 @@ export declare const PlanSpecSchema: z.ZodObject<{
319
320
  priority: "must-have" | "should-have" | "nice-to-have";
320
321
  acceptanceCriteria: string[];
321
322
  dependencies?: string[] | undefined;
322
- estimatedComplexity?: "medium" | "low" | "high" | undefined;
323
+ estimatedComplexity?: "high" | "medium" | "low" | undefined;
323
324
  estimatedSprints?: number | undefined;
324
325
  }[];
325
- createdAt: string;
326
326
  updatedAt: string;
327
327
  version?: number | undefined;
328
328
  assumptions?: string[] | undefined;
329
329
  outOfScope?: string[] | undefined;
330
330
  ambiguityScore?: number | undefined;
331
331
  clarificationQuestions?: {
332
- questionId: string;
333
332
  category: "other" | "scope" | "user-personas" | "data-model" | "tech-constraints" | "design-ux" | "integrations" | "non-functional" | "error-handling" | "integration-risk" | "pattern-conflict" | "regression-risk";
333
+ questionId: string;
334
334
  question: string;
335
335
  options?: {
336
336
  description: string;
@@ -340,10 +340,10 @@ export declare const PlanSpecSchema: z.ZodObject<{
340
340
  ambiguityWeight?: number | undefined;
341
341
  }[] | undefined;
342
342
  resolvedClarifications?: {
343
- questionId: string;
344
343
  answer: string;
344
+ questionId: string;
345
345
  resolvedAt: string;
346
- resolvedBy?: "planner" | "user" | undefined;
346
+ resolvedBy?: "user" | "planner" | undefined;
347
347
  }[] | undefined;
348
348
  techStack?: string[] | undefined;
349
349
  techNotes?: Record<string, unknown> | undefined;
@@ -96,7 +96,7 @@ export declare const SprintContractSchema: z.ZodObject<{
96
96
  startedAt: z.ZodOptional<z.ZodString>;
97
97
  completedAt: z.ZodOptional<z.ZodString>;
98
98
  }, "strip", z.ZodTypeAny, {
99
- status: "in-progress" | "completed" | "proposed" | "negotiating" | "agreed" | "evaluating" | "passed" | "failed" | "needs-rework";
99
+ status: "failed" | "completed" | "evaluating" | "in-progress" | "proposed" | "negotiating" | "agreed" | "passed" | "needs-rework";
100
100
  description: string;
101
101
  specId: string;
102
102
  title: string;
@@ -117,8 +117,8 @@ export declare const SprintContractSchema: z.ZodObject<{
117
117
  definitionOfDone: string;
118
118
  estimatedFiles: string[];
119
119
  iterationHistory: unknown[];
120
- ambiguityScore?: number | undefined;
121
120
  createdAt?: string | undefined;
121
+ ambiguityScore?: number | undefined;
122
122
  updatedAt?: string | undefined;
123
123
  completedAt?: string | undefined;
124
124
  generatorNotes?: string | undefined;
@@ -129,7 +129,7 @@ export declare const SprintContractSchema: z.ZodObject<{
129
129
  evalResults?: unknown[] | undefined;
130
130
  startedAt?: string | undefined;
131
131
  }, {
132
- status: "in-progress" | "completed" | "proposed" | "negotiating" | "agreed" | "evaluating" | "passed" | "failed" | "needs-rework";
132
+ status: "failed" | "completed" | "evaluating" | "in-progress" | "proposed" | "negotiating" | "agreed" | "passed" | "needs-rework";
133
133
  description: string;
134
134
  specId: string;
135
135
  title: string;
@@ -144,11 +144,11 @@ export declare const SprintContractSchema: z.ZodObject<{
144
144
  nonGoals: string[];
145
145
  stopConditions: string[];
146
146
  definitionOfDone: string;
147
+ createdAt?: string | undefined;
147
148
  features?: string[] | undefined;
148
149
  assumptions?: string[] | undefined;
149
150
  outOfScope?: string[] | undefined;
150
151
  ambiguityScore?: number | undefined;
151
- createdAt?: string | undefined;
152
152
  updatedAt?: string | undefined;
153
153
  completedAt?: string | undefined;
154
154
  dependsOn?: string[] | undefined;
@@ -0,0 +1,53 @@
1
+ import { z } from "zod";
2
+ import type { LLMClient } from "../providers/types.js";
3
+ import type { FleetManifest } from "./manifest.js";
4
+ import { type Outline } from "./decomposer-deep.js";
5
+ export declare const CRITIQUE_MAX_ROUNDS = 1;
6
+ export declare const CRITIQUE_PARSE_MAX_RETRIES = 1;
7
+ export declare const DEEP_CRITIQUE_MAX_TOTAL_CALLS: number;
8
+ export declare const CRITIQUE_SYSTEM_PROMPT = "You are an independent tech-lead reviewer evaluating a proposed fleet manifest for adequacy.\n\nA fleet manifest is a list of sub-project children, each with a folder name and a build task.\nYou did NOT author this manifest \u2014 it was produced by another agent. Review it as a third-party critic.\n\nOutput ONLY a single JSON object (no prose, no markdown fences, no tool calls) with EXACTLY this shape:\n{\n \"verdict\": \"approve\" | \"reject\",\n \"feedback\": \"<concise free-text feedback; empty string if approving>\"\n}\n\nRules:\n- \"verdict\" must be exactly \"approve\" or \"reject\" (no other values).\n- \"feedback\" must be a string (empty string is fine for an approval).\n- Approve if: the manifest has enough children to plausibly cover the outlined areas, each child has a clear folder and self-contained task, and there are no obvious duplicates or missing critical areas.\n- Reject if: the manifest is under-expanded (too few children for the number of outlined areas), children are vague or not self-contained, or critical areas from the outline are missing.\n- Output the JSON object and nothing else.";
9
+ export declare const CRITIQUE_COERCION_INSTRUCTION = "Your previous response was not a valid critique verdict.\nOutput ONLY a single JSON object (no prose, no markdown fences, no tool calls) with EXACTLY this shape:\n{\n \"verdict\": \"approve\" | \"reject\",\n \"feedback\": \"<concise free-text feedback; empty string if approving>\"\n}\n\nRules:\n- \"verdict\" must be exactly \"approve\" or \"reject\".\n- \"feedback\" must be a string.\n- Output the JSON object and nothing else.";
10
+ export declare const CritiqueVerdictSchema: z.ZodObject<{
11
+ verdict: z.ZodEnum<["approve", "reject"]>;
12
+ feedback: z.ZodString;
13
+ }, "strip", z.ZodTypeAny, {
14
+ feedback: string;
15
+ verdict: "approve" | "reject";
16
+ }, {
17
+ feedback: string;
18
+ verdict: "approve" | "reject";
19
+ }>;
20
+ export type CritiqueVerdict = z.infer<typeof CritiqueVerdictSchema>;
21
+ export type ValidateVerdictResult = {
22
+ ok: true;
23
+ verdict: CritiqueVerdict;
24
+ } | {
25
+ ok: false;
26
+ error: string;
27
+ };
28
+ export declare function validateVerdict(rawText: string): ValidateVerdictResult;
29
+ export declare function callCritic(input: {
30
+ client: LLMClient;
31
+ model: string;
32
+ goal: string;
33
+ outline: Outline;
34
+ candidate: FleetManifest;
35
+ priorText?: string;
36
+ formattedError?: string;
37
+ }): Promise<string>;
38
+ export declare function getCriticVerdict(input: {
39
+ client: LLMClient;
40
+ model: string;
41
+ goal: string;
42
+ outline: Outline;
43
+ candidate: FleetManifest;
44
+ }): Promise<CritiqueVerdict>;
45
+ export declare function runCritiqueLoop(input: {
46
+ client: LLMClient;
47
+ model: string;
48
+ goal: string;
49
+ outline: Outline;
50
+ baseline: FleetManifest;
51
+ expandMaxRetries: number;
52
+ }): Promise<FleetManifest>;
53
+ //# sourceMappingURL=critic-deep.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"critic-deep.d.ts","sourceRoot":"","sources":["../../src/fleet/critic-deep.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,SAAS,EAAW,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAK,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AC,KAAK,EAAE;IAC3C,MAAM,EAAE,SAAS,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,aAAa,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,GAAG,OAAO,CAAC,aAAa,CAAC,CAoDzB"}
@@ -0,0 +1,199 @@
1
+ import { z } from "zod";
2
+ import { runExpandStage, DEEP_MAX_TOTAL_CALLS, DEEP_EXPAND_MAX_RETRIES, } from "./decomposer-deep.js";
3
+ // ── Constants ────────────────────────────────────────────────────────
4
+ export const CRITIQUE_MAX_ROUNDS = 1;
5
+ export const CRITIQUE_PARSE_MAX_RETRIES = 1;
6
+ // bober: fixed budget = DEEP_MAX_TOTAL_CALLS + CRITIQUE_MAX_ROUNDS*((1+CRITIQUE_PARSE_MAX_RETRIES)+(1+DEEP_EXPAND_MAX_RETRIES)); raise CRITIQUE_MAX_ROUNDS if 1 round proves too few
7
+ export const DEEP_CRITIQUE_MAX_TOTAL_CALLS = DEEP_MAX_TOTAL_CALLS +
8
+ CRITIQUE_MAX_ROUNDS * ((1 + CRITIQUE_PARSE_MAX_RETRIES) + (1 + DEEP_EXPAND_MAX_RETRIES));
9
+ // ── Prompts ──────────────────────────────────────────────────────────
10
+ export const CRITIQUE_SYSTEM_PROMPT = `You are an independent tech-lead reviewer evaluating a proposed fleet manifest for adequacy.
11
+
12
+ A fleet manifest is a list of sub-project children, each with a folder name and a build task.
13
+ You did NOT author this manifest — it was produced by another agent. Review it as a third-party critic.
14
+
15
+ Output ONLY a single JSON object (no prose, no markdown fences, no tool calls) with EXACTLY this shape:
16
+ {
17
+ "verdict": "approve" | "reject",
18
+ "feedback": "<concise free-text feedback; empty string if approving>"
19
+ }
20
+
21
+ Rules:
22
+ - "verdict" must be exactly "approve" or "reject" (no other values).
23
+ - "feedback" must be a string (empty string is fine for an approval).
24
+ - Approve if: the manifest has enough children to plausibly cover the outlined areas, each child has a clear folder and self-contained task, and there are no obvious duplicates or missing critical areas.
25
+ - Reject if: the manifest is under-expanded (too few children for the number of outlined areas), children are vague or not self-contained, or critical areas from the outline are missing.
26
+ - Output the JSON object and nothing else.`;
27
+ export const CRITIQUE_COERCION_INSTRUCTION = `Your previous response was not a valid critique verdict.
28
+ Output ONLY a single JSON object (no prose, no markdown fences, no tool calls) with EXACTLY this shape:
29
+ {
30
+ "verdict": "approve" | "reject",
31
+ "feedback": "<concise free-text feedback; empty string if approving>"
32
+ }
33
+
34
+ Rules:
35
+ - "verdict" must be exactly "approve" or "reject".
36
+ - "feedback" must be a string.
37
+ - Output the JSON object and nothing else.`;
38
+ // ── Schema + types ───────────────────────────────────────────────────
39
+ export const CritiqueVerdictSchema = z.object({
40
+ verdict: z.enum(["approve", "reject"]),
41
+ feedback: z.string(),
42
+ });
43
+ // ── validateVerdict (NEVER throws) ───────────────────────────────────
44
+ export function validateVerdict(rawText) {
45
+ let parsed;
46
+ // Try direct parse first
47
+ try {
48
+ parsed = JSON.parse(rawText.trim());
49
+ }
50
+ catch {
51
+ // Try extracting JSON from markdown code fences
52
+ const fenceMatch = /```(?:json)?\s*\n?([\s\S]*?)\n?\s*```/.exec(rawText);
53
+ if (fenceMatch) {
54
+ try {
55
+ parsed = JSON.parse(fenceMatch[1].trim());
56
+ }
57
+ catch {
58
+ // Fall through
59
+ }
60
+ }
61
+ // Try finding the first { ... } block
62
+ if (!parsed) {
63
+ const braceStart = rawText.indexOf("{");
64
+ const braceEnd = rawText.lastIndexOf("}");
65
+ if (braceStart !== -1 && braceEnd > braceStart) {
66
+ try {
67
+ parsed = JSON.parse(rawText.slice(braceStart, braceEnd + 1));
68
+ }
69
+ catch {
70
+ return {
71
+ ok: false,
72
+ error: `No valid JSON object found in response. Raw: ${rawText.slice(0, 200)}`,
73
+ };
74
+ }
75
+ }
76
+ else {
77
+ return {
78
+ ok: false,
79
+ error: `No JSON object found in response. Raw: ${rawText.slice(0, 200)}`,
80
+ };
81
+ }
82
+ }
83
+ }
84
+ const result = CritiqueVerdictSchema.safeParse(parsed);
85
+ if (!result.success) {
86
+ const issues = result.error.issues
87
+ .map((i) => ` - ${i.path.join(".")}: ${i.message}`)
88
+ .join("\n");
89
+ return { ok: false, error: issues };
90
+ }
91
+ return { ok: true, verdict: result.data };
92
+ }
93
+ // ── Internal: one CRITIC call ────────────────────────────────────────
94
+ export async function callCritic(input) {
95
+ const { client, model, goal, outline, candidate, priorText, formattedError } = input;
96
+ // Fresh message array — NEVER extends the EXPAND conversation (LOCK1)
97
+ const firstUserContent = `Review this proposed fleet manifest as a third-party critic.\n\n` +
98
+ `Goal: ${goal}\n\n` +
99
+ `Outline:\n${JSON.stringify(outline)}\n\n` +
100
+ `Proposed manifest:\n${JSON.stringify(candidate)}`;
101
+ let messages;
102
+ if (priorText !== undefined && formattedError !== undefined) {
103
+ // Coercion retry: 3-message shape [user, assistant, user]
104
+ messages = [
105
+ { role: "user", content: firstUserContent },
106
+ { role: "assistant", content: priorText },
107
+ {
108
+ role: "user",
109
+ content: `${CRITIQUE_COERCION_INSTRUCTION}\n\nPrevious validation error:\n${formattedError}`,
110
+ },
111
+ ];
112
+ }
113
+ else {
114
+ // First turn: single user message
115
+ messages = [{ role: "user", content: firstUserContent }];
116
+ }
117
+ const response = await client.chat({
118
+ model,
119
+ system: CRITIQUE_SYSTEM_PROMPT,
120
+ messages,
121
+ jsonObjectMode: true,
122
+ });
123
+ return response.text;
124
+ }
125
+ // ── getCriticVerdict (fail-open on parse exhaustion) ─────────────────
126
+ export async function getCriticVerdict(input) {
127
+ const { client, model, goal, outline, candidate } = input;
128
+ const maxAttempts = 1 + CRITIQUE_PARSE_MAX_RETRIES;
129
+ let lastError = "Unknown error";
130
+ let priorText;
131
+ for (let attempt = 0; attempt < maxAttempts; attempt++) {
132
+ const rawText = await callCritic({
133
+ client,
134
+ model,
135
+ goal,
136
+ outline,
137
+ candidate,
138
+ priorText: attempt > 0 ? priorText : undefined,
139
+ formattedError: attempt > 0 ? lastError : undefined,
140
+ });
141
+ const validated = validateVerdict(rawText);
142
+ if (validated.ok) {
143
+ return validated.verdict;
144
+ }
145
+ lastError = validated.error;
146
+ priorText = rawText;
147
+ }
148
+ // Fail-open: degrade to Phase-3 rather than blocking (ADR-3)
149
+ // bober: approve on parse exhaustion; upgrade path — add structured schema if model drift worsens
150
+ return { verdict: "approve", feedback: "" };
151
+ }
152
+ // ── runCritiqueLoop (never throws, accept-best on exhaustion) ─────────
153
+ export async function runCritiqueLoop(input) {
154
+ const { client, model, goal, outline, baseline, expandMaxRetries } = input;
155
+ // Track all structurally-valid candidates for accept-best on exhaustion
156
+ const candidates = [baseline];
157
+ let current = baseline;
158
+ // totalCriticRounds = CRITIQUE_MAX_ROUNDS re-expands means CRITIQUE_MAX_ROUNDS+1 critic calls
159
+ let reExpandsLeft = CRITIQUE_MAX_ROUNDS;
160
+ let continueLoop = true;
161
+ while (continueLoop) {
162
+ let verdict;
163
+ try {
164
+ verdict = await getCriticVerdict({ client, model, goal, outline, candidate: current });
165
+ }
166
+ catch {
167
+ // Transport failure — accept best, never throw (ADR-1)
168
+ break;
169
+ }
170
+ if (verdict.verdict === "approve") {
171
+ return current;
172
+ }
173
+ // Reject: re-expand with critique feedback if rounds remain
174
+ if (reExpandsLeft <= 0) {
175
+ // Round budget exhausted after critiquing re-expanded manifest — accept best
176
+ break;
177
+ }
178
+ reExpandsLeft -= 1;
179
+ try {
180
+ const reExpanded = await runExpandStage({
181
+ client,
182
+ model,
183
+ outline,
184
+ goal,
185
+ maxRetries: expandMaxRetries,
186
+ critiqueFeedback: verdict.feedback,
187
+ });
188
+ candidates.push(reExpanded);
189
+ current = reExpanded;
190
+ }
191
+ catch {
192
+ // Expand failure — accept best so far, never throw
193
+ break;
194
+ }
195
+ }
196
+ // Accept best: tiebreak by most children, then first-seen (baseline)
197
+ return candidates.reduce((best, c) => c.children.length > best.children.length ? c : best);
198
+ }
199
+ //# sourceMappingURL=critic-deep.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C;AACJ,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare const DEEP_PLAN_MAX_RETRIES = 1;
2
+ export declare const DEEP_EXPAND_MAX_RETRIES = 1;
3
+ export declare const DEEP_MAX_TOTAL_CALLS = 4;
4
+ //# sourceMappingURL=decomposer-deep-constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decomposer-deep-constants.d.ts","sourceRoot":"","sources":["../../src/fleet/decomposer-deep-constants.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,qBAAqB,IAAI,CAAC;AACvC,eAAO,MAAM,uBAAuB,IAAI,CAAC;AAEzC,eAAO,MAAM,oBAAoB,IAAI,CAAC"}
@@ -0,0 +1,14 @@
1
+ // bober: Leaf constants module — INTENTIONALLY has no imports.
2
+ //
3
+ // It exists to break the `decomposer-deep` <-> `critic-deep` module-init circular-import
4
+ // temporal-dead-zone crash (incident inc-20260620-cli-tdz-crash). `critic-deep.ts` reads
5
+ // DEEP_MAX_TOTAL_CALLS + DEEP_EXPAND_MAX_RETRIES at module-evaluation time to derive
6
+ // DEEP_CRITIQUE_MAX_TOTAL_CALLS; when those bindings lived in `decomposer-deep.ts` (which
7
+ // imports `runCritiqueLoop` back from `critic-deep.ts`), entering the graph via
8
+ // `decomposer-deep` first left them in their TDZ → ReferenceError, killing the whole CLI.
9
+ // Sourcing them from this dependency-free leaf makes the init-time reads order-independent.
10
+ export const DEEP_PLAN_MAX_RETRIES = 1;
11
+ export const DEEP_EXPAND_MAX_RETRIES = 1;
12
+ // bober: fixed budget = (1+DEEP_PLAN_MAX_RETRIES)+(1+DEEP_EXPAND_MAX_RETRIES); upgrade path: increase retries constants
13
+ export const DEEP_MAX_TOTAL_CALLS = 4;
14
+ //# sourceMappingURL=decomposer-deep-constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decomposer-deep-constants.js","sourceRoot":"","sources":["../../src/fleet/decomposer-deep-constants.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,EAAE;AACF,yFAAyF;AACzF,yFAAyF;AACzF,qFAAqF;AACrF,0FAA0F;AAC1F,gFAAgF;AAChF,0FAA0F;AAC1F,4FAA4F;AAC5F,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC;AACvC,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC;AACzC,wHAAwH;AACxH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ export type OutlineArea = {
2
+ name: string;
3
+ intent: string;
4
+ };
5
+ export type Outline = {
6
+ areas: OutlineArea[];
7
+ };
8
+ //# sourceMappingURL=decomposer-deep-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decomposer-deep-types.d.ts","sourceRoot":"","sources":["../../src/fleet/decomposer-deep-types.ts"],"names":[],"mappings":"AAUA,MAAM,MAAM,WAAW,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAC3D,MAAM,MAAM,OAAO,GAAG;IAAE,KAAK,EAAE,WAAW,EAAE,CAAA;CAAE,CAAC"}
@@ -0,0 +1,9 @@
1
+ // bober: Leaf types module — INTENTIONALLY has no relative imports.
2
+ //
3
+ // It exists to break the `critic-deep` <-> `decomposer-deep` import cycle: critic-deep needs the
4
+ // `Outline` type but must NOT depend on decomposer-deep.ts (the cycle node). Hosting Outline here —
5
+ // a dependency-free leaf both modules can import — removes critic-deep's last edge to decomposer-deep
6
+ // (mirrors the ./decomposer-deep-constants.ts precedent that broke the init-time TDZ cycle,
7
+ // inc-20260620-cli-tdz-crash). decomposer-deep.ts re-exports these so its public surface is unchanged.
8
+ export {};
9
+ //# sourceMappingURL=decomposer-deep-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decomposer-deep-types.js","sourceRoot":"","sources":["../../src/fleet/decomposer-deep-types.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,EAAE;AACF,iGAAiG;AACjG,oGAAoG;AACpG,sGAAsG;AACtG,4FAA4F;AAC5F,uGAAuG"}
@@ -0,0 +1,51 @@
1
+ import type { FleetManifest } from "./manifest.js";
2
+ import type { LLMClient } from "../providers/types.js";
3
+ export declare const DEEP_PLAN_SYSTEM_PROMPT = "You are a tech-lead creating a coarse outline of independent sub-project areas for a high-level goal.\n\nOutput ONLY a single JSON object (no prose, no markdown fences, no tool calls) with EXACTLY this shape:\n{\n \"areas\": [\n { \"name\": \"<free-form area name>\", \"intent\": \"<what this sub-project area covers>\" }\n ]\n}\n\nRules:\n- \"name\" is a free-form label describing a major concern of the goal (e.g. \"Authentication\", \"Data Layer\", \"Web Frontend\").\n- \"intent\" is a concise description of what this area covers and why it is independent.\n- You MUST include at least 1 area.\n- Do NOT include folder names, kebab-case slugs, or implementation details \u2014 this is a coarse planning outline only.\n- Output the JSON object and nothing else.";
4
+ export declare const DEEP_PLAN_COERCION_INSTRUCTION = "Your previous response was not a valid outline.\nOutput ONLY a single JSON object (no prose, no markdown fences, no tool calls) with EXACTLY this shape:\n{\n \"areas\": [\n { \"name\": \"<free-form area name>\", \"intent\": \"<what this sub-project area covers>\" }\n ]\n}\n\nRules:\n- \"name\" must be a non-empty string describing a major concern of the goal.\n- \"intent\" must be a non-empty string describing what the area covers.\n- You MUST include at least 1 area.\n- Output the JSON object and nothing else.";
5
+ export declare const DEEP_EXPAND_SYSTEM_PROMPT = "You are a tech-lead expanding a coarse outline into independent, buildable sub-projects.\n\nOutput ONLY a single JSON object (no prose, no markdown fences, no tool calls) with EXACTLY this shape:\n{\n \"children\": [\n { \"folder\": \"<short-kebab-case-dir-name>\", \"task\": \"<self-contained build instruction>\" }\n ]\n}\n\nRules:\n- \"folder\" must be a short kebab-case directory name (e.g. \"api-server\", \"web-frontend\", \"cli-tool\").\n- \"task\" must be a complete, self-contained instruction that a code-generation agent can execute independently.\n- You MUST include at least 1 child.\n- Do NOT include \"config\", \"concurrency\", \"rootDir\", or \"provider\" keys anywhere in the output.\n- Each child carries ONLY \"folder\" and \"task\" \u2014 no other keys.\n- Output the JSON object and nothing else.";
6
+ export declare const DEEP_EXPAND_COERCION_INSTRUCTION = "Your previous response was not a valid fleet manifest.\nOutput ONLY a single JSON object (no prose, no markdown fences, no tool calls) with EXACTLY this shape:\n{\n \"children\": [\n { \"folder\": \"<short-kebab-case-dir-name>\", \"task\": \"<self-contained build instruction>\" }\n ]\n}\n\nRules:\n- \"folder\" must be a short kebab-case directory name.\n- \"task\" must be a complete, self-contained build instruction.\n- You MUST include at least 1 child.\n- Do NOT include \"config\", \"concurrency\", \"rootDir\", or \"provider\" keys anywhere in the output.\n- Each child carries ONLY \"folder\" and \"task\" \u2014 no other keys.\n- Output the JSON object and nothing else.";
7
+ export declare const DEEP_PLAN_MAX_RETRIES = 1;
8
+ export declare const DEEP_EXPAND_MAX_RETRIES = 1;
9
+ export declare const DEEP_MAX_TOTAL_CALLS = 4;
10
+ export type OutlineArea = {
11
+ name: string;
12
+ intent: string;
13
+ };
14
+ export type Outline = {
15
+ areas: OutlineArea[];
16
+ };
17
+ export interface DecomposeDeepInput {
18
+ goal: string;
19
+ client: LLMClient;
20
+ model: string;
21
+ count?: string;
22
+ planMaxRetries?: number;
23
+ expandMaxRetries?: number;
24
+ critique?: boolean;
25
+ }
26
+ type ValidateOutlineResult = {
27
+ ok: true;
28
+ outline: Outline;
29
+ } | {
30
+ ok: false;
31
+ error: string;
32
+ };
33
+ export declare function validateOutline(rawText: string): ValidateOutlineResult;
34
+ export declare function runPlanStage(input: {
35
+ client: LLMClient;
36
+ model: string;
37
+ goal: string;
38
+ count?: string;
39
+ maxRetries: number;
40
+ }): Promise<Outline>;
41
+ export declare function runExpandStage(input: {
42
+ client: LLMClient;
43
+ model: string;
44
+ outline: Outline;
45
+ goal: string;
46
+ maxRetries: number;
47
+ critiqueFeedback?: string;
48
+ }): Promise<FleetManifest>;
49
+ export declare function decomposeGoalDeep(input: DecomposeDeepInput): Promise<FleetManifest>;
50
+ export {};
51
+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