@roomi-fields/grillhouse 0.29.0 → 0.30.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 (222) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/CHANGELOG.md +739 -0
  3. package/bin/grillhouse.mjs +79 -18
  4. package/cadre/templates/projet/.github/workflows/ci.yml +2 -13
  5. package/cadre/templates/projet/CLAUDE.md +5 -1
  6. package/cadre/templates/projet/docs/agents/issue-tracker.md +1 -1
  7. package/cadre/templates/projet/package.json +2 -2
  8. package/charte.md +24 -0
  9. package/dist/temporal/acte.d.ts +24 -0
  10. package/dist/temporal/acte.js +139 -0
  11. package/dist/temporal/acte.js.map +1 -0
  12. package/dist/temporal/attributs.d.ts +6 -0
  13. package/dist/temporal/attributs.js +15 -0
  14. package/dist/temporal/attributs.js.map +1 -0
  15. package/dist/temporal/circuit/activites.d.ts +13 -0
  16. package/dist/temporal/circuit/activites.js +33 -0
  17. package/dist/temporal/circuit/activites.js.map +1 -0
  18. package/dist/temporal/circuit/client.d.ts +72 -0
  19. package/dist/temporal/circuit/client.js +247 -0
  20. package/dist/temporal/circuit/client.js.map +1 -0
  21. package/dist/temporal/circuit/commande.d.ts +2 -0
  22. package/dist/temporal/circuit/commande.js +238 -0
  23. package/dist/temporal/circuit/commande.js.map +1 -0
  24. package/dist/temporal/circuit/contrat.d.ts +305 -0
  25. package/dist/temporal/circuit/contrat.js +24 -0
  26. package/dist/temporal/circuit/contrat.js.map +1 -0
  27. package/dist/temporal/circuit/deroule.d.ts +3 -0
  28. package/dist/temporal/circuit/deroule.js +540 -0
  29. package/dist/temporal/circuit/deroule.js.map +1 -0
  30. package/dist/temporal/client.d.ts +47 -0
  31. package/dist/temporal/client.js +69 -0
  32. package/dist/temporal/client.js.map +1 -0
  33. package/dist/temporal/commande.d.ts +2 -0
  34. package/dist/temporal/commande.js +95 -0
  35. package/dist/temporal/commande.js.map +1 -0
  36. package/dist/temporal/deroules.d.ts +5 -0
  37. package/dist/temporal/deroules.js +10 -0
  38. package/dist/temporal/deroules.js.map +1 -0
  39. package/dist/temporal/etat.d.ts +33 -0
  40. package/dist/temporal/etat.js +59 -0
  41. package/dist/temporal/etat.js.map +1 -0
  42. package/dist/temporal/file/activites.d.ts +10 -0
  43. package/dist/temporal/file/activites.js +25 -0
  44. package/dist/temporal/file/activites.js.map +1 -0
  45. package/dist/temporal/file/client.d.ts +4 -0
  46. package/dist/temporal/file/client.js +6 -0
  47. package/dist/temporal/file/client.js.map +1 -0
  48. package/dist/temporal/file/contrat.d.ts +158 -0
  49. package/dist/temporal/file/contrat.js +14 -0
  50. package/dist/temporal/file/contrat.js.map +1 -0
  51. package/dist/temporal/file/deroule.d.ts +15 -0
  52. package/dist/temporal/file/deroule.js +235 -0
  53. package/dist/temporal/file/deroule.js.map +1 -0
  54. package/dist/temporal/installation.d.ts +124 -0
  55. package/dist/temporal/installation.js +408 -0
  56. package/dist/temporal/installation.js.map +1 -0
  57. package/dist/temporal/places/activites.d.ts +8 -0
  58. package/dist/temporal/places/activites.js +13 -0
  59. package/dist/temporal/places/activites.js.map +1 -0
  60. package/dist/temporal/places/client.d.ts +28 -0
  61. package/dist/temporal/places/client.js +64 -0
  62. package/dist/temporal/places/client.js.map +1 -0
  63. package/dist/temporal/places/contrat.d.ts +106 -0
  64. package/dist/temporal/places/contrat.js +21 -0
  65. package/dist/temporal/places/contrat.js.map +1 -0
  66. package/dist/temporal/places/deroule.d.ts +3 -0
  67. package/dist/temporal/places/deroule.js +198 -0
  68. package/dist/temporal/places/deroule.js.map +1 -0
  69. package/dist/temporal/sonde/activites.d.ts +6 -0
  70. package/dist/temporal/sonde/activites.js +52 -0
  71. package/dist/temporal/sonde/activites.js.map +1 -0
  72. package/dist/temporal/sonde/contrat.d.ts +35 -0
  73. package/dist/temporal/sonde/contrat.js +10 -0
  74. package/dist/temporal/sonde/contrat.js.map +1 -0
  75. package/dist/temporal/sonde/deroule.d.ts +3 -0
  76. package/dist/temporal/sonde/deroule.js +39 -0
  77. package/dist/temporal/sonde/deroule.js.map +1 -0
  78. package/dist/temporal/tickets/activites.d.ts +7 -0
  79. package/dist/temporal/tickets/activites.js +81 -0
  80. package/dist/temporal/tickets/activites.js.map +1 -0
  81. package/dist/temporal/tickets/client.d.ts +10 -0
  82. package/dist/temporal/tickets/client.js +31 -0
  83. package/dist/temporal/tickets/client.js.map +1 -0
  84. package/dist/temporal/tickets/contrat.d.ts +56 -0
  85. package/dist/temporal/tickets/contrat.js +13 -0
  86. package/dist/temporal/tickets/contrat.js.map +1 -0
  87. package/dist/temporal/tickets/deroule.d.ts +3 -0
  88. package/dist/temporal/tickets/deroule.js +94 -0
  89. package/dist/temporal/tickets/deroule.js.map +1 -0
  90. package/dist/temporal/travailleur.d.ts +2 -0
  91. package/dist/temporal/travailleur.js +69 -0
  92. package/dist/temporal/travailleur.js.map +1 -0
  93. package/docs/ARCHITECTURE.md +609 -80
  94. package/docs/CADRE.md +17 -0
  95. package/docs/INTERFACE.md +134 -42
  96. package/hooks/crochet.mjs +19 -2
  97. package/hooks/hooks.json +11 -0
  98. package/package.json +16 -4
  99. package/scripts/activites.mjs +2182 -0
  100. package/scripts/aiguillage.d.mts +37 -0
  101. package/scripts/aiguillage.mjs +7 -3
  102. package/scripts/avancement.mjs +128 -16
  103. package/scripts/bilan.mjs +37 -19
  104. package/scripts/cadre.mjs +11 -2
  105. package/scripts/circuit.mjs +881 -4059
  106. package/scripts/circuits-cles.d.mts +4 -0
  107. package/scripts/circuits-cles.mjs +21 -0
  108. package/scripts/circuits-du-serveur.mjs +105 -0
  109. package/scripts/codes-de-sortie.mjs +9 -0
  110. package/scripts/commandes-composees.mjs +45 -41
  111. package/scripts/commandes-du-path.d.mts +7 -0
  112. package/scripts/commandes-du-path.mjs +25 -0
  113. package/scripts/composition-des-langages.mjs +16 -12
  114. package/scripts/conformite.mjs +6 -13
  115. package/scripts/copies-finies.mjs +52 -47
  116. package/scripts/depart-du-ticket.d.mts +53 -0
  117. package/scripts/depart-du-ticket.mjs +124 -0
  118. package/scripts/dependances-internes.mjs +115 -0
  119. package/scripts/dernier-vert.mjs +7 -15
  120. package/scripts/donnees-cles.mjs +228 -0
  121. package/scripts/droits.mjs +11 -1
  122. package/scripts/effets.mjs +352 -0
  123. package/scripts/enveloppe/enveloppe.mjs +119 -8
  124. package/scripts/enveloppe/lancer.sh +14 -18
  125. package/scripts/enveloppe/paquets-du-plan.mjs +2 -2
  126. package/scripts/enveloppe/travail-de-la-copie.mjs +5 -1
  127. package/scripts/etapes.mjs +5 -2
  128. package/scripts/faits-du-circuit.mjs +493 -0
  129. package/scripts/file-des-tickets.d.mts +21 -0
  130. package/scripts/file-des-tickets.mjs +58 -0
  131. package/scripts/flux-des-paquets.mjs +187 -0
  132. package/scripts/gardes-du-cadre.mjs +12 -2
  133. package/scripts/integration/file.mjs +475 -420
  134. package/scripts/integration/integrer.mjs +17 -19
  135. package/scripts/integration/rejeu.mjs +19 -4
  136. package/scripts/jointure.d.ts +145 -27
  137. package/scripts/langages/cargo/commandes.mjs +289 -109
  138. package/scripts/langages/cargo/composants.mjs +130 -34
  139. package/scripts/langages/cargo/exemples.mjs +12 -21
  140. package/scripts/langages/cargo/index.mjs +18 -8
  141. package/scripts/langages/cargo/sccache.mjs +8 -14
  142. package/scripts/langages/python/commandes.mjs +216 -100
  143. package/scripts/langages/python/composants.mjs +53 -21
  144. package/scripts/langages/python/exemples.mjs +6 -16
  145. package/scripts/langages/python/index.mjs +24 -8
  146. package/scripts/langages/python/lot.mjs +1 -36
  147. package/scripts/langages/typescript/construire.mjs +6 -163
  148. package/scripts/langages/typescript/exemples.mjs +3 -11
  149. package/scripts/langages/typescript/frontieres.mjs +1 -1
  150. package/scripts/langages/typescript/index.mjs +43 -61
  151. package/scripts/langages/typescript/interfaces-contre-code.mjs +4 -4
  152. package/scripts/langages/typescript/migrations/0.30.0-prefixe-des-tickets.mjs +63 -0
  153. package/scripts/langages/typescript/migrations/0.30.0-tailles-des-outils-lourds.mjs +31 -0
  154. package/scripts/langages/typescript/migrations/0.30.0-titres-nommant-un-ticket.mjs +40 -0
  155. package/scripts/langages/typescript/mise-a-jour.mjs +1 -2
  156. package/scripts/langages/typescript/tailles-des-tests.mjs +40 -9
  157. package/scripts/langages/typescript/tests-de-nuit.mjs +12 -9
  158. package/scripts/langages/typescript/tests.mjs +17 -8
  159. package/scripts/langages/typescript/titres-de-tests.mjs +297 -0
  160. package/scripts/langages/typescript/turbo-des-paquets.mjs +183 -38
  161. package/scripts/langages/typescript/verdict.mjs +1 -1
  162. package/scripts/langages/typescript/verifier.mjs +31 -11
  163. package/scripts/langages/typescript/vitest-config/base.mjs +22 -1
  164. package/scripts/langages/typescript/vitest-config/bornes.mjs +13 -0
  165. package/scripts/langages/typescript/vitest-config/cibles.mjs +36 -14
  166. package/scripts/langages/typescript/vitest-config/delais.mjs +54 -0
  167. package/scripts/langages/typescript/vitest-config/delais.setup.mjs +11 -0
  168. package/scripts/langages/typescript/vitest-config/duree.classement.mjs +100 -0
  169. package/scripts/langages/typescript/vitest-config/duree.reporter.mjs +49 -63
  170. package/scripts/langages/typescript/vitest-config/machine.setup.mjs +3 -0
  171. package/scripts/langages/typescript/vitest.nuit.config.mjs +4 -0
  172. package/scripts/mesure/pression.mjs +3 -3
  173. package/scripts/mesure-de-la-machine.d.mts +21 -0
  174. package/scripts/mesure-de-la-machine.mjs +76 -0
  175. package/scripts/migrations/0.23.2-copies-du-cadre.mjs +8 -2
  176. package/scripts/migrations/0.30.0-ci-appelle-la-verification.mjs +120 -0
  177. package/scripts/migrations/0.31.0-paquets-dans-le-graphe.mjs +81 -0
  178. package/scripts/migrations.mjs +5 -0
  179. package/scripts/nuit.sh +10 -3
  180. package/scripts/outils-cles.d.mts +24 -0
  181. package/scripts/outils-cles.mjs +0 -1
  182. package/scripts/paquet-npm.mjs +147 -0
  183. package/scripts/paquet.mjs +73 -4
  184. package/scripts/paquets.mjs +34 -6
  185. package/scripts/passe-de-la-machine.mjs +66 -0
  186. package/scripts/places-de-la-machine.mjs +360 -0
  187. package/scripts/places-du-serveur.mjs +170 -0
  188. package/scripts/prefixe-des-tickets.mjs +68 -0
  189. package/scripts/preparation.mjs +10 -3
  190. package/scripts/registre.mjs +3 -2
  191. package/scripts/regles-des-places.d.mts +36 -0
  192. package/scripts/regles-des-places.mjs +70 -0
  193. package/scripts/reponses-du-circuit.d.mts +6 -0
  194. package/scripts/reponses-du-circuit.mjs +28 -0
  195. package/scripts/resultats.mjs +7 -9
  196. package/scripts/retirer-les-copies-finies.mjs +25 -0
  197. package/scripts/sans-reponse.d.mts +4 -0
  198. package/scripts/sans-reponse.mjs +13 -0
  199. package/scripts/seances.mjs +918 -0
  200. package/scripts/services-du-noyau.mjs +26 -8
  201. package/scripts/session-start.sh +2 -2
  202. package/scripts/sortie.mjs +3 -3
  203. package/scripts/sous-commandes.mjs +38 -9
  204. package/scripts/style-a-l-ecriture.mjs +229 -0
  205. package/scripts/superviseur.mjs +122 -111
  206. package/scripts/tableau.mjs +148 -110
  207. package/scripts/taches-du-graphe.mjs +328 -0
  208. package/scripts/ticket-du-circuit.mjs +206 -0
  209. package/scripts/transitions.d.mts +148 -0
  210. package/scripts/transitions.mjs +901 -0
  211. package/scripts/verrou-de-fichier.mjs +2 -2
  212. package/scripts/verrou-de-machine.mjs +28 -13
  213. package/skills/explorateur/SKILL.md +2 -1
  214. package/skills/pitmaster/SKILL.md +17 -18
  215. package/skills/pitmaster/references/consigne-agent.md +5 -1
  216. package/skills/release/SKILL.md +3 -3
  217. package/skills/relecteur/SKILL.md +4 -2
  218. package/skills/testwriter/SKILL.md +36 -24
  219. package/scripts/demon.mjs +0 -251
  220. package/scripts/integration/file-attente.mjs +0 -61
  221. package/scripts/langages/cargo/touches.mjs +0 -93
  222. package/scripts/langages/typescript/script-des-tests.mjs +0 -6
