ddd-ts-kit 0.26.0 → 0.82.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (491) hide show
  1. package/CHANGELOG.md +225 -0
  2. package/README.fr.md +62 -15
  3. package/README.md +56 -14
  4. package/dist/acceptance/acceptance-file-of.d.ts +5 -0
  5. package/dist/acceptance/acceptance-file-of.d.ts.map +1 -0
  6. package/dist/acceptance/acceptance-file-of.js +7 -0
  7. package/dist/acceptance/acceptance-file-of.js.map +1 -0
  8. package/dist/acceptance/acceptance-gate.d.ts +8 -0
  9. package/dist/acceptance/acceptance-gate.d.ts.map +1 -0
  10. package/dist/acceptance/acceptance-gate.js +2 -0
  11. package/dist/acceptance/acceptance-gate.js.map +1 -0
  12. package/dist/acceptance/acceptance-lock.d.ts +32 -0
  13. package/dist/acceptance/acceptance-lock.d.ts.map +1 -0
  14. package/dist/acceptance/acceptance-lock.js +2 -0
  15. package/dist/acceptance/acceptance-lock.js.map +1 -0
  16. package/dist/acceptance/acceptance-problem.d.ts +15 -0
  17. package/dist/acceptance/acceptance-problem.d.ts.map +1 -0
  18. package/dist/acceptance/acceptance-problem.js +2 -0
  19. package/dist/acceptance/acceptance-problem.js.map +1 -0
  20. package/dist/acceptance/commentless.d.ts +4 -0
  21. package/dist/acceptance/commentless.d.ts.map +1 -0
  22. package/dist/acceptance/commentless.js +31 -0
  23. package/dist/acceptance/commentless.js.map +1 -0
  24. package/dist/acceptance/counts-for.d.ts +5 -0
  25. package/dist/acceptance/counts-for.d.ts.map +1 -0
  26. package/dist/acceptance/counts-for.js +8 -0
  27. package/dist/acceptance/counts-for.js.map +1 -0
  28. package/dist/acceptance/criteria-in.d.ts +14 -0
  29. package/dist/acceptance/criteria-in.d.ts.map +1 -0
  30. package/dist/acceptance/criteria-in.js +34 -0
  31. package/dist/acceptance/criteria-in.js.map +1 -0
  32. package/dist/acceptance/drift.d.ts +30 -0
  33. package/dist/acceptance/drift.d.ts.map +1 -0
  34. package/dist/acceptance/drift.js +44 -0
  35. package/dist/acceptance/drift.js.map +1 -0
  36. package/dist/acceptance/format-acceptance.d.ts +5 -0
  37. package/dist/acceptance/format-acceptance.d.ts.map +1 -0
  38. package/dist/acceptance/format-acceptance.js +40 -0
  39. package/dist/acceptance/format-acceptance.js.map +1 -0
  40. package/dist/acceptance/lock-acceptance.d.ts +24 -0
  41. package/dist/acceptance/lock-acceptance.d.ts.map +1 -0
  42. package/dist/acceptance/lock-acceptance.js +58 -0
  43. package/dist/acceptance/lock-acceptance.js.map +1 -0
  44. package/dist/acceptance/lock-file-of.d.ts +3 -0
  45. package/dist/acceptance/lock-file-of.d.ts.map +1 -0
  46. package/dist/acceptance/lock-file-of.js +6 -0
  47. package/dist/acceptance/lock-file-of.js.map +1 -0
  48. package/dist/acceptance/lock-problems.d.ts +21 -0
  49. package/dist/acceptance/lock-problems.d.ts.map +1 -0
  50. package/dist/acceptance/lock-problems.js +58 -0
  51. package/dist/acceptance/lock-problems.js.map +1 -0
  52. package/dist/acceptance/read-acceptance.d.ts +9 -0
  53. package/dist/acceptance/read-acceptance.d.ts.map +1 -0
  54. package/dist/acceptance/read-acceptance.js +76 -0
  55. package/dist/acceptance/read-acceptance.js.map +1 -0
  56. package/dist/acceptance/read-lock.d.ts +5 -0
  57. package/dist/acceptance/read-lock.d.ts.map +1 -0
  58. package/dist/acceptance/read-lock.js +45 -0
  59. package/dist/acceptance/read-lock.js.map +1 -0
  60. package/dist/acceptance/read-verdicts.d.ts +9 -0
  61. package/dist/acceptance/read-verdicts.d.ts.map +1 -0
  62. package/dist/acceptance/read-verdicts.js +35 -0
  63. package/dist/acceptance/read-verdicts.js.map +1 -0
  64. package/dist/acceptance/scenario-problems.d.ts +12 -0
  65. package/dist/acceptance/scenario-problems.d.ts.map +1 -0
  66. package/dist/acceptance/scenario-problems.js +74 -0
  67. package/dist/acceptance/scenario-problems.js.map +1 -0
  68. package/dist/acceptance/scenario.d.ts +23 -0
  69. package/dist/acceptance/scenario.d.ts.map +1 -0
  70. package/dist/acceptance/scenario.js +2 -0
  71. package/dist/acceptance/scenario.js.map +1 -0
  72. package/dist/acceptance/scenarios-in.d.ts +4 -0
  73. package/dist/acceptance/scenarios-in.d.ts.map +1 -0
  74. package/dist/acceptance/scenarios-in.js +68 -0
  75. package/dist/acceptance/scenarios-in.js.map +1 -0
  76. package/dist/acceptance/story-acceptance.d.ts +29 -0
  77. package/dist/acceptance/story-acceptance.d.ts.map +1 -0
  78. package/dist/acceptance/story-acceptance.js +2 -0
  79. package/dist/acceptance/story-acceptance.js.map +1 -0
  80. package/dist/acceptance/story-file-of.d.ts +4 -0
  81. package/dist/acceptance/story-file-of.d.ts.map +1 -0
  82. package/dist/acceptance/story-file-of.js +8 -0
  83. package/dist/acceptance/story-file-of.js.map +1 -0
  84. package/dist/acceptance/story-of-file.d.ts +3 -0
  85. package/dist/acceptance/story-of-file.d.ts.map +1 -0
  86. package/dist/acceptance/story-of-file.js +6 -0
  87. package/dist/acceptance/story-of-file.js.map +1 -0
  88. package/dist/acceptance/story-of-row.d.ts +3 -0
  89. package/dist/acceptance/story-of-row.d.ts.map +1 -0
  90. package/dist/acceptance/story-of-row.js +6 -0
  91. package/dist/acceptance/story-of-row.js.map +1 -0
  92. package/dist/acceptance/story-problems.d.ts +16 -0
  93. package/dist/acceptance/story-problems.d.ts.map +1 -0
  94. package/dist/acceptance/story-problems.js +48 -0
  95. package/dist/acceptance/story-problems.js.map +1 -0
  96. package/dist/acceptance/verdict-on.d.ts +8 -0
  97. package/dist/acceptance/verdict-on.d.ts.map +1 -0
  98. package/dist/acceptance/verdict-on.js +9 -0
  99. package/dist/acceptance/verdict-on.js.map +1 -0
  100. package/dist/acceptance/verdict.d.ts +14 -0
  101. package/dist/acceptance/verdict.d.ts.map +1 -0
  102. package/dist/acceptance/verdict.js +2 -0
  103. package/dist/acceptance/verdict.js.map +1 -0
  104. package/dist/acceptance/verdicts-dir.d.ts +3 -0
  105. package/dist/acceptance/verdicts-dir.d.ts.map +1 -0
  106. package/dist/acceptance/verdicts-dir.js +3 -0
  107. package/dist/acceptance/verdicts-dir.js.map +1 -0
  108. package/dist/check/catalogue/architecture-rules.d.ts.map +1 -1
  109. package/dist/check/catalogue/architecture-rules.js +6 -0
  110. package/dist/check/catalogue/architecture-rules.js.map +1 -1
  111. package/dist/check/catalogue/default-severities.d.ts.map +1 -1
  112. package/dist/check/catalogue/default-severities.js +3 -0
  113. package/dist/check/catalogue/default-severities.js.map +1 -1
  114. package/dist/check/commands/check-command.d.ts.map +1 -1
  115. package/dist/check/commands/check-command.js +4 -1
  116. package/dist/check/commands/check-command.js.map +1 -1
  117. package/dist/check/commands/explain-command.d.ts.map +1 -1
  118. package/dist/check/commands/explain-command.js +2 -9
  119. package/dist/check/commands/explain-command.js.map +1 -1
  120. package/dist/check/configuration/config-inspection.d.ts +1 -0
  121. package/dist/check/configuration/config-inspection.d.ts.map +1 -1
  122. package/dist/check/configuration/config-inspection.js +9 -1
  123. package/dist/check/configuration/config-inspection.js.map +1 -1
  124. package/dist/check/engine/format-check.d.ts +6 -1
  125. package/dist/check/engine/format-check.d.ts.map +1 -1
  126. package/dist/check/engine/format-check.js +33 -11
  127. package/dist/check/engine/format-check.js.map +1 -1
  128. package/dist/check/explain/documented-rule.d.ts +8 -0
  129. package/dist/check/explain/documented-rule.d.ts.map +1 -0
  130. package/dist/check/explain/documented-rule.js +14 -0
  131. package/dist/check/explain/documented-rule.js.map +1 -0
  132. package/dist/check/explain/explanations-of.d.ts +5 -0
  133. package/dist/check/explain/explanations-of.d.ts.map +1 -0
  134. package/dist/check/explain/explanations-of.js +16 -0
  135. package/dist/check/explain/explanations-of.js.map +1 -0
  136. package/dist/check/explain/persistence-docs.d.ts.map +1 -1
  137. package/dist/check/explain/persistence-docs.js +7 -0
  138. package/dist/check/explain/persistence-docs.js.map +1 -1
  139. package/dist/check/explain/tree-docs.d.ts.map +1 -1
  140. package/dist/check/explain/tree-docs.js +9 -0
  141. package/dist/check/explain/tree-docs.js.map +1 -1
  142. package/dist/check/explain/wiring-docs.d.ts.map +1 -1
  143. package/dist/check/explain/wiring-docs.js +13 -0
  144. package/dist/check/explain/wiring-docs.js.map +1 -1
  145. package/dist/check/fixtures/declarations-fixtures.d.ts.map +1 -1
  146. package/dist/check/fixtures/declarations-fixtures.js +78 -1
  147. package/dist/check/fixtures/declarations-fixtures.js.map +1 -1
  148. package/dist/check/fixtures/persistence-fixtures.d.ts.map +1 -1
  149. package/dist/check/fixtures/persistence-fixtures.js +25 -0
  150. package/dist/check/fixtures/persistence-fixtures.js.map +1 -1
  151. package/dist/check/fixtures/test-fixtures.d.ts.map +1 -1
  152. package/dist/check/fixtures/test-fixtures.js +35 -0
  153. package/dist/check/fixtures/test-fixtures.js.map +1 -1
  154. package/dist/check/model/rule-explanation.d.ts +10 -0
  155. package/dist/check/model/rule-explanation.d.ts.map +1 -0
  156. package/dist/check/model/rule-explanation.js +2 -0
  157. package/dist/check/model/rule-explanation.js.map +1 -0
  158. package/dist/check/project/walk-directory.js +1 -1
  159. package/dist/check/project/walk-directory.js.map +1 -1
  160. package/dist/check/rules/config-valid.d.ts.map +1 -1
  161. package/dist/check/rules/config-valid.js +1 -0
  162. package/dist/check/rules/config-valid.js.map +1 -1
  163. package/dist/check/rules/declarations-port-adapter-wired.d.ts +3 -0
  164. package/dist/check/rules/declarations-port-adapter-wired.d.ts.map +1 -0
  165. package/dist/check/rules/declarations-port-adapter-wired.js +104 -0
  166. package/dist/check/rules/declarations-port-adapter-wired.js.map +1 -0
  167. package/dist/check/rules/persistence-primary-key-order.d.ts +3 -0
  168. package/dist/check/rules/persistence-primary-key-order.d.ts.map +1 -0
  169. package/dist/check/rules/persistence-primary-key-order.js +31 -0
  170. package/dist/check/rules/persistence-primary-key-order.js.map +1 -0
  171. package/dist/check/rules/test-acceptance-black-box.d.ts +3 -0
  172. package/dist/check/rules/test-acceptance-black-box.d.ts.map +1 -0
  173. package/dist/check/rules/test-acceptance-black-box.js +38 -0
  174. package/dist/check/rules/test-acceptance-black-box.js.map +1 -0
  175. package/dist/commands/acceptance.d.ts +11 -0
  176. package/dist/commands/acceptance.d.ts.map +1 -0
  177. package/dist/commands/acceptance.js +63 -0
  178. package/dist/commands/acceptance.js.map +1 -0
  179. package/dist/commands/doctor.d.ts +4 -1
  180. package/dist/commands/doctor.d.ts.map +1 -1
  181. package/dist/commands/doctor.js +20 -4
  182. package/dist/commands/doctor.js.map +1 -1
  183. package/dist/commands/lint.d.ts +7 -0
  184. package/dist/commands/lint.d.ts.map +1 -0
  185. package/dist/commands/lint.js +55 -0
  186. package/dist/commands/lint.js.map +1 -0
  187. package/dist/commands/plan-waves.d.ts.map +1 -1
  188. package/dist/commands/plan-waves.js +1 -2
  189. package/dist/commands/plan-waves.js.map +1 -1
  190. package/dist/commands/stories.d.ts +9 -0
  191. package/dist/commands/stories.d.ts.map +1 -0
  192. package/dist/commands/stories.js +16 -0
  193. package/dist/commands/stories.js.map +1 -0
  194. package/dist/commands/story-scope.d.ts +4 -0
  195. package/dist/commands/story-scope.d.ts.map +1 -0
  196. package/dist/commands/story-scope.js +34 -0
  197. package/dist/commands/story-scope.js.map +1 -0
  198. package/dist/commands/story.d.ts +9 -0
  199. package/dist/commands/story.d.ts.map +1 -0
  200. package/dist/commands/story.js +45 -0
  201. package/dist/commands/story.js.map +1 -0
  202. package/dist/commands/worker-scope.d.ts.map +1 -1
  203. package/dist/commands/worker-scope.js +2 -0
  204. package/dist/commands/worker-scope.js.map +1 -1
  205. package/dist/commands/worktree.d.ts +7 -0
  206. package/dist/commands/worktree.d.ts.map +1 -0
  207. package/dist/commands/worktree.js +34 -0
  208. package/dist/commands/worktree.js.map +1 -0
  209. package/dist/config/config.d.ts +9 -0
  210. package/dist/config/config.d.ts.map +1 -1
  211. package/dist/config/index.d.ts +1 -0
  212. package/dist/config/index.d.ts.map +1 -1
  213. package/dist/config/index.js +1 -0
  214. package/dist/config/index.js.map +1 -1
  215. package/dist/config/parse-config.d.ts.map +1 -1
  216. package/dist/config/parse-config.js +3 -0
  217. package/dist/config/parse-config.js.map +1 -1
  218. package/dist/config/restack-config-text.d.ts +3 -2
  219. package/dist/config/restack-config-text.d.ts.map +1 -1
  220. package/dist/config/restack-config-text.js +5 -3
  221. package/dist/config/restack-config-text.js.map +1 -1
  222. package/dist/config/serialize-config.d.ts.map +1 -1
  223. package/dist/config/serialize-config.js +3 -1
  224. package/dist/config/serialize-config.js.map +1 -1
  225. package/dist/config/worktree-modes.d.ts +3 -0
  226. package/dist/config/worktree-modes.d.ts.map +1 -0
  227. package/dist/config/worktree-modes.js +3 -0
  228. package/dist/config/worktree-modes.js.map +1 -0
  229. package/dist/doctor/diagnose.d.ts +2 -0
  230. package/dist/doctor/diagnose.d.ts.map +1 -1
  231. package/dist/doctor/diagnose.js +22 -3
  232. package/dist/doctor/diagnose.js.map +1 -1
  233. package/dist/doctor/doctor-finding.d.ts +13 -5
  234. package/dist/doctor/doctor-finding.d.ts.map +1 -1
  235. package/dist/doctor/format-diagnosis.d.ts +4 -1
  236. package/dist/doctor/format-diagnosis.d.ts.map +1 -1
  237. package/dist/doctor/format-diagnosis.js +49 -3
  238. package/dist/doctor/format-diagnosis.js.map +1 -1
  239. package/dist/doctor/in-range.d.ts +7 -0
  240. package/dist/doctor/in-range.d.ts.map +1 -0
  241. package/dist/doctor/in-range.js +90 -0
  242. package/dist/doctor/in-range.js.map +1 -0
  243. package/dist/doctor/install-findings.d.ts +11 -0
  244. package/dist/doctor/install-findings.d.ts.map +1 -0
  245. package/dist/doctor/install-findings.js +119 -0
  246. package/dist/doctor/install-findings.js.map +1 -0
  247. package/dist/doctor/node-findings.d.ts +7 -0
  248. package/dist/doctor/node-findings.d.ts.map +1 -0
  249. package/dist/doctor/node-findings.js +19 -0
  250. package/dist/doctor/node-findings.js.map +1 -0
  251. package/dist/doctor/package-findings.d.ts +2 -0
  252. package/dist/doctor/package-findings.d.ts.map +1 -1
  253. package/dist/doctor/package-findings.js +1 -1
  254. package/dist/doctor/package-findings.js.map +1 -1
  255. package/dist/doctor/submodule-findings.d.ts +7 -0
  256. package/dist/doctor/submodule-findings.d.ts.map +1 -0
  257. package/dist/doctor/submodule-findings.js +22 -0
  258. package/dist/doctor/submodule-findings.js.map +1 -0
  259. package/dist/generate/kinds/acceptance-kind.d.ts +3 -0
  260. package/dist/generate/kinds/acceptance-kind.d.ts.map +1 -0
  261. package/dist/generate/kinds/acceptance-kind.js +69 -0
  262. package/dist/generate/kinds/acceptance-kind.js.map +1 -0
  263. package/dist/generate/kinds.d.ts.map +1 -1
  264. package/dist/generate/kinds.js +2 -0
  265. package/dist/generate/kinds.js.map +1 -1
  266. package/dist/generate/schedule/cron-problem.d.ts.map +1 -1
  267. package/dist/generate/schedule/cron-problem.js +16 -1
  268. package/dist/generate/schedule/cron-problem.js.map +1 -1
  269. package/dist/generate/shared-writes.d.ts.map +1 -1
  270. package/dist/generate/shared-writes.js +3 -0
  271. package/dist/generate/shared-writes.js.map +1 -1
  272. package/dist/help/notes.d.ts +1 -1
  273. package/dist/help/notes.d.ts.map +1 -1
  274. package/dist/help/notes.js +71 -10
  275. package/dist/help/notes.js.map +1 -1
  276. package/dist/help/usage.d.ts +1 -1
  277. package/dist/help/usage.d.ts.map +1 -1
  278. package/dist/help/usage.js +8 -1
  279. package/dist/help/usage.js.map +1 -1
  280. package/dist/init/agent-permissions.d.ts.map +1 -1
  281. package/dist/init/agent-permissions.js +9 -1
  282. package/dist/init/agent-permissions.js.map +1 -1
  283. package/dist/init/ignore-worktrees.d.ts +7 -0
  284. package/dist/init/ignore-worktrees.d.ts.map +1 -0
  285. package/dist/init/ignore-worktrees.js +15 -0
  286. package/dist/init/ignore-worktrees.js.map +1 -0
  287. package/dist/init/manifest/versions.js +24 -24
  288. package/dist/init/run-init.d.ts.map +1 -1
  289. package/dist/init/run-init.js +12 -4
  290. package/dist/init/run-init.js.map +1 -1
  291. package/dist/lint/eslint-in-project.d.ts +8 -0
  292. package/dist/lint/eslint-in-project.d.ts.map +1 -0
  293. package/dist/lint/eslint-in-project.js +33 -0
  294. package/dist/lint/eslint-in-project.js.map +1 -0
  295. package/dist/lint/format-verdict.d.ts +4 -0
  296. package/dist/lint/format-verdict.d.ts.map +1 -0
  297. package/dist/lint/format-verdict.js +11 -0
  298. package/dist/lint/format-verdict.js.map +1 -0
  299. package/dist/lint/lint-run.d.ts +8 -0
  300. package/dist/lint/lint-run.d.ts.map +1 -0
  301. package/dist/lint/lint-run.js +2 -0
  302. package/dist/lint/lint-run.js.map +1 -0
  303. package/dist/lint/lint-verdict.d.ts +19 -0
  304. package/dist/lint/lint-verdict.d.ts.map +1 -0
  305. package/dist/lint/lint-verdict.js +25 -0
  306. package/dist/lint/lint-verdict.js.map +1 -0
  307. package/dist/lint/parse-lint-answer.d.ts +13 -0
  308. package/dist/lint/parse-lint-answer.d.ts.map +1 -0
  309. package/dist/lint/parse-lint-answer.js +18 -0
  310. package/dist/lint/parse-lint-answer.js.map +1 -0
  311. package/dist/migration/plan-replay.d.ts +4 -3
  312. package/dist/migration/plan-replay.d.ts.map +1 -1
  313. package/dist/migration/plan-replay.js +21 -6
  314. package/dist/migration/plan-replay.js.map +1 -1
  315. package/dist/migration/rename-branch-migrations.d.ts +13 -0
  316. package/dist/migration/rename-branch-migrations.d.ts.map +1 -0
  317. package/dist/migration/rename-branch-migrations.js +25 -0
  318. package/dist/migration/rename-branch-migrations.js.map +1 -0
  319. package/dist/migration/replay-drizzle-migrations.d.ts +6 -3
  320. package/dist/migration/replay-drizzle-migrations.d.ts.map +1 -1
  321. package/dist/migration/replay-drizzle-migrations.js +48 -4
  322. package/dist/migration/replay-drizzle-migrations.js.map +1 -1
  323. package/dist/migration/replay-plan.d.ts +8 -0
  324. package/dist/migration/replay-plan.d.ts.map +1 -1
  325. package/dist/migration/restore-migration-folder.d.ts +4 -0
  326. package/dist/migration/restore-migration-folder.d.ts.map +1 -0
  327. package/dist/migration/restore-migration-folder.js +15 -0
  328. package/dist/migration/restore-migration-folder.js.map +1 -0
  329. package/dist/package-manager/lockfiles.d.ts +2 -0
  330. package/dist/package-manager/lockfiles.d.ts.map +1 -1
  331. package/dist/package-manager/lockfiles.js +5 -0
  332. package/dist/package-manager/lockfiles.js.map +1 -1
  333. package/dist/plan/batched-waves.d.ts +0 -2
  334. package/dist/plan/batched-waves.d.ts.map +1 -1
  335. package/dist/plan/batched-waves.js +4 -4
  336. package/dist/plan/batched-waves.js.map +1 -1
  337. package/dist/plan/plan-waves.d.ts +0 -2
  338. package/dist/plan/plan-waves.d.ts.map +1 -1
  339. package/dist/plan/plan-waves.js +2 -2
  340. package/dist/plan/plan-waves.js.map +1 -1
  341. package/dist/run.d.ts.map +1 -1
  342. package/dist/run.js +12 -0
  343. package/dist/run.js.map +1 -1
  344. package/dist/slice/plan-staging.d.ts +1 -1
  345. package/dist/slice/plan-staging.d.ts.map +1 -1
  346. package/dist/slice/plan-staging.js +5 -2
  347. package/dist/slice/plan-staging.js.map +1 -1
  348. package/dist/stories/forecast-merge.d.ts +14 -0
  349. package/dist/stories/forecast-merge.d.ts.map +1 -0
  350. package/dist/stories/forecast-merge.js +44 -0
  351. package/dist/stories/forecast-merge.js.map +1 -0
  352. package/dist/stories/format-stories.d.ts +4 -0
  353. package/dist/stories/format-stories.d.ts.map +1 -0
  354. package/dist/stories/format-stories.js +66 -0
  355. package/dist/stories/format-stories.js.map +1 -0
  356. package/dist/stories/format-story-phases.d.ts +5 -0
  357. package/dist/stories/format-story-phases.d.ts.map +1 -0
  358. package/dist/stories/format-story-phases.js +14 -0
  359. package/dist/stories/format-story-phases.js.map +1 -0
  360. package/dist/stories/merge-forecast.d.ts +18 -0
  361. package/dist/stories/merge-forecast.d.ts.map +1 -0
  362. package/dist/stories/merge-forecast.js +2 -0
  363. package/dist/stories/merge-forecast.js.map +1 -0
  364. package/dist/stories/open-stories.d.ts +8 -0
  365. package/dist/stories/open-stories.d.ts.map +1 -0
  366. package/dist/stories/open-stories.js +31 -0
  367. package/dist/stories/open-stories.js.map +1 -0
  368. package/dist/stories/open-story-scope.d.ts +23 -0
  369. package/dist/stories/open-story-scope.d.ts.map +1 -0
  370. package/dist/stories/open-story-scope.js +86 -0
  371. package/dist/stories/open-story-scope.js.map +1 -0
  372. package/dist/stories/open-story.d.ts +11 -0
  373. package/dist/stories/open-story.d.ts.map +1 -0
  374. package/dist/stories/open-story.js +2 -0
  375. package/dist/stories/open-story.js.map +1 -0
  376. package/dist/stories/read-stories.d.ts +9 -0
  377. package/dist/stories/read-stories.d.ts.map +1 -0
  378. package/dist/stories/read-stories.js +60 -0
  379. package/dist/stories/read-stories.js.map +1 -0
  380. package/dist/stories/read-story-phases.d.ts +10 -0
  381. package/dist/stories/read-story-phases.d.ts.map +1 -0
  382. package/dist/stories/read-story-phases.js +144 -0
  383. package/dist/stories/read-story-phases.js.map +1 -0
  384. package/dist/stories/read-story-place.d.ts +4 -0
  385. package/dist/stories/read-story-place.d.ts.map +1 -0
  386. package/dist/stories/read-story-place.js +23 -0
  387. package/dist/stories/read-story-place.js.map +1 -0
  388. package/dist/stories/review-file-of.d.ts +4 -0
  389. package/dist/stories/review-file-of.d.ts.map +1 -0
  390. package/dist/stories/review-file-of.js +7 -0
  391. package/dist/stories/review-file-of.js.map +1 -0
  392. package/dist/stories/section-of.d.ts +3 -0
  393. package/dist/stories/section-of.d.ts.map +1 -0
  394. package/dist/stories/section-of.js +11 -0
  395. package/dist/stories/section-of.js.map +1 -0
  396. package/dist/stories/stories-view.d.ts +13 -0
  397. package/dist/stories/stories-view.d.ts.map +1 -0
  398. package/dist/stories/stories-view.js +2 -0
  399. package/dist/stories/stories-view.js.map +1 -0
  400. package/dist/stories/story-crossing.d.ts +16 -0
  401. package/dist/stories/story-crossing.d.ts.map +1 -0
  402. package/dist/stories/story-crossing.js +2 -0
  403. package/dist/stories/story-crossing.js.map +1 -0
  404. package/dist/stories/story-gate.d.ts +4 -0
  405. package/dist/stories/story-gate.d.ts.map +1 -0
  406. package/dist/stories/story-gate.js +2 -0
  407. package/dist/stories/story-gate.js.map +1 -0
  408. package/dist/stories/story-phase.d.ts +13 -0
  409. package/dist/stories/story-phase.d.ts.map +1 -0
  410. package/dist/stories/story-phase.js +2 -0
  411. package/dist/stories/story-phase.js.map +1 -0
  412. package/dist/stories/story-place.d.ts +14 -0
  413. package/dist/stories/story-place.d.ts.map +1 -0
  414. package/dist/stories/story-place.js +2 -0
  415. package/dist/stories/story-place.js.map +1 -0
  416. package/dist/stories/story-scope-file.d.ts +3 -0
  417. package/dist/stories/story-scope-file.d.ts.map +1 -0
  418. package/dist/stories/story-scope-file.js +3 -0
  419. package/dist/stories/story-scope-file.js.map +1 -0
  420. package/dist/stories/story-scope.d.ts +17 -0
  421. package/dist/stories/story-scope.d.ts.map +1 -0
  422. package/dist/stories/story-scope.js +2 -0
  423. package/dist/stories/story-scope.js.map +1 -0
  424. package/dist/stories/story-state.d.ts +13 -0
  425. package/dist/stories/story-state.d.ts.map +1 -0
  426. package/dist/stories/story-state.js +2 -0
  427. package/dist/stories/story-state.js.map +1 -0
  428. package/dist/stories/trunk-phase.d.ts +8 -0
  429. package/dist/stories/trunk-phase.d.ts.map +1 -0
  430. package/dist/stories/trunk-phase.js +27 -0
  431. package/dist/stories/trunk-phase.js.map +1 -0
  432. package/dist/version.d.ts +1 -1
  433. package/dist/version.js +1 -1
  434. package/dist/worker/add-worktree.d.ts +7 -0
  435. package/dist/worker/add-worktree.d.ts.map +1 -0
  436. package/dist/worker/add-worktree.js +13 -0
  437. package/dist/worker/add-worktree.js.map +1 -0
  438. package/dist/worker/branch-exists.d.ts +3 -0
  439. package/dist/worker/branch-exists.d.ts.map +1 -0
  440. package/dist/worker/branch-exists.js +6 -0
  441. package/dist/worker/branch-exists.js.map +1 -0
  442. package/dist/worker/briefed-rows.js +1 -1
  443. package/dist/worker/briefed-rows.js.map +1 -1
  444. package/dist/worker/ensure-ignored.d.ts +7 -0
  445. package/dist/worker/ensure-ignored.d.ts.map +1 -0
  446. package/dist/worker/ensure-ignored.js +17 -0
  447. package/dist/worker/ensure-ignored.js.map +1 -0
  448. package/dist/worker/install-notes.d.ts +9 -0
  449. package/dist/worker/install-notes.d.ts.map +1 -0
  450. package/dist/worker/install-notes.js +25 -0
  451. package/dist/worker/install-notes.js.map +1 -0
  452. package/dist/worker/is-worktree.d.ts +3 -0
  453. package/dist/worker/is-worktree.d.ts.map +1 -0
  454. package/dist/worker/is-worktree.js +15 -0
  455. package/dist/worker/is-worktree.js.map +1 -0
  456. package/dist/worker/open-worker-scope.d.ts +6 -1
  457. package/dist/worker/open-worker-scope.d.ts.map +1 -1
  458. package/dist/worker/open-worker-scope.js +29 -36
  459. package/dist/worker/open-worker-scope.js.map +1 -1
  460. package/dist/worker/repository-prefix.d.ts +3 -0
  461. package/dist/worker/repository-prefix.d.ts.map +1 -0
  462. package/dist/worker/repository-prefix.js +14 -0
  463. package/dist/worker/repository-prefix.js.map +1 -0
  464. package/dist/worker/upstream-of.d.ts +8 -0
  465. package/dist/worker/upstream-of.d.ts.map +1 -0
  466. package/dist/worker/upstream-of.js +18 -0
  467. package/dist/worker/upstream-of.js.map +1 -0
  468. package/dist/worker/worktree-home.d.ts +9 -0
  469. package/dist/worker/worktree-home.d.ts.map +1 -0
  470. package/dist/worker/worktree-home.js +17 -0
  471. package/dist/worker/worktree-home.js.map +1 -0
  472. package/dist/worker/worktree-of.d.ts +13 -0
  473. package/dist/worker/worktree-of.d.ts.map +1 -0
  474. package/dist/worker/worktree-of.js +30 -0
  475. package/dist/worker/worktree-of.js.map +1 -0
  476. package/dist/worktree/open-worktree.d.ts +20 -0
  477. package/dist/worktree/open-worktree.d.ts.map +1 -0
  478. package/dist/worktree/open-worktree.js +57 -0
  479. package/dist/worktree/open-worktree.js.map +1 -0
  480. package/dist/worktree/worktree-scope.d.ts +15 -0
  481. package/dist/worktree/worktree-scope.d.ts.map +1 -0
  482. package/dist/worktree/worktree-scope.js +2 -0
  483. package/dist/worktree/worktree-scope.js.map +1 -0
  484. package/package.json +2 -2
  485. package/templates/acceptance/acceptance.spec.ts.tpl +35 -0
  486. package/templates/init/docker/dockerignore.tpl +1 -0
  487. package/templates/init/e2e/jest.e2e.config.js.tpl +1 -1
  488. package/templates/init/e2e/vitest.e2e.config.ts.tpl +1 -1
  489. package/templates/init/gitignore.tpl +1 -0
  490. package/templates/pipeline/biome.json.tpl +1 -0
  491. package/templates/pipeline/package-scripts.json +3 -3
