@roomi-fields/grillhouse 0.28.3 → 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 (238) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/CHANGELOG.md +739 -0
  3. package/bin/grillhouse.mjs +128 -26
  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/README.md +11 -11
  7. package/cadre/templates/projet/_gitignore +2 -5
  8. package/cadre/templates/projet/docs/agents/issue-tracker.md +1 -1
  9. package/cadre/templates/projet/package.json +2 -2
  10. package/charte.md +37 -4
  11. package/dist/temporal/acte.d.ts +24 -0
  12. package/dist/temporal/acte.js +139 -0
  13. package/dist/temporal/acte.js.map +1 -0
  14. package/dist/temporal/attributs.d.ts +6 -0
  15. package/dist/temporal/attributs.js +15 -0
  16. package/dist/temporal/attributs.js.map +1 -0
  17. package/dist/temporal/circuit/activites.d.ts +13 -0
  18. package/dist/temporal/circuit/activites.js +33 -0
  19. package/dist/temporal/circuit/activites.js.map +1 -0
  20. package/dist/temporal/circuit/client.d.ts +72 -0
  21. package/dist/temporal/circuit/client.js +247 -0
  22. package/dist/temporal/circuit/client.js.map +1 -0
  23. package/dist/temporal/circuit/commande.d.ts +2 -0
  24. package/dist/temporal/circuit/commande.js +238 -0
  25. package/dist/temporal/circuit/commande.js.map +1 -0
  26. package/dist/temporal/circuit/contrat.d.ts +305 -0
  27. package/dist/temporal/circuit/contrat.js +24 -0
  28. package/dist/temporal/circuit/contrat.js.map +1 -0
  29. package/dist/temporal/circuit/deroule.d.ts +3 -0
  30. package/dist/temporal/circuit/deroule.js +540 -0
  31. package/dist/temporal/circuit/deroule.js.map +1 -0
  32. package/dist/temporal/client.d.ts +47 -0
  33. package/dist/temporal/client.js +69 -0
  34. package/dist/temporal/client.js.map +1 -0
  35. package/dist/temporal/commande.d.ts +2 -0
  36. package/dist/temporal/commande.js +95 -0
  37. package/dist/temporal/commande.js.map +1 -0
  38. package/dist/temporal/deroules.d.ts +5 -0
  39. package/dist/temporal/deroules.js +10 -0
  40. package/dist/temporal/deroules.js.map +1 -0
  41. package/dist/temporal/etat.d.ts +33 -0
  42. package/dist/temporal/etat.js +59 -0
  43. package/dist/temporal/etat.js.map +1 -0
  44. package/dist/temporal/file/activites.d.ts +10 -0
  45. package/dist/temporal/file/activites.js +25 -0
  46. package/dist/temporal/file/activites.js.map +1 -0
  47. package/dist/temporal/file/client.d.ts +4 -0
  48. package/dist/temporal/file/client.js +6 -0
  49. package/dist/temporal/file/client.js.map +1 -0
  50. package/dist/temporal/file/contrat.d.ts +158 -0
  51. package/dist/temporal/file/contrat.js +14 -0
  52. package/dist/temporal/file/contrat.js.map +1 -0
  53. package/dist/temporal/file/deroule.d.ts +15 -0
  54. package/dist/temporal/file/deroule.js +235 -0
  55. package/dist/temporal/file/deroule.js.map +1 -0
  56. package/dist/temporal/installation.d.ts +124 -0
  57. package/dist/temporal/installation.js +408 -0
  58. package/dist/temporal/installation.js.map +1 -0
  59. package/dist/temporal/places/activites.d.ts +8 -0
  60. package/dist/temporal/places/activites.js +13 -0
  61. package/dist/temporal/places/activites.js.map +1 -0
  62. package/dist/temporal/places/client.d.ts +28 -0
  63. package/dist/temporal/places/client.js +64 -0
  64. package/dist/temporal/places/client.js.map +1 -0
  65. package/dist/temporal/places/contrat.d.ts +106 -0
  66. package/dist/temporal/places/contrat.js +21 -0
  67. package/dist/temporal/places/contrat.js.map +1 -0
  68. package/dist/temporal/places/deroule.d.ts +3 -0
  69. package/dist/temporal/places/deroule.js +198 -0
  70. package/dist/temporal/places/deroule.js.map +1 -0
  71. package/dist/temporal/sonde/activites.d.ts +6 -0
  72. package/dist/temporal/sonde/activites.js +52 -0
  73. package/dist/temporal/sonde/activites.js.map +1 -0
  74. package/dist/temporal/sonde/contrat.d.ts +35 -0
  75. package/dist/temporal/sonde/contrat.js +10 -0
  76. package/dist/temporal/sonde/contrat.js.map +1 -0
  77. package/dist/temporal/sonde/deroule.d.ts +3 -0
  78. package/dist/temporal/sonde/deroule.js +39 -0
  79. package/dist/temporal/sonde/deroule.js.map +1 -0
  80. package/dist/temporal/tickets/activites.d.ts +7 -0
  81. package/dist/temporal/tickets/activites.js +81 -0
  82. package/dist/temporal/tickets/activites.js.map +1 -0
  83. package/dist/temporal/tickets/client.d.ts +10 -0
  84. package/dist/temporal/tickets/client.js +31 -0
  85. package/dist/temporal/tickets/client.js.map +1 -0
  86. package/dist/temporal/tickets/contrat.d.ts +56 -0
  87. package/dist/temporal/tickets/contrat.js +13 -0
  88. package/dist/temporal/tickets/contrat.js.map +1 -0
  89. package/dist/temporal/tickets/deroule.d.ts +3 -0
  90. package/dist/temporal/tickets/deroule.js +94 -0
  91. package/dist/temporal/tickets/deroule.js.map +1 -0
  92. package/dist/temporal/travailleur.d.ts +2 -0
  93. package/dist/temporal/travailleur.js +69 -0
  94. package/dist/temporal/travailleur.js.map +1 -0
  95. package/docs/ARCHITECTURE.md +813 -53
  96. package/docs/CADRE.md +17 -0
  97. package/docs/INTERFACE.md +161 -30
  98. package/hooks/crochet.mjs +19 -2
  99. package/hooks/hooks.json +11 -0
  100. package/package.json +16 -4
  101. package/scripts/activites.mjs +2182 -0
  102. package/scripts/aiguillage.d.mts +37 -0
  103. package/scripts/aiguillage.mjs +328 -0
  104. package/scripts/avancement.mjs +159 -64
  105. package/scripts/bilan.mjs +37 -19
  106. package/scripts/cadre.mjs +11 -2
  107. package/scripts/circuit.mjs +888 -3654
  108. package/scripts/circuits-cles.d.mts +4 -0
  109. package/scripts/circuits-cles.mjs +21 -0
  110. package/scripts/circuits-du-serveur.mjs +105 -0
  111. package/scripts/codes-de-sortie.mjs +9 -0
  112. package/scripts/commandes-composees.mjs +45 -41
  113. package/scripts/commandes-du-path.d.mts +7 -0
  114. package/scripts/commandes-du-path.mjs +25 -0
  115. package/scripts/composition-des-langages.mjs +30 -11
  116. package/scripts/conformite.mjs +19 -10
  117. package/scripts/copies-finies.mjs +188 -42
  118. package/scripts/depart-du-ticket.d.mts +53 -0
  119. package/scripts/depart-du-ticket.mjs +124 -0
  120. package/scripts/dependances-internes.mjs +115 -0
  121. package/scripts/dernier-vert.mjs +7 -15
  122. package/scripts/donnees-cles.mjs +228 -0
  123. package/scripts/droits.mjs +11 -1
  124. package/scripts/effets.mjs +352 -0
  125. package/scripts/enveloppe/enveloppe.mjs +119 -8
  126. package/scripts/enveloppe/lancer.sh +27 -32
  127. package/scripts/enveloppe/paquets-du-plan.mjs +2 -2
  128. package/scripts/enveloppe/travail-de-la-copie.mjs +99 -12
  129. package/scripts/etapes.mjs +6 -3
  130. package/scripts/faits-du-circuit.mjs +493 -0
  131. package/scripts/file-des-tickets.d.mts +21 -0
  132. package/scripts/file-des-tickets.mjs +58 -0
  133. package/scripts/flux-des-paquets.mjs +187 -0
  134. package/scripts/fusion-du-changelog.mjs +0 -1
  135. package/scripts/gardes-du-cadre.mjs +12 -2
  136. package/scripts/grillhouse-maj.mjs +16 -7
  137. package/scripts/integration/file.mjs +477 -422
  138. package/scripts/integration/integrer.mjs +20 -22
  139. package/scripts/integration/rejeu.mjs +19 -4
  140. package/scripts/jointure.d.ts +168 -28
  141. package/scripts/langages/cargo/commandes.mjs +426 -119
  142. package/scripts/langages/cargo/composants.mjs +187 -3
  143. package/scripts/langages/cargo/exemples.mjs +75 -17
  144. package/scripts/langages/cargo/index.mjs +32 -13
  145. package/scripts/langages/cargo/migrations/0.28.4-tailles-des-tests.mjs +35 -0
  146. package/scripts/langages/cargo/sccache.mjs +62 -16
  147. package/scripts/langages/cargo/squelette.mjs +72 -3
  148. package/scripts/langages/cargo/tailles-des-tests.mjs +195 -0
  149. package/scripts/langages/cargo/tests-de-head.mjs +159 -0
  150. package/scripts/langages/python/commandes.mjs +232 -79
  151. package/scripts/langages/python/composants.mjs +65 -3
  152. package/scripts/langages/python/exemples.mjs +21 -12
  153. package/scripts/langages/python/index.mjs +25 -5
  154. package/scripts/langages/python/lot.mjs +1 -36
  155. package/scripts/langages/python/squelette.mjs +119 -17
  156. package/scripts/langages/typescript/construire.mjs +6 -163
  157. package/scripts/langages/typescript/exemples.mjs +19 -11
  158. package/scripts/langages/typescript/frontieres.mjs +1 -1
  159. package/scripts/langages/typescript/index.mjs +48 -63
  160. package/scripts/langages/typescript/interfaces-contre-code.mjs +4 -4
  161. package/scripts/langages/typescript/migrations/0.30.0-prefixe-des-tickets.mjs +63 -0
  162. package/scripts/langages/typescript/migrations/0.30.0-tailles-des-outils-lourds.mjs +31 -0
  163. package/scripts/langages/typescript/migrations/0.30.0-titres-nommant-un-ticket.mjs +40 -0
  164. package/scripts/langages/typescript/mise-a-jour.mjs +1 -2
  165. package/scripts/langages/typescript/regle-des-tests.mjs +13 -0
  166. package/scripts/langages/typescript/squelette.mjs +18 -2
  167. package/scripts/langages/typescript/tailles-des-tests.mjs +40 -9
  168. package/scripts/langages/typescript/tests-de-nuit.mjs +44 -21
  169. package/scripts/langages/typescript/tests.mjs +17 -8
  170. package/scripts/langages/typescript/titres-de-tests.mjs +297 -0
  171. package/scripts/langages/typescript/turbo-des-paquets.mjs +183 -38
  172. package/scripts/langages/typescript/verdict.mjs +1 -1
  173. package/scripts/langages/typescript/verifier.mjs +110 -296
  174. package/scripts/langages/typescript/vitest-config/base.mjs +30 -10
  175. package/scripts/langages/typescript/vitest-config/bornes.mjs +13 -0
  176. package/scripts/langages/typescript/vitest-config/cibles.mjs +123 -62
  177. package/scripts/langages/typescript/vitest-config/delais.mjs +54 -0
  178. package/scripts/langages/typescript/vitest-config/delais.setup.mjs +11 -0
  179. package/scripts/langages/typescript/vitest-config/duree.classement.mjs +100 -0
  180. package/scripts/langages/typescript/vitest-config/duree.reporter.mjs +56 -64
  181. package/scripts/langages/typescript/vitest-config/machine.setup.mjs +7 -2
  182. package/scripts/langages/typescript/vitest-config/mesure.mjs +3 -2
  183. package/scripts/langages/typescript/vitest.nuit.config.mjs +22 -13
  184. package/scripts/lecture-unique.mjs +51 -0
  185. package/scripts/mesure/pression.mjs +11 -9
  186. package/scripts/mesure-de-la-machine.d.mts +21 -0
  187. package/scripts/mesure-de-la-machine.mjs +76 -0
  188. package/scripts/migrations/0.23.2-copies-du-cadre.mjs +8 -2
  189. package/scripts/migrations/0.30.0-ci-appelle-la-verification.mjs +120 -0
  190. package/scripts/migrations/0.31.0-paquets-dans-le-graphe.mjs +81 -0
  191. package/scripts/migrations.mjs +5 -0
  192. package/scripts/nuit.sh +29 -15
  193. package/scripts/outil.mjs +72 -0
  194. package/scripts/outils-cles.d.mts +24 -0
  195. package/scripts/outils-cles.mjs +0 -1
  196. package/scripts/paquet-npm.mjs +147 -0
  197. package/scripts/paquet.mjs +112 -14
  198. package/scripts/paquets.mjs +34 -6
  199. package/scripts/passe-de-la-machine.mjs +66 -0
  200. package/scripts/places-de-la-machine.mjs +360 -0
  201. package/scripts/places-du-serveur.mjs +170 -0
  202. package/scripts/prefixe-des-tickets.mjs +68 -0
  203. package/scripts/preparation.mjs +10 -3
  204. package/scripts/registre.mjs +3 -2
  205. package/scripts/regles-des-places.d.mts +36 -0
  206. package/scripts/regles-des-places.mjs +70 -0
  207. package/scripts/reponses-du-circuit.d.mts +6 -0
  208. package/scripts/reponses-du-circuit.mjs +28 -0
  209. package/scripts/resultats.mjs +29 -14
  210. package/scripts/retirer-les-copies-finies.mjs +25 -0
  211. package/scripts/sans-reponse.d.mts +4 -0
  212. package/scripts/sans-reponse.mjs +13 -0
  213. package/scripts/seances.mjs +918 -0
  214. package/scripts/services-du-noyau.mjs +28 -11
  215. package/scripts/session-start.sh +10 -1
  216. package/scripts/sortie.mjs +23 -4
  217. package/scripts/sources.mjs +3 -3
  218. package/scripts/sous-commandes.mjs +39 -9
  219. package/scripts/style-a-l-ecriture.mjs +229 -0
  220. package/scripts/superviseur.mjs +382 -16
  221. package/scripts/tableau.mjs +329 -130
  222. package/scripts/taches-du-graphe.mjs +328 -0
  223. package/scripts/ticket-du-circuit.mjs +206 -0
  224. package/scripts/transitions.d.mts +148 -0
  225. package/scripts/transitions.mjs +901 -0
  226. package/scripts/verrou-de-fichier.mjs +2 -2
  227. package/scripts/verrou-de-machine.mjs +322 -62
  228. package/skills/developpeur/SKILL.md +11 -3
  229. package/skills/explorateur/SKILL.md +2 -1
  230. package/skills/pitmaster/SKILL.md +62 -28
  231. package/skills/pitmaster/references/consigne-agent.md +5 -1
  232. package/skills/release/SKILL.md +3 -3
  233. package/skills/relecteur/SKILL.md +22 -8
  234. package/skills/testwriter/SKILL.md +47 -39
  235. package/scripts/demon.mjs +0 -138
  236. package/scripts/integration/file-attente.mjs +0 -61
  237. package/scripts/langages/cargo/touches.mjs +0 -93
  238. 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,26 +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`) are
23
- // left out (`--ignore-glob`), and a night test plays when its own file is named. `--force`
24
- // changes nothing: pytest keeps no result to replay. Another option goes to pytest.
25
- // - `verifier` plays, in each package the changes since the last green touch (every package with
26
- // `--tout`, or when no last green counts), the typing then the tests of the day; green, it keeps
27
- // the last green (scripts/dernier-vert.mjs). It plays under the lock of the machine
28
- // (`avecLaMachine` of ./jointure), as the module cargo's. `verifier --gardes` plays the guards
29
- // 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.
30
54
  // - `typer`: `uv run --locked python -m compileall`, the folders whose name begins with a dot (the
31
55
  // `.venv`) left out. `preparer`: `uv sync --locked --group test`.
32
56
  // - `tests-de-nuit`: pytest on the night tests of each package that holds some; none, nothing
33
57
  // plays and the code is 0. The night (scripts/nuit.sh) runs it.
34
- // - Each command plays under a temporary directory of its pass, the guard of the temporary
35
- // 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
36
65
  // end of the pass, green, red or interrupted; what the tests left there fails the pass (code 1),
37
66
  // each name written on the error stream, the lock files uv takes there (`uv-<hash>.lock`) apart,
38
67
  // which the base removes with the rest. A test makes its temporary
@@ -59,16 +88,22 @@ import { fileURLToPath, pathToFileURL } from 'node:url';
59
88
  import { RESULTATS } from '../../resultats.mjs';
60
89
  import {
61
90
  AttenteDeLaMachine,
62
- avecLaMachine,
91
+ surUnePlace,
92
+ avecLaMachineEtUnePlace,
63
93
  cacheDeCompilation,
64
- CHANGEMENTS,
65
- DEPUIS_LE_VERT,
66
- garderLeVert,
94
+ cheminsDeLaTache,
95
+ construireDepuisLesArguments,
96
+ GRAPHE_JOUE,
97
+ lancerLesTaches,
67
98
  ligneDesRestes,
68
- mesure,
99
+ nomDuPaquet,
69
100
  ouvrirBase,
70
101
  retirerALInterruption,
102
+ SCRIPT_DES_TESTS,
103
+ testsCibles,
104
+ travailleursDeLaSeance,
71
105
  } from '../../services-du-noyau.mjs';
106
+ import { TYPAGE } from '../../paquets.mjs';
72
107
  import {
73
108
  composantDans,
74
109
  composants,
@@ -77,11 +112,20 @@ import {
77
112
  GROUPE,
78
113
  joueDesTests,
79
114
  } from './composants.mjs';
80
- import { touchesDesFichiers } from './lot.mjs';
81
115
  import { JUNIT, TACHES } from './verdict.mjs';
82
116
 
83
117
  const ICI = fileURLToPath(import.meta.url);
84
- 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';
85
129
  const A_REPASSER = 75;
86
130
  const RACINE = '//';
87
131
  /** The night tests, which the day leaves out. */
@@ -158,7 +202,8 @@ function passe(racine, env) {
158
202
  rapports[f] = dossierDuPaquet;
159
203
  return ['-o', 'junit_family=xunit1', `--junit-xml=${path.join(dossier, JUNIT, f)}`];
160
204
  },
161
- jouer({ t, args, cwd, programme }) {
205
+ // <vert>, the codes that count green beside 0.
206
+ jouer({ t, args, cwd, programme }, vert = []) {
162
207
  // The environment of uv of the package, at the root (`sorties` of ./index.mjs).
163
208
  const venv = path.join(racine, VENV, path.relative(racine, cwd));
164
209
  const r = spawnSync(programme, args, {
@@ -170,6 +215,9 @@ function passe(racine, env) {
170
215
  process.stderr.write("⛔ uv absent du PATH : `npx grillhouse maj` l'installe.\n");
171
216
  }
172
217
  t.code = r.error ? 127 : (r.status ?? 128 + (constants.signals[r.signal] ?? 0));
218
+ if (vert.includes(t.code)) {
219
+ t.code = 0;
220
+ }
173
221
  ecrire();
174
222
  return t.code;
175
223
  },
@@ -184,32 +232,44 @@ function passe(racine, env) {
184
232
  }
185
233
 
186
234
  const UV_RUN = ['run', '--locked'];
235
+ // The code of pytest for « no tests collected », distinct from a failure (1).
236
+ const AUCUN_TEST = 5;
237
+
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
+ }
252
+ }
187
253
 
188
254
  // Plays pytest in the run <p> for each `{ c, chemins }` of <choix>, `chemins` from the package's
189
- // folder (empty: the whole package, the night left out), <options> given to pytest.
255
+ // folder (empty: the whole package), the night left out (`selection`), <options> given to pytest.
256
+ // The package played whole (no path, or its own folder) that collects no test is green, as
257
+ // `cargo test` on a crate without a test; a path within it that collects none stays red.
190
258
  function jouerLesTests(p, choix, options) {
191
259
  for (const { c, chemins } of choix) {
192
- const selection = chemins.length ? chemins : [`--ignore-glob=${DE_NUIT}`];
193
260
  const cache = path.join(p.racine, CACHE_DE_PYTEST, path.relative(p.racine, c.dossier));
194
261
  const args = [...UV_RUN, '--group', GROUPE, 'pytest', '-o', `cache_dir=${cache}`];
195
262
  args.push(...p.junit(c.nom, c.dossier));
196
- p.jouer(p.prevoir(c.nom, c.dossier, 'pytest', true, [...args, ...selection, ...options]));
197
- }
198
- }
199
-
200
- // The packages the changes since the last green of <racine> touch; every package with <tout> or
201
- // without a last green that counts. `{ choix, m }`, `m` the measure.
202
- function depuisLeVert(racine, tous, tout, env) {
203
- const m = mesure(racine, { tout, dans: env.TMPDIR });
204
- process.stderr.write(`${m.ligne}\n`);
205
- const f = m.env[CHANGEMENTS];
206
- if (!f) {
207
- return { choix: tous, m };
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));
267
+ const entier = chemins.every(ch => ch === '.');
268
+ p.jouer(
269
+ p.prevoir(c.nom, c.dossier, 'pytest', true, [...args, ...selection(chemins), ...options]),
270
+ entier ? [AUCUN_TEST] : []
271
+ );
208
272
  }
209
- const ch = JSON.parse(readFileSync(f, 'utf8'));
210
- const t = touchesDesFichiers(racine, [...ch.fichiers, ...ch.supprimes]);
211
- const nommes = new Set(t.touches.map(c => c.dossier));
212
- return { choix: tous.filter(c => nommes.has(c.dossier)), m };
213
273
  }
214
274
 
215
275
  // The packages the paths <chemins> choose in <racine>: `{ choix }`, or `{ refus }`.
@@ -222,6 +282,13 @@ function choisir(racine, tous, chemins) {
222
282
  refus.push(`${chemin} : hors de tout paquet Python (pyproject.toml)`);
223
283
  continue;
224
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
+ }
225
292
  const rel = path.relative(c.dossier, path.resolve(racine, chemin)) || '.';
226
293
  const deja = parDossier.get(c.dossier) ?? { c, chemins: [] };
227
294
  deja.chemins.push(rel);
@@ -230,12 +297,40 @@ function choisir(racine, tous, chemins) {
230
297
  return refus.length ? { refus } : { choix: [...parDossier.values()] };
231
298
  }
232
299
 
233
- // 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.
234
329
  function tester(racine, args, env) {
235
- const p = passe(racine, env);
236
330
  const tous = composants(racine);
237
331
  const chemins = args.filter(a => !a.startsWith('-'));
238
332
  const options = args.filter(a => a.startsWith('-') && a !== '--force');
333
+ let choisis = tous.filter(c => joueDesTests(racine, c));
239
334
  if (chemins.length) {
240
335
  const r = choisir(racine, tous, chemins);
241
336
  if (r.refus) {
@@ -244,48 +339,83 @@ function tester(racine, args, env) {
244
339
  }
245
340
  return 2;
246
341
  }
247
- jouerLesTests(p, r.choix, options);
248
- return p.code();
342
+ choisis = r.choix.map(x => x.c);
249
343
  }
250
- let m = null;
251
- let choix = tous;
252
- if (env[DEPUIS_LE_VERT]) {
253
- ({ 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;
254
350
  }
255
- try {
256
- const avec = choix.filter(c => joueDesTests(racine, c)).map(c => ({ c, chemins: [] }));
257
- jouerLesTests(p, avec, options);
258
- } finally {
259
- 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;
260
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;
388
+ }
389
+ const p = passe(racine, env);
390
+ jouerLesTests(p, r.choix, [...args.filter(a => a.startsWith('-')), ...options]);
261
391
  return p.code();
262
392
  }
263
393
 
264
394
  // The pass of `verifier` in <racine>, under the lock of the machine: the typing and the tests of
265
- // 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.
266
397
  function verifier(racine, args, env) {
267
- const p = passe(racine, env);
268
398
  if (args.includes('--gardes')) {
269
- return gardes(racine, p);
399
+ return gardes(racine, passe(racine, env));
270
400
  }
271
- const { choix, m } = depuisLeVert(racine, composants(racine), args.includes('--tout'), env);
272
- try {
273
- for (const c of choix) {
274
- typerLePaquet(p, c);
275
- }
276
- jouerLesTests(
277
- p,
278
- choix.filter(c => joueDesTests(racine, c)).map(c => ({ c, chemins: [] })),
279
- []
280
- );
281
- const code = p.code();
282
- if (code === 0 && m.etat) {
283
- garderLeVert(m.etat);
284
- }
285
- return code;
286
- } finally {
287
- 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;
288
404
  }
405
+ const { noms, absents } = nomsDuGraphe(racine, composants(racine));
406
+ direLesAbsents(absents);
407
+ if (noms.size === 0) {
408
+ return 0;
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;
289
419
  }
290
420
 
291
421
  // The typing of the package <c> in the run <p>: compileall, the folders of a dot left out.
@@ -353,7 +483,10 @@ function sousLaBase(genre, env, jouer) {
353
483
  */
354
484
  export function lancer(nom, args, { racine = process.cwd(), env = process.env } = {}) {
355
485
  if (nom === 'tester') {
356
- 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));
357
490
  }
358
491
  if (nom === 'tests-de-nuit') {
359
492
  return sousLaBase('tests', env, e => {
@@ -374,7 +507,7 @@ export function lancer(nom, args, { racine = process.cwd(), env = process.env }
374
507
  const dire = l => process.stdout.write(`${l}\n`);
375
508
  try {
376
509
  return sousLaBase('verification', env, envBase =>
377
- avecLaMachine(envMachine => verifier(racine, args, envMachine), {
510
+ avecLaMachineEtUnePlace(envMachine => verifier(racine, args, envMachine), {
378
511
  env: envBase,
379
512
  racine,
380
513
  dire,
@@ -388,10 +521,30 @@ export function lancer(nom, args, { racine = process.cwd(), env = process.env }
388
521
  return e.code;
389
522
  }
390
523
  }
391
- 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
+ }
392
545
  return sousLaBase('tests', env, e => {
393
546
  const p = passe(racine, e);
394
- for (const c of composants(racine)) {
547
+ for (const c of choisis) {
395
548
  if (nom === 'typer') {
396
549
  typerLePaquet(p, c);
397
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`, `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,7 +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 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
23
25
  // with smol-toml, a tool of this module (`outils`), an optional peer of the package loaded when a
24
26
  // manifest is judged.
25
27
  // - The readers of a package: none read by the module (a dependency between two packages of
@@ -32,6 +34,7 @@ import { existsSync, readdirSync, readFileSync } from 'node:fs';
32
34
  import { createRequire } from 'node:module';
33
35
  import path from 'node:path';
34
36
  import { isDeepStrictEqual } from 'node:util';
37
+ import { luUneFois } from '../../services-du-noyau.mjs';
35
38
 
36
39
  const require = createRequire(import.meta.url);
37
40
 
@@ -74,8 +77,14 @@ function dossiersAvecManifeste(dossier) {
74
77
  return out;
75
78
  }
76
79
 
77
- /** The components of the project at <racine>, sorted by folder. */
80
+ /** The components of the project at <racine>, sorted by folder; read once in a scope of the core
81
+ * (`luUneFois`): a sweep asks it of every file of a folder. */
78
82
  export function composants(racine) {
83
+ return luUneFois(`python composants ${path.resolve(racine)}`, () => lireLesComposants(racine));
84
+ }
85
+
86
+ // The components of `composants`, read at each call.
87
+ function lireLesComposants(racine) {
79
88
  return dossiersAvecManifeste(racine)
80
89
  .sort()
81
90
  .map(dossier => ({
@@ -137,6 +146,15 @@ export function estUnTest(chemin, racine) {
137
146
  return null;
138
147
  }
139
148
 
149
+ /**
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.
153
+ */
154
+ export function arbreDAvant(chemin, racine) {
155
+ return Boolean(estUnTest(chemin, racine)?.joue);
156
+ }
157
+
140
158
  // The parts of the parsed manifests <a> and <b> that differ, out of the group of the tests: each
141
159
  // `[<table>]`, a group of `[dependency-groups]` as `[dependency-groups].<groupe>`, a key out of
142
160
  // every table bare.
@@ -194,6 +212,50 @@ function horsDesTests(chemin, racine, avant, apres) {
194
212
  /** What the testwriter writes of the manifests (scripts/jointure.d.ts, `manifestes`). */
195
213
  export const manifestes = { verrous: [VERROU], horsDesTests };
196
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
+
197
259
  /** The readers of the packages <noms>: none; a name no component bears, without provider. */
198
260
  export function lecteurs(_racine, { composants: liste, noms }) {
199
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'],
@@ -227,6 +217,25 @@ export default {
227
217
  'site/tests/donnees.json : test',
228
218
  ],
229
219
  },
220
+ versionDeHead: {
221
+ valide: [
222
+ 'site/pages/generer.py',
223
+ 'site/conftest.py',
224
+ 'site/tests/donnees.json',
225
+ 'README.md',
226
+ ],
227
+ // A test file plays in a tree, under its own name, a night test as a night test.
228
+ invalide: [
229
+ 'site/pages/test_pages.py',
230
+ 'site/pages/pages_test.py',
231
+ 'site/pages/site_nuit_test.py',
232
+ ],
233
+ attendu: [
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',
237
+ ],
238
+ },
230
239
  fichiersEngendres: {
231
240
  valide: aJour,
232
241
  invalide: enRetard,