@@ -4,6 +4,7 @@
4
4
  // `commandes`; run by `grillhouse <commande>` in the root of the project, its arguments after.
5
5
  //
6
6
  // npx grillhouse tests [--force] [<chemin>…] [--<option>…] tester
7
+ // npx grillhouse tests-du-paquet <chemin>… [--<option>…] tests-du-paquet
7
8
  // npx grillhouse verifier [--tout | --gardes] verifier
8
9
  // node commandes.mjs typer typer
9
10
  // npx grillhouse preparer preparer
@@ -13,34 +14,54 @@
13
14
  // - Each command plays in the folder of each package (./composants.mjs), one after the other, by
14
15
  // uv, which reads its pyproject.toml, its uv.lock (`--locked`: a lock out of date is refused, as
15
16
  // `npm ci`), and the Python its `requires-python` and its `.python-version` ask.
16
- // - `tester` plays pytest in each package that plays tests: `uv run --locked --group test pytest`,
17
- // the group `test` holding pytest and what the tests depend on, its JUnit report in the family
18
- // `xunit1` (./verdict.mjs). A path, written from the root, chooses the package that holds it,
19
- // and pytest plays that path alone; a path out of every package is refused, named, and nothing
20
- // plays (code 2). Without a path, every package that plays tests plays, or, under the circuit's
21
- // mark (`GRILLHOUSE_DEPUIS_LE_VERT`), the packages the changes since the last green touch
22
- // (./lot.mjs), every package when no last green counts. The night tests (`*_nuit_test.py`, the
23
- // one class out of the day: Python has no time budget bench) are left out of every folder,
24
- // played whole or named (`--ignore-glob`), and a night test plays when its own file is named,
25
- // as the module cargo's: pytest never ignores a path named, and a folder named that holds a
26
- // night file named gives its tests of the day file by file, since pytest would collect that
27
- // file through the folder (grillhouse-1ic.1). `--force`
28
- // changes nothing: pytest keeps no result to replay. Another option goes to pytest. A package
29
- // played whole (no path, or its own folder named) whose pytest collects no test (code 5) is
30
- // green, as `cargo test` on a crate without a test and the skeleton typescript's
31
- // `passWithNoTests`; a path within the package that collects no test stays red, as a run whose
32
- // paths name no test fails in every language.
33
- // - `verifier` plays, in each package the changes since the last green touch (every package with
34
- // `--tout`, or when no last green counts), the typing then the tests of the day; green, it keeps
35
- // the last green (scripts/dernier-vert.mjs). It plays under the lock of the machine
36
- // (`avecLaMachine` of ./jointure), as the module cargo's. `verifier --gardes` plays the guards
37
- // alone: the project's root scripts `grillhouse:gardes` then `gardes` the package.json holds.
17
+ // - `tester` plays the tests of the packages as tasks of Turborepo, the way of the module
18
+ // typescript's (scripts/langages/typescript/tests.mjs): `turbo run test:unit --filter=<projet>…`
19
+ // on the projects of the graph, each one a package with its own `package.json`
20
+ // (scripts/paquet-npm.mjs), the task of a project whose inputs did not move replayed from
21
+ // Turborepo's cache; the frame selects nothing by the last green. A path, written from the root,
22
+ // chooses the project that holds it (only its task plays) and reaches the task, made absolute, in
23
+ // the variable `GRILLHOUSE_TESTS` (`TESTS_CIBLES`, scripts/taches-du-graphe.mjs) beside the
24
+ // options, which the `env` of the task names: it enters its hash, so a run by path of a project
25
+ // unchanged replays from the cache, and another path moves the hash. `--force` carries the moment
26
+ // of the run in the variable instead (`rejouer`), which no cached run holds: the task plays for
27
+ // real (`npm run test:forcer`). A path out of every project, or in a project that is no package
28
+ // of the graph, is refused, named, and nothing plays (code 2). The exit code is Turborepo's.
29
+ // - `tests-du-paquet <chemin>…` is the body of that task, which the `test:unit` script of a project
30
+ // calls (`grillhouse tests-du-paquet <dossier du projet>`, written with the package): it never
31
+ // runs Turborepo, so `tester` and the task do not loop. It plays pytest in the project:
32
+ // `uv run --locked --group test pytest`, the group `test` holding pytest and what the tests
33
+ // depend on, its JUnit report in the family `xunit1` (./verdict.mjs). A path, written from the
34
+ // root, chooses the project that holds it, and pytest plays that path alone; the paths of the
35
+ // variable `GRILLHOUSE_TESTS` that lie in the project replace the folder the script names. A path
36
+ // out of every project is refused, named, and nothing plays (code 2). The night tests
37
+ // (`*_nuit_test.py`, the one class out of the day: Python has no time budget bench) are left out
38
+ // of every folder, played whole or named (`--ignore-glob`), and a night test named is refused,
39
+ // named, and nothing plays (code 2), as the module cargo's: the night alone plays it. `--force` changes nothing here:
40
+ // pytest keeps no result to replay. Another option goes to pytest. A project played whole (its
41
+ // own folder named) whose pytest collects no test (code 5) is green, as `cargo test` on a crate
42
+ // without a test and the skeleton typescript's `passWithNoTests`; a path within the project that
43
+ // collects no test stays red, as a run whose paths name no test fails in every language.
44
+ // - `verifier` plays the typing and the tests of the projects as the tasks of Turborepo (`turbo run
45
+ // typecheck test:unit --filter=<projet>…`, the cache of the tasks selecting those that play
46
+ // again; `--tout` plays the tests for real, the moment of the pass in the variable
47
+ // `GRILLHOUSE_TESTS`). It keeps no green: the one pass of the verification keeps it
48
+ // (scripts/dernier-vert.mjs, scripts/langages/typescript/verifier.mjs). Beside the module of
49
+ // package.json, whose pass plays every task of the graph, the composed command sets
50
+ // `GRAPHE_JOUE` and `verifier` plays nothing again. It plays on a place of
51
+ // the machine and under its lock (`avecLaMachineEtUnePlace` of ./jointure), as the module cargo's. `verifier --gardes` plays
52
+ // the guards alone: the project's root scripts `grillhouse:gardes` then `gardes` the package.json
53
+ // holds.
38
54
  // - `typer`: `uv run --locked python -m compileall`, the folders whose name begins with a dot (the
