@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
@@ -0,0 +1,4 @@
1
+ // The types of the reading of the key `grillhouse.circuits` (./circuits-cles.mjs).
2
+
3
+ /** The number of circuits at once (1 when absent), or the fault by its name. */
4
+ export function reglageDesCircuits(pkg: unknown): { max: number | null; faute: string | null };
@@ -0,0 +1,21 @@
1
+ // The reading of the key `grillhouse.circuits` of a package.json (grillhouse-4nr.9, decision D9,
2
+ // the owner's word of 2026-11-04), read as written: an integer of 1 or more, the number of
3
+ // circuits of the project that run at once, which the queue of its tickets
4
+ // (src/temporal/tickets/) holds; absent or null, 1. Any other value is a fault, which the queue
5
+ // names before any work.
6
+
7
+ // Returns { max, faute }: `max` the number of circuits at once, null on a fault; `faute` the
8
+ // fault by its name, null when the key reads.
9
+ export function reglageDesCircuits(pkg) {
10
+ const c = pkg?.grillhouse?.circuits;
11
+ if (c === undefined || c === null) {
12
+ return { max: 1, faute: null };
13
+ }
14
+ if (!Number.isInteger(c) || c < 1) {
15
+ return {
16
+ max: null,
17
+ faute: `grillhouse.circuits vaut ${JSON.stringify(c)}, pas un entier ≥ 1.`,
18
+ };
19
+ }
20
+ return { max: c, faute: null };
21
+ }
@@ -0,0 +1,105 @@
1
+ // The circuits of a repository as the board (scripts/tableau.mjs) and the supervisor
2
+ // (scripts/superviseur.mjs) read them: one call to the Temporal server (src/temporal/circuit/
3
+ // client.ts `lireLesCircuits`, the memo and the status of each workflow, no worker living), as the
4
+ // UI of Temporal lists its workflows, and the progress of the pass under way of each one that runs,
5
+ // read in its working directory (scripts/avancement.mjs `avancementDuTravail`).
6
+ import { existsSync } from 'node:fs';
7
+ import path from 'node:path';
8
+ import { avancementDuTravail } from './avancement.mjs';
9
+ import { sansReponseEn } from './sans-reponse.mjs';
10
+
11
+ /**
12
+ * A circuit as the server gives it (`CircuitLu` of src/temporal/circuit/client.ts) with its
13
+ * progress and the page of its workflow on the web UI of the server (`lien`).
14
+ * @typedef {import('../dist/temporal/circuit/client.js').CircuitLu & { avancement: ReturnType<typeof avancementDuTravail>, lien?: string }} CircuitDuServeur
15
+ */
16
+
17
+ /**
18
+ * The circuits <circuits> of the repository at <racine>, each with the progress of its pass under
19
+ * way while it runs (`avancement`, in `.claude/worktrees/<ticket>.travail`, null without one).
20
+ * @template {{ ticket: string, vivant: boolean }} C
21
+ * @param {string} racine
22
+ * @param {C[]} circuits
23
+ * @returns {(C & { avancement: ReturnType<typeof avancementDuTravail> })[]}
24
+ */
25
+ export const avecLeurAvancement = (racine, circuits) =>
26
+ circuits.map(c => ({
27
+ ...c,
28
+ avancement: c.vivant
29
+ ? avancementDuTravail(path.join(racine, '.claude', 'worktrees', `${c.ticket}.travail`))
30
+ : null,
31
+ }));
32
+
33
+ // The built client of the package (`dist/`), which a fresh clone has unbuilt.
34
+ const CONSTRUIT = path.join(import.meta.dirname, '..', 'dist', 'temporal', 'circuit', 'client.js');
35
+
36
+ /** The client of the circuits is not built: the reading names the command that builds it. */
37
+ export class ClientNonConstruit extends Error {
38
+ constructor() {
39
+ super(
40
+ `le client Temporal n'est pas construit (${CONSTRUIT} n'existe pas) : la construction du paquet le pose, \`npm run build --workspace @roomi-fields/grillhouse\``
41
+ );
42
+ this.name = 'ClientNonConstruit';
43
+ }
44
+ }
45
+
46
+ // How long the reading waits for the server: a guard, far above a reading's few milliseconds, so
47
+ // that a server down keeps neither the board nor the opening of a session waiting (the client's
48
+ // own retries last some twenty seconds).
49
+ export const DELAI_MS = 5_000;
50
+
51
+ /** What a reading that waited DELAI_MS in vain says: « Temporal ne répond pas en 5 s ». */
52
+ export const SANS_REPONSE_EN = sansReponseEn(DELAI_MS);
53
+
54
+ // The gRPC statuses of a server that does not answer in time: none listens (UNAVAILABLE, 14), or
55
+ // none answers within the delay (DEADLINE_EXCEEDED, 4), a server slow under load as a port closed.
56
+ const SANS_REPONSE = new Set([4, 14]);
57
+
58
+ /** The server at <adresse> did not answer the reading of the circuits within DELAI_MS. */
59
+ export class ServeurMuet extends Error {
60
+ /**
61
+ * @param {string} adresse
62
+ * @param {unknown} cause
63
+ */
64
+ constructor(adresse, cause) {
65
+ super(`${SANS_REPONSE_EN} sur ${adresse}`, { cause });
66
+ this.name = 'ServeurMuet';
67
+ this.adresse = adresse;
68
+ }
69
+ }
70
+
71
+ // Whether <e>, an error of the client, says that the server did not answer: its gRPC status, on
72
+ // itself or its cause (a `ServiceError` of the client carries the gRPC error as its cause).
73
+ const sansReponse = e =>
74
+ [e, e?.cause].some(x => typeof x?.code === 'number' && SANS_REPONSE.has(x.code));
75
+
76
+ /**
77
+ * The circuits of the repository at <racine>, read from the Temporal server of the environment in
78
+ * one call, with their progress (`avecLeurAvancement`) and the page of each one's workflow on the
79
+ * web UI of the server (`lienDuTableauWeb`). A server that does not answer within
80
+ * DELAI_MS throws `ServeurMuet`, which its caller tells from a repository without circuits and
81
+ * from any other fault, thrown as it is; a client not built throws `ClientNonConstruit`.
82
+ * @param {string} racine
83
+ */
84
+ export async function circuitsDuServeur(racine) {
85
+ if (!existsSync(CONSTRUIT)) {
86
+ throw new ClientNonConstruit();
87
+ }
88
+ const { lienDuTableauWeb, ouvrirLeClient } = await import('../dist/temporal/client.js');
89
+ const { lireLesCircuits } = await import('../dist/temporal/circuit/client.js');
90
+ const { idDuCircuit } = await import('../dist/temporal/circuit/contrat.js');
91
+ const c = ouvrirLeClient();
92
+ try {
93
+ const lus = await c.client.connection.withDeadline(Date.now() + DELAI_MS, () =>
94
+ lireLesCircuits(c.client, racine)
95
+ );
96
+ return avecLeurAvancement(racine, lus).map(x => ({
97
+ ...x,
98
+ lien: lienDuTableauWeb(c.adresse, c.client.options.namespace, idDuCircuit(racine, x.ticket)),
99
+ }));
100
+ } catch (e) {
101
+ throw sansReponse(e) ? new ServeurMuet(c.adresse, e) : e;
102
+ } finally {
103
+ await c.fermer();
104
+ }
105
+ }
@@ -0,0 +1,9 @@
1
+ // The exit codes the frame's processes share, with no input nor output, as sysexits.h names them:
2
+ // a module a pure module (scripts/etapes.mjs, scripts/transitions.mjs) imports with no reading of
3
+ // the machine.
4
+ //
5
+ // - A_REPASSER, 75, is the exit code of « à repasser » (EX_TEMPFAIL of sysexits.h: try again
6
+ // later), neither green nor red: a measure of time under load (scripts/mesure/pression.mjs), the
7
+ // wait of the lock of the machine at its bound (scripts/verrou-de-machine.mjs), a stop of the
8
+ // circuit that a gesture settles (scripts/etapes.mjs, ARRETS).
9
+ export const A_REPASSER = 75;
@@ -13,25 +13,29 @@
13
13
  // results directory included (`GRILLHOUSE_RESULTATS`), where each module writes under names of
