@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
@@ -2,9 +2,9 @@
2
2
  // The mechanical steps of one integration, run by the circuit of the ticket (scripts/circuit.mjs)
3
3
  // once the reviewer has accepted the lot, which the circuit builds from the ticket's copy. It
4
4
  // commits the lot on the branch of the ticket, or refuses it with the full output of the step that
5
- // refused. The branch then waits for the queue (scripts/integration/file.mjs), which brings it onto
6
- // main. Run from any working tree of the repository, it works on the main tree, found from git's
7
- // common directory.
5
+ // refused. The circuit of the ticket then sends the branch to the queue of the project (the
6
+ // workflow `file:<racine>`, src/temporal/file/deroule.ts), which brings it onto main. Run from any
7
+ // working tree of the repository, it works on the main tree, found from git's common directory.
8
8
  //
9
9
  // npx grillhouse integrer --ticket <id>
10
10
  // [--tests <patch>] [--code <patch>] --message <file> [--references <file>]
@@ -44,8 +44,8 @@
44
44
  // main tree when its inputs are unchanged). Green is required: main stays green, and nothing is compared with a base. A test
45
45
  // known red is put in quarantine in the test itself (`it.skip` or `it.fails`, with its
46
46
  // ticket), as a mature continuous integration does; the integration admits none. A
47
- // `npm run verifier` « à repasser » (75: a failure of duration under load, which found no rest
48
- // in its bound, scripts/langages/typescript/verifier.mjs) is neither green nor red: the run stops there, exit 75,
47
+ // `npm run verifier` « à repasser » (75: the wait for the lock of the machine reached its
48
+ // bound, scripts/verrou-de-machine.mjs) is neither green nor red: the run stops there, exit 75,
49
49
  // nothing committed and nothing refused, the lot where it was, for the same command again;
50
50
  // any other code than 0 refuses;
51
51
  // 7. the commit in the copy, its hooks included, under GRILLHOUSE_INTEGRATION=1: a pre-commit
@@ -56,8 +56,7 @@
56
56
  // directory of the ticket's circuit, `<copie>.travail`, stays for the circuit that still runs,
57
57
  // and the queue removes it at the ticket's closure): a refusal, a locked copy for
58
58
  // example, is written to the ticket, the commit stands. The ticket is labelled
59
- // `en-file` and the branch takes its place at the end of the queue
60
- // (scripts/integration/file-attente.mjs). main does not move here.
59
+ // `en-file`, which the queue removes. main does not move here.
61
60
  //
62
61
  // The references written in full are the generated files the project declares
63
62
  // (`grillhouse.engendres`), then the frame's the circuit hands over (`--references`, a JSON file the
@@ -93,12 +92,12 @@ import { pathToFileURL } from 'node:url';
93
92
  import { arbitrageTranche, estArbitrage } from '../arbitrages.mjs';
94
93
  import { couvertPar, engendresDe, regenerer, touchesPar } from '../engendres.mjs';
95
94
  import { langageDe } from '../langages.mjs';
95
+ import { avecLesDonnees, donneesDe } from '../donnees-cles.mjs';
96
96
  import { avecLesOutils, outilsDe } from '../outils-cles.mjs';
97
97
  import { lacherVerrou, prendreVerrou } from '../verrou-de-fichier.mjs';
98
- import { dossierCommun, inscrireEntree } from './file-attente.mjs';
99
98
  import { ouvrirCopie, RETIRER_COPIE } from './rejeu.mjs';
100
99
  import { verdictDe } from './verdict.mjs';
101
- import { A_REPASSER } from '../mesure/pression.mjs';
100
+ import { A_REPASSER } from '../codes-de-sortie.mjs';
102
101
  import { ouvrirBase } from '../mesure/base-de-passe.mjs';
103
102
 
104
103
  // A file name as git writes it in a patch: a name with a character outside ASCII, a quote, a
@@ -250,11 +249,10 @@ function main(argv) {
250
249
  return 2;
251
250
  }
252
251
  // The main tree, from git's common directory: run from a copy, the integration still works on it.
