@roomi-fields/grillhouse 0.47.1 → 0.49.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 (186) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/CHANGELOG.md +116 -0
  3. package/agents/direct.md +9 -0
  4. package/cadre/templates/projet/.github/workflows/ci.yml +24 -38
  5. package/cadre/templates/projet/.github/workflows/machine-vierge.yml +5 -0
  6. package/cadre/templates/projet/.github/workflows/nuit.yml +14 -2
  7. package/cadre/templates/projet/CLAUDE.md +31 -10
  8. package/cadre/templates/projet/docs/agents/issue-tracker.md +1 -1
  9. package/cadre/templates/turbo/paquets.json +3 -1
  10. package/cadre/templates/turbo/sans-paquets.json +3 -1
  11. package/charte.md +46 -13
  12. package/dist/temporal/circuit/appel.d.ts +4 -1
  13. package/dist/temporal/circuit/appel.js +15 -1
  14. package/dist/temporal/circuit/appel.js.map +1 -1
  15. package/dist/temporal/circuit/client.d.ts +7 -1
  16. package/dist/temporal/circuit/client.js +54 -1
  17. package/dist/temporal/circuit/client.js.map +1 -1
  18. package/dist/temporal/circuit/commande.js +35 -60
  19. package/dist/temporal/circuit/commande.js.map +1 -1
  20. package/dist/temporal/circuit/contrat.d.ts +2 -1
  21. package/dist/temporal/circuit/contrat.js +2 -1
  22. package/dist/temporal/circuit/contrat.js.map +1 -1
  23. package/dist/temporal/circuit/deroule.js +9 -2
  24. package/dist/temporal/circuit/deroule.js.map +1 -1
  25. package/dist/temporal/commande.js +2 -13
  26. package/dist/temporal/commande.js.map +1 -1
  27. package/dist/temporal/deroules.d.ts +1 -1
  28. package/dist/temporal/deroules.js +2 -2
  29. package/dist/temporal/deroules.js.map +1 -1
  30. package/dist/temporal/file/activites.d.ts +1 -4
  31. package/dist/temporal/file/activites.js +13 -14
  32. package/dist/temporal/file/activites.js.map +1 -1
  33. package/dist/temporal/file/contrat.d.ts +34 -91
  34. package/dist/temporal/file/contrat.js +33 -5
  35. package/dist/temporal/file/contrat.js.map +1 -1
  36. package/dist/temporal/file/deroule.d.ts +1 -9
  37. package/dist/temporal/file/deroule.js +57 -166
  38. package/dist/temporal/file/deroule.js.map +1 -1
  39. package/dist/temporal/installation.d.ts +26 -1
  40. package/dist/temporal/installation.js +111 -2
  41. package/dist/temporal/installation.js.map +1 -1
  42. package/dist/temporal/nuits/activites.d.ts +5 -10
  43. package/dist/temporal/nuits/activites.js +9 -57
  44. package/dist/temporal/nuits/activites.js.map +1 -1
  45. package/dist/temporal/nuits/choix.d.ts +15 -0
  46. package/dist/temporal/nuits/choix.js +20 -0
  47. package/dist/temporal/nuits/choix.js.map +1 -1
  48. package/dist/temporal/nuits/contrat.d.ts +11 -16
  49. package/dist/temporal/nuits/deroule.js +38 -67
  50. package/dist/temporal/nuits/deroule.js.map +1 -1
  51. package/dist/temporal/places/client.d.ts +9 -11
  52. package/dist/temporal/places/client.js +11 -19
  53. package/dist/temporal/places/client.js.map +1 -1
  54. package/dist/temporal/places/contrat.d.ts +25 -24
  55. package/dist/temporal/places/contrat.js +5 -7
  56. package/dist/temporal/places/contrat.js.map +1 -1
  57. package/dist/temporal/places/deroule.js +26 -36
  58. package/dist/temporal/places/deroule.js.map +1 -1
  59. package/dist/temporal/tickets/activites.js +4 -2
  60. package/dist/temporal/tickets/activites.js.map +1 -1
  61. package/dist/temporal/tickets/contrat.d.ts +2 -1
  62. package/docs/ARCHITECTURE.md +453 -133
  63. package/docs/CADRE.md +16 -13
  64. package/docs/INTERFACE.md +100 -25
  65. package/hooks/hooks.json +9 -0
  66. package/hooks/register.tsx +59 -5
  67. package/package.json +1 -1
  68. package/scripts/activites.mjs +319 -52
  69. package/scripts/aiguillage.mjs +5 -1
  70. package/scripts/attente-a-l-arret.mjs +2 -5
  71. package/scripts/attente-au-tour.mjs +2 -5
  72. package/scripts/bilan.mjs +125 -2
  73. package/scripts/branche-de-nuit.mjs +32 -44
  74. package/scripts/ci-de-main.mjs +215 -16
  75. package/scripts/circuit.mjs +275 -189
  76. package/scripts/circuits-cles.d.mts +3 -3
  77. package/scripts/circuits-cles.mjs +6 -5
  78. package/scripts/coeurs-dedies.mjs +4 -4
  79. package/scripts/commandes-composees.mjs +12 -5
  80. package/scripts/composition-des-langages.mjs +2 -0
  81. package/scripts/crochets.mjs +2 -2
  82. package/scripts/dette.d.ts +2 -1
  83. package/scripts/dette.mjs +49 -6
  84. package/scripts/direct.mjs +343 -0
  85. package/scripts/droits.mjs +19 -0
  86. package/scripts/effets.mjs +6 -5
  87. package/scripts/engendres.mjs +2 -1
  88. package/scripts/enveloppe/enveloppe.mjs +127 -18
  89. package/scripts/enveloppe/lancer.sh +14 -3
  90. package/scripts/enveloppe/paquets-du-plan.mjs +9 -0
  91. package/scripts/enveloppe/travail-de-la-copie.mjs +121 -21
  92. package/scripts/etapes.mjs +14 -4
  93. package/scripts/etat-du-depot.mjs +23 -0
  94. package/scripts/faits-du-circuit.mjs +24 -34
  95. package/scripts/fermeture-de-la-machine.d.mts +27 -0
  96. package/scripts/fermeture-de-la-machine.mjs +98 -0
  97. package/scripts/fichiers-nommes.mjs +27 -1
  98. package/scripts/file-des-tickets.d.mts +18 -1
  99. package/scripts/file-des-tickets.mjs +63 -15
  100. package/scripts/greffons.mjs +1 -1
  101. package/scripts/grillhouse-maj.mjs +13 -25
  102. package/scripts/groupe-cles.d.mts +6 -0
  103. package/scripts/groupe-cles.mjs +29 -1
  104. package/scripts/integration/file.mjs +162 -48
  105. package/scripts/integration/integrer.mjs +2 -0
  106. package/scripts/jointure.d.ts +22 -3
  107. package/scripts/journal-des-etats.d.mts +16 -0
  108. package/scripts/journal-des-etats.mjs +44 -2
  109. package/scripts/journal.mjs +3 -0
  110. package/scripts/langages/c/commandes.mjs +5 -5
  111. package/scripts/langages/c/composants.mjs +13 -5
  112. package/scripts/langages/c/index.mjs +2 -0
  113. package/scripts/langages/c/squelette.mjs +1 -1
  114. package/scripts/langages/cargo/commandes.mjs +5 -6
  115. package/scripts/langages/cargo/index.mjs +2 -0
  116. package/scripts/langages/python/commandes.mjs +5 -5
  117. package/scripts/langages/python/composants.mjs +10 -2
  118. package/scripts/langages/python/index.mjs +2 -0
  119. package/scripts/langages/typescript/composants.mjs +10 -3
  120. package/scripts/langages/typescript/construire.mjs +2 -0
  121. package/scripts/langages/typescript/exemples.mjs +33 -1
  122. package/scripts/langages/typescript/index.mjs +22 -0
  123. package/scripts/langages/typescript/migrations/0.49.0-tests-equipes.mjs +32 -0
  124. package/scripts/langages/typescript/module-absent.mjs +24 -0
  125. package/scripts/langages/typescript/tests-de-nuit.mjs +152 -32
  126. package/scripts/langages/typescript/tests-du-poste.mjs +65 -23
  127. package/scripts/langages/typescript/titres-de-tests.mjs +11 -7
  128. package/scripts/langages/typescript/turbo-des-paquets.mjs +40 -5
  129. package/scripts/langages/typescript/verifier.mjs +3 -5
  130. package/scripts/langages/typescript/verrou-des-dependances.mjs +161 -0
  131. package/scripts/langages/typescript/vitest-config/cibles.mjs +57 -6
  132. package/scripts/langages/typescript/vitest-config/lances.mjs +3 -1
  133. package/scripts/langages/typescript/vitest-config/machine.setup.mjs +11 -5
  134. package/scripts/langages/typescript/vitest.nuit.config.mjs +53 -5
  135. package/scripts/langages.mjs +25 -3
  136. package/scripts/machine.mjs +103 -0
  137. package/scripts/matieres-cles.mjs +17 -0
  138. package/scripts/matieres-lues.mjs +104 -0
  139. package/scripts/mesure/base-de-passe.mjs +2 -1
  140. package/scripts/migrations/0.48.0-ci-declenchee-par-la-file.mjs +32 -0
  141. package/scripts/migrations/0.48.0-poussee-retiree.mjs +31 -0
  142. package/scripts/migrations/0.49.0-reservation-de-trois-coeurs.mjs +30 -0
  143. package/scripts/migrations.mjs +6 -0
  144. package/scripts/nuit.sh +113 -46
  145. package/scripts/paquet.mjs +16 -5
  146. package/scripts/paquets.d.ts +4 -0
  147. package/scripts/paquets.mjs +57 -0
  148. package/scripts/passe-de-la-machine.mjs +13 -14
  149. package/scripts/places-de-la-machine.mjs +120 -44
  150. package/scripts/places-du-serveur.mjs +29 -8
  151. package/scripts/plafond-de-la-machine.d.mts +7 -13
  152. package/scripts/plafond-de-la-machine.mjs +19 -35
  153. package/scripts/poussee-retiree.mjs +18 -0
  154. package/scripts/prefixe-des-tickets.mjs +1 -1
  155. package/scripts/references-changees.mjs +159 -0
  156. package/scripts/registre.d.mts +2 -2
  157. package/scripts/regles-des-places.d.mts +20 -12
  158. package/scripts/regles-des-places.mjs +27 -30
  159. package/scripts/repli-de-la-nuit.mjs +112 -0
  160. package/scripts/reponses-du-circuit.d.mts +4 -2
  161. package/scripts/reponses-du-circuit.mjs +44 -9
  162. package/scripts/reprise.mjs +27 -8
  163. package/scripts/resultats.mjs +61 -9
  164. package/scripts/seances.mjs +258 -40
  165. package/scripts/services-du-noyau.mjs +3 -0
  166. package/scripts/sous-commandes.mjs +37 -7
  167. package/scripts/superviseur.mjs +241 -88
  168. package/scripts/tableau.mjs +327 -131
  169. package/scripts/taches-du-graphe.mjs +84 -4
  170. package/scripts/ticket.mjs +345 -0
  171. package/scripts/transitions.d.mts +52 -0
  172. package/scripts/transitions.mjs +194 -16
  173. package/scripts/un-commit-par-ticket.mjs +4 -3
  174. package/scripts/verdict-de-la-nuit.mjs +47 -20
  175. package/scripts/verrou-de-fichier.mjs +2 -2
  176. package/scripts/verrous/ecriture-hors-enveloppe.mjs +86 -0
  177. package/scripts/verrous/verrou.mjs +17 -1
  178. package/skills/developpeur/SKILL.md +1 -1
  179. package/skills/direct/SKILL.md +57 -0
  180. package/skills/explorateur/SKILL.md +10 -6
  181. package/skills/pitmaster/SKILL.md +37 -14
  182. package/skills/pitmaster/references/consigne-agent.md +7 -1
  183. package/skills/relecteur/SKILL.md +11 -1
  184. package/skills/testwriter/SKILL.md +10 -0
  185. package/scripts/poussee-cles.mjs +0 -46
  186. package/scripts/ticket.sh +0 -25