14
14
  // its own. A line on the error stream names each module before it plays, so that what a
15
15
  // command prints on its standard output stays its own.
16
- // - `tester`: an argument that begins with « - » is an option, given to every module; any other is
16
+ // - `tester`, `tests-du-paquet`, `construire` and `typer` (the last three: one package, as the
17
+ // scripts of its package.json call them): an argument that begins with « - » is an option, given to every module; any other is
17
18
  // a path from the root, given to the module of the component that holds it
18
19
  // (`moduleDuFichier`), or out of every component to the first module whose rule of a test file
19
20
  // judges it (`estUnTest`). With paths, the modules that receive none do not play. A path no
20
21
  // module takes is refused, named, and nothing plays (code 2).
21
- // - The last green (scripts/dernier-vert.mjs) is kept once, after the last module: while the
22
- // modules play, a module green defers its own (`VERT_DIFFERE`); when every module played green
23
- // and each deferred one, the first deferred is kept, the state of the repository when the pass
24
- // began. A pass with one module red keeps none, so that the next pass plays its changes again.
22
+ // - The launcher's `construire --echec <fichier> <plan>` is one implementation for every language
23
+ // (scripts/taches-du-graphe.mjs): the first module plays it, once.
24
+ // - No green is kept here, and no module is given one to defer: the last green
25
+ // (scripts/dernier-vert.mjs) is kept by the one pass of the verification, once, when every task
26
+ // of every language of the graph is green (scripts/langages/typescript/verifier.mjs). A module
27
+ // that plays after a red one gets `PASSE_ROUGE` in its environment: that pass keeps none.
28
+ // - `verifier`: the module of package.json passes over the whole graph (every task of every
29
+ // language, once); the others get `GRAPHE_JOUE` and play no task of it again (cargo: its
30
+ // `deny check` alone), so that nextest and pytest play once.
25
31
  // - The exit code: 0 when every module is green, 75 when the only reds are « à repasser », else the
