ddd-ts-kit 0.26.0 → 0.27.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 (360) hide show
  1. package/CHANGELOG.md +96 -0
  2. package/README.fr.md +4 -3
  3. package/README.md +3 -2
  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 +2 -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 +1 -0
  113. package/dist/check/catalogue/default-severities.js.map +1 -1
  114. package/dist/check/configuration/config-inspection.d.ts +1 -0
  115. package/dist/check/configuration/config-inspection.d.ts.map +1 -1
  116. package/dist/check/configuration/config-inspection.js +9 -1
  117. package/dist/check/configuration/config-inspection.js.map +1 -1
  118. package/dist/check/explain/tree-docs.d.ts.map +1 -1
  119. package/dist/check/explain/tree-docs.js +9 -0
  120. package/dist/check/explain/tree-docs.js.map +1 -1
  121. package/dist/check/fixtures/test-fixtures.d.ts.map +1 -1
  122. package/dist/check/fixtures/test-fixtures.js +35 -0
  123. package/dist/check/fixtures/test-fixtures.js.map +1 -1
  124. package/dist/check/project/walk-directory.js +1 -1
  125. package/dist/check/project/walk-directory.js.map +1 -1
  126. package/dist/check/rules/config-valid.d.ts.map +1 -1
  127. package/dist/check/rules/config-valid.js +1 -0
  128. package/dist/check/rules/config-valid.js.map +1 -1
  129. package/dist/check/rules/test-acceptance-black-box.d.ts +3 -0
  130. package/dist/check/rules/test-acceptance-black-box.d.ts.map +1 -0
  131. package/dist/check/rules/test-acceptance-black-box.js +38 -0
  132. package/dist/check/rules/test-acceptance-black-box.js.map +1 -0
  133. package/dist/commands/acceptance.d.ts +11 -0
  134. package/dist/commands/acceptance.d.ts.map +1 -0
  135. package/dist/commands/acceptance.js +63 -0
  136. package/dist/commands/acceptance.js.map +1 -0
  137. package/dist/commands/plan-waves.d.ts.map +1 -1
  138. package/dist/commands/plan-waves.js +1 -2
  139. package/dist/commands/plan-waves.js.map +1 -1
  140. package/dist/commands/stories.d.ts +9 -0
  141. package/dist/commands/stories.d.ts.map +1 -0
  142. package/dist/commands/stories.js +16 -0
  143. package/dist/commands/stories.js.map +1 -0
  144. package/dist/commands/story-scope.d.ts +4 -0
  145. package/dist/commands/story-scope.d.ts.map +1 -0
  146. package/dist/commands/story-scope.js +34 -0
  147. package/dist/commands/story-scope.js.map +1 -0
  148. package/dist/commands/story.d.ts +9 -0
  149. package/dist/commands/story.d.ts.map +1 -0
  150. package/dist/commands/story.js +45 -0
  151. package/dist/commands/story.js.map +1 -0
  152. package/dist/commands/worker-scope.d.ts.map +1 -1
  153. package/dist/commands/worker-scope.js +2 -0
  154. package/dist/commands/worker-scope.js.map +1 -1
  155. package/dist/commands/worktree.d.ts +7 -0
  156. package/dist/commands/worktree.d.ts.map +1 -0
  157. package/dist/commands/worktree.js +34 -0
  158. package/dist/commands/worktree.js.map +1 -0
  159. package/dist/config/config.d.ts +7 -0
  160. package/dist/config/config.d.ts.map +1 -1
  161. package/dist/config/index.d.ts +1 -0
  162. package/dist/config/index.d.ts.map +1 -1
  163. package/dist/config/index.js +1 -0
  164. package/dist/config/index.js.map +1 -1
  165. package/dist/config/parse-config.js +1 -0
  166. package/dist/config/parse-config.js.map +1 -1
  167. package/dist/config/serialize-config.js +1 -0
  168. package/dist/config/serialize-config.js.map +1 -1
  169. package/dist/config/worktree-modes.d.ts +3 -0
  170. package/dist/config/worktree-modes.d.ts.map +1 -0
  171. package/dist/config/worktree-modes.js +3 -0
  172. package/dist/config/worktree-modes.js.map +1 -0
  173. package/dist/generate/kinds/acceptance-kind.d.ts +3 -0
  174. package/dist/generate/kinds/acceptance-kind.d.ts.map +1 -0
  175. package/dist/generate/kinds/acceptance-kind.js +69 -0
  176. package/dist/generate/kinds/acceptance-kind.js.map +1 -0
  177. package/dist/generate/kinds.d.ts.map +1 -1
  178. package/dist/generate/kinds.js +2 -0
  179. package/dist/generate/kinds.js.map +1 -1
  180. package/dist/generate/shared-writes.d.ts.map +1 -1
  181. package/dist/generate/shared-writes.js +3 -0
  182. package/dist/generate/shared-writes.js.map +1 -1
  183. package/dist/help/notes.d.ts +1 -1
  184. package/dist/help/notes.d.ts.map +1 -1
  185. package/dist/help/notes.js +50 -2
  186. package/dist/help/notes.js.map +1 -1
  187. package/dist/help/usage.d.ts +1 -1
  188. package/dist/help/usage.d.ts.map +1 -1
  189. package/dist/help/usage.js +6 -0
  190. package/dist/help/usage.js.map +1 -1
  191. package/dist/init/agent-permissions.d.ts.map +1 -1
  192. package/dist/init/agent-permissions.js +9 -1
  193. package/dist/init/agent-permissions.js.map +1 -1
  194. package/dist/init/ignore-worktrees.d.ts +7 -0
  195. package/dist/init/ignore-worktrees.d.ts.map +1 -0
  196. package/dist/init/ignore-worktrees.js +15 -0
  197. package/dist/init/ignore-worktrees.js.map +1 -0
  198. package/dist/init/manifest/versions.js +24 -24
  199. package/dist/init/run-init.d.ts.map +1 -1
  200. package/dist/init/run-init.js +9 -3
  201. package/dist/init/run-init.js.map +1 -1
  202. package/dist/plan/batched-waves.d.ts +0 -2
  203. package/dist/plan/batched-waves.d.ts.map +1 -1
  204. package/dist/plan/batched-waves.js +4 -4
  205. package/dist/plan/batched-waves.js.map +1 -1
  206. package/dist/plan/plan-waves.d.ts +0 -2
  207. package/dist/plan/plan-waves.d.ts.map +1 -1
  208. package/dist/plan/plan-waves.js +2 -2
  209. package/dist/plan/plan-waves.js.map +1 -1
  210. package/dist/run.d.ts.map +1 -1
  211. package/dist/run.js +10 -0
  212. package/dist/run.js.map +1 -1
  213. package/dist/slice/plan-staging.d.ts +1 -1
  214. package/dist/slice/plan-staging.d.ts.map +1 -1
  215. package/dist/slice/plan-staging.js +5 -2
  216. package/dist/slice/plan-staging.js.map +1 -1
  217. package/dist/stories/forecast-merge.d.ts +14 -0
  218. package/dist/stories/forecast-merge.d.ts.map +1 -0
  219. package/dist/stories/forecast-merge.js +44 -0
  220. package/dist/stories/forecast-merge.js.map +1 -0
  221. package/dist/stories/format-stories.d.ts +4 -0
  222. package/dist/stories/format-stories.d.ts.map +1 -0
  223. package/dist/stories/format-stories.js +66 -0
  224. package/dist/stories/format-stories.js.map +1 -0
  225. package/dist/stories/format-story-phases.d.ts +5 -0
  226. package/dist/stories/format-story-phases.d.ts.map +1 -0
  227. package/dist/stories/format-story-phases.js +14 -0
  228. package/dist/stories/format-story-phases.js.map +1 -0
  229. package/dist/stories/merge-forecast.d.ts +18 -0
  230. package/dist/stories/merge-forecast.d.ts.map +1 -0
  231. package/dist/stories/merge-forecast.js +2 -0
  232. package/dist/stories/merge-forecast.js.map +1 -0
  233. package/dist/stories/open-stories.d.ts +8 -0
  234. package/dist/stories/open-stories.d.ts.map +1 -0
  235. package/dist/stories/open-stories.js +31 -0
  236. package/dist/stories/open-stories.js.map +1 -0
  237. package/dist/stories/open-story-scope.d.ts +23 -0
  238. package/dist/stories/open-story-scope.d.ts.map +1 -0
  239. package/dist/stories/open-story-scope.js +86 -0
  240. package/dist/stories/open-story-scope.js.map +1 -0
  241. package/dist/stories/open-story.d.ts +11 -0
  242. package/dist/stories/open-story.d.ts.map +1 -0
  243. package/dist/stories/open-story.js +2 -0
  244. package/dist/stories/open-story.js.map +1 -0
  245. package/dist/stories/read-stories.d.ts +9 -0
  246. package/dist/stories/read-stories.d.ts.map +1 -0
  247. package/dist/stories/read-stories.js +60 -0
  248. package/dist/stories/read-stories.js.map +1 -0
  249. package/dist/stories/read-story-phases.d.ts +10 -0
  250. package/dist/stories/read-story-phases.d.ts.map +1 -0
  251. package/dist/stories/read-story-phases.js +144 -0
  252. package/dist/stories/read-story-phases.js.map +1 -0
  253. package/dist/stories/read-story-place.d.ts +4 -0
  254. package/dist/stories/read-story-place.d.ts.map +1 -0
  255. package/dist/stories/read-story-place.js +23 -0
  256. package/dist/stories/read-story-place.js.map +1 -0
  257. package/dist/stories/review-file-of.d.ts +4 -0
  258. package/dist/stories/review-file-of.d.ts.map +1 -0
  259. package/dist/stories/review-file-of.js +7 -0
  260. package/dist/stories/review-file-of.js.map +1 -0
  261. package/dist/stories/section-of.d.ts +3 -0
  262. package/dist/stories/section-of.d.ts.map +1 -0
  263. package/dist/stories/section-of.js +11 -0
  264. package/dist/stories/section-of.js.map +1 -0
  265. package/dist/stories/stories-view.d.ts +13 -0
  266. package/dist/stories/stories-view.d.ts.map +1 -0
  267. package/dist/stories/stories-view.js +2 -0
  268. package/dist/stories/stories-view.js.map +1 -0
  269. package/dist/stories/story-crossing.d.ts +16 -0
  270. package/dist/stories/story-crossing.d.ts.map +1 -0
  271. package/dist/stories/story-crossing.js +2 -0
  272. package/dist/stories/story-crossing.js.map +1 -0
  273. package/dist/stories/story-gate.d.ts +4 -0
  274. package/dist/stories/story-gate.d.ts.map +1 -0
  275. package/dist/stories/story-gate.js +2 -0
  276. package/dist/stories/story-gate.js.map +1 -0
  277. package/dist/stories/story-phase.d.ts +13 -0
  278. package/dist/stories/story-phase.d.ts.map +1 -0
  279. package/dist/stories/story-phase.js +2 -0
  280. package/dist/stories/story-phase.js.map +1 -0
  281. package/dist/stories/story-place.d.ts +14 -0
  282. package/dist/stories/story-place.d.ts.map +1 -0
  283. package/dist/stories/story-place.js +2 -0
  284. package/dist/stories/story-place.js.map +1 -0
  285. package/dist/stories/story-scope-file.d.ts +3 -0
  286. package/dist/stories/story-scope-file.d.ts.map +1 -0
  287. package/dist/stories/story-scope-file.js +3 -0
  288. package/dist/stories/story-scope-file.js.map +1 -0
  289. package/dist/stories/story-scope.d.ts +17 -0
  290. package/dist/stories/story-scope.d.ts.map +1 -0
  291. package/dist/stories/story-scope.js +2 -0
  292. package/dist/stories/story-scope.js.map +1 -0
  293. package/dist/stories/story-state.d.ts +13 -0
  294. package/dist/stories/story-state.d.ts.map +1 -0
  295. package/dist/stories/story-state.js +2 -0
  296. package/dist/stories/story-state.js.map +1 -0
  297. package/dist/stories/trunk-phase.d.ts +8 -0
  298. package/dist/stories/trunk-phase.d.ts.map +1 -0
  299. package/dist/stories/trunk-phase.js +27 -0
  300. package/dist/stories/trunk-phase.js.map +1 -0
  301. package/dist/version.d.ts +1 -1
  302. package/dist/version.js +1 -1
  303. package/dist/worker/add-worktree.d.ts +7 -0
  304. package/dist/worker/add-worktree.d.ts.map +1 -0
  305. package/dist/worker/add-worktree.js +13 -0
  306. package/dist/worker/add-worktree.js.map +1 -0
  307. package/dist/worker/branch-exists.d.ts +3 -0
  308. package/dist/worker/branch-exists.d.ts.map +1 -0
  309. package/dist/worker/branch-exists.js +6 -0
  310. package/dist/worker/branch-exists.js.map +1 -0
  311. package/dist/worker/briefed-rows.js +1 -1
  312. package/dist/worker/briefed-rows.js.map +1 -1
  313. package/dist/worker/ensure-ignored.d.ts +7 -0
  314. package/dist/worker/ensure-ignored.d.ts.map +1 -0
  315. package/dist/worker/ensure-ignored.js +17 -0
  316. package/dist/worker/ensure-ignored.js.map +1 -0
  317. package/dist/worker/install-notes.d.ts +9 -0
  318. package/dist/worker/install-notes.d.ts.map +1 -0
  319. package/dist/worker/install-notes.js +25 -0
  320. package/dist/worker/install-notes.js.map +1 -0
  321. package/dist/worker/is-worktree.d.ts +3 -0
  322. package/dist/worker/is-worktree.d.ts.map +1 -0
  323. package/dist/worker/is-worktree.js +15 -0
  324. package/dist/worker/is-worktree.js.map +1 -0
  325. package/dist/worker/open-worker-scope.d.ts +6 -1
  326. package/dist/worker/open-worker-scope.d.ts.map +1 -1
  327. package/dist/worker/open-worker-scope.js +29 -36
  328. package/dist/worker/open-worker-scope.js.map +1 -1
  329. package/dist/worker/repository-prefix.d.ts +3 -0
  330. package/dist/worker/repository-prefix.d.ts.map +1 -0
  331. package/dist/worker/repository-prefix.js +14 -0
  332. package/dist/worker/repository-prefix.js.map +1 -0
  333. package/dist/worker/upstream-of.d.ts +8 -0
  334. package/dist/worker/upstream-of.d.ts.map +1 -0
  335. package/dist/worker/upstream-of.js +18 -0
  336. package/dist/worker/upstream-of.js.map +1 -0
  337. package/dist/worker/worktree-home.d.ts +9 -0
  338. package/dist/worker/worktree-home.d.ts.map +1 -0
  339. package/dist/worker/worktree-home.js +17 -0
  340. package/dist/worker/worktree-home.js.map +1 -0
  341. package/dist/worker/worktree-of.d.ts +13 -0
  342. package/dist/worker/worktree-of.d.ts.map +1 -0
  343. package/dist/worker/worktree-of.js +30 -0
  344. package/dist/worker/worktree-of.js.map +1 -0
  345. package/dist/worktree/open-worktree.d.ts +20 -0
  346. package/dist/worktree/open-worktree.d.ts.map +1 -0
  347. package/dist/worktree/open-worktree.js +57 -0
  348. package/dist/worktree/open-worktree.js.map +1 -0
  349. package/dist/worktree/worktree-scope.d.ts +15 -0
  350. package/dist/worktree/worktree-scope.d.ts.map +1 -0
  351. package/dist/worktree/worktree-scope.js +2 -0
  352. package/dist/worktree/worktree-scope.js.map +1 -0
  353. package/package.json +2 -2
  354. package/templates/acceptance/acceptance.spec.ts.tpl +35 -0
  355. package/templates/init/docker/dockerignore.tpl +1 -0
  356. package/templates/init/e2e/jest.e2e.config.js.tpl +1 -1
  357. package/templates/init/e2e/vitest.e2e.config.ts.tpl +1 -1
  358. package/templates/init/gitignore.tpl +1 -0
  359. package/templates/pipeline/biome.json.tpl +1 -0
  360. package/templates/pipeline/package-scripts.json +1 -1
