@jokerized/getresearchdone 0.4.1

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 (711) hide show
  1. package/.claude-plugin/plugin.json +103 -0
  2. package/README.md +211 -0
  3. package/agents/grd-baseline-assessor.md +684 -0
  4. package/agents/grd-code-reviewer.md +300 -0
  5. package/agents/grd-codebase-mapper.md +355 -0
  6. package/agents/grd-critique-agent.md +119 -0
  7. package/agents/grd-debugger.md +519 -0
  8. package/agents/grd-deep-diver.md +737 -0
  9. package/agents/grd-eval-planner.md +913 -0
  10. package/agents/grd-eval-reporter.md +717 -0
  11. package/agents/grd-executor.md +683 -0
  12. package/agents/grd-feasibility-analyst.md +624 -0
  13. package/agents/grd-integration-checker.md +367 -0
  14. package/agents/grd-knowledge-miner.md +81 -0
  15. package/agents/grd-migrator.md +88 -0
  16. package/agents/grd-phase-researcher.md +697 -0
  17. package/agents/grd-plan-checker.md +443 -0
  18. package/agents/grd-planner.md +1532 -0
  19. package/agents/grd-product-owner.md +562 -0
  20. package/agents/grd-project-researcher.md +513 -0
  21. package/agents/grd-research-synthesizer.md +273 -0
  22. package/agents/grd-roadmapper.md +798 -0
  23. package/agents/grd-surveyor.md +566 -0
  24. package/agents/grd-verifier.md +893 -0
  25. package/bin/gd.js +4 -0
  26. package/bin/gd.ts +227 -0
  27. package/bin/grd-manifest.js +4 -0
  28. package/bin/grd-manifest.ts +286 -0
  29. package/bin/grd-mcp-server.js +4 -0
  30. package/bin/grd-mcp-server.ts +124 -0
  31. package/bin/grd-tools.js +4 -0
  32. package/bin/grd-tools.ts +2471 -0
  33. package/bin/postinstall.js +4 -0
  34. package/bin/postinstall.ts +80 -0
  35. package/commands/add-phase.md +123 -0
  36. package/commands/add-todo.md +87 -0
  37. package/commands/assess-baseline.md +289 -0
  38. package/commands/autopilot.md +100 -0
  39. package/commands/autoplan.md +55 -0
  40. package/commands/check-todos.md +87 -0
  41. package/commands/compare-methods.md +262 -0
  42. package/commands/complete-milestone.md +225 -0
  43. package/commands/debug.md +372 -0
  44. package/commands/deep-dive.md +288 -0
  45. package/commands/discover.md +281 -0
  46. package/commands/discuss-phase.md +188 -0
  47. package/commands/discuss.md +55 -0
  48. package/commands/eval-report.md +310 -0
  49. package/commands/evolve.md +79 -0
  50. package/commands/execute-phase.md +1017 -0
  51. package/commands/feasibility.md +292 -0
  52. package/commands/help.md +407 -0
  53. package/commands/init.md +1508 -0
  54. package/commands/insert-phase.md +113 -0
  55. package/commands/iterate.md +327 -0
  56. package/commands/list-phase-assumptions.md +217 -0
  57. package/commands/long-term-roadmap.md +202 -0
  58. package/commands/map-codebase.md +111 -0
  59. package/commands/migrate.md +159 -0
  60. package/commands/new-milestone.md +169 -0
  61. package/commands/pause-work.md +83 -0
  62. package/commands/plan-milestone-gaps.md +373 -0
  63. package/commands/plan-phase.md +655 -0
  64. package/commands/principles.md +328 -0
  65. package/commands/product-plan.md +319 -0
  66. package/commands/progress.md +481 -0
  67. package/commands/quick.md +167 -0
  68. package/commands/reapply-patches.md +154 -0
  69. package/commands/remove-phase.md +97 -0
  70. package/commands/requirement.md +96 -0
  71. package/commands/resume-project.md +113 -0
  72. package/commands/settings.md +1144 -0
  73. package/commands/survey.md +242 -0
  74. package/commands/sync.md +246 -0
  75. package/commands/tracker-setup.md +322 -0
  76. package/commands/update.md +202 -0
  77. package/commands/verify-phase.md +335 -0
  78. package/commands/verify-work.md +701 -0
  79. package/commands/wireup.md +29 -0
  80. package/dist/bin/gd.d.ts +3 -0
  81. package/dist/bin/gd.d.ts.map +1 -0
  82. package/dist/bin/gd.js +178 -0
  83. package/dist/bin/gd.js.map +1 -0
  84. package/dist/bin/grd-manifest.d.ts +3 -0
  85. package/dist/bin/grd-manifest.d.ts.map +1 -0
  86. package/dist/bin/grd-manifest.js +202 -0
  87. package/dist/bin/grd-manifest.js.map +1 -0
  88. package/dist/bin/grd-mcp-server.d.ts +3 -0
  89. package/dist/bin/grd-mcp-server.d.ts.map +1 -0
  90. package/dist/bin/grd-mcp-server.js +71 -0
  91. package/dist/bin/grd-mcp-server.js.map +1 -0
  92. package/dist/bin/grd-tools.d.ts +3 -0
  93. package/dist/bin/grd-tools.d.ts.map +1 -0
  94. package/dist/bin/grd-tools.js +1680 -0
  95. package/dist/bin/grd-tools.js.map +1 -0
  96. package/dist/bin/postinstall.d.ts +3 -0
  97. package/dist/bin/postinstall.d.ts.map +1 -0
  98. package/dist/bin/postinstall.js +61 -0
  99. package/dist/bin/postinstall.js.map +1 -0
  100. package/dist/lib/autopilot-milestone.d.ts +2 -0
  101. package/dist/lib/autopilot-milestone.d.ts.map +1 -0
  102. package/dist/lib/autopilot-milestone.js +94 -0
  103. package/dist/lib/autopilot-milestone.js.map +1 -0
  104. package/dist/lib/autopilot-pipeline.d.ts +2 -0
  105. package/dist/lib/autopilot-pipeline.d.ts.map +1 -0
  106. package/dist/lib/autopilot-pipeline.js +830 -0
  107. package/dist/lib/autopilot-pipeline.js.map +1 -0
  108. package/dist/lib/autopilot-waves.d.ts +2 -0
  109. package/dist/lib/autopilot-waves.d.ts.map +1 -0
  110. package/dist/lib/autopilot-waves.js +266 -0
  111. package/dist/lib/autopilot-waves.js.map +1 -0
  112. package/dist/lib/autopilot.d.ts +2 -0
  113. package/dist/lib/autopilot.d.ts.map +1 -0
  114. package/dist/lib/autopilot.js +1314 -0
  115. package/dist/lib/autopilot.js.map +1 -0
  116. package/dist/lib/autoplan.d.ts +2 -0
  117. package/dist/lib/autoplan.d.ts.map +1 -0
  118. package/dist/lib/autoplan.js +198 -0
  119. package/dist/lib/autoplan.js.map +1 -0
  120. package/dist/lib/autoresearch.d.ts +2 -0
  121. package/dist/lib/autoresearch.d.ts.map +1 -0
  122. package/dist/lib/autoresearch.js +626 -0
  123. package/dist/lib/autoresearch.js.map +1 -0
  124. package/dist/lib/backend.d.ts +2 -0
  125. package/dist/lib/backend.d.ts.map +1 -0
  126. package/dist/lib/backend.js +1036 -0
  127. package/dist/lib/backend.js.map +1 -0
  128. package/dist/lib/benchmark.d.ts +99 -0
  129. package/dist/lib/benchmark.d.ts.map +1 -0
  130. package/dist/lib/benchmark.js +278 -0
  131. package/dist/lib/benchmark.js.map +1 -0
  132. package/dist/lib/citations.d.ts +2 -0
  133. package/dist/lib/citations.d.ts.map +1 -0
  134. package/dist/lib/citations.js +642 -0
  135. package/dist/lib/citations.js.map +1 -0
  136. package/dist/lib/cleanup.d.ts +2 -0
  137. package/dist/lib/cleanup.d.ts.map +1 -0
  138. package/dist/lib/cleanup.js +1222 -0
  139. package/dist/lib/cleanup.js.map +1 -0
  140. package/dist/lib/cli/adapters.d.ts +10 -0
  141. package/dist/lib/cli/adapters.d.ts.map +1 -0
  142. package/dist/lib/cli/adapters.js +27 -0
  143. package/dist/lib/cli/adapters.js.map +1 -0
  144. package/dist/lib/cli/agent.d.ts +17 -0
  145. package/dist/lib/cli/agent.d.ts.map +1 -0
  146. package/dist/lib/cli/agent.js +53 -0
  147. package/dist/lib/cli/agent.js.map +1 -0
  148. package/dist/lib/cli/index.d.ts +21 -0
  149. package/dist/lib/cli/index.d.ts.map +1 -0
  150. package/dist/lib/cli/index.js +264 -0
  151. package/dist/lib/cli/index.js.map +1 -0
  152. package/dist/lib/cli/output.d.ts +20 -0
  153. package/dist/lib/cli/output.d.ts.map +1 -0
  154. package/dist/lib/cli/output.js +22 -0
  155. package/dist/lib/cli/output.js.map +1 -0
  156. package/dist/lib/cli/scan-dispatch.d.ts +9 -0
  157. package/dist/lib/cli/scan-dispatch.d.ts.map +1 -0
  158. package/dist/lib/cli/scan-dispatch.js +107 -0
  159. package/dist/lib/cli/scan-dispatch.js.map +1 -0
  160. package/dist/lib/cli/tools.d.ts +16 -0
  161. package/dist/lib/cli/tools.d.ts.map +1 -0
  162. package/dist/lib/cli/tools.js +168 -0
  163. package/dist/lib/cli/tools.js.map +1 -0
  164. package/dist/lib/commands/_dashboard-parsers.d.ts +2 -0
  165. package/dist/lib/commands/_dashboard-parsers.d.ts.map +1 -0
  166. package/dist/lib/commands/_dashboard-parsers.js +192 -0
  167. package/dist/lib/commands/_dashboard-parsers.js.map +1 -0
  168. package/dist/lib/commands/analysis.d.ts +2 -0
  169. package/dist/lib/commands/analysis.d.ts.map +1 -0
  170. package/dist/lib/commands/analysis.js +1418 -0
  171. package/dist/lib/commands/analysis.js.map +1 -0
  172. package/dist/lib/commands/assumptions.d.ts +2 -0
  173. package/dist/lib/commands/assumptions.d.ts.map +1 -0
  174. package/dist/lib/commands/assumptions.js +166 -0
  175. package/dist/lib/commands/assumptions.js.map +1 -0
  176. package/dist/lib/commands/blame.d.ts +2 -0
  177. package/dist/lib/commands/blame.d.ts.map +1 -0
  178. package/dist/lib/commands/blame.js +133 -0
  179. package/dist/lib/commands/blame.js.map +1 -0
  180. package/dist/lib/commands/budget.d.ts +2 -0
  181. package/dist/lib/commands/budget.d.ts.map +1 -0
  182. package/dist/lib/commands/budget.js +100 -0
  183. package/dist/lib/commands/budget.js.map +1 -0
  184. package/dist/lib/commands/check-plans.d.ts +2 -0
  185. package/dist/lib/commands/check-plans.d.ts.map +1 -0
  186. package/dist/lib/commands/check-plans.js +190 -0
  187. package/dist/lib/commands/check-plans.js.map +1 -0
  188. package/dist/lib/commands/config.d.ts +2 -0
  189. package/dist/lib/commands/config.d.ts.map +1 -0
  190. package/dist/lib/commands/config.js +188 -0
  191. package/dist/lib/commands/config.js.map +1 -0
  192. package/dist/lib/commands/dashboard.d.ts +2 -0
  193. package/dist/lib/commands/dashboard.d.ts.map +1 -0
  194. package/dist/lib/commands/dashboard.js +466 -0
  195. package/dist/lib/commands/dashboard.js.map +1 -0
  196. package/dist/lib/commands/estimate.d.ts +2 -0
  197. package/dist/lib/commands/estimate.d.ts.map +1 -0
  198. package/dist/lib/commands/estimate.js +148 -0
  199. package/dist/lib/commands/estimate.js.map +1 -0
  200. package/dist/lib/commands/eval-diff.d.ts +2 -0
  201. package/dist/lib/commands/eval-diff.d.ts.map +1 -0
  202. package/dist/lib/commands/eval-diff.js +213 -0
  203. package/dist/lib/commands/eval-diff.js.map +1 -0
  204. package/dist/lib/commands/freshness.d.ts +2 -0
  205. package/dist/lib/commands/freshness.d.ts.map +1 -0
  206. package/dist/lib/commands/freshness.js +163 -0
  207. package/dist/lib/commands/freshness.js.map +1 -0
  208. package/dist/lib/commands/health.d.ts +2 -0
  209. package/dist/lib/commands/health.d.ts.map +1 -0
  210. package/dist/lib/commands/health.js +435 -0
  211. package/dist/lib/commands/health.js.map +1 -0
  212. package/dist/lib/commands/index.d.ts +2 -0
  213. package/dist/lib/commands/index.d.ts.map +1 -0
  214. package/dist/lib/commands/index.js +128 -0
  215. package/dist/lib/commands/index.js.map +1 -0
  216. package/dist/lib/commands/install.d.ts +56 -0
  217. package/dist/lib/commands/install.d.ts.map +1 -0
  218. package/dist/lib/commands/install.js +214 -0
  219. package/dist/lib/commands/install.js.map +1 -0
  220. package/dist/lib/commands/knowhow-aggregator.d.ts +2 -0
  221. package/dist/lib/commands/knowhow-aggregator.d.ts.map +1 -0
  222. package/dist/lib/commands/knowhow-aggregator.js +279 -0
  223. package/dist/lib/commands/knowhow-aggregator.js.map +1 -0
  224. package/dist/lib/commands/knowledge-search.d.ts +2 -0
  225. package/dist/lib/commands/knowledge-search.d.ts.map +1 -0
  226. package/dist/lib/commands/knowledge-search.js +113 -0
  227. package/dist/lib/commands/knowledge-search.js.map +1 -0
  228. package/dist/lib/commands/long-term-roadmap.d.ts +2 -0
  229. package/dist/lib/commands/long-term-roadmap.d.ts.map +1 -0
  230. package/dist/lib/commands/long-term-roadmap.js +272 -0
  231. package/dist/lib/commands/long-term-roadmap.js.map +1 -0
  232. package/dist/lib/commands/patterns.d.ts +91 -0
  233. package/dist/lib/commands/patterns.d.ts.map +1 -0
  234. package/dist/lib/commands/patterns.js +391 -0
  235. package/dist/lib/commands/patterns.js.map +1 -0
  236. package/dist/lib/commands/phase-info.d.ts +2 -0
  237. package/dist/lib/commands/phase-info.d.ts.map +1 -0
  238. package/dist/lib/commands/phase-info.js +509 -0
  239. package/dist/lib/commands/phase-info.js.map +1 -0
  240. package/dist/lib/commands/plan-lint.d.ts +56 -0
  241. package/dist/lib/commands/plan-lint.d.ts.map +1 -0
  242. package/dist/lib/commands/plan-lint.js +481 -0
  243. package/dist/lib/commands/plan-lint.js.map +1 -0
  244. package/dist/lib/commands/plan-phase.d.ts +53 -0
  245. package/dist/lib/commands/plan-phase.d.ts.map +1 -0
  246. package/dist/lib/commands/plan-phase.js +288 -0
  247. package/dist/lib/commands/plan-phase.js.map +1 -0
  248. package/dist/lib/commands/progress.d.ts +2 -0
  249. package/dist/lib/commands/progress.d.ts.map +1 -0
  250. package/dist/lib/commands/progress.js +266 -0
  251. package/dist/lib/commands/progress.js.map +1 -0
  252. package/dist/lib/commands/quality.d.ts +2 -0
  253. package/dist/lib/commands/quality.d.ts.map +1 -0
  254. package/dist/lib/commands/quality.js +80 -0
  255. package/dist/lib/commands/quality.js.map +1 -0
  256. package/dist/lib/commands/rollback.d.ts +2 -0
  257. package/dist/lib/commands/rollback.d.ts.map +1 -0
  258. package/dist/lib/commands/rollback.js +145 -0
  259. package/dist/lib/commands/rollback.js.map +1 -0
  260. package/dist/lib/commands/scan.d.ts +25 -0
  261. package/dist/lib/commands/scan.d.ts.map +1 -0
  262. package/dist/lib/commands/scan.js +28 -0
  263. package/dist/lib/commands/scan.js.map +1 -0
  264. package/dist/lib/commands/search.d.ts +2 -0
  265. package/dist/lib/commands/search.d.ts.map +1 -0
  266. package/dist/lib/commands/search.js +212 -0
  267. package/dist/lib/commands/search.js.map +1 -0
  268. package/dist/lib/commands/select-candidate.d.ts +128 -0
  269. package/dist/lib/commands/select-candidate.d.ts.map +1 -0
  270. package/dist/lib/commands/select-candidate.js +518 -0
  271. package/dist/lib/commands/select-candidate.js.map +1 -0
  272. package/dist/lib/commands/singularity.d.ts +2 -0
  273. package/dist/lib/commands/singularity.d.ts.map +1 -0
  274. package/dist/lib/commands/singularity.js +185 -0
  275. package/dist/lib/commands/singularity.js.map +1 -0
  276. package/dist/lib/commands/slug-timestamp.d.ts +2 -0
  277. package/dist/lib/commands/slug-timestamp.d.ts.map +1 -0
  278. package/dist/lib/commands/slug-timestamp.js +54 -0
  279. package/dist/lib/commands/slug-timestamp.js.map +1 -0
  280. package/dist/lib/commands/tail.d.ts +2 -0
  281. package/dist/lib/commands/tail.d.ts.map +1 -0
  282. package/dist/lib/commands/tail.js +100 -0
  283. package/dist/lib/commands/tail.js.map +1 -0
  284. package/dist/lib/commands/todo.d.ts +2 -0
  285. package/dist/lib/commands/todo.d.ts.map +1 -0
  286. package/dist/lib/commands/todo.js +200 -0
  287. package/dist/lib/commands/todo.js.map +1 -0
  288. package/dist/lib/commands/watch.d.ts +2 -0
  289. package/dist/lib/commands/watch.d.ts.map +1 -0
  290. package/dist/lib/commands/watch.js +72 -0
  291. package/dist/lib/commands/watch.js.map +1 -0
  292. package/dist/lib/complexity.d.ts +55 -0
  293. package/dist/lib/complexity.d.ts.map +1 -0
  294. package/dist/lib/complexity.js +80 -0
  295. package/dist/lib/complexity.js.map +1 -0
  296. package/dist/lib/context/agents.d.ts +2 -0
  297. package/dist/lib/context/agents.d.ts.map +1 -0
  298. package/dist/lib/context/agents.js +344 -0
  299. package/dist/lib/context/agents.js.map +1 -0
  300. package/dist/lib/context/base.d.ts +2 -0
  301. package/dist/lib/context/base.d.ts.map +1 -0
  302. package/dist/lib/context/base.js +81 -0
  303. package/dist/lib/context/base.js.map +1 -0
  304. package/dist/lib/context/execute.d.ts +2 -0
  305. package/dist/lib/context/execute.d.ts.map +1 -0
  306. package/dist/lib/context/execute.js +753 -0
  307. package/dist/lib/context/execute.js.map +1 -0
  308. package/dist/lib/context/index.d.ts +2 -0
  309. package/dist/lib/context/index.d.ts.map +1 -0
  310. package/dist/lib/context/index.js +88 -0
  311. package/dist/lib/context/index.js.map +1 -0
  312. package/dist/lib/context/progress.d.ts +2 -0
  313. package/dist/lib/context/progress.d.ts.map +1 -0
  314. package/dist/lib/context/progress.js +178 -0
  315. package/dist/lib/context/progress.js.map +1 -0
  316. package/dist/lib/context/project.d.ts +2 -0
  317. package/dist/lib/context/project.d.ts.map +1 -0
  318. package/dist/lib/context/project.js +413 -0
  319. package/dist/lib/context/project.js.map +1 -0
  320. package/dist/lib/context/research.d.ts +2 -0
  321. package/dist/lib/context/research.d.ts.map +1 -0
  322. package/dist/lib/context/research.js +466 -0
  323. package/dist/lib/context/research.js.map +1 -0
  324. package/dist/lib/dead-ends.d.ts +28 -0
  325. package/dist/lib/dead-ends.d.ts.map +1 -0
  326. package/dist/lib/dead-ends.js +451 -0
  327. package/dist/lib/dead-ends.js.map +1 -0
  328. package/dist/lib/deps.d.ts +2 -0
  329. package/dist/lib/deps.d.ts.map +1 -0
  330. package/dist/lib/deps.js +630 -0
  331. package/dist/lib/deps.js.map +1 -0
  332. package/dist/lib/discussion.d.ts +2 -0
  333. package/dist/lib/discussion.d.ts.map +1 -0
  334. package/dist/lib/discussion.js +1041 -0
  335. package/dist/lib/discussion.js.map +1 -0
  336. package/dist/lib/drift.d.ts +36 -0
  337. package/dist/lib/drift.d.ts.map +1 -0
  338. package/dist/lib/drift.js +481 -0
  339. package/dist/lib/drift.js.map +1 -0
  340. package/dist/lib/evolve/_dimensions-features.d.ts +2 -0
  341. package/dist/lib/evolve/_dimensions-features.d.ts.map +1 -0
  342. package/dist/lib/evolve/_dimensions-features.js +369 -0
  343. package/dist/lib/evolve/_dimensions-features.js.map +1 -0
  344. package/dist/lib/evolve/_dimensions.d.ts +2 -0
  345. package/dist/lib/evolve/_dimensions.d.ts.map +1 -0
  346. package/dist/lib/evolve/_dimensions.js +358 -0
  347. package/dist/lib/evolve/_dimensions.js.map +1 -0
  348. package/dist/lib/evolve/_product-ideation.d.ts +2 -0
  349. package/dist/lib/evolve/_product-ideation.d.ts.map +1 -0
  350. package/dist/lib/evolve/_product-ideation.js +281 -0
  351. package/dist/lib/evolve/_product-ideation.js.map +1 -0
  352. package/dist/lib/evolve/_prompts.d.ts +2 -0
  353. package/dist/lib/evolve/_prompts.d.ts.map +1 -0
  354. package/dist/lib/evolve/_prompts.js +153 -0
  355. package/dist/lib/evolve/_prompts.js.map +1 -0
  356. package/dist/lib/evolve/cli.d.ts +2 -0
  357. package/dist/lib/evolve/cli.d.ts.map +1 -0
  358. package/dist/lib/evolve/cli.js +224 -0
  359. package/dist/lib/evolve/cli.js.map +1 -0
  360. package/dist/lib/evolve/discovery.d.ts +2 -0
  361. package/dist/lib/evolve/discovery.d.ts.map +1 -0
  362. package/dist/lib/evolve/discovery.js +391 -0
  363. package/dist/lib/evolve/discovery.js.map +1 -0
  364. package/dist/lib/evolve/index.d.ts +2 -0
  365. package/dist/lib/evolve/index.d.ts.map +1 -0
  366. package/dist/lib/evolve/index.js +88 -0
  367. package/dist/lib/evolve/index.js.map +1 -0
  368. package/dist/lib/evolve/orchestrator.d.ts +2 -0
  369. package/dist/lib/evolve/orchestrator.d.ts.map +1 -0
  370. package/dist/lib/evolve/orchestrator.js +851 -0
  371. package/dist/lib/evolve/orchestrator.js.map +1 -0
  372. package/dist/lib/evolve/scoring.d.ts +2 -0
  373. package/dist/lib/evolve/scoring.d.ts.map +1 -0
  374. package/dist/lib/evolve/scoring.js +118 -0
  375. package/dist/lib/evolve/scoring.js.map +1 -0
  376. package/dist/lib/evolve/state.d.ts +2 -0
  377. package/dist/lib/evolve/state.d.ts.map +1 -0
  378. package/dist/lib/evolve/state.js +264 -0
  379. package/dist/lib/evolve/state.js.map +1 -0
  380. package/dist/lib/evolve/types.d.ts +249 -0
  381. package/dist/lib/evolve/types.d.ts.map +1 -0
  382. package/dist/lib/evolve/types.js +3 -0
  383. package/dist/lib/evolve/types.js.map +1 -0
  384. package/dist/lib/frontmatter.d.ts +2 -0
  385. package/dist/lib/frontmatter.d.ts.map +1 -0
  386. package/dist/lib/frontmatter.js +513 -0
  387. package/dist/lib/frontmatter.js.map +1 -0
  388. package/dist/lib/gates.d.ts +2 -0
  389. package/dist/lib/gates.d.ts.map +1 -0
  390. package/dist/lib/gates.js +578 -0
  391. package/dist/lib/gates.js.map +1 -0
  392. package/dist/lib/genome.d.ts +10 -0
  393. package/dist/lib/genome.d.ts.map +1 -0
  394. package/dist/lib/genome.js +368 -0
  395. package/dist/lib/genome.js.map +1 -0
  396. package/dist/lib/got.d.ts +2 -0
  397. package/dist/lib/got.d.ts.map +1 -0
  398. package/dist/lib/got.js +280 -0
  399. package/dist/lib/got.js.map +1 -0
  400. package/dist/lib/invariants.d.ts +2 -0
  401. package/dist/lib/invariants.d.ts.map +1 -0
  402. package/dist/lib/invariants.js +298 -0
  403. package/dist/lib/invariants.js.map +1 -0
  404. package/dist/lib/knowledge.d.ts +2 -0
  405. package/dist/lib/knowledge.d.ts.map +1 -0
  406. package/dist/lib/knowledge.js +658 -0
  407. package/dist/lib/knowledge.js.map +1 -0
  408. package/dist/lib/long-term-roadmap.d.ts +2 -0
  409. package/dist/lib/long-term-roadmap.d.ts.map +1 -0
  410. package/dist/lib/long-term-roadmap.js +602 -0
  411. package/dist/lib/long-term-roadmap.js.map +1 -0
  412. package/dist/lib/markdown-split.d.ts +2 -0
  413. package/dist/lib/markdown-split.d.ts.map +1 -0
  414. package/dist/lib/markdown-split.js +199 -0
  415. package/dist/lib/markdown-split.js.map +1 -0
  416. package/dist/lib/mcp-server.d.ts +2 -0
  417. package/dist/lib/mcp-server.d.ts.map +1 -0
  418. package/dist/lib/mcp-server.js +2424 -0
  419. package/dist/lib/mcp-server.js.map +1 -0
  420. package/dist/lib/metrics.d.ts +16 -0
  421. package/dist/lib/metrics.d.ts.map +1 -0
  422. package/dist/lib/metrics.js +48 -0
  423. package/dist/lib/metrics.js.map +1 -0
  424. package/dist/lib/overstory.d.ts +2 -0
  425. package/dist/lib/overstory.d.ts.map +1 -0
  426. package/dist/lib/overstory.js +211 -0
  427. package/dist/lib/overstory.js.map +1 -0
  428. package/dist/lib/parallel.d.ts +2 -0
  429. package/dist/lib/parallel.d.ts.map +1 -0
  430. package/dist/lib/parallel.js +349 -0
  431. package/dist/lib/parallel.js.map +1 -0
  432. package/dist/lib/paths.d.ts +2 -0
  433. package/dist/lib/paths.d.ts.map +1 -0
  434. package/dist/lib/paths.js +254 -0
  435. package/dist/lib/paths.js.map +1 -0
  436. package/dist/lib/phase-complete-llm.d.ts +22 -0
  437. package/dist/lib/phase-complete-llm.d.ts.map +1 -0
  438. package/dist/lib/phase-complete-llm.js +331 -0
  439. package/dist/lib/phase-complete-llm.js.map +1 -0
  440. package/dist/lib/phase-complete.d.ts +46 -0
  441. package/dist/lib/phase-complete.d.ts.map +1 -0
  442. package/dist/lib/phase-complete.js +278 -0
  443. package/dist/lib/phase-complete.js.map +1 -0
  444. package/dist/lib/phase-io.d.ts +2 -0
  445. package/dist/lib/phase-io.d.ts.map +1 -0
  446. package/dist/lib/phase-io.js +126 -0
  447. package/dist/lib/phase-io.js.map +1 -0
  448. package/dist/lib/phase.d.ts +2 -0
  449. package/dist/lib/phase.d.ts.map +1 -0
  450. package/dist/lib/phase.js +1344 -0
  451. package/dist/lib/phase.js.map +1 -0
  452. package/dist/lib/plan-tournament.d.ts +63 -0
  453. package/dist/lib/plan-tournament.d.ts.map +1 -0
  454. package/dist/lib/plan-tournament.js +353 -0
  455. package/dist/lib/plan-tournament.js.map +1 -0
  456. package/dist/lib/refinement.d.ts +74 -0
  457. package/dist/lib/refinement.d.ts.map +1 -0
  458. package/dist/lib/refinement.js +283 -0
  459. package/dist/lib/refinement.js.map +1 -0
  460. package/dist/lib/requirements.d.ts +2 -0
  461. package/dist/lib/requirements.d.ts.map +1 -0
  462. package/dist/lib/requirements.js +355 -0
  463. package/dist/lib/requirements.js.map +1 -0
  464. package/dist/lib/research-bundle.d.ts +2 -0
  465. package/dist/lib/research-bundle.d.ts.map +1 -0
  466. package/dist/lib/research-bundle.js +246 -0
  467. package/dist/lib/research-bundle.js.map +1 -0
  468. package/dist/lib/roadmap.d.ts +2 -0
  469. package/dist/lib/roadmap.d.ts.map +1 -0
  470. package/dist/lib/roadmap.js +541 -0
  471. package/dist/lib/roadmap.js.map +1 -0
  472. package/dist/lib/sample.d.ts +16 -0
  473. package/dist/lib/sample.d.ts.map +1 -0
  474. package/dist/lib/sample.js +20 -0
  475. package/dist/lib/sample.js.map +1 -0
  476. package/dist/lib/scaffold.d.ts +2 -0
  477. package/dist/lib/scaffold.d.ts.map +1 -0
  478. package/dist/lib/scaffold.js +355 -0
  479. package/dist/lib/scaffold.js.map +1 -0
  480. package/dist/lib/scan/_utils.d.ts +11 -0
  481. package/dist/lib/scan/_utils.d.ts.map +1 -0
  482. package/dist/lib/scan/_utils.js +36 -0
  483. package/dist/lib/scan/_utils.js.map +1 -0
  484. package/dist/lib/scan/base64.d.ts +15 -0
  485. package/dist/lib/scan/base64.d.ts.map +1 -0
  486. package/dist/lib/scan/base64.js +66 -0
  487. package/dist/lib/scan/base64.js.map +1 -0
  488. package/dist/lib/scan/ignorefile.d.ts +30 -0
  489. package/dist/lib/scan/ignorefile.d.ts.map +1 -0
  490. package/dist/lib/scan/ignorefile.js +101 -0
  491. package/dist/lib/scan/ignorefile.js.map +1 -0
  492. package/dist/lib/scan/injection.d.ts +14 -0
  493. package/dist/lib/scan/injection.d.ts.map +1 -0
  494. package/dist/lib/scan/injection.js +39 -0
  495. package/dist/lib/scan/injection.js.map +1 -0
  496. package/dist/lib/scan/patterns.d.ts +17 -0
  497. package/dist/lib/scan/patterns.d.ts.map +1 -0
  498. package/dist/lib/scan/patterns.js +123 -0
  499. package/dist/lib/scan/patterns.js.map +1 -0
  500. package/dist/lib/scan/strip-markdown.d.ts +7 -0
  501. package/dist/lib/scan/strip-markdown.d.ts.map +1 -0
  502. package/dist/lib/scan/strip-markdown.js +38 -0
  503. package/dist/lib/scan/strip-markdown.js.map +1 -0
  504. package/dist/lib/scan/types.d.ts +23 -0
  505. package/dist/lib/scan/types.d.ts.map +1 -0
  506. package/dist/lib/scan/types.js +3 -0
  507. package/dist/lib/scan/types.js.map +1 -0
  508. package/dist/lib/scheduler-wait.d.ts +2 -0
  509. package/dist/lib/scheduler-wait.d.ts.map +1 -0
  510. package/dist/lib/scheduler-wait.js +59 -0
  511. package/dist/lib/scheduler-wait.js.map +1 -0
  512. package/dist/lib/scheduler.d.ts +254 -0
  513. package/dist/lib/scheduler.d.ts.map +1 -0
  514. package/dist/lib/scheduler.js +1147 -0
  515. package/dist/lib/scheduler.js.map +1 -0
  516. package/dist/lib/state.d.ts +2 -0
  517. package/dist/lib/state.d.ts.map +1 -0
  518. package/dist/lib/state.js +744 -0
  519. package/dist/lib/state.js.map +1 -0
  520. package/dist/lib/think.d.ts +18 -0
  521. package/dist/lib/think.d.ts.map +1 -0
  522. package/dist/lib/think.js +317 -0
  523. package/dist/lib/think.js.map +1 -0
  524. package/dist/lib/tracker.d.ts +2 -0
  525. package/dist/lib/tracker.d.ts.map +1 -0
  526. package/dist/lib/tracker.js +1121 -0
  527. package/dist/lib/tracker.js.map +1 -0
  528. package/dist/lib/types.d.ts +1514 -0
  529. package/dist/lib/types.d.ts.map +1 -0
  530. package/dist/lib/types.js +4 -0
  531. package/dist/lib/types.js.map +1 -0
  532. package/dist/lib/utils.d.ts +2 -0
  533. package/dist/lib/utils.d.ts.map +1 -0
  534. package/dist/lib/utils.js +1363 -0
  535. package/dist/lib/utils.js.map +1 -0
  536. package/dist/lib/verify.d.ts +2 -0
  537. package/dist/lib/verify.d.ts.map +1 -0
  538. package/dist/lib/verify.js +1153 -0
  539. package/dist/lib/verify.js.map +1 -0
  540. package/dist/lib/wireup/autofix.d.ts +2 -0
  541. package/dist/lib/wireup/autofix.d.ts.map +1 -0
  542. package/dist/lib/wireup/autofix.js +188 -0
  543. package/dist/lib/wireup/autofix.js.map +1 -0
  544. package/dist/lib/wireup/cli.d.ts +2 -0
  545. package/dist/lib/wireup/cli.d.ts.map +1 -0
  546. package/dist/lib/wireup/cli.js +194 -0
  547. package/dist/lib/wireup/cli.js.map +1 -0
  548. package/dist/lib/wireup/detection.d.ts +47 -0
  549. package/dist/lib/wireup/detection.d.ts.map +1 -0
  550. package/dist/lib/wireup/detection.js +410 -0
  551. package/dist/lib/wireup/detection.js.map +1 -0
  552. package/dist/lib/wireup/discovery.d.ts +2 -0
  553. package/dist/lib/wireup/discovery.d.ts.map +1 -0
  554. package/dist/lib/wireup/discovery.js +934 -0
  555. package/dist/lib/wireup/discovery.js.map +1 -0
  556. package/dist/lib/wireup/execution.d.ts +2 -0
  557. package/dist/lib/wireup/execution.d.ts.map +1 -0
  558. package/dist/lib/wireup/execution.js +573 -0
  559. package/dist/lib/wireup/execution.js.map +1 -0
  560. package/dist/lib/wireup/index.d.ts +2 -0
  561. package/dist/lib/wireup/index.d.ts.map +1 -0
  562. package/dist/lib/wireup/index.js +85 -0
  563. package/dist/lib/wireup/index.js.map +1 -0
  564. package/dist/lib/wireup/orchestrator.d.ts +2 -0
  565. package/dist/lib/wireup/orchestrator.d.ts.map +1 -0
  566. package/dist/lib/wireup/orchestrator.js +366 -0
  567. package/dist/lib/wireup/orchestrator.js.map +1 -0
  568. package/dist/lib/wireup/report.d.ts +47 -0
  569. package/dist/lib/wireup/report.d.ts.map +1 -0
  570. package/dist/lib/wireup/report.js +201 -0
  571. package/dist/lib/wireup/report.js.map +1 -0
  572. package/dist/lib/wireup/scenarios.d.ts +2 -0
  573. package/dist/lib/wireup/scenarios.d.ts.map +1 -0
  574. package/dist/lib/wireup/scenarios.js +516 -0
  575. package/dist/lib/wireup/scenarios.js.map +1 -0
  576. package/dist/lib/wireup/state.d.ts +2 -0
  577. package/dist/lib/wireup/state.d.ts.map +1 -0
  578. package/dist/lib/wireup/state.js +102 -0
  579. package/dist/lib/wireup/state.js.map +1 -0
  580. package/dist/lib/wireup/types.d.ts +376 -0
  581. package/dist/lib/wireup/types.d.ts.map +1 -0
  582. package/dist/lib/wireup/types.js +3 -0
  583. package/dist/lib/wireup/types.js.map +1 -0
  584. package/dist/lib/worktree.d.ts +2 -0
  585. package/dist/lib/worktree.d.ts.map +1 -0
  586. package/dist/lib/worktree.js +999 -0
  587. package/dist/lib/worktree.js.map +1 -0
  588. package/lib/autopilot-milestone.ts +136 -0
  589. package/lib/autopilot-pipeline.ts +1179 -0
  590. package/lib/autopilot-waves.ts +361 -0
  591. package/lib/autopilot.ts +1874 -0
  592. package/lib/autoplan.ts +280 -0
  593. package/lib/autoresearch.js +4 -0
  594. package/lib/autoresearch.ts +886 -0
  595. package/lib/backend.ts +1252 -0
  596. package/lib/benchmark.ts +341 -0
  597. package/lib/citations.ts +760 -0
  598. package/lib/cleanup.ts +1588 -0
  599. package/lib/cli/adapters.ts +41 -0
  600. package/lib/cli/agent.ts +83 -0
  601. package/lib/cli/index.ts +273 -0
  602. package/lib/cli/output.ts +33 -0
  603. package/lib/cli/scan-dispatch.ts +130 -0
  604. package/lib/cli/tools.ts +198 -0
  605. package/lib/commands/_dashboard-parsers.ts +275 -0
  606. package/lib/commands/analysis.ts +1851 -0
  607. package/lib/commands/assumptions.ts +232 -0
  608. package/lib/commands/blame.ts +174 -0
  609. package/lib/commands/budget.ts +148 -0
  610. package/lib/commands/check-plans.ts +233 -0
  611. package/lib/commands/config.ts +287 -0
  612. package/lib/commands/dashboard.ts +680 -0
  613. package/lib/commands/estimate.ts +204 -0
  614. package/lib/commands/eval-diff.ts +252 -0
  615. package/lib/commands/freshness.ts +213 -0
  616. package/lib/commands/health.ts +607 -0
  617. package/lib/commands/index.ts +266 -0
  618. package/lib/commands/install.ts +307 -0
  619. package/lib/commands/knowhow-aggregator.ts +345 -0
  620. package/lib/commands/knowledge-search.ts +153 -0
  621. package/lib/commands/long-term-roadmap.ts +390 -0
  622. package/lib/commands/patterns.ts +465 -0
  623. package/lib/commands/phase-info.ts +698 -0
  624. package/lib/commands/plan-lint.ts +546 -0
  625. package/lib/commands/plan-phase.ts +375 -0
  626. package/lib/commands/progress.ts +319 -0
  627. package/lib/commands/quality.ts +138 -0
  628. package/lib/commands/rollback.ts +195 -0
  629. package/lib/commands/scan.ts +72 -0
  630. package/lib/commands/search.ts +300 -0
  631. package/lib/commands/select-candidate.ts +687 -0
  632. package/lib/commands/singularity.ts +222 -0
  633. package/lib/commands/slug-timestamp.ts +74 -0
  634. package/lib/commands/tail.ts +129 -0
  635. package/lib/commands/todo.ts +273 -0
  636. package/lib/commands/watch.ts +80 -0
  637. package/lib/complexity.ts +117 -0
  638. package/lib/context/agents.ts +505 -0
  639. package/lib/context/base.ts +123 -0
  640. package/lib/context/execute.ts +977 -0
  641. package/lib/context/index.ts +110 -0
  642. package/lib/context/progress.ts +278 -0
  643. package/lib/context/project.ts +531 -0
  644. package/lib/context/research.ts +646 -0
  645. package/lib/dead-ends.ts +506 -0
  646. package/lib/deps.ts +773 -0
  647. package/lib/discussion.ts +1275 -0
  648. package/lib/drift.ts +519 -0
  649. package/lib/evolve/_dimensions-features.ts +525 -0
  650. package/lib/evolve/_dimensions.ts +511 -0
  651. package/lib/evolve/_product-ideation.ts +405 -0
  652. package/lib/evolve/_prompts.ts +178 -0
  653. package/lib/evolve/cli.ts +330 -0
  654. package/lib/evolve/discovery.ts +571 -0
  655. package/lib/evolve/index.ts +105 -0
  656. package/lib/evolve/orchestrator.ts +1139 -0
  657. package/lib/evolve/scoring.ts +167 -0
  658. package/lib/evolve/state.ts +330 -0
  659. package/lib/evolve/types.ts +290 -0
  660. package/lib/frontmatter.ts +615 -0
  661. package/lib/gates.ts +695 -0
  662. package/lib/genome.ts +402 -0
  663. package/lib/got.js +4 -0
  664. package/lib/got.ts +361 -0
  665. package/lib/invariants.ts +378 -0
  666. package/lib/knowledge.ts +768 -0
  667. package/lib/long-term-roadmap.ts +806 -0
  668. package/lib/markdown-split.ts +273 -0
  669. package/lib/mcp-server.ts +3292 -0
  670. package/lib/metrics.ts +49 -0
  671. package/lib/overstory.ts +270 -0
  672. package/lib/parallel.ts +570 -0
  673. package/lib/paths.ts +293 -0
  674. package/lib/phase-complete-llm.ts +376 -0
  675. package/lib/phase-complete.ts +366 -0
  676. package/lib/phase-io.ts +101 -0
  677. package/lib/phase.ts +1981 -0
  678. package/lib/plan-tournament.ts +426 -0
  679. package/lib/refinement.ts +349 -0
  680. package/lib/requirements.ts +469 -0
  681. package/lib/research-bundle.ts +300 -0
  682. package/lib/roadmap.ts +775 -0
  683. package/lib/scaffold.ts +480 -0
  684. package/lib/scan/_utils.ts +37 -0
  685. package/lib/scan/base64.ts +90 -0
  686. package/lib/scan/ignorefile.ts +109 -0
  687. package/lib/scan/injection.ts +67 -0
  688. package/lib/scan/patterns.ts +139 -0
  689. package/lib/scan/strip-markdown.ts +39 -0
  690. package/lib/scan/types.ts +28 -0
  691. package/lib/scheduler-wait.ts +58 -0
  692. package/lib/scheduler.ts +1370 -0
  693. package/lib/state.ts +1000 -0
  694. package/lib/think.ts +365 -0
  695. package/lib/tracker.ts +1591 -0
  696. package/lib/types.ts +1663 -0
  697. package/lib/utils.ts +1479 -0
  698. package/lib/verify.ts +1434 -0
  699. package/lib/wireup/autofix.ts +241 -0
  700. package/lib/wireup/cli.ts +278 -0
  701. package/lib/wireup/detection.ts +542 -0
  702. package/lib/wireup/discovery.ts +1063 -0
  703. package/lib/wireup/execution.ts +686 -0
  704. package/lib/wireup/index.ts +117 -0
  705. package/lib/wireup/orchestrator.ts +519 -0
  706. package/lib/wireup/report.ts +286 -0
  707. package/lib/wireup/scenarios.ts +616 -0
  708. package/lib/wireup/state.ts +139 -0
  709. package/lib/wireup/types.ts +436 -0
  710. package/lib/worktree.ts +1309 -0
  711. package/package.json +67 -0
