ddd-ts-kit 0.92.0 → 0.93.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 (110) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/README.fr.md +12 -7
  3. package/README.md +9 -5
  4. package/dist/acceptance/check-locked-files.d.ts +25 -0
  5. package/dist/acceptance/check-locked-files.d.ts.map +1 -0
  6. package/dist/acceptance/check-locked-files.js +84 -0
  7. package/dist/acceptance/check-locked-files.js.map +1 -0
  8. package/dist/acceptance/scenarios-in.d.ts +4 -0
  9. package/dist/acceptance/scenarios-in.d.ts.map +1 -1
  10. package/dist/acceptance/scenarios-in.js +2 -2
  11. package/dist/acceptance/scenarios-in.js.map +1 -1
  12. package/dist/commands/acceptance.d.ts.map +1 -1
  13. package/dist/commands/acceptance.js +14 -0
  14. package/dist/commands/acceptance.js.map +1 -1
  15. package/dist/commands/generate.js +2 -0
  16. package/dist/commands/generate.js.map +1 -1
  17. package/dist/commit/run-git.d.ts +5 -1
  18. package/dist/commit/run-git.d.ts.map +1 -1
  19. package/dist/commit/run-git.js +19 -2
  20. package/dist/commit/run-git.js.map +1 -1
  21. package/dist/controllers/finish-migration.js +4 -2
  22. package/dist/controllers/finish-migration.js.map +1 -1
  23. package/dist/docs/behaviour-page.d.ts.map +1 -1
  24. package/dist/docs/behaviour-page.js +9 -1
  25. package/dist/docs/behaviour-page.js.map +1 -1
  26. package/dist/generate/kind.d.ts +2 -0
  27. package/dist/generate/kind.d.ts.map +1 -1
  28. package/dist/generate/kinds/job/job-vars.d.ts +4 -1
  29. package/dist/generate/kinds/job/job-vars.d.ts.map +1 -1
  30. package/dist/generate/kinds/job/job-vars.js +11 -1
  31. package/dist/generate/kinds/job/job-vars.js.map +1 -1
  32. package/dist/generate/kinds/job-kind.js +20 -3
  33. package/dist/generate/kinds/job-kind.js.map +1 -1
  34. package/dist/generate/kinds/service-kind.d.ts.map +1 -1
  35. package/dist/generate/kinds/service-kind.js +30 -3
  36. package/dist/generate/kinds/service-kind.js.map +1 -1
  37. package/dist/init/files/inert-persistence-file.d.ts +5 -0
  38. package/dist/init/files/inert-persistence-file.d.ts.map +1 -0
  39. package/dist/init/files/inert-persistence-file.js +16 -0
  40. package/dist/init/files/inert-persistence-file.js.map +1 -0
  41. package/dist/init/files/platform-files.js +6 -1
  42. package/dist/init/files/platform-files.js.map +1 -1
  43. package/dist/init/manifest/versions.js +24 -24
  44. package/dist/measures/branch-commits.d.ts +4 -2
  45. package/dist/measures/branch-commits.d.ts.map +1 -1
  46. package/dist/measures/branch-commits.js +32 -8
  47. package/dist/measures/branch-commits.js.map +1 -1
  48. package/dist/measures/timeline-of.d.ts +3 -2
  49. package/dist/measures/timeline-of.d.ts.map +1 -1
  50. package/dist/measures/timeline-of.js +37 -8
  51. package/dist/measures/timeline-of.js.map +1 -1
  52. package/dist/platform-layout/platform-layout.d.ts +2 -0
  53. package/dist/platform-layout/platform-layout.d.ts.map +1 -1
  54. package/dist/platform-layout/platform-layout.js +2 -0
  55. package/dist/platform-layout/platform-layout.js.map +1 -1
  56. package/dist/presets/no-flags.d.ts.map +1 -1
  57. package/dist/presets/no-flags.js +1 -0
  58. package/dist/presets/no-flags.js.map +1 -1
  59. package/dist/progress/build-next-of.d.ts +9 -0
  60. package/dist/progress/build-next-of.d.ts.map +1 -0
  61. package/dist/progress/build-next-of.js +22 -0
  62. package/dist/progress/build-next-of.js.map +1 -0
  63. package/dist/progress/format-progress.d.ts.map +1 -1
  64. package/dist/progress/format-progress.js +3 -0
  65. package/dist/progress/format-progress.js.map +1 -1
  66. package/dist/progress/progress.d.ts +3 -1
  67. package/dist/progress/progress.d.ts.map +1 -1
  68. package/dist/progress/read-progress.d.ts.map +1 -1
  69. package/dist/progress/read-progress.js +7 -2
  70. package/dist/progress/read-progress.js.map +1 -1
  71. package/dist/version.d.ts +1 -1
  72. package/dist/version.js +1 -1
  73. package/package.json +4 -4
  74. package/templates/architecture/extractable.declared.spec.ts.tpl +2 -2
  75. package/templates/architecture/extractable.manual.spec.ts.tpl +2 -2
  76. package/templates/architecture/extractable.tsyringe.spec.ts.tpl +2 -2
  77. package/templates/architecture/hosting.declared.spec.ts.tpl +69 -0
  78. package/templates/architecture/hosting.manual.spec.ts.tpl +57 -0
  79. package/templates/architecture/hosting.tsyringe.spec.ts.tpl +69 -0
  80. package/templates/init/docker/env.example.tpl +8 -0
  81. package/templates/init/gitignore.tpl +3 -0
  82. package/templates/init/main.ts.tpl +27 -20
  83. package/templates/init/platform/audit/audit.module.tsyringe.ts.tpl +11 -3
  84. package/templates/init/platform/composition/compose-application.manual.ts.tpl +25 -4
  85. package/templates/init/platform/composition/compose-application.tsyringe.ts.tpl +47 -65
  86. package/templates/init/platform/composition/context-selection.tsyringe.ts.tpl +17 -0
  87. package/templates/init/platform/composition/lay-foundations.manual.ts.tpl +15 -0
  88. package/templates/init/platform/composition/platform-options.manual.ts.tpl +9 -0
  89. package/templates/init/platform/composition/routes-of.tsyringe.ts.tpl +51 -0
  90. package/templates/init/platform/config/app-config.ts.tpl +7 -0
  91. package/templates/init/platform/config/load-config.ts.tpl +25 -0
  92. package/templates/init/platform/files/files.module.tsyringe.ts.tpl +6 -2
  93. package/templates/init/platform/jobs/job-settings.ts.tpl +13 -3
  94. package/templates/init/platform/privacy/privacy.module.tsyringe.ts.tpl +9 -6
  95. package/templates/init/platform/redis/open-redis.ts.tpl +13 -8
  96. package/templates/job/job.declared.ts.tpl +1 -1
  97. package/templates/job/job.spec.buses.ts.tpl +3 -0
  98. package/templates/job/job.spec.tsyringe.ts.tpl +29 -1
  99. package/templates/job/wiring.manual.tpl +3 -0
  100. package/templates/job/wiring.tsyringe.tpl +1 -1
  101. package/templates/pipeline/biome.json.tpl +7 -0
  102. package/templates/pipeline/knip.json.tpl +1 -0
  103. package/templates/pipeline/package-scripts.json +1 -1
  104. package/templates/service/compose.tpl +1 -1
  105. package/templates/service/extracted-name.tpl +2 -0
  106. package/templates/service/extracted.declared.tpl +6 -0
  107. package/templates/service/extracted.manual.tpl +2 -0
  108. package/templates/service/extracted.tsyringe.tpl +6 -0
  109. package/templates/service/main.ts.tpl +5 -1
  110. package/templates/worker/main.ts.tpl +20 -13