39
55
  // `.venv`) left out. `preparer`: `uv sync --locked --group test`.
40
56
  // - `tests-de-nuit`: pytest on the night tests of each package that holds some; none, nothing
41
57
  // plays and the code is 0. The night (scripts/nuit.sh) runs it.
42
- // - Each command plays under a temporary directory of its pass, the guard of the temporary
43
- // directory: a base (`ouvrirBase` of ./jointure) named in TMPDIR, TMP and TEMP, removed at the
58
+ // - `construire --echec <fichier> <plan>` is the launcher's build of the copy
59
+ // (scripts/enveloppe/lancer.sh), the core's one for every language
60
+ // (`construireDepuisLesArguments` of scripts/taches-du-graphe.mjs): the plan and its providers by
61
+ // `turbo run build --filter=<paquet>…`. `construire <chemin>` syncs one project, as the script
62
+ // `build` of its package.
63
+ // - `tests-du-paquet`, `tests-de-nuit`, `verifier`, `typer` and `preparer` play under a temporary
64
+ // directory of their pass, the guard of the temporary directory: a base (`ouvrirBase` of ./jointure) named in TMPDIR, TMP and TEMP, removed at the
44
65
  // end of the pass, green, red or interrupted; what the tests left there fails the pass (code 1),
45
66
  // each name written on the error stream, the lock files uv takes there (`uv-<hash>.lock`) apart,