@@ -0,0 +1,1514 @@
1
+ /**
2
+ * GRD Core Type Definitions -- Shared interfaces and type aliases for the entire codebase
3
+ *
4
+ * This module is pure type definitions with no runtime code. It serves as the
5
+ * single source of truth for TypeScript interfaces used across all GRD modules.
6
+ *
7
+ * Pattern:
8
+ * - `module.exports = {}` allows `require('./types')` from JS modules (returns empty object)
9
+ * - `export type { ... }` allows `import type { ... } from './types'` from TS modules
10
+ *
11
+ * @module types
12
+ */
13
+ /**
14
+ * Valid backend identifiers for AI coding CLI detection.
15
+ */
16
+ export type BackendId = 'claude' | 'codex' | 'gemini' | 'opencode' | 'overstory' | 'superpowers' | 'grd';
17
+ /**
18
+ * Abstract model tiers mapped to backend-specific model names.
19
+ */
20
+ export type ModelTier = 'opus' | 'sonnet' | 'haiku';
21
+ /**
22
+ * Configuration profile names controlling model tier selection per agent.
23
+ */
24
+ export type ModelProfileName = 'quality' | 'balanced' | 'budget';
25
+ /**
26
+ * Token budget optimization preference, orthogonal to model_profile.
27
+ * - 'frugal': aggressively downgrade for cost savings
28
+ * - 'balanced': moderate adaptive downgrade (default)
29
+ * - 'quality': preserve tier unless budget is critical
30
+ */
31
+ export type TokenProfileName = 'frugal' | 'balanced' | 'quality';
32
+ /**
33
+ * Effort axis (v0.4 Phase 1). Orthogonal to model_profile and token_profile.
34
+ * Scales deterministic compute knobs — currently only the count of plan
35
+ * candidates generated per phase. Distinct from `EffortLevel`
36
+ * (low/medium/high), which controls per-agent Claude reasoning effort.
37
+ * - 'thrifty': 1 candidate per phase
38
+ * - 'balanced': 3 candidates per phase (default)
39
+ * - 'deep': 7 candidates per phase
40
+ */
41
+ export type EffortAxisLevel = 'thrifty' | 'balanced' | 'deep';
42
+ /**
43
+ * Names of effort-scaled knobs. v0.4 ships exactly one
44
+ * (candidates_per_plan_phase); v0.5+ may add more.
45
+ */
46
+ export type EffortKnobName = 'candidates_per_plan_phase';
47
+ /**
48
+ * Budget pressure classification based on rolling-window consumption.
49
+ * Thresholds are configurable via SchedulerConfig.budget_pressure_thresholds.
50
+ */
51
+ export type BudgetPressureLevel = 'none' | 'warning' | 'high' | 'critical';
52
+ /**
53
+ * Task complexity estimate used by adaptive model-tier routing.
54
+ * Produced by estimateComplexity() from lib/complexity.ts.
55
+ */
56
+ export type ComplexityLevel = 'low' | 'medium' | 'high';
57
+ /**
58
+ * Configurable thresholds for budget pressure classification. Values are
59
+ * ratios of (consumed + reserved) / budget. Defaults: 60%, 80%, 95%.
60
+ */
61
+ export interface BudgetPressureThresholds {
62
+ warning: number;
63
+ high: number;
64
+ critical: number;
65
+ }
66
+ /**
67
+ * Effort levels for controlling reasoning depth in supported backends.
68
+ * Claude Code v2.1.68+: low (fast), medium (default for Opus 4.6), high (ultrathink).
69
+ */
70
+ export type EffortLevel = 'low' | 'medium' | 'high';
71
+ /**
72
+ * Maps agent types to effort level selections per model profile.
73
+ * Parallels AgentModelProfiles but for the effort dimension.
74
+ */
75
+ export type AgentEffortProfiles = Record<string, Record<ModelProfileName, EffortLevel>>;
76
+ /**
77
+ * Maps abstract model tiers to backend-specific model name strings.
78
+ */
79
+ export interface ModelTierMap {
80
+ opus: string;
81
+ sonnet: string;
82
+ haiku: string;
83
+ }
84
+ /**
85
+ * Capability flags describing what orchestration features a backend supports.
86
+ * `subagents` can be boolean or string ('experimental') for partial support.
87
+ */
88
+ export interface BackendCapabilities {
89
+ subagents: boolean | string;
90
+ parallel: boolean;
91
+ teams: boolean;
92
+ hooks: boolean;
93
+ mcp: boolean;
94
+ native_worktree_isolation: boolean;
95
+ effort: boolean;
96
+ http_hooks: boolean;
97
+ cron: boolean;
98
+ smart_approvals: boolean;
99
+ plan_mode: boolean;
100
+ sandbox_gvisor: boolean;
101
+ sandbox_lxc: boolean;
102
+ mcp_elicitation: boolean;
103
+ model_overrides: boolean;
104
+ max_output_tokens: {
105
+ default: number;
106
+ upper_bound: number;
107
+ } | null;
108
+ }
109
+ /**
110
+ * Result of Chrome DevTools MCP availability detection.
111
+ */
112
+ export interface WebMcpResult {
113
+ available: boolean;
114
+ source: string;
115
+ reason?: string;
116
+ }
117
+ /**
118
+ * Result of Playwright MCP availability detection.
119
+ */
120
+ export interface PlaywrightResult {
121
+ available: boolean;
122
+ source: 'config' | 'env' | 'mcp-config' | 'default';
123
+ reason?: string;
124
+ }
125
+ /**
126
+ * Timeout configuration values in milliseconds.
127
+ */
128
+ export interface GrdTimeouts {
129
+ jest_ms: number;
130
+ lint_ms: number;
131
+ format_ms: number;
132
+ consistency_ms: number;
133
+ tracker_gh_ms: number;
134
+ tracker_auth_ms: number;
135
+ backend_detect_ms: number;
136
+ autopilot_check_ms: number;
137
+ autoresearch_test_ms: number;
138
+ autoresearch_coverage_ms: number;
139
+ autoresearch_lint_ms: number;
140
+ backend_probe_ms: number;
141
+ discussion_git_ms: number;
142
+ overstory_probe_ms: number;
143
+ overstory_install_ms: number;
144
+ }
145
+ /**
146
+ * Ceremony configuration for scale-adaptive workflow control.
147
+ */
148
+ export interface CeremonyConfig {
149
+ default_level?: 'auto' | 'light' | 'standard' | 'full';
150
+ phase_overrides?: Record<string, 'light' | 'standard' | 'full'>;
151
+ }
152
+ /**
153
+ * Role a backend plays in a multi-backend discussion round.
154
+ */
155
+ export type DiscussionRole = 'reviewer' | 'brainstormer' | 'verifier' | 'executor';
156
+ /**
157
+ * Maps discussion roles to the backend that fulfills each role.
158
+ * Partial — not all roles need to be assigned.
159
+ */
160
+ export type BackendRolesConfig = Partial<Record<DiscussionRole, BackendId>>;
161
+ /**
162
+ * Configuration for the cross-backend discussion feature.
163
+ * All fields have defaults; partial objects are merged with defaults in loadConfig().
164
+ */
165
+ export interface DiscussionConfig {
166
+ /** Whether discussion is enabled at all. Default: true */
167
+ enabled: boolean;
168
+ /** Run a discussion round before planning. Default: true */
169
+ before_planning: boolean;
170
+ /** Run a discussion round before execution. Default: false */
171
+ before_execution: boolean;
172
+ /** Number of rounds (clamped 1-3). Default: 2 */
173
+ max_rounds: number;
174
+ /** Per-round timeout in seconds. Default: 180 */
175
+ timeout_per_round_seconds: number;
176
+ /** Which backend synthesizes the final answer. Default: 'claude' */
177
+ synthesizer: BackendId;
178
+ }
179
+ /**
180
+ * Result of probing whether a backend CLI binary is on PATH.
181
+ */
182
+ export interface BackendAvailability {
183
+ available: boolean;
184
+ version: string | null;
185
+ }
186
+ /**
187
+ * Options for dispatching a prompt to a backend CLI subprocess.
188
+ */
189
+ export interface DispatchOptions {
190
+ /** Timeout in milliseconds. */
191
+ timeout_ms?: number;
192
+ /** Working directory for the subprocess. Defaults to process.cwd(). */
193
+ cwd?: string;
194
+ /** Model name override (backend-specific string). Optional. */
195
+ model?: string;
196
+ }
197
+ /**
198
+ * Typed response from a backend CLI subprocess dispatch.
199
+ */
200
+ export interface BackendResponse {
201
+ /** Which backend produced this response. */
202
+ backend: BackendId;
203
+ /** Trimmed stdout from the subprocess, or '' on error. */
204
+ response_text: string;
205
+ /** Wall-clock duration of the dispatch in milliseconds. */
206
+ duration_ms: number;
207
+ /** Stderr output or error message. Empty string on success. */
208
+ stderr?: string;
209
+ }
210
+ /**
211
+ * Result of detecting an elicitation (question/clarification request) in
212
+ * a backend subprocess output. Used by detectElicitation() in discussion.ts.
213
+ */
214
+ export interface ElicitationDetection {
215
+ /** The extracted question text (matched line or combined lines for numbered options) */
216
+ question: string;
217
+ /** Which detection patterns matched (for debugging/logging) */
218
+ patterns: string[];
219
+ /** Confidence: 'high' for direct questions/numbered options/clarification phrases, 'medium' for option prompts */
220
+ confidence: 'high' | 'medium';
221
+ }
222
+ /**
223
+ * A single entry in a discussion round — either a successful backend response
224
+ * or a skipped entry when a participant was unavailable.
225
+ *
226
+ * Discriminated union: check `'skipped' in entry` to distinguish the two variants.
227
+ */
228
+ export type DiscussionRoundEntry = BackendResponse | {
229
+ backend: BackendId;
230
+ skipped: true;
231
+ reason: string;
232
+ };
233
+ /**
234
+ * Result of detecting an elicitation pattern in backend output.
235
+ * Used by the elicitation detection pipeline to identify when a backend
236
+ * is asking the user a question rather than executing autonomously.
237
+ */
238
+ export interface ElicitationDetection {
239
+ /** The extracted question text */
240
+ question: string;
241
+ /** Which detection patterns matched (for debugging/logging) */
242
+ patterns: string[];
243
+ /** Confidence: 'high' for direct questions, 'medium' for heuristic matches */
244
+ confidence: 'high' | 'medium';
245
+ }
246
+ /**
247
+ * Result returned by runDiscussion() after a multi-backend discussion completes.
248
+ */
249
+ export interface DiscussionResult {
250
+ /** The topic/question posed to all participants. */
251
+ topic: string;
252
+ /** Backend IDs of all requested participants (including skipped). */
253
+ participants: BackendId[];
254
+ /** Per-round array of participant responses. rounds[0] = round 1, etc. */
255
+ rounds: DiscussionRoundEntry[][];
256
+ /** Synthesizer backend response after round 1 collection. */
257
+ synthesis: BackendResponse;
258
+ /** Total wall-clock duration in milliseconds. */
259
+ duration_ms: number;
260
+ /** Absolute path to the written markdown history file. */
261
+ discussion_file: string;
262
+ }
263
+ /**
264
+ * Options for the runDiscussion() orchestration function.
265
+ * All fields are optional; defaults are applied by runDiscussion().
266
+ */
267
+ export interface RunDiscussionOptions {
268
+ /** Number of discussion rounds. Default: 2. Clamped to 1-3. */
269
+ rounds?: number;
270
+ /** Backend that synthesizes the final answer. Default: 'claude'. */
271
+ synthesizer?: BackendId;
272
+ /** Per-round timeout in seconds. Default: 180. */
273
+ timeout_per_round_seconds?: number;
274
+ /** Working directory for backend subprocesses. Default: process.cwd(). */
275
+ cwd?: string;
276
+ /** Phase identifier used in the output filename. Default: 'unknown'. */
277
+ phase?: string;
278
+ /** Type label used in the output filename. Default: 'discussion'. */
279
+ type?: string;
280
+ /** Milestone version string used to locate the discussions directory. Default: currentMilestone(cwd). */
281
+ milestone?: string | null;
282
+ }
283
+ /**
284
+ * A concern raised during a plan review.
285
+ * severity distinguishes blocking issues from minor suggestions.
286
+ */
287
+ export interface Concern {
288
+ description: string;
289
+ severity: 'blocker' | 'warning' | 'suggestion';
290
+ }
291
+ /**
292
+ * Result returned by reviewPlanViaBackend() after a plan is reviewed.
293
+ * Contains approval verdict, concerns list, and raw response for debugging.
294
+ */
295
+ export interface PlanReviewResult {
296
+ approved: boolean;
297
+ concerns: Concern[];
298
+ suggestions: string[];
299
+ reviewer_backend: BackendId;
300
+ duration_ms: number;
301
+ raw_response: string;
302
+ }
303
+ /**
304
+ * A single issue found during a code review.
305
+ * Includes file location, line range, and severity classification.
306
+ */
307
+ export interface ReviewIssue {
308
+ severity: 'blocker' | 'warning' | 'suggestion';
309
+ file: string;
310
+ line_range: string;
311
+ description: string;
312
+ }
313
+ /**
314
+ * Result returned by reviewCodeViaBackend() after a code diff is reviewed.
315
+ * Contains approval verdict, issues list, and raw response for debugging.
316
+ */
317
+ export interface CodeReviewResult {
318
+ approved: boolean;
319
+ issues: ReviewIssue[];
320
+ summary: string;
321
+ reviewer_backend: BackendId;
322
+ duration_ms: number;
323
+ raw_response: string;
324
+ }
325
+ /**
326
+ * A single PR review comment targeting a file and line.
327
+ * Used for posting structured feedback to GitHub PR review threads.
328
+ */
329
+ export interface PRReviewComment {
330
+ file: string;
331
+ line: number;
332
+ body: string;
333
+ severity: 'blocker' | 'warning' | 'suggestion';
334
+ }
335
+ /**
336
+ * Result returned by reviewPRViaBackend() after a PR diff is reviewed.
337
+ * Contains structured comments suitable for GitHub PR review posting.
338
+ */
339
+ export interface PRReviewResult {
340
+ comments: PRReviewComment[];
341
+ summary: string;
342
+ reviewer_backend: BackendId;
343
+ duration_ms: number;
344
+ raw_response: string;
345
+ }
346
+ /**
347
+ * Full GRD project configuration as returned by loadConfig().
348
+ * All fields are populated with defaults when not present in config.json.
349
+ */
350
+ export interface GrdConfig {
351
+ model_profile: ModelProfileName;
352
+ /**
353
+ * Token optimization preference (Spec 4). Controls adaptive model-tier
354
+ * routing behavior under budget pressure or low task complexity.
355
+ * Default: 'balanced'. Set via `gd settings token_profile <value>`.
356
+ */
357
+ token_profile?: TokenProfileName;
358
+ /**
359
+ * Effort axis (v0.4 Phase 1). Orthogonal to model_profile and token_profile.
360
+ * Scales the count of plan candidates generated per phase (1 / 3 / 7 for
361
+ * thrifty / balanced / deep). Default: 'balanced'. Set via
362
+ * `gd settings effort <value>`. The EFFORT_PROFILES table and
363
+ * resolveEffortKnob helper in lib/utils.ts are structured for v0.5+ to
364
+ * add more knobs without changing the API. Type `EffortAxisLevel` is
365
+ * intentionally distinct from `EffortLevel` (low/medium/high), which
366
+ * controls per-agent Claude reasoning effort and predates this field.
367
+ */
368
+ effort?: EffortAxisLevel;
369
+ commit_docs: boolean;
370
+ search_gitignored: boolean;
371
+ branching_strategy: string;
372
+ phase_branch_template: string;
373
+ milestone_branch_template: string;
374
+ base_branch: string;
375
+ research: boolean;
376
+ plan_checker: boolean;
377
+ verifier: boolean;
378
+ parallelization: boolean;
379
+ code_review_enabled: boolean;
380
+ code_review_timing: string;
381
+ code_review_severity_gate: string;
382
+ code_review_auto_fix_warnings: boolean;
383
+ use_teams: boolean;
384
+ team_timeout_minutes: number;
385
+ max_concurrent_teammates: number;
386
+ backend: string | undefined;
387
+ backend_models: Record<string, ModelTierMap> | undefined;
388
+ autonomous_mode: boolean;
389
+ ceremony: CeremonyConfig | undefined;
390
+ timeouts: GrdTimeouts;
391
+ evolve: EvolveConfig | undefined;
392
+ scheduler?: SchedulerConfig;
393
+ superpowers?: SuperpowersConfig;
394
+ backend_roles?: BackendRolesConfig;
395
+ discussion?: DiscussionConfig;
396
+ /** When true, plan-phase gate blocks on unresolved critical citation nodes. Default: false */
397
+ citation_gate?: boolean;
398
+ /** When true, run transitive citation gate during plan-phase (warning severity). Default: false */
399
+ transitive_citation_gate?: boolean;
400
+ /** When true, run post-phase metric-driven refinement loop. Default: false */
401
+ refinement_loop?: boolean;
402
+ /**
403
+ * Drift score config (Tier-2 #7 of Ouroboros integration). Weights for
404
+ * goal/constraint/ontology components, plus the threshold above which
405
+ * `gd health` flags the project as drifted. Defaults: 0.5/0.3/0.2 and
406
+ * threshold 0.3. Defined in lib/drift.ts DEFAULT_WEIGHTS.
407
+ */
408
+ drift?: {
409
+ weights?: {
410
+ goal: number;
411
+ constraint: number;
412
+ ontology: number;
413
+ };
414
+ threshold?: number;
415
+ };
416
+ /**
417
+ * Autopilot termination knobs (Tier-3 #10 of Ouroboros integration).
418
+ * Default: feature disabled. When `stop_on_ontology_convergence` is
419
+ * true, autopilot stops after a wave once `1 - ontology_drift` reaches
420
+ * `ontology_convergence_threshold` (default 0.95). Source: lib/drift.ts
421
+ * `computeOntologyDrift` over the project's SUMMARY vocab.
422
+ */
423
+ autopilot?: {
424
+ stop_on_ontology_convergence?: boolean;
425
+ ontology_convergence_threshold?: number;
426
+ };
427
+ /**
428
+ * When true, autopilot and `gd phase complete` invoke an LLM fallback
429
+ * if the mechanical phase-completion regex-based path fails. The
430
+ * fallback spawns Claude via the scheduler, gives it the current
431
+ * ROADMAP.md + STATE.md contents, and asks it to perform the edits.
432
+ *
433
+ * Default: false. Opt-in. When disabled, mechanical failures return
434
+ * null and log a hint advising manual recovery.
435
+ *
436
+ * Spec 3B of the gsd-2-selective-adoption milestone.
437
+ */
438
+ phase_complete_llm_fallback?: boolean;
439
+ /**
440
+ * Number of retry attempts for the LLM fallback path (Spec 3B) when
441
+ * the subprocess fails or verification doesn't confirm success.
442
+ * Uses exponential backoff: 2^attempt seconds between retries
443
+ * (2s, 4s, 8s, ...). Default: 0 (no retries — single attempt only).
444
+ */
445
+ phase_complete_llm_fallback_retries?: number;
446
+ /**
447
+ * Optional per-agent-type override of the baseline complexity used
448
+ * by estimateComplexity. Keys are agent type names (e.g.,
449
+ * 'grd-verifier'); values are 'low' | 'medium' | 'high'. When a
450
+ * key is present, its value takes precedence over the built-in
451
+ * AGENT_BASELINE_COMPLEXITY table.
452
+ *
453
+ * Example:
454
+ * agent_complexity_overrides: { 'my-custom-agent': 'high' }
455
+ */
456
+ agent_complexity_overrides?: Record<string, ComplexityLevel>;
457
+ /**
458
+ * Optional overrides for estimateComplexity's internal heuristic
459
+ * cutoffs. All fields are optional; missing fields use defaults.
460
+ */
461
+ complexity_heuristics?: {
462
+ /** Prompt length (chars) above which complexity promotes to 'high'. Default: 20000 */
463
+ prompt_length_high_threshold?: number;
464
+ /** Avg recent sample tokens below which 'high' demotes to 'medium'. Default: 3000 */
465
+ sample_demote_high_to_medium?: number;
466
+ /** Avg recent sample tokens below which 'medium' demotes to 'low'. Default: 1500 */
467
+ sample_demote_medium_to_low?: number;
468
+ /** Minimum number of recent samples needed to consider demotion. Default: 3 */
469
+ min_samples_for_demotion?: number;
470
+ };
471
+ }
472
+ export interface EvolveConfig {
473
+ auto_commit: boolean;
474
+ create_pr: boolean;
475
+ /**
476
+ * When true, evolve appends a `## Snapshot YYYY-MM-DD` block to
477
+ * `.planning/GENOME.md` at the end of each successful cycle (completed
478
+ * or converged). Off by default — opt in to avoid surprising existing
479
+ * users with new files. The snapshot is written via runGenomeSnapshot
480
+ * (lib/genome.ts) and skipped silently if GENOME.md is in split-index
481
+ * format. Tier-2 #8 auto-genome follow-up.
482
+ */
483
+ auto_genome_snapshot?: boolean;
484
+ }
485
+ /**
486
+ * Options for spawning a backend subprocess.
487
+ * Used by BackendAdapter and the scheduler spawn path.
488
+ */
489
+ export interface SpawnOpts {
490
+ timeout?: number;
491
+ maxTurns?: number;
492
+ model?: string;
493
+ outputFormat?: string;
494
+ captureOutput?: boolean;
495
+ captureStderr?: boolean;
496
+ cwd?: string;
497
+ workItemId?: string;
498
+ parallel?: boolean;
499
+ /**
500
+ * Optional agent type hint (e.g., 'grd-planner', 'grd-verifier').
501
+ * Recorded in UsageSample for per-agent complexity routing (M2).
502
+ * Optional for backward compatibility.
503
+ */
504
+ agentType?: string;
505
+ }
506
+ /**
507
+ * Configuration for the cross-backend rate limit scheduler.
508
+ * Controls backend priority, fallback, rate limits, and prediction parameters.
509
+ */
510
+ export interface SchedulerConfig {
511
+ backend_priority: AdapterBackendId[];
512
+ free_fallback: {
513
+ backend: AdapterBackendId;
514
+ model?: string;
515
+ };
516
+ backend_limits?: Record<string, {
517
+ tpm: number;
518
+ rpm?: number;
519
+ }>;
520
+ prediction: {
521
+ window_minutes: number;
522
+ ewma_alpha: number;
523
+ safety_margin_tasks: number;
524
+ min_samples: number;
525
+ };
526
+ /**
527
+ * Maximum wait time (in minutes) for account recovery via sample aging
528
+ * before falling through to free_fallback. Default: 90.
529
+ *
530
+ * When all priority accounts are exhausted, scheduler.spawn computes the
531
+ * soonest time any account will regain headroom (via sample window aging)
532
+ * and sleeps until then — unless that wait would exceed max_wait_minutes,
533
+ * in which case it falls through to today's free_fallback behavior.
534
+ *
535
+ * Set to 0 to disable the wait entirely (preserves pre-Spec 2A behavior).
536
+ * Set arbitrarily high (e.g., 10080 = 1 week) to effectively uncap.
537
+ */
538
+ max_wait_minutes?: number;
539
+ /**
540
+ * Thresholds for budget pressure classification (Spec 4). Each value
541
+ * is a ratio of (tokens_consumed_in_window + tokens_reserved) / token_budget.
542
+ * Defaults: { warning: 0.6, high: 0.8, critical: 0.95 }.
543
+ */
544
+ budget_pressure_thresholds?: BudgetPressureThresholds;
545
+ /**
546
+ * Maximum time (seconds) the scheduler will wait for a spawned backend
547
+ * subprocess to produce any stdout/stderr data before killing it.
548
+ * Default: 900 (15 minutes). Set arbitrarily high (e.g., 3600) to
549
+ * effectively disable. Set low to catch hangs faster.
550
+ *
551
+ * Distinct from `opts.timeout`, which is a total wall-clock upper
552
+ * bound. The idle timeout fires only when the subprocess is completely
553
+ * silent for the configured duration — legitimate streaming inference
554
+ * with progressive output is unaffected.
555
+ */
556
+ idle_timeout_seconds?: number;
557
+ /**
558
+ * Optional per-backend override of idle_timeout_seconds. If a backend
559
+ * has an entry here, it takes precedence over the global
560
+ * idle_timeout_seconds default. Example:
561
+ *
562
+ * idle_timeout_seconds_by_backend: { claude: 600, gemini: 1800 }
563
+ *
564
+ * Keys are backend IDs (claude, codex, gemini, opencode, etc.).
565
+ * Missing backends fall back to the global idle_timeout_seconds
566
+ * (default 900).
567
+ */
568
+ idle_timeout_seconds_by_backend?: Record<string, number>;
569
+ }
570
+ /**
571
+ * A single recorded usage sample from a backend spawn.
572
+ * Used for EWMA token prediction and rate limit tracking.
573
+ */
574
+ export interface UsageSample {
575
+ backend: BackendId;
576
+ stateKey?: string;
577
+ /** Agent type this sample was recorded for (M2). */
578
+ agentType?: string;
579
+ timestamp: number;
580
+ duration: number;
581
+ tokenEstimate: number;
582
+ exitCode: number;
583
+ workItemId: string;
584
+ }
585
+ /**
586
+ * Per-backend usage state tracked by the scheduler.
587
+ * Maintains sliding-window samples, EWMA estimates, and in-flight reservations.
588
+ */
589
+ export interface BackendUsageState {
590
+ samples: UsageSample[];
591
+ ewma_tokens_per_task: number;
592
+ tokens_consumed_in_window: number;
593
+ tokens_reserved: number;
594
+ in_flight_count: number;
595
+ token_budget: number;
596
+ budget_learned: boolean;
597
+ budget_confidence: number;
598
+ cooldown_until?: number;
599
+ }
600
+ /**
601
+ * Result returned by the scheduler after a backend spawn completes.
602
+ * Extends basic exit-code info with backend identity and token accounting.
603
+ */
604
+ export interface SchedulerSpawnResult {
605
+ exitCode: number;
606
+ /**
607
+ * Captured subprocess stdout. Populated whenever the backend subprocess
608
+ * writes to stdout; callers that pass captureOutput: true in SpawnOpts can
609
+ * rely on this field being set. Otherwise may be undefined or empty string.
610
+ */
611
+ stdout?: string;
612
+ stderr?: string;
613
+ timedOut: boolean;
614
+ /**
615
+ * True if the subprocess was killed because it exceeded the idle
616
+ * timeout (no stdout/stderr activity for `idle_timeout_seconds`).
617
+ * Distinct from `timedOut` which indicates total-timeout.
618
+ */
619
+ idleTimedOut?: boolean;
620
+ backend: BackendId;
621
+ tokensUsed: number;
622
+ workItemId: string;
623
+ /**
624
+ * Codex r15 P2: when the subprocess emitted a repeating-pattern
625
+ * output (bigram-Jaccard ≥ threshold for ≥3 consecutive chunks),
626
+ * the scheduler attaches a SpinDetectedEvent so autopilot can write
627
+ * a SPIN-REPORT.md with recovery suggestions.
628
+ */
629
+ spinEvent?: {
630
+ detected: boolean;
631
+ repeated_pattern: string;
632
+ consecutive_count: number;
633
+ max_similarity: number;
634
+ };
635
+ }
636
+ /**
637
+ * Adapter interface for a backend CLI (claude, codex, gemini, opencode, overstory).
638
+ * Encapsulates binary name, argument building, token parsing, and rate-limit detection.
639
+ */
640
+ export interface BackendAdapter {
641
+ binary: string;
642
+ buildArgs(prompt: string, opts: SpawnOpts): string[];
643
+ parseTokenUsage(stderr: string): number | null;
644
+ isRateLimited(exitCode: number, stderr: string): boolean;
645
+ }
646
+ /**
647
+ * Phase information returned by findPhaseInternal().
648
+ * Contains directory paths, plan lists, and metadata flags.
649
+ */
650
+ export interface PhaseInfo {
651
+ found: boolean;
652
+ directory: string;
653
+ phase_number: string;
654
+ phase_name: string | null;
655
+ phase_slug: string | null;
656
+ plans: string[];
657
+ summaries: string[];
658
+ incomplete_plans: string[];
659
+ has_research: boolean;
660
+ has_context: boolean;
661
+ has_verification: boolean;
662
+ consistency_warning: string | null;
663
+ }
664
+ /**
665
+ * Milestone identification with version and display name.
666
+ */
667
+ export interface MilestoneInfo {
668
+ version: string;
669
+ name: string;
670
+ }
671
+ /**
672
+ * Common STATE.md field names as optional string properties.
673
+ * Used for typed access to STATE.md sections.
674
+ */
675
+ export interface StateFields {
676
+ updated?: string;
677
+ active_phase?: string;
678
+ current_plan?: string;
679
+ milestone?: string;
680
+ status?: string;
681
+ progress?: string;
682
+ next?: string;
683
+ last_action?: string;
684
+ stopped_at?: string;
685
+ next_action?: string;
686
+ context_needed?: string;
687
+ }
688
+ /**
689
+ * Phase information parsed from ROADMAP.md.
690
+ */
691
+ export interface RoadmapPhase {
692
+ number: string;
693
+ name: string;
694
+ goal?: string;
695
+ type?: string;
696
+ depends_on?: string[];
697
+ duration?: string;
698
+ requirements?: string[];
699
+ verification_level?: string;
700
+ status: string;
701
+ plans_count?: number;
702
+ plans_complete?: number;
703
+ }
704
+ /**
705
+ * YAML frontmatter as a record with common optional typed fields.
706
+ */
707
+ export interface FrontmatterObject extends Record<string, unknown> {
708
+ phase?: string;
709
+ plan?: string | number;
710
+ type?: string;
711
+ wave?: number;
712
+ depends_on?: string[];
713
+ autonomous?: boolean;
714
+ verification_level?: string;
715
+ subsystem?: string;
716
+ tags?: string[];
717
+ }
718
+ /**
719
+ * MCP tool descriptor for registering tools in the MCP server.
720
+ */
721
+ export interface McpToolDescriptor {
722
+ name: string;
723
+ description: string;
724
+ inputSchema: {
725
+ type: 'object';
726
+ properties: Record<string, {
727
+ type: string;
728
+ description: string;
729
+ enum?: string[];
730
+ }>;
731
+ required?: string[];
732
+ };
733
+ execute: (params: Record<string, string>) => Promise<string> | string;
734
+ }
735
+ /**
736
+ * Result of a git command execution via execGit().
737
+ */
738
+ export interface ExecGitResult {
739
+ exitCode: number;
740
+ stdout: string;
741
+ stderr: string;
742
+ }
743
+ /**
744
+ * Run-scoped file content cache with init/reset/get lifecycle.
745
+ * Created by createRunCache() in utils.js.
746
+ */
747
+ export interface RunCache {
748
+ init: () => void;
749
+ reset: () => void;
750
+ get: (key: string, reader: (key: string) => unknown) => unknown;
751
+ }
752
+ /**
753
+ * Model profile table mapping agent types to tier selections per profile.
754
+ * Used by MODEL_PROFILES constant in utils.js.
755
+ */
756
+ export type AgentModelProfiles = Record<string, Record<ModelProfileName, ModelTier>>;
757
+ /**
758
+ * Result returned by all validation functions in invariants.ts.
759
+ * valid is true when errors is empty; warnings are non-fatal informational notices.
760
+ */
761
+ export interface ValidationResult {
762
+ valid: boolean;
763
+ errors: string[];
764
+ warnings: string[];
765
+ }
766
+ /**
767
+ * Typed representation of a parsed plan artifact (PLAN.md frontmatter + objective).
768
+ * Used by validateStructural, validateSemantic, validateCrossPhase, and extractPlanArtifact.
769
+ */
770
+ export interface PlanArtifact {
771
+ objective: string;
772
+ files_modified: string[];
773
+ phase: string;
774
+ plan: number;
775
+ type: string;
776
+ wave: number;
777
+ depends_on: string[];
778
+ autonomous: boolean;
779
+ provides: string[];
780
+ requires: string[];
781
+ integration_points: string[];
782
+ }
783
+ /**
784
+ * A node representing a plan's artifact declarations in the artifact DAG.
785
+ * Each plan that declares provides/requires/integration_points becomes a node.
786
+ */
787
+ export interface ArtifactDAGNode {
788
+ /** Unique plan identifier, e.g. "94-01" */
789
+ id: string;
790
+ /** Numeric plan number */
791
+ plan_number: number;
792
+ /** Artifact names this plan produces, e.g. ["lib/deps.ts:buildArtifactDAG"] */
793
+ provides: string[];
794
+ /** Artifact names this plan depends on */
795
+ requires: string[];
796
+ /** Integration surface declarations */
797
+ integration_points: string[];
798
+ }
799
+ /**
800
+ * A directed edge representing a requires→provides dependency between plans.
801
+ * from_plan is the consumer (requires the artifact); to_plan is the producer (provides it).
802
+ */
803
+ export interface ArtifactDAGEdge {
804
+ /** Plan that requires the artifact (consumer) */
805
+ from_plan: string;
806
+ /** Plan that provides the artifact (producer) */
807
+ to_plan: string;
808
+ /** The artifact name creating this edge */
809
+ artifact: string;
810
+ /** Whether this is a hard dependency or integration point */
811
+ type: 'requires' | 'integration';
812
+ }
813
+ /**
814
+ * The complete artifact dependency graph built from plan provides/requires declarations.
815
+ * Used by the wave builder and executor to reason about fine-grained dependencies.
816
+ */
817
+ export interface ArtifactDAG {
818
+ /** All plan nodes */
819
+ nodes: ArtifactDAGNode[];
820
+ /** All directed dependency edges */
821
+ edges: ArtifactDAGEdge[];
822
+ /** Topologically sorted plan IDs (Kahn's algorithm) */
823
+ sorted_plans: string[];
824
+ /** Map from artifact name to providing plan ID */
825
+ providers: Record<string, string>;
826
+ /** Artifact names in requires declarations with no matching provider */
827
+ missing_requires: string[];
828
+ }
829
+ /**
830
+ * Result of validating an ArtifactDAG for cycles, missing dependencies, and warnings.
831
+ */
832
+ export interface ArtifactDAGValidation {
833
+ /** True when cycles and missing_deps are both empty */
834
+ valid: boolean;
835
+ /** All detected cycles; each inner array is a cycle path (start node repeated at end) */
836
+ cycles: string[][];
837
+ /** Requires entries with no matching provider in the plan set */
838
+ missing_deps: Array<{
839
+ plan: string;
840
+ artifact: string;
841
+ }>;
842
+ /** Non-fatal issues (unused provides, duplicate provides declarations) */
843
+ warnings: string[];
844
+ }
845
+ /**
846
+ * Represents a frozen contract for an artifact — the interface definition
847
+ * captured at the point a plan node's output is accepted downstream.
848
+ */
849
+ export interface FrozenInterface {
850
+ /** Plan that provides this artifact */
851
+ plan_id: string;
852
+ /** Artifact name (e.g. "lib/foo.ts:Bar") */
853
+ artifact: string;
854
+ /** The frozen interface definition as a string comment */
855
+ contract: string;
856
+ }
857
+ /**
858
+ * Result of executing a single DAG node (plan).
859
+ */
860
+ export interface NodeExecutionResult {
861
+ /** The plan node ID (e.g. "98-01") */
862
+ node_id: string;
863
+ /** Whether execution succeeded */
864
+ success: boolean;
865
+ /** List of artifact names actually produced */
866
+ artifacts_produced: string[];
867
+ /** Error message if failed */
868
+ error?: string;
869
+ }
870
+ /**
871
+ * Result of smoke-testing a node's output against its declared provides.
872
+ */
873
+ export interface SmokeTestResult {
874
+ /** The plan node ID */
875
+ node_id: string;
876
+ /** Whether all provides artifacts were produced */
877
+ passed: boolean;
878
+ /** Provides artifacts NOT found in artifacts_produced */
879
+ missing_artifacts: string[];
880
+ /** Human-readable result message */
881
+ message: string;
882
+ }
883
+ /**
884
+ * Options for executeArtifactDAG.
885
+ */
886
+ export interface GoTExecuteOptions {
887
+ /** Max retry attempts per node on smoke failure (default 1) */
888
+ maxRetries?: number;
889
+ /** When true, return stub results without dispatching agents */
890
+ dryRun?: boolean;
891
+ }
892
+ /**
893
+ * Full result of executing an artifact DAG via GoT synthesis engine.
894
+ */
895
+ export interface GoTExecutionResult {
896
+ /** Topological wave groupings of plan IDs */
897
+ waves: string[][];
898
+ /** Per-node execution results */
899
+ results: NodeExecutionResult[];
900
+ /** Per-node smoke test results */
901
+ smoke_tests: SmokeTestResult[];
902
+ /** Total retry count across all nodes */
903
+ retries: number;
904
+ /** True when all smoke tests passed */
905
+ success: boolean;
906
+ }
907
+ /**
908
+ * Context passed to buildNodePrompt when constructing per-node execution prompts.
909
+ */
910
+ export interface NodePromptContext {
911
+ /** Phase name */
912
+ phase_name: string;
913
+ /** Phase directory path */
914
+ phase_dir: string;
915
+ /** Research directory path (optional) */
916
+ research_dir?: string;
917
+ }
918
+ /**
919
+ * A gate check violation with code, severity, message, fix hint, and context.
920
+ * Used by gates.ts, context.js, parallel.js, phase.js.
921
+ */
922
+ export interface GateViolation {
923
+ code: string;
924
+ severity: 'error' | 'warning';
925
+ message: string;
926
+ fix: string;
927
+ context: Record<string, unknown>;
928
+ }
929
+ /**
930
+ * Result returned by runPreflightGates().
931
+ * Used by gates.ts, context.js, parallel.js.
932
+ */
933
+ export interface PreflightResult {
934
+ passed: boolean;
935
+ bypassed: boolean;
936
+ errors: GateViolation[];
937
+ warnings: GateViolation[];
938
+ command: string;
939
+ }
940
+ /**
941
+ * Configuration for the phase_cleanup section of config.json.
942
+ * Used by cleanup.ts, phase.js, commands.js.
943
+ */
944
+ export interface CleanupConfig {
945
+ enabled: boolean;
946
+ refactoring: boolean;
947
+ doc_sync: boolean;
948
+ test_coverage: boolean;
949
+ export_consistency: boolean;
950
+ doc_staleness: boolean;
951
+ config_schema: boolean;
952
+ cleanup_threshold: number;
953
+ }
954
+ /**
955
+ * Quality analysis summary counts from runQualityAnalysis.
956
+ * Used by cleanup.ts, phase.js.
957
+ */
958
+ export interface QualityAnalysisSummary {
959
+ total_issues: number;
960
+ complexity_violations: number;
961
+ dead_exports: number;
962
+ oversized_files: number;
963
+ doc_drift_issues?: number;
964
+ test_coverage_gaps?: number;
965
+ stale_imports?: number;
966
+ doc_staleness_issues?: number;
967
+ config_schema_issues?: number;
968
+ [key: string]: number | undefined;
969
+ }
970
+ /**
971
+ * A parsed requirement from REQUIREMENTS.md.
972
+ * Used by requirements.ts, commands.js, mcp-server.js, scaffold.js, phase.js.
973
+ */
974
+ export interface Requirement {
975
+ id: string;
976
+ title: string;
977
+ priority: string | null;
978
+ category: string | null;
979
+ deferred_from: string | null;
980
+ resolves: string | null;
981
+ description: string | null;
982
+ status?: string;
983
+ phase?: string;
984
+ milestone?: string;
985
+ }
986
+ /**
987
+ * A traceability matrix entry parsed from REQUIREMENTS.md.
988
+ * Used by requirements.ts, commands.js.
989
+ */
990
+ export interface TraceabilityEntry {
991
+ req: string;
992
+ feature: string;
993
+ priority: string;
994
+ phase: string;
995
+ status: string;
996
+ }
997
+ /**
998
+ * A node in the phase dependency graph.
999
+ * Used by deps.ts, parallel.js, autopilot.js.
1000
+ */
1001
+ export interface DependencyNode {
1002
+ id: string;
1003
+ name: string;
1004
+ }
1005
+ /**
1006
+ * A directed edge in the phase dependency graph.
1007
+ * Used by deps.ts, parallel.js, autopilot.js.
1008
+ */
1009
+ export interface DependencyEdge {
1010
+ from: string;
1011
+ to: string;
1012
+ }
1013
+ /**
1014
+ * Phase dependency graph with nodes and directed edges.
1015
+ * Used by deps.ts, parallel.js, autopilot.js.
1016
+ */
1017
+ export interface DependencyGraph {
1018
+ nodes: DependencyNode[];
1019
+ edges: DependencyEdge[];
1020
+ }
1021
+ /**
1022
+ * Options for multi-milestone autopilot orchestration.
1023
+ * Controls how many milestones to process, subprocess behavior, and step skipping.
1024
+ */
1025
+ export interface MultiMilestoneOptions {
1026
+ maxMilestones?: number;
1027
+ dryRun?: boolean;
1028
+ timeout?: number;
1029
+ maxTurns?: number;
1030
+ model?: string;
1031
+ skipPlan?: boolean;
1032
+ skipExecute?: boolean;
1033
+ skipPostPipeline?: boolean;
1034
+ }
1035
+ /**
1036
+ * Per-milestone result in multi-milestone autopilot.
1037
+ * Tracks phase attempts and completion status for a single milestone iteration.
1038
+ */
1039
+ export interface MilestoneStepResult {
1040
+ milestone: string;
1041
+ phases_attempted: number;
1042
+ phases_completed: number;
1043
+ status: 'completed' | 'failed' | 'skipped' | 'dry-run' | 'converged';
1044
+ reason?: string;
1045
+ }
1046
+ /**
1047
+ * Returned by runMultiMilestoneAutopilot.
1048
+ * Aggregates results across all milestone iterations.
1049
+ */
1050
+ export interface MultiMilestoneResult {
1051
+ milestones_attempted: number;
1052
+ milestones_completed: number;
1053
+ milestone_results: MilestoneStepResult[];
1054
+ stopped_at: string | null;
1055
+ /**
1056
+ * Graceful early termination reason at the milestone-chain level —
1057
+ * propagated from a child runAutopilot when convergence fires
1058
+ * (Tier-3 #10). Distinct from `stopped_at` so callers like evolve
1059
+ * do not classify graceful convergence as a failure.
1060
+ */
1061
+ converged_at: string | null;
1062
+ total_phases_attempted: number;
1063
+ total_phases_completed: number;
1064
+ }
1065
+ /**
1066
+ * Options for the autoplan command.
1067
+ * Controls discovery behavior, subprocess parameters, and output format.
1068
+ */
1069
+ export interface AutoplanOptions {
1070
+ groups?: Array<{
1071
+ id: string;
1072
+ theme: string;
1073
+ dimension: string;
1074
+ items: Array<{
1075
+ title: string;
1076
+ description: string;
1077
+ effort: string;
1078
+ }>;
1079
+ priority: number;
1080
+ effort: string;
1081
+ }>;
1082
+ pickPct?: number;
1083
+ dryRun?: boolean;
1084
+ timeout?: number;
1085
+ maxTurns?: number;
1086
+ model?: string;
1087
+ milestoneName?: string;
1088
+ }
1089
+ /**
1090
+ * Result returned by runAutoplan().
1091
+ */
1092
+ export interface AutoplanResult {
1093
+ status: 'completed' | 'failed' | 'dry-run';
1094
+ groups_count: number;
1095
+ items_count: number;
1096
+ prompt: string;
1097
+ milestone_name?: string;
1098
+ reason?: string;
1099
+ }
1100
+ /**
1101
+ * Meta-backends that orchestrate other backends — cannot be used as
1102
+ * Superpowers' underlying default_backend target.
1103
+ * overstory is excluded because it has a real CLI adapter.
1104
+ */
1105
+ export type MetaBackendId = 'superpowers' | 'grd';
1106
+ /**
1107
+ * Direct AI CLI backends that have adapter implementations and can serve as
1108
+ * a Superpowers target (excludes meta-backends superpowers and grd).
1109
+ */
1110
+ export type AdapterBackendId = Exclude<BackendId, MetaBackendId>;
1111
+ /**
1112
+ * Direct AI CLI backends that can serve as a Superpowers target.
1113
+ * @deprecated Use AdapterBackendId instead.
1114
+ */
1115
+ export type DirectBackendId = AdapterBackendId;
1116
+ /**
1117
+ * Configuration for a single AI CLI account with its config directory.
1118
+ */
1119
+ export interface AccountConfig {
1120
+ config_dir: string;
1121
+ }
1122
+ /**
1123
+ * Result of resolving which backend account to use for a scheduled task.
1124
+ * Combines backend identity, account config, and a compound state key.
1125
+ */
1126
+ export interface AccountResolution {
1127
+ backend: AdapterBackendId;
1128
+ account: AccountConfig;
1129
+ stateKey: string;
1130
+ }
1131
+ /**
1132
+ * Configuration for the Superpowers execution backend.
1133
+ * Superpowers orchestrates any AI CLI backend with account rotation.
1134
+ */
1135
+ export interface SuperpowersConfig {
1136
+ default_backend: DirectBackendId;
1137
+ account_rotation: boolean;
1138
+ accounts: Partial<Record<AdapterBackendId, AccountConfig[]>>;
1139
+ }
1140
+ export interface OverstoryInfo {
1141
+ available: boolean;
1142
+ version: string;
1143
+ config_path: string;
1144
+ max_agents: number;
1145
+ default_runtime: string;
1146
+ worktree_base: string;
1147
+ }
1148
+ export interface SlingOpts {
1149
+ plan_path: string;
1150
+ overlay_path: string;
1151
+ runtime: string;
1152
+ model: string;
1153
+ phase_number: string;
1154
+ plan_id: string;
1155
+ milestone: string;
1156
+ timeout_minutes: number;
1157
+ }
1158
+ export interface SlingResult {
1159
+ agent_id: string;
1160
+ worktree_path: string;
1161
+ branch: string;
1162
+ tmux_session: string;
1163
+ runtime: string;
1164
+ }
1165
+ export interface AgentStatus {
1166
+ agent_id: string;
1167
+ state: 'pending' | 'running' | 'done' | 'failed' | 'stopped';
1168
+ exit_code: number | null;
1169
+ duration_ms: number;
1170
+ worktree_path: string;
1171
+ branch: string;
1172
+ runtime: string;
1173
+ model: string;
1174
+ }
1175
+ export interface FleetStatus {
1176
+ agents: AgentStatus[];
1177
+ active_count: number;
1178
+ completed_count: number;
1179
+ failed_count: number;
1180
+ }
1181
+ export interface MergeResult {
1182
+ merged: boolean;
1183
+ conflicts: string[];
1184
+ branch: string;
1185
+ commit_sha: string | null;
1186
+ error: string | null;
1187
+ }
1188
+ export interface OverstoryConfig {
1189
+ runtime: string;
1190
+ install_prompt: boolean;
1191
+ poll_interval_ms: number;
1192
+ merge_strategy: 'auto' | 'manual';
1193
+ overlay_template: string | null;
1194
+ }
1195
+ export interface OverstoryMailMessage {
1196
+ type: string;
1197
+ body: string;
1198
+ ts: number;
1199
+ }
1200
+ /** Parsed missing component from PAPERS.md structured output. */
1201
+ export interface MissingComponent {
1202
+ /** Component identifier */
1203
+ name: string;
1204
+ /** Paper slug or title where component originates */
1205
+ source_paper: string;
1206
+ /** What the component does */
1207
+ description: string;
1208
+ /** Whether source code exists for this component */
1209
+ code_available: boolean;
1210
+ }
1211
+ /** Parsed borrowed component from PAPERS.md structured output. */
1212
+ export interface BorrowedComponent {
1213
+ /** Component identifier */
1214
+ name: string;
1215
+ /** Paper slug or title */
1216
+ source_paper: string;
1217
+ /** What the component does */
1218
+ description: string;
1219
+ }
1220
+ /** Citation graph node representing a paper and its dependencies. */
1221
+ export interface CitationNode {
1222
+ /** Paper slug (e.g., "vaswani-attention-2017") */
1223
+ slug: string;
1224
+ /** Full paper title */
1225
+ title: string;
1226
+ /** Whether the paper has been fetched and analyzed */
1227
+ resolved: boolean;
1228
+ /** How important this dependency is */
1229
+ priority: 'critical' | 'normal' | 'low';
1230
+ /** Extracted technique description (empty until resolved) */
1231
+ technique_summary: string;
1232
+ /** Components referenced but not implemented in this paper */
1233
+ missing_components: MissingComponent[];
1234
+ /** Components adopted from other papers */
1235
+ borrowed_components: BorrowedComponent[];
1236
+ }
1237
+ /** Citation graph edge — a directed dependency between papers. */
1238
+ export interface CitationEdge {
1239
+ /** Paper that depends on another */
1240
+ from_slug: string;
1241
+ /** Paper being depended upon */
1242
+ to_slug: string;
1243
+ /** Whether this is a missing or borrowed dependency */
1244
+ type: 'missing' | 'borrowed';
1245
+ /** Which component creates this edge */
1246
+ component_name: string;
1247
+ }
1248
+ /** Complete citation graph with nodes and directed edges. */
1249
+ export interface CitationGraph {
1250
+ /** All paper nodes (source papers + dependency papers) */
1251
+ nodes: CitationNode[];
1252
+ /** All directed dependency edges */
1253
+ edges: CitationEdge[];
1254
+ /** ISO timestamp of graph construction */
1255
+ built_at: string;
1256
+ }
1257
+ /**
1258
+ * Options for controlling BFS traversal of the citation graph.
1259
+ * max_depth and max_nodes prevent unbounded traversal on large real citation chains.
1260
+ */
1261
+ export interface TraversalOptions {
1262
+ /** Maximum BFS depth from root nodes. Default: 3 */
1263
+ max_depth: number;
1264
+ /** Maximum total nodes to visit before stopping. Default: 50 */
1265
+ max_nodes: number;
1266
+ /** Injectable fetch function for auto-retrieval (used in Plan 02). Optional. */
1267
+ fetchFn?: (url: string, timeoutMs: number) => Promise<string | null>;
1268
+ }
1269
+ /**
1270
+ * Result of a BFS traversal through the citation graph.
1271
+ * Captures visited nodes, traversed edges, leaf nodes, and depth/count statistics.
1272
+ */
1273
+ export interface TraversalResult {
1274
+ /** All CitationNodes discovered during traversal (including root nodes) */
1275
+ visited_nodes: CitationNode[];
1276
+ /** All CitationEdges traversed (subset of graph edges reachable from roots) */
1277
+ edges_traversed: CitationEdge[];
1278
+ /** Nodes that have no outgoing edges in the graph (leaf dependencies not in PAPERS.md) */
1279
+ unresolved_leaves: CitationNode[];
1280
+ /** Maximum depth level actually reached during BFS */
1281
+ depth_reached: number;
1282
+ /** Total node count visited (may equal max_nodes if limit was hit) */
1283
+ total_visited: number;
1284
+ }
1285
+ /** Configuration for citation resolution API calls. */
1286
+ export interface ApiConfig {
1287
+ arxiv_enabled: boolean;
1288
+ semantic_scholar_enabled: boolean;
1289
+ timeout_ms: number;
1290
+ fetchFn?: (url: string) => Promise<{
1291
+ ok: boolean;
1292
+ text: () => Promise<string>;
1293
+ }>;
1294
+ }
1295
+ /**
1296
+ * A structured knowledge entry mined from phase execution output.
1297
+ * Stored in KNOWHOW.md and injected into planning/execution prompts to
1298
+ * compound improvements across phases.
1299
+ */
1300
+ export interface KnowhowEntry {
1301
+ /** Descriptive name of the pattern or technique. */
1302
+ pattern_name: string;
1303
+ /** Where this knowledge came from (paper slug, codebase path, or execution result). */
1304
+ source: string;
1305
+ /** Conditions under which this pattern is useful. */
1306
+ applicability: string;
1307
+ /** Representative code example or reference. */
1308
+ code_snippet: string;
1309
+ /** Which phase produced this entry. */
1310
+ phase_number: number;
1311
+ /** ISO timestamp when entry was created. */
1312
+ created_at: string;
1313
+ }
1314
+ /**
1315
+ * Quantitative metrics collected from a single test/lint/build run.
1316
+ * Adapted from NERFIFY PSNR-minima ROI analysis to GRD's domain:
1317
+ * test coverage minima, type error density, lint violation clustering.
1318
+ */
1319
+ export interface RefinementMetrics {
1320
+ /** Percentage of lines/statements covered by tests (0–100). */
1321
+ test_coverage_pct: number;
1322
+ /** Number of TypeScript type errors from tsc --noEmit. */
1323
+ type_error_count: number;
1324
+ /** Number of ESLint violations (errors + warnings). */
1325
+ lint_violation_count: number;
1326
+ /** ISO 8601 timestamp when these metrics were collected. */
1327
+ timestamp: string;
1328
+ }
1329
+ /**
1330
+ * A metric snapshot tied to a specific phase and plan.
1331
+ * Used for building time-series data to detect convergence and minima.
1332
+ */
1333
+ export interface MetricSnapshot {
1334
+ metrics: RefinementMetrics;
1335
+ phase: string;
1336
+ plan: string;
1337
+ }
1338
+ /**
1339
+ * Discriminated branch type for closed-loop refinement routing.
1340
+ * - macro: metric-minima guided patching (coverage dips, error spikes)
1341
+ * - geometry: structural validation (type errors, export consistency)
1342
+ * - generative: artifact analysis (lint patterns, code smell clustering)
1343
+ */
1344
+ export type CritiqueBranch = 'macro' | 'geometry' | 'generative';
1345
+ /**
1346
+ * Configuration for convergence detection in the refinement loop.
1347
+ * Epsilon values define the minimum change threshold below which a dimension
1348
+ * is considered converged.
1349
+ */
1350
+ export interface ConvergenceConfig {
1351
+ /** Minimum coverage change (in percentage points) to consider not-converged. */
1352
+ epsilon_coverage: number;
1353
+ /** Minimum type error count change to consider not-converged. */
1354
+ epsilon_type_errors: number;
1355
+ /** Minimum lint violation count change to consider not-converged. */
1356
+ epsilon_lint: number;
1357
+ /** Maximum refinement iterations before forcing convergence. */
1358
+ max_iterations: number;
1359
+ }
1360
+ /**
1361
+ * A detected minima region in a metric time series.
1362
+ * For coverage: local dips (where coverage drops below neighbors).
1363
+ * For errors/violations: local spikes (where count rises above neighbors).
1364
+ */
1365
+ export interface MinimaRegion {
1366
+ /** Which metric dimension this region belongs to. */
1367
+ dimension: 'test_coverage_pct' | 'type_error_count' | 'lint_violation_count';
1368
+ /** Index in the snapshot array where this region occurs. */
1369
+ index: number;
1370
+ /** Metric value at this region. */
1371
+ value: number;
1372
+ /** Absolute delta from the average of the two neighbors. */
1373
+ delta: number;
1374
+ }
1375
+ /**
1376
+ * Classification of a research paper by implementation difficulty.
1377
+ * Adapted from NERFIFY-BENCH Figure 7 categorization.
1378
+ *
1379
+ * - directly-integrable: Paper's technique can be implemented using existing
1380
+ * GRD infrastructure without external model dependencies.
1381
+ * - requires-external-models: Implementation needs external model weights or
1382
+ * services not bundled with GRD.
1383
+ * - out-of-scope: Paper describes capabilities beyond code synthesis (hardware,
1384
+ * large-scale training infrastructure, etc.)
1385
+ * - novelty-coverage: Paper contributes novel ideas but implementation fidelity
1386
+ * is measured differently (architecture variants, ablation studies, etc.)
1387
+ */
1388
+ export type IntegrationCategory = 'directly-integrable' | 'requires-external-models' | 'out-of-scope' | 'novelty-coverage';
1389
+ /**
1390
+ * Quantitative metrics from actually running the generated code.
1391
+ */
1392
+ export interface TrainabilityMetrics {
1393
+ /** Whether the generated code compiles/builds without errors. */
1394
+ build_success: boolean;
1395
+ /** Whether execution completes without crashes. */
1396
+ runtime_stable: boolean;
1397
+ /** Whether training/optimization converges (if applicable). */
1398
+ convergence_detected: boolean;
1399
+ /** Wall-clock execution time in milliseconds. */
1400
+ execution_time_ms: number;
1401
+ /** Captured stderr/error output (empty string if none). */
1402
+ error_log: string;
1403
+ }
1404
+ /**
1405
+ * Qualitative assessment of how faithfully the generated code captures the paper's semantics.
1406
+ */
1407
+ export interface SemanticScore {
1408
+ /** 0-1 score for how well the code captures the paper's novel contributions. */
1409
+ novelty_capture: number;
1410
+ /** 0-1 score for alignment between paper's described interface and generated code. */
1411
+ api_surface_match: number;
1412
+ /** 0-1 score for correctness of core algorithm implementation. */
1413
+ algorithmic_fidelity: number;
1414
+ /** Optional free-text notes from evaluator. */
1415
+ notes: string;
1416
+ }
1417
+ /**
1418
+ * Configurable weight distribution for composite scoring.
1419
+ * semantic_weight + trainability_weight must equal 1.0.
1420
+ */
1421
+ export interface ScoringRubric {
1422
+ /** Weight for semantic dimension (0-1, all weights sum to 1). */
1423
+ semantic_weight: number;
1424
+ /** Weight for trainability dimension. */
1425
+ trainability_weight: number;
1426
+ /** Per-category difficulty multiplier (1.0 = neutral). */
1427
+ category_adjustments: Record<IntegrationCategory, number>;
1428
+ }
1429
+ /**
1430
+ * A single research paper entry in the benchmark corpus.
1431
+ */
1432
+ export interface BenchmarkEntry {
1433
+ /** Unique identifier (typically paper slug). */
1434
+ id: string;
1435
+ /** Paper title. */
1436
+ title: string;
1437
+ /** Source reference (arXiv ID, DOI, or URL). */
1438
+ source: string;
1439
+ /** Integration difficulty classification. */
1440
+ category: IntegrationCategory;
1441
+ /** Domain/method tags for filtering. */
1442
+ tags: string[];
1443
+ /** ISO 8601 timestamp when entry was added to corpus. */
1444
+ added_at: string;
1445
+ }
1446
+ /**
1447
+ * A scored evaluation result for a single benchmark entry.
1448
+ */
1449
+ export interface BenchmarkResult {
1450
+ /** References BenchmarkEntry.id. */
1451
+ entry_id: string;
1452
+ /** Semantic implementation scoring. */
1453
+ semantic: SemanticScore;
1454
+ /** Build/run/convergence metrics. */
1455
+ trainability: TrainabilityMetrics;
1456
+ /** Weighted composite score (0-1). */
1457
+ composite_score: number;
1458
+ /** Which ScoringRubric version was used. */
1459
+ rubric_version: string;
1460
+ /** ISO 8601 timestamp. */
1461
+ evaluated_at: string;
1462
+ /** Who/what produced this result (agent name or 'manual'). */
1463
+ evaluator: string;
1464
+ }
1465
+ /** Quality analysis result returned from cleanup module. */
1466
+ export interface QualityAnalysisResult {
1467
+ skipped?: boolean;
1468
+ reason?: string;
1469
+ phase?: string;
1470
+ timestamp?: string;
1471
+ summary?: QualityAnalysisSummary;
1472
+ details?: Record<string, unknown>;
1473
+ trends?: Record<string, unknown> | null;
1474
+ }
1475
+ /** Generated cleanup plan info from cleanup module. */
1476
+ export interface CleanupPlanResult {
1477
+ path: string;
1478
+ plan_number: string;
1479
+ issues_addressed: number;
1480
+ }
1481
+ /** Options for cmdPhaseComplete. */
1482
+ export interface PhaseCompleteOptions {
1483
+ dryRun?: boolean;
1484
+ force?: boolean;
1485
+ skip_cleanup?: boolean;
1486
+ raw?: boolean;
1487
+ }
1488
+ /** Result from the phase complete core logic. */
1489
+ export interface PhaseCompleteResult {
1490
+ dry_run?: boolean;
1491
+ would_complete_phase?: string;
1492
+ phase_found?: boolean;
1493
+ gate_failed?: boolean;
1494
+ gate_errors?: GateViolation[];
1495
+ gate_warnings?: GateViolation[];
1496
+ completed_phase?: string;
1497
+ phase_name?: string | null;
1498
+ plans_executed?: string;
1499
+ next_phase?: string | null;
1500
+ next_phase_name?: string | null;
1501
+ is_last_phase?: boolean;
1502
+ date?: string;
1503
+ roadmap_updated?: boolean;
1504
+ state_updated?: boolean;
1505
+ quality_report?: QualityAnalysisResult;
1506
+ cleanup_plan_generated?: CleanupPlanResult;
1507
+ /**
1508
+ * True if this result was produced by the LLM fallback path (Spec 3B),
1509
+ * not the mechanical regex path. Callers may want to log differently
1510
+ * or skip certain downstream operations.
1511
+ */
1512
+ llm_fallback?: boolean;
1513
+ }
1514
+ //# sourceMappingURL=types.d.ts.map