package/CHANGELOG.md CHANGED
@@ -4,6 +4,42 @@ What each version changes for someone who uses the kit. The packages of `package
4
4
  together, under one version; the notes of each [GitHub release](https://github.com/gbourgeat/ddd-ts-kit/releases)
5
5
  list the pull requests behind it.
6
6
 
7
+ ## 0.93.0
8
+
9
+ **The behaviour pages of `ddd-ts-kit docs` no longer open a rule with the row ids and criteria of its title.** A regression spec named `#FIX1 escalates ...` or an acceptance scenario named `#US1.04 AC1 a member declares ...` is written in `docs/behaviour/` as `escalates ...` and `a member declares ...`, read with the patterns `acceptance` uses for rows and criteria; the rest of the title is kept as it is.
10
+
11
+ To move: run `ddd-ts-kit docs` once to rewrite the pages.
12
+
13
+ **`todo` and `status` no longer count an `it.todo` in `test/architecture/extractable.spec.ts`.** The spec kept one in the branch for a project with no context, which never runs once a context exists, so a gate that wants nothing left had to explain it away. The branch is now a passing case, `has no context to wire alone yet`, in the three variants of the template (tsyringe, declared, manual); Jest still gets no table without rows.
14
+
15
+ To move: a project already generated keeps its `it.todo` until the spec is regenerated, or replace that line by `it('has no context to wire alone yet', () => expect(contexts).toHaveLength(0));`.
16
+
17
+ **`measures` reads a history of any size and finds the merge that closes a story, whatever its subject.** `runGit` no longer stops at the 1 MB of output `spawnSync` allows by default (a git that cannot answer is now an error that says so, not an empty answer that made every story read "not committed"), and `branchCommits` asks the files only of `docs/architecture` and `test/acceptance`, so a store versioned once in the history does not weigh on it. The lead time ends at the close of the story: the first commit of the first-parent history that contains the last commit of the story, whether a merge commit with any subject or a squash; the merge of the trunk into the story branch (`merge-trunk`) is never taken for it, and a story with no report is not closed.
18
+
19
+ **`status` no longer repeats the `Next:` line of the plan after the build has moved on.** At step 7 (the build) no skill rewrites that line row by row, so it kept naming the first row after all of them were done. `status` now derives the next step from `docs/architecture/slices.md`: the next row ready on the trunk, or `7 build done: close step 7 in docs/architecture/plan.md (Next: done)` once every row is done. The line of the plan is printed beside it when the two disagree, and `planNext` carries it in `--json` (`next` is the derived one). The `start` skill says that at step 7 the line is derived.
20
+
21
+ **The `biome.json`, `knip.json` and `.gitignore` of `init` ignore what is not the project.** The Claude Code sandbox leaves empty files in the project (`.mcp.json`, `.claude/launch.json`, `.claude/settings.local.json`, dotfiles), and installs under it may write a pnpm store there: `biome format` failed on the empty JSON files and warned on the broken links of `.pnpm-store/`, and Knip failed loading the empty `.mcp.json`. `biome.json` now reads the git ignore file and skips `.claude` and `.mcp.json`, `knip.json` sets `"mcp": false`, and `.gitignore` lists `.pnpm-store/` with pnpm. The guide on sandboxing agents says which files the sandbox leaves, and the read-only `.git/config.lock` to delete outside it.
22
+
23
+ To move: in a project written before this change, add `"vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": true }` and the entries `"!**/.claude"` and `"!.mcp.json"` to `biome.json`, `"mcp": false` to `knip.json`, and `.pnpm-store/` to `.gitignore` with pnpm (or run `init --force`, which rewrites the files).
24
+
25
+ **`generate service` writes a docker-compose.yml that Docker reads.** The compose service took `"${{service.portVariable}}:3000"` literally, because the templates keep every `${{ ... }}` for the expressions of a GitHub workflow, and `docker compose config` refused it. The port is now `"${PAGING_PORT:-3001}:3000"`: the service listens on the variable of its context, 3001 by default.
26
+
27
+ To move: a compose file written by an earlier `generate service` holds `${{service.portVariable}}`; replace it with `${<CONTEXT>_PORT:-3001}` (the context in upper snake case).
28
+
29
+ **A locked regression spec of a fix can be amended by the session, and `acceptance --lock` refuses a spec that fails the formatter or the linter.** The guard used to refuse every write to a locked regression spec, by the session and by sub-agents alike, so the `acceptance-judge` agent never had a new version to rule on and a spec that failed the lint could never be corrected. Now the main session of the fix may write a new version (with the editor tools or a formatter or `eslint --fix` in the shell), a sub-agent still may not; `npx ddd-ts-kit acceptance <code>` reports the change since the lock, and `--lock` takes it only with an `amend` verdict of the judge (a change of layout alone needs none, the fingerprint ignores white space). `acceptance <code> --lock` also runs the formatter (the `format` script, in check mode) and the linter (the `lint` script) of the project on the files it locks, the regression specs of a fix or the acceptance spec of a story, and refuses to lock while they fail, naming the file and what the tool reports. A project without those scripts or tools is locked as before. The `fix`, `story` and `testing` skills say to format and lint the spec before locking, and what the session does when a locked spec turns out wrong.
30
+
31
+ **`generate job` writes a job that runs once per tenant in a project with tenancy, and `init` gives the scheduler the tenants.** A job without `tenancy` is global: it runs in no tenant, its command carries a system actor that names none, and a tenant-scoped repository threw `NoCurrentTenantError` on every real run, while the generated spec (fakes, a recorded command) stayed green. Under `stack.tenancy`, `generate job` now writes `tenancy: 'per-tenant'` (`--global` writes `tenancy: 'global'` for work across tenants, refused in a project without tenancy), says which it wrote, and its spec runs the occurrence for two tenants. `init` reads `TENANTS` (comma separated tenant ids, validated at start) into `config.tenants`, passes it as `tenants` to `composeApplication` and binds an `InMemoryTenantDirectory` on the scheduler, so a hand-written `tenancy: 'per-tenant'` no longer throws `InvalidJobScheduleError` at boot. `src/main.ts`, the worker and the services pass `tenants: config.tenants`. On tsyringe, `compose-application.ts` was at the size limit of the checker: `ContextSelection` now lives in `composition/context-selection.ts` and, with an HTTP framework, `routesOf` in `composition/routes-of.ts`.
32
+
33
+ To move: in a project under tenancy, add `tenancy: 'per-tenant'` to each `@Scheduled` (or the `tenancy` key of `platform.jobs.register` on a hand-wired platform) whose use case reads a tenant-scoped repository, list the tenants in `TENANTS` of the environment, and run `ddd-ts-kit init --force` to receive `config.tenants`, the `tenants` option and the binding (or add them by hand: `tenants: new InMemoryTenantDirectory(options.tenants ?? [])` in `kernelModule`, `tenants: config.tenants` in the entry points).
34
+
35
+ **`generate service` takes the context out of the application of `src/main.ts` and the worker.** The entry point of the service composed the context, but `everyContext` still listed it and `src/main.ts` composed `everyContext`, so the API and the service both subscribed its durable consumers, drove its process store and scheduled its jobs. The root now exports `everyContext` (the full list: the tools, the generated contracts, the end-to-end tests) and `hostedContexts` (every context but those run as services, read from the `extracted` regions `generate service` fills with the module and the routes of the context); `src/main.ts` and the worker compose `hostedContexts`, and `jobSettings(env)` leaves out the jobs of the extracted contexts. `generate service` also writes `test/architecture/hosting.spec.ts`, which composes both roots and fails when a module, a consumer, a process or a job of a service is registered in the whole application, when a consumer is registered twice, or when the entry point of a service does not leave the jobs of the platform to the whole application.
36
+
37
+ To move: run `ddd-ts-kit init --force` (the new root, `main.ts`, the worker), pass `hostedContexts` as the third argument of `composeApplication` in `src/main.ts` and `src/apps/worker/main.ts`, and for each context already run as a service add its module (its name on tsyringe, its `<context>Module` on a hand-wired platform) and its routes to the `extracted` regions of `compose-application.ts`, its name to the `extracted` region of `src/platform/jobs/job-settings.ts`; copy `test/architecture/hosting.spec.ts` from a fresh project, whose `extracted` region lists the services.
38
+
39
+ **A service no longer runs the jobs of the platform, and the processes of one deployment share the namespace of their Redis keys.** `composeApplication` always added the audit and privacy modules, so a service written by `generate service` scheduled `audit.archive` and `privacy.purge-expired` (and `files.purge-staged`) with the defaults of the kernel, `enabled: true`, since `jobSettings(env, '<context>')` kept only `<context>.*`: `JOB_AUDIT_ARCHIVE_ENABLED=false` did not reach it, and an archive that removes entries from the database ran onto the disk of the service. The platform jobs now belong to the whole application: `ApplicationOptions.platformJobs` (default `true`) is `false` in the entry point of a service, and `auditModule`, `privacyModule` and `filesModule` (or `registerPlatformJobs` on a hand-wired platform) register their job only when it is on. The lock, the cache, the rate limiter, the relay signal and the Redis job store took `OTEL_SERVICE_NAME`, which a deployment sets per container, so the API and a service held different locks and ran the same occurrence on one database: they now take `DEPLOYMENT_NAME` (`config.deploymentName`, the project name when left out), while `OTEL_SERVICE_NAME` keeps naming the container in the traces. `test/architecture/hosting.spec.ts` composes the root of a service and fails when it registers a job of the platform or of another context.
40
+
41
+ To move: set the same `DEPLOYMENT_NAME` in every container of a deployment (the cache, the lock and the job store keep their old keys only if it equals the old `OTEL_SERVICE_NAME` of the API); in each `src/apps/<context>/main.ts` add `platformJobs: false` beside `jobs`; run `ddd-ts-kit init --force` for the modules and the configuration, and `openRedis(config)` now reads `config.deploymentName`.
42
+
7
43
  ## 0.92.0
