@roomi-fields/grillhouse 0.29.0 → 0.31.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 (263) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/CHANGELOG.md +769 -0
  3. package/agents/developpeur.md +0 -1
  4. package/agents/explorateur.md +0 -1
  5. package/agents/questionneur.md +0 -1
  6. package/agents/testwriter.md +0 -1
  7. package/bin/grillhouse.mjs +79 -18
  8. package/cadre/templates/projet/.github/workflows/ci.yml +2 -13
  9. package/cadre/templates/projet/CLAUDE.md +5 -1
  10. package/cadre/templates/projet/docs/agents/issue-tracker.md +1 -1
  11. package/cadre/templates/projet/package.json +2 -2
  12. package/charte.md +24 -0
  13. package/dist/temporal/acte.d.ts +24 -0
  14. package/dist/temporal/acte.js +139 -0
  15. package/dist/temporal/acte.js.map +1 -0
  16. package/dist/temporal/attributs.d.ts +6 -0
  17. package/dist/temporal/attributs.js +15 -0
  18. package/dist/temporal/attributs.js.map +1 -0
  19. package/dist/temporal/circuit/activites.d.ts +13 -0
  20. package/dist/temporal/circuit/activites.js +33 -0
  21. package/dist/temporal/circuit/activites.js.map +1 -0
  22. package/dist/temporal/circuit/client.d.ts +72 -0
  23. package/dist/temporal/circuit/client.js +247 -0
  24. package/dist/temporal/circuit/client.js.map +1 -0
  25. package/dist/temporal/circuit/commande.d.ts +2 -0
  26. package/dist/temporal/circuit/commande.js +238 -0
  27. package/dist/temporal/circuit/commande.js.map +1 -0
  28. package/dist/temporal/circuit/contrat.d.ts +305 -0
  29. package/dist/temporal/circuit/contrat.js +30 -0
  30. package/dist/temporal/circuit/contrat.js.map +1 -0
  31. package/dist/temporal/circuit/deroule.d.ts +3 -0
  32. package/dist/temporal/circuit/deroule.js +540 -0
  33. package/dist/temporal/circuit/deroule.js.map +1 -0
  34. package/dist/temporal/client.d.ts +47 -0
  35. package/dist/temporal/client.js +69 -0
  36. package/dist/temporal/client.js.map +1 -0
  37. package/dist/temporal/commande.d.ts +2 -0
  38. package/dist/temporal/commande.js +94 -0
  39. package/dist/temporal/commande.js.map +1 -0
  40. package/dist/temporal/deroules.d.ts +5 -0
  41. package/dist/temporal/deroules.js +10 -0
  42. package/dist/temporal/deroules.js.map +1 -0
  43. package/dist/temporal/etat.d.ts +33 -0
  44. package/dist/temporal/etat.js +59 -0
  45. package/dist/temporal/etat.js.map +1 -0
  46. package/dist/temporal/file/activites.d.ts +10 -0
  47. package/dist/temporal/file/activites.js +25 -0
  48. package/dist/temporal/file/activites.js.map +1 -0
  49. package/dist/temporal/file/client.d.ts +4 -0
  50. package/dist/temporal/file/client.js +6 -0
  51. package/dist/temporal/file/client.js.map +1 -0
  52. package/dist/temporal/file/contrat.d.ts +158 -0
  53. package/dist/temporal/file/contrat.js +14 -0
  54. package/dist/temporal/file/contrat.js.map +1 -0
  55. package/dist/temporal/file/deroule.d.ts +15 -0
  56. package/dist/temporal/file/deroule.js +235 -0
  57. package/dist/temporal/file/deroule.js.map +1 -0
  58. package/dist/temporal/installation.d.ts +120 -0
  59. package/dist/temporal/installation.js +386 -0
  60. package/dist/temporal/installation.js.map +1 -0
  61. package/dist/temporal/places/activites.d.ts +8 -0
  62. package/dist/temporal/places/activites.js +13 -0
  63. package/dist/temporal/places/activites.js.map +1 -0
  64. package/dist/temporal/places/client.d.ts +28 -0
  65. package/dist/temporal/places/client.js +64 -0
  66. package/dist/temporal/places/client.js.map +1 -0
  67. package/dist/temporal/places/contrat.d.ts +106 -0
  68. package/dist/temporal/places/contrat.js +21 -0
  69. package/dist/temporal/places/contrat.js.map +1 -0
  70. package/dist/temporal/places/deroule.d.ts +3 -0
  71. package/dist/temporal/places/deroule.js +198 -0
  72. package/dist/temporal/places/deroule.js.map +1 -0
  73. package/dist/temporal/sonde/activites.d.ts +6 -0
  74. package/dist/temporal/sonde/activites.js +52 -0
  75. package/dist/temporal/sonde/activites.js.map +1 -0
  76. package/dist/temporal/sonde/contrat.d.ts +35 -0
  77. package/dist/temporal/sonde/contrat.js +10 -0
  78. package/dist/temporal/sonde/contrat.js.map +1 -0
  79. package/dist/temporal/sonde/deroule.d.ts +3 -0
  80. package/dist/temporal/sonde/deroule.js +39 -0
  81. package/dist/temporal/sonde/deroule.js.map +1 -0
  82. package/dist/temporal/tickets/activites.d.ts +7 -0
  83. package/dist/temporal/tickets/activites.js +81 -0
  84. package/dist/temporal/tickets/activites.js.map +1 -0
  85. package/dist/temporal/tickets/client.d.ts +10 -0
  86. package/dist/temporal/tickets/client.js +31 -0
  87. package/dist/temporal/tickets/client.js.map +1 -0
  88. package/dist/temporal/tickets/contrat.d.ts +56 -0
  89. package/dist/temporal/tickets/contrat.js +13 -0
  90. package/dist/temporal/tickets/contrat.js.map +1 -0
  91. package/dist/temporal/tickets/deroule.d.ts +3 -0
  92. package/dist/temporal/tickets/deroule.js +94 -0
  93. package/dist/temporal/tickets/deroule.js.map +1 -0
  94. package/dist/temporal/travailleur.d.ts +2 -0
  95. package/dist/temporal/travailleur.js +69 -0
  96. package/dist/temporal/travailleur.js.map +1 -0
  97. package/docs/ARCHITECTURE.md +646 -87
  98. package/docs/CADRE.md +27 -0
  99. package/docs/INTERFACE.md +139 -42
  100. package/hooks/crochet.mjs +19 -2
  101. package/hooks/hooks.json +11 -0
  102. package/package.json +16 -4
  103. package/scripts/activites.mjs +2255 -0
  104. package/scripts/aiguillage.d.mts +37 -0
  105. package/scripts/aiguillage.mjs +40 -14
  106. package/scripts/avancement.mjs +155 -26
  107. package/scripts/bilan.mjs +137 -43
  108. package/scripts/cadre.mjs +16 -4
  109. package/scripts/circuit.mjs +993 -4075
  110. package/scripts/circuits-cles.d.mts +4 -0
  111. package/scripts/circuits-cles.mjs +21 -0
  112. package/scripts/circuits-du-serveur.mjs +105 -0
  113. package/scripts/codes-de-sortie.mjs +9 -0
  114. package/scripts/commandes-composees.mjs +45 -41
  115. package/scripts/commandes-du-path.d.mts +7 -0
  116. package/scripts/commandes-du-path.mjs +25 -0
  117. package/scripts/composants-affectes.mjs +64 -21
  118. package/scripts/composition-des-langages.mjs +18 -12
  119. package/scripts/conformite.mjs +56 -28
  120. package/scripts/copies-finies.mjs +52 -47
  121. package/scripts/depart-du-ticket.d.mts +53 -0
  122. package/scripts/depart-du-ticket.mjs +124 -0
  123. package/scripts/dependances-internes.mjs +121 -0
  124. package/scripts/dernier-vert.mjs +61 -34
  125. package/scripts/dette.mjs +32 -11
  126. package/scripts/donnees-cles.mjs +244 -0
  127. package/scripts/droits.mjs +51 -16
  128. package/scripts/effets.mjs +352 -0
  129. package/scripts/empreinte-d-etape.mjs +17 -0
  130. package/scripts/engendres.mjs +15 -5
  131. package/scripts/enveloppe/enveloppe.mjs +259 -55
  132. package/scripts/enveloppe/lancer.sh +14 -18
  133. package/scripts/enveloppe/paquets-du-plan.mjs +2 -2
  134. package/scripts/enveloppe/travail-de-la-copie.mjs +41 -13
  135. package/scripts/etapes.mjs +5 -2
  136. package/scripts/faits-du-circuit.mjs +493 -0
  137. package/scripts/file-des-tickets.d.mts +21 -0
  138. package/scripts/file-des-tickets.mjs +58 -0
  139. package/scripts/flux-des-paquets.mjs +201 -0
  140. package/scripts/gardes-du-cadre.mjs +21 -5
  141. package/scripts/init.mjs +11 -4
  142. package/scripts/integration/file.mjs +544 -434
  143. package/scripts/integration/integrer.mjs +87 -43
  144. package/scripts/integration/rejeu.mjs +45 -13
  145. package/scripts/jointure.d.ts +151 -28
  146. package/scripts/langages/cargo/commandes.mjs +383 -124
  147. package/scripts/langages/cargo/composants.mjs +154 -42
  148. package/scripts/langages/cargo/exemples.mjs +12 -21
  149. package/scripts/langages/cargo/index.mjs +22 -8
  150. package/scripts/langages/cargo/sccache.mjs +8 -14
  151. package/scripts/langages/cargo/tests-de-head.mjs +25 -9
  152. package/scripts/langages/python/commandes.mjs +218 -100
  153. package/scripts/langages/python/composants.mjs +53 -21
  154. package/scripts/langages/python/exemples.mjs +6 -16
  155. package/scripts/langages/python/index.mjs +28 -8
  156. package/scripts/langages/python/lot.mjs +1 -36
  157. package/scripts/langages/typescript/chemins-des-tests.mjs +6 -2
  158. package/scripts/langages/typescript/composants.mjs +9 -3
  159. package/scripts/langages/typescript/consommateurs-arbitres.mjs +40 -14
  160. package/scripts/langages/typescript/consommateurs.mjs +39 -14
  161. package/scripts/langages/typescript/construire.mjs +6 -163
  162. package/scripts/langages/typescript/elements-du-lot.mjs +36 -12
  163. package/scripts/langages/typescript/exemples.mjs +3 -11
  164. package/scripts/langages/typescript/frontieres.mjs +66 -22
  165. package/scripts/langages/typescript/index-interfaces.mjs +36 -13
  166. package/scripts/langages/typescript/index.mjs +50 -61
  167. package/scripts/langages/typescript/interfaces-contre-code.mjs +113 -45
  168. package/scripts/langages/typescript/lecteurs.mjs +36 -11
  169. package/scripts/langages/typescript/migrations/0.23.0-config-vitest.mjs +15 -5
  170. package/scripts/langages/typescript/migrations/0.25.0-chemins-des-tests.mjs +6 -2
  171. package/scripts/langages/typescript/migrations/0.25.0-tailles-des-tests.mjs +6 -2
  172. package/scripts/langages/typescript/migrations/0.30.0-prefixe-des-tickets.mjs +63 -0
  173. package/scripts/langages/typescript/migrations/0.30.0-tailles-des-outils-lourds.mjs +33 -0
  174. package/scripts/langages/typescript/migrations/0.30.0-titres-nommant-un-ticket.mjs +40 -0
  175. package/scripts/langages/typescript/mise-a-jour.mjs +1 -2
  176. package/scripts/langages/typescript/parcours.mjs +12 -4
  177. package/scripts/langages/typescript/regle-des-tests.mjs +9 -3
  178. package/scripts/langages/typescript/resumes.mjs +9 -3
  179. package/scripts/langages/typescript/tailles-des-tests.mjs +93 -20
  180. package/scripts/langages/typescript/tests-de-nuit.mjs +15 -10
  181. package/scripts/langages/typescript/tests.mjs +40 -15
  182. package/scripts/langages/typescript/titres-de-tests.mjs +320 -0
  183. package/scripts/langages/typescript/turbo-des-paquets.mjs +327 -81
  184. package/scripts/langages/typescript/verdict.mjs +4 -2
  185. package/scripts/langages/typescript/verifier.mjs +58 -20
  186. package/scripts/langages/typescript/vitest-config/avancement.reporter.mjs +15 -5
  187. package/scripts/langages/typescript/vitest-config/base.mjs +29 -3
  188. package/scripts/langages/typescript/vitest-config/bornes.mjs +13 -0
  189. package/scripts/langages/typescript/vitest-config/changements.mjs +21 -8
  190. package/scripts/langages/typescript/vitest-config/cibles.mjs +36 -14
  191. package/scripts/langages/typescript/vitest-config/delais.mjs +60 -0
  192. package/scripts/langages/typescript/vitest-config/delais.setup.mjs +11 -0
  193. package/scripts/langages/typescript/vitest-config/duree.classement.mjs +108 -0
  194. package/scripts/langages/typescript/vitest-config/duree.reporter.mjs +56 -59
  195. package/scripts/langages/typescript/vitest-config/lances.mjs +83 -27
  196. package/scripts/langages/typescript/vitest-config/machine.setup.mjs +10 -0
  197. package/scripts/langages/typescript/vitest-config/resultats.mjs +3 -1
  198. package/scripts/langages/typescript/vitest.nuit.config.mjs +4 -0
  199. package/scripts/lint-des-scripts.mjs +58 -0
  200. package/scripts/mesure/base-de-passe.mjs +117 -25
  201. package/scripts/mesure/pression.mjs +12 -6
  202. package/scripts/mesure-de-la-machine.d.mts +21 -0
  203. package/scripts/mesure-de-la-machine.mjs +76 -0
  204. package/scripts/migrations/0.23.0-charte-importee.mjs +6 -2
  205. package/scripts/migrations/0.23.0-crochets-de-seance.mjs +25 -8
  206. package/scripts/migrations/0.23.0-marche-du-projet.mjs +18 -6
  207. package/scripts/migrations/0.23.2-copies-du-cadre.mjs +56 -18
  208. package/scripts/migrations/0.24.12-tri-des-decouvertes.mjs +6 -2
  209. package/scripts/migrations/0.25.0-script-des-tests.mjs +15 -5
  210. package/scripts/migrations/0.30.0-ci-appelle-la-verification.mjs +124 -0
  211. package/scripts/migrations/0.31.0-paquets-dans-le-graphe.mjs +81 -0
  212. package/scripts/migrations.mjs +5 -0
  213. package/scripts/nuit.sh +25 -3
  214. package/scripts/outil.mjs +3 -1
  215. package/scripts/outils-cles.d.mts +24 -0
  216. package/scripts/outils-cles.mjs +18 -8
  217. package/scripts/paquet-npm.mjs +157 -0
  218. package/scripts/paquet.mjs +73 -4
  219. package/scripts/paquets.mjs +46 -10
  220. package/scripts/passe-de-la-machine.mjs +71 -0
  221. package/scripts/places-de-la-machine.mjs +414 -0
  222. package/scripts/places-du-serveur.mjs +170 -0
  223. package/scripts/prefixe-des-tickets.mjs +68 -0
  224. package/scripts/preparation.mjs +25 -8
  225. package/scripts/registre.mjs +9 -4
  226. package/scripts/regles-des-places.d.mts +36 -0
  227. package/scripts/regles-des-places.mjs +70 -0
  228. package/scripts/reponses-du-circuit.d.mts +6 -0
  229. package/scripts/reponses-du-circuit.mjs +28 -0
  230. package/scripts/reprise.mjs +66 -0
  231. package/scripts/resultats.mjs +112 -46
  232. package/scripts/retirer-les-copies-finies.mjs +25 -0
  233. package/scripts/sans-reponse.d.mts +4 -0
  234. package/scripts/sans-reponse.mjs +13 -0
  235. package/scripts/seances.mjs +936 -0
  236. package/scripts/services-du-noyau.mjs +27 -8
  237. package/scripts/session-start.sh +2 -2
  238. package/scripts/sortie.mjs +3 -3
  239. package/scripts/sous-commandes.mjs +41 -10
  240. package/scripts/style-a-l-ecriture.mjs +260 -0
  241. package/scripts/superviseur.mjs +122 -111
  242. package/scripts/tableau.mjs +180 -117
  243. package/scripts/taches-du-graphe.mjs +348 -0
  244. package/scripts/ticket-du-circuit.mjs +216 -0
  245. package/scripts/transitions.d.mts +148 -0
  246. package/scripts/transitions.mjs +1018 -0
  247. package/scripts/verrou-de-fichier.mjs +8 -4
  248. package/scripts/verrou-de-machine.mjs +150 -51
  249. package/scripts/verrous/commande.mjs +50 -17
  250. package/scripts/verrous/ticket-du-sous-agent.mjs +9 -3
  251. package/scripts/verrous/verrou.mjs +42 -14
  252. package/skills/explorateur/SKILL.md +9 -2
  253. package/skills/grill/SKILL.md +1 -1
  254. package/skills/mesure/SKILL.md +3 -0
  255. package/skills/pitmaster/SKILL.md +17 -18
  256. package/skills/pitmaster/references/consigne-agent.md +5 -1
  257. package/skills/release/SKILL.md +3 -3
  258. package/skills/relecteur/SKILL.md +5 -3
  259. package/skills/testwriter/SKILL.md +49 -31
  260. package/scripts/demon.mjs +0 -251
  261. package/scripts/integration/file-attente.mjs +0 -61
  262. package/scripts/langages/cargo/touches.mjs +0 -93
  263. package/scripts/langages/typescript/script-des-tests.mjs +0 -6