@@ -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,CAAC;IAEjG,MAAM,IAAI,GAAmB;QAC3B,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,QAAQ,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5B,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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AAC,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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-acceptance.js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AAE,QAAQ,EAAE,YAAY,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE,CAAC;SACzF;KACF,CAAC;AACJ,CAAC;AAED,gFAAgF;AAChF,SAAS,MAAM,CAAC,KAAa,EAAE,MAAwB,EAAE,SAA8B;IACrF,OAAO,MAAM;SACV,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,KAAK,KAAK,CAAC,WAAW,EAAE,CAAC;SACzE,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QACb,EAAE,EAAE,GAAG,CAAC,EAAE;QACV,IAAI,EAAE,GAAG,CAAC,IAAI;QACd,KAAK,EAAE,GAAG,CAAC,KAAK;QAChB,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,SAAS,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;KAC1E,CAAC,CAAC,CAAC;AACR,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { Workspace } from '../workspace/index.js';
2
+ import type { AcceptanceLock } from './acceptance-lock.js';
3
+ /** The lock of the story; undefined when it has none or the file is not a lock. */
4
+ export declare function readLock(ws: Workspace, story: string): AcceptanceLock | undefined;
5
+ //# sourceMappingURL=read-lock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-lock.d.ts","sourceRoot":"","sources":["../../src/acceptance/read-lock.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAA6B,MAAM,sBAAsB,CAAC;AAGtF,mFAAmF;AACnF,wBAAgB,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAcjF"}
@@ -0,0 +1,45 @@
1
+ import { isRecord } from '../config/values/is-record.js';
2
+ import { lockFileOf } from './lock-file-of.js';
3
+ /** The lock of the story; undefined when it has none or the file is not a lock. */
4
+ export function readLock(ws, story) {
5
+ const text = ws.read(lockFileOf(story));
6
+ if (text === undefined) {
7
+ return undefined;
8
+ }
9
+ try {
10
+ const raw = JSON.parse(text);
11
+ return isRecord(raw) ? lockOf(raw, story) : undefined;
12
+ }
13
+ catch {
14
+ return undefined;
15
+ }
16
+ }
17
+ function lockOf(raw, story) {
18
+ const criteria = isRecord(raw['criteria']) ? raw['criteria'] : {};
19
+ return {
20
+ story,
21
+ criteria: Object.fromEntries(Object.entries(criteria).filter((entry) => typeof entry[1] === 'string')),
22
+ scenarios: records(raw['scenarios']).map((scenario) => ({
23
+ title: text(scenario['title']),
24
+ criteria: texts(scenario['criteria']),
25
+ fingerprint: text(scenario['fingerprint']),
26
+ })),
27
+ amendments: records(raw['amendments']).map((amendment) => ({
28
+ subject: text(amendment['subject']),
29
+ criteria: texts(amendment['criteria']),
30
+ reason: text(amendment['reason']),
31
+ verdict: text(amendment['verdict']),
32
+ on: text(amendment['on']),
33
+ })),
34
+ };
35
+ }
36
+ function records(value) {
37
+ return Array.isArray(value) ? value.filter(isRecord) : [];
38
+ }
39
+ function texts(value) {
40
+ return Array.isArray(value) ? value.filter((item) => typeof item === 'string') : [];
41
+ }
42
+ function text(value) {
43
+ return typeof value === 'string' ? value : '';
44
+ }
45
+ //# sourceMappingURL=read-lock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-lock.js","sourceRoot":"","sources":["../../src/acceptance/read-lock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAGzD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,mFAAmF;AACnF,MAAM,UAAU,QAAQ,CAAC,EAAa,EAAE,KAAa;IACnD,MAAM,IAAI,GAAG,EAAE,CAAC,IAAI,CAAC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,EAAE,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;YACnC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;YACtC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;YACjC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;YACnC,EAAE,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;SAC1B,CAAC,CACH;KACF,CAAC;AACJ,CAAC;AAED,SAAS,OAAO,CAAC,KAAc;IAC7B,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC5D,CAAC;AAED,SAAS,KAAK,CAAC,KAAc;IAC3B,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACtF,CAAC;AAED,SAAS,IAAI,CAAC,KAAc;IAC1B,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;AAChD,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { Workspace } from '../workspace/index.js';
2
+ import type { Verdict } from './verdict.js';
3
+ /**
4
+ * The verdicts on the changes of a story since its lock, read from `test/acceptance/verdicts/`:
5
+ * each a Markdown file with the lines `Story:`, `Subject:`, `Fingerprint:`, `Verdict: amend` or
6
+ * `refuse`, and `Reason:`. A file missing one of them is not a verdict.
7
+ */
8
+ export declare function readVerdicts(ws: Workspace, story: string): Verdict[];
9
+ //# sourceMappingURL=read-verdicts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-verdicts.d.ts","sourceRoot":"","sources":["../../src/acceptance/read-verdicts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAK5C;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,EAAE,CAKpE"}
@@ -0,0 +1,35 @@
1
+ import { VERDICTS_DIR } from './verdicts-dir.js';
2
+ const FIELD = /^(Story|Subject|Fingerprint|Verdict|Reason):\s*(.*)$/;
3
+ /**
4
+ * The verdicts on the changes of a story since its lock, read from `test/acceptance/verdicts/`:
5
+ * each a Markdown file with the lines `Story:`, `Subject:`, `Fingerprint:`, `Verdict: amend` or
6
+ * `refuse`, and `Reason:`. A file missing one of them is not a verdict.
7
+ */
8
+ export function readVerdicts(ws, story) {
9
+ return ws
10
+ .list(VERDICTS_DIR)
11
+ .filter((name) => name.endsWith('.md'))
12
+ .flatMap((name) => verdictIn(`${VERDICTS_DIR}/${name}`, ws.read(`${VERDICTS_DIR}/${name}`) ?? '', story));
13
+ }
14
+ /** The verdict a file holds on the story, or none. */
15
+ function verdictIn(file, text, story) {
16
+ const fields = fieldsOf(text);
17
+ const verdict = fields.get('Verdict');
18
+ const subject = fields.get('Subject');
19
+ const fingerprint = fields.get('Fingerprint');
20
+ if (fields.get('Story')?.toLowerCase() !== story.toLowerCase() ||
21
+ subject === undefined ||
22
+ fingerprint === undefined) {
23
+ return [];
24
+ }
25
+ return verdict === 'amend' || verdict === 'refuse'
26
+ ? [{ file, story, subject, fingerprint, verdict, reason: fields.get('Reason') ?? '' }]
27
+ : [];
28
+ }
29
+ function fieldsOf(text) {
30
+ return new Map(text.split('\n').flatMap((line) => {
31
+ const [, key, value] = FIELD.exec(line.trim()) ?? [];
32
+ return key === undefined || value === undefined ? [] : [[key, value.trim().replace(/^`|`$/g, '')]];
33
+ }));
34
+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AE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC;QACtF,CAAC,CAAC,EAAE,CAAC;AACT,CAAC;AAED,SAAS,QAAQ,CAAC,IAAY;IAC5B,OAAO,IAAI,GAAG,CACZ,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QAChC,MAAM,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC;QAErD,OAAO,GAAG,KAAK,SAAS,IAAI,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAU,CAAC,CAAC;IAC9G,CAAC,CAAC,CACH,CAAC;AACJ,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { AcceptanceProblem } from './acceptance-problem.js';
2
+ import type { Scenario } from './scenario.js';
3
+ /** What a scenario needs to be judged: the rows of slices.md, those done, the criteria of its story. */
4
+ export interface ScenarioContext {
5
+ readonly file: string;
6
+ readonly knownRows: ReadonlySet<string>;
7
+ readonly doneRows: ReadonlySet<string>;
8
+ /** The ids of the criteria of the story; empty when its specification states none. */
9
+ readonly criteria: ReadonlySet<string>;
10
+ }
11
+ export declare function scenarioProblems(scenario: Scenario, context: ScenarioContext): AcceptanceProblem[];
12
+ //# sourceMappingURL=scenario-problems.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scenario-problems.d.ts","sourceRoot":"","sources":["../../src/acceptance/scenario-problems.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C,wGAAwG;AACxG,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACxC,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACvC,sFAAsF;IACtF,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CACxC;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,eAAe,GAAG,iBAAiB,EAAE,CAqBlG"}
@@ -0,0 +1,74 @@
1
+ export function scenarioProblems(scenario, context) {
2
+ const at = `${context.file}:${scenario.line}`;
3
+ const quoted = `"${scenario.title}"`;
4
+ if (scenario.state === 'todo') {
5
+ return [{ kind: 'todo', at, message: `${quoted} is still an it.todo: write the scenario.`, from: 'written' }];
6
+ }
7
+ if (scenario.state === 'skipped') {
8
+ return [
9
+ {
10
+ kind: 'skipped',
11
+ at,
12
+ message: `${quoted} is put aside by the runner: an acceptance scenario runs, wrapped in pending(...) until its code is built.`,
13
+ },
14
+ ];
15
+ }
16
+ const judged = { at, quoted, scenario };
17
+ return [...rowProblems(judged, context), ...criterionProblems(judged, context), ...pendingProblems(judged, context)];
18
+ }
19
+ function rowProblems({ at, quoted, scenario }, { knownRows }) {
20
+ if (scenario.rows.length === 0) {
21
+ return [
22
+ {
23
+ kind: 'no-row',
24
+ at,
25
+ message: `${quoted} names no row: start its title with the id of the row that makes it pass (#US5.02).`,
26
+ },
27
+ ];
28
+ }
29
+ return scenario.rows
30
+ .filter((id) => !knownRows.has(id))
31
+ .map((id) => ({
32
+ kind: 'unknown-row',
33
+ at,
34
+ message: `${quoted} names #${id}, which no row of docs/architecture/slices.md carries.`,
35
+ }));
36
+ }
37
+ function criterionProblems({ at, quoted, scenario }, { criteria }) {
38
+ if (criteria.size === 0) {
39
+ return [];
40
+ }
41
+ if (scenario.criteria.length === 0) {
42
+ return [
43
+ {
44
+ kind: 'no-criterion',
45
+ at,
46
+ message: `${quoted} names no acceptance criterion: put the one it proves after its row (#US5.02 AC1 ...).`,
47
+ from: 'written',
48
+ },
49
+ ];
50
+ }
51
+ return scenario.criteria
52
+ .filter((id) => !criteria.has(id))
53
+ .map((id) => ({
54
+ kind: 'unknown-criterion',
55
+ at,
56
+ message: `${quoted} names ${id}, which the specification of the story does not state.`,
57
+ }));
58
+ }
59
+ function pendingProblems({ at, quoted, scenario }, { doneRows }) {
60
+ if (scenario.state !== 'pending') {
61
+ return [];
62
+ }
63
+ if (scenario.rows.length > 0 && scenario.rows.every((id) => doneRows.has(id))) {
64
+ return [
65
+ {
66
+ kind: 'done-pending',
67
+ at,
68
+ message: `${quoted} is still pending, and every row it names is done: build what it waits for, or remove pending(...) once it passes.`,
69
+ },
70
+ ];
71
+ }
72
+ return [{ kind: 'pending', at, message: `${quoted} is pending: its code is not built yet.`, from: 'passing' }];
73
+ }
74
+ //# sourceMappingURL=scenario-problems.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scenario-problems.js","sourceRoot":"","sources":["../../src/acceptance/scenario-problems.ts"],"names":[],"mappings":"AAYA,MAAM,UAAU,gBAAgB,CAAC,QAAkB,EAAE,OAAwB;IAC3E,MAAM,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC;IAC9C,MAAM,MAAM,GAAG,IAAI,QAAQ,CAAC,KAAK,GAAG,CAAC;IAErC,IAAI,QAAQ,CAAC,KAAK,KAAK,MAAM,EAAE,CAAC;QAC9B,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,GAAG,MAAM,2CAA2C,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC;IAChH,CAAC;IAED,IAAI,QAAQ,CAA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AC,EAAE,CAAC;QACnC,OAAO;YACL;gBACE,IAAI,EAAE,cAAc;gBACpB,EAAE;gBACF,OAAO,EAAE,GAAG,MAAM,wFAAwF;gBAC1G,IAAI,EAAE,SAAS;aAChB;SACF,CAAC;IACJ,CAAC;IAED,OAAO,QAAQ,CAAC,QAAQ;SACrB,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;SACjC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QACZ,IAAI,EAAE,mBAA4B;QAClC,EAAE;QACF,OAAO,EAAE,GAAG,MAAM,UAAU,EAAE,wDAAwD;KACvF,CAAC,CAAC,CAAC;AACR,CAAC;AAED,SAAS,eAAe,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAU,EAAE,EAAE,QAAQ,EAAmB;IACtF,IAAI,QAAQ,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;QACjC,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;QAC9E,OAAO;YACL;gBACE,IAAI,EAAE,cAAc;gBACpB,EAAE;gBACF,OAAO,EAAE,GAAG,MAAM,oHAAoH;aACvI;SACF,CAAC;IACJ,CAAC;IAED,OAAO,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,OAAO,EAAE,GAAG,MAAM,yCAAyC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC;AACjH,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * What a scenario of an acceptance spec says of its code: `todo`, an `it.todo` still to write;
3
+ * `pending`, written and wrapped in `pending(...)`, the code it waits for not built; `active`,
4
+ * written and expected to pass; `skipped`, put aside by the runner (`.skip`, `.fails`, `.failing`),
5
+ * which an acceptance spec never does.
6
+ */
7
+ export type ScenarioState = 'todo' | 'pending' | 'active' | 'skipped';
8
+ /** One `it` of an acceptance spec. */
9
+ export interface Scenario {
10
+ readonly title: string;
11
+ readonly line: number;
12
+ /** The ids of the rows of slices.md its title names (`#US5.02`): what makes it pass. */
13
+ readonly rows: readonly string[];
14
+ /** The acceptance criteria of the story its title names (`AC1`): what it proves. */
15
+ readonly criteria: readonly string[];
16
+ readonly state: ScenarioState;
17
+ /**
18
+ * What the scenario asserts, as a digest: its call without comments, white space, trailing commas
19
+ * and the `pending(...)` around its body, so that removing the wrapper or formatting again keeps it.
20
+ */
21
+ readonly fingerprint: string;
22
+ }
23
+ //# sourceMappingURL=scenario.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scenario.d.ts","sourceRoot":"","sources":["../../src/acceptance/scenario.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEtE,sCAAsC;AACtC,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,wFAAwF;IACxF,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,oFAAoF;IACpF,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B;;;OAGG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=scenario.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scenario.js","sourceRoot":"","sources":["../../src/acceptance/scenario.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import type { Scenario } from './scenario.js';
2
+ /** The scenarios of an acceptance spec, in the order of the file. */
3
+ export declare function scenariosIn(source: string): Scenario[];
4
+ //# sourceMappingURL=scenarios-in.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scenarios-in.d.ts","sourceRoot":"","sources":["../../src/acceptance/scenarios-in.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAiB,MAAM,eAAe,CAAC;AAgB7D,qEAAqE;AACrE,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,EAAE,CA4BtD"}
@@ -0,0 +1,68 @@
1
+ import { createHash } from 'node:crypto';
2
+ import { scan } from '../check/scan/scan.js';
3
+ import { commentless } from './commentless.js';
4
+ /** An `it` or `test` call up to the quote of its title, read in the code, where comments and literals are blanked. */
5
+ const CALL = /\b(?:it|test)(?:\.(todo|skip|only|fails|failing|concurrent))?\(\s*['"`]/g;
6
+ /** `pending(` right after the title: the body waits for its code. */
7
+ const WRAPPER = /^\s*,\s*pending\s*\(/;
8
+ /** A row id as a title names it: `#US5.02`, `#M2.07`, `#4.15`. */
9
+ const ROW = /#([A-Za-z0-9][\w.-]*\w)/g;
10
+ /** An acceptance criterion of the story as a title names it: `AC1`. */
11
+ const CRITERION = /\bAC\d+\b/g;
12
+ const SKIPPED = new Set(['skip', 'fails', 'failing']);
13
+ /** The scenarios of an acceptance spec, in the order of the file. */
14
+ export function scenariosIn(source) {
15
+ const scanned = scan(source);
16
+ const { code } = scanned;
17
+ const titles = new Map(scanned.strings.map((record) => [record.start, record]));
18
+ const written = commentless(source, scanned);
19
+ return [...code.matchAll(CALL)].flatMap((match) => {
20
+ const title = titles.get(match.index + match[0].length - 1);
21
+ if (title === undefined) {
22
+ return [];
23
+ }
24
+ const end = closingParenthesis(code, code.indexOf('(', match.index));
25
+ const wrapper = WRAPPER.exec(code.slice(title.end, end));
26
+ const opened = wrapper === null ? undefined : title.end + wrapper[0].length - 1;
27
+ return [
28
+ {
29
+ title: title.value,
30
+ line: scanned.lineAt(match.index),
31
+ rows: [...title.value.matchAll(ROW)].flatMap(([, id]) => (id === undefined ? [] : [id])),
32
+ criteria: [...new Set(title.value.match(CRITERION) ?? [])],
33
+ state: stateOf(match[1], opened !== undefined),
34
+ fingerprint: fingerprintOf(written, code, { start: match.index, end, opened, wrapperStart: title.end }),
35
+ },
36
+ ];
37
+ });
38
+ }
39
+ function stateOf(modifier, isPending) {
40
+ if (modifier === 'todo') {
41
+ return 'todo';
42
+ }
43
+ if (modifier !== undefined && SKIPPED.has(modifier)) {
44
+ return 'skipped';
45
+ }
46
+ return isPending ? 'pending' : 'active';
47
+ }
48
+ /** The offset just after the parenthesis that closes the one at `open`, or the end of the code. */
49
+ function closingParenthesis(code, open) {
50
+ let depth = 0;
51
+ for (let at = open; at < code.length; at += 1) {
52
+ depth += code[at] === '(' ? 1 : code[at] === ')' ? -1 : 0;
53
+ if (depth === 0) {
54
+ return at + 1;
55
+ }
56
+ }
57
+ return code.length;
58
+ }
59
+ function fingerprintOf(written, code, extent) {
60
+ const { start, end, opened, wrapperStart } = extent;
61
+ const closed = opened === undefined ? undefined : closingParenthesis(code, opened) - 1;
62
+ const unwrapped = opened === undefined || closed === undefined
63
+ ? written.slice(start, end)
64
+ : `${written.slice(start, wrapperStart)},${written.slice(opened + 1, closed)}${written.slice(closed + 1, end)}`;
65
+ const normalized = unwrapped.replace(/\s+/g, '').replace(/,(?=[)\]}])/g, '');
66
+ return createHash('sha256').update(normalized).digest('hex').slice(0, 16);
67
+ }
68
+ //# sourceMappingURL=scenarios-in.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scenarios-in.js","sourceRoot":"","sources":["../../src/acceptance/scenarios-in.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,M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