8
44
 
9
45
  **What a method of a Nest controller takes is its signature too: `@Body() body: IssueInvoiceBody` is read into the generated `<context>.controllers.ts`, and `@KitRoute` no longer gives `request`.**
package/README.fr.md CHANGED
@@ -1,5 +1,5 @@
1
1
  [English](README.md) · **Français**
2
- <!-- translation-of: README.md sha256:f9728c17b021be67 -->
2
+ <!-- translation-of: README.md sha256:625e334eec9dcf53 -->
3
3
 
4
4
  # ddd-ts-kit
5
5
 
@@ -962,7 +962,7 @@ Régénère ce qui dérive de la configuration et du code, et rien d'autre :
962
962
  par l'équipe garde ses lignes, le bloc ajouté à leur suite ; sans aucun propriétaire, rien
963
963
  n'est écrit.
964
964
 
965
- `--behaviour` n'écrit que les pages de `docs/behaviour/`, tout autre document généré laissé tel quel : c'est ce que lance le *hook* de pre-commit quand une *spec* est indexée ; avec `--check`, seules ces pages sont comparées.
965
+ `--behaviour` n'écrit que les pages de `docs/behaviour/`, tout autre document généré laissé tel quel : c'est ce que lance le *hook* de pre-commit quand une *spec* est indexée ; avec `--check`, seules ces pages sont comparées. Une règle est écrite comme son titre sans les identifiants de ligne et les critères qui l'ouvrent (`#FIX1 `, `#US1.04 AC1 `), qui la datent du changement qui l'a apportée et ne disent rien à un lecteur métier.
966
966
 
967
967
  `--stored-events` enregistre aussi dans `stored-events.lock.json` la forme de chaque version d'un
968
968
  événement stocké déclarée dans les codecs de `infrastructure/persistence/`, sans jamais réécrire
@@ -1232,7 +1232,7 @@ ddd-ts-kit todo [<context>]
1232
1232
  `status` affiche la ligne `Next:` de `docs/architecture/plan.md`, les lignes de
1233
1233
  `docs/architecture/slices.md` par statut et par responsable, et par contexte les `TODO(domain)`,
1234
1234
  `TODO(platform)` et `it.todo` restants, puis ceux hors des contextes. Un fichier manquant n'est
1235
- pas une erreur. Chaque ligne qui n'est pas faite dit si elle peut commencer : prête sur le tronc
1235
+ pas une erreur. Quand le plan est à l'étape 7 (la construction), la ligne `Next:` est déduite des lignes (la prochaine ligne prête sur le tronc, ou `7 build done` quand toutes sont faites) et la ligne du plan est affichée à côté, `planNext` dans `--json`. Chaque ligne qui n'est pas faite dit si elle peut commencer : prête sur le tronc
1236
1236
  quand toutes ses dépendances sont faites, prête sur une branche quand chaque dépendance non faite
