@matteeh/osq 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (606) hide show
  1. package/README.md +234 -15
  2. package/dist/cli/approve.d.ts +7 -0
  3. package/dist/cli/approve.d.ts.map +1 -1
  4. package/dist/cli/approve.js +34 -0
  5. package/dist/cli/approve.js.map +1 -1
  6. package/dist/cli/bin.js +2 -3
  7. package/dist/cli/bin.js.map +1 -1
  8. package/dist/cli/check.d.ts +15 -0
  9. package/dist/cli/check.d.ts.map +1 -0
  10. package/dist/cli/check.js +65 -0
  11. package/dist/cli/check.js.map +1 -0
  12. package/dist/cli/index.d.ts.map +1 -1
  13. package/dist/cli/index.js +10 -10
  14. package/dist/cli/index.js.map +1 -1
  15. package/dist/cli/init.d.ts.map +1 -1
  16. package/dist/cli/init.js +6 -1
  17. package/dist/cli/init.js.map +1 -1
  18. package/dist/cli/lint.d.ts +3 -0
  19. package/dist/cli/lint.d.ts.map +1 -1
  20. package/dist/cli/lint.js +33 -14
  21. package/dist/cli/lint.js.map +1 -1
  22. package/dist/cli/plan-queue.d.ts +10 -4
  23. package/dist/cli/plan-queue.d.ts.map +1 -1
  24. package/dist/cli/plan-queue.js +20 -19
  25. package/dist/cli/plan-queue.js.map +1 -1
  26. package/dist/cli/plan-sections.d.ts +15 -0
  27. package/dist/cli/plan-sections.d.ts.map +1 -0
  28. package/dist/cli/plan-sections.js +47 -0
  29. package/dist/cli/plan-sections.js.map +1 -0
  30. package/dist/cli/plan.d.ts +1 -0
  31. package/dist/cli/plan.d.ts.map +1 -1
  32. package/dist/cli/plan.js +14 -4
  33. package/dist/cli/plan.js.map +1 -1
  34. package/dist/cli/report.d.ts.map +1 -1
  35. package/dist/cli/report.js +73 -1
  36. package/dist/cli/report.js.map +1 -1
  37. package/dist/cli/run.d.ts +7 -0
  38. package/dist/cli/run.d.ts.map +1 -0
  39. package/dist/cli/run.js +22 -0
  40. package/dist/cli/run.js.map +1 -0
  41. package/dist/cli/verified.d.ts +15 -0
  42. package/dist/cli/verified.d.ts.map +1 -0
  43. package/dist/cli/verified.js +34 -0
  44. package/dist/cli/verified.js.map +1 -0
  45. package/dist/core/foundation/config-agents.d.ts +16 -0
  46. package/dist/core/foundation/config-agents.d.ts.map +1 -0
  47. package/dist/core/foundation/config-agents.js +2 -0
  48. package/dist/core/foundation/config-agents.js.map +1 -0
  49. package/dist/core/foundation/config-claude.d.ts +48 -0
  50. package/dist/core/foundation/config-claude.d.ts.map +1 -0
  51. package/dist/core/foundation/config-claude.js +106 -0
  52. package/dist/core/foundation/config-claude.js.map +1 -0
  53. package/dist/core/foundation/config-codex-resolve.d.ts +10 -0
  54. package/dist/core/foundation/config-codex-resolve.d.ts.map +1 -0
  55. package/dist/core/foundation/config-codex-resolve.js +24 -0
  56. package/dist/core/foundation/config-codex-resolve.js.map +1 -0
  57. package/dist/core/foundation/config-file.d.ts +18 -0
  58. package/dist/core/foundation/config-file.d.ts.map +1 -0
  59. package/dist/core/foundation/config-file.js +46 -0
  60. package/dist/core/foundation/config-file.js.map +1 -0
  61. package/dist/core/foundation/config-gates.d.ts +2 -0
  62. package/dist/core/foundation/config-gates.d.ts.map +1 -1
  63. package/dist/core/foundation/config-gates.js +8 -0
  64. package/dist/core/foundation/config-gates.js.map +1 -1
  65. package/dist/core/foundation/config-opencode.d.ts +25 -0
  66. package/dist/core/foundation/config-opencode.d.ts.map +1 -0
  67. package/dist/core/foundation/config-opencode.js +55 -0
  68. package/dist/core/foundation/config-opencode.js.map +1 -0
  69. package/dist/core/foundation/config-pi.d.ts +10 -0
  70. package/dist/core/foundation/config-pi.d.ts.map +1 -1
  71. package/dist/core/foundation/config-pi.js +13 -0
  72. package/dist/core/foundation/config-pi.js.map +1 -1
  73. package/dist/core/foundation/config-planning.d.ts +12 -1
  74. package/dist/core/foundation/config-planning.d.ts.map +1 -1
  75. package/dist/core/foundation/config-planning.js +29 -1
  76. package/dist/core/foundation/config-planning.js.map +1 -1
  77. package/dist/core/foundation/config-traceability.d.ts +28 -0
  78. package/dist/core/foundation/config-traceability.d.ts.map +1 -0
  79. package/dist/core/foundation/config-traceability.js +63 -0
  80. package/dist/core/foundation/config-traceability.js.map +1 -0
  81. package/dist/core/foundation/config-user.d.ts +32 -0
  82. package/dist/core/foundation/config-user.d.ts.map +1 -0
  83. package/dist/core/foundation/config-user.js +2 -0
  84. package/dist/core/foundation/config-user.js.map +1 -0
  85. package/dist/core/foundation/config-vcs.d.ts +29 -0
  86. package/dist/core/foundation/config-vcs.d.ts.map +1 -0
  87. package/dist/core/foundation/config-vcs.js +57 -0
  88. package/dist/core/foundation/config-vcs.js.map +1 -0
  89. package/dist/core/foundation/config.d.ts +23 -24
  90. package/dist/core/foundation/config.d.ts.map +1 -1
  91. package/dist/core/foundation/config.js +29 -36
  92. package/dist/core/foundation/config.js.map +1 -1
  93. package/dist/core/foundation/decisions-validate.d.ts +16 -0
  94. package/dist/core/foundation/decisions-validate.d.ts.map +1 -0
  95. package/dist/core/foundation/decisions-validate.js +74 -0
  96. package/dist/core/foundation/decisions-validate.js.map +1 -0
  97. package/dist/core/foundation/decisions.d.ts +34 -0
  98. package/dist/core/foundation/decisions.d.ts.map +1 -0
  99. package/dist/core/foundation/decisions.js +152 -0
  100. package/dist/core/foundation/decisions.js.map +1 -0
  101. package/dist/core/foundation/doctor-decisions.d.ts +9 -0
  102. package/dist/core/foundation/doctor-decisions.d.ts.map +1 -0
  103. package/dist/core/foundation/doctor-decisions.js +49 -0
  104. package/dist/core/foundation/doctor-decisions.js.map +1 -0
  105. package/dist/core/foundation/doctor-managed.d.ts.map +1 -1
  106. package/dist/core/foundation/doctor-managed.js +3 -0
  107. package/dist/core/foundation/doctor-managed.js.map +1 -1
  108. package/dist/core/foundation/doctor-prices.d.ts +8 -0
  109. package/dist/core/foundation/doctor-prices.d.ts.map +1 -0
  110. package/dist/core/foundation/doctor-prices.js +25 -0
  111. package/dist/core/foundation/doctor-prices.js.map +1 -0
  112. package/dist/core/foundation/doctor.d.ts.map +1 -1
  113. package/dist/core/foundation/doctor.js +20 -30
  114. package/dist/core/foundation/doctor.js.map +1 -1
  115. package/dist/core/foundation/harness-catalog.d.ts +7 -8
  116. package/dist/core/foundation/harness-catalog.d.ts.map +1 -1
  117. package/dist/core/foundation/harness-catalog.js +26 -41
  118. package/dist/core/foundation/harness-catalog.js.map +1 -1
  119. package/dist/core/foundation/init-blocks.d.ts +1 -1
  120. package/dist/core/foundation/init-blocks.d.ts.map +1 -1
  121. package/dist/core/foundation/init-blocks.js +51 -14
  122. package/dist/core/foundation/init-blocks.js.map +1 -1
  123. package/dist/core/foundation/init.d.ts +4 -0
  124. package/dist/core/foundation/init.d.ts.map +1 -1
  125. package/dist/core/foundation/init.js +7 -0
  126. package/dist/core/foundation/init.js.map +1 -1
  127. package/dist/core/foundation/new.d.ts +4 -1
  128. package/dist/core/foundation/new.d.ts.map +1 -1
  129. package/dist/core/foundation/new.js +18 -8
  130. package/dist/core/foundation/new.js.map +1 -1
  131. package/dist/core/foundation/package-root.d.ts +6 -0
  132. package/dist/core/foundation/package-root.d.ts.map +1 -1
  133. package/dist/core/foundation/package-root.js +6 -0
  134. package/dist/core/foundation/package-root.js.map +1 -1
  135. package/dist/core/foundation/rules-block.d.ts +11 -0
  136. package/dist/core/foundation/rules-block.d.ts.map +1 -0
  137. package/dist/core/foundation/rules-block.js +90 -0
  138. package/dist/core/foundation/rules-block.js.map +1 -0
  139. package/dist/core/foundation/traceability-block.d.ts +13 -0
  140. package/dist/core/foundation/traceability-block.d.ts.map +1 -0
  141. package/dist/core/foundation/traceability-block.js +124 -0
  142. package/dist/core/foundation/traceability-block.js.map +1 -0
  143. package/dist/core/lifecycle/done.d.ts.map +1 -1
  144. package/dist/core/lifecycle/done.js +2 -4
  145. package/dist/core/lifecycle/done.js.map +1 -1
  146. package/dist/core/lifecycle/recertify.d.ts +9 -0
  147. package/dist/core/lifecycle/recertify.d.ts.map +1 -0
  148. package/dist/core/lifecycle/recertify.js +27 -0
  149. package/dist/core/lifecycle/recertify.js.map +1 -0
  150. package/dist/core/lifecycle/reject.d.ts.map +1 -1
  151. package/dist/core/lifecycle/reject.js +3 -4
  152. package/dist/core/lifecycle/reject.js.map +1 -1
  153. package/dist/core/lifecycle/retry.d.ts.map +1 -1
  154. package/dist/core/lifecycle/retry.js +6 -20
  155. package/dist/core/lifecycle/retry.js.map +1 -1
  156. package/dist/core/lifecycle/verification-record.d.ts +42 -0
  157. package/dist/core/lifecycle/verification-record.d.ts.map +1 -0
  158. package/dist/core/lifecycle/verification-record.js +76 -0
  159. package/dist/core/lifecycle/verification-record.js.map +1 -0
  160. package/dist/core/report/approval-flags.d.ts +16 -3
  161. package/dist/core/report/approval-flags.d.ts.map +1 -1
  162. package/dist/core/report/approval-flags.js +59 -22
  163. package/dist/core/report/approval-flags.js.map +1 -1
  164. package/dist/core/report/brief-to-approval.d.ts +7 -0
  165. package/dist/core/report/brief-to-approval.d.ts.map +1 -0
  166. package/dist/core/report/brief-to-approval.js +43 -0
  167. package/dist/core/report/brief-to-approval.js.map +1 -0
  168. package/dist/core/report/planning-price-gaps.d.ts +10 -0
  169. package/dist/core/report/planning-price-gaps.d.ts.map +1 -0
  170. package/dist/core/report/planning-price-gaps.js +37 -0
  171. package/dist/core/report/planning-price-gaps.js.map +1 -0
  172. package/dist/core/report/planning-slice-lookup.d.ts.map +1 -1
  173. package/dist/core/report/planning-slice-lookup.js +3 -9
  174. package/dist/core/report/planning-slice-lookup.js.map +1 -1
  175. package/dist/core/report/recent-disclosures.d.ts +18 -0
  176. package/dist/core/report/recent-disclosures.d.ts.map +1 -0
  177. package/dist/core/report/recent-disclosures.js +105 -0
  178. package/dist/core/report/recent-disclosures.js.map +1 -0
  179. package/dist/core/report/record-disclosures.d.ts +14 -0
  180. package/dist/core/report/record-disclosures.d.ts.map +1 -0
  181. package/dist/core/report/record-disclosures.js +30 -0
  182. package/dist/core/report/record-disclosures.js.map +1 -0
  183. package/dist/core/report/record-estimates.d.ts +25 -0
  184. package/dist/core/report/record-estimates.d.ts.map +1 -0
  185. package/dist/core/report/record-estimates.js +83 -0
  186. package/dist/core/report/record-estimates.js.map +1 -0
  187. package/dist/core/report/record-rework.d.ts +19 -0
  188. package/dist/core/report/record-rework.d.ts.map +1 -0
  189. package/dist/core/report/record-rework.js +50 -0
  190. package/dist/core/report/record-rework.js.map +1 -0
  191. package/dist/core/report/record-verification.d.ts +16 -0
  192. package/dist/core/report/record-verification.d.ts.map +1 -0
  193. package/dist/core/report/record-verification.js +33 -0
  194. package/dist/core/report/record-verification.js.map +1 -0
  195. package/dist/core/report/report-dependencies.d.ts +29 -0
  196. package/dist/core/report/report-dependencies.d.ts.map +1 -0
  197. package/dist/core/report/report-dependencies.js +92 -0
  198. package/dist/core/report/report-dependencies.js.map +1 -0
  199. package/dist/core/report/report-events.d.ts +1 -0
  200. package/dist/core/report/report-events.d.ts.map +1 -1
  201. package/dist/core/report/report-events.js +8 -26
  202. package/dist/core/report/report-events.js.map +1 -1
  203. package/dist/core/report/report-mutation.d.ts +34 -0
  204. package/dist/core/report/report-mutation.d.ts.map +1 -0
  205. package/dist/core/report/report-mutation.js +191 -0
  206. package/dist/core/report/report-mutation.js.map +1 -0
  207. package/dist/core/report/report-scope.d.ts +21 -0
  208. package/dist/core/report/report-scope.d.ts.map +1 -0
  209. package/dist/core/report/report-scope.js +61 -0
  210. package/dist/core/report/report-scope.js.map +1 -0
  211. package/dist/core/report/report-traceability.d.ts +29 -0
  212. package/dist/core/report/report-traceability.d.ts.map +1 -0
  213. package/dist/core/report/report-traceability.js +94 -0
  214. package/dist/core/report/report-traceability.js.map +1 -0
  215. package/dist/core/report/report.d.ts +35 -1
  216. package/dist/core/report/report.d.ts.map +1 -1
  217. package/dist/core/report/report.js +130 -111
  218. package/dist/core/report/report.js.map +1 -1
  219. package/dist/core/report/result-sections.d.ts +30 -0
  220. package/dist/core/report/result-sections.d.ts.map +1 -0
  221. package/dist/core/report/result-sections.js +125 -0
  222. package/dist/core/report/result-sections.js.map +1 -0
  223. package/dist/core/report/scope-size.d.ts +7 -0
  224. package/dist/core/report/scope-size.d.ts.map +1 -0
  225. package/dist/core/report/scope-size.js +22 -0
  226. package/dist/core/report/scope-size.js.map +1 -0
  227. package/dist/core/run/commit-message.d.ts +24 -0
  228. package/dist/core/run/commit-message.d.ts.map +1 -0
  229. package/dist/core/run/commit-message.js +76 -0
  230. package/dist/core/run/commit-message.js.map +1 -0
  231. package/dist/core/run/dead-commit.d.ts +10 -0
  232. package/dist/core/run/dead-commit.d.ts.map +1 -0
  233. package/dist/core/run/dead-commit.js +70 -0
  234. package/dist/core/run/dead-commit.js.map +1 -0
  235. package/dist/core/run/focused-tests.d.ts +43 -0
  236. package/dist/core/run/focused-tests.d.ts.map +1 -0
  237. package/dist/core/run/focused-tests.js +116 -0
  238. package/dist/core/run/focused-tests.js.map +1 -0
  239. package/dist/core/run/manifest-approval.d.ts +7 -0
  240. package/dist/core/run/manifest-approval.d.ts.map +1 -0
  241. package/dist/core/run/manifest-approval.js +30 -0
  242. package/dist/core/run/manifest-approval.js.map +1 -0
  243. package/dist/core/run/manifest.d.ts +11 -1
  244. package/dist/core/run/manifest.d.ts.map +1 -1
  245. package/dist/core/run/manifest.js +52 -11
  246. package/dist/core/run/manifest.js.map +1 -1
  247. package/dist/core/run/mutation-report.d.ts +29 -0
  248. package/dist/core/run/mutation-report.d.ts.map +1 -0
  249. package/dist/core/run/mutation-report.js +107 -0
  250. package/dist/core/run/mutation-report.js.map +1 -0
  251. package/dist/core/run/mutation-run.d.ts +32 -0
  252. package/dist/core/run/mutation-run.d.ts.map +1 -0
  253. package/dist/core/run/mutation-run.js +80 -0
  254. package/dist/core/run/mutation-run.js.map +1 -0
  255. package/dist/core/run/verification.d.ts +12 -1
  256. package/dist/core/run/verification.d.ts.map +1 -1
  257. package/dist/core/run/verification.js +24 -2
  258. package/dist/core/run/verification.js.map +1 -1
  259. package/dist/core/spec/approve-worktree-shared.d.ts +33 -0
  260. package/dist/core/spec/approve-worktree-shared.d.ts.map +1 -0
  261. package/dist/core/spec/approve-worktree-shared.js +59 -0
  262. package/dist/core/spec/approve-worktree-shared.js.map +1 -0
  263. package/dist/core/spec/approve-worktree.d.ts +21 -0
  264. package/dist/core/spec/approve-worktree.d.ts.map +1 -0
  265. package/dist/core/spec/approve-worktree.js +153 -0
  266. package/dist/core/spec/approve-worktree.js.map +1 -0
  267. package/dist/core/spec/approve.d.ts +20 -10
  268. package/dist/core/spec/approve.d.ts.map +1 -1
  269. package/dist/core/spec/approve.js +57 -54
  270. package/dist/core/spec/approve.js.map +1 -1
  271. package/dist/core/spec/capability-impact.d.ts +43 -0
  272. package/dist/core/spec/capability-impact.d.ts.map +1 -0
  273. package/dist/core/spec/capability-impact.js +85 -0
  274. package/dist/core/spec/capability-impact.js.map +1 -0
  275. package/dist/core/spec/decisions-lint.d.ts +18 -0
  276. package/dist/core/spec/decisions-lint.d.ts.map +1 -0
  277. package/dist/core/spec/decisions-lint.js +127 -0
  278. package/dist/core/spec/decisions-lint.js.map +1 -0
  279. package/dist/core/spec/delta.d.ts +6 -0
  280. package/dist/core/spec/delta.d.ts.map +1 -1
  281. package/dist/core/spec/delta.js +73 -5
  282. package/dist/core/spec/delta.js.map +1 -1
  283. package/dist/core/spec/digest-decisions.d.ts +27 -0
  284. package/dist/core/spec/digest-decisions.d.ts.map +1 -0
  285. package/dist/core/spec/digest-decisions.js +86 -0
  286. package/dist/core/spec/digest-decisions.js.map +1 -0
  287. package/dist/core/spec/digest-format.d.ts +4 -0
  288. package/dist/core/spec/digest-format.d.ts.map +1 -0
  289. package/dist/core/spec/digest-format.js +44 -0
  290. package/dist/core/spec/digest-format.js.map +1 -0
  291. package/dist/core/spec/digest.d.ts +5 -3
  292. package/dist/core/spec/digest.d.ts.map +1 -1
  293. package/dist/core/spec/digest.js +14 -33
  294. package/dist/core/spec/digest.js.map +1 -1
  295. package/dist/core/spec/human-steps.d.ts +20 -0
  296. package/dist/core/spec/human-steps.d.ts.map +1 -0
  297. package/dist/core/spec/human-steps.js +52 -0
  298. package/dist/core/spec/human-steps.js.map +1 -0
  299. package/dist/core/spec/impact-lint.d.ts +24 -0
  300. package/dist/core/spec/impact-lint.d.ts.map +1 -0
  301. package/dist/core/spec/impact-lint.js +39 -0
  302. package/dist/core/spec/impact-lint.js.map +1 -0
  303. package/dist/core/spec/import-graph.d.ts +35 -0
  304. package/dist/core/spec/import-graph.d.ts.map +1 -0
  305. package/dist/core/spec/import-graph.js +155 -0
  306. package/dist/core/spec/import-graph.js.map +1 -0
  307. package/dist/core/spec/lint-findings.d.ts +44 -0
  308. package/dist/core/spec/lint-findings.d.ts.map +1 -0
  309. package/dist/core/spec/lint-findings.js +56 -0
  310. package/dist/core/spec/lint-findings.js.map +1 -0
  311. package/dist/core/spec/lint-output.d.ts +53 -0
  312. package/dist/core/spec/lint-output.d.ts.map +1 -0
  313. package/dist/core/spec/lint-output.js +87 -0
  314. package/dist/core/spec/lint-output.js.map +1 -0
  315. package/dist/core/spec/linter.d.ts +14 -4
  316. package/dist/core/spec/linter.d.ts.map +1 -1
  317. package/dist/core/spec/linter.js +271 -111
  318. package/dist/core/spec/linter.js.map +1 -1
  319. package/dist/core/spec/merged-spec-check.d.ts +24 -0
  320. package/dist/core/spec/merged-spec-check.d.ts.map +1 -0
  321. package/dist/core/spec/merged-spec-check.js +95 -0
  322. package/dist/core/spec/merged-spec-check.js.map +1 -0
  323. package/dist/core/spec/openspec-issues.d.ts +58 -0
  324. package/dist/core/spec/openspec-issues.d.ts.map +1 -0
  325. package/dist/core/spec/openspec-issues.js +166 -0
  326. package/dist/core/spec/openspec-issues.js.map +1 -0
  327. package/dist/core/spec/parser.d.ts +1 -0
  328. package/dist/core/spec/parser.d.ts.map +1 -1
  329. package/dist/core/spec/parser.js +16 -6
  330. package/dist/core/spec/parser.js.map +1 -1
  331. package/dist/core/spec/scenario-impact.d.ts +47 -0
  332. package/dist/core/spec/scenario-impact.d.ts.map +1 -0
  333. package/dist/core/spec/scenario-impact.js +130 -0
  334. package/dist/core/spec/scenario-impact.js.map +1 -0
  335. package/dist/core/spec/test-impact.d.ts +28 -0
  336. package/dist/core/spec/test-impact.d.ts.map +1 -0
  337. package/dist/core/spec/test-impact.js +119 -0
  338. package/dist/core/spec/test-impact.js.map +1 -0
  339. package/dist/core/spec/traceability-links.d.ts +50 -0
  340. package/dist/core/spec/traceability-links.d.ts.map +1 -0
  341. package/dist/core/spec/traceability-links.js +120 -0
  342. package/dist/core/spec/traceability-links.js.map +1 -0
  343. package/dist/core/spec/traceability-lint.d.ts +29 -0
  344. package/dist/core/spec/traceability-lint.d.ts.map +1 -0
  345. package/dist/core/spec/traceability-lint.js +143 -0
  346. package/dist/core/spec/traceability-lint.js.map +1 -0
  347. package/dist/core/status/blocked-item.d.ts +8 -0
  348. package/dist/core/status/blocked-item.d.ts.map +1 -0
  349. package/dist/core/status/blocked-item.js +45 -0
  350. package/dist/core/status/blocked-item.js.map +1 -0
  351. package/dist/core/status/change-locations.d.ts +44 -0
  352. package/dist/core/status/change-locations.d.ts.map +1 -0
  353. package/dist/core/status/change-locations.js +138 -0
  354. package/dist/core/status/change-locations.js.map +1 -0
  355. package/dist/core/status/dependency-readiness.d.ts +11 -0
  356. package/dist/core/status/dependency-readiness.d.ts.map +1 -0
  357. package/dist/core/status/dependency-readiness.js +39 -0
  358. package/dist/core/status/dependency-readiness.js.map +1 -0
  359. package/dist/core/status/inbox-projection.d.ts.map +1 -1
  360. package/dist/core/status/inbox-projection.js +23 -4
  361. package/dist/core/status/inbox-projection.js.map +1 -1
  362. package/dist/core/status/inbox-text.d.ts.map +1 -1
  363. package/dist/core/status/inbox-text.js +34 -3
  364. package/dist/core/status/inbox-text.js.map +1 -1
  365. package/dist/core/status/inbox.d.ts +10 -1
  366. package/dist/core/status/inbox.d.ts.map +1 -1
  367. package/dist/core/status/inbox.js +19 -1
  368. package/dist/core/status/inbox.js.map +1 -1
  369. package/dist/core/status/layout.d.ts +6 -0
  370. package/dist/core/status/layout.d.ts.map +1 -1
  371. package/dist/core/status/layout.js +8 -0
  372. package/dist/core/status/layout.js.map +1 -1
  373. package/dist/core/status/next-step.d.ts +17 -0
  374. package/dist/core/status/next-step.d.ts.map +1 -0
  375. package/dist/core/status/next-step.js +85 -0
  376. package/dist/core/status/next-step.js.map +1 -0
  377. package/dist/core/status/pre-spawn-words.d.ts +13 -0
  378. package/dist/core/status/pre-spawn-words.d.ts.map +1 -0
  379. package/dist/core/status/pre-spawn-words.js +26 -0
  380. package/dist/core/status/pre-spawn-words.js.map +1 -0
  381. package/dist/core/status/queue-parser.d.ts +1 -0
  382. package/dist/core/status/queue-parser.d.ts.map +1 -1
  383. package/dist/core/status/queue-parser.js +41 -2
  384. package/dist/core/status/queue-parser.js.map +1 -1
  385. package/dist/core/status/queue-planning.d.ts +1 -0
  386. package/dist/core/status/queue-planning.d.ts.map +1 -1
  387. package/dist/core/status/queue-planning.js +24 -12
  388. package/dist/core/status/queue-planning.js.map +1 -1
  389. package/dist/core/status/queue-report-detail.d.ts.map +1 -1
  390. package/dist/core/status/queue-report-detail.js +5 -3
  391. package/dist/core/status/queue-report-detail.js.map +1 -1
  392. package/dist/core/status/queue-state.d.ts +1 -1
  393. package/dist/core/status/queue-state.d.ts.map +1 -1
  394. package/dist/core/status/queue-state.js +27 -41
  395. package/dist/core/status/queue-state.js.map +1 -1
  396. package/dist/core/status/show.d.ts +25 -0
  397. package/dist/core/status/show.d.ts.map +1 -1
  398. package/dist/core/status/show.js +354 -91
  399. package/dist/core/status/show.js.map +1 -1
  400. package/dist/core/status/state.d.ts.map +1 -1
  401. package/dist/core/status/state.js +1 -23
  402. package/dist/core/status/state.js.map +1 -1
  403. package/dist/core/status/status.d.ts +18 -0
  404. package/dist/core/status/status.d.ts.map +1 -1
  405. package/dist/core/status/status.js +59 -80
  406. package/dist/core/status/status.js.map +1 -1
  407. package/dist/core/status/verification.d.ts +27 -0
  408. package/dist/core/status/verification.d.ts.map +1 -0
  409. package/dist/core/status/verification.js +111 -0
  410. package/dist/core/status/verification.js.map +1 -0
  411. package/dist/core/trace/function-ranges.d.ts +30 -0
  412. package/dist/core/trace/function-ranges.d.ts.map +1 -0
  413. package/dist/core/trace/function-ranges.js +250 -0
  414. package/dist/core/trace/function-ranges.js.map +1 -0
  415. package/dist/core/trace/mutation-pick.d.ts +55 -0
  416. package/dist/core/trace/mutation-pick.d.ts.map +1 -0
  417. package/dist/core/trace/mutation-pick.js +96 -0
  418. package/dist/core/trace/mutation-pick.js.map +1 -0
  419. package/dist/core/trace/scenario-index.d.ts +27 -0
  420. package/dist/core/trace/scenario-index.d.ts.map +1 -0
  421. package/dist/core/trace/scenario-index.js +76 -0
  422. package/dist/core/trace/scenario-index.js.map +1 -0
  423. package/dist/core/trace/scenario-lookup.d.ts +14 -0
  424. package/dist/core/trace/scenario-lookup.d.ts.map +1 -0
  425. package/dist/core/trace/scenario-lookup.js +179 -0
  426. package/dist/core/trace/scenario-lookup.js.map +1 -0
  427. package/dist/core/trace/tag-scan.d.ts +44 -0
  428. package/dist/core/trace/tag-scan.d.ts.map +1 -0
  429. package/dist/core/trace/tag-scan.js +200 -0
  430. package/dist/core/trace/tag-scan.js.map +1 -0
  431. package/dist/core/vcs/doctor-git.d.ts +13 -0
  432. package/dist/core/vcs/doctor-git.d.ts.map +1 -0
  433. package/dist/core/vcs/doctor-git.js +114 -0
  434. package/dist/core/vcs/doctor-git.js.map +1 -0
  435. package/dist/core/vcs/git-vcs-write.d.ts +47 -0
  436. package/dist/core/vcs/git-vcs-write.d.ts.map +1 -0
  437. package/dist/core/vcs/git-vcs-write.js +210 -0
  438. package/dist/core/vcs/git-vcs-write.js.map +1 -0
  439. package/dist/core/vcs/git-vcs.d.ts +40 -0
  440. package/dist/core/vcs/git-vcs.d.ts.map +1 -0
  441. package/dist/core/vcs/git-vcs.js +170 -0
  442. package/dist/core/vcs/git-vcs.js.map +1 -0
  443. package/dist/core/vcs/no-vcs.d.ts +26 -0
  444. package/dist/core/vcs/no-vcs.d.ts.map +1 -0
  445. package/dist/core/vcs/no-vcs.js +62 -0
  446. package/dist/core/vcs/no-vcs.js.map +1 -0
  447. package/dist/core/vcs/select.d.ts +11 -0
  448. package/dist/core/vcs/select.d.ts.map +1 -0
  449. package/dist/core/vcs/select.js +33 -0
  450. package/dist/core/vcs/select.js.map +1 -0
  451. package/dist/core/vcs/snapshot.d.ts +34 -0
  452. package/dist/core/vcs/snapshot.d.ts.map +1 -0
  453. package/dist/core/vcs/snapshot.js +71 -0
  454. package/dist/core/vcs/snapshot.js.map +1 -0
  455. package/dist/core/vcs/vcs.d.ts +55 -0
  456. package/dist/core/vcs/vcs.d.ts.map +1 -0
  457. package/dist/core/vcs/vcs.js +2 -0
  458. package/dist/core/vcs/vcs.js.map +1 -0
  459. package/dist/core/vcs/worktree.d.ts +10 -0
  460. package/dist/core/vcs/worktree.d.ts.map +1 -0
  461. package/dist/core/vcs/worktree.js +25 -0
  462. package/dist/core/vcs/worktree.js.map +1 -0
  463. package/dist/core/web/web-data-folders.d.ts.map +1 -1
  464. package/dist/core/web/web-data-folders.js +18 -33
  465. package/dist/core/web/web-data-folders.js.map +1 -1
  466. package/dist/core/web/web-data-lifecycle.d.ts.map +1 -1
  467. package/dist/core/web/web-data-lifecycle.js +2 -1
  468. package/dist/core/web/web-data-lifecycle.js.map +1 -1
  469. package/dist/core/web/web-events.d.ts +8 -6
  470. package/dist/core/web/web-events.d.ts.map +1 -1
  471. package/dist/core/web/web-events.js +7 -31
  472. package/dist/core/web/web-events.js.map +1 -1
  473. package/dist/core/web/web-server.d.ts.map +1 -1
  474. package/dist/core/web/web-server.js +3 -0
  475. package/dist/core/web/web-server.js.map +1 -1
  476. package/dist/core/web/web-trees.d.ts +27 -0
  477. package/dist/core/web/web-trees.d.ts.map +1 -0
  478. package/dist/core/web/web-trees.js +82 -0
  479. package/dist/core/web/web-trees.js.map +1 -0
  480. package/dist/harness/claude/claude-exec-args.d.ts +13 -0
  481. package/dist/harness/claude/claude-exec-args.d.ts.map +1 -0
  482. package/dist/harness/claude/claude-exec-args.js +61 -0
  483. package/dist/harness/claude/claude-exec-args.js.map +1 -0
  484. package/dist/harness/claude/claude-exec.d.ts +12 -0
  485. package/dist/harness/claude/claude-exec.d.ts.map +1 -0
  486. package/dist/harness/claude/claude-exec.js +79 -0
  487. package/dist/harness/claude/claude-exec.js.map +1 -0
  488. package/dist/harness/claude/claude-stream.d.ts +31 -0
  489. package/dist/harness/claude/claude-stream.d.ts.map +1 -0
  490. package/dist/harness/claude/claude-stream.js +150 -0
  491. package/dist/harness/claude/claude-stream.js.map +1 -0
  492. package/dist/harness/claude/claude-tools.d.ts +5 -0
  493. package/dist/harness/claude/claude-tools.d.ts.map +1 -0
  494. package/dist/harness/claude/claude-tools.js +30 -0
  495. package/dist/harness/claude/claude-tools.js.map +1 -0
  496. package/dist/harness/index.d.ts +1 -0
  497. package/dist/harness/index.d.ts.map +1 -1
  498. package/dist/harness/index.js +3 -0
  499. package/dist/harness/index.js.map +1 -1
  500. package/dist/harness/opencode/opencode-session.d.ts +42 -0
  501. package/dist/harness/opencode/opencode-session.d.ts.map +1 -0
  502. package/dist/harness/opencode/opencode-session.js +123 -0
  503. package/dist/harness/opencode/opencode-session.js.map +1 -0
  504. package/dist/harness/opencode/opencode.d.ts +2 -1
  505. package/dist/harness/opencode/opencode.d.ts.map +1 -1
  506. package/dist/harness/opencode/opencode.js +52 -28
  507. package/dist/harness/opencode/opencode.js.map +1 -1
  508. package/dist/harness/prompt.js +1 -1
  509. package/dist/harness/prompt.js.map +1 -1
  510. package/dist/harness/types.d.ts +112 -1
  511. package/dist/harness/types.d.ts.map +1 -1
  512. package/dist/harness/types.js.map +1 -1
  513. package/dist/index.d.ts +3 -1
  514. package/dist/index.d.ts.map +1 -1
  515. package/dist/index.js +1 -0
  516. package/dist/index.js.map +1 -1
  517. package/dist/testing/index.d.ts +3 -0
  518. package/dist/testing/index.d.ts.map +1 -0
  519. package/dist/testing/index.js +2 -0
  520. package/dist/testing/index.js.map +1 -0
  521. package/dist/testing/scenario.d.ts +29 -0
  522. package/dist/testing/scenario.d.ts.map +1 -0
  523. package/dist/testing/scenario.js +157 -0
  524. package/dist/testing/scenario.js.map +1 -0
  525. package/dist/watcher/archiver.d.ts +2 -1
  526. package/dist/watcher/archiver.d.ts.map +1 -1
  527. package/dist/watcher/archiver.js +27 -2
  528. package/dist/watcher/archiver.js.map +1 -1
  529. package/dist/watcher/auto-recertify.d.ts +27 -0
  530. package/dist/watcher/auto-recertify.d.ts.map +1 -0
  531. package/dist/watcher/auto-recertify.js +113 -0
  532. package/dist/watcher/auto-recertify.js.map +1 -0
  533. package/dist/watcher/auto-retry.d.ts +1 -1
  534. package/dist/watcher/auto-retry.d.ts.map +1 -1
  535. package/dist/watcher/auto-retry.js +3 -11
  536. package/dist/watcher/auto-retry.js.map +1 -1
  537. package/dist/watcher/baseline-key.d.ts +17 -0
  538. package/dist/watcher/baseline-key.d.ts.map +1 -0
  539. package/dist/watcher/baseline-key.js +31 -0
  540. package/dist/watcher/baseline-key.js.map +1 -0
  541. package/dist/watcher/baseline.d.ts +32 -0
  542. package/dist/watcher/baseline.d.ts.map +1 -0
  543. package/dist/watcher/baseline.js +166 -0
  544. package/dist/watcher/baseline.js.map +1 -0
  545. package/dist/watcher/blocked.d.ts +12 -0
  546. package/dist/watcher/blocked.d.ts.map +1 -0
  547. package/dist/watcher/blocked.js +24 -0
  548. package/dist/watcher/blocked.js.map +1 -0
  549. package/dist/watcher/dependencies.d.ts +28 -0
  550. package/dist/watcher/dependencies.d.ts.map +1 -0
  551. package/dist/watcher/dependencies.js +152 -0
  552. package/dist/watcher/dependencies.js.map +1 -0
  553. package/dist/watcher/done-metadata.d.ts +4 -0
  554. package/dist/watcher/done-metadata.d.ts.map +1 -0
  555. package/dist/watcher/done-metadata.js +20 -0
  556. package/dist/watcher/done-metadata.js.map +1 -0
  557. package/dist/watcher/failure-reason.d.ts +1 -1
  558. package/dist/watcher/failure-reason.d.ts.map +1 -1
  559. package/dist/watcher/focused-verify.d.ts +17 -0
  560. package/dist/watcher/focused-verify.d.ts.map +1 -0
  561. package/dist/watcher/focused-verify.js +54 -0
  562. package/dist/watcher/focused-verify.js.map +1 -0
  563. package/dist/watcher/git-guard.d.ts +24 -0
  564. package/dist/watcher/git-guard.d.ts.map +1 -0
  565. package/dist/watcher/git-guard.js +95 -0
  566. package/dist/watcher/git-guard.js.map +1 -0
  567. package/dist/watcher/instructions-drift.d.ts +21 -0
  568. package/dist/watcher/instructions-drift.d.ts.map +1 -0
  569. package/dist/watcher/instructions-drift.js +115 -0
  570. package/dist/watcher/instructions-drift.js.map +1 -0
  571. package/dist/watcher/loop.d.ts.map +1 -1
  572. package/dist/watcher/loop.js +36 -50
  573. package/dist/watcher/loop.js.map +1 -1
  574. package/dist/watcher/measures.d.ts.map +1 -1
  575. package/dist/watcher/measures.js +22 -39
  576. package/dist/watcher/measures.js.map +1 -1
  577. package/dist/watcher/mutation-check.d.ts +42 -0
  578. package/dist/watcher/mutation-check.d.ts.map +1 -0
  579. package/dist/watcher/mutation-check.js +147 -0
  580. package/dist/watcher/mutation-check.js.map +1 -0
  581. package/dist/watcher/regression.d.ts +10 -5
  582. package/dist/watcher/regression.d.ts.map +1 -1
  583. package/dist/watcher/regression.js +29 -22
  584. package/dist/watcher/regression.js.map +1 -1
  585. package/dist/watcher/runner.d.ts.map +1 -1
  586. package/dist/watcher/runner.js +12 -14
  587. package/dist/watcher/runner.js.map +1 -1
  588. package/dist/watcher/spawn.d.ts.map +1 -1
  589. package/dist/watcher/spawn.js +5 -0
  590. package/dist/watcher/spawn.js.map +1 -1
  591. package/dist/watcher/task-verify.d.ts +7 -2
  592. package/dist/watcher/task-verify.d.ts.map +1 -1
  593. package/dist/watcher/task-verify.js +33 -8
  594. package/dist/watcher/task-verify.js.map +1 -1
  595. package/dist/watcher/verify.d.ts +1 -5
  596. package/dist/watcher/verify.d.ts.map +1 -1
  597. package/dist/watcher/verify.js +2 -6
  598. package/dist/watcher/verify.js.map +1 -1
  599. package/package.json +5 -1
  600. package/templates/PLANNER.md +35 -9
  601. package/templates/openspec/config.yaml +1 -1
  602. package/templates/openspec/schemas/osq/schema.yaml +4 -2
  603. package/templates/openspec/schemas/osq/templates/proposal.md +9 -2
  604. package/templates/proposal.md +9 -2
  605. package/ui/dist/assets/{index-CZYeQ8la.js → index-D39uYbbL.js} +1 -1
  606. package/ui/dist/index.html +1 -1
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Run one mutation pick: substitute the command's placeholders, run it through
3
+ * `runVerificationCommand` with the pick's environment, read the report, and
4
+ * return the outcome. The temporary folder is always removed. Nothing here
5
+ * blocks a task.
6
+ */
7
+ import type { MutationPick } from '../trace/mutation-pick.js';
8
+ import { type MutationSurvivor } from './mutation-report.js';
9
+ /** Why a pick was not measured. */
10
+ export type MutationNotMeasuredReason = 'range_unknown' | 'timed_out' | 'command_failed' | 'report_invalid';
11
+ /** One pick's outcome, counts, survivors, and process evidence. */
12
+ export interface MutationRunResult {
13
+ readonly outcome: 'measured' | 'not_measured';
14
+ readonly reason?: MutationNotMeasuredReason;
15
+ readonly killed: number;
16
+ readonly survived: number;
17
+ readonly invalid: number;
18
+ readonly survivors: readonly MutationSurvivor[];
19
+ readonly duration: number;
20
+ readonly exitCode: number | null;
21
+ readonly output: string;
22
+ }
23
+ /**
24
+ * Run `command` for one pick under `timeoutSeconds`. The ranges and tests go
25
+ * to the placeholders and to `OSQ_MUTATE` and `OSQ_MUTATION_TESTS` as JSON
26
+ * arrays, and the report path to `{report}` and `OSQ_MUTATION_REPORT`. The
27
+ * command also receives `OSQ_CHANGE` through `runVerificationCommand`. A pick
28
+ * whose ranges are unknown is not run. The fresh temporary folder is removed
29
+ * after the report is read, whether or not it was readable.
30
+ */
31
+ export declare function runMutationPick(pick: MutationPick, projectRoot: string, changeFolder: string, command: string, timeoutSeconds: number): Promise<MutationRunResult>;
32
+ //# sourceMappingURL=mutation-run.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mutation-run.d.ts","sourceRoot":"","sources":["../../../src/core/run/mutation-run.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,KAAK,gBAAgB,EAAsB,MAAM,sBAAsB,CAAC;AAGjF,mCAAmC;AACnC,MAAM,MAAM,yBAAyB,GACjC,eAAe,GACf,WAAW,GACX,gBAAgB,GAChB,gBAAgB,CAAC;AAErB,mEAAmE;AACnE,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,OAAO,EAAE,UAAU,GAAG,cAAc,CAAC;IAC9C,QAAQ,CAAC,MAAM,CAAC,EAAE,yBAAyB,CAAC;IAC5C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAChD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAqCD;;;;;;;GAOG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,YAAY,EAClB,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,iBAAiB,CAAC,CA8C5B"}
@@ -0,0 +1,80 @@
1
+ /**
2
+ * Run one mutation pick: substitute the command's placeholders, run it through
3
+ * `runVerificationCommand` with the pick's environment, read the report, and
4
+ * return the outcome. The temporary folder is always removed. Nothing here
5
+ * blocks a task.
6
+ */
7
+ import fs from 'node:fs/promises';
8
+ import os from 'node:os';
9
+ import path from 'node:path';
10
+ import { readMutationReport } from './mutation-report.js';
11
+ import { runVerificationCommand } from './verification.js';
12
+ /** The last 2,000 characters of a command's output. */
13
+ function boundOutput(output) {
14
+ return output.length > 2000 ? output.slice(-2000) : output;
15
+ }
16
+ /** A not-measured result with zero counts and no survivors. */
17
+ function notMeasured(reason, exitCode, duration, output) {
18
+ return {
19
+ outcome: 'not_measured',
20
+ reason,
21
+ killed: 0,
22
+ survived: 0,
23
+ invalid: 0,
24
+ survivors: [],
25
+ duration,
26
+ exitCode,
27
+ output,
28
+ };
29
+ }
30
+ /** Replace `{mutate}`, `{tests}`, and `{report}` with the pick's shell-ready values. */
31
+ function resolveCommand(pick, command, reportPath) {
32
+ const ranges = pick.ranges ?? [];
33
+ const tests = pick.tests.map((test) => `'${test}'`).join(' ');
34
+ return command
35
+ .replace(/\{mutate\}/g, ranges.join(','))
36
+ .replace(/\{tests\}/g, tests)
37
+ .replace(/\{report\}/g, `'${reportPath}'`);
38
+ }
39
+ /**
40
+ * Run `command` for one pick under `timeoutSeconds`. The ranges and tests go
41
+ * to the placeholders and to `OSQ_MUTATE` and `OSQ_MUTATION_TESTS` as JSON
42
+ * arrays, and the report path to `{report}` and `OSQ_MUTATION_REPORT`. The
43
+ * command also receives `OSQ_CHANGE` through `runVerificationCommand`. A pick
44
+ * whose ranges are unknown is not run. The fresh temporary folder is removed
45
+ * after the report is read, whether or not it was readable.
46
+ */
47
+ export async function runMutationPick(pick, projectRoot, changeFolder, command, timeoutSeconds) {
48
+ if (pick.ranges === null)
49
+ return notMeasured('range_unknown', null, 0, '');
50
+ const folder = await fs.mkdtemp(path.join(os.tmpdir(), 'osq-mutation-'));
51
+ const reportPath = path.join(folder, 'mutation.json');
52
+ try {
53
+ const result = await runVerificationCommand(projectRoot, resolveCommand(pick, command, reportPath), timeoutSeconds, changeFolder, {
54
+ OSQ_MUTATE: JSON.stringify([...pick.ranges]),
55
+ OSQ_MUTATION_TESTS: JSON.stringify([...pick.tests]),
56
+ OSQ_MUTATION_REPORT: reportPath,
57
+ });
58
+ if (result.timedOut) {
59
+ return notMeasured('timed_out', result.exitCode, result.duration, boundOutput(result.output));
60
+ }
61
+ if (result.error !== undefined || result.exitCode !== 0) {
62
+ return notMeasured('command_failed', result.exitCode, result.duration, boundOutput(result.output));
63
+ }
64
+ const counts = readMutationReport(reportPath, pick.file, pick.ranges);
65
+ if (counts === null) {
66
+ return notMeasured('report_invalid', result.exitCode, result.duration, boundOutput(result.output));
67
+ }
68
+ return {
69
+ outcome: 'measured',
70
+ ...counts,
71
+ duration: result.duration,
72
+ exitCode: result.exitCode,
73
+ output: result.output,
74
+ };
75
+ }
76
+ finally {
77
+ await fs.rm(folder, { recursive: true, force: true });
78
+ }
79
+ }
80
+ //# sourceMappingURL=mutation-run.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mutation-run.js","sourceRoot":"","sources":["../../../src/core/run/mutation-run.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAyB,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAsB3D,uDAAuD;AACvD,SAAS,WAAW,CAAC,MAAc;IACjC,OAAO,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;AAC7D,CAAC;AAED,+DAA+D;AAC/D,SAAS,WAAW,CAClB,MAAiC,EACjC,QAAuB,EACvB,QAAgB,EAChB,MAAc;IAEd,OAAO;QACL,OAAO,EAAE,cAAc;QACvB,MAAM;QACN,MAAM,EAAE,CAAC;QACT,QAAQ,EAAE,CAAC;QACX,OAAO,EAAE,CAAC;QACV,SAAS,EAAE,EAAE;QACb,QA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ertification gates. It never imports from the
19
19
  * watcher or harness layers, so core retains its import boundary; callers own