@@ -18,9 +18,10 @@
18
18
  // `requires-python` and `.python-version`. The rules that refuse a role that writes pytest run
19
19
  // directly (`droits`).
20
20
  // - The packages, a file's, the test files, what the testwriter writes, of the manifests too, the
21
- // readers, the entries of the index of the interfaces (./composants.mjs); the packages touched
22
- // since a commit and the elements of a lot (./lot.mjs).
23
- // - The commands `tester`, `verifier`, `typer`, `preparer` and `tests-de-nuit` (./commandes.mjs),
21
+ // readers, the entries of the index of the interfaces (./composants.mjs); the elements of a lot
22
+ // (./lot.mjs).
23
+ // - The commands `tester` (the projects' tasks of Turborepo), `tests-du-paquet` (the body of a
24
+ // project's task), `verifier`, `typer`, `preparer` and `tests-de-nuit` (./commandes.mjs),
24
25
  // each described, never run, and the verdict of a run (./verdict.mjs); the guard of the sizes of
25
26
  // the tests (./tailles-des-tests.mjs) and the index of the interfaces up to date, each a command
26
27
  // by its name too. The generated file, the index of the interfaces (./index-interfaces.mjs), its
@@ -32,19 +33,23 @@
32
33
  import { readFileSync } from 'node:fs';