26
32
  // first other code; 128 plus the number of a signal that ended a module.
27
33
  import { spawnSync } from 'node:child_process';
28
- import { mkdtempSync, readFileSync, rmSync } from 'node:fs';
29
- import { constants, tmpdir } from 'node:os';
30
- import path from 'node:path';
34
+ import { constants } from 'node:os';
31
35
  import { fileURLToPath, pathToFileURL } from 'node:url';
32
36
  import { moduleDuFichier } from './composition-des-langages.mjs';
33
- import { garderLeVert, VERT_DIFFERE } from './dernier-vert.mjs';
34
37
  import { langagesDe } from './langages.mjs';
38
+ import { GRAPHE_JOUE, PASSE_ROUGE } from './taches-du-graphe.mjs';
35
39
 
36
40
  /** This script, the one every composed command runs. */
37
41
  export const SCRIPT = fileURLToPath(import.meta.url);
@@ -46,10 +50,19 @@ export const unir = codes =>
46
50
  codes.find(c => c !== 0 && c !== A_REPASSER) ??
47
51
  (codes.some(c => c === A_REPASSER) ? A_REPASSER : 0);
48
52
 
53
+ // The commands whose path arguments go to the module of the component that holds each.
54
+ const PAR_CHEMIN = ['tester', 'tests-du-paquet', 'construire', 'typer'];
55
+
49
56
  // The arguments of each module of <modules> for the command <nom>: `{ parts: [{ module, args }] }`,
50
57
  // or `{ refus }`, the paths no module takes.
