@roomi-fields/grillhouse 0.50.2 → 0.51.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 (132) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/CHANGELOG.md +52 -0
  3. package/agents/developpeur.md +1 -1
  4. package/agents/direct.md +1 -1
  5. package/agents/explorateur.md +1 -1
  6. package/agents/questionneur.md +1 -1
  7. package/agents/relecteur.md +1 -1
  8. package/agents/testwriter.md +1 -1
  9. package/cadre/templates/c/package.json +1 -0
  10. package/cadre/templates/cargo/package.json +1 -0
  11. package/cadre/templates/python/package.json +1 -0
  12. package/charte.md +17 -12
  13. package/dist/machine/part-par-sorte.d.ts +16 -0
  14. package/dist/machine/part-par-sorte.js +36 -0
  15. package/dist/machine/part-par-sorte.js.map +1 -0
  16. package/dist/temporal/circuit/appel.js +1 -1
  17. package/dist/temporal/circuit/appel.js.map +1 -1
  18. package/dist/temporal/circuit/client.d.ts +5 -4
  19. package/dist/temporal/circuit/client.js +39 -16
  20. package/dist/temporal/circuit/client.js.map +1 -1
  21. package/dist/temporal/circuit/contrat.d.ts +11 -7
  22. package/dist/temporal/circuit/contrat.js +5 -9
  23. package/dist/temporal/circuit/contrat.js.map +1 -1
  24. package/dist/temporal/circuit/deroule.js +18 -6
  25. package/dist/temporal/circuit/deroule.js.map +1 -1
  26. package/dist/temporal/commande.js +12 -3
  27. package/dist/temporal/commande.js.map +1 -1
  28. package/dist/temporal/installation.d.ts +54 -3
  29. package/dist/temporal/installation.js +187 -17
  30. package/dist/temporal/installation.js.map +1 -1
  31. package/dist/temporal/places/client.d.ts +5 -1
  32. package/dist/temporal/places/client.js +23 -11
  33. package/dist/temporal/places/client.js.map +1 -1
  34. package/docs/ARCHITECTURE.md +23 -2700
  35. package/docs/INTERFACE.md +23 -8
  36. package/docs/architecture/circuit.md +59 -12
  37. package/docs/architecture/entree.md +20 -7
  38. package/docs/architecture/greffon.md +6 -2
  39. package/docs/architecture/installation.md +30 -11
  40. package/docs/architecture/machine.md +50 -37
  41. package/docs/architecture/tests.md +52 -14
  42. package/docs/lexique.md +154 -0
  43. package/hooks/register.tsx +1 -1
  44. package/package.json +1 -1
  45. package/scripts/activites.mjs +85 -60
  46. package/scripts/aiguillage.mjs +15 -7
  47. package/scripts/attente-de-la-machine.mjs +4 -8
  48. package/scripts/avancement.mjs +12 -8
  49. package/scripts/bilan.mjs +10 -7
  50. package/scripts/branche-de-nuit.mjs +2 -2
  51. package/scripts/ci-de-main.mjs +18 -21
  52. package/scripts/circuit.mjs +86 -43
  53. package/scripts/circuits-du-serveur.mjs +5 -5
  54. package/scripts/composants-affectes.mjs +30 -12
  55. package/scripts/composition-des-langages.mjs +5 -3
  56. package/scripts/conformite.mjs +1 -1
  57. package/scripts/consommation-des-passes.mjs +8 -6
  58. package/scripts/copies-finies.mjs +3 -14
  59. package/scripts/depart-du-ticket.d.mts +8 -2
  60. package/scripts/depart-du-ticket.mjs +26 -8
  61. package/scripts/direct.mjs +158 -72
  62. package/scripts/droits.mjs +63 -185
  63. package/scripts/engendres.mjs +3 -14
  64. package/scripts/enveloppe/enveloppe.mjs +75 -30
  65. package/scripts/enveloppe/lancer.sh +59 -45
  66. package/scripts/enveloppe/paquets-du-plan.mjs +38 -11
  67. package/scripts/enveloppe/travail-de-la-copie.mjs +115 -3
  68. package/scripts/etapes.mjs +84 -22
  69. package/scripts/faits-du-circuit.mjs +8 -2
  70. package/scripts/grillhouse-maj.mjs +43 -18
  71. package/scripts/groupe-cles.d.mts +15 -0
  72. package/scripts/groupe-cles.mjs +77 -2
  73. package/scripts/init.mjs +9 -2
  74. package/scripts/integration/rejeu.mjs +8 -1
  75. package/scripts/jointure.d.ts +22 -3
  76. package/scripts/langages/c/index.mjs +5 -2
  77. package/scripts/langages/cargo/commandes.mjs +35 -15
  78. package/scripts/langages/cargo/composants.mjs +45 -3
  79. package/scripts/langages/cargo/index.mjs +6 -3
  80. package/scripts/langages/cargo/sccache.mjs +10 -3
  81. package/scripts/langages/python/index.mjs +5 -2
  82. package/scripts/langages/typescript/chemins-des-tests.mjs +1 -1
  83. package/scripts/langages/typescript/index.mjs +4 -2
  84. package/scripts/langages/typescript/mise-a-jour.mjs +1 -1
  85. package/scripts/langages/typescript/rapports-aux-lignes.mjs +74 -0
  86. package/scripts/langages/typescript/turbo-des-paquets.mjs +99 -36
  87. package/scripts/langages/typescript/verdict.mjs +29 -3
  88. package/scripts/langages/typescript/verifier.mjs +1 -1
  89. package/scripts/langages/typescript/vitest-config/changements.mjs +8 -6
  90. package/scripts/langages/typescript/vitest-config/lances.mjs +15 -32
  91. package/scripts/langages.mjs +54 -4
  92. package/scripts/matieres-lues.mjs +1 -1
  93. package/scripts/mesure/base-de-passe.mjs +32 -90
  94. package/scripts/migrations/serveurs-de-l-index.mjs +79 -0
  95. package/scripts/migrations.mjs +21 -7
  96. package/scripts/paquets.d.ts +3 -0
  97. package/scripts/paquets.mjs +88 -1
  98. package/scripts/passe-de-la-machine.mjs +109 -36
  99. package/scripts/places-de-la-machine.mjs +81 -29
  100. package/scripts/plafond-de-la-machine.d.mts +2 -5
  101. package/scripts/plafond-de-la-machine.mjs +9 -9
  102. package/scripts/reprise.mjs +42 -13
  103. package/scripts/resultats.mjs +76 -54
  104. package/scripts/retirer-les-copies-finies.mjs +1 -1
  105. package/scripts/seances.mjs +426 -115
  106. package/scripts/services-du-noyau.mjs +9 -1
  107. package/scripts/session-start.sh +14 -1
  108. package/scripts/sortie.mjs +37 -6
  109. package/scripts/sous-commandes.mjs +0 -2
  110. package/scripts/superviseur.mjs +33 -13
  111. package/scripts/tableau.mjs +61 -16
  112. package/scripts/transitions.d.mts +25 -2
  113. package/scripts/transitions.mjs +137 -29
  114. package/scripts/verrous/ecriture-hors-enveloppe.mjs +31 -9
  115. package/skills/codebase-design/DESIGN-IT-TWICE.md +1 -1
  116. package/skills/developpeur/SKILL.md +38 -15
  117. package/skills/direct/SKILL.md +29 -9
  118. package/skills/domain-modeling/GLOSSARY-FORMAT.md +9 -9
  119. package/skills/domain-modeling/SKILL.md +14 -12
  120. package/skills/explorateur/SKILL.md +30 -6
  121. package/skills/pitmaster/SKILL.md +12 -16
  122. package/skills/pitmaster/references/consigne-agent.md +12 -11
  123. package/skills/relecteur/SKILL.md +12 -5
  124. package/skills/systematic-debugging/SKILL.md +281 -0
  125. package/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
  126. package/skills/systematic-debugging/condition-based-waiting.md +115 -0
  127. package/skills/systematic-debugging/defense-in-depth.md +122 -0
  128. package/skills/systematic-debugging/find-polluter.sh +72 -0
  129. package/skills/systematic-debugging/root-cause-tracing.md +169 -0
  130. package/skills/testwriter/SKILL.md +35 -29
  131. package/scripts/verrous/commande.mjs +0 -214
  132. package/scripts/verrous/verrou.mjs +0 -311