33
34
  import path from 'node:path';
34
35
  import { fileURLToPath } from 'node:url';
36
+ import { empreintesDesTaches } from '../../services-du-noyau.mjs';
35
37
  import { commandes, GARDES, PYCACHE } from './commandes.mjs';
36
38
  import {
37
39
  composantDans,
38
40
  composants,
39
41
  entreesDeLIndex,
42
+ estDeNuit,
40
43
  estUnTest,
41
- soeurDAvant,
44
+ arbreDAvant,
42
45
  joueDesTests,
43
46
  lecteurs,
47
+ liensDuManifeste,
44
48
  manifestes,
49
+ nomDuManifeste,
45
50
  } from './composants.mjs';
46
51
  import { enRetard, SORTIE } from './index-interfaces.mjs';
47
- import { elementsDuLot, touches } from './lot.mjs';
52
+ import { elementsDuLot } from './lot.mjs';
48
53
  import { miseAJour } from './mise-a-jour.mjs';
49
54
  import { squelette } from './squelette.mjs';
50
55
  import { verdict } from './verdict.mjs';
@@ -54,6 +59,15 @@ const ici = nom => path.join(path.dirname(fileURLToPath(import.meta.url)), nom);
54
59
  export default {
55
60
  nom: 'python',
56
61
  manifeste: 'pyproject.toml',
62
+ nomDuManifeste,
63
+ liensDuManifeste,
64
+ construireLesPaquets: () => {
65
+ throw new Error('construction non prise en charge pour python');
66
+ },
67
+ // No output of a project of Python is a datum of another package's tests.
68
+ sortieDuPaquet: () => {
69
+ throw new Error('sortie non prise en charge pour python');
70
+ },
57
71
  outils: ['smol-toml'],
58
72
  binaires: JSON.parse(readFileSync(ici('binaires.json'), 'utf8')),
59
73
  ignorer: ['.venv', '.pytest_cache', PYCACHE],
@@ -74,13 +88,19 @@ export default {
74
88
  matieres: () => [],
75
89
  joueDesTests,
76
90
  lecteurs,
77
- touches,
78
91
  elementsDuLot,
92
+ // The hashes of the inputs of the tests tasks of the projects and their dependents, as
93
+ // Turborepo plans them.
94
+ empreintes: (racine, noms) => empreintesDesTaches('turbo', racine, noms),
79
95
  commandes,
80
96
  verdict,
81
97
  estUnTest,
82
- soeurDAvant,
83
- // Its tool plays HEAD's version of each test file beside it (`soeurDAvant`): no name to read.
98
+ // A night test, `*_nuit_test.py` (`estDeNuit`).
99
+ horsDuJour: chemin => estDeNuit(path.basename(chemin)),
100
+ arbreDAvant,
101
+ // Its tree needs no environment of its own: the virtual environment of a tree is uv's.
102
+ envDArbre: () => ({}),
103
+ // Its tool plays HEAD's version of each test file in a tree (`arbreDAvant`): no name to read.
84
104
  testsDeHead: () => null,
85
105
  manifestes,
86
106
  fichiersEngendres: () => [
@@ -1,16 +1,9 @@
1
- // The changes of a project of Python read by git: the packages touched since a commit (`touches`
2
- // of the join, scripts/jointure.d.ts) and the elements of a lot (`elementsDuLot`).
1
+ // The changes of a project of Python read by git: the elements of a lot (`elementsDuLot`).
3
2
  //
4
- // - The files changed since a commit: what git sees changed, the working tree and the untracked
5
- // files included (`git diff --name-only --no-renames <depuis>`, `git ls-files -o
6
- // --exclude-standard`). Each touches the package of the longest folder that holds it
7
- // (./composants.mjs); a file out of every package is out of the graph. No dependent: the module
8
- // reads no dependency between packages of Python.
9
3
  // - The lot between two commits (`git diff --name-only --no-renames <avant> <apres>`): every file
10
4
  // it changes in `fichiers`; the module reads no element of a source of Python, so each `.py` is
11
5
  // named in `horsDuService`, which the reviewer surveys himself.
12
6
  import { spawnSync } from 'node:child_process';
13
- import { composantDans, composants } from './composants.mjs';
14
7
 
15
8
  const lignesDeGit = (racine, args) => {
16
9
  const r = spawnSync('git', ['-C', racine, ...args, '-z'], {
@@ -23,34 +16,6 @@ const lignesDeGit = (racine, args) => {
23
16
  return r.stdout.split('\0').filter(Boolean);
24
17
  };
25
18
 
26
- /** The packages the files <fichiers> (from <racine>) touch, and the files out of the graph. */
27
- export function touchesDesFichiers(racine, fichiers) {
28
- const liste = composants(racine);
29
- const touches = new Set();
30
- const horsGraphe = [];
31
- for (const f of new Set(fichiers)) {
32
- const c = composantDans(liste, racine, f);
33
- if (c) {
34
- touches.add(c);
35
- } else {
36
- horsGraphe.push(f);
37
- }
38
- }
39
- return {
40
- touches: [...touches].sort((a, b) => a.nom.localeCompare(b.nom)),
41
- dependants: [],
42
- horsGraphe: horsGraphe.sort(),
43
- };
44
- }
45
-
46
- /** The packages touched in <racine> since the commit <depuis>, and the files out of the graph. */
47
- export function touches(racine, { depuis }) {
48
- return touchesDesFichiers(racine, [
49
- ...lignesDeGit(racine, ['diff', '--name-only', '--no-renames', depuis]),
50
- ...lignesDeGit(racine, ['ls-files', '-o', '--exclude-standard']),
51
- ]);
52
- }
53
-
54
19
  /** The elements of the lot of <racine> between <avant> and <apres>. */
55
20
  export function elementsDuLot(racine, { avant, apres }) {
56
21
  try {
@@ -62,7 +62,11 @@ export function verifier(racine) {
62
62
  if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) {
63
63
  const racine = process.cwd();
64
64
  const { refus, lignes } = trancher(racine, GARDE, verifier(racine));
65
- for (const r of refus) process.stderr.write(`⛔ ${r.message}\n`);
66
- for (const l of lignes) process.stderr.write(`${l}\n`);
65
+ for (const r of refus) {
66
+ process.stderr.write(`⛔ ${r.message}\n`);
67
+ }
68
+ for (const l of lignes) {
69
+ process.stderr.write(`${l}\n`);
70
+ }
67
71
  process.exitCode = refus.length ? 1 : 0;
68
72
  }
@@ -12,9 +12,13 @@ function tousDossiers(racine) {
12
12
  const found = [];
13
13
  for (const parent of ['packages', 'src']) {
14
14
  const base = path.join(racine, parent);
15
- if (!existsSync(base)) continue;
15
+ if (!existsSync(base)) {
16
+ continue;
17
+ }
16
18
  for (const e of readdirSync(base, { withFileTypes: true })) {
17
- if (e.isDirectory()) found.push({ nom: e.name, dir: path.join(base, e.name) });
19
+ if (e.isDirectory()) {
20
+ found.push({ nom: e.name, dir: path.join(base, e.name) });
21
+ }
18
22
  }
19
23
  }
20
24
  return found;
@@ -48,7 +52,9 @@ export function matieres(racine) {
48
52
  const found = [];
49
53
  for (const { nom, dir } of dossiers(racine)) {
50
54
  const pj = path.join(dir, 'package.json');
51
- if (!existsSync(pj)) continue;
55
+ if (!existsSync(pj)) {
56
+ continue;
57
+ }
52
58
  let paquet;
53
59
  try {
54
60
  paquet = JSON.parse(readFileSync(pj, 'utf8'));
@@ -55,8 +55,11 @@ function lignesConsommateurs(texte) {
55
55
  const out = [];
56
56
  let dedans = false;
57
57
  for (const l of ecrites) {
58
- if (/^##\s/.test(l)) dedans = /^##\s+Consommateurs\s*$/.test(l);
59
- else if (dedans && /^\s*-\s+\S/.test(l)) out.push(l.trim());
58
+ if (/^##\s/.test(l)) {
59
+ dedans = /^##\s+Consommateurs\s*$/.test(l);
60
+ } else if (dedans && /^\s*-\s+\S/.test(l)) {
61
+ out.push(l.trim());
62
+ }
60
63
  }
61
64
  return out;
62
65
  }
@@ -68,9 +71,14 @@ function section(description, titre) {
68
71
  let niveau = 0;
69
72
  for (const l of String(description ?? '').split('\n')) {
70
73
  const t = /^(#{1,6})\s+(.*)$/.exec(l);
71
- if (niveau && t && t[1].length <= niveau) break;
72
- if (niveau) out.push(l);
73
- else if (t && titre.test(t[2].trim())) niveau = t[1].length;
74
+ if (niveau && t && t[1].length <= niveau) {
75
+ break;
76
+ }
77
+ if (niveau) {
78
+ out.push(l);
79
+ } else if (t && titre.test(t[2].trim())) {
80
+ niveau = t[1].length;
81
+ }
74
82
  }
75
83
  return out.join('\n');
76
84
  }
@@ -108,7 +116,9 @@ function bdJson(principal, args) {
108
116
  encoding: 'utf8',
109
117
  maxBuffer: 256 * 1024 * 1024,
110
118
  });
111
- if (r.status !== 0) throw new Error(r.stderr || r.error?.message || `code ${r.status}`);
119
+ if (r.status !== 0) {
120
+ throw new Error(r.stderr || r.error?.message || `code ${r.status}`);
121
+ }
112
122
  return JSON.parse(r.stdout || '[]');
113
123
  }
114
124
 
@@ -117,11 +127,15 @@ function bdJson(principal, args) {
117
127
  // and plan read by bd from the main tree, judged by `juger`.
118
128
  export function verifier(racine, env = process.env) {
119
129
  const ticket = ticketDeLaCopie(racine);
120
- if (!ticket) return [];
130
+ if (!ticket) {
131
+ return [];
132
+ }
121
133
  const interfaces = [];
122
134
  for (const c of aVerifier(racine, env)) {
123
135
  const iface = path.join(c.dir, 'docs', 'INTERFACE.md');
124
- if (!existsSync(iface)) continue;
136
+ if (!existsSync(iface)) {
137
+ continue;
138
+ }
125
139
  const rel = path.relative(racine, iface);
126
140
  const head = git(racine, 'show', `HEAD:${rel}`);
127
141
  interfaces.push({
@@ -161,7 +175,9 @@ export function juger(ticket, interfaces, commentaires, ticketLu) {
161
175
  nomsAvant.set(l.consommateur, new Set([...(nomsAvant.get(l.consommateur) ?? []), ...l.noms]));
162
176
  }
163
177
  for (const ligne of lignesConsommateurs(apres)) {
164
- if (avant.has(ligne)) continue;
178
+ if (avant.has(ligne)) {
179
+ continue;
180
+ }
165
181
  const l = lireLigne(ligne);
166
182
  const lue = l?.noms ? l : null;
167
183
  const deja = lue && nomsAvant.get(lue.consommateur);
@@ -169,7 +185,9 @@ export function juger(ticket, interfaces, commentaires, ticketLu) {
169
185
  changees.push({ rel, ligne, lue, ajoutes });
170
186
  }
171
187
  }
172
- if (changees.length === 0) return [];
188
+ if (changees.length === 0) {
189
+ return [];
190
+ }
173
191
  let comments;
174
192
  try {
175
193
  comments = (commentaires() ?? []).map(x => ({ text: String(x.text ?? '') }));
@@ -185,7 +203,9 @@ export function juger(ticket, interfaces, commentaires, ticketLu) {
185
203
  const restantes = changees.filter(
186
204
  ({ ligne }) => !arbitrages.some(a => a.text.includes(consommateurDe(ligne)))
187
205
  );
188
- if (restantes.length === 0) return [];
206
+ if (restantes.length === 0) {
207
+ return [];
208
+ }
189
209
  // The lines no arbitrage settles: the ticket's plan, its title and its sections « Architecture »
190
210
  // and « Noms publiés ».
191
211
  let plan;
@@ -206,7 +226,9 @@ export function juger(ticket, interfaces, commentaires, ticketLu) {
206
226
  const constats = [];
207
227
  for (const { rel, ligne, lue, ajoutes } of restantes) {
208
228
  const manquants = lue ? nonNommes(plan, [lue.consommateur, ...ajoutes]) : null;
209
- if (manquants?.length === 0) continue;
229
+ if (manquants?.length === 0) {
230
+ continue;
231
+ }
210
232
  const consommateur = consommateurDe(ligne);
211
233
  const dit = manquants
212
234
  ? ` ; le plan ne nomme pas ${manquants.map(n => `\`${n}\``).join(', ')}`
@@ -223,7 +245,11 @@ export function juger(ticket, interfaces, commentaires, ticketLu) {
223
245
  if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) {
224
246
  const racine = process.cwd();
225
247
  const { refus, lignes } = trancher(racine, 'consommateurs-arbitres', verifier(racine));
226
- for (const r of refus) process.stderr.write(`⛔ ${r.message}\n`);
227
- for (const l of lignes) process.stderr.write(`${l}\n`);
248
+ for (const r of refus) {
249
+ process.stderr.write(`⛔ ${r.message}\n`);
250
+ }
251
+ for (const l of lignes) {
252
+ process.stderr.write(`${l}\n`);
253
+ }
228
254
  process.exitCode = refus.length ? 1 : 0;
229
255
  }
@@ -71,7 +71,9 @@ const NOM = /^(?:\*|[\p{ID_Start}$_][\p{ID_Continue}$‌‍]*)$/u;
71
71
  // « : » is not a name (`NOM`), a bullet of prose; null for a line that is no bullet (a paragraph).
72
72
  // The one reading of such a line, for this guard and for scripts/langages/typescript/consommateurs-arbitres.mjs.
73
73
  export function lireLigne(ligne) {
74
- if (!/^[-*]\s+\S/.test(ligne)) return null;
74
+ if (!/^[-*]\s+\S/.test(ligne)) {
75
+ return null;
76
+ }
75
77
  const m = /^[-*]\s+`?([^`:\s]+)`?\s*:\s*(.+)$/.exec(ligne);
76
78
  const noms = m
77
79
  ? m[2]
@@ -97,7 +99,9 @@ function lignesDeConsommateurs(texte) {
97
99
  continue;
98
100
  }
99
101
  const lue = dedans ? lireLigne(l.trim()) : null;
100
- if (lue) out.push({ texte: l.trim(), ...lue });
102
+ if (lue) {
103
+ out.push({ texte: l.trim(), ...lue });
104
+ }
101
105
  }
102
106
  return out;
103
107
  }
@@ -147,7 +151,9 @@ export function imports(source) {
147
151
  .replace(/^\s*type\s+/, '')
148
152
  .split(/\s+as\s+/)[0]
149
153
  .trim();
150
- if (nom) noms.push(nom);
154
+ if (nom) {
155
+ noms.push(nom);
156
+ }
151
157
  }
152
158
  }
153
159
  if (
@@ -155,8 +161,9 @@ export function imports(source) {
155
161
  .replace(/\{[^}]*\}/, '')
156
162
  .replace(/,/g, '')
157
163
  .trim()
158
- )
164
+ ) {
159
165
  noms.push('*');
166
+ }
160
167
  out.push({ spec: m[2], noms });
161
168
  }
162
169
  return out;
@@ -208,11 +215,19 @@ export function utilise(racine, tous = composants(racine), parLesTests = null) {
208
215
  }
209
216
  parLesTests.get(c).add(p);
210
217
  }
211
- if (!p || (test && !matiere.has(p.nom))) continue;
212
- if (!out.has(p.nom)) out.set(p.nom, new Map());
218
+ if (!p || (test && !matiere.has(p.nom))) {
219
+ continue;
220
+ }
221
+ if (!out.has(p.nom)) {
222
+ out.set(p.nom, new Map());
223
+ }
213
224
  const parConsommateur = out.get(p.nom);
214
- if (!parConsommateur.has(c.nom)) parConsommateur.set(c.nom, new Set());
215
- for (const n of noms) parConsommateur.get(c.nom).add(n);
225
+ if (!parConsommateur.has(c.nom)) {
226
+ parConsommateur.set(c.nom, new Set());
227
+ }
228
+ for (const n of noms) {
229
+ parConsommateur.get(c.nom).add(n);
230
+ }
216
231
  }
217
232
  }
218
233
  }
@@ -269,19 +284,22 @@ export function verifier(racine) {
269
284
  for (const [consommateur, noms] of utilises) {
270
285
  const permis = declare.get(consommateur) ?? new Set();
271
286
  for (const n of noms) {
272
- if (!permis.has(n))
287
+ if (!permis.has(n)) {
273
288
  refus.push({
274
289
  fichier: rel,
275
290
  regle: 'usage-non-declare',
276
291
  message: `${consommateur} utilise « ${n} » de ${p.nom}, que ${rel} ne déclare pas.`,
277
292
  });
293
+ }
278
294
  }
279
295
  }
280
296
  for (const [consommateur, noms] of declare) {
281
- if (hors.has(consommateur)) continue;
297
+ if (hors.has(consommateur)) {
298
+ continue;
299
+ }
282
300
  const faits = utilises.get(consommateur) ?? new Set();
283
301
  for (const n of noms) {
284
- if (!faits.has(n))
302
+ if (!faits.has(n)) {
285
303
  refus.push({
286
304
  fichier: rel,
287
305
  regle: DECLARE_NON_UTILISE,
@@ -289,6 +307,7 @@ export function verifier(racine) {
289
307
  nom: n,
290
308
  message: `${rel} déclare « ${n} » pour ${consommateur}, qu'aucun code de ${consommateur} n'utilise.`,
291
309
  });
310
+ }
292
311
  }
293
312
  }
294
313
  }
@@ -299,8 +318,12 @@ if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) {
299
318
  const racine = process.cwd();
300
319
  const verdict = verifier(racine);
301
320
  const { refus, lignes } = trancher(racine, 'consommateurs', verdict.refus);
302
- for (const r of refus) process.stderr.write(`⛔ ${r.message}\n`);
303
- for (const l of lignes) process.stderr.write(`${l}\n`);
321
+ for (const r of refus) {
322
+ process.stderr.write(`⛔ ${r.message}\n`);
323
+ }
324
+ for (const l of lignes) {
325
+ process.stderr.write(`${l}\n`);
326
+ }
304
327
  if (refus.some(r => r.regle !== DECLARE_NON_UTILISE && r.regle !== LIGNE_MAL_FORMEE)) {
305
328
  process.stderr.write(
306
329
  "Une consommation nouvelle se décide (le titre du ticket, sa section « Architecture » ou sa section « Noms publiés » qui la nomment, sinon l'arbitrage du superviseur), puis entre dans la section « Consommateurs » de l'interface du fournisseur.\n"
@@ -311,5 +334,7 @@ if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) {
311
334
  "Un nom que son consommateur n'utilise plus sort de sa ligne dans la section « Consommateurs » de l'interface du fournisseur.\n"
312
335
  );
313
336
  }
314
- if (refus.length) process.exitCode = 1;
337
+ if (refus.length) {
338
+ process.exitCode = 1;
339
+ }
315
340
  }
@@ -5,172 +5,15 @@
5
5
  //
6
6
  // node construire.mjs --echec <fichier> <plan> from the root of the copy
7
7
  //
8
- // - <plan> is the session's plan, the paths of the packages it writes, in the form of the
9
- // envelope's variable (`lireLaListe` of the core's services, `packages/a:packages/b`).
10
- // - As Bazel builds the dependencies of a target before the target: for a plan whose every path
11
- // is a package of the frame, their providers are built first (the builds their builds wait for,
12
- // read in Turborepo's graph, `turbo run build --filter=<paquet>… --dry=json`), and a failure
13
- // stops the launch; then the traces of other packages their tests wait for
14
- // (`grillhouse.traces`, read in Turborepo's plan of their tests, `turbo run test:unit
15
- // --filter=<paquet>… --dry=json`), which the envelope shows read-only, and a failure stops the
16
- // launch. A task of either step that waits, directly or not, for a task of a package of the plan
17
- // (`attendentLePlan` of ./turbo-des-paquets.mjs) is not played there: as with Bazel's
18
- // --keep_going, a package of the plan stays a target of the plan even as another's provider
19
- // (BPScript's 990-corpus, the shared test material, which the trace of 060-encoder waits for),
20
- // and goes with the plan. Then the packages, the traces of the plan or that wait for it, and what
21
- // their tests read (`turbo run build <those traces> --filter=<paquet>...…
22
- // --continue=dependencies-successful`), whose failure does not stop the launch: each task whose
23
- // dependencies succeed goes to its end, so what their tests read without depending on them is
24
- // built whole. Their consumers are not built.
25
- // - Any other plan, the whole repository (`.`) included, or a path that is no package of the frame
26
- // (BPScript's libraries/), reads the graph of the whole copy dry (`turbo run build --dry=json`),
27
- // whose failure (Turborepo absent, its configuration refused) stops the launch, then builds the
28
- // copy whole as far as it builds (`turbo run build --continue=dependencies-successful`), whose
29
- // failure does not stop the launch either.
30
- // - A build that fails without stopping the launch writes in <fichier> the line that says which
31
- // build failed and what was built, then its output, which the launcher puts in the session's
32
- // instruction (« La construction échoue »): repairing it is the session's work. Its output goes
33
- // to the standard output too.
8
+ // - The launcher is the core's, one for every language (`construireDepuisLesArguments` of
9
+ // scripts/taches-du-graphe.mjs): the plan and its providers by `turbo run build
10
+ // --filter=<paquet>…`, the whole copy for a plan with a path that is no package of the graph.
11
+ // This module gives it Turborepo, the task runner of the graph.
34
12
  // - The exit code: 0 when the launch goes on, a build failure included; 1 for a step that stops it;
35
13
  // 2 for a malformed call.
36
- import { spawnSync } from 'node:child_process';
37
- import { closeSync, openSync, readFileSync, writeFileSync } from 'node:fs';
38
- import path from 'node:path';
39
14
  import { pathToFileURL } from 'node:url';
40
- import { paquets } from '../../paquets.mjs';
41
- import { lireLaListe } from '../../services-du-noyau.mjs';
42
- import { SCRIPT_DES_TESTS } from './script-des-tests.mjs';
43
- import { attendentLePlan, tracesDuPlan } from './turbo-des-paquets.mjs';
44
-
45
- const TURBO = ['--no-install', 'turbo'];
46
- const ENTIERE =
47
- "La construction de la copie entière échoue ; ce qui n'attend pas la construction en échec est construit.";
48
- const DU_PLAN =
49
- "La construction des paquets de ton plan échoue ; leurs fournisseurs et ce que leurs tests lisent sans dépendre d'eux sont construits.";
50
-
51
- class Arret extends Error {}
52
-
53
- // Turborepo with <args> in <racine>, its output on this process's; throws Arret on a failure.
54
- function turbo(racine, args) {
55
- const r = spawnSync('npx', [...TURBO, ...args], { cwd: racine, stdio: 'inherit' });
56
- if (r.status !== 0) {
57
- throw new Arret(`turbo ${args.join(' ')}`);
58
- }
59
- }
60
-
61
- // Turborepo's plan of <args> in <racine>, parsed; throws Arret on a failure.
62
- function plan(racine, args) {
63
- const r = spawnSync('npx', [...TURBO, ...args, '--dry=json'], {
64
- cwd: racine,
65
- encoding: 'utf8',
66
- maxBuffer: 256 * 1024 * 1024,
67
- stdio: ['ignore', 'pipe', 'inherit'],
68
- });
69
- if (r.status !== 0) {
70
- throw new Arret(`turbo ${args.join(' ')} --dry=json`);
71
- }
72
- return JSON.parse(r.stdout);
73
- }
74
-
75
- // The build <args> in <racine>, its output in <echec> then on this process's: when it fails,
76
- // <echec> holds <ligne> then that output, and the warning <alerte> follows it.
77
- function construireJusquOuIlConstruit(racine, args, echec, ligne, alerte) {
78
- const fd = openSync(echec, 'w');
79
- let r;
80
- try {
81
- r = spawnSync('npx', [...TURBO, ...args], { cwd: racine, stdio: ['ignore', fd, fd] });
82
- } finally {
83
- closeSync(fd);
84
- }
85
- const sortie = readFileSync(echec, 'utf8');
86
- process.stdout.write(sortie);
87
- if (r.status === 0) {
88
- writeFileSync(echec, '');
89
- return;
90
- }
91
- process.stdout.write(`${alerte}\n`);
92
- writeFileSync(echec, `${ligne}\n${sortie}`);
93
- }
94
-
95
- /**
96
- * Builds the copy at <racine> for the plan <liste>, the failure of a build that does not stop the
97
- * launch written in <echec>: the exit code (see the header).
98
- * @param {string} racine the root of the copy
99
- * @param {string} liste the plan, in the form of the envelope's variable
100
- * @param {string} echec the file of a build that fails
101
- */
102
- export function construire(racine, liste, echec) {
103
- writeFileSync(echec, '');
104
- const tous = paquets(racine).filter(p => !p.hors);
105
- const noms = lireLaListe(liste).map(
106
- d => tous.find(p => p.dossier === path.normalize(d).replace(/\/$/, ''))?.pkg.name ?? null
107
- );
108
- try {
109
- if (noms.length === 0 || !noms.every(Boolean)) {
110
- plan(racine, ['run', 'build']);
111
- construireJusquOuIlConstruit(
112
- racine,
113
- ['run', 'build', '--continue=dependencies-successful'],
114
- echec,
115
- ENTIERE,
116
- "⚠️ La construction de la copie échoue : la séance s'ouvre, la consigne porte l'erreur."
117
- );
118
- return 0;
119
- }
120
- const cibles = noms.map(n => `--filter=${n}`);
121
- // Their providers: the builds their own builds wait for, save those that wait for a package
122
- // of the plan, which go with the plan below.
123
- const graphe = plan(racine, ['run', 'build', ...cibles]);
124
- const avecLePlan = attendentLePlan(graphe, noms);
125
- const fournisseurs = graphe.tasks
126
- .map(t => t.taskId)
127
- .filter(id => !avecLePlan.has(id))
128
- .sort();
129
- if (fournisseurs.length) {
130
- turbo(racine, ['run', ...fournisseurs]);
131
- }
132
- // The traces their tests wait for: another package's trace that waits for no package of the
133
- // plan is produced here, a failure stopping the launch, as a provider's; a trace of the plan,
134
- // or one that waits for it, is produced with the plan below.
135
- const tests = plan(racine, ['run', SCRIPT_DES_TESTS, ...cibles]);
136
- const attend = attendentLePlan(tests, noms);
137
- const autres = tracesDuPlan(tests, t => !attend.has(t.taskId));
138
- if (autres.length) {
139
- turbo(racine, ['run', ...autres]);
140
- }
141
- const avec = tracesDuPlan(tests, t => attend.has(t.taskId));
142
- construireJusquOuIlConstruit(
143
- racine,
144
- [
145
- 'run',
146
- 'build',
147
- ...avec,
148
- ...noms.map(n => `--filter=${n}...`),
149
- '--continue=dependencies-successful',
150
- ],
151
- echec,
152
- DU_PLAN,
153
- `⚠️ La construction du plan (${noms.join(' ')}) échoue : la séance s'ouvre, la consigne porte l'erreur.`
154
- );
155
- return 0;
156
- } catch (e) {
157
- if (!(e instanceof Arret)) {
158
- throw e;
159
- }
160
- process.stderr.write(`⛔ ${e.message} échoue.\n`);
161
- return 1;
162
- }
163
- }
15
+ import { construireDepuisLesArguments } from '../../services-du-noyau.mjs';
164
16
 
165
17
  if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) {
166
- const args = process.argv.slice(2);
167
- const i = args.indexOf('--echec');
168
- const echec = i >= 0 ? args[i + 1] : undefined;
169
- const reste = i >= 0 ? [...args.slice(0, i), ...args.slice(i + 2)] : args;
170
- if (!echec || reste.length !== 1) {
171
- process.stderr.write('usage: construire.mjs --echec <fichier> <plan>\n');
172
- process.exitCode = 2;
173
- } else {
174
- process.exitCode = construire(process.cwd(), reste[0], echec);
175
- }
18
+ process.exitCode = construireDepuisLesArguments('turbo', process.argv.slice(2));
176
19
  }