51
58
  function repartir(nom, args, modules, racine) {
52
- if (nom !== 'tester') {
59
+ // `construire` and `typer` name a package by its path, as `tester`.
60
+ // The launcher's build is one implementation for every language (scripts/taches-du-graphe.mjs): it
61
+ // plays once, by the first module, not once per module (each would build the same copy again).
62
+ if (nom === 'construire' && args.includes('--echec')) {
63
+ return { parts: modules.slice(0, 1).map(module => ({ module, args })) };
64
+ }
65
+ if (!PAR_CHEMIN.includes(nom)) {
53
66
  return { parts: modules.map(module => ({ module, args })) };
54
67
  }
55
68
  const estChemin = a => !a.startsWith('-');
@@ -109,40 +122,31 @@ export function jouer(
109
122
  }
110
123
  return 2;
111
124
  }
112
- const dossier = mkdtempSync(path.join(tmpdir(), 'grillhouse-vert-differe-'));
113
- const differe = path.join(dossier, 'verts');
114
- try {
115
- const codes = r.parts.map(({ module, args: siens }) => {
116
- const c = module.commandes(racine)[nom];
117
- dire(`▶ ${module.nom} : ${nom}`);
118
- const p = spawnSync(process.execPath, [c.script, ...c.args, ...siens], {
119
- cwd: racine,
120
- stdio: 'inherit',
121
- env: { ...env, [VERT_DIFFERE]: differe },
122
- });
123
- if (p.error) {
124
- process.stderr.write(`⛔ ${module.nom} : ${nom} : ${p.error.message}\n`);
125
- return 1;
126
- }
127
- return p.status ?? 128 + (constants.signals[p.signal ?? 'SIGTERM'] ?? 0);
125
+ // A module that plays after a red one is told so (PASSE_ROUGE): the one pass of the verification
126
+ // keeps no green then.
127
+ const codes = [];
128
+ const duGraphe = r.parts.find(x => x.module.manifeste === 'package.json')?.module;
129
+ for (const { module, args: siens } of r.parts) {
130
+ const c = module.commandes(racine)[nom];
131
+ dire(`▶ ${module.nom} : ${nom}`);
132
+ const rouge = codes.some(x => x !== 0);
133
+ const p = spawnSync(process.execPath, [c.script, ...c.args, ...siens], {
134
+ cwd: racine,
135
+ stdio: 'inherit',
136
+ env: {
137
+ ...env,
138
+ ...(rouge ? { [PASSE_ROUGE]: '1' } : {}),
139
+ ...(nom === 'verifier' && module !== duGraphe && duGraphe ? { [GRAPHE_JOUE]: '1' } : {}),
140
+ },
128
141
  });
129
- const code = unir(codes);
130
- let verts = [];
131
- try {
132
- verts = readFileSync(differe, 'utf8')
133
- .split('\n')
134
- .filter(Boolean)
135
- .map(l => JSON.parse(l));
136
- } catch {
137
- verts = [];
138
- }
139
- if (code === 0 && verts.length > 0 && verts.length === r.parts.length) {
140
- garderLeVert(verts[0], {});
142
+ if (p.error) {
143
+ process.stderr.write(`⛔ ${module.nom} : ${nom} : ${p.error.message}\n`);
144
+ codes.push(1);
145
+ } else {
146
+ codes.push(p.status ?? 128 + (constants.signals[p.signal ?? 'SIGTERM'] ?? 0));
141
147
  }
142
- return code;
143
- } finally {
144
- rmSync(dossier, { recursive: true, force: true });
145
148
  }
149
+ return unir(codes);
146
150
  }
147
151
 
148
152
  if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) {
@@ -0,0 +1,7 @@
1
+ // The types of ./commandes-du-path.mjs, for the frame's TypeScript (src/temporal/installation.ts).
2
+
3
+ /** The path of the command <nom> in the PATH of <env>, or null. */
4
+ export function trouverDansLePath(
5
+ nom: string,
6
+ env?: Record<string, string | undefined>
7
+ ): string | null;
@@ -0,0 +1,25 @@
1
+ // The search of a command in the PATH, as `command -v` finds it: the first folder of PATH that
2
+ // holds an executable file of its name. The one search of the core, which the installation of
3
+ // Temporal (src/temporal/installation.ts), the preparation of a project (./preparation.mjs) and
4
+ // the modules of language (by ./services-du-noyau.mjs) call.
5
+ import { accessSync, constants } from 'node:fs';
6
+ import path from 'node:path';
7
+
8
+ /**
9
+ * The path of the command <nom> in the PATH of <env>, or null.
10
+ * @param {string} nom
11
+ * @param {Record<string, string | undefined>} [env]
12
+ * @returns {string | null}
13
+ */
14
+ export function trouverDansLePath(nom, env = process.env) {
15
+ for (const d of (env.PATH ?? '').split(path.delimiter).filter(Boolean)) {
16
+ const f = path.join(d, nom);
17
+ try {
18
+ accessSync(f, constants.X_OK);
19
+ return f;
20
+ } catch {
21
+ // not in this folder
22
+ }
23
+ }
24
+ return null;
25
+ }
@@ -68,7 +68,9 @@ import { langageDe } from './langages.mjs';
68
68
  */
69
69
  export function cheminsLus(dir) {
70
70
  const manifeste = path.join(dir, 'package.json');
71
- if (!existsSync(manifeste)) return [];
71
+ if (!existsSync(manifeste)) {
72
+ return [];
73
+ }
72
74
  const { grillhouse } = JSON.parse(readFileSync(manifeste, 'utf8'));
73
75
  const liste = v => (Array.isArray(v) ? v.filter(l => typeof l === 'string') : []);
74
76
  return [
@@ -83,8 +85,11 @@ function lesSections(description) {
83
85
  let dedans = false;
84
86
  for (const l of String(description ?? '').split('\n')) {
85
87
  const m = /^## (.+)$/.exec(l);
86
- if (m) dedans = /^(Architecture|Critères)\b/.test(m[1].trim());
87
- else if (dedans) out.push(l);
88
+ if (m) {
89
+ dedans = /^(Architecture|Critères)\b/.test(m[1].trim());
90
+ } else if (dedans) {
91
+ out.push(l);
92
+ }
88
93
  }
89
94
  return out.join('\n');
90
95
  }
@@ -112,7 +117,9 @@ function elementsNommes(texte) {
112
117
  const vus = new Set();
113
118
  for (const [, brut] of texte.matchAll(/`([^`\n]+)`/g)) {
114
119
  const m = /^([A-Za-z_$][\w$]*)((?:\.[A-Za-z_$][\w$]*|\([^)]*\))*)$/.exec(brut.trim());
115
- if (m) vus.add(m[1]);
120
+ if (m) {
121
+ vus.add(m[1]);
122
+ }
116
123
  }
117
124
  return [...vus];
118
125
  }
@@ -123,10 +130,16 @@ function cheminsEcrits(racine, texte) {
123
130
  const out = new Set();
124
131
  for (const [brut] of texte.matchAll(/[\w.@-]+(?:\/[\w.@-]+)*/g)) {
125
132
  const p = brut.replace(/\.+$/, '');
126
- if (!p.includes('/') && !/\.\w+$/.test(p)) continue;
133
+ if (!p.includes('/') && !/\.\w+$/.test(p)) {
134
+ continue;
135
+ }
127
136
  const net = path.normalize(p);
128
- if (net.startsWith('..') || path.isAbsolute(net)) continue;
129
- if (existsSync(path.join(racine, net))) out.add(net.split(path.sep).join('/'));
137
+ if (net.startsWith('..') || path.isAbsolute(net)) {
138
+ continue;
139
+ }
140
+ if (existsSync(path.join(racine, net))) {
141
+ out.add(net.split(path.sep).join('/'));
142
+ }
130
143
  }
131
144
  return [...out];
132
145
  }
@@ -144,9 +157,13 @@ function lecteursDesChemins(racine, tous, changes) {
144
157
  for (const brut of new Set(cheminsLus(c.dossier))) {
145
158
  const lu = brut.replace(/^\.\//, '').replace(/\/+$/, '');
146
159
  const atteints = changes.filter(ch => !recouvre(propre, ch) && recouvre(lu, ch)).sort();
147
- if (atteints.length) par.add(`lit ${lu} (${atteints.join(', ')})`);
160
+ if (atteints.length) {
161
+ par.add(`lit ${lu} (${atteints.join(', ')})`);
162
+ }
163
+ }
164
+ if (par.size) {
165
+ out.set(c, par);
148
166
  }
149
- if (par.size) out.set(c, par);
150
167
  }
151
168
  return out;
152
169
  }
@@ -184,18 +201,28 @@ export function releve(racine, description) {
184
201
  const trouves = new Set(ceuxNommes);
185
202
  for (const e of code.elements) {
186
203
  trouves.add(e.fournisseur);
187
- for (const l of e.lecteurs) trouves.add(l.composant);
204
+ for (const l of e.lecteurs) {
205
+ trouves.add(l.composant);
206
+ }
188
207
  }
189
208
  for (const e of code.types.elements) {
190
- for (const d of e.declarations) if (d.publie) trouves.add(d.composant);
191
- for (const c of e.lecteurs.keys()) trouves.add(c);
209
+ for (const d of e.declarations) {
210
+ if (d.publie) {
211
+ trouves.add(d.composant);
212
+ }
213
+ }
214
+ for (const c of e.lecteurs.keys()) {
215
+ trouves.add(c);
216
+ }
192
217
  }
193
218
  // By the paths read: the components whose tests declare they read a path the ticket changes.
194
219
  const parChemins = lecteursDesChemins(racine, tous, [
195
220
  ...cheminsEcrits(racine, texte),
196
221
  ...ceuxNommes.map(c => path.relative(racine, c.dossier).split(path.sep).join('/')),
197
222
  ]);
198
- for (const c of parChemins.keys()) trouves.add(c);
223
+ for (const c of parChemins.keys()) {
224
+ trouves.add(c);
225
+ }
199
226
  // By the architecture: the Rend of the CADRE.md of each component that publishes an element.
200
227
  const declarants = new Set([
201
228
  ...code.elements.map(e => e.fournisseur),
@@ -205,8 +232,12 @@ export function releve(racine, description) {
205
232
  for (const p of declarants) {
206
233
  for (const { regle, texte: ligne } of rendus(p)) {
207
234
  for (const c of nommes(racine, tous, ligne)) {
208
- if (c === p) continue;
209
- if (!architecture.has(c)) architecture.set(c, new Set());
235
+ if (c === p) {
236
+ continue;
237
+ }
238
+ if (!architecture.has(c)) {
239
+ architecture.set(c, new Set());
240
+ }
210
241
  architecture.get(c).add(`CADRE de ${nomAuTitre(racine, p)}, Rend ${regle}`);
211
242
  trouves.add(c);
212
243
  }
@@ -251,7 +282,9 @@ export function releve(racine, description) {
251
282
  // lines included.
252
283
  function rendus(c) {
253
284
  const f = path.join(c.dossier, 'docs', 'CADRE.md');
254
- if (!existsSync(f)) return [];
285
+ if (!existsSync(f)) {
286
+ return [];
287
+ }
255
288
  const texte = readFileSync(f, 'utf8');
256
289
  const out = [];
257
290
  let dedans = false;
@@ -261,11 +294,15 @@ function rendus(c) {
261
294
  dedans = /Rend\s*$/.test(h[1].trim());
262
295
  continue;
263
296
  }
264
- if (!dedans) continue;
297
+ if (!dedans) {
298
+ continue;
299
+ }
265
300
  if (/^[-*] /.test(l)) {
266
301
  const regle = /^[-*] \*\*(R\d+)\.?\*\*/.exec(l)?.[1] ?? `l.${i + 1}`;
267
302
  out.push({ regle, texte: l });
268
- } else if (/^\s+\S/.test(l) && out.length) out.at(-1).texte += ` ${l.trim()}`;
303
+ } else if (/^\s+\S/.test(l) && out.length) {
304
+ out.at(-1).texte += ` ${l.trim()}`;
305
+ }
269
306
  }
270
307
  return out;
271
308
  }
@@ -273,7 +310,9 @@ function rendus(c) {
273
310
  // The components of the survey <r> the title <titre> does not name (its components as written,
274
311
  // package names or paths, or `.`), in the survey's order.
275
312
  export function manquants(racine, r, titre) {
276
- if (titre.includes('.')) return [];
313
+ if (titre.includes('.')) {
314
+ return [];
315
+ }
277
316
  const tous = langageDe(racine).composants(racine);
278
317
  const couvre = c => {
279
318
  const rel = path.relative(racine, c.dossier).split(path.sep).join('/');
@@ -323,7 +362,9 @@ export function texteDuReleve(r) {
323
362
  const cle = `${ou} ; lu par ${lus || 'aucun autre'}.`;
324
363
  lignes.set(cle, [...(lignes.get(cle) ?? []), `\`${e.nom}\``]);
325
364
  }
326
- for (const [cle, noms] of lignes) out.push(` - ${noms.join(', ')} : ${cle}`);
365
+ for (const [cle, noms] of lignes) {
366
+ out.push(` - ${noms.join(', ')} : ${cle}`);
367
+ }
327
368
  }
328
369
  if (r.lit.length) {
329
370
  const lus = r.lit.map(l => `${l.composant} (${l.par.join(' ; ')})`).join(', ');
@@ -333,7 +374,9 @@ export function texteDuReleve(r) {
333
374
  const lus = r.architecture.map(l => `${l.composant} (${l.par.join(' ; ')})`).join(', ');
334
375
  out.push(`- Par l'architecture : ${lus}.`);
335
376
  }
336
- if (r.nommes.length) out.push(`- Nommés au ticket : ${r.nommes.join(', ')}.`);
377
+ if (r.nommes.length) {
378
+ out.push(`- Nommés au ticket : ${r.nommes.join(', ')}.`);
379
+ }
337
380
  if (r.sansFournisseur.length) {
338
381
  out.push(
339
382
  `- Sans interface qui les publie : ${r.sansFournisseur.map(n => `\`${n}\``).join(', ')}.`
@@ -8,7 +8,7 @@
8
8
  // is refused, named with both languages: a package has one language. A file belongs to the
9
9
  // module of the component that holds it, the deepest (`moduleDuFichier`); a file out of every
10
10
  // component stays the core's, as with one language: the first module, in the order of the
11
- // declaration, whose answer is not null judges it (`estUnTest`, `soeurDAvant`,
11
+ // declaration, whose answer is not null judges it (`estUnTest`, `soeurDAvant`, `arbreDAvant`,
12
12
  // `testsDeHead`, `manifestes.horsDesTests`).
13
13
  // - Whether a component plays tests, the readers of components and the components touched are
14
14
  // each module's on its own components, the results joined: a name without supplier is without
@@ -196,6 +196,10 @@ export function composer(modules) {
196
196
  matieres: racine => modules.flatMap(m => m.matieres(racine)),
197
197
  joueDesTests: (racine, composant) =>
198
198
  moduleDuComposant(racine, composant)?.joueDesTests(racine, composant) ?? false,
199
+ empreintes(racine, noms) {
200
+ const parts = modules.map(m => m.empreintes(racine, noms));
201
+ return parts.some(p => p === null) ? null : Object.assign({}, ...parts);
202
+ },
199
203
  lecteurs(racine, o) {
200
204
  const composants = leurs(racine, o.composants);
201
205
  const nommes = leurs(racine, o.nommes);
@@ -223,16 +227,6 @@ export function composer(modules) {
223
227
  parLesTests: new Map(parts.flatMap(p => [...p.parLesTests])),
224
228
  };
225
229
  },
226
- touches(racine, o) {
227
- const parts = modules.map(m => m.touches(racine, o));
228
- const touches = parts.flatMap(p => p.touches);
229
- const vus = new Set(touches.map(c => c.dossier));
230
- return {
231
- touches,
232
- dependants: parts.flatMap(p => p.dependants).filter(c => !vus.has(c.dossier)),
233
- horsGraphe: parts[0].horsGraphe.filter(f => parts.every(p => p.horsGraphe.includes(f))),
234
- };
235
- },
236
230
  elementsDuLot(racine, o) {
237
231
  const parts = modules.map(m => ({ m, l: m.elementsDuLot(racine, o) }));
238
232
  const impossibles = parts.filter(p => p.l.etat !== 'fait');
@@ -270,8 +264,20 @@ export function composer(modules) {
270
264
  },
271
265
  estUnTest: (chemin, racine) =>
272
266
  premiereReponse(modules, racine, chemin, m => m.estUnTest(chemin, racine)),
267
+ horsDuJour: (chemin, racine) =>
268
+ Boolean(premiereReponse(modules, racine, chemin, m => m.horsDuJour(chemin, racine))),
273
269
  soeurDAvant: (chemin, racine) =>
274
- premiereReponse(modules, racine, chemin, m => m.soeurDAvant(chemin, racine)),
270
+ premiereReponse(modules, racine, chemin, m =>
271
+ typeof m.soeurDAvant === 'function' ? m.soeurDAvant(chemin, racine) : null
272
+ ),
273
+ arbreDAvant: (chemin, racine) =>
274
+ Boolean(
275
+ premiereReponse(modules, racine, chemin, m =>
276
+ typeof m.arbreDAvant === 'function' ? m.arbreDAvant(chemin, racine) : null
277
+ )
278
+ ),
279
+ envDArbre: (chemin, racine) =>
280
+ moduleDuFichier(modules, racine, chemin)?.envDArbre?.(chemin, racine) ?? {},
275
281
  testsDeHead: (chemin, racine, lire, options) =>
276
282
  premiereReponse(modules, racine, chemin, m => m.testsDeHead(chemin, racine, lire, options)),
277
283
  manifestes: {