@@ -0,0 +1,74 @@
1
+ // The test files of a runner that writes no report test by test, read from the lines it prints:
2
+ // `claude plugin test`, which plays the tests of a plugin (packages/grillhouse/docs/architecture/tests.md
3
+ // §3.3), which the verdict of the module reads (./verdict.mjs). As Bazel judges a test target that
4
+ // writes no test.xml by its exit code and its log, a task of such a runner is judged by both. The
5
+ // lines:
6
+ //
7
+ // <file, from the folder of the package>:
8
+ // (pass) <full name of the test> [<duration>]
9
+ // (fail) <full name of the test> [<duration>]
10
+ // <message, indented>
11
+ // (fail) the file did not load
12
+ // <reason, indented>
13
+ // Ran <n> tests across <m> files. [<duration>]
14
+ import path from 'node:path';
15
+
16
+ const FICHIER = /^(\S.*\.(?:test|spec)\.[cm]?[jt]sx?):$/;
17
+ const TEST = /^\((pass|fail|skip|todo)\) (.*?)(?: \[[\d.]+(?:ms|s)\])?$/;
18
+ const BILAN = /^Ran \d+ tests? across \d+ files?\./;
19
+ const NON_CHARGE = 'the file did not load';
20
+ const ETATS = { pass: 'passed', fail: 'failed', skip: 'skipped', todo: 'todo' };
21
+
22
+ /**
23
+ * The reports of the test files the lines &lt;texte&gt; of a task name, its package in the folder
24
+ * &lt;dossier&gt; (absolute), its exit code &lt;code&gt;: a file the runner did not load is failed, without a
25
+ * test, its reason its message. None when the lines prove nothing: the runner stopped before its
26
+ * last line, or a red code that no line explains.
27
+ * @param {string} texte
28
+ * @param {{ dossier: string, code: number }} tache
29
+ * @returns {import('../../jointure.js').RapportDeTest[]}
30
+ */
31
+ export function rapportsAuxLignes(texte, { dossier, code }) {
32
+ const rapports = [];
33
+ let rapport = null;
34
+ // What the indented lines that follow explain: the failed test, or the file not loaded.
35
+ let explique = null;
36
+ let fini = false;
37
+ for (const ligne of texte.split(/\r?\n/)) {
38
+ const fichier = FICHIER.exec(ligne);
39
+ const test = rapport && TEST.exec(ligne);
40
+ if (fichier) {
41
+ rapport = {
42
+ fichier: path.join(dossier, fichier[1]),
43
+ etat: 'passed',
44
+ message: '',
45
+ tests: [],
46
+ };
47
+ rapports.push(rapport);
48
+ explique = null;
49
+ } else if (test) {
50
+ const [, etat, nom] = test;
51
+ explique = null;
52
+ if (etat === 'fail') {
53
+ rapport.etat = 'failed';
54
+ }
55
+ if (etat === 'fail' && nom === NON_CHARGE) {
56
+ explique = rapport;
57
+ } else {
58
+ const t = { titre: nom.split(' > ').at(-1), nom, etat: ETATS[etat], message: '' };
59
+ rapport.tests.push(t);
60
+ explique = etat === 'fail' ? t : null;
61
+ }
62
+ } else if (BILAN.test(ligne)) {
63
+ fini = true;
64
+ rapport = null;
65
+ explique = null;
66
+ } else if (explique && /^\s/.test(ligne)) {
67
+ explique.message += `${explique.message ? '\n' : ''}${ligne.trim()}`;
68
+ } else {
69
+ explique = null;
70
+ }
71
+ }
72
+ const expliquee = code === 0 || rapports.some(r => r.etat === 'failed');
73
+ return fini && expliquee ? rapports : [];
74
+ }
@@ -42,11 +42,12 @@
42
42
  // "traces": { "trace:grammaires": { "lit": ["…/paires-v1"], "ecrit": "packages/060-encoder/trace/grammaires-du-corpus" } }