@@ -33,6 +33,11 @@ import { BASE as GARDES_DE_LA_BASE, FICHIER as DETTE } from './dette.mjs';
33
33
  import { commandesPermises, optionsDuRole } from './droits.mjs';
34
34
  import { cheminsLus } from './composants-affectes.mjs';
35
35
  import { couvertPar } from './engendres.mjs';
36
+ import {
37
+ differencesDesReferences,
38
+ ligneDesReferences,
39
+ texteDesDifferences,
40
+ } from './references-changees.mjs';
36
41
  import { ecrireLaListe, VARIABLE as VARIABLE_ENVELOPPE } from './enveloppe/paquets-du-plan.mjs';
37
42
  import { etapeDuCircuit, EXPLORATEUR, SUITE } from './etapes.mjs';
38
43
  import { gardesDuCadre, nomsDesGardes } from './gardes-du-cadre.mjs';
@@ -47,6 +52,7 @@ import { avecLesOutils } from './outils-cles.mjs';
47
52
  import { avecLesDonnees } from './donnees-cles.mjs';
48
53
  import { consigneDesFlux } from './flux-des-paquets.mjs';
49
54
  import { avecLaPasse, lancementSousPart, passeLourde } from './passe-de-la-machine.mjs';
55
+ import { POUR_LES_GARDES, SCRIPTS_DE_GARDES } from './taches-du-graphe.mjs';
50
56
  import {
51
57
  A_INSCRIRE,
52
58
  bloquantsDeLaFiche,
@@ -240,7 +246,10 @@ export function texteDuVerdict(fiche) {
240
246
  // Gerrit has the next review read the difference between two patch sets, each against its own
241
247
  // base: the files of the lot that changed since, the command of the difference, the findings
242
248
  // still open with their recipients.
243
- export async function relire(ctx, { constats = [] } = {}) {
249
+ export async function relire(
250
+ ctx,
251
+ { constats = [], consigneDuRelecteur = valeurs => consigne(valeurs, 1) } = {}
252
+ ) {
244
253
  const { tests, code } = fichiersDuLot(ctx);
245
254
  const rapports = rapportsDuCircuit(ctx);
246
255
  const precedents = fichesDe(ctx, 'relecteur').length;
@@ -269,6 +278,15 @@ export async function relire(ctx, { constats = [] } = {}) {
269
278
  }
270
279
  const affirmations = path.join(ctx.tmp, 'affirmations.md');
271
280
  writeFileSync(affirmations, leTicket(ctx).description);
281
+ // The reference files the lot changes, measured on the tree between its base and the lot kept.
282
+ const differences = lot
283
+ ? differencesDesReferences({
284
+ copie: ctx.copie,
285
+ references: lesReferences(ctx),
286
+ base: lot.base,
287
+ lot: lot.commit,
288
+ })
289
+ : [];
272
290
  const liste = lot
273
291
  ? langageDe(ctx.copie).elementsDuLot(ctx.copie, { avant: 'HEAD', apres: lot.commit })
274
292
  : { etat: 'impossible', raison: 'le lot n’a pas pu être gardé', elements: [] };
@@ -302,12 +320,13 @@ export async function relire(ctx, { constats = [] } = {}) {
302
320
  precedente,
303
321
  affirmations,
304
322
  elements: texteDesElements(liste, bornee),
323
+ differences: texteDesDifferences(differences),
305
324
  flux: consigneDesFlux(ctx.racine, [...tests, ...code]),
306
325
  rapports: rapports.join('\n\n') || 'aucun',
307
326
  // The supervisor's context of a resumption, his answer to a question of the reviewer among them.
308
327
  contexte: contexteDe(ctx),
309
328
  };
310
- const fiche = await jusquALaFiche(ctx, 'relecteur', consigne(valeurs, 1), {
329
+ const fiche = await jusquALaFiche(ctx, 'relecteur', consigneDuRelecteur(valeurs), {
311
330
  signeDeVie: ctx.ports?.signeDeVie,
312
331
  id: idDeSeance(ctx, 'relecture'),
313
332
  evenement: 'relecture',
@@ -316,7 +335,9 @@ export async function relire(ctx, { constats = [] } = {}) {
316
335
  avec: lot ? { lot: { ...lot, fichiers: [...tests, ...code] } } : {},
317
336
  // Every review judges the findings still open, bounded or whole (`suiviDesConstats`).
318
337
  valider: f =>
319
- [conformiteDuLot(f, liste), suiviDesConstats(f, ouvertsALaRelecture)]
338
+ [
339
+ conformiteDuLot(f, { ...liste, references: differences.map(d => d.fichier) }),
340
+ suiviDesConstats(f, ouvertsALaRelecture)]
320
341
  .filter(Boolean)
321
342
  .join(' ; ') || null,
322
343
  });
@@ -354,7 +375,7 @@ export function relectureEntiere(constats) {
354
375
  // every one, and the lines of the review before by element), each marked to judge again, or to
355
376
  // take up with its line before; then the changed sources the language service does not read,
356
377
  // whose elements he surveys himself, one line of conformity each as `<fichier>#<nom>`, and why.
357
- function texteDesElements(liste, bornee = null) {
378
+ export function texteDesElements(liste, bornee = null) {
358
379
  if (liste.etat !== 'fait') {
359
380
  return `aucun : la liste n'a pas pu être calculée (${liste.raison}) ; tu relèves toi-même chaque élément du lot.`;
360
381
  }
@@ -386,7 +407,7 @@ function texteDesElements(liste, bornee = null) {
386
407
  // The last review of the ticket and the lot it read: its sheet's entry (`{ fiche, lot: { commit,
387
408
  // arbre, base, fichiers } }`), or null before any, without a copy, or when the lot or its base is
388
409
  // not kept (the repository no longer holds one of them).
389
- function relectureDAvant(ctx) {
410
+ export function relectureDAvant(ctx) {
390
411
  const e = lesFiches(ctx).findLast(x => x.role === 'relecteur');
391
412
  if (!e?.lot?.commit || !e.lot.base || !existsSync(ctx.copie)) {
392
413
  return null;
@@ -912,7 +933,8 @@ function restaurer(ctx, commit, fichiers) {
912
933
  }
913
934
  }
914
935
 
915
- // Whether a proof of the counts <compte> passes: no file of the lot that does not load, no green
936
+ // Whether a proof of the counts <compte> passes: no file of the lot that does not load (one that
937
+ // imports a module the copy does not hold is a red, `casseDeChargement`), no green
916
938
  // the sheet names in `portent_le_travail` (`nommes`), and at least one red (of the lot, existing
917
939
  // or of a build); the greens the sheet does not name and the ones HEAD holds are accepted but prove
918
940
  // nothing. Under a plan « comportement tests-adaptés » (<inchange>), nothing has to turn red and every
@@ -948,8 +970,17 @@ export function preuveReussie(
948
970
  // ended well (<code> 0, the binary compiled and played), the file loaded and simply holds no test
949
971
  // of its own — an aggregator harness (tests/it/main.rs, `mod …;`) or shared test matter; not a
950
972
  // casse. With a result but no test (<res> present, 0 tests), it is a casse only when that result
951
- // itself failed. Returns the kind of casse (`non-joue`, `ne-charge-pas`) or null when there is none.
952
- export function casseDeChargement({ res, code, constructions, aDesResultats = false }) {
973
+ // itself failed. A file that fails to load on a module it imports and the copy does not hold
974
+ // (<absent>) is no casse either: the test is written before the code the ticket creates, and its
975
+ // load failure is its red (`module-absent`). Returns the kind (`non-joue`, `ne-charge-pas`,
976
+ // `module-absent`) or null when the file is neither a casse nor a red of that kind.
977
+ export function casseDeChargement({
978
+ res,
979
+ code,
980
+ constructions,
981
+ aDesResultats = false,
982
+ absent = false,
983
+ }) {
953
984
  const tests = res?.tests ?? [];
954
985
  if (constructions.length && (!res || tests.length === 0)) {
955
986
  return null;
@@ -962,7 +993,7 @@ export function casseDeChargement({ res, code, constructions, aDesResultats = fa
962
993
  return code === 0 || aDesResultats ? null : 'non-joue';
963
994
  }
964
995
  if (tests.length === 0) {
965
- return res.etat === 'failed' ? 'ne-charge-pas' : null;
996
+ return res.etat !== 'failed' ? null : absent ? 'module-absent' : 'ne-charge-pas';
966
997
  }
967
998
  return null;
968
999
  }
@@ -1034,8 +1065,7 @@ export function integrer(ctx) {
1034
1065
  // The integration is not played when the lot is already on main or the copy holds no file to
1035
1066
  // commit: one check, as a merge queue closes an entry already merged (Zuul). It is looked for
1036
1067
  // when the ticket is labelled `en-file` (the queue takes it off) or the copy holds no file of the
1037
- // lot (a copy that holds one still has a lot to commit — a second commit of a reopened ticket, for
1038
- // example).
1068
+ // lot (a copy that holds one still has a lot to commit).
1039
1069
  const sansLot = !(tests.length || code.length);
1040
1070
  if (enFile || sansLot) {
1041
1071
  // A lot already on main (`lotSurMain`, the one rule the integrator publishes): the ticket
@@ -1295,7 +1325,17 @@ function messageDeCommit(ctx) {
1295
1325
  });
1296
1326
  const type = TYPES_DE_COMMIT[ctx.type] ?? 'feat';
1297
1327
  const portee = noms.length ? `(${noms.join(',')})` : '';
1328
+ // The reference files the lot changes, measured on the tree of the lot (the copy against HEAD).
1329
+ const lot = garderLeLot(ctx, null);
1298
1330
  return messageDuLot({
1331
+ references: lot
1332
+ ? differencesDesReferences({
1333
+ copie: ctx.copie,
1334
+ references: lesReferences(ctx),
1335
+ base: lot.base,
1336
+ lot: lot.commit,
1337
+ })
1338
+ : [],
1299
1339
  entete: `${type}${portee}: ${ctx.sujet} (${ctx.ticket})`,
1300
1340
  description: leTicket(ctx).description,
1301
1341
  fiches: lesFiches(ctx)
@@ -1309,8 +1349,9 @@ function messageDeCommit(ctx) {
1309
1349
  // section of the criteria of the plan <description> (its heading begins with « Critères »), what
1310
1350
  // the lot changes; a paragraph per deviation the sheets <fiches> carry (`ecarts`), each subject
1311
1351
  // once, in the order it first appears, with the value of the last sheet that carries it (a
1312
- // subject known again whatever its case and spacing); then the trailer.
1313
- export function messageDuLot({ entete, description, fiches }) {
1352
+ // subject known again whatever its case and spacing); the line of the reference files the lot
1353
+ // changes (<references>, `ligneDesReferences`, none when it changes none); then the trailer.
1354
+ export function messageDuLot({ entete, description, fiches, references = [] }) {
1314
1355
  const criteres = [];
1315
1356
  let dedans = false;
1316
1357
  for (const ligne of String(description ?? '').split('\n')) {
@@ -1330,6 +1371,7 @@ export function messageDuLot({ entete, description, fiches }) {
1330
1371
  return [
1331
1372
  entete,
1332
1373
  criteres.join('\n').trim(),
1374
+ ligneDesReferences(references),
1333
1375
  ...[...ecarts.values()].map(e => `${e.sujet} : ${e.texte}`),
1334
1376
  'Co-Authored-By: Claude <noreply@anthropic.com>',
1335
1377
  ]
@@ -1369,6 +1411,50 @@ function changements(ctx) {
1369
1411
  // language (`estUnTest`, scripts/jointure.d.ts).
1370
1412
  const duTestwriter = (ctx, fichier) => langageDe(ctx.copie).estUnTest(fichier, ctx.copie) !== null;
1371
1413
 
1414
+ // The files of the lot the testwriter writes (test files and the shared test material), present
1415
+ // in the copy, from its root.
1416
+ const fichiersDuTestwriter = ctx =>
1417
+ changements(ctx)
1418
+ .filter(c => !c.supprime && duTestwriter(ctx, c.fichier))
1419
+ .map(c => c.fichier);
1420
+
1421
+ // The characters of a file name, and those of a path.
1422
+ const DE_NOM = new Set('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-');
1423
+ const DE_CHEMIN = new Set([...DE_NOM, '.', '/']);
1424
+
1425
+ // The files of <candidats> (from the root of the copy) that <message>, the message of a failed
1426
+ // test of the file <fichier>, names: each written from the root, or from the directory <dossier>
1427
+ // of the package of <fichier>, as a guard written as a test lists what it finds (« tests/a.spec.ts:23:
1428
+ // ESSAIS »). The stack of the error is not read: a file it goes through is not named. <fichier>
1429
+ // itself is never one of them.
1430
+ function nommesParLeMessage(message, fichier, dossier, candidats) {
1431
+ const lignes = String(message ?? '').split('\n');
1432
+ // The first line of the stack: indented, « at … ».
1433
+ const pile = lignes.findIndex(l => l !== l.trimStart() && l.trimStart().startsWith('at '));
1434
+ const texte = (pile < 0 ? lignes : lignes.slice(0, pile)).join('\n');
1435
+ // Whether <texte> holds <chemin> as a whole path: no character of a path right before it, and
1436
+ // after it neither one of a longer name nor a further extension (« .ts:23 » and « .ts. » end it).
1437
+ const nomme = chemin => {
1438
+ for (let i = texte.indexOf(chemin); i >= 0; i = texte.indexOf(chemin, i + 1)) {
1439
+ const avant = texte[i - 1] ?? '\n';
1440
+ const apres = texte[i + chemin.length] ?? '\n';
1441
+ const suite = texte[i + chemin.length + 1] ?? '\n';
1442
+ if (
1443
+ !DE_CHEMIN.has(avant) &&
1444
+ !DE_NOM.has(apres) &&
1445
+ apres !== '/' &&
1446
+ !(apres === '.' && DE_NOM.has(suite))
1447
+ ) {
1448
+ return true;
1449
+ }
1450
+ }
1451
+ return false;
1452
+ };
1453
+ return candidats.filter(
1454
+ c => c !== fichier && (nomme(c) || (dossier ? nomme(path.posix.relative(dossier, c)) : false))
1455
+ );
1456
+ }
1457
+
1372
1458
  // The test files of the lot that the testwriter writes, present in the copy: in the packages of
1373
1459
  // the plan and in the shared test material. <langage> reads the class of a file: the strict join
1374
1460
  // by default, the join of the copy (`langageDeLaCopie`) for the launch of a session, which must
@@ -1386,6 +1472,17 @@ export function testsDuLot(ctx, langage = langageDe) {
1386
1472
  return fichiers.filter(f => l.estUnTest(f, ctx.copie)?.joue).sort();
1387
1473
  }
1388
1474
 
1475
+ // The files a proof resumed at a red plays: of the files the red names <nommes>, the tests the
1476
+ // runner of the copy's language plays. A red of a guard names what it found, a document among it
1477
+ // (a line « Consommateurs » of an INTERFACE.md): no test, so nothing for the proof to play.
1478
+ export function testsDeLaReprise(ctx, nommes, langage = langageDe) {
1479
+ if (nommes.length === 0) {
1480
+ return [];
1481
+ }
1482
+ const l = langage(ctx.copie);
1483
+ return nommes.filter(f => l.estUnTest(f, ctx.copie)?.joue);
1484
+ }
1485
+
1389
1486
  // The package directory of the copy that holds <fichier>, or « . ».
1390
1487
  function paquetDe(liste, fichier) {
1391
1488
  const p = liste.find(({ dossier }) => `${fichier}`.startsWith(`${dossier}${path.sep}`));
@@ -1401,8 +1498,8 @@ function paquetDe(liste, fichier) {
1401
1498
  // group of its own, its command launched by the circuit (`lancementSousPart`); it passes the mark
1402
1499
  // of its part to the `npm run verifier` it runs, which takes none of its own; its wait is written
1403
1500
  // to the log. A wait that stops (its bound, 75; a faulty key or reserve, 1) is the command's
1404
- // code, its message in the log; `attente`, a 75 that is a wait for a part or for room at its
1405
- // bound (the pass's own, or that of the `npm run verifier` it runs). Once it holds its part, the
1501
+ // code, its message in the log and in `raison`; `attente`, a 75 that is a wait for a part or for
1502
+ // room at its bound (the pass's own, or that of the `npm run verifier` it runs). Once it holds its part, the
1406
1503
  // pass plays under a progress directory of its own (`avancement`), of the kind `genreDeLaPasse`
1407
1504
  // names. It plays in the environment of a pass (`environnementDeLaPasse`).
1408
1505
  function npm(ctx, etape, args, env = {}, cwd = ctx.copie) {
@@ -1468,7 +1565,7 @@ function npm(ctx, etape, args, env = {}, cwd = ctx.copie) {
1468
1565
  throw e;
1469
1566
  }
1470
1567
  appendFileSync(ctx.journal, `${e.message}\n`);
1471
- return { code: e.code, dossier, attente: e.code === A_REPASSER };
1568
+ return { code: e.code, dossier, attente: e.code === A_REPASSER, raison: e.message };
1472
1569
  } finally {
1473
1570
  closeSync(fd);
1474
1571
  }
@@ -1509,7 +1606,10 @@ function journalDeTache(ctx, t) {
1509
1606
 
1510
1607
  // The measure of the proof of the red: one run per package, `npm test -- --force <files>` of the
1511
1608
  // lot that lie in it, or, with no file of the lot, `npm test -- <package>` for each package of the
1512
- // plan, played whole. Each run `{ groupe, entier, code, resultats, constructions }`. A measure of
1609
+ // plan, played whole. Each run `{ groupe, entier, code, resultats, constructions, commande,
1610
+ // attente, raison }`, the last three its command line, whether its 75 is a wait of the machine at
1611
+ // its bound, and the reason of that wait. A run at 75 (« à repasser ») ends the measure: the runs
1612
+ // after it would wait as it did. A measure of
1513
1613
  // the same files on the same tree (`cleDeLaMesure`) is not played again, as Turborepo replays a
1514
1614
  // task whose inputs and arguments did not move: the last one, <derniere>, its caller keeps.
1515
1615
  // `{ cle, runs }`. The tests main already holds green are read from the registry of results
@@ -1517,7 +1617,8 @@ function journalDeTache(ctx, t) {
1517
1617
  // the lot.
1518
1618
  function mesureDeLaPreuve(ctx, liste, fichiers, derniere = null) {
1519
1619
  const cle = cleDeLaMesure(ctx, fichiers);
1520
- if (derniere?.cle === cle) {
1620
+ // A measure with a run at 75 is no verdict: it is never read back, and plays again.
1621
+ if (derniere?.cle === cle && !derniere.runs.some(r => r.code === A_REPASSER)) {
1521
1622
  return derniere;
1522
1623
  }
1523
1624
  const entiers = fichiers.length ? [] : paquetsDuPlan(ctx, liste);
@@ -1540,10 +1641,16 @@ function mesureDeLaPreuve(ctx, liste, fichiers, derniere = null) {
1540
1641
  groupe,
1541
1642
  entier,
1542
1643
  code: pass.code,
1644
+ commande: `npm test -- ${(entier ? [dossier] : ['--force', ...groupe]).join(' ')}`,
1645
+ attente: Boolean(pass.attente),
1646
+ raison: pass.raison ?? null,
1543
1647
  resultats: langageDe(ctx.copie).verdict(pass.dossier).rapports,
1544
1648
  // The builds of the plan's packages that failed: each one a red, not compiling is failing.
1545
1649
  constructions: constructionsEchouees(ctx, liste, pass.dossier),
1546
1650
  });
1651
+ if (pass.code === A_REPASSER) {
1652
+ break;
1653
+ }
1547
1654
  }
1548
1655
  return { cle, runs };
1549
1656
  }
@@ -1561,17 +1668,52 @@ const sansSeparateur = nom =>
1561
1668
  export const portentLeTravail = fiches =>
1562
1669
  fiches.filter(f => Array.isArray(f.portent_le_travail)).at(-1)?.portent_le_travail ?? [];
1563
1670
 
1671
+ // The proof of the measure <runs> when one of them is at 75 (« à repasser »: the part of the
1672
+ // machine awaited to its bound, a pass cut), null otherwise. Such a measure proved nothing, neither
1673
+ // a red nor a file that does not load: the proof is `aRepasser`, as a check at 75 is
1674
+ // (`controles`), `attente` when every such run is a wait of the machine, its report naming each
1675
+ // command, its code and its reason; it counts nothing and keeps no measure (`mesure` null: neither
1676
+ // written nor read back), which the next proof plays.
1677
+ export function preuveARepasser(ctx, runs) {
1678
+ const aRepasser = runs.filter(r => r.code === A_REPASSER);
1679
+ if (!aRepasser.length) {
1680
+ return null;
1681
+ }
1682
+ const resume = `à repasser : ${aRepasser
1683
+ .map(r => `${r.commande} (code ${r.code})${r.raison ? ` : ${r.raison}` : ''}`)
1684
+ .join(' ; ')}`;
1685
+ return {
1686
+ ok: false,
1687
+ aRepasser: true,
1688
+ attente: aRepasser.every(r => r.attente),
1689
+ rouges: 0,
1690
+ resume,
1691
+ texte: [
1692
+ `${SUITE.find(e => e.etat === PREUVE).titre} : ${resume}`,
1693
+ '',
1694
+ 'La passe n’a rien prouvé : aucun test du lot n’est jugé, aucun fichier n’est compté.',
1695
+ `Le journal du ticket, pour le détail de la passe : ${ctx.journal} (il se cite en pièce, \`${ctx.ticket}.log:<ligne>\`)`,
1696
+ ].join('\n'),
1697
+ mesure: null,
1698
+ };
1699
+ }
1700
+
1564
1701
  // The proof of the red, on every test of the lot: `{ ok, rouges, texte, resume }`, `texte` the
1565
- // report, written whole to its file beside the copy. A
1702
+ // report, written whole to its file beside the copy. The tests judged are those of the files the
1703
+ // lot changes: a module of a single integration binary the lot does not change is main's, its
1704
+ // greens left out and its reds existing reds. A
1566
1705
  // green test is a defect when the testwriter's sheets name it (`portent_le_travail`), read at
1567
1706
  // each proof, and accepted when they do not; a test's full name is read whatever the
1568
1707
  // separator between its group and its title, a blank, or « > » as Vitest prints it, or « › » as
1569
1708
  // Jest and the report of the proof print it (`sansSeparateur`); the measure plays again only when
1570
1709
  // the copy changed (`mesureDeLaPreuve`).
1571
- export function preuve(ctx, { mesure: derniere = null, fichiers: seuls = null } = {}) {
1710
+ // A measure with a run at 75 proved nothing: the proof is « à repasser » (`preuveARepasser`).
1711
+ export function preuve(ctx, { mesure: derniere = null, fichiers: duRouge = null } = {}) {
1572
1712
  // Only the files of the day are proved; the ones only the night plays are put aside, named.
1573
- // Resumed at a red (<seuls>, the files it names), the proof plays these files alone and passes
1574
- // when they load: a test fixed is green, not red.
1713
+ // Resumed at a red (<duRouge>, the files it names), the proof plays the tests among them alone
1714
+ // (<seuls>) and passes when they load: a test fixed is green, not red. A red that names no test
1715
+ // (a document a guard refused) leaves nothing to play, and the proof passes.
1716
+ const seuls = duRouge ? testsDeLaReprise(ctx, duRouge) : null;
1575
1717
  const {
1576
1718
  jour: fichiers,
1577
1719
  misDeCote: deNuit,
@@ -1593,19 +1735,33 @@ export function preuve(ctx, { mesure: derniere = null, fichiers: seuls = null }
1593
1735
  const nonNommes = [];
1594
1736
  const nommes = [];
1595
1737
  const casses = [];
1738
+ const langage = langageDe(ctx.copie);
1596
1739
  const liste = composantsDe(ctx.copie).filter(p => !p.hors);
1597
1740
  let anciens = 0;
1598
1741
  const reportes = [];
1599
1742
  // A lot of files put aside alone plays nothing, not the packages whole.
1600
1743
  const mesuree =
1601
- fichiers.length || !misDeCote.length ? mesureDeLaPreuve(ctx, liste, fichiers, derniere) : null;
1744
+ (fichiers.length || !misDeCote.length) && !(seuls && seuls.length === 0)
1745
+ ? mesureDeLaPreuve(ctx, liste, fichiers, derniere)
1746
+ : null;
1602
1747
  const mesure = mesuree?.runs ?? [];
1748
+ const aRepasser = preuveARepasser(ctx, mesure);
1749
+ if (aRepasser) {
1750
+ return aRepasser;
1751
+ }
1603
1752
  // The tests main already holds green, read from the registry of results of the copy's branch, or
1604
1753
  // main's (scripts/registre-des-resultats.mjs): a test of the lot the registry holds existed, its
1605
1754
  // green accepted; one absent is new.
1606
1755
  const registre = lireLeRegistre(ctx.copie);
1607
- // A plan « comportement tests-adaptés »: every green of the lot is expected.
1608
- const inchange = ctx.sorte?.comportement === 'tests-adaptés';
1756
+ // A plan « comportement tests-adaptés », or a testwriter session the supervisor asked
1757
+ // (`--depuis testwriter`, `ctx.testwriterDemande`): every green of the lot is expected.
1758
+ const inchange = ctx.sorte?.comportement === 'tests-adaptés' || Boolean(ctx.testwriterDemande);
1759
+ // The files the lot changes: a result of the run under another file is main's.
1760
+ const duLot = new Set(
1761
+ changements(ctx)
1762
+ .filter(c => !c.supprime)
1763
+ .map(c => c.fichier)
1764
+ );
1609
1765
  // The developpeur already ran after the last testwriter: the code is there, no test can turn red.
1610
1766
  const codePresent = codeDejaPresent(ctx);
1611
1767
  for (const { groupe, entier, code, resultats, constructions } of mesure) {
@@ -1632,21 +1788,37 @@ export function preuve(ctx, { mesure: derniere = null, fichiers: seuls = null }
1632
1788
  }
1633
1789
  }
1634
1790
  // The files judged: those of the lot in the group, and, for a single integration binary that
1635
- // plays its modules (Rust `tests/it/main.rs`), each module file the run reports — the group names
1636
- // the binary, the results name the modules, so a module's reds are credited to the lot, and the
1637
- // aggregator is no false casse. A package played whole (`entier`) keeps its own branch above.
1638
- const fichiersDuGroupe = entier
1639
- ? groupe
1640
- : [...new Set([...groupe, ...resultats.map(r => path.relative(ctx.copie, r.fichier))])];
1791
+ // plays its modules (Rust `tests/it/main.rs`), each module file the run reports that the lot
1792
+ // changes — the group names the binary, the results name the modules, so a module's reds are
1793
+ // credited to the lot, and the aggregator is no false casse. A module the lot does not change
1794
+ // is main's: its greens say nothing of the lot, and its reds are existing reds, as those of a
1795
+ // package played whole (`entier`), which keeps its own branch above.
1796
+ const modules = entier ? [] : resultats.map(r => path.relative(ctx.copie, r.fichier));
1797
+ const fichiersDuGroupe = [...new Set([...groupe, ...modules.filter(f => duLot.has(f))])];
1798
+ for (const res of entier ? [] : resultats) {
1799
+ const f = path.relative(ctx.copie, res.fichier);
1800
+ if (fichiersDuGroupe.includes(f)) {
1801
+ continue;
1802
+ }
1803
+ for (const a of res.tests.filter(x => x.etat === 'failed')) {
1804
+ rouges.push(`rouge existant : ${f} › ${a.nom} — ${premiereLigne(a.message)}`);
1805
+ }
1806
+ }
1641
1807
  for (const f of fichiersDuGroupe) {
1642
1808
  const res = resultats.find(t => t.fichier === path.join(ctx.copie, f));
1643
1809
  const tests = res?.tests ?? [];
1644
1810
  const deHead = vertsDuRegistre(registre, f);
1811
+ // The module the file imports and the copy does not hold: the code the ticket creates.
1812
+ const importe =
1813
+ res && tests.length === 0
1814
+ ? langage.moduleAbsent(res.message ?? '', path.join(ctx.copie, f))
1815
+ : null;
1645
1816
  const casse = casseDeChargement({
1646
1817
  res,
1647
1818
  code,
1648
1819
  constructions,
1649
1820
  aDesResultats: resultats.length > 0,
1821
+ absent: Boolean(importe) && !existsSync(importe),
1650
1822
  });
1651
1823
  if (casse === 'non-joue') {
1652
1824
  casses.push(
@@ -1654,6 +1826,11 @@ export function preuve(ctx, { mesure: derniere = null, fichiers: seuls = null }
1654
1826
  );
1655
1827
  } else if (casse === 'ne-charge-pas') {
1656
1828
  casses.push(`${f} — ne se charge pas : ${premiereLigne(res.message || res.etat)}`);
1829
+ } else if (casse === 'module-absent') {
1830
+ rouges.push(
1831
+ `${f} — importe un module absent, que le code du ticket crée : ${path.relative(ctx.copie, importe)}`
1832
+ );
1833
+ rougesDuLot++;
1657
1834
  }
1658
1835
  for (const a of tests) {
1659
1836
  if (a.etat === 'failed') {
@@ -1796,9 +1973,12 @@ const STYLE = new Set(['lint', 'format:check']);
1796
1973
  // names « . », which holds the whole copy.
1797
1974
  // A path of a component the plan set apart from the survey (`ctx.ecartes`) counts as the plan's:
1798
1975
  // `ecarte`, its directory, says so, and the circuit extends the plan to it.
1976
+ // A test file of a reader package the plan extended to its tests (`ctx.testsEtendus`, their
1977
+ // directories) counts as the plan's.
1799
1978
  function situer(ctx, liste, chemin) {
1800
- const dedans = chemin ? dansLePlan(ctx, chemin) : nommeLaRacine(ctx);
1801
1979
  const p = chemin ? liste.find(x => chemin.startsWith(`${x.dossier}/`)) : null;
1980
+ const etendu = Boolean(chemin) && dansLesTestsEtendus(ctx, chemin);
1981
+ const dedans = chemin ? dansLePlan(ctx, chemin) || etendu : nommeLaRacine(ctx);
1802
1982
  const paquet = p ? p.pkg.name : null;
1803
1983
  const ecarte = !dedans && p && dansLesEcartes(ctx, chemin) ? p.dossier : null;
1804
1984
  return {
@@ -1806,9 +1986,32 @@ function situer(ctx, liste, chemin) {
1806
1986
  paquet,
1807
1987
  horsTitre: dedans || ecarte !== null ? null : paquet,
1808
1988
  ecarte,
1989
+ // The package out of the plan that holds the path, and whether the path is a test file: the
1990
+ // reds of one package that all lie in test files extend the plan to its tests.
1991
+ lecteur: !dedans && p ? p.dossier : null,
1992
+ test: Boolean(chemin) && estUnFichierDeTest(ctx, chemin),
1809
1993
  };
1810
1994
  }
1811
1995
 
1996
+ // Whether <chemin> is a test file of the module of the language of the copy (not the shared
1997
+ // test material, which the lock lets the testwriter write anywhere).
1998
+ function estUnFichierDeTest(ctx, chemin) {
1999
+ try {
2000
+ const classe = langageDe(ctx.copie).estUnTest(chemin, ctx.copie);
2001
+ return Boolean(classe?.test) && !classe.matiere;
2002
+ } catch {
2003
+ return false;
2004
+ }
2005
+ }
2006
+
2007
+ // Whether <chemin> is a test file of a package the plan extended to its tests.
2008
+ function dansLesTestsEtendus(ctx, chemin) {
2009
+ return (
2010
+ (ctx.testsEtendus ?? []).some(d => chemin.startsWith(`${d}/`)) &&
2011
+ estUnFichierDeTest(ctx, chemin)
2012
+ );
2013
+ }
2014
+
1812
2015
  // Whether a directory of the components the plan set apart (`ctx.ecartes`) holds <chemin>.
1813
2016
  function dansLesEcartes(ctx, chemin) {
1814
2017
  return (ctx.ecartes ?? []).some(c => chemin === c || chemin.startsWith(`${c}/`));
@@ -1817,13 +2020,14 @@ function dansLesEcartes(ctx, chemin) {
1817
2020
  // The reds of the check <c> (`{ args, env, code, dossier }`), read in its results: each failed
1818
2021
  // test of the reports of Vitest, each finding of the guards' SARIF, each failed build, and each
1819
2022
  // failed task none of those situates; a red check with none of them is one red of the command.
1820
- // Each red `{ texte, fichier, gardes, detail, dansLePlan, paquet, horsTitre, arbitrer, joue }`: the
2023
+ // Each red `{ texte, fichier, gardes, nommes, detail, dansLePlan, paquet, horsTitre, arbitrer, joue }`: the
1821
2024
  // line that names it (test or finding, file, message), its file (null for a red of a task), the
1822
- // names its finding carries (its guard and its rule), the beginning of its task's log for a build,
2025
+ // names its finding carries (its guard and its rule), the files of the lot the testwriter writes
2026
+ // that the message of a failed test names (`nommesParLeMessage`), the beginning of its task's log for a build,
1823
2027
  // whether a path of the plan holds it (none for a red without a file), the package that holds it
1824
2028
  // and that package again when it is out of the plan, whether it is a finding to settle
1825
2029
  // (`a-arbitrer`), and the package whose task gave it, as Turborepo names it (« // » for the
1826
- // root's guards; null for a red of the command).
2030
+ // root's guards; null for a red of the command, which carries `sansResultat`).
1827
2031
  // As SARIF 2.1.0 and GitHub code scanning, a finding of level error fails, a warning or a note
1828
2032
  // shows without failing: `{ rouges, avertissements }`, `avertissements` the lines of the findings
1829
2033
  // of another level, which the report lists apart. A guards' task red without a finding of level
@@ -1845,6 +2049,8 @@ export function rougesDe(ctx, liste, c) {
1845
2049
  const out = [];
1846
2050
  const testes = new Set();
1847
2051
  const langage = langageDe(ctx.copie);
2052
+ // The files of the lot the testwriter writes, read at the first failed test.
2053
+ let duLot = null;
1848
2054
  for (const res of langage.verdict(c.dossier).rapports) {
1849
2055
  const f = path.relative(ctx.copie, res.fichier);
1850
2056
  const lieu = situer(ctx, liste, f);
@@ -1858,9 +2064,24 @@ export function rougesDe(ctx, liste, c) {
1858
2064
  testes.add(paquetDe(liste, f));
1859
2065
  }
1860
2066
  for (const a of res.tests.filter(x => x.etat === 'failed')) {
2067
+ duLot ??= fichiersDuTestwriter(ctx);
2068
+ // The files of the lot the message of a test out of the lot names (a guard written as a
2069
+ // test), which the first line of the red may not show. The message of a test of the lot is
2070
+ // not read: its red is the developpeur's, whatever it names.
2071
+ const nommes = duLot.includes(f)
2072
+ ? []
2073
+ : nommesParLeMessage(
2074
+ a.message,
2075
+ f,
2076
+ liste.find(x => f.startsWith(`${x.dossier}/`))?.dossier ?? null,
2077
+ duLot
2078
+ );
2079
+ const premiere = premiereLigne(a.message);
2080
+ const tus = nommes.filter(n => !premiere.includes(n));
1861
2081
  out.push({
1862
- texte: `test ${f} › ${a.nom} — ${premiereLigne(a.message)}`,
2082
+ texte: `test ${f} › ${a.nom} — ${premiere}${tus.length ? ` (il nomme ${tus.join(', ')})` : ''}`,
1863
2083
  fichier: f,
2084
+ nommes,
1864
2085
  ...lieu,
1865
2086
  joue: lieu.paquet,
1866
2087
  });
@@ -1925,11 +2146,25 @@ export function rougesDe(ctx, liste, c) {
1925
2146
  out.push({
1926
2147
  texte: `${ligneDeCommande(c)} rouge (code ${c.code}), sans résultat qui situe son rouge — le journal du ticket : ${ctx.journal} (il se cite en pièce, \`${ctx.ticket}.log:<ligne>\`)`,
1927
2148
  ...situer(ctx, liste, null),
2149
+ sansResultat: true,
1928
2150
  });
1929
2151
  }
1930
2152
  return { rouges: out, avertissements };
1931
2153
  }
1932
2154
 
2155
+ // The lines of the reds of a red pass `npm run verifier` played out of a circuit, in the copy
2156
+ // <copie>, its results under <dossier>: the reading of the checks (`rougesDe`) on the whole copy,
2157
+ // each red its line (test, file, message; finding; failed task), a failed build with the beginning
2158
+ // of its log. A pass whose results situate no red gives none: its caller holds its output (the
2159
+ // queue's final pass, scripts/integration/file.mjs).
2160
+ export function rougesDUnePasse({ copie, dossier, code, ticket, journal }) {
2161
+ const ctx = { copie, paquets: ['.'], ecartes: [], ticket, journal };
2162
+ const liste = composantsDe(copie).filter(p => !p.hors);
2163
+ return rougesDe(ctx, liste, { args: ['run', 'verifier'], code, dossier })
2164
+ .rouges.filter(r => !r.sansResultat)
2165
+ .map(r => (r.detail ? `${r.texte}\n\n${r.detail}` : r.texte));
2166
+ }
2167
+
1933
2168
  const ligneDeCommande = c =>
1934
2169
  `${Object.entries(c.env ?? {})
1935
2170
  .map(([k, v]) => `${k}=${v} `)
@@ -1950,8 +2185,9 @@ const ligneDeCommande = c =>
1950
2185
  // report of the checks (empty without one); `auDeveloppeur` whether a red lies
1951
2186
  // in a package of the plan; `horsTitre` the packages out of the plan that hold a red; `arbitrer`
1952
2187
  // when every red of the plan is a finding to settle; `lieux` the place of each red, `{ fichier,
1953
- // gardes, dansLePlan }`, its file (null for a red without one), the names its finding carries
1954
- // (none for a test or a task), and whether a path of the plan holds it; `references`, out of the final pass, the references whose reds the checks saw,
2188
+ // gardes, dansLePlan, nommes }`, its file (null for a red without one), the names its finding carries
2189
+ // (none for a test or a task), whether a path of the plan holds it, and, when there are some, the
2190
+ // files of the lot the testwriter writes that the message of its failed test names; `references`, out of the final pass, the references whose reds the checks saw,
1955
2191
  // which their regeneration lifts before the checks judge the lot again, or before the final pass; `tous` every red as it was read; `notes`,
1956
2192
  // at the final pass, each key of the debt a guard wrote inscribed above what it finds, `{ garde,
1957
2193
  // fichier, regle, trouve }`.
@@ -1999,7 +2235,7 @@ export function controles(ctx, finale, restreinte = null, reportes = null, fichi
1999
2235
  // A red two commands both play (a package of the plan and a component set apart that share a
2000
2236
  // task) is one red.
2001
2237
  const vusDesCommandes = new Set();
2002
- const tous = [
2238
+ const lus = [
2003
2239
  ...resultats
2004
2240
  .flatMap(r => r.rouges)
2005
2241
  .filter(r => {
@@ -2010,6 +2246,20 @@ export function controles(ctx, finale, restreinte = null, reportes = null, fichi
2010
2246
  r => !reportes.rejouee || (Boolean(r.joue) && !joues.has(r.joue))
2011
2247
  ),
2012
2248
  ];
2249
+ // A reader package out of the plan (set apart from the survey, or out of the title) whose every
2250
+ // red lies in a test file (not yet extended to its tests): the plan extends to those test files
2251
+ // alone, and its reds go on as the plan's. One red in its code, or in a task of the package (a
2252
+ // build, a typing), keeps the package out of the plan: the circuit does not guess the repair.
2253
+ const testsLecteurs = [
2254
+ ...new Set(lus.filter(r => r.lecteur && r.test).map(r => r.lecteur)),
2255
+ ]
2256
+ .filter(d => lus.filter(r => r.lecteur === d).every(r => r.test))
2257
+ .sort();
2258
+ const tous = lus.map(r =>
2259
+ r.lecteur && testsLecteurs.includes(r.lecteur)
2260
+ ? { ...r, dansLePlan: true, horsTitre: null, ecarte: null }
2261
+ : r
2262
+ );
2013
2263
  // Out of the final pass, the reds of the plan are the developpeur's; a red of a reference goes to
2014
2264
  // its regeneration (4.2), before any red goes to him; the others (the root, a red no file situates, a
2015
2265
  // package out of the plan) wait for the final pass.
@@ -2017,6 +2267,7 @@ export function controles(ctx, finale, restreinte = null, reportes = null, fichi
2017
2267
  fichier: r.fichier ?? null,
2018
2268
  gardes: r.gardes ?? [],
2019
2269
  dansLePlan: Boolean(r.dansLePlan),
2270
+ ...(r.nommes?.length ? { nommes: r.nommes } : {}),
2020
2271
  });
2021
2272
  const deReference = r => referencesDesRouges(ctx, [lieu(r)]).length > 0;
2022
2273
  const siens = r => finale || (r.dansLePlan && !deReference(r));
@@ -2108,6 +2359,9 @@ export function controles(ctx, finale, restreinte = null, reportes = null, fichi
2108
2359
  horsTitre: [...new Set(rouges.map(r => r.horsTitre).filter(Boolean))].sort(),
2109
2360
  // The directories of the components the plan set apart that hold a red: the plan extends to them.
2110
2361
  ecartesRouges: [...new Set(rouges.map(r => r.ecarte).filter(Boolean))].sort(),
2362
+ // The directories of the reader packages whose reds all lie in test files: the plan extends to
2363
+ // those tests, and not to the packages.
2364
+ testsLecteurs,
2111
2365
  lieux: rouges.map(lieu),
2112
2366
  references,
2113
2367
  tous,
@@ -2125,6 +2379,10 @@ export function controles(ctx, finale, restreinte = null, reportes = null, fichi
2125
2379
  };
2126
2380
  }
2127
2381
 
2382
+ // The command of npm that builds what the guard tasks of the root wait for in the graph, by the
2383
+ // command `construire --gardes` of the module of the language (scripts/taches-du-graphe.mjs).
2384
+ const CONSTRUCTION_DES_GARDES = ['exec', '--no', '--', 'grillhouse', 'construire', POUR_LES_GARDES];
2385
+
2128
2386
  // The test files <fichiers> of the lot that the checks name to `npm test`: all but the ones out of
2129
2387
  // every package of the language (`horsDesPaquets` of `separerLesFichiersDuJour`: the tests of the
2130
2388
  // frame's plugin), which `npm test` refuses and the guards play (`claude plugin test`).
@@ -2136,7 +2394,11 @@ export function testsNommesAuxControles(ctx, fichiers) {
2136
2394
  // The checks of the plan, out of the final pass: `npm test -- <package>` for each package of the
2137
2395
  // plan and each the lot touches in it, `npm test -- <test files of the lot>` that none of them
2138
2396
  // holds (the shared test material's out of the plan), each test played once, then the guards in
2139
- // the envelope of the plan, whose findings on its files alone count.
2397
+ // the envelope of the plan, whose findings on its files alone count. A guard reads what the builds
2398
+ // write (the `dist/` of every package, one out of the plan included), and its task of the graph
2399
+ // waits for them, as the deps of a Bazel target: before the guards, out of the envelope, the build
2400
+ // of what the guard tasks wait for (CONSTRUCTION_DES_GARDES), which the tests of the plan do not
2401
+ // build (BPScript 320.14.2.8.1: `npm run gardes` red on the `dist/` of six packages out of the plan).
2140
2402
  export function commandesDuPlan(ctx, liste, seuls = null) {
2141
2403
  const lot = changements(ctx);
2142
2404
  const touches = liste.length
@@ -2166,13 +2428,13 @@ export function commandesDuPlan(ctx, liste, seuls = null) {
2166
2428
  .sort();
2167
2429
  const scripts = lireJson(path.join(ctx.copie, 'package.json'))?.scripts ?? {};
2168
2430
  const enveloppe = { [VARIABLE_ENVELOPPE]: ecrireLaListe(ctx.paquets) };
2431
+ const gardes = SCRIPTS_DE_GARDES.filter(s => s in scripts);
2169
2432
  return [
2170
2433
  ...(tests.length ? [{ args: ['test', '--', ...tests] }] : []),
2171
2434
  ...entiers.map(d => ({ args: d === '.' ? ['test'] : ['test', '--', d] })),
2172
2435
  ...jouesDesEcartes.map(d => ({ args: ['test', '--', d] })),
2173
- ...['grillhouse:gardes', 'gardes']
2174
- .filter(s => s in scripts)
2175
- .map(s => ({ args: ['run', s], env: enveloppe })),
2436
+ ...(gardes.length ? [{ args: CONSTRUCTION_DES_GARDES }] : []),
2437
+ ...gardes.map(s => ({ args: ['run', s], env: enveloppe })),
2176
2438
  ];
2177
2439
  }
2178
2440
 
@@ -2288,17 +2550,22 @@ export function empreinteDeLEtape(ctx, etape) {
2288
2550
  // The test files and the files of code a red lies in (<lieux>, the places of the red as the
2289
2551
  // checks name them) that the testwriter and the developpeur carry (scripts/reprise.mjs
2290
2552
  // `attribuerLeRouge`): `{ tests, code }`. The testwriter carries the test files of the lot; the
2291
- // developpeur, every other file of a path of the plan.
2553
+ // developpeur, every other file of a path of the plan. A file the message of a failed test names
2554
+ // (`nommes` of its place) is one the red lies in, as the file that fails.
2292
2555
  export function portesDuRouge(ctx, lieux) {
2293
- const dulot = new Set(
2294
- changements(ctx)
2295
- .filter(c => !c.supprime && duTestwriter(ctx, c.fichier))
2296
- .map(c => c.fichier)
2297
- );
2298
- const nommes = [...new Set((lieux ?? []).map(l => l.fichier).filter(Boolean))];
2556
+ const dulot = new Set(fichiersDuTestwriter(ctx));
2557
+ const nommes = [
2558
+ ...new Set((lieux ?? []).flatMap(l => [l.fichier, ...(l.nommes ?? [])]).filter(Boolean)),
2559
+ ];
2560
+ // The test files of the readers the plan extended to their tests are the testwriter's too: he
2561
+ // alone writes them (`lecteurs`).
2562
+ const lecteurs = nommes.filter(f => !dulot.has(f) && dansLesTestsEtendus(ctx, f));
2299
2563
  return {
2300
- tests: nommes.filter(f => dulot.has(f)),
2301
- code: nommes.filter(f => !dulot.has(f) && (dansLePlan(ctx, f) || dansLesEcartes(ctx, f))),
2564
+ tests: nommes.filter(f => dulot.has(f) || lecteurs.includes(f)),
2565
+ code: nommes.filter(
2566
+ f => !dulot.has(f) && !lecteurs.includes(f) && (dansLePlan(ctx, f) || dansLesEcartes(ctx, f))
2567
+ ),
2568
+ ...(lecteurs.length ? { lecteurs } : {}),
2302
2569
  };
2303
2570
  }
2304
2571