@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
@@ -13,8 +13,9 @@
13
13
  // with its `piece`: the circuit goes on, or stops at « hors-portee » or « besoin », the piece
14
14
  // with the stop (testwriter, developpeur, and the explorateur's gesture of a mechanical ticket,
15
15
  // its own schema, `geste`);
16
- // - `verts_attendus` (`fichier` from the root, `test` its full name, or none for every green of a
17
- // file HEAD holds, `raison`): the proof of the red (testwriter);
16
+ // - `portent_le_travail` (`fichier` from the root, `test` its full name, or none for every test of
17
+ // the file): the tests of the lot that carry the ticket's work, which the proof of the red
18
+ // requires red (testwriter);
18
19
  // - `renvoi` (`role` testwriter): the circuit relaunches the testwriter, then the proof and the
19
20
  // developpeur (developpeur);
20
21
  // - `hors_plan` (`critere` its number, `paquet` the package out of the plan that would hold it,
@@ -303,18 +304,15 @@ const FICHES = {
303
304
  testwriter: objet(
304
305
  {
305
306
  ...STATUT,
306
- verts_attendus: liste(
307
+ portent_le_travail: liste(
307
308
  objet(
308
309
  {
309
310
  fichier: texte('Le fichier de tests, depuis la racine du dépôt.'),
310
- test: texte(
311
- 'Le nom complet du test ; absent, chaque vert du fichier, s’il est un fichier que HEAD tient.'
312
- ),
313
- raison: texte('Pourquoi ce test passe avant le code.'),
311
+ test: texte('Le nom complet du test ; absent, chaque test du fichier.'),
314
312
  },
315
- ['fichier', 'raison']
313
+ ['fichier']
316
314
  ),
317
- 'Chaque test vert avant le code, que la preuve du rouge admet.'
315
+ 'Les tests du lot qui portent le travail du ticket : la preuve du rouge exige qu’ils échouent avant le code.'
318
316
  ),
319
317
  ...DECOUVERTES,
320
318
  },
@@ -506,25 +504,35 @@ export function sorteDuPlan(fiche) {
506
504
  function erreurs(schema, valeur, ou) {
507
505
  const nom = ou || 'la fiche';
508
506
  if (schema.type === 'object') {
509
- if (!valeur || typeof valeur !== 'object' || Array.isArray(valeur))
507
+ if (!valeur || typeof valeur !== 'object' || Array.isArray(valeur)) {
510
508
  return [`${nom} : un objet`];
509
+ }
511
510
  const out = [];
512
511
  for (const k of schema.required ?? []) {
513
- if (!(k in valeur)) out.push(`${ou ? `${ou}.` : ''}${k} : manque`);
512
+ if (!(k in valeur)) {
513
+ out.push(`${ou ? `${ou}.` : ''}${k} : manque`);
514
+ }
514
515
  }
515
516
  for (const [k, v] of Object.entries(valeur)) {
516
517
  const sous = schema.properties[k];
517
518
  const chemin = `${ou ? `${ou}.` : ''}${k}`;
518
- if (!sous) out.push(`${chemin} : hors du schéma`);
519
- else out.push(...erreurs(sous, v, chemin));
519
+ if (!sous) {
520
+ out.push(`${chemin} : hors du schéma`);
521
+ } else {
522
+ out.push(...erreurs(sous, v, chemin));
523
+ }
520
524
  }
521
525
  return out;
522
526
  }
523
527
  if (schema.type === 'array') {
524
- if (!Array.isArray(valeur)) return [`${nom} : une liste`];
528
+ if (!Array.isArray(valeur)) {
529
+ return [`${nom} : une liste`];
530
+ }
525
531
  return valeur.flatMap((v, i) => erreurs(schema.items, v, `${ou}[${i}]`));
526
532
  }
527
- if (typeof valeur !== 'string') return [`${nom} : un texte`];
533
+ if (typeof valeur !== 'string') {
534
+ return [`${nom} : un texte`];
535
+ }
528
536
  if (schema.enum && !schema.enum.includes(valeur)) {
529
537
  return [`${nom} : « ${valeur} » n'est pas l'un de ${schema.enum.join(', ')}`];
530
538
  }
@@ -563,13 +571,17 @@ export function conformiteDuLot(fiche, { elements, fichiers }) {
563
571
  const ids = new Set(elements.map(e => e.id));
564
572
  const hors = new Set(fichiers ?? []);
565
573
  const duLot = element => {
566
- if (ids.has(element) || hors.has(element)) return true;
574
+ if (ids.has(element) || hors.has(element)) {
575
+ return true;
576
+ }
567
577
  const diese = element.lastIndexOf('#');
568
578
  return diese > 0 && diese < element.length - 1 && hors.has(element.slice(0, diese));
569
579
  };
570
580
  const fautes = [];
571
581
  const sans = elements.filter(e => !lignes.some(l => l.element === e.id)).map(e => e.id);
572
- if (sans.length) fautes.push(`conformite : sans ligne pour ${sans.join(', ')}`);
582
+ if (sans.length) {
583
+ fautes.push(`conformite : sans ligne pour ${sans.join(', ')}`);
584
+ }
573
585
  for (const [i, l] of lignes.entries()) {
574
586
  if (!duLot(l.element)) {
575
587
  fautes.push(`conformite[${i}].element : ${l.element} n'est pas un élément du lot`);
@@ -612,10 +624,14 @@ export function cleDuConstat(titre) {
612
624
  // (<titres>), as the author answers in each thread of a review: a FAIT without the answer to one,
613
625
  // by its title (a BLOQUÉ or a BESOIN stops the circuit before any review). The fault, or null.
614
626
  export function reponsesAuxConstats(fiche, titres) {
615
- if (fiche.statut !== 'FAIT') return null;
627
+ if (fiche.statut !== 'FAIT') {
628
+ return null;
629
+ }
616
630
  const repondus = new Set((fiche.reponses ?? []).map(r => cleDuConstat(r.titre)));
617
631
  const sans = titres.filter(t => !repondus.has(t)).map(t => `« ${t} »`);
618
- if (!sans.length) return null;
632
+ if (!sans.length) {
633
+ return null;
634
+ }
619
635
  return `reponses : sans réponse ${sans.length > 1 ? 'aux constats' : 'au constat'} ${sans.join(', ')}`;
620
636
  }
621
637
 
@@ -631,7 +647,9 @@ export function suiviDesConstats(fiche, titres) {
631
647
  return `suivi : sans ligne pour ${sans.length > 1 ? 'les constats' : 'le constat'} ${liste(sans)}`;
632
648
  }
633
649
  const tenus = fiche.verdict === 'ACCEPTÉ' ? titres.filter(t => etats.get(t) !== 'levé') : [];
634
- if (!tenus.length) return null;
650
+ if (!tenus.length) {
651
+ return null;
652
+ }
635
653
  return `suivi : un ACCEPTÉ tient ${tenus.length > 1 ? 'les constats' : 'le constat'} ${liste(tenus)} non levé${tenus.length > 1 ? 's' : ''}`;
636
654
  }
637
655
 
@@ -643,10 +661,15 @@ export function conformiteDuTri(fiche, decouvertes) {
643
661
  const lignes = (fiche.verdicts ?? []).map(l => l.decouverte);
644
662
  const fautes = [];
645
663
  const sans = decouvertes.filter(d => !lignes.includes(d));
646
- if (sans.length) fautes.push(`verdicts : sans ligne pour ${sans.join(', ')}`);
664
+ if (sans.length) {
665
+ fautes.push(`verdicts : sans ligne pour ${sans.join(', ')}`);
666
+ }
647
667
  for (const d of new Set(lignes)) {
648
- if (!decouvertes.includes(d)) fautes.push(`verdicts : ${d} n'est pas une découverte du ticket`);
649
- else if (lignes.filter(x => x === d).length > 1) fautes.push(`verdicts : ${d} a deux lignes`);
668
+ if (!decouvertes.includes(d)) {
669
+ fautes.push(`verdicts : ${d} n'est pas une découverte du ticket`);
670
+ } else if (lignes.filter(x => x === d).length > 1) {
671
+ fautes.push(`verdicts : ${d} a deux lignes`);
672
+ }
650
673
  }
651
674
  return fautes.length ? fautes.join(' ; ') : null;
652
675
  }
@@ -663,7 +686,9 @@ export function conformiteDuTri(fiche, decouvertes) {
663
686
  export function lirePiece(texte) {
664
687
  const t = String(texte ?? '').trim();
665
688
  const ticket = /^ticket\s*,\s*/i.exec(t);
666
- if (ticket) return pieceDuTicket(t.slice(ticket[0].length));
689
+ if (ticket) {
690
+ return pieceDuTicket(t.slice(ticket[0].length));
691
+ }
667
692
  if (t.startsWith('$ ')) {
668
693
  const vrai = t.indexOf('\n');
669
694
  const saut = vrai < 0 ? t.indexOf('\\n') : vrai;
@@ -672,15 +697,25 @@ export function lirePiece(texte) {
672
697
  return commande && sortie ? { commande, sortie } : null;
673
698
  }
674
699
  let lieu = t.split(/\s/)[0];
675
- while (lieu && '`.,;:)'.includes(lieu.at(-1))) lieu = lieu.slice(0, -1);
676
- while (lieu.startsWith('`')) lieu = lieu.slice(1);
700
+ while (lieu && '`.,;:)'.includes(lieu.at(-1))) {
701
+ lieu = lieu.slice(0, -1);
702
+ }
703
+ while (lieu.startsWith('`')) {
704
+ lieu = lieu.slice(1);
705
+ }
677
706
  const deux = lieu.lastIndexOf(':');
678
707
  const [debut, fin, ...reste] = lieu.slice(deux + 1).split('-');
679
708
  const nombre = n => (/^\d+$/.test(n ?? '') && Number(n) >= 1 ? Number(n) : null);
680
709
  const ligne = nombre(debut);
681
- if (deux < 1 || !ligne || reste.length) return null;
682
- if (fin === undefined) return { fichier: lieu.slice(0, deux), ligne };
683
- if (!nombre(fin) || nombre(fin) < ligne) return null;
710
+ if (deux < 1 || !ligne || reste.length) {
711
+ return null;
712
+ }
713
+ if (fin === undefined) {
714
+ return { fichier: lieu.slice(0, deux), ligne };
715
+ }
716
+ if (!nombre(fin) || nombre(fin) < ligne) {
717
+ return null;
718
+ }
684
719
  return { fichier: lieu.slice(0, deux), ligne, fin: nombre(fin) };
685
720
  }
686
721
 
@@ -689,8 +724,12 @@ export function lirePiece(texte) {
689
724
  // piece cites one criterion: « critère 1 et 7 » is none.
690
725
  function pieceDuTicket(reste) {
691
726
  const critere = /^critère\s+([1-9]\d*)(?!\d)(?!\s*(?:et|,)\s*\d)(?:$|[\s.,;:])/i.exec(reste);
692
- if (critere) return { critere: Number(critere[1]) };
693
- if (!reste.startsWith('§')) return null;
727
+ if (critere) {
728
+ return { critere: Number(critere[1]) };
729
+ }
730
+ if (!reste.startsWith('§')) {
731
+ return null;
732
+ }
694
733
  const apres = reste.slice(1).trim();
695
734
  const cite = /^«\s*([^»]*?)\s*»/.exec(apres);
696
735
  const section = (cite ? cite[1] : apres.split(/\s:(?:\s|$)|:$/)[0]).trim();
@@ -714,7 +753,9 @@ function introuvables(f, copie) {
714
753
  const racine = path.resolve(copie);
715
754
  for (const [ou, p] of piecesDe(f)) {
716
755
  const lu = lirePiece(p);
717
- if (!lu?.fichier) continue;
756
+ if (!lu?.fichier) {
757
+ continue;
758
+ }
718
759
  const abs = path.resolve(racine, lu.fichier);
719
760
  const lieu = `${lu.fichier}:${lu.ligne}${lu.fin ? `-${lu.fin}` : ''}`;
720
761
  if (!abs.startsWith(`${racine}${path.sep}`) || !existsSync(abs) || !statSync(abs).isFile()) {
@@ -748,7 +789,9 @@ function horsDuTicket(f, description) {
748
789
  continue;
749
790
  }
750
791
  const numero = /^\s*(\d+)[.)]\s/.exec(ligne);
751
- if (dedans && numero) criteres.add(Number(numero[1]));
792
+ if (dedans && numero) {
793
+ criteres.add(Number(numero[1]));
794
+ }
752
795
  }
753
796
  const out = [];
754
797
  for (const [ou, p] of piecesDe(f)) {
@@ -778,8 +821,12 @@ function horsDuTicket(f, description) {
778
821
  function manques(role, f) {
779
822
  const out = [];
780
823
  const plein = k => typeof f[k] === 'string' && f[k].trim() !== '';
781
- if (f.statut === 'BLOQUÉ' && !plein('raison')) out.push('raison : manque, pour BLOQUÉ');
782
- if (f.statut === 'BESOIN' && !plein('question')) out.push('question : manque, pour BESOIN');
824
+ if (f.statut === 'BLOQUÉ' && !plein('raison')) {
825
+ out.push('raison : manque, pour BLOQUÉ');
826
+ }
827
+ if (f.statut === 'BESOIN' && !plein('question')) {
828
+ out.push('question : manque, pour BESOIN');
829
+ }
783
830
  if (['BLOQUÉ', 'BESOIN'].includes(f.statut) && !('piece' in f)) {
784
831
  out.push(`piece : manque, pour ${f.statut}`);
785
832
  }
@@ -831,7 +878,9 @@ function manques(role, f) {
831
878
  }
832
879
  }
833
880
  if (role === 'explorateur') {
834
- if (!(f.paquets ?? []).length) out.push('paquets : manque, pour un plan');
881
+ if (!(f.paquets ?? []).length) {
882
+ out.push('paquets : manque, pour un plan');
883
+ }
835
884
  for (const [i, r] of (f.reponses ?? []).entries()) {
836
885
  if (!/^[1-9]\d*$/.test(r.numero)) {
837
886
  out.push(`reponses[${i}].numero : « ${r.numero} » n'est pas le numéro d'une question`);
@@ -840,7 +889,9 @@ function manques(role, f) {
840
889
  }
841
890
  if (role === 'tri') {
842
891
  for (const [i, l] of (f.verdicts ?? []).entries()) {
843
- if (!l.texte.trim()) out.push(`verdicts[${i}].texte : manque, pour ${l.verdict}`);
892
+ if (!l.texte.trim()) {
893
+ out.push(`verdicts[${i}].texte : manque, pour ${l.verdict}`);
894
+ }
844
895
  if (VERDICTS_PROUVES.includes(l.verdict) && !('piece' in l)) {
845
896
  out.push(
846
897
  `verdicts[${i}].piece : manque, pour ${l.verdict} : « $ <commande> » rejouée sur main et sa sortie, ou fichier:ligne ; sans elle, le verdict est non-confirmee`
@@ -863,7 +914,9 @@ function manques(role, f) {
863
914
  // the description of the ticket, each piece of the ticket names a criterion or a section of it.
864
915
  export function lireFiche(role, sortie, { copie, ticket } = {}) {
865
916
  const schema = schemaDeFiche(role);
866
- if (!schema) return { erreur: `le rôle ${role} n'a pas de fiche` };
917
+ if (!schema) {
918
+ return { erreur: `le rôle ${role} n'a pas de fiche` };
919
+ }
867
920
  let resultat;
868
921
  try {
869
922
  resultat = JSON.parse(String(sortie ?? ''));
@@ -875,16 +928,26 @@ export function lireFiche(role, sortie, { copie, ticket } = {}) {
875
928
  }
876
929
  const fiche = resultat.structured_output;
877
930
  const fautes = erreurs(schema, fiche, '');
878
- if (!fautes.length) fautes.push(...manques(role, fiche));
879
- if (!fautes.length && copie) fautes.push(...introuvables(fiche, copie));
880
- if (!fautes.length && typeof ticket === 'string') fautes.push(...horsDuTicket(fiche, ticket));
881
- if (fautes.length) return { erreur: `fiche non conforme : ${fautes.join(' ; ')}` };
931
+ if (!fautes.length) {
932
+ fautes.push(...manques(role, fiche));
933
+ }
934
+ if (!fautes.length && copie) {
935
+ fautes.push(...introuvables(fiche, copie));
936
+ }
937
+ if (!fautes.length && typeof ticket === 'string') {
938
+ fautes.push(...horsDuTicket(fiche, ticket));
939
+ }
940
+ if (fautes.length) {
941
+ return { erreur: `fiche non conforme : ${fautes.join(' ; ')}` };
942
+ }
882
943
  return { fiche, seance: resultat.session_id ?? null };
883
944
  }
884
945
 
885
946
  // The directory of the package of <racine> that holds <fichier> (from the root), null for none.
886
947
  function paquetDe(racine, fichier) {
887
- if (!fichier) return null;
948
+ if (!fichier) {
949
+ return null;
950
+ }
888
951
  const p = paquets(racine)
889
952
  .filter(({ dossier }) => fichier === dossier || fichier.startsWith(`${dossier}/`))
890
953
  .sort((a, b) => b.dossier.length - a.dossier.length)[0];
@@ -934,7 +997,9 @@ let numero = 0;
934
997
  // its path, or null without the variable.
935
998
  export function ecrireSarif({ garde, constats, racine = process.cwd(), env = process.env }) {
936
999
  const dossier = env[RESULTATS];
937
- if (!dossier) return null;
1000
+ if (!dossier) {
1001
+ return null;
1002
+ }
938
1003
  const f = path.join(dossier, SARIF, `${garde}-${process.pid}-${++numero}.sarif`);
939
1004
  mkdirSync(path.dirname(f), { recursive: true });
940
1005
  writeFileSync(f, `${JSON.stringify(sarif({ garde, constats, racine }), null, 2)}\n`);
@@ -989,8 +1054,9 @@ export function lireSarif(dossier) {
989
1054
  if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) {
990
1055
  const [option, role] = process.argv.slice(2);
991
1056
  const schema = option === '--schema' ? schemaDeFiche(role) : null;
992
- if (schema) process.stdout.write(`${JSON.stringify(schema)}\n`);
993
- else {
1057
+ if (schema) {
1058
+ process.stdout.write(`${JSON.stringify(schema)}\n`);
1059
+ } else {
994
1060
  process.stderr.write(
995
1061
  option === '--schema'
996
1062
  ? `⛔ le rôle ${role} n'a pas de fiche.\n`
@@ -0,0 +1,25 @@
1
+ // The command of the removal of the finished copies (./copies-finies.mjs), which the night runs
2
+ // once its steps are played (scripts/nuit.sh):
3
+ //
4
+ // node scripts/retirer-les-copies-finies.mjs [<copie finie de jouer>…] from the main tree
5
+ //
6
+ // - The circuits that run are what the Temporal server says (./circuits-du-serveur.mjs, one call,
7
+ // 5 s at most); a server that does not answer, a client not built or any other fault of that
8
+ // reading leaves them unread (null), as the removal of ./copies-finies.mjs takes them.
9
+ // - The removal lives in ./copies-finies.mjs, which imports nothing of the built `dist/`: the lock
10
+ // of the machine (./verrou-de-machine.mjs) and the base configuration of the tests import it,
11
+ // and a project of trial holds the frame's scripts without `dist/`.
12
+ import { circuitsDuServeur } from './circuits-du-serveur.mjs';
13
+ import { retirerLesCopiesDuDepot } from './copies-finies.mjs';
14
+
15
+ const racine = process.cwd();
16
+ let vivants = null;
17
+ try {
18
+ vivants = new Set((await circuitsDuServeur(racine)).filter(c => c.vivant).map(c => c.ticket));
19
+ } catch {
20
+ vivants = null;
21
+ }
22
+ const lignes = retirerLesCopiesDuDepot(racine, process.argv.slice(2), vivants);
23
+ if (lignes.length) {
24
+ process.stdout.write(`${lignes.join('\n')}\n`);
25
+ }
@@ -0,0 +1,4 @@
1
+ // The types of ./sans-reponse.mjs, for the frame's TypeScript (src/temporal/circuit/commande.ts).
2
+
3
+ /** « Temporal ne répond pas en <n> s », <n> the delay <delaiMs> in seconds. */
4
+ export function sansReponseEn(delaiMs: number): string;
@@ -0,0 +1,13 @@
1
+ // What a reading of the Temporal server says when the server does not answer within its delay:
2
+ // the fact measured, « Temporal ne répond pas en <n> s », since a server slow under load and a port
3
+ // where none listens look the same from the client. One rule for every reader: the board, the
4
+ // opening of a session (scripts/circuits-du-serveur.mjs), the command of the circuit
5
+ // (src/temporal/circuit/commande.ts) and the state of the service (src/temporal/etat.ts), each
6
+ // with the delay of its own reading.
7
+
8
+ /**
9
+ * « Temporal ne répond pas en <n> s », <n> the delay <delaiMs> in seconds.
10
+ * @param {number} delaiMs
11
+ * @returns {string}
12
+ */
13
+ export const sansReponseEn = delaiMs => `Temporal ne répond pas en ${delaiMs / 1000} s`;