43
43
  // }
44
44
  //
45
- // - `lit`: the paths its tests read, directories or files, data or code. Its `test:unit` hashes
46
- // them (`inputs`: the root's, `$TURBO_EXTENDS$`, or `$TURBO_DEFAULT$` when the root's task sets
47
- // none; then `$TURBO_ROOT$/<dir>/**` each) and waits, beside the root's `dependsOn`, for each
45
+ // - `lit`: the paths its tests read, directories, files or glob patterns, data or code. Its
46
+ // `test:unit` hashes them (`inputs`: the root's, `$TURBO_EXTENDS$`, or `$TURBO_DEFAULT$` when
47
+ // the root's task sets none; then `$TURBO_ROOT$/<dir>/**` per directory, a file or a pattern as
48
+ // is, a path strictly inside a trace's output both ways) and waits, beside the root's `dependsOn`, for each
48
49
  // trace whose output one of them overlaps (`<producer>#trace:<name>`). The patterns its test
49
- // files declare they read (`// @lit <motif>` at their head, ./vitest-config/lances.mjs) are
50
+ // files declare they read (`// @lit <motif>` at their head, read by the module of its language) are
50
51
  // hashed with them (`$TURBO_ROOT$/<motif>` each, those `lit` already covers left out), a
51
52
  // package without `lit` included.
52
53
  // - `traces`: each trace the package produces, its command the package's script of the same name,
@@ -57,11 +58,13 @@
57
58
  // a package's tests wait for are read in Turborepo's plan of its tests (`tracesDuPlan` of
58
59
  // scripts/taches-du-graphe.mjs).
59
60
  // - The package holding a declared path of data alone (the shared test material) has its `build`
60
- // leave it out (`inputs`: the root's, then `!<dir>/**` each). A declared path holding code
61
+ // leave it out (`inputs`: the root's, then `!<dir>/**` per directory, a file or a pattern as is,
62
+ // `!` before it; a pattern that covers a file the build reads by name stays). A declared path holding code
61
63
  // (`.ts`, `.tsx`, `.mts`, `.cts`, `.d.ts`, `.js`, `.jsx`, `.mjs`, `.cjs`) stays an input of its
62
64
  // package's build; what a trace writes is no code of it.
63
65
  //
64
- // The check refuses a declared path absent that no trace writes; a trace written out of its
66
+ // The check refuses a declared path absent, or a pattern that covers no file, that no trace
67
+ // writes; a trace written out of its
65
68
  // package, followed by git, or not ignored; a `trace:*` script without declaration, a declaration
66
69
  // without script or not named `trace:<name>`. In the root's turbo.json, which is the project's, it
67
70
  // refuses what the generator owns: a task of one package (`<package>#<task>`, the root's own
@@ -111,14 +114,22 @@ import {
111
114
  AVANCEMENT,
112
115
  CHANGEMENTS,
113
116
  inscrireLePlan,
117
+ langage,
114
118
  paquetsSansPackageJson,
115
119
  TRACE,
116
120
  VARIABLE_TRAVAILLEURS as TRAVAILLEURS,
117
121
  } from '../../services-du-noyau.mjs';
118
122
  import { matieres } from './consommateurs.mjs';
119
- import { lecturesDeclarees, testsDuPaquet } from './vitest-config/lances.mjs';
123
+ import { lecturesDesTests } from './vitest-config/lances.mjs';
120
124
  import { parcourir } from './parcours.mjs';
121
- import { paquets, TYPAGE } from '../../paquets.mjs';
125
+ import {
126
+ estUnMotif,
127
+ fichiersDuMotif,
128
+ lectureNette,
129
+ paquets,
130
+ recouvreLaLecture,
131
+ TYPAGE,
132
+ } from '../../paquets.mjs';
122
133
  import { ecrireSarif, RESULTATS } from '../../resultats.mjs';