253
- const racine = path.dirname(
254
- spawnSync('git', ['rev-parse', '--path-format=absolute', '--git-common-dir'], {
255
- encoding: 'utf8',
256
- }).stdout.trim()
257
- );
252
+ const commun = spawnSync('git', ['rev-parse', '--path-format=absolute', '--git-common-dir'], {
253
+ encoding: 'utf8',
254
+ }).stdout.trim();
255
+ const racine = path.dirname(commun);
258
256
  const git = (...args) => spawnSync('git', ['-C', racine, ...args], { encoding: 'utf8' });
259
257
  const bd = (...a) =>
260
258
  spawnSync('bd', a, { cwd: racine, encoding: 'utf8', maxBuffer: 256 * 1024 * 1024 });
@@ -267,7 +265,7 @@ function main(argv) {
267
265
 
268
266
  // One integration at a time: a second waits for the end of the first; a lock whose process is
269
267
  // gone is taken over.
270
- const verrou = path.join(dossierCommun(racine), 'integration.lock');
268
+ const verrou = path.join(commun, 'integration.lock');
271
269
  prendreVerrou(verrou, { attendre: true });
272
270
  const debut = Date.now();
273
271
  // The working directory of the integration: a base of its own, removed at its end, swept by the
@@ -278,9 +276,11 @@ function main(argv) {
278
276
  // 0. The keys of the project, before any work.
279
277
  let engendres;
280
278
  let outils;
279
+ let donnees;
281
280
  try {
282
281
  engendres = engendresDe(racine);
283
282
  outils = outilsDe(racine);
283
+ donnees = donneesDe(racine);
284
284
  } catch (e) {
285
285
  return refuser(`Une clé grillhouse du package.json est refusée :\n${e.message}`);
286
286
  }
@@ -385,7 +385,7 @@ function main(argv) {
385
385
  const installation = installer();
386
386
  if (installation) return refuser(installation);
387
387
  if (aRegenerer.length) {
388
- const env = avecLesOutils(outils, process.env);
388
+ const env = avecLesDonnees(donnees, avecLesOutils(outils, process.env));
389
389
  const refus = regenerer({
390
390
  refs: aRegenerer,
391
391
  dansCopie,
@@ -403,10 +403,10 @@ function main(argv) {
403
403
 
404
404
  // 6. The tests: the build, the guards and every test of the day, green required.
405
405
  dire('— npm run verifier (construction, gardes, tests)');
406
- const verdict = tester().status;
406
+ const verdict = tester({ sorte: 'Intégration', ticket: o.ticket }).status;
407
407
  if (verdict === A_REPASSER) {
408
408
  dire(
409
- `⏱ À repasser (code ${A_REPASSER}) : un échec de durée sous charge, sans repos dans la borne. Le lot n'est ni commis ni refusé ; relance la même commande.`
409
+ `⏱ À repasser (code ${A_REPASSER}) : l'attente de la machine a atteint sa borne. Le lot n'est ni commis ni refusé ; relance la même commande.`
410
410
  );
411
411
  return A_REPASSER;
412
412
  }
@@ -428,7 +428,7 @@ function main(argv) {
428
428
  const commit = dansCopie('rev-parse', 'HEAD').stdout.trim();
429
429
 
430
430
  // 8. The branch of the ticket takes the commit; the ticket's copy follows it (it carried the
431
- // lot, which the commit now holds) and is removed; the ticket waits in the queue.
431
+ // lot, which the commit now holds) and is removed; the ticket is labelled `en-file`.
432
432
  const pose = git('update-ref', `refs/heads/${branche}`, commit);
433
433
  if (pose.status !== 0) {
434
434
  return refuser(`La branche ${branche} ne prend pas ${commit.slice(0, 7)} :\n${pose.stderr}`);
@@ -445,12 +445,10 @@ function main(argv) {
445
445
  })
446
446
  : { status: 0, stderr: '' };
447
447
  if (retrait.status !== 0) {
448
- const raison = `La copie ${copieTicket} n'est pas retirée après le commit de ${branche} : ${retrait.stderr.trim()}\nLa branche reste en file.`;
448
+ const raison = `La copie ${copieTicket} n'est pas retirée après le commit de ${branche} : ${retrait.stderr.trim()}`;
449
449
  bd('comments', 'add', o.ticket, raison);
450
450
  dire(`⚠ ${raison}`);
451
451
  }
452
- inscrireEntree(racine, branche, o.ticket);
453
- dire('✓ en file');
454
452
  const duree = Math.round((Date.now() - debut) / 100) / 10;
455
453
  dire(`⏱ ${duree} s`);
456
454
  return 0;
@@ -120,9 +120,10 @@ export function ouvrirCopie({ racine, copie, ref, dire }) {
120
120
  ];
121
121
  const montage = spawnSync('bash', monter('true'), { encoding: 'utf8' });
122
122
  if (montage.status !== 0) return { refus: montage.stderr.trim() };
123
- const lancer = (commande, args) => {
123
+ const lancer = (commande, args, envPlus = null) => {
124
124
  const r = spawnSync('bash', monter(commande, ...args), {
125
125
  cwd: copie,
126
+ ...(envPlus ? { env: { ...process.env, ...envPlus } } : {}),
126
127
  encoding: 'utf8',
127
128
  maxBuffer: SORTIE_MAX,
128
129
  });
@@ -154,10 +155,24 @@ export function ouvrirCopie({ racine, copie, ref, dire }) {
154
155
 
155
156
  // The checks of the copy: its preparation, then its verification; the first that is not green
156
157
  // ends them.
157
- const tester = () => {
158
+ // `identite` (`{ sorte, ticket }`, the ticket null when unknown) is set in the environment of
159
+ // `npm run verifier` alone, which names itself so at the lock of the machine; the preparation
160
+ // does not receive it.
161
+ const tester = identite => {
158
162
  let r;
159
- for (const [commande, args] of commandesDeVerification(copie)) {
160
- r = lancer(commande, args);
163
+ const commandes = commandesDeVerification(copie);
164
+ for (const [i, [commande, args]] of commandes.entries()) {
165
+ const verifier = i === commandes.length - 1 && identite;
166
+ r = lancer(
167
+ commande,
168
+ args,
169
+ verifier
170
+ ? {
171
+ GRILLHOUSE_VERIFICATION_SORTE: identite.sorte,
172
+ GRILLHOUSE_VERIFICATION_TICKET: identite.ticket ?? '',
173
+ }
174
+ : null
175
+ );
161
176
  if (r.status !== 0) {
162
177
  break;
163
178
  }
@@ -230,16 +230,44 @@ export interface Composition {
230
230
  racine: string,
231
231
  o: { composants: Composant[]; noms: string[]; texte: string; nommes: Composant[] }
232
232
  ): Lecteurs;
233
- touches(
234
- racine: string,
235
- o: { depuis: string }
236
- ): { touches: Composant[]; dependants: Composant[]; horsGraphe: string[] };
237
233
  elementsDuLot(racine: string, o: { avant: string; apres: string }): ElementsDuLot;
238
234
  commandes(
239
235
  racine: string
240
236
  ): { tester: Commande; verifier: Commande; typer: Commande } & Record<string, Commande>;
241
237
  verdict(dossier: string): { rapports: RapportDeTest[]; taches: TacheJouee[] };
242
238
  estUnTest(chemin: string, racine: string): ClasseDeTest;
239
+ /** Whether the test file `chemin` (from `racine`) is out of the day, one that only the night
240
+ * plays (a night test, a time budget bench, a time witness), by the module's own definitions;
241
+ * false for any other file. */
242
+ horsDuJour(chemin: string, racine: string): boolean;
243
+ /** Optional, for a tool that reads a test file beside it (typescript): the sibling of HEAD's
244
+ * version of the test file `chemin` (from `racine`), from the root: a file beside it, a test
245
+ * the tool plays in the same run as it, its tests named in the run's report as the file's, of
246
+ * its class (day, night, bench), which the proof of the red writes, plays and removes; null for
247
+ * a file that has none. */
248
+ soeurDAvant?(chemin: string, racine: string): string | null;
249
+ /** Whether HEAD's version of the test file `chemin` (from `racine`) plays in a tree of its own,
250
+ * the copy's with that file alone replaced, under the file's own name, which the proof of the
251
+ * red builds, plays and removes (cargo, python); false for a file the tool cannot play so
252
+ * (cargo: a target `tests/<dossier>/main.rs`, a unit test of `src/`: `testsDeHead`), plays
253
+ * beside it (typescript: `soeurDAvant`) or does not play. */
254
+ arbreDAvant(chemin: string, racine: string): boolean;
255
+ /** The environment a tree of HEAD's version of `chemin` plays under (cargo: the target
256
+ * directory of the copy's compilations); empty for none. */
257
+ envDArbre(chemin: string, racine: string): Record<string, string>;
258
+ /** The names of the tests of HEAD's version of the test file `chemin` (from `racine`), as the
259
+ * verdict names them, read without playing them, for a file whose tree the proof does not play
260
+ * (cargo: a unit test of `src/`, a target `tests/<dossier>/main.rs`, its out-of-line modules read
261
+ * too), or whose tree breaks the build of its package while the lot alone builds (cargo: a
262
+ * target `tests/<nom>.rs` whose HEAD's version no longer compiles against the lot's
263
+ * `tests/common`, grillhouse-3e2.2); the proof of the red holds each for a green HEAD already
264
+ * holds. `lire` gives HEAD's text of a file from the root, null for none. Null for any other
265
+ * file, or one HEAD does not hold. */
266
+ testsDeHead(
267
+ chemin: string,
268
+ racine: string,
269
+ lire: (fichier: string) => string | null
270
+ ): string[] | null;
243
271
  manifestes: Manifestes;
244
272
  fichiersEngendres(racine: string): FichierEngendre[];
245
273
  gardes(racine: string): string[][];
@@ -251,6 +279,35 @@ export interface Langage extends Composition {
251
279
  /** The manifest of a package of this language, in its folder (`package.json`, `Cargo.toml`):
252
280
  * the guard of the languages asks it of a package the architecture declares of this language. */
253
281
  manifeste: string;
282
+ /** The name the text of a manifest of this language gives its package (the `name` of a
283
+ * `package.json`, of the `[package]` of a `Cargo.toml`, of the `[project]` of a
284
+ * `pyproject.toml`); null for none. */
285
+ nomDuManifeste(texte: string): string | null;
286
+ /** The internal dependencies the manifest of the package at `chemin` (from `racine`) links by a
287
+ * path or a workspace entry, as the names of the packages (`nomA` gives the name of the package
288
+ * whose manifest lies in a folder, null for none; a dependency without one keeps its key);
289
+ * `table` names where the manifest links them and `outil` the tool that builds by them. None for
290
+ * a language whose manifest is the package.json. */
291
+ liensDuManifeste(
292
+ racine: string,
293
+ chemin: string,
294
+ nomA: (dossier: string) => string | null
295
+ ): { noms: string[]; table: string; outil: string };
296
+ /** Builds the packages `noms` (by their package.json name) of the project in the working
297
+ * directory, before the tests of a package that declares them as data; throws, named, on a
298
+ * failure. Held by the module of the language whose manifest is the package.json. */
299
+ construireLesPaquets(noms: string[]): void;
300
+ /** The absolute path of the output `sortie` that the package at `chemin` (from `racine`) builds,
301
+ * which another package's tests run (`grillhouse.donnees`, scripts/donnees-cles.mjs): for a
302
+ * crate, a binary of `cargo metadata` in its target directory, `release` or `debug` as `release`
303
+ * says. Throws, named, for a package without that output, and « sortie non prise en charge pour
304
+ * <langage> » for a language whose outputs are not data. */
305
+ sortieDuPaquet(
306
+ racine: string,
307
+ chemin: string,
308
+ sortie: string,
309
+ options?: { release?: boolean }
310
+ ): string;
254
311
  /** The entries of the index of the interfaces, one per interface of the module's components and
255
312
  * the root's, `lignes` as the index writes them, which the core assembles for a project of
256
313
  * several languages (scripts/index-interfaces.mjs). */
@@ -262,17 +319,22 @@ export interface Langage extends Composition {
262
319
  * and its text (its manifest, the configuration of its tests and of its typing, a file of code,
263
320
  * its folder of tests), which the core writes where absent; `espace`, the manifest of the
264
321
  * workspace with the package's entry, from the root and its new text, null when it holds it
265
- * already; `verrouiller`, the command, run in `dossier` (from the root), that brings the lock of
266
- * the versions in line with the new package. `modele`: the package.json of the module's template
267
- * (`miseAJour.gabarit`), the versions of its tools. Throws, named, for a path where the module
268
- * holds no package. */
322
+ * already; `verrouiller`, the commands, each run in its `dossier` (from the root) in their order,
323
+ * that bring the lock of the versions in line with the new package, as `uv add -r` takes the
324
+ * dependencies a file declares. `modele`: the package.json of the module's template
325
+ * (`miseAJour.gabarit`), the versions of its tools; `existants`: the files the folder already
326
+ * holds, from it, its docs/, its hidden entries and the directories the sources of the project
327
+ * leave out (`hors` of scripts/sources.mjs: node_modules, dist, each `ignorer`) left out, which the
328
+ * skeleton takes as they are (as `cargo init` takes the code in place). Throws, named, for a
329
+ * path where the module holds no package, and for a folder whose files it cannot take, what is
330
+ * missing named. */
269
331
  squelette(
270
332
  racine: string,
271
- o: { chemin: string; modele: Record<string, unknown> }
333
+ o: { chemin: string; modele: Record<string, unknown>; existants: string[] }
272
334
  ): {
273
335
  fichiers: Record<string, string>;
274
336
  espace: { fichier: string; texte: string } | null;
275
- verrouiller: { commande: string; args: string[]; dossier: string };
337
+ verrouiller: { commande: string; args: string[]; dossier: string }[];
276
338
  };
277
339
  }
278
340
 
@@ -313,14 +375,10 @@ export function ouvrirAvancement(o: {
313
375
  /** Writes the plan of the tasks of a pass in its progress. */
314
376
  export function inscrireLePlan(dossier: string, o: { racine: string; taches: unknown[] }): void;
315
377
  /** Keeps the total of a pass that ended, for the next one's measure. */
316
- export function garderLeTotal(dossier: string, racine: string): void;
317
- /** Writes the measure of a pass. */
318
- export function ecrireLaMesure(o: {
319
- env?: NodeJS.ProcessEnv;
320
- depot: string;
321
- commande: string;
322
- dossier: string;
323
- }): void;
378
+ export function garderLeTotal(dossier: string): void;
379
+ /** Names the progress directory of the measure that holds the lock of the machine under `env`,
380
+ * beside the lock (scripts/verrou-de-machine.mjs); the function that takes it out. */
381
+ export function nommerLAvancement(o: { env?: NodeJS.ProcessEnv; dossier: string }): () => void;
324
382
  /** Opens the base of a pass of the kind `genre` (scripts/mesure/base-de-passe.mjs). */
325
383
  export function ouvrirBase(genre: string, o?: { dans?: string }): unknown;
326
384
  /** Whether `chemin` lies in a temporary directory under `env` (scripts/mesure/base-de-passe.mjs). */
@@ -328,6 +386,8 @@ export function dansLeTemporaire(chemin: string, env?: NodeJS.ProcessEnv): boole
328
386
  /** The cache of compilation of `outil`, under `~/.cache/grillhouse/`, never in the temporary
329
387
  * directory. */
330
388
  export function cacheDeCompilation(outil: string, env?: NodeJS.ProcessEnv): string;
389
+ /** The path of the command <nom> in the PATH of <env>, or null (scripts/commandes-du-path.mjs). */
390
+ export function trouverDansLePath(nom: string, env?: NodeJS.ProcessEnv): string | null;
331
391
  /** The cache of `outil` for the build rooted at `racine`, swept once `racine` is gone. */
332
392
  export function cacheDeLaRacine(
333
393
  outil: string,
@@ -343,34 +403,114 @@ export function ligneDesRestes(restes: string[]): string | null;
343
403
  export function retirerALInterruption(retirer: () => void): () => void;
344
404
  /** The pressure of the processor above which a pass is « à repasser » (scripts/mesure/pression.mjs). */
345
405
  export const SEUIL_PRESSION: number;
346
- /** The exit code of a pass « à repasser ». */
406
+ /** The exit code of a pass « à repasser » (scripts/codes-de-sortie.mjs). */
347
407
  export const A_REPASSER: number;
348
- /** The longest wait for the rest of the machine, in milliseconds. */
349
- export const BORNE_ATTENTE_MS: number;
408
+ /** The file of Beads that holds the prefix of the tickets (scripts/prefixe-des-tickets.mjs). */
409
+ export const CONFIG_BEADS: string;
410
+ /** The prefix of the tickets, read from the key `issue-prefix`; throws when it is missing. */
411
+ export function prefixe(racine: string): string;
412
+ /** Writes the key `issue-prefix`, unless it holds a value; the line written, or null. */
413
+ export function ecrireLePrefixe(racine: string, valeur: string): string | null;
350
414
  /** The pressure of the processor, in percent, or null when it cannot be read. */
351
415
  export function lirePression(fichier?: string): number | null;
352
416
  /** The pressure `p` as a line says it. */
353
417
  export function ecrirePression(p: number | null): string;
354
- /** Waits for the rest of the machine, within its bound. */
355
- export function attendreLeRepos(o?: Record<string, unknown>): unknown;
356
418
  /** The variable naming the files changed since the last green (scripts/dernier-vert.mjs). */
357
419
  export const CHANGEMENTS: string;
358
420
  /** The variable naming the commit of the last green a run measures itself from. */
359
421
  export const DEPUIS_LE_VERT: string;
360
- /** Keeps the green of a pass, which the next one measures itself from; deferred to the file
361
- * `GRILLHOUSE_VERT_DIFFERE` of `env` names, in a project of several languages. */
362
- export function garderLeVert(etat: unknown, env?: NodeJS.ProcessEnv): void;
422
+ /** The variable the composed command sets for a module that plays after a module whose pass was
423
+ * red: the pass of the verification then keeps no green. */
424
+ export const PASSE_ROUGE: string;
425
+ /** Keeps the green of a pass, which the next one measures itself from: the one pass of the
426
+ * verification keeps it, once, when every task of every language of the graph is green; no module
427
+ * of language keeps one. */
428
+ export function garderLeVert(etat: unknown): void;
363
429
  /** The measure of the repository at `racine` against its last green. */
364
430
  export function mesure(racine: string, o?: { tout?: boolean; dans?: string }): unknown;
431
+ /** The workers a session of an agent plays its tests on (`GRILLHOUSE_TRAVAILLEURS` of `env`), or
432
+ * null in a heavy pass (every core); refuses a value that is not a positive integer, by name. */
433
+ export function travailleursDeLaSeance(env?: NodeJS.ProcessEnv): number | null;
365
434
  /** The wait for the lock of the machine, ended without it (scripts/verrou-de-machine.mjs). */
366
435
  export class AttenteDeLaMachine extends Error {}
367
- /** Runs `faire` under the lock of the machine. */
368
- export function avecLaMachine(...args: unknown[]): unknown;
436
+ /** Runs `faire` on a place of the machine, then under its lock (scripts/places-de-la-machine.mjs). */
437
+ export function avecLaMachineEtUnePlace(...args: unknown[]): unknown;
438
+ /** Plays a pass on a place of the machine: its exit code, or the code of the wait that stops. */
439
+ export function surUnePlace(
440
+ passe: (env: NodeJS.ProcessEnv) => number,
441
+ o?: { env?: NodeJS.ProcessEnv; dire?: (l: string) => void }
442
+ ): number;
369
443
  /** Waits for room in the temporary directory, as a heavy pass does before it plays. */
370
444
  export function attendreDeLaPlace(o?: Record<string, unknown>): void;
371
445
  /** The source files of the project at `racine` under `dossier`, as paths from `racine`, what the
372
446
  * tools of its language write left out (scripts/sources.mjs). */
373
447
  export function sources(racine: string, dossier?: string): string[];
448
+ /** The packages of a language that has no package.json of its own (a crate, a project of Python)
449
+ * the tables of docs/ARCHITECTURE.md declare at `racine`, each `{ langage, chemin, nom }` (`chemin`
450
+ * from the root, `nom` the manifest's name); none for a project that declares neither language
451
+ * (scripts/paquet-npm.mjs). */
452
+ export function paquetsSansPackageJson(
453
+ racine: string
454
+ ): { langage: string; chemin: string; nom: string }[];
455
+ /** The name of the script and of the task of the tests of a package, the same for every language. */
456
+ export const SCRIPT_DES_TESTS: string;
457
+ /** The name of the environment variable that carries the paths and the options of a targeted run
458
+ * to the task of the tests (`{ arguments, rejouer? }` in JSON), the same for every language. */
459
+ export const TESTS_CIBLES: string;
460
+ /** The variable the composed command sets for the modules of a `verifier` that plays beside the
461
+ * module of package.json, whose pass already plays every task of the graph: they play none. */
462
+ export const GRAPHE_JOUE: string;
463
+ /** The beginning of the name of a trace task, the output of a package that another's tests read. */
464
+ export const TRACE: string;
465
+ /** The name of the package of the graph whose folder is `dossier` (absolute) in `racine`, or null
466
+ * when that folder is no package of the graph (scripts/taches-du-graphe.mjs). */
467
+ export function nomDuPaquet(racine: string, dossier: string): string | null;
468
+ /** Runs the tasks `taches` of the packages `noms` (all when empty) with the task runner `outil`,
469
+ * each task whose dependencies succeed played to its end: the runner's exit code. `tests` is the
470
+ * content of the variable `TESTS_CIBLES` of the run; the variable of `env` never passes on. */
471
+ export function lancerLesTaches(o: {
472
+ outil: string;
473
+ racine: string;
474
+ taches: string[];
475
+ noms?: Iterable<string>;
476
+ tests?: { arguments: string[]; rejouer?: string };
477
+ env?: NodeJS.ProcessEnv;
478
+ }): number;
479
+ /** The content of the variable `TESTS_CIBLES` for a targeted run: the paths and options it names, and
480
+ * the moment of the run when `force` (the task plays for real); undefined when there is nothing to
481
+ * carry. */
482
+ export function testsCibles(o: {
483
+ arguments: string[];
484
+ force?: boolean;
485
+ }): { arguments: string[]; rejouer?: string } | undefined;
486
+ /** The paths and the options of a task of the tests of a package, run by its script: the paths
487
+ * `donnes` its script names, each replaced by those of the variable `TESTS_CIBLES` of `env` that
488
+ * lie in the same component (`dossierDe`: the folder of the component of an absolute path, or
489
+ * null), and the options of the variable. */
490
+ export function cheminsDeLaTache(o: {
491
+ racine: string;
492
+ donnes: string[];
493
+ env?: NodeJS.ProcessEnv;
494
+ dossierDe: (absolu: string) => string | null;
495
+ }): { chemins: string[]; options: string[] };
496
+ /** The trace tasks of a plan of the runner (`run … --dry=json`, parsed), those `garder` keeps: their
497
+ * task ids, sorted. */
498
+ export function tracesDuPlan(
499
+ plan: { tasks: { task: string; taskId: string }[] },
500
+ garder?: (t: any) => boolean
501
+ ): string[];
502
+ /** The command `construire --echec <fichier> <plan>` of a module, run from the root of the copy:
503
+ * builds the plan and its providers with the task runner `outil`, `run build --filter=<paquet>…`
504
+ * (the whole copy for a plan with a path that is no package); its exit code. */
505
+ export function construireDepuisLesArguments(
506
+ outil: string,
507
+ args: string[],
508
+ racine?: string
509
+ ): number;
510
+ /** What `lire` returns, read once under `cle` while the core holds a scope of readings done once
511
+ * (a sweep that asks many questions of a tree that does not move), at each call otherwise
512
+ * (scripts/lecture-unique.mjs). */
513
+ export function luUneFois<T>(cle: string, lire: () => T): T;
374
514
  /** True when the text of a ticket's comment is an arbitrage (scripts/arbitrages.mjs). */
375
515
  export function estArbitrage(text: string | null | undefined): boolean;
376
516
  /** True when the arbitrage `a` of `comments` is settled. */