46
67
  // which the base removes with the rest. A test makes its temporary
@@ -67,16 +88,22 @@ import { fileURLToPath, pathToFileURL } from 'node:url';
67
88
  import { RESULTATS } from '../../resultats.mjs';
68
89
  import {
69
90
  AttenteDeLaMachine,
70
- avecLaMachine,
91
+ surUnePlace,
92
+ avecLaMachineEtUnePlace,
71
93
  cacheDeCompilation,
72
- CHANGEMENTS,
73
- DEPUIS_LE_VERT,
74
- garderLeVert,
94
+ cheminsDeLaTache,
95
+ construireDepuisLesArguments,
96
+ GRAPHE_JOUE,
97
+ lancerLesTaches,
75
98
  ligneDesRestes,
76
- mesure,
99
+ nomDuPaquet,
77
100
  ouvrirBase,
78
101
  retirerALInterruption,
102
+ SCRIPT_DES_TESTS,
103
+ testsCibles,
104
+ travailleursDeLaSeance,
79
105
  } from '../../services-du-noyau.mjs';
106
+ import { TYPAGE } from '../../paquets.mjs';
80
107
  import {
81
108
  composantDans,
82
109
  composants,
@@ -85,11 +112,20 @@ import {
85
112
  GROUPE,
86
113
  joueDesTests,
87
114
  } from './composants.mjs';
88
- import { touchesDesFichiers } from './lot.mjs';
89
115
  import { JUNIT, TACHES } from './verdict.mjs';
90
116
 
91
117
  const ICI = fileURLToPath(import.meta.url);
92
- export const NOMS = ['tester', 'verifier', 'typer', 'preparer', 'tests-de-nuit'];
118
+ export const NOMS = [
119
+ 'tester',
120
+ 'tests-du-paquet',
121
+ 'verifier',
122
+ 'typer',
123
+ 'construire',
124
+ 'preparer',
125
+ 'tests-de-nuit',
126
+ ];
127
+ // The task runner of the graph of the packages.
128
+ const OUTIL = 'turbo';
93
129
  const A_REPASSER = 75;
94
130
  const RACINE = '//';
95
131
  /** The night tests, which the day leaves out. */
@@ -199,22 +235,20 @@ const UV_RUN = ['run', '--locked'];
199
235
  // The code of pytest for « no tests collected », distinct from a failure (1).
200
236
  const AUCUN_TEST = 5;
201
237
 
202
- // The selection of pytest for the paths <chemins> of the package <c>, from its folder (empty: the
203
- // whole package): the night left out of every folder (`--ignore-glob`), as the module cargo's;
204
- // a night file named plays, pytest never ignoring a path named, unless a folder named holds it,
205
- // through which pytest collects it: that folder then gives its tests of the day, file by file.
206
- function selection(c, chemins) {
207
- const nuits = chemins.filter(ch => estDeNuit(path.basename(ch)));
208
- const tient = (d, f) => d !== f && !path.relative(d, f).startsWith('..');
209
- const nommes = chemins.flatMap(ch => {
210
- if (!nuits.some(n => tient(ch, n))) {
211
- return [ch];
212
- }
213
- return fichiersDeTest(path.join(c.dossier, ch))
214
- .filter(f => !estDeNuit(path.basename(f)))
215
- .map(f => path.relative(c.dossier, f));
216
- });
217
- return [`--ignore-glob=${DE_NUIT}`, ...nommes];
238
+ // The selection of pytest for the paths <chemins> of a package, from its folder (empty: the
239
+ // whole package): the night left out of every folder (`--ignore-glob`), as the module cargo's; a
240
+ // night file named never reaches it (`choisir` refuses it).
241
+ function selection(chemins) {
242
+ return [`--ignore-glob=${DE_NUIT}`, ...chemins];
243
+ }
244
+
245
+ // Whether the pyproject of the package at <dossier> declares pytest-xdist, which `-n` needs.
246
+ function declareXdist(dossier) {
247
+ try {
248
+ return /pytest-xdist/.test(readFileSync(path.join(dossier, 'pyproject.toml'), 'utf8'));
249
+ } catch {
250
+ return false;
251
+ }
218
252
  }
219
253
 
220
254
  // Plays pytest in the run <p> for each `{ c, chemins }` of <choix>, `chemins` from the package's
@@ -226,29 +260,18 @@ function jouerLesTests(p, choix, options) {
226
260
  const cache = path.join(p.racine, CACHE_DE_PYTEST, path.relative(p.racine, c.dossier));
227
261
  const args = [...UV_RUN, '--group', GROUPE, 'pytest', '-o', `cache_dir=${cache}`];
228
262
  args.push(...p.junit(c.nom, c.dossier));
263
+ // The workers of a session of an agent (GRILLHOUSE_TRAVAILLEURS): `-n` of pytest-xdist, for a
264
+ // package whose test group declares it; a heavy pass, without the variable, plays alone.
265
+ const travailleurs = travailleursDeLaSeance(process.env);
266
+ if (travailleurs !== null && declareXdist(c.dossier)) args.push('-n', String(travailleurs));
229
267
  const entier = chemins.every(ch => ch === '.');
230
268
  p.jouer(
231
- p.prevoir(c.nom, c.dossier, 'pytest', true, [...args, ...selection(c, chemins), ...options]),
269
+ p.prevoir(c.nom, c.dossier, 'pytest', true, [...args, ...selection(chemins), ...options]),
232
270
  entier ? [AUCUN_TEST] : []
233
271
  );
234
272
  }
235
273
  }
236
274
 
237
- // The packages the changes since the last green of <racine> touch; every package with <tout> or
238
- // without a last green that counts. `{ choix, m }`, `m` the measure.
239
- function depuisLeVert(racine, tous, tout, env) {
240
- const m = mesure(racine, { tout, dans: env.TMPDIR });
241
- process.stderr.write(`${m.ligne}\n`);
242
- const f = m.env[CHANGEMENTS];
243
- if (!f) {
244
- return { choix: tous, m };
245
- }
246
- const ch = JSON.parse(readFileSync(f, 'utf8'));
247
- const t = touchesDesFichiers(racine, [...ch.fichiers, ...ch.supprimes]);
248
- const nommes = new Set(t.touches.map(c => c.dossier));
249
- return { choix: tous.filter(c => nommes.has(c.dossier)), m };
250
- }
251
-
252
275
  // The packages the paths <chemins> choose in <racine>: `{ choix }`, or `{ refus }`.
253
276
  function choisir(racine, tous, chemins) {
254
277
  const parDossier = new Map();
@@ -259,6 +282,13 @@ function choisir(racine, tous, chemins) {
259
282
  refus.push(`${chemin} : hors de tout paquet Python (pyproject.toml)`);
260
283
  continue;
261
284
  }
285
+ // A night test plays at night alone (`tests-de-nuit`): a targeted run refuses it, named.
286
+ if (estDeNuit(path.basename(chemin))) {
287
+ refus.push(
288
+ `${chemin} : un test de nuit se joue la nuit seulement (npx grillhouse nuit le joue)`
289
+ );
290
+ continue;
291
+ }
262
292
  const rel = path.relative(c.dossier, path.resolve(racine, chemin)) || '.';
263
293
  const deja = parDossier.get(c.dossier) ?? { c, chemins: [] };
264
294
  deja.chemins.push(rel);
@@ -267,12 +297,40 @@ function choisir(racine, tous, chemins) {
267
297
  return refus.length ? { refus } : { choix: [...parDossier.values()] };
268
298
  }
269
299
 
270
- // The pass of `tester` in <racine>, its arguments <args>, under <env>.
300
+ // The graph packages of the projects <projets>: `{ noms, absents }`, the names of those that are
301
+ // packages of the graph, and the names of the projects that are not.
302
+ function nomsDuGraphe(racine, projets) {
303
+ const noms = new Set();
304
+ const absents = [];
305
+ for (const c of projets) {
306
+ const nom = nomDuPaquet(racine, c.dossier);
307
+ if (nom === null) {
308
+ absents.push(c.nom);
309
+ } else {
310
+ noms.add(nom);
311
+ }
312
+ }
313
+ return { noms, absents };
314
+ }
315
+
316
+ // Says, on the error stream, each project of <absents> that is no package of the graph: its tests
317
+ // do not play, as a package without a `package.json` is out of Turborepo's tasks.
318
+ function direLesAbsents(absents) {
319
+ for (const nom of absents) {
320
+ process.stderr.write(
321
+ `⚠️ ${nom} : pas un paquet du graphe (package.json absent) ; ses tests ne se jouent pas : npx grillhouse maj\n`
322
+ );
323
+ }
324
+ }
325
+
326
+ // The pass of `tester` in <racine>, its arguments <args>, under <env>: the tasks `test:unit` of the
327
+ // projects the paths choose (every project that plays tests without a path) as Turborepo's, the
328
+ // exit code its.
271
329
  function tester(racine, args, env) {
272
- const p = passe(racine, env);
273
330
  const tous = composants(racine);
274
331
  const chemins = args.filter(a => !a.startsWith('-'));
275
332
  const options = args.filter(a => a.startsWith('-') && a !== '--force');
333
+ let choisis = tous.filter(c => joueDesTests(racine, c));
276
334
  if (chemins.length) {
277
335
  const r = choisir(racine, tous, chemins);
278
336
  if (r.refus) {
@@ -281,48 +339,83 @@ function tester(racine, args, env) {
281
339
  }
282
340
  return 2;
283
341
  }
284
- jouerLesTests(p, r.choix, options);
285
- return p.code();
342
+ choisis = r.choix.map(x => x.c);
286
343
  }
287
- let m = null;
288
- let choix = tous;
289
- if (env[DEPUIS_LE_VERT]) {
290
- ({ choix, m } = depuisLeVert(racine, tous, args.includes('--force'), env));
344
+ const { noms, absents } = nomsDuGraphe(racine, choisis);
345
+ if (chemins.length && absents.length) {
346
+ process.stderr.write(
347
+ `⛔ ${absents.join(', ')} : pas un paquet du graphe (package.json absent) : npx grillhouse maj\n`
348
+ );
349
+ return 2;
291
350
  }
292
- try {
293
- const avec = choix.filter(c => joueDesTests(racine, c)).map(c => ({ c, chemins: [] }));
294
- jouerLesTests(p, avec, options);
295
- } finally {
296
- m?.retirer();
351
+ direLesAbsents(absents);
352
+ if (noms.size === 0) {
353
+ return 0;
354
+ }
355
+ return lancerLesTaches({
356
+ outil: OUTIL,
357
+ racine,
358
+ taches: [SCRIPT_DES_TESTS],
359
+ noms,
360
+ tests: testsCibles({
361
+ arguments: [...chemins.map(c => path.resolve(racine, c)), ...options],
362
+ force: args.includes('--force'),
363
+ }),
364
+ env,
365
+ });
366
+ }
367
+
368
+ // The pass of `tests-du-paquet` in <racine>, its arguments <args>, under <env>: the body of the task
369
+ // `test:unit` of a project. The paths its script names, completed by those of the variable of the
370
+ // task that lie in the same project.
371
+ function testsDuPaquet(racine, args, env) {
372
+ const tous = composants(racine);
373
+ const donnes = args.filter(a => !a.startsWith('-'));
374
+ if (donnes.length === 0) {
375
+ process.stderr.write(
376
+ '⛔ tests-du-paquet : aucun chemin (un dossier de projet, ou un fichier de test).\n'
377
+ );
378
+ return 2;
379
+ }
380
+ const dossierDe = abs => composantDans(tous, racine, abs)?.dossier ?? null;
381
+ const { chemins, options } = cheminsDeLaTache({ racine, donnes, env, dossierDe });
382
+ const r = choisir(racine, tous, chemins);
383
+ if (r.refus) {
384
+ for (const l of r.refus) {
385
+ process.stderr.write(`⛔ ${l}\n`);
386
+ }
387
+ return 2;
297
388
  }
389
+ const p = passe(racine, env);
390
+ jouerLesTests(p, r.choix, [...args.filter(a => a.startsWith('-')), ...options]);
298
391
  return p.code();
299
392
  }
300
393
 
301
394
  // The pass of `verifier` in <racine>, under the lock of the machine: the typing and the tests of
302
- // the packages the changes since the last green touch; green, it keeps the last green.
395
+ // the projects as tasks of Turborepo (the tests played for real with <args> `--tout`). It keeps no
396
+ // green.
303
397
  function verifier(racine, args, env) {
304
- const p = passe(racine, env);
305
398
  if (args.includes('--gardes')) {
306
- return gardes(racine, p);
399
+ return gardes(racine, passe(racine, env));
307
400
  }
308
- const { choix, m } = depuisLeVert(racine, composants(racine), args.includes('--tout'), env);
309
- try {
310
- for (const c of choix) {
311
- typerLePaquet(p, c);
312
- }
313
- jouerLesTests(
314
- p,
315
- choix.filter(c => joueDesTests(racine, c)).map(c => ({ c, chemins: [] })),
316
- []
317
- );
318
- const code = p.code();
319
- if (code === 0 && m.etat) {
320
- garderLeVert(m.etat);
321
- }
322
- return code;
323
- } finally {
324
- m.retirer();
401
+ // Beside the module of package.json (composed command), its pass has played the tasks.
402
+ if (env[GRAPHE_JOUE]) {
403
+ return 0;
404
+ }
405
+ const { noms, absents } = nomsDuGraphe(racine, composants(racine));
406
+ direLesAbsents(absents);
407
+ if (noms.size === 0) {
408
+ return 0;
325
409
  }
410
+ const code = lancerLesTaches({
411
+ outil: OUTIL,
412
+ racine,
413
+ taches: [TYPAGE, SCRIPT_DES_TESTS],
414
+ noms,
415
+ tests: testsCibles({ arguments: [], force: args.includes('--tout') }),
416
+ env,
417
+ });
418
+ return code === 0 ? 0 : 1;
326
419
  }
327
420
 
328
421
  // The typing of the package <c> in the run <p>: compileall, the folders of a dot left out.
@@ -390,7 +483,10 @@ function sousLaBase(genre, env, jouer) {
390
483
  */
391
484
  export function lancer(nom, args, { racine = process.cwd(), env = process.env } = {}) {
392
485
  if (nom === 'tester') {
393
- return sousLaBase('tests', env, e => tester(racine, args, e));
486
+ return surUnePlace(e => tester(racine, args, e), { env });
487
+ }
488
+ if (nom === 'tests-du-paquet') {
489
+ return sousLaBase('tests', env, e => testsDuPaquet(racine, args, e));
394
490
  }
395
491
  if (nom === 'tests-de-nuit') {
396
492
  return sousLaBase('tests', env, e => {
@@ -411,7 +507,7 @@ export function lancer(nom, args, { racine = process.cwd(), env = process.env }
411
507
  const dire = l => process.stdout.write(`${l}\n`);
412
508
  try {
413
509
  return sousLaBase('verification', env, envBase =>
414
- avecLaMachine(envMachine => verifier(racine, args, envMachine), {
510
+ avecLaMachineEtUnePlace(envMachine => verifier(racine, args, envMachine), {
415
511
  env: envBase,
416
512
  racine,
417
513
  dire,
@@ -425,10 +521,30 @@ export function lancer(nom, args, { racine = process.cwd(), env = process.env }
425
521
  return e.code;
426
522
  }
427
523
  }
428
- if (nom === 'typer' || nom === 'preparer') {
524
+ // The launcher's `construire` (`--echec <fichier> <plan>`, scripts/enveloppe/lancer.sh) builds
525
+ // the copy for a session, the plan and its providers, as every language's.
526
+ if (nom === 'construire' && args.includes('--echec')) {
527
+ return construireDepuisLesArguments(OUTIL, args, racine);
528
+ }
529
+ if (nom === 'typer' || nom === 'preparer' || nom === 'construire') {
530
+ // `construire` and `typer` with a path: the one project of that folder, as Turborepo's task of
531
+ // one package; `typer` alone types them all, `preparer` syncs them all.
532
+ let choisis = composants(racine);
533
+ if (nom === 'construire' || (nom === 'typer' && args.length)) {
534
+ const [chemin, ...autres] = args;
535
+ const abs = chemin === undefined ? null : path.resolve(racine, chemin);
536
+ const c = abs === null ? undefined : choisis.find(x => x.dossier === abs);
537
+ if (!c || autres.length) {
538
+ process.stderr.write(
539
+ `⛔ ${nom} : ${chemin ?? 'aucun chemin'} ne désigne pas un projet Python (un dossier de pyproject.toml, une fois).\n`
540
+ );
541
+ return 2;
542
+ }
543
+ choisis = [c];
544
+ }
429
545
  return sousLaBase('tests', env, e => {
430
546
  const p = passe(racine, e);
431
- for (const c of composants(racine)) {
547
+ for (const c of choisis) {
432
548
  if (nom === 'typer') {
433
549
  typerLePaquet(p, c);
434
550
  } else {
@@ -1,6 +1,6 @@
1
1
  // The components of a project of Python, as uv finds a project (PEP 621, `pyproject.toml`): the
2
2
  // packages the module python answers the join with (scripts/jointure.d.ts, `composants`,
3
- // `composantDe`, `matieres`, `joueDesTests`, `lecteurs`, `estUnTest`, `soeurDAvant`, `manifestes`,
3
+ // `composantDe`, `matieres`, `joueDesTests`, `lecteurs`, `estUnTest`, `arbreDAvant`, `manifestes`,
4
4
  // `entreesDeLIndex`).
5
5
  //
6
6
  // - A component is a folder that holds a pyproject.toml, found under the root, the folders whose
@@ -19,10 +19,9 @@
19
19
  // any file under a folder `tests/` of a component, his helpers and his data. Of the manifests
20
20
  // (`manifestes`): the group `test` of the table `[dependency-groups]` of a pyproject.toml (PEP
21
21
  // 735), what the tests depend on, and the uv.lock of a component, which uv brings in line with
22
- // it; a change of any other part of a pyproject.toml is named by it. The sibling of HEAD's
23
- // version of a test file (`soeurDAvant`), which the proof of the red plays beside it, is a name
24
- // pytest collects, of its file's kind: `test_<nom>_circuit_avant.py`, `<nom>_circuit_avant_test.py`,
25
- // `<nom>_circuit_avant_nuit_test.py`. The pyproject.toml is read
22
+ // it; a change of any other part of a pyproject.toml is named by it. HEAD's version of a test
23
+ // file (`arbreDAvant`) plays in a tree of its own, under the file's name, which the proof of the
24
+ // red builds. The pyproject.toml is read
26
25
  // with smol-toml, a tool of this module (`outils`), an optional peer of the package loaded when a
27
26
  // manifest is judged.
28
27
  // - The readers of a package: none read by the module (a dependency between two packages of
@@ -148,23 +147,12 @@ export function estUnTest(chemin, racine) {
148
147
  }
149
148
 
150
149
  /**
151
- * The sibling of HEAD's version of the test file <chemin> (from <racine>), which pytest collects
152
- * and plays in the same run: `test_<nom>_circuit_avant.py` beside `test_<nom>.py`,
153
- * `<nom>_circuit_avant_test.py` beside `<nom>_test.py`, `<nom>_circuit_avant_nuit_test.py`
154
- * beside a night test `<nom>_nuit_test.py`, so that it stays one; a name pytest collects by
155
- * default (`python_files`), its tests named in its report as the file's; null for a file pytest
156
- * does not play.
150
+ * Whether HEAD's version of the test file <chemin> (from <racine>) plays in a tree of its own,
151
+ * under the file's own name, so that its tests are named in its report as the file's, of its
152
+ * kind (day, night); false for a file pytest does not play.
157
153
  */
158
- export function soeurDAvant(chemin, racine) {
159
- if (!estUnTest(chemin, racine)?.joue) {
160
- return null;
161
- }
162
- if (estDeNuit(path.basename(chemin))) {
163
- return chemin.replace(/_nuit_test\.py$/, '_circuit_avant_nuit_test.py');
164
- }
165
- return chemin.endsWith('_test.py')
166
- ? chemin.replace(/_test\.py$/, '_circuit_avant_test.py')
167
- : chemin.replace(/\.py$/, '_circuit_avant.py');
154
+ export function arbreDAvant(chemin, racine) {
155
+ return Boolean(estUnTest(chemin, racine)?.joue);
168
156
  }
169
157
 
170
158
  // The parts of the parsed manifests <a> and <b> that differ, out of the group of the tests: each
@@ -224,6 +212,50 @@ function horsDesTests(chemin, racine, avant, apres) {
224
212
  /** What the testwriter writes of the manifests (scripts/jointure.d.ts, `manifestes`). */
225
213
  export const manifestes = { verrous: [VERROU], horsDesTests };
226
214
 
215
+ /**
216
+ * The name a pyproject.toml <texte> gives its project: the `name` of its `[project]`; null for none.
217
+ * @param {string} texte
218
+ */
219
+ export function nomDuManifeste(texte) {
220
+ let section = null;
221
+ for (const l of texte.split('\n')) {
222
+ const s = /^\s*\[([^\]]+)\]\s*(?:#.*)?$/.exec(l);
223
+ if (s) {
224
+ section = s[1].trim();
225
+ continue;
226
+ }
227
+ const n = /^\s*name\s*=\s*["']([^"']+)["']/.exec(l);
228
+ if (section === 'project' && n) {
229
+ return n[1];
230
+ }
231
+ }
232
+ return null;
233
+ }
234
+
235
+ /**
236
+ * The internal dependencies of the project at <chemin> (from <racine>): each entry of
237
+ * `[tool.uv.sources]` with a `path` (named by <nomA> of the folder there, else by its key) or
238
+ * `workspace = true` (named by its key).
239
+ * @param {string} racine
240
+ * @param {string} chemin
241
+ * @param {(dossier: string) => string | null} nomA
242
+ */
243
+ export function liensDuManifeste(racine, chemin, nomA) {
244
+ const { parse } = require('smol-toml');
245
+ const dossier = path.join(racine, chemin);
246
+ const f = path.join(dossier, MANIFESTE);
247
+ const m = existsSync(f) ? parse(readFileSync(f, 'utf8')) : {};
248
+ const noms = new Set();
249
+ for (const [cle, spec] of Object.entries(m.tool?.uv?.sources ?? {})) {
250
+ if (typeof spec?.path === 'string') {
251
+ noms.add(nomA(path.resolve(dossier, spec.path)) ?? cle);
252
+ } else if (spec?.workspace === true) {
253
+ noms.add(cle);
254
+ }
255
+ }
256
+ return { noms: [...noms], table: '[tool.uv.sources]', outil: 'uv' };
257
+ }
258
+
227
259
  /** The readers of the packages <noms>: none; a name no component bears, without provider. */
228
260
  export function lecteurs(_racine, { composants: liste, noms }) {
229
261
  const elements = [];
@@ -5,8 +5,7 @@
5
5
  // - A project of two packages, declared python in its architecture: `site` (its project
6
6
  // `generateur`, a test of the day `pages/test_pages.py`, a night test, a `conftest.py`, its
7
7
  // interface) and `outil` (its project `outil`, no test); the root's interface, and the index of
8
- // the interfaces they give, up to date. Committed: `projet`; the same, a source of `site` then
9
- // changed and a file out of every package added: `change`, measured from its commit; the same
8
+ // the interfaces they give, up to date. Committed: `projet`; the same
10
9
  // with a second commit that changes `site`, adds the package `neuf` and removes `outil`: `lot`;
11
10
  // the same, the interface of `site` then changed, its index late: `enRetard`.
12
11
  // - A directory without pyproject.toml: `vide`.
@@ -129,10 +128,6 @@ export default {
129
128
  const aJour = projet(dans);
130
129
  const vide = mkdtempSync(path.join(dans, 'vide-'));
131
130
  writeFileSync(path.join(vide, 'README.md'), 'aucun paquet\n');
132
- const change = projet(dans);
133
- const depuis = tete(change);
134
- writeFileSync(path.join(change, 'site/pages/generer.py'), 'def generer():\n return 2\n');
135
- writeFileSync(path.join(change, 'notes.txt'), 'hors des paquets\n');
136
131
  const lot = projet(dans);
137
132
  const avantLeLot = tete(lot);
138
133
  const ecrireLot = ecrireDans(lot);
@@ -150,7 +145,7 @@ export default {
150
145
  const site = path.join(aJour, 'site');
151
146
  return {
152
147
  racine: aJour,
153
- depots: { projet: aJour, change, depuis, lot, avantLeLot, enRetard, vide },
148
+ depots: { projet: aJour, lot, avantLeLot, enRetard, vide },
154
149
  composants: {
155
150
  valide: vide,
156
151
  invalide: aJour,
@@ -173,11 +168,6 @@ export default {
173
168
  invalide: { racine: aJour, noms: ['generateur', 'absent'] },
174
169
  attendu: ['absent : sans fournisseur'],
175
170
  },
176
- touches: {
177
- valide: { racine: aJour, depuis: 'HEAD' },
178
- invalide: { racine: change, depuis },
179
- attendu: ['touché site', 'hors notes.txt'],
180
- },
181
171
  commandes: {
182
172
  valide: ['tester', 'verifier', 'typer', 'preparer', 'tests-de-nuit', 'index-interfaces'],
183
173
  invalide: ['tester', 'deployer'],
@@ -234,16 +224,16 @@ export default {
234
224
  'site/tests/donnees.json',
235
225
  'README.md',
236
226
  ],
237
- // A night test keeps its end, so that its sibling stays one.
227
+ // A test file plays in a tree, under its own name, a night test as a night test.
238
228
  invalide: [
239
229
  'site/pages/test_pages.py',
240
230
  'site/pages/pages_test.py',
241
231
  'site/pages/site_nuit_test.py',
242
232
  ],
243
233
  attendu: [
244
- 'site/pages/test_pages.py → site/pages/test_pages_circuit_avant.py',
245
- 'site/pages/pages_test.py → site/pages/pages_circuit_avant_test.py',
246
- 'site/pages/site_nuit_test.py → site/pages/site_circuit_avant_nuit_test.py',
234
+ 'site/pages/test_pages.py → un arbre',
235
+ 'site/pages/pages_test.py → un arbre',
236
+ 'site/pages/site_nuit_test.py → un arbre',
247
237
  ],
248
238
  },
249
239
  fichiersEngendres: {