123
134
  import {
124
135
  SCRIPT_DES_TESTS as TESTS,
@@ -416,13 +427,11 @@ const net = d => String(d ?? '').replace(/\/+$/, '');
416
427
  // and whether it has such a segment: { fixe, glob }.
417
428
  function partieFixe(motif) {
418
429
  const segments = String(motif).replace(/^\.\//, '').split('/');
419
- const i = segments.findIndex(s => /[*?[\]{}]/.test(s));
430
+ const i = segments.findIndex(estUnMotif);
420
431
  return { fixe: net((i < 0 ? segments : segments.slice(0, i)).join('/')), glob: i >= 0 };
421
432
  }
422
433
  // Whether <f> is <d> or under it.
423
434
  const sous = (f, d) => f === d || f.startsWith(`${d}/`);
424
- // Whether one of <a> and <b> holds the other.
425
- const recouvre = (a, b) => sous(a, b) || sous(b, a);
426
435
 
427
436
  // The paths of the submodules the .gitmodules of <racine> declares, sorted; none without one.
428
437
  function sousModules(racine) {
@@ -443,12 +452,33 @@ function sousModules(racine) {
443
452
  .sort();
444
453
  }
445
454
 
446
- // The exclusion of the `.git` of each submodule of <sm> one of the <chemins> (from the root)
447
- // holds, each `!<prefixe><path from <depuis>>/.git`: the `.git` of a submodule set in a copy is
455
+ // Whether an input of Turborepo, the path or pattern <lu>, can reach the `.git` of the submodule
456
+ // <m>: a path that holds it; a pattern whose fixed part is the submodule or holds it, then a glob.
457
+ function atteintLeGit(lu, m) {
458
+ const { fixe, glob } = partieFixe(lu);
459
+ return glob ? fixe === '' || sous(m, fixe) : sous(m, fixe);
460
+ }
461
+
462
+ // The inputs, from the root, that the path read <lu> (`grillhouse.lit`) of <racine> gives: a
463
+ // pattern or a file as is, a directory with `/**`. A path strictly inside the output of a trace of
464
+ // <ecrits>, which may not be written yet, gives both, so that the text does not follow the disk.
465
+ function entreesDeLecture(racine, lu, ecrits) {
466
+ if (estUnMotif(lu)) {
467
+ return [lu];
468
+ }
469
+ if (ecrits.some(e => lu !== e && sous(lu, e))) {
470
+ return [lu, `${lu}/**`];
471
+ }
472
+ const f = statSync(path.join(racine, lu), { throwIfNoEntry: false });
473
+ return [f?.isFile() ? lu : `${lu}/**`];
474
+ }
475
+
476
+ // The exclusion of the `.git` of each submodule of <sm> one of the <chemins> (from the root, paths
477
+ // or patterns) reaches, each `!<prefixe><path from <depuis>>/.git`: the `.git` of a submodule set in a copy is
448
478
  // a file naming that copy.
449
479
  const gitsExclus = (chemins, sm, prefixe = '$TURBO_ROOT$/', depuis = '') =>
450
480
  sm
451
- .filter(m => chemins.some(c => sous(m, c)))
481
+ .filter(m => chemins.some(c => atteintLeGit(c, m)))
452
482
  .map(m => `!${prefixe}${depuis ? path.posix.relative(depuis, m) : m}/.git`);
453
483
 
454
484
  // The file of the base <base> that a configuration of TypeScript in <dir> extends, as tsc finds
@@ -659,7 +689,7 @@ function declarations(liste) {
659
689
  .filter(p => !p.hors)
660
690
  .map(({ dossier, pkg }) => {
661
691
  const g = pkg.grillhouse ?? {};
662
- const chemins = l => [...new Set((Array.isArray(l) ? l : []).map(net))].sort();
692
+ const chemins = l => [...new Set((Array.isArray(l) ? l : []).map(lectureNette))].sort();
663
693
  return {
664
694
  dossier,
665
695
  pkg,
@@ -677,14 +707,16 @@ function declarations(liste) {
677
707
  }
678
708
 
679
709
  // The patterns the test files of the package at <dossier> (absolute) declare they read (`// @lit`
680
- // at their head, ./vitest-config/lances.mjs), each a glob from the root, those the paths <lit> of
681
- // the package already cover left out; sorted.
682
- function lecturesDesTests(dossier, lit) {
683
- return [
684
- ...new Set(testsDuPaquet(dossier).flatMap(t => lecturesDeclarees(readFileSync(t, 'utf8')))),
685
- ]
686
- .filter(m => !lit.some(l => m === l || m.startsWith(`${l}/`)))
687
- .sort();
710
+ // at their head), as the module of its language <langageNom> reads them (null: a package of
711
+ // TypeScript, ./vitest-config/lances.mjs), each a glob from the root, those the paths <lit> of the
712
+ // package already cover left out; sorted.
713
+ function lecturesHorsDeLit(dossier, langageNom, lit) {
714
+ const lectures = langageNom
715
+ ? langage(langageNom).lecturesDesTests(dossier)
716
+ : lecturesDesTests(dossier);
717
+ return lectures.filter(
718
+ m => !lit.some(l => m === l || m.startsWith(`${l.replace(/\/\*\*$/, '')}/`))
719
+ );
688
720
  }
689
721
 
690
722
  // The text of a package's turbo.json, whose tasks are <taches>.
@@ -719,7 +751,7 @@ export function attendus(racine) {
719
751
  // The trace tasks whose output one of <lit> overlaps, <soi> left out, sorted.
720
752
  const jointes = (lit, soi) =>
721
753
  traces
722
- .filter(t => t.id !== soi && lit.some(l => recouvre(l, t.ecrit)))
754
+ .filter(t => t.id !== soi && lit.some(l => recouvreLaLecture(l, t.ecrit)))
723
755
  .map(t => t.id)
724
756
  .sort();
725
757
  // The paths of data alone declared: the ones a trace writes left out, which git ignores, and the
@@ -727,7 +759,9 @@ export function attendus(racine) {
727
759
  const ecrits = traces.map(t => t.ecrit);
728
760
  const donnees = [
729
761
  ...new Set([...decls.values()].flatMap(d => [...d.lit, ...d.traces.flatMap(t => t.lit)])),
730
- ].filter(l => !ecrits.some(e => recouvre(l, e)) && !contientCode(racine, l, ecrits));
762
+ ].filter(
763
+ l => !ecrits.some(e => recouvreLaLecture(l, e)) && !contientCode(racine, l, ecrits)
764
+ );
731
765
  // The inputs of the root's <tache> a package's own extend: the root's, or Turborepo's default
732
766
  // when the root sets none (`$TURBO_EXTENDS$` then extends an empty list).
733
767
  const base = tache => (deRacine.get(tache)?.inputs ? '$TURBO_EXTENDS$' : '$TURBO_DEFAULT$');
@@ -756,12 +790,19 @@ export function attendus(racine) {
756
790
  const lusParBuild = propres
757
791
  ? f => propres.includes(f)
758
792
  : f => f === 'package.json' || /^tsconfig[^/]*\.json$/.test(f);
793
+ const relatif = f => path.posix.relative(dossier, f);
794
+ // A pattern that covers a file the build reads by name is left in its inputs.
759
795
  const dedans = donnees
760
796
  .filter(d => d !== dossier && sous(d, dossier))
761
- .map(d => path.posix.relative(dossier, d))
762
- .filter(d => !lusParBuild(d))
797
+ .filter(d =>
798
+ estUnMotif(d)
799
+ ? !fichiersDuMotif(racine, d).some(f => lusParBuild(relatif(f)))
800
+ : !lusParBuild(relatif(d))
801
+ )
763
802
  .sort();
764
- const sansDonnees = dedans.map(d => `!${d}/**`);
803
+ const sansDonnees = dedans
804
+ .flatMap(d => entreesDeLecture(racine, d, ecrits))
805
+ .map(e => `!${relatif(e)}`);
765
806
  if (langageDuPaquet) {
766
807
  taches.build.inputs = [...propres, ...sansDonnees];
767
808
  } else if (propres) {
@@ -791,13 +832,19 @@ export function attendus(racine) {
791
832
  }
792
833
  }
793
834
  const decl = decls.get(dossier);
794
- const declares = lecturesDesTests(path.join(racine, dossier), decl.lit);
835
+ const declares = lecturesHorsDeLit(
836
+ path.join(racine, dossier),
837
+ langageDuPaquet ?? null,
838
+ decl.lit
839
+ );
795
840
  if (decl.lit.length || declares.length) {
796
841
  taches[TESTS] = {
797
842
  dependsOn: [...deplier(deRacine.get(TESTS)?.dependsOn ?? []), ...jointes(decl.lit)],
798
843
  inputs: [
799
844
  base(TESTS),
800
- ...decl.lit.map(l => `$TURBO_ROOT$/${l}/**`),
845
+ ...decl.lit
846
+ .flatMap(l => entreesDeLecture(racine, l, ecrits))
847
+ .map(l => `$TURBO_ROOT$/${l}`),
801
848
  ...declares.map(m => `$TURBO_ROOT$/${m}`),
802
849
  ...gitsExclus(decl.lit, sm),
803
850
  ],
@@ -809,7 +856,9 @@ export function attendus(racine) {
809
856
  dependsOn: [...deplier(['build', '^build']), ...jointes(t.lit, t.id)],
810
857
  inputs: [
811
858
  '$TURBO_DEFAULT$',
812
- ...t.lit.map(l => `$TURBO_ROOT$/${l}/**`),
859
+ ...t.lit
860
+ .flatMap(l => entreesDeLecture(racine, l, ecrits))
861
+ .map(l => `$TURBO_ROOT$/${l}`),
813
862
  ...gitsExclus(t.lit, sm),
814
863
  `!${ecrit}/**`,
815
864
  ],
@@ -1069,12 +1118,17 @@ export function ecrire(racine) {
1069
1118
  return ecrits;
1070
1119
  }
1071
1120
 
1072
- // Whether <chemin> of <racine> (a directory, or a file, from the root) holds a file of code; what
1073
- // lies under one of <exclus> left out, as `parcourir` walks it.
1121
+ // Whether <chemin> of <racine> (a directory, a file or a pattern, from the root) holds a file of
1122
+ // code; what lies under one of <exclus> left out, as `parcourir` walks it.
1074
1123
  function contientCode(racine, chemin, exclus) {
1075
1124
  if (exclus.some(e => sous(chemin, e))) {
1076
1125
  return false;
1077
1126
  }
1127
+ if (estUnMotif(chemin)) {
1128
+ return fichiersDuMotif(racine, chemin).some(
1129
+ f => CODE.test(f) && !exclus.some(e => sous(f, e))
1130
+ );
1131
+ }
1078
1132
  const rel = p => path.relative(racine, p).split(path.sep).join('/');
1079
1133
  return parcourir(path.join(racine, chemin), p => exclus.some(e => sous(rel(p), e))).some(f =>
1080
1134
  CODE.test(f)
@@ -1084,7 +1138,7 @@ function contientCode(racine, chemin, exclus) {
1084
1138
  const gitSort = (racine, args) => spawnSync('git', args, { cwd: racine, encoding: 'utf8' });
1085
1139
 
1086
1140
  // The refusals of the data and traces the packages of <racine> declare: one line per declared
1087
- // path absent that no trace writes, per trace written out of its producer,
1141
+ // path absent or pattern covering no file that no trace writes, per trace written out of its producer,
1088
1142
  // followed by git or not ignored, per trace script without declaration and declaration without
1089
1143
  // script.
1090
1144
  function declarationsRefusees(racine) {
@@ -1124,8 +1178,17 @@ function declarationsRefusees(racine) {
1124
1178
  }
1125
1179
  }
1126
1180
  for (const l of [...new Set([...lit, ...traces.flatMap(t => t.lit)])].sort()) {
1127
- const sortie = ecrits.some(e => recouvre(l, e));
1128
- if (!sortie && !existsSync(path.join(racine, l))) {
1181
+ const sortie = ecrits.some(e => recouvreLaLecture(l, e));
1182
+ if (sortie) {
1183
+ continue;
1184
+ }
1185
+ if (estUnMotif(l)) {
1186
+ if (fichiersDuMotif(racine, l).length === 0) {
1187
+ refus.push(
1188
+ `⛔ ${ici} : le motif lu \`${l}\` ne recouvre aucun fichier, et aucune trace n'écrit sous lui (\`grillhouse.traces\`).`
1189
+ );
1190
+ }
1191
+ } else if (!existsSync(path.join(racine, l))) {
1129
1192
  refus.push(
1130
1193
  `⛔ ${ici} : le chemin lu \`${l}\` n'existe pas, et aucune trace ne l'écrit (\`grillhouse.traces\`).`
1131
1194
  );
@@ -8,8 +8,13 @@
8
8
  // `<dossier>/vitest/` while the variable is set (scripts/langages/typescript/vitest-config/resultats.mjs):
9
9
  // `lireRapportsVitest` gives each test file, its status, the message of a file that does not
10
10
  // load, and each test, its title, its full name, its status and its first message.
11
+ // - The log of a task of tests whose package has no report (./rapports-aux-lignes.mjs, a runner
12
+ // without a report test by test), read from the root of the run.
11
13
  import { existsSync, readdirSync, readFileSync } from 'node:fs';
12
14
  import path from 'node:path';
15
+ import { stripVTControlCharacters } from 'node:util';
16
+ import { A_REPASSER } from '../../services-du-noyau.mjs';
17
+ import { rapportsAuxLignes } from './rapports-aux-lignes.mjs';
13
18
  import { lireLesResumes } from './resume-du-lanceur.mjs';
14
19
  import { VITEST } from './vitest-config/resultats.mjs';
15
20
 
@@ -46,7 +51,28 @@ export function lireRapportsVitest(dossier) {
46
51
  );
47
52
  }
48
53
 
49
- // The verdict the results directory <dossier> holds: `{ rapports, taches }`.
50
- export function verdict(dossier) {
51
- return { rapports: lireRapportsVitest(dossier), taches: lireLesResumes(dossier) };
54
+ // The reports the logs of the tasks <taches> give, from the root <racine> of their run: those of
55
+ // each task of tests that ran, not « à repasser », whose package has none among <rapports>.
56
+ function rapportsDesJournaux(racine, taches, rapports) {
57
+ return taches
58
+ .filter(t => t.tests && t.journal && t.code !== null && t.code !== A_REPASSER)
59
+ .flatMap(t => {
60
+ const paquet = path.join(racine, t.dossier, path.sep);
61
+ const journal = path.join(racine, t.journal);
62
+ return !existsSync(journal) || rapports.some(r => r.fichier.startsWith(paquet))
63
+ ? []
64
+ : rapportsAuxLignes(stripVTControlCharacters(readFileSync(journal, 'utf8')), {
65
+ dossier: paquet,
66
+ code: t.code,
67
+ });
68
+ });
69
+ }
70
+
71
+ // The verdict the results directory <dossier> holds: `{ rapports, taches }`; with the root
72
+ // <racine> of the run, the reports its logs give too.
73
+ export function verdict(dossier, racine) {
74
+ const rapports = lireRapportsVitest(dossier);
75
+ const taches = lireLesResumes(dossier);
76
+ const auxLignes = racine ? rapportsDesJournaux(racine, taches, rapports) : [];
77
+ return { rapports: [...rapports, ...auxLignes], taches };
52
78
  }
@@ -390,7 +390,7 @@ function passe({ racine, demandes, env, dire, coeurs }) {
390
390
  // green that turned red, with the moment they did. A red pass on a ticket's branch records none:
391
391
  // its reds are the ticket's work.
392
392
  if (complet && env[RESULTATS] && m?.etat) {
393
- const rapports = langageDe(racine).verdict(env[RESULTATS]).rapports;
393
+ const rapports = langageDe(racine).verdict(env[RESULTATS], racine).rapports;
394
394
  if (code === 0) {
395
395
  garderLeRegistre(m.etat, rapports);
396
396
  } else if (!m.etat.branche || m.etat.branche === m.etat.main) {
@@ -26,7 +26,8 @@
26
26
  // 4. the configuration of the package at its top: `package.json`, `vitest.config.*`,
27
27
  // `vite.config.*`, `vitest.workspace.*`, `tsconfig*.json`; its `setupFiles` and its
28
28
  // `globalSetup`, which Vitest runs beside the graph;
29
- // 5. a path its tests declare they read (`grillhouse.lit` of its package.json, from the top):
29
+ // 5. a path its tests declare they read (`grillhouse.lit` of its package.json, from the top,
30
+ // a path or a glob pattern, as `couvertPar` of ../../../paquets.mjs reads it):
30
31
  // a directory or a file out of the package that its tests read as a whole (the templates,
31
32
  // the plugin, the configuration of the repository), as Bazel's `data`, named file by file
32
33
  // where the frame rewrites their neighbours (the hooks and configuration of `.beads`, never
@@ -71,6 +72,7 @@ import { existsSync, readFileSync, realpathSync } from 'node:fs';
71
72
  import { createRequire } from 'node:module';
72
73
  import path from 'node:path';
73
74
  import { fileURLToPath } from 'node:url';
75
+ import { couvertPar } from '../../../paquets.mjs';
74
76
  import { testsQuiDeclarent, testsQuiLancent, testsQuiNomment } from './lances.mjs';
75
77
 
76
78
  // This directory, the frame's base configuration.
@@ -208,9 +210,9 @@ function paquetEntier(ch, dossier, test = {}) {
208
210
  const racine = ch.racine;
209
211
  const abs = f => path.join(racine, f);
210
212
  const deps = dependances(racine, dossier);
211
- const lit = (lireJson(path.join(dossier, 'package.json'))?.grillhouse?.lit ?? [])
212
- .filter(l => typeof l === 'string')
213
- .map(l => l.replace(/^\.\//, '').replace(/\/+$/, ''));
213
+ const lit = (lireJson(path.join(dossier, 'package.json'))?.grillhouse?.lit ?? []).filter(
214
+ l => typeof l === 'string'
215
+ );
214
216
  const preparation = [test.setupFiles, test.globalSetup]
215
217
  .flat()
216
218
  .filter(f => typeof f === 'string')
@@ -231,7 +233,7 @@ function paquetEntier(ch, dossier, test = {}) {
231
233
  ? 'la configuration du paquet'
232
234
  : preparation.includes(a)
233
235
  ? 'un fichier de préparation des tests'
234
- : !ch.cible && lit.some(l => f === l || f.startsWith(`${l}/`))
236
+ : !ch.cible && couvertPar(lit, f)
235
237
  ? 'un chemin que ses tests déclarent lire (grillhouse.lit)'
236
238
  : deps.some(d => sous(a, d) && construit(racine, d, a))
237
239
  ? 'le code d’un paquet dont il dépend, que ses tests lisent construit'
@@ -246,7 +248,7 @@ function paquetEntier(ch, dossier, test = {}) {
246
248
  // path reads its text, not its output.
247
249
  if (!ch.cible) {
248
250
  for (const f of ch.sansEffet ?? []) {
249
- if (lit.some(l => f === l || f.startsWith(`${l}/`))) {
251
+ if (couvertPar(lit, f)) {
250
252
  return { raison: 'un chemin que ses tests déclarent lire (grillhouse.lit)', fichier: f };
251
253
  }
252
254
  }
@@ -5,7 +5,7 @@
5
5
  // Mechanism: packages/grillhouse/docs/architecture/tests.md, §5.3 (the tests of a package replayed).
6
6
  //
7
7
  // - What a test names (`nommesPar`): each path that a string of its code writes whole
8
- // (`'../../scripts/verrous/verrou.mjs'`), or that the strings of one call of `join` or
8
+ // (`'../../scripts/verrous/ecriture-hors-enveloppe.mjs'`), or that the strings of one call of `join` or
9
9
  // `resolve` write together (`path.join(DEPOT, 'packages/a', 'scripts/x.mjs')`), resolved from
10
10
  // the directory of the file that writes it, then from the test's package, then from the top of
11
11
  // the repository, the first that exists: the constant `SCRIPT` of a test that launches a script,
@@ -23,7 +23,7 @@
23
23
  // - What a test reads (`lusPar`): the test and the files it names, then, from file to file, the
24
24
  // modules each one imports (a relative specifier, or a package of the workspace, resolved as Node
25
25
  // resolves it, out of node_modules once its links are followed) and the paths each module's code
26
- // writes from its own directory (`path.join(ICI, 'verrous/verrou.mjs')`), a command's link
26
+ // writes from its own directory (`path.join(ICI, 'verrous/ticket-du-sous-agent.mjs')`), a command's link
27
27
  // included (the hook of the plugin that runs `node_modules/.bin/grillhouse <sous-commande>`), and
28
28
  // the paths a script of the shell writes from its own directory (`"$ici/superviseur.mjs"`): a
29
29
  // script that launches another names it. A subcommand leads to every script of the command's
@@ -44,8 +44,8 @@
44
44
  // turbo.json (../turbo-des-paquets.mjs) writes each pattern in the inputs of the package's test
45
45
  // task, so that Turborepo's cache follows the same declaration.
46
46
  // - What a test names without the frame reading it (`nonDeclares`): a string of the test's code or
47
- // of its material that ends the path of a module of its package (`'verrou.mjs'`,
48
- // `'verrous/verrou.mjs'`), out of a directory of tests, the module out of what the test reads and
47
+ // of its material that ends the path of a module of its package (`'registre.mjs'`,
48
+ // `'enveloppe/lancer.sh'`), out of a directory of tests, the module out of what the test reads and
49
49
  // out of the package's `grillhouse.lit`: a script it launches by a path built at run time
50
50
  // (`path.join(SCRIPTS, nom)`), whose change would not play it; or a pattern that names a
51
51
  // directory of the package without a fixed start (`'**/scripts/*.mjs'`), for each module it
@@ -62,7 +62,7 @@ import { existsSync, globSync, readFileSync, realpathSync, statSync } from 'node
62
62
  import { createRequire } from 'node:module';
63
63
  import path from 'node:path';
64
64
  import { matieres } from '../composants.mjs';
65
- import { paquets } from '../../../paquets.mjs';
65
+ import { couvertPar, lecturesDeclarees, paquets } from '../../../paquets.mjs';
66
66
  import { parcourir } from '../parcours.mjs';
67
67
 
68
68
  /** A test file, as Vitest's default `include` names one. */
@@ -484,29 +484,6 @@ export function testsQuiNomment(dossier, racine, changes) {
484
484
  );
485
485
  }
486
486
 
487
- // The tag of a test that declares the files it reads: a line `// @lit <motif> …` of the comment at
488
- // the head of the file, before its first line of code, as the tag `@poste` (./cibles.mjs).
489
- const ETIQUETTE_DE_LECTURE = /^\/\/\s*@lit\b(.*)$/;
490
-
491
- /**
492
- * The patterns the text <texte> of a test file declares it reads: the words of each line
493
- * `// @lit` of the comment at its head, each a glob from the top of the repository.
494
- * @param {string} texte the text of the file
495
- */
496
- export function lecturesDeclarees(texte) {
497
- const out = [];
498
- for (const ligne of texte.split('\n')) {
499
- const l = ligne.trim();
500
- const m = ETIQUETTE_DE_LECTURE.exec(l);
501
- if (m) {
502
- out.push(...m[1].split(/\s+/).filter(Boolean));
503
- } else if (l !== '' && !l.startsWith('//') && !l.startsWith('#!')) {
504
- break;
505
- }
506
- }
507
- return out;
508
- }
509
-
510
487
  /**
511
488
  * The test files of the package at <dossier> that declare they read one of the files <chemins>
512
489
  * (each from the top of the repository): those whose `@lit` patterns cover one; absolute, sorted.
@@ -521,12 +498,18 @@ export function testsQuiDeclarent(dossier, chemins) {
521
498
  });
522
499
  }
523
500
 
524
- // Whether the path <rel> (from the top) lies under one of the paths <lit> (from the top).
525
- const dansLit = (rel, lit) => lit.some(l => rel === l || rel.startsWith(`${l}/`));
501
+ /**
502
+ * The patterns the test files of the package at <dossier> declare they read (`lecturesDeclarees`),
503
+ * each once, sorted.
504
+ * @param {string} dossier the directory of the package, absolute
505
+ */
506
+ export function lecturesDesTests(dossier) {
507
+ return [...new Set(testsDuPaquet(dossier).flatMap(t => lecturesDeclarees(lire(t))))].sort();
508
+ }
526
509
 
527
510
  /**
528
511
  * What the test files of the package at <dossier>, in the repository at <racine>, name without
529
- * the frame reading it, <lit> the package's `grillhouse.lit` (paths from the top):
512
+ * the frame reading it, <lit> the package's `grillhouse.lit` (paths or patterns from the top):
530
513
  * `[{ test, fichier, chaine }]`, `test` and `fichier` from the top, `fichier` a module of the
531
514
  * package out of a directory of tests whose path the string <chaine> of the test's code (or of its
532
515
  * material) ends, out of what the test reads (`lusPar`) and out of lit; in the order of the tests.
@@ -538,7 +521,7 @@ export function nonDeclares(dossier, racine, lit = [], memo = new Map()) {
538
521
  const modules = [];
539
522
  for (const f of fichiersSous(dossier)) {
540
523
  const r = du(racine, f);
541
- if (!MODULE.test(f) || TEST.test(f) || MATIERE.test(r) || dansLit(r, lit)) {
524
+ if (!MODULE.test(f) || TEST.test(f) || MATIERE.test(r) || couvertPar(lit, r)) {
542
525
  continue;
543
526
  }
544
527
  modules.push(f);
@@ -20,12 +20,18 @@
20
20
  // the part of a manifest its tests own) are
21
21
  // played in the main tree of the repository when they throw in the copy, the paths carried from
22
22
  // one tree to the other. A session leaves such a copy between two writes of one change (cargo:
23
- // a dependency moved in the manifest of the workspace and not yet in a crate's); the lock of
24
- // its writes, its envelope and the acts of its circuit read on, as
23
+ // a dependency moved in the manifest of the workspace and not yet in a crate's); the judgment
24
+ // of its lots, its envelope and the acts of its circuit read on, as
25
25
  // rust-analyzer keeps the last graph that loaded, and the write that repairs the copy passes.
26
26
  // `langageDe` stays strict: a guard, a build and the red of a reading read the tree as it is.
27
+ // - The generator of the graph (the `turbo.json` of the packages, whose tasks hash what each
28
+ // package declares its tests read, `grillhouse.lit`) serves every language, as Turborepo hashes
29
+ // the inputs of a task whatever tool it runs. It lives in the module typescript, which the join
30
+ // asks for it in a project that declares no typescript: its command, its generated files, its
31
+ // share of the update and, in a repository of packages, its guard (docs/architecture/tests.md
32
+ // §3.1).
27
33
  // - A module is loaded once per process, synchronously (`require` of an ES module, Node 22): the
28
- // locks and the guards ask it in a hook, where nothing waits.
34
+ // hooks and the guards ask it where nothing waits.
29
35
  //
30
36
  // What the core asks of a module: docs/architecture/tests.md §3.3 and scripts/jointure.d.ts.
31
37
  import { spawnSync } from 'node:child_process';
@@ -33,6 +39,7 @@ import { createRequire } from 'node:module';
33
39
  import path from 'node:path';
34
40
  import { composer } from './composition-des-langages.mjs';
35
41
  import { matieresDeclarees, sousUneMatiere } from './matieres-lues.mjs';
42
+ import { paquets } from './paquets.mjs';
36
43
  import {
37
44
  ARCHITECTURE,
38
45
  COLONNE,
@@ -121,6 +128,49 @@ const avecLesMatieres = langage =>
121
128
  : null),
122
129
  });
123
130
 
131
+ // The name of the generator of the graph, its command and its guard, and the module that holds it.
132
+ const GRAPHE = 'turbo-des-paquets';
133
+ const PORTEUR = 'typescript';
134
+
135
+ // <composition>, the join of <modules>, with the generator of the graph when none of them holds
136
+ // it: its command, its generated files, and its guard in a repository of packages, the first of
137
+ // the languages'. The composition itself when one of them holds it.
138
+ const avecLeGraphe = (composition, modules) => {
139
+ if (modules.some(m => m.nom === PORTEUR)) {
140
+ return composition;
141
+ }
142
+ const porteur = charger(PORTEUR);
143
+ return Object.assign(Object.create(composition), {
144
+ commandes: racine => ({
145
+ ...composition.commandes(racine),
146
+ [GRAPHE]: porteur.commandes(racine)[GRAPHE],
147
+ }),
148
+ fichiersEngendres: racine => [
149
+ ...composition.fichiersEngendres(racine),
150
+ ...porteur.fichiersEngendres(racine).filter(e => e.gardes.includes(GRAPHE)),
151
+ ],
152
+ gardes: racine => [
153
+ ...(paquets(racine).length
154
+ ? porteur.gardes(racine).filter(g => path.basename(g[0], '.mjs') === GRAPHE)
155
+ : []),
156
+ ...composition.gardes(racine),
157
+ ],
158
+ });
159
+ };
160
+
161
+ /**
162
+ * The generators the update runs in a project of the modules <modules>, each with its module:
163
+ * each module's (`miseAJour.generateurs`), then the generator of the graph, which every project
164
+ * has (a generator two give is run once, by its command).
165
+ * @param {import('./jointure.js').Langage[]} modules
166
+ */
167
+ export const generateursDe = modules =>
168
+ [...modules, charger(PORTEUR)].flatMap(m =>
169
+ m.miseAJour.generateurs
170
+ .filter(g => modules.includes(m) || g.commande === GRAPHE)
171
+ .map(g => ({ g, m }))
172
+ );
173
+
124
174
  const composes = new Map();
125
175
  /**
126
176
  * The join of the modules that serve the project at <racine> (`langagesDe`): their composition
@@ -133,7 +183,7 @@ export function langageDe(racine) {
133
183
  const modules = langagesDe(racine);
134
184
  const cle = modules.map(m => m.nom).join('+');
135
185
  if (!composes.has(cle)) {
136
- composes.set(cle, avecLesMatieres(composer(modules)));
186
+ composes.set(cle, avecLesMatieres(avecLeGraphe(composer(modules), modules)));
137
187
  }
138
188
  return composes.get(cle);
139
189
  }
@@ -4,7 +4,7 @@
4
4
  // with the code (Web Platform Tests keep their cases the same way): a list of folders of the
5
5
  // repository, each from the root. The testwriter writes any file under one, as a file of shared
6
6
  // test material; the developpeur does not (`estUnTest` of the join of the languages,
7
- // scripts/langages.mjs, which the lock, the envelope and the conflicts of a copy read).
7
+ // scripts/langages.mjs, which the judgment of a lot, the envelope and the conflicts of a copy read).
8
8
  //
9
9
  // This module holds the reading itself, given the components of the project; it imports no
10
10
  // language, so that the join of the languages can use it. The reading a caller asks by a