1237
1237
  est une ligne confiée à un *worker* dont le *worktree* a des *commits* d'avance sur sa base (les
1238
1238
  `rows` de son `.ddd-ts-kit/worker.json`, tels que `status --workers` les lit), et en attente
@@ -1240,7 +1240,7 @@ sinon, avec les identifiants qu'elle attend. Une story ou un jalon dont toutes l
1240
1240
  faites mais que des marqueurs qui lui appartiennent gardent ouvert a sa propre ligne (seuls les
1241
1241
  marqueurs qui peuvent garder une telle story ouverte passent par git blame, un appel par fichier), avec la commande qui les liste :
1242
1242
  `story M1: every row done, 3 markers left: npx ddd-ts-kit story-check M1` (voir
1243
- [story-check](#story-check)). `--json` affiche `{ next, slices, remaining }` :
1243
+ [story-check](#story-check)). `--json` affiche `{ next, planNext, slices, remaining }` :
1244
1244
  `next` et `slices` valent `null` quand leur fichier manque, `slices` contient
1245
1245
  `{ file, rows, byStatus, byOwner, duplicates, unscoped, unclosed }`, `unclosed` valant
1246
1246
  `[{ story, markers, command }]`, une ligne non faite portant
@@ -1377,11 +1377,16 @@ chacun) et refuse tant qu'une spec listée manque ou ne contient aucun test. Un
1377
1377
  changé ou supprimé est signalé comme l'est un scénario changé, sous le sujet
1378
1378
  `test "<title>" of <file>` avec son empreinte, jusqu'à ce que l'agent `acceptance-judge` laisse
1379
1379
  passer cette version, le `## Statement` du correctif étant le critère ; un nouveau test n'a
1380
- besoin que d'un nouveau verrou. `--gate passing` tient que chaque test verrouillé est là,
1380
+ besoin que d'un nouveau verrou. `--lock` lance aussi le formateur (le script `format`, en mode
1381
+ vérification) et le *linter* (le script `lint`) du projet sur les fichiers qu'il verrouille, les
1382
+ *specs* de régression d'un correctif ou la *spec* d'acceptation d'une *story*, et sur eux seuls : il
1383
+ refuse, en nommant le fichier et ce que l'outil signale, tant qu'ils échouent, puisqu'un fichier
1384
+ verrouillé ne se touche plus. Un projet sans ces scripts ni ces outils est verrouillé comme avant.
1385
+ `--gate passing` tient que chaque test verrouillé est là,
1381
1386
  inchangé et plus enveloppé dans `pending(...)` ; c'est le lanceur de tests, pas cette commande,
1382
1387
  qui prouve qu'il passe. La garde du plugin lit le même verrou dans le *worktree* d'un correctif
1383
1388
  (`"kind": "fix"` dans `.ddd-ts-kit/story.json`) : elle ouvre le code dès que le verrou existe
1384
- et refuse toute modification d'une spec verrouillée (skill `fix`,
1389
+ et refuse toute modification d'une spec verrouillée par un sous-agent, la session en écrivant une nouvelle version sur laquelle le juge se prononce (skill `fix`,
1385
1390
  [parcours d'une story](../../docs/guides/story-workflow.fr.md)).
1386
1391
 
1387
1392
  ```
@@ -1549,7 +1554,7 @@ n'écrit rien et ne demande rien à la plateforme.
1549
1554
  |---|---|
1550
1555
  | temps de conception | du premier *commit* de `docs/architecture/stories/<code>.md` au *commit* de `test/acceptance/<code>.acceptance.lock.json` |
1551
1556
  | temps de construction | du *commit* du verrou au premier *commit* dont le `## Report` contient du texte |
1552
- | délai de livraison | du premier *commit* du fichier de la *story* au *commit* de la branche courante dont le sujet nomme `story/<code>` (un *commit* de fusion d'abord, sinon un *commit* de *squash* qui nomme la branche) ; `open` sans lui |
1557
+ | délai de livraison | du premier *commit* du fichier de la *story* à la clôture : le premier *commit* de l'historique en premier parent de la branche courante qui contient le dernier *commit* de la *story*, quel que soit son sujet (une fusion, un *squash* ; la fusion du tronc dans la branche de la *story* n'est jamais la clôture) ; `open` sans rapport ou sans clôture |
1553
1558
  | retravail des exigences | les *commits* qui ont changé `## Acceptance criteria` après le premier *commit* portant un *trailer* `Slice: <code>.<n>` ; les amendements du verrou (chacun un verdict `amend`) ; les verdicts `refuse` de `test/acceptance/verdicts/` |
1554
1559
  | décisions provisoires | les lignes `D<n>` du fichier de la *story* |
1555
1560
  | compromis | les éléments sous `### Compromises` du rapport |
package/README.md CHANGED
@@ -917,7 +917,7 @@ Regenerates what is derived from the config and the code, and nothing else:
917
917
  platform owners. A file the team wrote keeps its lines, the block appended after them; without
918
918
  any owner nothing is written.
919
919
 
920
- `--behaviour` writes the pages of `docs/behaviour/` alone, every other generated document left as it is: what the pre-commit hook runs when a spec is staged; with `--check`, those pages alone are compared.
920
+ `--behaviour` writes the pages of `docs/behaviour/` alone, every other generated document left as it is: what the pre-commit hook runs when a spec is staged; with `--check`, those pages alone are compared. A rule is written as its title without the row ids and criteria it opens with (`#FIX1 `, `#US1.04 AC1 `), which date it to the change that brought it and mean nothing to a reader of the business.
921
921
 
922
922
  `--stored-events` also records in `stored-events.lock.json` the shape of each version of a stored
923
923
  event declared in the codecs of `infrastructure/persistence/`, never rewriting a recorded version:
@@ -1172,7 +1172,7 @@ ddd-ts-kit todo [<context>]
1172
1172
  `status` prints the `Next:` line of `docs/architecture/plan.md`, the rows of
1173
1173
  `docs/architecture/slices.md` by status and by owner, and per context the `TODO(domain)`,
1174
1174
  `TODO(platform)` and `it.todo` left, then those outside the contexts. A missing file is not an
1175
- error. Each row not done says whether it can start: ready on the trunk when every dependency is
1175
+ error. When the plan sits at step 7 (the build) the `Next:` line is derived from the rows (the next row ready on the trunk, or `7 build done` once every row is done) and the line of the plan is printed beside it, `planNext` in `--json`. Each row not done says whether it can start: ready on the trunk when every dependency is
1176
1176
  done, ready on a branch when each dependency not done is a row briefed to a worker whose worktree
1177
1177
  has commits ahead of its base (the `rows` of its `.ddd-ts-kit/worker.json`, as `status --workers`
1178
1178
  reads them), and waiting otherwise, with the ids it waits for. A story or a milestone whose rows
@@ -1306,10 +1306,14 @@ write; a test the runner puts aside is reported whatever the gate), and that the
1306
1306
  A locked test changed or removed is reported as a changed scenario is, as the subject
1307
1307
  `test "<title>" of <file>` with its fingerprint, until the `acceptance-judge` agent lets that
1308
1308
  version through, the `## Statement` of the fix being the criterion; a new test only needs locking
1309
- again. `--gate passing` holds that each locked test is there, unchanged and no longer wrapped in
1309
+ again. `--lock` also runs the formatter (the `format` script, in check mode) and the linter (the
1310
+ `lint` script) of the project on the files it locks, a fix's regression specs or a story's
1311
+ acceptance spec, and only on those: it refuses, naming the file and what the tool reports, while they
1312
+ fail, since a locked file can no longer be touched. A project without those scripts or tools is locked
1313
+ as before. `--gate passing` holds that each locked test is there, unchanged and no longer wrapped in
1310
1314
  `pending(...)`; the test runner, not this command, proves it passes. The guard of the plugin reads
1311
1315
  the same lock in the worktree of a fix (`"kind": "fix"` in `.ddd-ts-kit/story.json`): it opens the
1312
- code once the lock exists and refuses every edit of a locked spec (skill `fix`,
1316
+ code once the lock exists and refuses every edit of a locked spec by a sub-agent, the session writing a new version for the judge to rule on (skill `fix`,
1313
1317
  [story workflow](../../docs/guides/story-workflow.md)).
1314
1318
 
1315
1319
  ```
@@ -1467,7 +1471,7 @@ nothing and asks nothing of the platform.
1467
1471
  |---|---|
1468
1472
  | design time | the first commit of `docs/architecture/stories/<code>.md` to the commit of `test/acceptance/<code>.acceptance.lock.json` |
1469
1473
  | build time | the lock commit to the first commit whose `## Report` holds text |
1470
- | lead time | the first commit of the story file to the commit of the current branch whose subject names `story/<code>` (a merge commit first, else a squash commit that names the branch); `open` without one |
1474
+ | lead time | the first commit of the story file to the close: the first commit of the first-parent history of the current branch that contains the last commit of the story, whatever its subject (a merge, a squash; the merge of the trunk into the story branch is never it); `open` without a report or without a close |
1471
1475
  | requirements rework | the commits that changed `## Acceptance criteria` after the first commit carrying a `Slice: <code>.<n>` trailer; the amendments of the lock (each an `amend` verdict); the `refuse` verdicts of `test/acceptance/verdicts/` |
1472
1476
  | provisional decisions | the `D<n>` lines of the story file |
1473
1477
  | compromises | the items under `### Compromises` of the report |
@@ -0,0 +1,25 @@
1
+ /** What a tool answered: its exit code and everything it printed. */
2
+ interface ToolRun {
3
+ readonly status: number;
4
+ readonly output: string;
5
+ }
6
+ /** Runs a program with node's arguments in a directory; the seam that keeps the checks testable without real tools. */
7
+ export type RunTool = (program: string, args: readonly string[], cwd: string) => ToolRun;
8
+ /** What the project's own tools found on the files about to be locked, and what was left unchecked and why. */
9
+ export interface LockedFilesCheck {
10
+ readonly findings: readonly string[];
11
+ readonly unchecked: readonly string[];
12
+ }
13
+ /** What runs the programs, and the command line of the kit that `lint` is run through; both replaced by a test. */
14
+ export interface Tools {
15
+ readonly run?: RunTool;
16
+ readonly cli?: string | undefined;
17
+ }
18
+ /**
19
+ * Runs the formatter and the linter of the project, as its `format` and `lint` scripts name them, on
20
+ * the files a lock is about to make untouchable, and only on those. A tool the project has no script
21
+ * for, or has not installed, checks nothing and is listed as unchecked: the lock goes as it did.
22
+ */
23
+ export declare function checkLockedFiles(root: string, files: readonly string[], tools?: Tools): LockedFilesCheck;
24
+ export {};
25
+ //# sourceMappingURL=check-locked-files.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-locked-files.d.ts","sourceRoot":"","sources":["../../src/acceptance/check-locked-files.ts"],"names":[],"mappings":"AAMA,qEAAqE;AACrE,UAAU,OAAO;IACf,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,uHAAuH;AACvH,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;AAEzF,+GAA+G;AAC/G,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;CACvC;AAED,mHAAmH;AACnH,MAAM,WAAW,KAAK;IACpB,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACnC;AAKD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,MAAM,EAAE,EAAE,KAAK,GAAE,KAAU,GAAG,gBAAgB,CAY5G"}
@@ -0,0 +1,84 @@
1
+ import { spawnSync } from 'node:child_process';
2
+ import fs from 'node:fs';
3
+ import path from 'node:path';
4
+ import { isRecord } from '../check/support/is-record.js';
5
+ import { findProjectFormatter } from '../migration/find-project-formatter.js';
6
+ /** Enough of a failing tool to read the cause. */
7
+ const TAIL_LINES = 40;
8
+ /**
9
+ * Runs the formatter and the linter of the project, as its `format` and `lint` scripts name them, on
10
+ * the files a lock is about to make untouchable, and only on those. A tool the project has no script
11
+ * for, or has not installed, checks nothing and is listed as unchecked: the lock goes as it did.
12
+ */
13
+ export function checkLockedFiles(root, files, tools = {}) {
14
+ if (files.length === 0) {
15
+ return { findings: [], unchecked: [] };
16
+ }
17
+ const { run = runWithNode, cli = process.argv[1] } = tools;
18
+ const checks = [formatCheck(root, files, run), lintCheck({ root, files, run, cli })];
19
+ return {
20
+ findings: checks.flatMap((check) => (check.finding === undefined ? [] : [check.finding])),
21
+ unchecked: checks.flatMap((check) => (check.unchecked === undefined ? [] : [check.unchecked])),
22
+ };
23
+ }
24
+ function formatCheck(root, files, run) {
25
+ const formatter = findProjectFormatter(root);
26
+ if (typeof formatter === 'string') {
27
+ return { unchecked: `format: ${formatter}` };
28
+ }
29
+ const checking = formatter.args.map((arg) => (arg === '--write' && formatter.name === 'Prettier' ? '--check' : arg));
30
+ const args = formatter.name === 'Biome' ? checking.filter((arg) => arg !== '--write') : checking;
31
+ const result = run(process.execPath, [formatter.bin, ...args, ...files], root);
32
+ return result.status === 0
33
+ ? {}
34
+ : { finding: `${formatter.name} wants these files formatted (\`npm run format\`):\n${tail(result.output)}` };
35
+ }
36
+ function lintCheck({ root, files, run, cli }) {
37
+ const script = scriptOf(root, 'lint');
38
+ if (script === undefined) {
39
+ return { unchecked: 'lint: package.json has no `lint` script' };
40
+ }
41
+ const program = lintProgram(root, script, cli);
42
+ if (typeof program === 'string') {
43
+ return { unchecked: `lint: ${program}` };
44
+ }
45
+ const result = run(process.execPath, [...program, ...files], root);
46
+ return result.status === 0
47
+ ? {}
48
+ : { finding: `The linter reports these files (\`npm run lint\`):\n${tail(result.output)}` };
49
+ }
50
+ /** The node arguments that lint the given files as the `lint` script does, or why they cannot be found. */
51
+ function lintProgram(root, script, cli) {
52
+ if (!resolves(root, 'eslint')) {
53
+ return 'ESLint is not installed (run `npm install`)';
54
+ }
55
+ if (/\bddd-ts-kit\s+lint\b/.test(script)) {
56
+ return cli === undefined ? 'the ddd-ts-kit command line is not known' : [cli, 'lint', '--no-cache'];
57
+ }
58
+ const bin = path.join(root, 'node_modules', 'eslint', 'bin', 'eslint.js');
59
+ return /\beslint\b/.test(script) && fs.existsSync(bin)
60
+ ? [bin, '--max-warnings', '0']
61
+ : 'the `lint` script does not run ESLint';
62
+ }
63
+ function resolves(root, name) {
64
+ return fs.existsSync(path.join(root, 'node_modules', name, 'package.json'));
65
+ }
66
+ function scriptOf(root, name) {
67
+ try {
68
+ const manifest = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8'));
69
+ const scripts = isRecord(manifest) ? manifest['scripts'] : undefined;
70
+ const script = isRecord(scripts) ? scripts[name] : undefined;
71
+ return typeof script === 'string' ? script : undefined;
72
+ }
73
+ catch {
74
+ return undefined;
75
+ }
76
+ }
77
+ function tail(output) {
78
+ return output.trimEnd().split('\n').slice(-TAIL_LINES).join('\n');
79
+ }
80
+ function runWithNode(program, args, cwd) {
81
+ const run = spawnSync(program, [...args], { cwd, encoding: 'utf8', maxBuffer: 1024 * 1024 * 64 });
82
+ return { status: run.status ?? 1, output: `${run.stdout}${run.stderr}${run.error?.message ?? ''}` };
83
+ }
84
+ //# sourceMappingURL=check-locked-files.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-locked-files.js","sourceRoot":"","sources":["../../src/acceptance/check-locked-files.ts"],"names":[],"mappings":"AAA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,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC,MAAM,GAAG,GAAG,CAAC,MAAM,GAAG,GAAG,CAAC,KAAK,EAAE,OAAO,IAAI,EAAE,EAAE,EAAE,CAAC;AACtG,CAAC"}
@@ -1,4 +1,8 @@
1
1
  import type { Scenario } from './scenario.js';
2
+ /** A row id as a title names it: `#US5.02`, `#M2.07`, `#4.15`. */
3
+ export declare const ROW: RegExp;
4
+ /** An acceptance criterion of the story as a title names it: `AC1`. */
5
+ export declare const CRITERION: RegExp;
2
6
  /** The scenarios of an acceptance spec, in the order of the file. */
3
7
  export declare function scenariosIn(source: string): Scenario[];
4
8
  //# sourceMappingURL=scenarios-in.d.ts.map
@@ -1 +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,YAAY,CAAC;AAgB1D,qEAAqE;AACrE,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,EAAE,CA4BtD"}
1
+ {"version":3,"file":"scenarios-in.d.ts","sourceRoot":"","sources":["../../src/acceptance/scenarios-in.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAiB,MAAM,YAAY,CAAC;AAQ1D,kEAAkE;AAClE,eAAO,MAAM,GAAG,QAA6B,CAAC;AAE9C,uEAAuE;AACvE,eAAO,MAAM,SAAS,QAAe,CAAC;AAItC,qEAAqE;AACrE,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,EAAE,CA4BtD"}
@@ -6,9 +6,9 @@ const CALL = /\b(?:it|test)(?:\.(todo|skip|only|fails|failing|concurrent))?\(\s*
6
6
  /** `pending(` right after the title: the body waits for its code. */
7
7
  const WRAPPER = /^\s*,\s*pending\s*\(/;
8
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;
9
+ export const ROW = /#([A-Za-z0-9][\w.-]*\w)/g;
10
10
  /** An acceptance criterion of the story as a title names it: `AC1`. */
11
- const CRITERION = /\bAC\d+\b/g;
11
+ export const CRITERION = /\bAC\d+\b/g;
12
12
  const SKIPPED = new Set(['skip', 'fails', 'failing']);
13
13
  /** The scenarios of an acceptance spec, in the order of the file. */
14
14
  export function scenariosIn(source) {
@@ -1 +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,oBAAoB,CAAC;AAE1C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,sHAAsH;AACtH,MAAM,IAAI,GAAG,0EAA0E,CAAC;AAExF,qEAAqE;AACrE,MAAM,OAAO,GAAG,sBAAsB,CAAC;AAEvC,kEAAkE;AAClE,MAAM,GAAG,GAAG,0BAA0B,CAAC;AAEvC,uEAAuE;AACvE,MAAM,SAAS,GAAG,YAAY,CAAC;AAE/B,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC;AAEtD,qEAAqE;AACrE,MAAM,UAAU,WAAW,CAAC,MAAc;IACxC,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC;IAC7B,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IACzB,MAAM,MAAM,GAAG,IAAI,GAAG,CAAuB,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IACtG,MAAM,OAAO,GAAG,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAE7C,OAAO,CAAC,GAAG,IAAI,CA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E,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAC5E,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"acceptance.d.ts","sourceRoot":"","sources":["../../src/commands/acceptance.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGzC;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,EAAE,OA+B/B,CAAC"}
1
+ {"version":3,"file":"acceptance.d.ts","sourceRoot":"","sources":["../../src/commands/acceptance.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGzC;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,EAAE,OA+B/B,CAAC"}
@@ -1,3 +1,4 @@
1
+ import { checkLockedFiles } from '../acceptance/check-locked-files.js';
1
2
  import { ACCEPTANCE_GATES } from '../acceptance/acceptance-gate.js';
2
3
  import { countsFor } from '../acceptance/counts-for.js';
3
4
  import { formatAcceptance } from '../acceptance/format-acceptance.js';
@@ -43,6 +44,7 @@ function lock(ws, { asked, story, json }, io) {
43
44
  throw new CliError('--lock locks the acceptance of one story.', 'Name it: `npx ddd-ts-kit acceptance US5 --lock`.');
44
45
  }
45
46
  const locked = lockAcceptance(ws, { story, on: new Date().toISOString().slice(0, 10) });
47
+ refuseUnchecked(ws, story);
46
48
  ws.commit(false);
47
49
  io.out(json
48
50
  ? JSON.stringify({ story: story.story, ...locked }, null, 2)
@@ -52,6 +54,18 @@ function lock(ws, { asked, story, json }, io) {
52
54
  ].join('\n'));
53
55
  return 0;
54
56
  }
57
+ /**
58
+ * A locked file can no longer be touched, so the lock is refused while the files it makes untouchable
59
+ * fail the formatter or the linter of the project: the spec of a story, or the regression specs of a fix.
60
+ */
61
+ function refuseUnchecked(ws, story) {
62
+ const files = story.regression?.filter(({ found }) => found).map(({ file }) => file) ?? [story.file ?? ''];
63
+ const named = files.filter((file) => file !== '');
64
+ const checked = checkLockedFiles(ws.root, named);
65
+ if (checked.findings.length > 0) {
66
+ throw new CliError(`${named.join(', ')} fails the checks of the project, and a locked file can no longer be changed:\n${checked.findings.join('\n')}`, 'Run the formatter and the linter on the file, fix what they report (`npm run format`, `npm run lint -- <file>`), then lock again.');
67
+ }
68
+ }
55
69
  /** What a lock recorded: the regression tests of a fix, or the scenarios of a story. */
56
70
  function lockedWhat({ scenarios, tests }) {
57
71
  return tests > 0 && scenarios === 0
@@ -1 +1 @@
1
- {"version":3,"file":"acceptance.js","sourceRoot":"","sources":["../../src/commands/acceptance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAuB,MAAM,+BAA+B,CAAC;AACtF,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAe,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAIxC;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAY,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE;IACrD,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE;QACjC,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACxB,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE;KAC1C,CAAC,CAAC;IAEH,MAAM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C3D,CAAC;AAED,SAAS,MAAM,CAAC,IAAwB;IACtC,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,IAAI,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC;IAE9D,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,MAAM,IAAI,QAAQ,CAAC,iBAAiB,IAAI,IAAI,EAAE,eAAe,gBAAgB,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IACxG,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -72,6 +72,7 @@ const OPTIONS = {
72
72
  search: SWITCH,
73
73
  kind: TEXT,
74
74
  decorators: SWITCH,
75
+ global: SWITCH,
75
76
  deviation: TEXT,
76
77
  phase: TEXT,
77
78
  event: TEXT,
@@ -170,6 +171,7 @@ function switchesOf(args) {
170
171
  tenantScoped: args.flag('tenant-scoped'),
171
172
  search: args.flag('search'),
172
173
  decorators: args.flag('decorators'),
174
+ global: args.flag('global'),
173
175
  mapper: args.flag('mapper'),
174
176
  serializer: args.flag('serializer'),
175
177
  eventSourced: args.flag('event-sourced'),
@@ -1 +1 @@
1
- {"version":3,"file":"generate.js","sourceRoot":"","sources":["../../src/commands/generate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAA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;AACJ,CAAC"}
@@ -1,3 +1,7 @@
1
- /** What git prints for a command run in `directory`; undefined when it fails or is not installed. Only the user's own repository is read or changed. */
1
+ /**
2
+ * What git prints for a command run in `directory`; undefined when git answers with a failure
3
+ * status or is not installed. A git that could not answer at all (its output over the buffer, a
4
+ * timeout) is an error: it is not an empty answer. Only the user's own repository is read or changed.
5
+ */
2
6
  export declare function runGit(directory: string, args: readonly string[]): string | undefined;
3
7
  //# sourceMappingURL=run-git.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"run-git.d.ts","sourceRoot":"","sources":["../../src/commit/run-git.ts"],"names":[],"mappings":"AAEA,wJAAwJ;AACxJ,wBAAgB,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAIrF"}
1
+ {"version":3,"file":"run-git.d.ts","sourceRoot":"","sources":["../../src/commit/run-git.ts"],"names":[],"mappings":"AAMA;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAmBrF"}
@@ -1,7 +1,24 @@
1
1
  import { spawnSync } from 'node:child_process';
2
- /** What git prints for a command run in `directory`; undefined when it fails or is not installed. Only the user's own repository is read or changed. */
2
+ import { CliError } from '../cli-error.js';
3
+ /** A history can print far more than the 1 MB spawnSync allows by default; the merge takes the same room. */
4
+ const MAX_BUFFER = 256 * 1024 * 1024;
5
+ /**
6
+ * What git prints for a command run in `directory`; undefined when git answers with a failure
7
+ * status or is not installed. A git that could not answer at all (its output over the buffer, a
8
+ * timeout) is an error: it is not an empty answer. Only the user's own repository is read or changed.
9
+ */
3
10
  export function runGit(directory, args) {
4
- const run = spawnSync('git', [...args], { cwd: directory, encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'] });
11
+ const run = spawnSync('git', [...args], {
12
+ cwd: directory,
13
+ encoding: 'utf8',
14
+ maxBuffer: MAX_BUFFER,
15
+ stdio: ['ignore', 'pipe', 'pipe'],
16
+ });
17
+ const failure = run.error;
18
+ const code = failure !== undefined && 'code' in failure ? String(failure.code) : undefined;
19
+ if (failure !== undefined && code !== 'ENOENT') {
20
+ throw new CliError(`git ${args[0] ?? ''} could not be read: ${code ?? failure.message}.`, 'The answer of git was cut or git did not finish; run the same git command by hand to see why.');
21
+ }
5
22
  return run.status === 0 ? run.stdout : undefined;
6
23
  }
7
24
  //# sourceMappingURL=run-git.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"run-git.js","sourceRoot":"","sources":["../../src/commit/run-git.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,wJAAwJ;AACxJ,MAAM,UAAU,MAAM,CAAC,SAAiB,EAAE,IAAuB;IAC/D,MAAM,GAAG,GAAG,SAAS,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC;IAEjH,OAAO,GAAG,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;AACnD,CAAC"}
1
+ {"version":3,"file":"run-git.js","sourceRoot":"","sources":["../../src/commit/run-git.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,6GAA6G;AAC7G,MAAM,UAAU,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,CAAC;AAErC;;;;GAIG;AACH,MAAM,UAAU,MAAM,CAAC,SAAiB,EAAE,IAAuB;IAC/D,MAAM,GAAG,GAAG,SAAS,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC,EAAE;QACtC,GAAG,EAAE,SAAS;QACd,QAAQ,EAAE,MAAM;QAChB,SAAS,EAAE,UAAU;QACrB,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC;KAClC,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,GAAG,CAAC,KAAK,CAAC;IAC1B,MAAM,IAAI,GAAG,OAAO,KAAK,SAAS,IAAI,MAAM,IAAI,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAE3F,IAAI,OAAO,KAAK,SAAS,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC/C,MAAM,IAAI,QAAQ,CAChB,OAAO,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,uBAAuB,IAAI,IAAI,OAAO,CAAC,OAAO,GAAG,EACrE,+FAA+F,CAChG,CAAC;IACJ,CAAC;IAED,OAAO,GAAG,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;AACnD,CAAC"}
@@ -63,10 +63,12 @@ function listedByHand(text, kebab) {
63
63
  .replaceAll(new RegExp(String.raw `(?<![.\w])${camel}Route\(((?:[^()]|\([^()]*\))*)\)`, 'g'), `...controllerRoutes([new ${pascal}Controller($1)])`);
64
64
  }
65
65
  function remind({ config, draft }) {
66
- const composition = draft.read(compositionOf(config, draft)) ?? '';
66
+ const routes = platformFileIn(config, 'composition/routes-of.ts', (path) => draft.read(path) !== undefined);
67
+ const hosting = draft.read(routes) === undefined ? compositionOf(config, draft) : routes;
68
+ const composition = draft.read(hosting) ?? '';
67
69
  draft.manual.push('Run the formatter, then `ddd-ts-kit docs` (the generated file of each context registers what each controller is given), then the checks.', 'Move what a controller kept below its class to a request mapper or a serializer (`<name>.mapper.ts`, `<name>.serializer.ts`): a controller calls its bus and nothing else.', 'Each group stands behind `Authenticated`: give a group its own guards where a set of routes asks for more (a role, a membership). The permissions stay on the use cases.', "The spec of each controller runs it without its guards (`{ guards: 'skip' }`): pass a caller with `resolvePrincipal` and drop the option to hold the guards too.");
68
70
  if (isDeclared(config) && !composition.includes("of('controller')")) {
69
- draft.manual.push(`Mount the declared controllers in ${compositionOf(config, draft)}: add \`${MOUNTS}\` to the routes it defines, with \`controllerRoutes\` of @ddd-ts-kit/http and \`DeclaredEdges\` of @ddd-ts-kit/di.`);
71
+ draft.manual.push(`Mount the declared controllers in ${hosting}: add \`${MOUNTS}\` to the routes it defines, with \`controllerRoutes\` of @ddd-ts-kit/http and \`DeclaredEdges\` of @ddd-ts-kit/di.`);
70
72
  }
71
73
  }
72
74
  function compositionOf(config, draft) {
@@ -1 +1 @@
1
- {"version":3,"file":"finish-migration.js","sourceRoot":"","sources":["../../src/controllers/finish-migration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGpD,MAAM,MAAM,GAAG,qGAAqG,CAAC;AAErH;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,SAAoB,EAAE,QAA2B;IAC/E,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,SAAS,CAAC;IAEjD,IAAI,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;QACvB,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;IAC9D,CAAC;IAED,MAA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O,CAAC,IAAI,EAAE,CAAC;IAE9C,KAAK,CAAC,MAAM,CAAC,IAAI,CACf,0IAA0I,EAC1I,4KAA4K,EAC5K,0KAA0K,EAC1K,kKAAkK,CACnK,CAAC;IAEF,IAAI,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,CAAC;QACpE,KAAK,CAAC,MAAM,CAAC,IAAI,CACf,qCAAqC,OAAO,WAAW,MAAM,qHAAqH,CACnL,CAAC;IACJ,CAAC;AACH,CAAC;AAED,SAAS,aAAa,CAAC,MAA2B,EAAE,KAAyB;IAC3E,OAAO,cAAc,CAAC,MAAM,EAAE,oCAAoC,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,SAAS,CAAC,CAAC;AAChH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"behaviour-page.d.ts","sourceRoot":"","sources":["../../src/docs/behaviour-page.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAc,MAAM,gBAAgB,CAAC;AAgC9D;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,WAAW,EAAE,GAAG,MAAM,CAYtG"}
1
+ {"version":3,"file":"behaviour-page.d.ts","sourceRoot":"","sources":["../../src/docs/behaviour-page.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAc,MAAM,gBAAgB,CAAC;AAgC9D;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,WAAW,EAAE,GAAG,MAAM,CAYtG"}
@@ -1,3 +1,4 @@
1
+ import { CRITERION, ROW } from '../acceptance/scenarios-in.js';
1
2
  import { countsOf } from './counts-of.js';
2
3
  /** The word of a role, read from the suffix of a spec file: `slot.vo.spec.ts` is a value object. */
3
4
  const ROLES = {
@@ -70,7 +71,7 @@ function specHeading(file) {
70
71
  function rulesLines(rules, depth) {
71
72
  const indent = ' '.repeat(depth);
72
73
  return [
73
- ...rules.rules.map((rule) => `${indent}- ${rule.title}${suffix(rule.state)}`),
74
+ ...rules.rules.map((rule) => `${indent}- ${ruleText(rule.title)}${suffix(rule.state)}`),
74
75
  ...rules.groups.flatMap((group) => groupLines(group, depth)),
75
76
  ];
76
77
  }
@@ -80,4 +81,11 @@ function groupLines(group, depth) {
80
81
  function suffix(state) {
81
82
  return state === 'planned' ? ' (planned)' : state === 'aside' ? ' (put aside)' : '';
82
83
  }
84
+ /** The ids a title may open with: a row (`#US1.04`, `#FIX1`) and a criterion (`AC1`), as `acceptance` reads them. */
85
+ const LEADING_IDS = new RegExp(`^(?:\\s*(?:${ROW.source}|${CRITERION.source})[\\s,:;-]*)+`);
86
+ /** A rule as the business reads it: the title without the row ids and criteria it opens with, which date it to a change. */
87
+ function ruleText(title) {
88
+ const text = title.replace(LEADING_IDS, '').trim();
89
+ return text === '' ? title : text;
90
+ }
83
91
  //# sourceMappingURL=behaviour-page.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"behaviour-page.js","sourceRoot":"","sources":["../../src/docs/behaviour-page.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAmB,MAAM,aAAa,CAAC;AAIxD,oGAAoG;AACpG,MAAM,KAAK,GAAqC;IAC9C,SAAS,EAAE,WAAW;IACtB,MAAM,EAAE,QAAQ;IAChB,EAAE,EAAE,cAAc;IAClB,OAAO,EAAE,gBAAgB;IACzB,eAAe,EAAE,eAAe;IAChC,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;IAChB,eAAe,EAAE,eAAe;IAChC,qBAAqB,EAAE,qBAAqB;IAC5C,SAAS,EAAE,WAAW;IACtB,GAAG,EAAE,KAAK;IACV,gBAAgB,EAAE,gBAAgB;IAClC,OAAO,EAA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