20
20
  * event emission.
21
+ *
22
+ * `changeFolder` is the absolute change folder the command runs for, or null
23
+ * for a command whose deltas are already in the living spec. It becomes
24
+ * `OSQ_CHANGE`, or is removed from the child environment when null.
25
+ *
26
+ * `extraEnv` holds additional variables for the command, set after the
27
+ * `OSQ_CHANGE` handling so a caller can pass mutation inputs without touching
28
+ * the base environment.
29
+ *
30
+ * The captured output is passed through `relativizeToolSummary`, so every gate,
31
+ * event, and marker that reads it carries project-relative paths.
21
32
  */
22
- export declare function runVerificationCommand(projectRoot: string, command: string, timeoutSeconds: number): Promise<VerificationResult>;
33
+ export declare function runVerificationCommand(projectRoot: string, command: string, timeoutSeconds: number, changeFolder: string | null, extraEnv?: Readonly<Record<string, string>>): Promise<VerificationResult>;
23
34
  //# sourceMappingURL=verification.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"verification.d.ts","sourceRoot":"","sources":["../../../src/core/run/verification.ts"],"names":[],"mappings":"AAEA,+DAA+D;AAC/D,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,+DAA+D;IAC/D,QAAQ,EAAE,MAAM,CAAC;IACjB,iEAAiE;IACjE,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;IAClB,0EAA0E;IAC1E,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAWD;;;;;;;;GAQG;AACH,wBAAsB,sBAAsB,CAC1C,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,kBAAkB,CAAC,CA0D7B"}