@@ -0,0 +1,15 @@
1
+ /**
2
+ * What keeps the acceptance of a story from a gate. `always` problems are inconsistencies whatever
3
+ * the gate: a scenario that names no row, an unknown row or an unknown criterion, a scenario put
4
+ * aside, a pending one whose rows are all done, a locked one changed without its criterion. The
5
+ * others are what the gate asks for.
6
+ */
7
+ export interface AcceptanceProblem {
8
+ readonly kind: 'no-rows' | 'no-file' | 'todo' | 'uncovered' | 'uncovered-criterion' | 'no-criterion' | 'unknown-criterion' | 'unlocked' | 'drift' | 'pending' | 'skipped' | 'no-row' | 'unknown-row' | 'done-pending';
9
+ /** `file:line`, or `#<id>` for a row. */
10
+ readonly at: string;
11
+ readonly message: string;
12
+ /** The gate from which it counts; undefined when it always does. */
13
+ readonly from?: 'written' | 'passing';
14
+ }
15
+ //# sourceMappingURL=acceptance-problem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acceptance-problem.d.ts","sourceRoot":"","sources":["../../src/acceptance/acceptance-problem.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EACT,SAAS,GACT,SAAS,GACT,MAAM,GACN,WAAW,GACX,qBAAqB,GACrB,cAAc,GACd,mBAAmB,GACnB,UAAU,GACV,OAAO,GACP,SAAS,GACT,SAAS,GACT,QAAQ,GACR,aAAa,GACb,cAAc,CAAC;IACnB,yCAAyC;IACzC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,oEAAoE;IACpE,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CACvC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=acceptance-problem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acceptance-problem.js","sourceRoot":"","sources":["../../src/acceptance/acceptance-problem.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import type { Scan } from '../check/scan/scan.js';
2
+ /** The source with its comments blanked and everything else as written, strings and expressions alike: offsets are preserved. */
3
+ export declare function commentless(source: string, scanned: Scan): string;
4
+ //# sourceMappingURL=commentless.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commentless.d.ts","sourceRoot":"","sources":["../../src/acceptance/commentless.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAGlD,iIAAiI;AACjI,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,GAAG,MAAM,CAcjE"}
@@ -0,0 +1,31 @@
1
+ import { blank } from '../check/scan/blank.js';
2
+ /** The source with its comments blanked and everything else as written, strings and expressions alike: offsets are preserved. */
3
+ export function commentless(source, scanned) {
4
+ const ranges = [...lineComments(source, scanned), ...blockComments(source, scanned)].sort(([left], [right]) => left - right);
5
+ let text = '';
6
+ let at = 0;
7
+ for (const [start, end] of ranges) {
8
+ text += source.slice(at, start) + blank(source.slice(start, end));
9
+ at = end;
10
+ }
11
+ return text + source.slice(at);
12
+ }
13
+ /** A line comment runs from the first `//` of its line after which the code is blank, to the end of the line. */
14
+ function lineComments(source, { code, comments }) {
15
+ return comments.map(({ end }) => {
16
+ const lineStart = source.lastIndexOf('\n', end - 1) + 1;
17
+ let start = source.indexOf('//', lineStart);
18
+ while (start !== -1 && start < end && code.slice(start, end).trim() !== '') {
19
+ start = source.indexOf('//', start + 1);
20
+ }
21
+ return [start === -1 || start >= end ? end : start, end];
22
+ });
23
+ }
24
+ /** A block comment is its opening delimiter, its text, then its closing one unless it is left open at the end of the file. */
25
+ function blockComments(source, { blockComments: comments }) {
26
+ return comments.map(({ text, end }) => {
27
+ const closing = source.endsWith('*/', end) && end - text.length >= 4 ? 2 : 0;
28
+ return [end - closing - text.length - 2, end];
29
+ });
30
+ }
31
+ //# sourceMappingURL=commentless.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commentless.js","sourceRoot":"","sources":["../../src/acceptance/commentless.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAE/C,iIAAiI;AACjI,MAAM,UAAU,WAAW,CAAC,MAAc,EAAE,OAAa;IACvD,MAAM,MAAM,GAAG,CAAC,GAAG,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,aAAa,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,IAAI,CACvF,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,IAAI,GAAG,KAAK,CAClC,CAAC;IAEF,IAAI,IAAI,GAAG,EAAE,CAAC;IACd,IAAI,EAAE,GAAG,CAAC,CAAC;IAEX,KAAK,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,IAAI,MAAM,EAAE,CAAC;QAClC,IAAI,IAAI,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,KAAK,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC;QAClE,EAAE,GAAG,GAAG,CAAC;IACX,CAAC;IAED,OAAO,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AACjC,CAAC;AAED,iHAAiH;AACjH,SAAS,YAAY,CAAC,MAAc,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAQ;IAC5D,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE;QAC9B,MAAM,SAAS,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;QACxD,IAAI,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;QAE5C,OAAO,KAAK,KAAK,CAAC,CAAC,IAAI,KAAK,GAAG,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;YAC3E,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;QAC1C,CAAC;QAED,OAAO,CAAC,KAAK,KAAK,CAAC,CAAC,IAAI,KAAK,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAC3D,CAAC,CAAC,CAAC;AACL,CAAC;AAED,8HAA8H;AAC9H,SAAS,aAAa,CAAC,MAAc,EAAE,EAAE,aAAa,EAAE,QAAQ,EAAQ;IACtE,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE;QACpC,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,GAAG,GAAG,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAE7E,OAAO,CAAC,GAAG,GAAG,OAAO,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { AcceptanceGate } from './acceptance-gate.js';
2
+ import type { AcceptanceProblem } from './acceptance-problem.js';
3
+ /** True when the problem keeps a story from the gate; without a gate, only the inconsistencies count. */
4
+ export declare function countsFor(problem: AcceptanceProblem, gate: AcceptanceGate | undefined): boolean;
5
+ //# sourceMappingURL=counts-for.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"counts-for.d.ts","sourceRoot":"","sources":["../../src/acceptance/counts-for.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,yGAAyG;AACzG,wBAAgB,SAAS,CAAC,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAE,cAAc,GAAG,SAAS,GAAG,OAAO,CAM/F"}
@@ -0,0 +1,8 @@
1
+ /** True when the problem keeps a story from the gate; without a gate, only the inconsistencies count. */
2
+ export function countsFor(problem, gate) {
3
+ if (problem.from === undefined) {
4
+ return true;
5
+ }
6
+ return gate === 'passing' || (gate === 'written' && problem.from === 'written');
7
+ }
8
+ //# sourceMappingURL=counts-for.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"counts-for.js","sourceRoot":"","sources":["../../src/acceptance/counts-for.ts"],"names":[],"mappings":"AAGA,yGAAyG;AACzG,MAAM,UAAU,SAAS,CAAC,OAA0B,EAAE,IAAgC;IACpF,IAAI,OAAO,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAC/B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,IAAI,KAAK,SAAS,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,OAAO,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC;AAClF,CAAC"}
@@ -0,0 +1,14 @@
1
+ /** One acceptance criterion of a story, as its specification states it. */
2
+ export interface Criterion {
3
+ readonly id: string;
4
+ readonly text: string;
5
+ readonly line: number;
6
+ /** The digest of its text, white space aside: a scenario may change when this changes. */
7
+ readonly fingerprint: string;
8
+ }
9
+ /**
10
+ * The criteria under the `## Acceptance criteria` heading of a story's specification, one list item
11
+ * each, `- AC1: <what a client observes>`, an indented line continuing the item above it.
12
+ */
13
+ export declare function criteriaIn(text: string): Criterion[];
14
+ //# sourceMappingURL=criteria-in.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"criteria-in.d.ts","sourceRoot":"","sources":["../../src/acceptance/criteria-in.ts"],"names":[],"mappings":"AAEA,2EAA2E;AAC3E,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,0FAA0F;IAC1F,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAKD;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,CAapD"}
@@ -0,0 +1,34 @@
1
+ import { createHash } from 'node:crypto';
2
+ const SECTION = /^##\s+acceptance criteria\s*$/i;
3
+ const ITEM = /^\s*[-*]\s+\**(AC\d+)\**\s*[:.)]\**\s*(.*)$/;
4
+ /**
5
+ * The criteria under the `## Acceptance criteria` heading of a story's specification, one list item
6
+ * each, `- AC1: <what a client observes>`, an indented line continuing the item above it.
7
+ */
8
+ export function criteriaIn(text) {
9
+ const lines = text.split('\n');
10
+ const heading = lines.findIndex((line) => SECTION.test(line));
11
+ if (heading === -1) {
12
+ return [];
13
+ }
14
+ const end = lines.findIndex((line, at) => at > heading && /^#{1,2}\s/.test(line));
15
+ const section = lines.slice(heading + 1, end === -1 ? undefined : end);
16
+ const found = section.reduce((stated, line, at) => withLine(stated, line, heading + at + 2), []);
17
+ return found.map((criterion) => ({ ...criterion, fingerprint: digest(criterion.text) }));
18
+ }
19
+ /** The criteria read so far and one more line of the section: a new item, or the continuation of the last one. */
20
+ function withLine(stated, line, number) {
21
+ const item = ITEM.exec(line);
22
+ const last = stated.at(-1);
23
+ if (item !== null) {
24
+ return [...stated, { id: item[1] ?? '', text: item[2] ?? '', line: number }];
25
+ }
26
+ if (last === undefined || !/^\s+\S/.test(line)) {
27
+ return [...stated];
28
+ }
29
+ return [...stated.slice(0, -1), { ...last, text: `${last.text} ${line.trim()}` }];
30
+ }
31
+ function digest(text) {
32
+ return createHash('sha256').update(text.replace(/\s+/g, ' ').trim()).digest('hex').slice(0, 16);
33
+ }
34
+ //# sourceMappingURL=criteria-in.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"criteria-in.js","sourceRoot":"","sources":["../../src/acceptance/criteria-in.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAWzC,MAAM,OAAO,GAAG,gCAAgC,CAAC;AACjD,MAAM,IAAI,GAAG,6CAA6C,CAAC;AAE3D;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC/B,MAAM,OAAO,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAE9D,IAAI,OAAO,KAAK,CAAC,CAAC,EAAE,CAAC;QACnB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,GAAG,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,GAAG,OAAO,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAClF,MAAM,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,GAAG,CAAC,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACvE,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,CAAW,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO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C,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAClG,CAAC"}
@@ -0,0 +1,30 @@
1
+ import type { AcceptanceLock } from './acceptance-lock.js';
2
+ import type { Criterion } from './criteria-in.js';
3
+ import type { Scenario } from './scenario.js';
4
+ /**
5
+ * A change since the lock that only a verdict of the acceptance-judge agent lets through: a
6
+ * criterion changed or removed, or a scenario changed or removed while every criterion it proves
7
+ * stayed as locked. `subject` is how a verdict names it.
8
+ */
9
+ export interface Judged {
10
+ /** `scenario "<title>"` or `criterion AC1`. */
11
+ readonly subject: string;
12
+ /** The fingerprint of what it is now, or `removed`: a verdict holds for that version only. */
13
+ readonly fingerprint: string;
14
+ /** The criteria it proves (a scenario) or is (a criterion). */
15
+ readonly criteria: readonly string[];
16
+ }
17
+ /** How the scenarios stand against the lock of their story. */
18
+ export interface Drift {
19
+ /** What needs a verdict of the acceptance-judge agent before the acceptance is locked again. */
20
+ readonly toJudge: readonly Judged[];
21
+ /** What only needs locking again: a new scenario or criterion, a scenario changed with its criterion. */
22
+ readonly toLock: readonly string[];
23
+ }
24
+ /**
25
+ * The scenarios and criteria of a story against its lock. A new scenario or criterion adds to the
26
+ * acceptance and only needs locking; a changed or removed criterion, and a scenario changed or
27
+ * removed while its criteria were not, need a verdict first: what makes a test easier to pass.
28
+ */
29
+ export declare function driftOf(lock: AcceptanceLock, scenarios: readonly Scenario[], criteria: readonly Criterion[]): Drift;
30
+ //# sourceMappingURL=drift.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drift.d.ts","sourceRoot":"","sources":["../../src/acceptance/drift.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAkB,MAAM,sBAAsB,CAAC;AAC3E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAK9C;;;;GAIG;AACH,MAAM,WAAW,MAAM;IACrB,+CAA+C;IAC/C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,8FAA8F;IAC9F,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,+DAA+D;IAC/D,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;CACtC;AAED,+DAA+D;AAC/D,MAAM,WAAW,KAAK;IACpB,gGAAgG;IAChG,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,yGAAyG;IACzG,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;CACpC;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,QAAQ,EAAE,EAAE,QAAQ,EAAE,SAAS,SAAS,EAAE,GAAG,KAAK,CAkCnH"}
@@ -0,0 +1,44 @@
1
+ /** What a locked scenario or criterion became: its new fingerprint, or `removed`. */
2
+ const REMOVED = 'removed';
3
+ /**
4
+ * The scenarios and criteria of a story against its lock. A new scenario or criterion adds to the
5
+ * acceptance and only needs locking; a changed or removed criterion, and a scenario changed or
6
+ * removed while its criteria were not, need a verdict first: what makes a test easier to pass.
7
+ */
8
+ export function driftOf(lock, scenarios, criteria) {
9
+ const current = new Map(criteria.map((criterion) => [criterion.id, criterion.fingerprint]));
10
+ const written = scenarios.filter(({ state }) => state === 'pending' || state === 'active');
11
+ const changed = Object.keys(lock.criteria).filter((id) => lock.criteria[id] !== current.get(id));
12
+ const added = [...current.keys()].filter((id) => lock.criteria[id] === undefined);
13
+ const toJudge = changed.map((id) => ({
14
+ subject: `criterion ${id}`,
15
+ fingerprint: current.get(id) ?? REMOVED,
16
+ criteria: [id],
17
+ }));
18
+ const toLock = added.map((id) => `criterion ${id} is new`);
19
+ for (const locked of lock.scenarios) {
20
+ const now = written.find((scenario) => scenario.title === locked.title);
21
+ if (now?.fingerprint === locked.fingerprint) {
22
+ continue;
23
+ }
24
+ if (locked.criteria.some((id) => changed.includes(id))) {
25
+ toLock.push(`"${locked.title}" ${now === undefined ? 'removed' : 'changed'} with its criterion`);
26
+ }
27
+ else {
28
+ toJudge.push(scenarioChange(locked, now));
29
+ }
30
+ }
31
+ const titles = new Set(lock.scenarios.map(({ title }) => title));
32
+ return {
33
+ toJudge,
34
+ toLock: [...toLock, ...written.filter(({ title }) => !titles.has(title)).map(({ title }) => `"${title}" is new`)],
35
+ };
36
+ }
37
+ function scenarioChange(locked, now) {
38
+ return {
39
+ subject: `scenario "${locked.title}"`,
40
+ fingerprint: now?.fingerprint ?? REMOVED,
41
+ criteria: locked.criteria,
42
+ };
43
+ }
44
+ //# sourceMappingURL=drift.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drift.js","sourceRoot":"","sources":["../../src/acceptance/drift.ts"],"names":[],"mappings":"AAIA,qFAAqF;AACrF,MAAM,OAAO,GAAG,SAAS,CAAC;AAwB1B;;;;GAIG;AACH,MAAM,UAAU,OAAO,CAAC,IAAoB,EAAE,SAA8B,EAAE,QAA8B;IAC1G,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,EAAE,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAC5F,MAAM,OAAO,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,QAAQ,CAAC,CAAC;IAC3F,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;IACjG,MAAM,KAAK,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,EAA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,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEjE,OAAO;QACL,OAAO;QACP,MAAM,EAAE,CAAC,GAAG,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC;KAClH,CAAC;AACJ,CAAC;AAED,SAAS,cAAc,CAAC,MAAsB,EAAE,GAAyB;IACvE,OAAO;QACL,OAAO,EAAE,aAAa,MAAM,CAAC,KAAK,GAAG;QACrC,WAAW,EAAE,GAAG,EAAE,WAAW,IAAI,OAAO;QACxC,QAAQ,EAAE,MAAM,CAAC,QAAQ;KAC1B,CAAC;AACJ,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { AcceptanceGate } from './acceptance-gate.js';
2
+ import type { StoryAcceptance } from './story-acceptance.js';
3
+ /** The acceptance of each story as text: its spec, each row with its scenarios, then what keeps it from the gate. */
4
+ export declare function formatAcceptance(stories: readonly StoryAcceptance[], gate: AcceptanceGate | undefined): string;
5
+ //# sourceMappingURL=format-acceptance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-acceptance.d.ts","sourceRoot":"","sources":["../../src/acceptance/format-acceptance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,KAAK,EAAiB,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE5E,qHAAqH;AACrH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,SAAS,eAAe,EAAE,EAAE,IAAI,EAAE,cAAc,GAAG,SAAS,GAAG,MAAM,CAM9G"}
@@ -0,0 +1,40 @@
1
+ import { countsFor } from './counts-for.js';
2
+ /** The acceptance of each story as text: its spec, each row with its scenarios, then what keeps it from the gate. */
3
+ export function formatAcceptance(stories, gate) {
4
+ if (stories.length === 0) {
5
+ return 'No story: docs/architecture/slices.md has no row and test/acceptance/ no spec.';
6
+ }
7
+ return stories.map((story) => formatStory(story, gate)).join('\n\n');
8
+ }
9
+ function formatStory(story, gate) {
10
+ const problems = story.problems.filter((problem) => countsFor(problem, gate));
11
+ const verdict = gate === undefined
12
+ ? []
13
+ : [problems.length === 0 ? ` gate ${gate}: met` : ` gate ${gate}: ${problems.length} left`];
14
+ return [
15
+ `${story.story} ${story.file ?? '(no acceptance spec)'}${story.lock === undefined ? '' : ', locked'}`,
16
+ ...(story.specification === undefined ? [] : [` specification ${story.specification}: ${criteriaOf(story)}`]),
17
+ ...story.rows.map((row) => ` #${row.id} ${row.kind} "${row.slice}" (${row.status}): ${scenariosOf(row)}`),
18
+ ...story.amendments.map((amendment) => ` amended on ${amendment.on}, for the owner to validate: ${amendment.subject} (${amendment.verdict}): ${amendment.reason}`),
19
+ ...problems.map((problem) => ` ${problem.at} ${problem.message}`),
20
+ ...verdict,
21
+ ].join('\n');
22
+ }
23
+ function criteriaOf({ criteria, scenarios }) {
24
+ if (criteria.length === 0) {
25
+ return 'no acceptance criterion stated';
26
+ }
27
+ const proved = criteria.filter(({ id }) => scenarios.some((scenario) => scenario.criteria.includes(id))).length;
28
+ return `${criteria.length} criteria, ${proved} named by a scenario`;
29
+ }
30
+ function scenariosOf(row) {
31
+ if (row.scenarios.length === 0) {
32
+ return row.kind === 'slice' ? 'no scenario' : 'no scenario needed';
33
+ }
34
+ const states = ['active', 'pending', 'todo', 'skipped'].flatMap((state) => {
35
+ const count = row.scenarios.filter((scenario) => scenario.state === state).length;
36
+ return count === 0 ? [] : [`${count} ${state}`];
37
+ });
38
+ return `${row.scenarios.length} scenario${row.scenarios.length === 1 ? '' : 's'}, ${states.join(', ')}`;
39
+ }
40
+ //# sourceMappingURL=format-acceptance.js.map
@@ -0,0 +1 @@
1
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ACrE,CAAC;IAED,MAAM,MAAM,GAAG,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QACxE,MAAM,KAAK,GAAG,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC,MAAM,CAAC;QAElF,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,IAAI,KAAK,EAAE,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;IAEH,OAAO,GAAG,GAAG,CAAC,SAAS,CAAC,MAAM,YAAY,GAAG,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;AAC1G,CAAC"}
@@ -0,0 +1,24 @@
1
+ import type { Workspace } from '../workspace/index.js';
2
+ import type { Amendment } from './acceptance-lock.js';
3
+ import type { StoryAcceptance } from './story-acceptance.js';
4
+ /** What to lock: the acceptance of the story as read, and the day the amendments carry. */
5
+ export interface LockRequest {
6
+ readonly story: StoryAcceptance;
7
+ /** `YYYY-MM-DD`. */
8
+ readonly on: string;
9
+ }
10
+ /** What a lock wrote: the file and the amendments this lock added. */
11
+ export interface Locked {
12
+ readonly file: string;
13
+ readonly scenarios: number;
14
+ readonly amendments: readonly Amendment[];
15
+ }
16
+ /**
17
+ * Records the scenarios and the criteria of a story as agreed. Refused while the scenarios are not
18
+ * written (an it.todo, a slice row or a criterion without a scenario), and while a change since the
19
+ * previous lock that only a verdict lets through (a criterion changed, a scenario changed while its
20
+ * criteria were not) has no `amend` verdict of the acceptance-judge agent for its very version: the
21
+ * verdicts become amendments of the lock, which `acceptance` lists for the owner to validate.
22
+ */
23
+ export declare function lockAcceptance(ws: Workspace, request: LockRequest): Locked;
24
+ //# sourceMappingURL=lock-acceptance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lock-acceptance.d.ts","sourceRoot":"","sources":["../../src/acceptance/lock-acceptance.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAkB,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAMtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAM7D,2FAA2F;AAC3F,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,KAAK,EAAE,eAAe,CAAC;IAChC,oBAAoB;IACpB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACrB;AAED,sEAAsE;AACtE,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,SAAS,SAAS,EAAE,CAAC;CAC3C;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,GAAG,MAAM,CAqB1E"}
@@ -0,0 +1,58 @@
1
+ import { CliError } from '../cli-error.js';
2
+ import { countsFor } from './counts-for.js';
3
+ import { driftOf } from './drift.js';
4
+ import { lockFileOf } from './lock-file-of.js';
5
+ import { readLock } from './read-lock.js';
6
+ import { readVerdicts } from './read-verdicts.js';
7
+ import { verdictOn } from './verdict-on.js';
8
+ /** What locking judges again itself, or lets through: the lock is what it writes. */
9
+ const LEFT_TO_THE_LOCK = new Set(['unlocked', 'drift', 'done-pending']);
10
+ /**
11
+ * Records the scenarios and the criteria of a story as agreed. Refused while the scenarios are not
12
+ * written (an it.todo, a slice row or a criterion without a scenario), and while a change since the
13
+ * previous lock that only a verdict lets through (a criterion changed, a scenario changed while its
14
+ * criteria were not) has no `amend` verdict of the acceptance-judge agent for its very version: the
15
+ * verdicts become amendments of the lock, which `acceptance` lists for the owner to validate.
16
+ */
17
+ export function lockAcceptance(ws, request) {
18
+ const { story } = request;
19
+ requireWritten(story);
20
+ const previous = readLock(ws, story.story);
21
+ const amendments = amendmentsOf(ws, previous, request);
22
+ const written = story.scenarios.filter(({ state }) => state === 'pending' || state === 'active');
23
+ const lock = {
24
+ story: story.story,
25
+ criteria: Object.fromEntries(story.criteria.map(({ id, fingerprint }) => [id, fingerprint])),
26
+ scenarios: written.map(({ title, criteria, fingerprint }) => ({ title, criteria, fingerprint })),
27
+ amendments: [...(previous?.amendments ?? []), ...amendments],
28
+ };
29
+ const file = lockFileOf(story.story);
30
+ ws.update(file, `${JSON.stringify(lock, null, 2)}\n`);
31
+ return { file, scenarios: written.length, amendments };
32
+ }
33
+ function requireWritten(story) {
34
+ const blocking = story.problems.filter((problem) => countsFor(problem, 'written') && !LEFT_TO_THE_LOCK.has(problem.kind));
35
+ if (story.file === undefined || blocking.length > 0) {
36
+ throw new CliError(`The acceptance of ${story.story} is not written yet:\n${blocking.map((problem) => ` ${problem.at} ${problem.message}`).join('\n')}`, `Write every scenario, then lock: \`npx ddd-ts-kit acceptance ${story.story} --gate written\` lists what is left.`);
37
+ }
38
+ }
39
+ /** The changes since the previous lock with their `amend` verdicts; refused while one has none. */
40
+ function amendmentsOf(ws, previous, { story, on }) {
41
+ const changes = previous === undefined ? [] : driftOf(previous, story.scenarios, story.criteria).toJudge;
42
+ const verdicts = readVerdicts(ws, story.story);
43
+ const unjudged = changes.filter((change) => verdictOn(change, verdicts)?.verdict !== 'amend');
44
+ if (unjudged.length > 0) {
45
+ throw new CliError(`Changed since the lock without a verdict that lets it through: ${unjudged.map((change) => `${change.subject} (fingerprint ${change.fingerprint})`).join(', ')}.`, 'Restore each as locked; or launch the acceptance-judge agent on each, with its subject and fingerprint, and lock again once it wrote `Verdict: amend`. Never change an acceptance test to make code pass.');
46
+ }
47
+ return changes.map((change) => {
48
+ const verdict = verdictOn(change, verdicts);
49
+ return {
50
+ subject: change.subject,
51
+ criteria: change.criteria,
52
+ reason: verdict?.reason ?? '',
53
+ verdict: verdict?.file ?? '',
54
+ on,
55
+ };
56
+ });
57
+ }
58
+ //# sourceMappingURL=lock-acceptance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lock-acceptance.js","sourceRoot":"","sources":["../../src/acceptance/lock-acceptance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAG3C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,qFAAqF;AACrF,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC,CAAC,UAAU,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC;AAgBxE;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,EAAa,EAAE,OAAoB;IAChE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;IAE1B,cAAc,CAAC,KAAK,CAAC,CAAC;IAEtB,MAAM,QAAQ,GAAG,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IAC3C,MAAM,UAAU,GAAG,YAAY,CAAC,EAAE,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IACvD,MAAM,OAAO,GAAG,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,QAAQ,CAAC,C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AAO,EAAE,MAAM,IAAI,EAAE;YAC7B,OAAO,EAAE,OAAO,EAAE,IAAI,IAAI,EAAE;YAC5B,EAAE;SACH,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,3 @@
1
+ /** The lock of a story's acceptance, next to its spec. */
2
+ export declare function lockFileOf(story: string): string;
3
+ //# sourceMappingURL=lock-file-of.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lock-file-of.d.ts","sourceRoot":"","sources":["../../src/acceptance/lock-file-of.ts"],"names":[],"mappings":"AAEA,0DAA0D;AAC1D,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEhD"}
@@ -0,0 +1,6 @@
1
+ import { ACCEPTANCE_DIR } from './acceptance-file-of.js';
2
+ /** The lock of a story's acceptance, next to its spec. */
3
+ export function lockFileOf(story) {
4
+ return `${ACCEPTANCE_DIR}/${story.toLowerCase()}.acceptance.lock.json`;
5
+ }
6
+ //# sourceMappingURL=lock-file-of.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lock-file-of.js","sourceRoot":"","sources":["../../src/acceptance/lock-file-of.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzD,0DAA0D;AAC1D,MAAM,UAAU,UAAU,CAAC,KAAa;IACtC,OAAO,GAAG,cAAc,IAAI,KAAK,CAAC,WAAW,EAAE,uBAAuB,CAAC;AACzE,CAAC"}
@@ -0,0 +1,21 @@
1
+ import type { AcceptanceLock } from './acceptance-lock.js';
2
+ import type { AcceptanceProblem } from './acceptance-problem.js';
3
+ import type { Criterion } from './criteria-in.js';
4
+ import type { Scenario } from './scenario.js';
5
+ import type { Verdict } from './verdict.js';
6
+ /** A story's scenarios and criteria as read, with its lock when it has one and the verdicts on its changes. */
7
+ export interface LockedStory {
8
+ readonly story: string;
9
+ readonly lock: AcceptanceLock | undefined;
10
+ readonly scenarios: readonly Scenario[];
11
+ readonly criteria: readonly Criterion[];
12
+ readonly verdicts: readonly Verdict[];
13
+ }
14
+ /**
15
+ * The acceptance of a story against its lock. A criterion changed, or a scenario changed while its
16
+ * criteria were not, is a drift whatever the gate until the acceptance-judge agent let it through:
17
+ * the test made easier, or the specification changed without being judged. What only needs
18
+ * locking again counts from `written`.
19
+ */
20
+ export declare function lockProblems({ story, lock, scenarios, criteria, verdicts }: LockedStory): AcceptanceProblem[];
21
+ //# sourceMappingURL=lock-problems.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lock-problems.d.ts","sourceRoot":"","sources":["../../src/acceptance/lock-problems.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAGlD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAG5C,+GAA+G;AAC/G,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,cAAc,GAAG,SAAS,CAAC;IAC1C,QAAQ,CAAC,SAAS,EAAE,SAAS,QAAQ,EAAE,CAAC;IACxC,QAAQ,CAAC,QAAQ,EAAE,SAAS,SAAS,EAAE,CAAC;IACxC,QAAQ,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,CAAC;CACvC;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,WAAW,GAAG,iBAAiB,EAAE,CA2B7G"}
@@ -0,0 +1,58 @@
1
+ import { driftOf } from './drift.js';
2
+ import { lockFileOf } from './lock-file-of.js';
3
+ import { verdictOn } from './verdict-on.js';
4
+ /**
5
+ * The acceptance of a story against its lock. A criterion changed, or a scenario changed while its
6
+ * criteria were not, is a drift whatever the gate until the acceptance-judge agent let it through:
7
+ * the test made easier, or the specification changed without being judged. What only needs
8
+ * locking again counts from `written`.
9
+ */
10
+ export function lockProblems({ story, lock, scenarios, criteria, verdicts }) {
11
+ if (lock === undefined) {
12
+ return scenarios.some(({ state }) => state === 'pending' || state === 'active') ? [notLocked(story)] : [];
13
+ }
14
+ const drift = driftOf(lock, scenarios, criteria);
15
+ const at = lockFileOf(story);
16
+ const amended = drift.toJudge
17
+ .filter((change) => verdictOn(change, verdicts)?.verdict === 'amend')
18
+ .map(({ subject }) => `${subject} amended by its verdict`);
19
+ const toLock = [...drift.toLock, ...amended];
20
+ return [
21
+ ...drift.toJudge.flatMap((change) => driftProblems(story, change, verdictOn(change, verdicts))),
22
+ ...(toLock.length === 0
23
+ ? []
24
+ : [
25
+ {
26
+ kind: 'unlocked',
27
+ at,
28
+ message: `Lock again (\`npx ddd-ts-kit acceptance ${story} --lock\`): ${toLock.join('; ')}.`,
29
+ from: 'written',
30
+ },
31
+ ]),
32
+ ];
33
+ }
34
+ function driftProblems(story, change, verdict) {
35
+ if (verdict?.verdict === 'amend') {
36
+ return [];
37
+ }
38
+ const at = lockFileOf(story);
39
+ const refused = verdict === undefined
40
+ ? 'no verdict lets it through'
41
+ : `the acceptance-judge refused it (${verdict.file}: ${verdict.reason})`;
42
+ return [
43
+ {
44
+ kind: 'drift',
45
+ at,
46
+ message: `The ${change.subject} changed since the lock, and ${refused}: restore it as locked (git); or, when it truly failed its criterion or the statement changed, have the acceptance-judge agent judge "${change.subject}" at fingerprint ${change.fingerprint}.`,
47
+ },
48
+ ];
49
+ }
50
+ function notLocked(story) {
51
+ return {
52
+ kind: 'unlocked',
53
+ at: lockFileOf(story),
54
+ message: `The acceptance of ${story} is not locked: once its scenarios are written, \`npx ddd-ts-kit acceptance ${story} --lock\`, committed with them.`,
55
+ from: 'written',
56
+ };
57
+ }
58
+ //# sourceMappingURL=lock-problems.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lock-problems.js","sourceRoot":"","sources":["../../src/acceptance/lock-problems.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAe,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAG/C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAW5C;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAe;IACtF,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5G,CAAC;IAED,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;IACjD,MAAM,EAAE,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;IAE7B,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO;SAC1B,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC;SACpE,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,GAAG,OAAO,yBAAyB,CAAC,CAAC;IAE7D,MAAM,MAAM,GAAG,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,GAAG,OAAO,CAAC,CAAC;IAE7C,OAAO;QACL,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;QAC/F,GAAG,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC;YACrB,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC;gBACE;oBACE,IAAI,EAAE,UAAmB;oBACzB,EAAE;oBACF,OAAO,EAAE,2CAA2C,KAAK,eAAe,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG;oBAC5F,IAAI,EAAE,SAAkB;iBACzB;aACF,CAAC;KACP,CAAC;AACJ,CAAC;AAED,SAAS,aAAa,CAAC,KAAa,EAAE,MAAc,EAAE,OAA4B;IAChF,IAAI,OAAO,EAAE,OAAO,KAAK,OAAO,EAAE,CAAC;QACjC,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,EAAE,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;IAE7B,MAAM,OAAO,GACX,OAAO,KAAK,SAAS;QACnB,CAAC,CAAC,4BAA4B;QAC9B,CAAC,CAAC,oCAAoC,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC,MAAM,GAAG,CAAC;IAE7E,OAAO;QACL;YACE,IAAI,EAAE,OAAO;YACb,EAAE;YACF,OAAO,EAAE,OAAO,MAAM,CAAC,OAAO,gCAAgC,OAAO,yIAAyI,MAAM,CAAC,OAAO,oBAAoB,MAAM,CAAC,WAAW,GAAG;SACtQ;KACF,CAAC;AACJ,CAAC;AAED,SAAS,SAAS,CAAC,KAAa;IAC9B,OAAO;QACL,IAAI,EAAE,UAAU;QAChB,EAAE,EAAE,UAAU,CAAC,KAAK,CAAC;QACrB,OAAO,EAAE,qBAAqB,KAAK,+EAA+E,KAAK,iCAAiC;QACxJ,IAAI,EAAE,SAAS;KAChB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { Slice } from '../progress/slice.js';
2
+ import type { Workspace } from '../workspace/index.js';
3
+ import type { StoryAcceptance } from './story-acceptance.js';
4
+ /**
5
+ * The acceptance of every story of slices.md and of every acceptance spec, in the order of the
6
+ * file then of the specs; of one story when `only` names it, in any case.
7
+ */
8
+ export declare function readAcceptance(ws: Workspace, slices: readonly Slice[], only?: string): StoryAcceptance[];
9
+ //# sourceMappingURL=read-acceptance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-acceptance.d.ts","sourceRoot":"","sources":["../../src/acceptance/read-acceptance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAUvD,OAAO,KAAK,EAAiB,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAM5E;;;GAGG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,KAAK,EAAE,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,eAAe,EAAE,CAOxG"}
@@ -0,0 +1,76 @@
1
+ import { ACCEPTANCE_DIR, acceptanceFileOf } from './acceptance-file-of.js';
2
+ import { criteriaIn } from './criteria-in.js';
3
+ import { lockFileOf } from './lock-file-of.js';
4
+ import { readLock } from './read-lock.js';
5
+ import { readVerdicts } from './read-verdicts.js';
6
+ import { lockProblems } from './lock-problems.js';
7
+ import { scenarioProblems } from './scenario-problems.js';
8
+ import { scenariosIn } from './scenarios-in.js';
9
+ import { storyFileOf } from './story-file-of.js';
10
+ import { storyOfFile } from './story-of-file.js';
11
+ import { storyOfRow } from './story-of-row.js';
12
+ import { storyProblems } from './story-problems.js';
13
+ /**
14
+ * The acceptance of every story of slices.md and of every acceptance spec, in the order of the
15
+ * file then of the specs; of one story when `only` names it, in any case.
16
+ */
17
+ export function readAcceptance(ws, slices, only) {
18
+ const files = ws.list(ACCEPTANCE_DIR).flatMap((name) => storyOfFile(name) ?? []);
19
+ const stories = once([...slices.map((row) => storyOfRow(row.id)), ...files]);
20
+ return stories
21
+ .filter((story) => only === undefined || story.toLowerCase() === only.toLowerCase())
22
+ .map((story) => acceptanceOf(ws, story, slices));
23
+ }
24
+ /** Each story once, as its rows write it when they do. */
25
+ function once(stories) {
26
+ const seen = new Set();
27
+ return stories.filter((story) => {
28
+ const key = story.toLowerCase();
29
+ const isNew = !seen.has(key);
30
+ seen.add(key);
31
+ return isNew;
32
+ });
33
+ }
34
+ function acceptanceOf(ws, story, slices) {
35
+ const file = acceptanceFileOf(story);
36
+ const text = ws.read(file);
37
+ const scenarios = text === undefined ? [] : scenariosIn(text);
38
+ const specification = storyFileOf(ws, story);
39
+ const criteria = specification === undefined ? [] : criteriaIn(ws.read(specification) ?? '');
40
+ const lock = readLock(ws, story);
41
+ const rows = rowsOf(story, slices, scenarios);
42
+ const context = {
43
+ file,
44
+ knownRows: new Set(slices.map((row) => row.id)),
45
+ doneRows: new Set(slices.filter((row) => row.status === 'done').map((row) => row.id)),
46
+ criteria: new Set(criteria.map(({ id }) => id)),
47
+ };
48
+ return {
49
+ story,
50
+ ...(text === undefined ? {} : { file }),
51
+ ...(specification === undefined ? {} : { specification }),
52
+ rows,
53
+ criteria,
54
+ scenarios,
55
+ ...(lock === undefined ? {} : { lock: lockFileOf(story) }),
56
+ amendments: lock?.amendments ?? [],
57
+ problems: [
58
+ ...storyProblems({ story, file, text, rows, criteria, scenarios, specification }),
59
+ ...scenarios.flatMap((scenario) => scenarioProblems(scenario, context)),
60
+ ...lockProblems({ story, lock, scenarios, criteria, verdicts: readVerdicts(ws, story) }),
61
+ ],
62
+ };
63
+ }
64
+ /** The rows of the story in slices.md, each with the scenarios that name it. */
65
+ function rowsOf(story, slices, scenarios) {
66
+ return slices
67
+ .filter((row) => storyOfRow(row.id).toLowerCase() === story.toLowerCase())
68
+ .map((row) => ({
69
+ id: row.id,
70
+ kind: row.kind,
71
+ slice: row.slice,
72
+ status: row.status,
73
+ scenarios: scenarios.filter((scenario) => scenario.rows.includes(row.id)),
74
+ }));
75
+ }
76
+ //# sourceMappingURL=read-acceptance.js.map