1
+ {"version":3,"file":"verification.d.ts","sourceRoot":"","sources":["../../../src/core/run/verification.ts"],"names":[],"mappings":"AAGA,+DAA+D;AAC/D,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,+DAA+D;IAC/D,QAAQ,EAAE,MAAM,CAAC;IACjB,iEAAiE;IACjE,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;IAClB,0EAA0E;IAC1E,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAWD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,sBAAsB,CAC1C,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,MAAM,EACtB,YAAY,EAAE,MAAM,GAAG,IAAI,EAC3B,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAC1C,OAAO,CAAC,kBAAkB,CAAC,CAkE7B"}
@@ -1,4 +1,5 @@
1
1
  import { spawn } from 'node:child_process';
2
+ import { relativizeToolSummary } from './summary.js';
2
3
  function killTree(child, signal) {
3
4
  const pid = child.pid ?? Number.NaN;
4
5
  try {
@@ -16,20 +17,41 @@ function killTree(child, signal) {
16
17
  * scope-audit, archive, and recertification gates. It never imports from the
17
18
  * watcher or harness layers, so core retains its import boundary; callers own
18
19
  * event emission.
20
+ *
21
+ * `changeFolder` is the absolute change folder the command runs for, or null
22
+ * for a command whose deltas are already in the living spec. It becomes
23
+ * `OSQ_CHANGE`, or is removed from the child environment when null.
24
+ *
25
+ * `extraEnv` holds additional variables for the command, set after the
26
+ * `OSQ_CHANGE` handling so a caller can pass mutation inputs without touching
27
+ * the base environment.
28
+ *
29
+ * The captured output is passed through `relativizeToolSummary`, so every gate,
30
+ * event, and marker that reads it carries project-relative paths.
19
31
  */
20
- export async function runVerificationCommand(projectRoot, command, timeoutSeconds) {
32
+ export async function runVerificationCommand(projectRoot, command, timeoutSeconds, changeFolder, extraEnv) {
21
33
  const startMs = Date.now();
22
34
  const timeoutMs = timeoutSeconds * 1000;
23
35
  let timedOut = false;
24
36
  let exitCode = 1;
25
37
  let output = '';
26
38
  let spawnError;
39
+ const env = { ...process.env };
40
+ if (changeFolder === null) {
41
+ Reflect.deleteProperty(env, 'OSQ_CHANGE');
42
+ }
43
+ else {
44
+ env.OSQ_CHANGE = changeFolder;
45
+ }
46
+ for (const [name, value] of Object.entries(extraEnv ?? {}))
47
+ env[name] = value;
27
48
  await new Promise((resolve) => {
28
49
  const child = spawn(command, {
29
50
  cwd: projectRoot,
30
51
  shell: true,
31
52
  detached: true,
32
53
  stdio: ['ignore', 'pipe', 'pipe'],
54
+ env,
33
55
  });
34
56
  let timer = null;
35
57
  let killTimer = null;
@@ -70,7 +92,7 @@ export async function runVerificationCommand(projectRoot, command, timeoutSecond
70
92
  command,
71
93
  exitCode,
72
94
  duration: Number(((Date.now() - startMs) / 1000).toFixed(2)),
73
- output,
95
+ output: relativizeToolSummary(output, projectRoot),
74
96
  timedOut,
75
97
  ...(spawnError ? { error: spawnError } : {}),
76
98
  };
@@ -1 +1 @@
1
- {"version":3,"file":"verification.js","sourceRoot":"","sources":["../../../src/core/run/verification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAe3C,SAAS,QAAQ,CAAC,KAA+B,EAAE,MAAsB;IACvE,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,IAAI,MAAM,CAAC,GAAG,CAAC;IACpC,IAAI,CAAC;QACH,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IAC7B,CAAC;IAAC,MAAM,CAAC;QACP,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACrB,CAAC;AACH,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,WAAmB,EACnB,OAAe,EACf,cAAsB;IAEtB,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAC3B,MAAM,SAAS,GAAG,cAAc,GAAG,IAAI,CAAC;IACxC,IAAI,QAAQ,GAAG,KAA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AAC;QACX,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,OAAO;QACP,QAAQ;QACR,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAC5D,MAAM,EAAE,qBAAqB,CAAC,MAAM,EAAE,WAAW,CAAC;QAClD,QAAQ;QACR,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC7C,CAAC;AACJ,CAAC"}
@@ -0,0 +1,33 @@
1
+ import type { OsqConfig } from '../foundation/config.js';
2
+ import { type ApprovalDigest, type ApprovalFlag } from './digest.js';
3
+ /** How an optional approver review resolved before any seal is written. */
4
+ export type ApprovalReview = 'proceed' | 'confirmed' | 'declined';
5
+ /** Thrown when an approver declined a flagged approval; nothing is written. */
6
+ export declare class ApprovalDeclinedError extends Error {
7
+ constructor(flags: readonly ApprovalFlag[]);
8
+ }
9
+ /** The optional review port the CLI injects before the seal is written. */
10
+ export interface ApprovalReviewOptions {
11
+ review?: (digest: ApprovalDigest) => Promise<ApprovalReview>;
12
+ }
13
+ /** An approval that passed review, with the manifest mode it recorded. */
14
+ export interface ConfirmedApproval {
15
+ readonly digest: ApprovalDigest;
16
+ readonly mode: 'shown' | 'confirmed';
17
+ }
18
+ /** Normalize an optional observation time to ISO, or null when unusable. */
19
+ export declare function toIso(value: Date | string | undefined): string | null;
20
+ /** SHA-256 of a folder's `brief.md` bytes, or of empty bytes when absent. */
21
+ export declare function readBriefHash(folderPath: string): Promise<string>;
22
+ /**
23
+ * Build the digest and, when a review port is present, let it decide whether a
24
+ * flagged approval may proceed. Refusals throw before anything is written.
25
+ */
26
+ export declare function confirmApproval(projectRoot: string, folderPath: string, config: OsqConfig, options: ApprovalReviewOptions): Promise<ConfirmedApproval>;
27
+ /**
28
+ * Write the approval seal and manifest into `targetFolder`, which is the
29
+ * checkout's folder for an in-place approval or the worktree's copy otherwise.
30
+ * The caller owns the hash, so both paths seal the checkout's authored content.
31
+ */
32
+ export declare function writeApprovalSeal(projectRoot: string, targetFolder: string, config: OsqConfig, digest: ApprovalDigest, mode: 'shown' | 'confirmed', hash: string): Promise<void>;
33
+ //# sourceMappingURL=approve-worktree-shared.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"approve-worktree-shared.d.ts","sourceRoot":"","sources":["../../../src/core/spec/approve-worktree-shared.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAGzD,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,YAAY,EAGlB,MAAM,aAAa,CAAC;AAErB,2EAA2E;AAC3E,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,CAAC;AAElE,+EAA+E;AAC/E,qBAAa,qBAAsB,SAAQ,KAAK;gBAClC,KAAK,EAAE,SAAS,YAAY,EAAE;CAI3C;AAED,2EAA2E;AAC3E,MAAM,WAAW,qBAAqB;IACpC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC;CAC9D;AAED,0EAA0E;AAC1E,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAChC,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,WAAW,CAAC;CACtC;AAED,4EAA4E;AAC5E,wBAAgB,KAAK,CAAC,KAAK,EAAE,IAAI,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAQrE;AAED,6EAA6E;AAC7E,wBAAsB,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAGvE;AAED;;;GAGG;AACH,wBAAsB,eAAe,CACnC,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,iBAAiB,CAAC,CAW5B;AAED;;;;GAIG;AACH,wBAAsB,iBAAiB,CACrC,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,OAAO,GAAG,WAAW,EAC3B,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,IAAI,CAAC,CAUf"}
@@ -0,0 +1,59 @@
1
+ import fs from 'node:fs/promises';
2
+ import path from 'node:path';
3
+ import { hashBriefBytes } from '../report/planning.js';
4
+ import { buildManifest, writeManifest } from '../run/manifest.js';
5
+ import { buildApprovalDigest, summarizeApprovalFlags, } from './digest.js';
6
+ /** Thrown when an approver declined a flagged approval; nothing is written. */
7
+ export class ApprovalDeclinedError extends Error {
8
+ constructor(flags) {
9
+ super(`Approval declined: ${summarizeApprovalFlags(flags)}`);
10
+ this.name = 'ApprovalDeclinedError';
11
+ }
12
+ }
13
+ /** Normalize an optional observation time to ISO, or null when unusable. */
14
+ export function toIso(value) {
15
+ if (value instanceof Date) {
16
+ return Number.isFinite(value.getTime()) ? value.toISOString() : null;
17
+ }
18
+ if (typeof value === 'string') {
19
+ return Number.isFinite(Date.parse(value)) ? value : null;
20
+ }
21
+ return null;
22
+ }
23
+ /** SHA-256 of a folder's `brief.md` bytes, or of empty bytes when absent. */
24
+ export async function readBriefHash(folderPath) {
25
+ const bytes = await fs.readFile(path.join(folderPath, 'brief.md')).catch(() => null);
26
+ return hashBriefBytes(bytes ?? '');
27
+ }
28
+ /**
29
+ * Build the digest and, when a review port is present, let it decide whether a
30
+ * flagged approval may proceed. Refusals throw before anything is written.
31
+ */
32
+ export async function confirmApproval(projectRoot, folderPath, config, options) {
33
+ const digest = await buildApprovalDigest(projectRoot, folderPath, config);
34
+ let mode = 'shown';
35
+ if (options.review) {
36
+ const review = await options.review(digest);
37
+ if (review === 'declined') {
38
+ throw new ApprovalDeclinedError(digest.flags);
39
+ }
40
+ mode = review === 'confirmed' ? 'confirmed' : 'shown';
41
+ }
42
+ return { digest, mode };
43
+ }
44
+ /**
45
+ * Write the approval seal and manifest into `targetFolder`, which is the
46
+ * checkout's folder for an in-place approval or the worktree's copy otherwise.
47
+ * The caller owns the hash, so both paths seal the checkout's authored content.
48
+ */
49
+ export async function writeApprovalSeal(projectRoot, targetFolder, config, digest, mode, hash) {
50
+ const runDir = path.join(targetFolder, '.run');
51
+ await fs.mkdir(runDir, { recursive: true });
52
+ await fs.writeFile(path.join(runDir, 'approved'), `${hash}\n`, 'utf8');
53
+ const manifest = await buildManifest(projectRoot, targetFolder, config, {
54
+ ids: digest.flags.map((flag) => flag.id),
55
+ mode,
56
+ });
57
+ await writeManifest(runDir, manifest);
58
+ }
59
+ //# sourceMappingURL=approve-worktree-shared.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"approve-worktree-shared.js","sourceRoot":"","sources":["../../../src/core/spec/approve-worktree-shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAGL,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,aAAa,CAAC;AAKrB,+EAA+E;AAC/E,MAAM,OAAO,qBAAsB,SAAQ,KAAK;IAC9C,YAAY,KAA8B;QACxC,KAAK,CAAC,sBAAsB,sBAAsB,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAC7D,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;IACtC,CAAC;CACF;AAaD,4EAA4E;AAC5E,MAAM,UAAU,KAAK,CAAC,KAAgC;IACpD,IAAI,KAAK,YAAY,IAAI,EAAE,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;IACxD,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;AAC1B,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,WAAmB,EACnB,YAAoB,EACpB,MAAiB,EACjB,MAAsB,EACtB,IAA2B,EAC3B,IAAY;IAEZ,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;IAC/C,MAAM,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC5C,MAAM,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,CAAC,EAAE,GAAG,IAAI,IAAI,EAAE,MAAM,CAAC,CAAC;IAEvE,MAAM,QAAQ,GAAG,MAAM,aAAa,CAAC,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE;QACtE,GAAG,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QACxC,IAAI;KACL,CAAC,CAAC;IACH,MAAM,aAAa,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AACxC,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { type OsqConfig } from '../foundation/config.js';
2
+ import type { Vcs } from '../vcs/vcs.js';
3
+ import type { ApproveOptions, ApproveResult } from './approve.js';
4
+ /** Everything the worktree path needs from the checkout's change folder. */
5
+ export interface WorktreeApprovalInput {
6
+ readonly specId: string;
7
+ readonly folderName: string;
8
+ readonly folderPath: string;
9
+ readonly specsDir: string;
10
+ readonly config: OsqConfig;
11
+ readonly options: ApproveOptions;
12
+ readonly vcs: Vcs;
13
+ readonly warnings: readonly string[];
14
+ }
15
+ /**
16
+ * Approve a change onto its own branch and linked worktree, writing nothing to
17
+ * the checkout: lint and digest read it, the branch and worktree receive the
18
+ * sealed copy, and the worktree's first commit holds it.
19
+ */
20
+ export declare function approveIntoWorktree(projectRoot: string, input: WorktreeApprovalInput): Promise<ApproveResult>;
21
+ //# sourceMappingURL=approve-worktree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"approve-worktree.d.ts","sourceRoot":"","sources":["../../../src/core/spec/approve-worktree.ts"],"names":[],"mappings":"AAEA,OAAO,EAAkB,KAAK,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAYzE,OAAO,KAAK,EAAE,GAAG,EAAW,MAAM,eAAe,CAAC;AAQlD,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAIlE,4EAA4E;AAC5E,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;IACjC,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC;IAClB,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;CACtC;AA8GD;;;;GAIG;AACH,wBAAsB,mBAAmB,CACvC,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,qBAAqB,GAC3B,OAAO,CAAC,aAAa,CAAC,CA2DxB"}
@@ -0,0 +1,153 @@
1
+ import fs from 'node:fs/promises';
2
+ import path from 'node:path';
3
+ import { DEFAULT_CONFIG } from '../foundation/config.js';
4
+ import { appendObservedSessions, findPlanningSessions, resolveChangeCreationTime, } from '../report/planning-observed.js';
5
+ import { findUnpricedPlanningModels } from '../report/planning-price-gaps.js';
6
+ import { resolveOsqPackageVersion } from '../report/planning.js';
7
+ import { scopeCoversPath } from '../run/scope.js';
8
+ import { runVerificationCommand } from '../run/verification.js';
9
+ import { findChange } from '../status/change-locations.js';
10
+ import { selectVcs } from '../vcs/select.js';
11
+ import { worktreeBranch, worktreePath } from '../vcs/worktree.js';
12
+ import { confirmApproval, readBriefHash, toIso, writeApprovalSeal, } from './approve-worktree-shared.js';
13
+ import { hashChangeFolder } from './hasher.js';
14
+ import { parseSpecMdFromFolder, parseTaskMd } from './parser.js';
15
+ /** HEAD, refusing a branch other than the default unless `baseOk` is set. */
16
+ async function resolveBase(vcs, baseOk) {
17
+ const [head, defaultBranch] = await Promise.all([vcs.head(), vcs.defaultBranch()]);
18
+ if (head.branch === defaultBranch || baseOk)
19
+ return head;
20
+ const actual = head.branch ?? 'a detached HEAD';
21
+ throw new Error(`HEAD is on ${actual}, not the default branch ${defaultBranch}; pass --base-ok to approve from it`);
22
+ }
23
+ /** Every scope entry declared by every task of the change. */
24
+ async function readTaskScopes(folderPath) {
25
+ const tasksDir = path.join(folderPath, 'tasks');
26
+ const files = (await fs.readdir(tasksDir).catch(() => []))
27
+ .filter((entry) => entry.endsWith('.md'))
28
+ .sort();
29
+ const scopes = [];
30
+ for (const file of files) {
31
+ const content = await fs.readFile(path.join(tasksDir, file), 'utf8').catch(() => null);
32
+ if (content !== null)
33
+ scopes.push(...parseTaskMd(content).scope);
34
+ }
35
+ return scopes;
36
+ }
37
+ /** Refuse uncommitted checkout changes covered by any task's scope. */
38
+ async function refuseDirtyScope(folderPath, vcs, ignoreDirty) {
39
+ if (ignoreDirty)
40
+ return;
41
+ const scopes = await readTaskScopes(folderPath);
42
+ if (scopes.length === 0)
43
+ return;
44
+ const dirty = new Set();
45
+ for (const entry of await vcs.status()) {
46
+ if (scopeCoversPath(scopes, entry.path))
47
+ dirty.add(entry.path);
48
+ if (entry.from !== undefined && scopeCoversPath(scopes, entry.from))
49
+ dirty.add(entry.from);
50
+ }
51
+ if (dirty.size === 0)
52
+ return;
53
+ throw new Error(`uncommitted changes in task scope: ${[...dirty].sort().join(', ')}; commit them or pass --ignore-dirty`);
54
+ }
55
+ /** Refuse when the change's branch already exists. */
56
+ async function refuseExistingBranch(vcs, branch) {
57
+ const branches = await vcs.listBranches(branch);
58
+ if (branches.includes(branch))
59
+ throw new Error(`branch ${branch} already exists`);
60
+ }
61
+ /** Refuse when a `depends_on` change is approved but has not landed. */
62
+ async function refuseUnlandedDependencies(projectRoot, config, folderPath) {
63
+ const proposal = await parseSpecMdFromFolder(folderPath);
64
+ for (const id of proposal?.dependsOn ?? []) {
65
+ const dependency = await findChange(projectRoot, config, id).catch(() => null);
66
+ if (dependency === null)
67
+ continue;
68
+ const approved = await fs
69
+ .stat(path.join(dependency.folderPath, '.run', 'approved'))
70
+ .then(() => true)
71
+ .catch(() => false);
72
+ if (approved) {
73
+ throw new Error(`depends on ${dependency.folderName}, which is approved and has not landed; approve this change after it lands`);
74
+ }
75
+ }
76
+ }
77
+ /** Run `vcs.prepare` once in the worktree, stopping on a non-zero exit. */
78
+ async function runPrepare(worktreeRoot, config, branch) {
79
+ const prepare = config.vcs?.prepare;
80
+ if (prepare === undefined)
81
+ return;
82
+ const result = await runVerificationCommand(worktreeRoot, prepare, config.timeouts.verifyTimeoutSeconds, null);
83
+ if (result.exitCode !== 0) {
84
+ throw new Error(`prepare failed in worktree ${worktreeRoot} on branch ${branch}:\n${result.output}`);
85
+ }
86
+ }
87
+ /** Write `.run/base` and `.run/approver` into the worktree's folder copy. */
88
+ async function writeProvenance(vcs, worktreeFolder, base) {
89
+ const runDir = path.join(worktreeFolder, '.run');
90
+ await fs.writeFile(path.join(runDir, 'base'), `${base ?? ''}\n`, 'utf8');
91
+ const [userName, userEmail] = await Promise.all([
92
+ vcs.configValue('user.name'),
93
+ vcs.configValue('user.email'),
94
+ ]);
95
+ await fs.writeFile(path.join(runDir, 'approver'), `${userName ?? ''} <${userEmail ?? ''}>\n`, 'utf8');
96
+ }
97
+ /**
98
+ * Approve a change onto its own branch and linked worktree, writing nothing to
99
+ * the checkout: lint and digest read it, the branch and worktree receive the
100
+ * sealed copy, and the worktree's first commit holds it.
101
+ */
102
+ export async function approveIntoWorktree(projectRoot, input) {
103
+ const { specId, folderName, folderPath, specsDir, config, options, vcs, warnings } = input;
104
+ const vcsConfig = config.vcs;
105
+ if (vcsConfig === undefined || vcsConfig.author === undefined) {
106
+ throw new Error('vcs.author is required when vcs.enabled is true');
107
+ }
108
+ const branch = worktreeBranch(folderName);
109
+ const head = await resolveBase(vcs, options.baseOk);
110
+ await refuseDirtyScope(folderPath, vcs, options.ignoreDirty);
111
+ await refuseExistingBranch(vcs, branch);
112
+ await refuseUnlandedDependencies(projectRoot, config, folderPath);
113
+ const hash = await hashChangeFolder(folderPath);
114
+ const { digest, mode } = await confirmApproval(projectRoot, folderPath, config, options);
115
+ const observations = await findPlanningSessions(folderPath, {
116
+ createdAt: await resolveChangeCreationTime(folderPath),
117
+ observedAt: toIso(options.now) ?? new Date().toISOString(),
118
+ changesDir: specsDir,
119
+ planning: config.planning ?? DEFAULT_CONFIG.planning,
120
+ readers: options.planningReaders ?? [],
121
+ });
122
+ const repoRoot = (await vcs.root()) ?? projectRoot;
123
+ const wtPath = worktreePath(vcsConfig, repoRoot, folderName);
124
+ await fs.mkdir(path.dirname(wtPath), { recursive: true });
125
+ await vcs.createBranch(branch, head.sha ?? 'HEAD');
126
+ await vcs.worktreeAdd(wtPath, branch);
127
+ await runPrepare(wtPath, config, branch);
128
+ const relativeFolder = path.relative(projectRoot, folderPath).split(path.sep).join('/');
129
+ const worktreeFolder = path.join(wtPath, relativeFolder);
130
+ await fs.rm(worktreeFolder, { recursive: true, force: true });
131
+ await fs.cp(folderPath, worktreeFolder, { recursive: true });
132
+ await appendObservedSessions(worktreeFolder, observations, {
133
+ briefHash: await readBriefHash(folderPath),
134
+ osqVersion: await resolveOsqPackageVersion(),
135
+ });
136
+ await writeApprovalSeal(wtPath, worktreeFolder, config, digest, mode, hash);
137
+ await writeProvenance(vcs, worktreeFolder, head.sha);
138
+ const worktreeVcs = await selectVcs(wtPath, config);
139
+ await worktreeVcs.commit([relativeFolder], `osq: ${specId} approved`, vcsConfig.author);
140
+ return {
141
+ specId,
142
+ folderName,
143
+ folderPath,
144
+ hash,
145
+ warnings: [...warnings],
146
+ planningMatches: observations.length,
147
+ missingPrices: await findUnpricedPlanningModels([worktreeFolder], config.planning?.prices),
148
+ digest,
149
+ worktreePath: wtPath,
150
+ branch,
151
+ };
152
+ }
153
+ //# sourceMappingURL=approve-worktree.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"approve-worktree.js","sourceRoot":"","sources":["../../../src/core/spec/approve-worktree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAkB,MAAM,yBAAyB,CAAC;AACzE,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EACL,eAAe,EACf,aAAa,EACb,KAAK,EACL,iBAAiB,GAClB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAcjE,6EAA6E;AAC7E,KAAK,UAAU,WAAW,CAAC,GAAQ,EAAE,MAA2B;IAC9D,MAAM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AAc,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IACzD,MAAM,EAAE,CAAC,EAAE,CAAC,cAAc,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAC9D,MAAM,EAAE,CAAC,EAAE,CAAC,UAAU,EAAE,cAAc,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAE7D,MAAM,sBAAsB,CAAC,cAAc,EAAE,YAAY,EAAE;QACzD,SAAS,EAAE,MAAM,aAAa,CAAC,UAAU,CAAC;QAC1C,UAAU,EAAE,MAAM,wBAAwB,EAAE;KAC7C,CAAC,CAAC;IACH,MAAM,iBAAiB,CAAC,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAC5E,MAAM,eAAe,CAAC,GAAG,EAAE,cAAc,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;IAErD,MAAM,WAAW,GAAG,MAAM,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpD,MAAM,WAAW,CAAC,MAAM,CAAC,CAAC,cAAc,CAAC,EAAE,QAAQ,MAAM,WAAW,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IAExF,OAAO;QACL,MAAM;QACN,UAAU;QACV,UAAU;QACV,IAAI;QACJ,QAAQ,EAAE,CAAC,GAAG,QAAQ,CAAC;QACvB,eAAe,EAAE,YAAY,CAAC,MAAM;QACpC,aAAa,EAAE,MAAM,0BAA0B,CAAC,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC;QAC1F,MAAM;QACN,YAAY,EAAE,MAAM;QACpB,MAAM;KACP,CAAC;AACJ,CAAC"}
@@ -1,6 +1,9 @@
1
1
  import { type OsqConfig } from '../foundation/config.js';
2
2
  import { type PlanningSessionReader } from '../report/planning-observed.js';
3
- import { type ApprovalDigest, type ApprovalFlag } from './digest.js';
3
+ import { type ApprovalReviewOptions } from './approve-worktree-shared.js';
4
+ import type { ApprovalDigest } from './digest.js';
5
+ export type { ApprovalReview, ApprovalReviewOptions, } from './approve-worktree-shared.js';
6
+ export { ApprovalDeclinedError } from './approve-worktree-shared.js';
4
7
  export declare function findSpecFolder(specsDir: string, idOrPrefix: string): Promise<string>;
5
8
  export interface ApproveResult {
6
9
  specId: string;
@@ -10,22 +13,29 @@ export interface ApproveResult {
10
13
  warnings: string[];
11
14
  /** Number of local planning sessions matched at approval time. */
12
15
  planningMatches: number;
16
+ /** Recorded-token planning models the change's folder leaves unpriced. */
17
+ missingPrices: string[];
13
18
  /** The digest built for this approval, flags included. */
14
19
  digest: ApprovalDigest;
20
+ /** For a worktree approval, the linked worktree's absolute path. */
21
+ worktreePath?: string;
22
+ /** For a worktree approval, the branch the commit landed on. */
23
+ branch?: string;
15
24
  }
16
- /** How an optional approver review resolved before the seal was written. */
17
- export type ApprovalReview = 'proceed' | 'confirmed' | 'declined';
18
- /** Thrown when an approver declined a flagged approval; nothing is written. */
19
- export declare class ApprovalDeclinedError extends Error {
20
- constructor(flags: readonly ApprovalFlag[]);
21
- }
22
- export interface ApproveOptions {
25
+ export interface ApproveOptions extends ApprovalReviewOptions {
23
26
  /** Independent local session readers supplied by the CLI. */
24
27
  planningReaders?: readonly PlanningSessionReader[];
25
28
  /** Single observation end; defaults to the current time. */
26
29
  now?: Date | string;
27
- /** Optional port between the CLI and core for digest review and confirmation. */
28
- review?: (digest: ApprovalDigest) => Promise<ApprovalReview>;
30
+ /** Approve from a branch other than the default branch. */
31
+ baseOk?: boolean;
32
+ /** Approve despite uncommitted changes covered by a task's scope. */
33
+ ignoreDirty?: boolean;
29
34
  }
35
+ /**
36
+ * Approve one change. Lint always runs in the checkout. With `vcs.enabled` and
37
+ * git selected, the seal and commit go to a linked worktree and the checkout
38
+ * is left untouched; otherwise approval writes in place as before.
39
+ */
30
40
  export declare function approveSpec(projectRoot: string, specIdOrPrefix: string, config: OsqConfig, options?: ApproveOptions): Promise<ApproveResult>;
31
41
  //# sourceMappingURL=approve.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"approve.d.ts","sourceRoot":"","sources":["../../../src/core/spec/approve.ts"],"names":[],"mappings":"AAEA,OAAO,EAAkB,KAAK,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EACL,KAAK,qBAAqB,EAI3B,MAAM,gCAAgC,CAAC;AAIxC,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,YAAY,EAGlB,MAAM,aAAa,CAAC;AAIrB,wBAAsB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA4B1F;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,kEAAkE;IAClE,eAAe,EAAE,MAAM,CAAC;IACxB,0DAA0D;IAC1D,MAAM,EAAE,cAAc,CAAC;CACxB;AAED,4EAA4E;AAC5E,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,CAAC;AAElE,+EAA+E;AAC/E,qBAAa,qBAAsB,SAAQ,KAAK;gBAClC,KAAK,EAAE,SAAS,YAAY,EAAE;CAI3C;AAED,MAAM,WAAW,cAAc;IAC7B,6DAA6D;IAC7D,eAAe,CAAC,EAAE,SAAS,qBAAqB,EAAE,CAAC;IACnD,4DAA4D;IAC5D,GAAG,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IACpB,iFAAiF;IACjF,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC;CAC9D;AAiBD,wBAAsB,WAAW,CAC/B,WAAW,EAAE,MAAM,EACn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