@roomi-fields/grillhouse 0.50.3 → 0.52.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 (150) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/CHANGELOG.md +68 -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/plan.md +47 -0
  13. package/charte/preuve.md +39 -0
  14. package/charte/superviseur.md +61 -0
  15. package/charte/tests.md +38 -0
  16. package/charte.md +39 -189
  17. package/dist/machine/part-par-sorte.d.ts +16 -0
  18. package/dist/machine/part-par-sorte.js +36 -0
  19. package/dist/machine/part-par-sorte.js.map +1 -0
  20. package/dist/temporal/circuit/appel.js +1 -1
  21. package/dist/temporal/circuit/appel.js.map +1 -1
  22. package/dist/temporal/circuit/client.d.ts +4 -4
  23. package/dist/temporal/circuit/client.js +38 -16
  24. package/dist/temporal/circuit/client.js.map +1 -1
  25. package/dist/temporal/circuit/contrat.d.ts +11 -7
  26. package/dist/temporal/circuit/contrat.js +5 -9
  27. package/dist/temporal/circuit/contrat.js.map +1 -1
  28. package/dist/temporal/circuit/deroule.js +18 -6
  29. package/dist/temporal/circuit/deroule.js.map +1 -1
  30. package/dist/temporal/commande.js +12 -3
  31. package/dist/temporal/commande.js.map +1 -1
  32. package/dist/temporal/installation.d.ts +54 -3
  33. package/dist/temporal/installation.js +187 -17
  34. package/dist/temporal/installation.js.map +1 -1
  35. package/dist/temporal/places/client.d.ts +5 -1
  36. package/dist/temporal/places/client.js +23 -11
  37. package/dist/temporal/places/client.js.map +1 -1
  38. package/docs/ARCHITECTURE.md +23 -2700
  39. package/docs/INTERFACE.md +26 -10
  40. package/docs/architecture/circuit.md +61 -14
  41. package/docs/architecture/entree.md +21 -8
  42. package/docs/architecture/greffon.md +49 -20
  43. package/docs/architecture/installation.md +46 -17
  44. package/docs/architecture/machine.md +79 -39
  45. package/docs/architecture/tests.md +59 -16
  46. package/docs/lexique.md +163 -0
  47. package/hooks/hooks.json +0 -10
  48. package/hooks/register.tsx +92 -4
  49. package/package.json +2 -1
  50. package/scripts/activites.mjs +105 -65
  51. package/scripts/aiguillage.mjs +15 -8
  52. package/scripts/attente-au-tour.mjs +2 -3
  53. package/scripts/attente-de-la-machine.mjs +4 -8
  54. package/scripts/avancement.mjs +12 -8
  55. package/scripts/bilan.mjs +126 -63
  56. package/scripts/bilans-gardes.mjs +37 -0
  57. package/scripts/branche-de-nuit.mjs +2 -2
  58. package/scripts/ci-de-main.mjs +18 -21
  59. package/scripts/circuit.mjs +89 -44
  60. package/scripts/circuits-du-serveur.mjs +5 -5
  61. package/scripts/composants-affectes.mjs +30 -12
  62. package/scripts/composition-des-langages.mjs +5 -3
  63. package/scripts/conformite.mjs +1 -1
  64. package/scripts/consommation-des-passes.mjs +8 -6
  65. package/scripts/copies-finies.mjs +3 -14
  66. package/scripts/depart-du-ticket.d.mts +8 -2
  67. package/scripts/depart-du-ticket.mjs +26 -8
  68. package/scripts/direct.mjs +158 -72
  69. package/scripts/droits.mjs +165 -208
  70. package/scripts/engendres.mjs +3 -14
  71. package/scripts/entree-de-seance.mjs +35 -0
  72. package/scripts/enveloppe/enveloppe.mjs +98 -46
  73. package/scripts/enveloppe/lancer.sh +90 -66
  74. package/scripts/enveloppe/paquets-du-plan.mjs +38 -11
  75. package/scripts/enveloppe/travail-de-la-copie.mjs +192 -3
  76. package/scripts/etapes.mjs +84 -22
  77. package/scripts/faits-du-circuit.mjs +8 -2
  78. package/scripts/grillhouse-maj.mjs +43 -18
  79. package/scripts/groupe-cles.d.mts +15 -0
  80. package/scripts/groupe-cles.mjs +77 -2
  81. package/scripts/init.mjs +9 -2
  82. package/scripts/integration/rejeu.mjs +8 -1
  83. package/scripts/jointure.d.ts +24 -4
  84. package/scripts/langages/c/index.mjs +5 -2
  85. package/scripts/langages/cargo/commandes.mjs +35 -15
  86. package/scripts/langages/cargo/composants.mjs +45 -3
  87. package/scripts/langages/cargo/index.mjs +6 -3
  88. package/scripts/langages/python/commandes.mjs +50 -7
  89. package/scripts/langages/python/index.mjs +5 -2
  90. package/scripts/langages/python/squelette.mjs +2 -1
  91. package/scripts/langages/typescript/chemins-des-tests.mjs +1 -1
  92. package/scripts/langages/typescript/index.mjs +16 -14
  93. package/scripts/langages/typescript/mise-a-jour.mjs +1 -1
  94. package/scripts/langages/typescript/rapports-aux-lignes.mjs +74 -0
  95. package/scripts/langages/typescript/turbo-des-paquets.mjs +151 -38
  96. package/scripts/langages/typescript/verdict.mjs +29 -3
  97. package/scripts/langages/typescript/verifier.mjs +28 -3
  98. package/scripts/langages/typescript/vitest-config/changements.mjs +8 -6
  99. package/scripts/langages/typescript/vitest-config/lances.mjs +15 -32
  100. package/scripts/langages.mjs +54 -4
  101. package/scripts/matieres-lues.mjs +1 -1
  102. package/scripts/mesure/base-de-passe.mjs +32 -90
  103. package/scripts/migrations/serveurs-de-l-index.mjs +79 -0
  104. package/scripts/migrations/suivi-du-superviseur-retire.mjs +56 -0
  105. package/scripts/migrations.mjs +23 -7
  106. package/scripts/nuit.sh +3 -2
  107. package/scripts/paquet.mjs +1 -1
  108. package/scripts/paquets.d.ts +3 -0
  109. package/scripts/paquets.mjs +88 -1
  110. package/scripts/passe-de-la-machine.mjs +109 -36
  111. package/scripts/places-de-la-machine.mjs +81 -29
  112. package/scripts/plafond-de-la-machine.d.mts +2 -5
  113. package/scripts/plafond-de-la-machine.mjs +9 -9
  114. package/scripts/reprise.mjs +42 -13
  115. package/scripts/resultats.mjs +78 -56
  116. package/scripts/retirer-les-copies-finies.mjs +1 -1
  117. package/scripts/seances.mjs +471 -133
  118. package/scripts/services-du-noyau.mjs +9 -1
  119. package/scripts/session-start.sh +22 -7
  120. package/scripts/sortie-de-seance.mjs +70 -0
  121. package/scripts/sortie.mjs +37 -6
  122. package/scripts/sous-commandes.mjs +0 -3
  123. package/scripts/superviseur.mjs +400 -162
  124. package/scripts/tableau.mjs +188 -65
  125. package/scripts/transitions.d.mts +25 -2
  126. package/scripts/transitions.mjs +137 -29
  127. package/scripts/verrous/ecriture-hors-enveloppe.mjs +31 -9
  128. package/skills/codebase-design/DESIGN-IT-TWICE.md +1 -1
  129. package/skills/developpeur/SKILL.md +38 -15
  130. package/skills/direct/SKILL.md +29 -9
  131. package/skills/domain-modeling/GLOSSARY-FORMAT.md +9 -9
  132. package/skills/domain-modeling/SKILL.md +14 -12
  133. package/skills/explorateur/SKILL.md +32 -8
  134. package/skills/grill/SKILL.md +3 -2
  135. package/skills/pitmaster/SKILL.md +80 -50
  136. package/skills/pitmaster/references/cadre.md +1 -1
  137. package/skills/pitmaster/references/consigne-agent.md +12 -11
  138. package/skills/pitmaster/references/tour.md +6 -5
  139. package/skills/relecteur/SKILL.md +13 -6
  140. package/skills/systematic-debugging/SKILL.md +281 -0
  141. package/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
  142. package/skills/systematic-debugging/condition-based-waiting.md +115 -0
  143. package/skills/systematic-debugging/defense-in-depth.md +122 -0
  144. package/skills/systematic-debugging/find-polluter.sh +72 -0
  145. package/skills/systematic-debugging/root-cause-tracing.md +169 -0
  146. package/skills/testwriter/SKILL.md +37 -31
  147. package/cadre/templates/projet/pitmaster/SUIVI.md +0 -22
  148. package/scripts/attente-a-l-arret.mjs +0 -114
  149. package/scripts/verrous/commande.mjs +0 -214
  150. package/scripts/verrous/verrou.mjs +0 -311
@@ -48,6 +48,7 @@ import {
48
48
  estUnTest,
49
49
  joueDesTests,
50
50
  lecteurs,
51
+ lecturesDesTests,
51
52
  liensDuManifeste,
52
53
  manifestes,
53
54
  matieres,
@@ -77,9 +78,10 @@ export default {
77
78
  construireLesPaquets: () => {
78
79
  throw new Error('construction non prise en charge pour cargo');
79
80
  },
80
- // The reader of TOML by which the lock judges a Cargo.toml (./composants.mjs, `manifestes`), and
81
- // Turborepo, which plays the tasks of the crates (./commandes.mjs).
82
- outils: ['smol-toml', 'turbo'],
81
+ // The reader of TOML by which the judgment of a lot reads a Cargo.toml (./composants.mjs, `manifestes`), and
82
+ // Turborepo, which plays the tasks of the crates (./commandes.mjs); jsonc-parser, by which the
83
+ // generator of the graph reads and writes their turbo.json.
84
+ outils: ['jsonc-parser', 'smol-toml', 'turbo'],
83
85
  // The programs the installer of Temporal requires in the PATH of the workers: cargo's folder is
84
86
  // also rustc's, nextest's and sccache's (rustup, `cargo install`).
85
87
  executables: ['cargo'],
@@ -123,6 +125,7 @@ export default {
123
125
  composantDe: (racine, fichier) => composantDans(composants(racine), racine, fichier),
124
126
  matieres,
125
127
  joueDesTests,
128
+ lecturesDesTests,
126
129
  lecteurs,
127
130
  elementsDuLot,
128
131
  // The hashes of the inputs of the tests tasks of the crates and their dependents, as
@@ -28,8 +28,13 @@
28
28
  // - `tests-du-paquet <chemin>…` is the body of that task, which the `test:unit` script of a project
29
29
  // calls (`grillhouse tests-du-paquet <dossier du projet>`, written with the package): it never
30
30
  // runs Turborepo, so `tester` and the task do not loop. It plays pytest in the project:
31
- // `uv run --locked --group test pytest`, the group `test` holding pytest and what the tests
32
- // depend on, its JUnit report in the family `xunit1` (./verdict.mjs). A path, written from the
31
+ // `uv run --locked --group test <racine>/.venv/<dossier>/bin/pytest`, the pytest of the
32
+ // environment of the package by its path, the group `test` holding pytest and what the tests
33
+ // depend on, its JUnit report in the family `xunit1` (./verdict.mjs). Never `pytest` by its
34
+ // name: uv then plays the one of the PATH, without a word, when the environment holds none that
35
+ // launches. A pytest of the environment absent or broken (the interpreter of its shebang gone,
36
+ // as after the repository moved) is red, its line naming the repair, `uv sync --locked --group
37
+ // test --reinstall` on that environment. A path, written from the
33
38
  // root, chooses the project that holds it, and pytest plays that path alone; the paths of the
34
39
  // variable `GRILLHOUSE_TESTS` that lie in the project replace the folder the script names. A path
35
40
  // out of every project is refused, named, and nothing plays (code 2). The night tests
@@ -80,7 +85,7 @@
80
85
  // - The exit code: 0 when every task is green, 75 when the only reds are « à repasser », 1
81
86
  // otherwise; 2 for a path refused or a command unknown.
82
87
  import { spawnSync } from 'node:child_process';
83
- import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
88
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
84
89
  import { constants, tmpdir } from 'node:os';
85
90
  import path from 'node:path';
86
91
  import { fileURLToPath, pathToFileURL } from 'node:url';
@@ -160,6 +165,7 @@ function passe(racine, env) {
160
165
  const id = `${Date.now()}-${process.pid}`;
161
166
  const taches = [];
162
167
  const rapports = {};
168
+ let uvAbsent = false;
163
169
  // uv keeps its cache with the frame's caches of compilation, out of the temporary directory.
164
170
  const environnement = {
165
171
  ...env,
@@ -205,14 +211,14 @@ function passe(racine, env) {
205
211
  },
206
212
  // <vert>, the codes that count green beside 0.
207
213
  jouer({ t, args, cwd, programme }, vert = []) {
208
- // The environment of uv of the package, at the root (`sorties` of ./index.mjs).
209
- const venv = path.join(racine, VENV, path.relative(racine, cwd));
214
+ const venv = environnementDe(racine, cwd);
210
215
  const r = spawnSync(programme, args, {
211
216
  cwd,
212
217
  env: { ...environnement, UV_PROJECT_ENVIRONMENT: venv },
213
218
  stdio: 'inherit',
214
219
  });
215
220
  if (r.error?.code === 'ENOENT' && programme === 'uv') {
221
+ uvAbsent = true;
216
222
  process.stderr.write("⛔ uv absent du PATH : `npx grillhouse binaires` l'installe.\n");
217
223
  }
218
224
  t.code = r.error ? 127 : (r.status ?? 128 + (constants.signals[r.signal] ?? 0));
@@ -222,6 +228,8 @@ function passe(racine, env) {
222
228
  ecrire();
223
229
  return t.code;
224
230
  },
231
+ // Whether a task found no uv to run, which `jouer` said.
232
+ uvAbsent: () => uvAbsent,
225
233
  code() {
226
234
  const rouges = taches.filter(t => t.code !== 0);
227
235
  if (rouges.length === 0) {
@@ -232,6 +240,35 @@ function passe(racine, env) {
232
240
  };
233
241
  }
234
242
 
243
+ // The environment of uv of the package at <dossier>, at the root (`sorties` of ./index.mjs).
244
+ const environnementDe = (racine, dossier) =>
245
+ path.join(racine, VENV, path.relative(racine, dossier));
246
+
247
+ // Whether the script <f> of an environment launches: there, and the interpreter it names there,
248
+ // by its shebang or, for a path too long or with a space, by the `exec` of its `/bin/sh` header.
249
+ function seLance(f) {
250
+ let texte;
251
+ try {
252
+ texte = readFileSync(f, 'utf8');
253
+ } catch {
254
+ return false;
255
+ }
256
+ const [premiere, seconde = ''] = texte.split('\n');
257
+ const interpretes = [
258
+ /^#!\s*(\S+)/.exec(premiere)?.[1],
259
+ /^'''exec' '(\/[^']*)' "\$0"/.exec(seconde)?.[1],
260
+ ];
261
+ return interpretes.every(i => i === undefined || existsSync(i));
262
+ }
263
+
264
+ // The line of a red run of the package at <dossier> whose pytest <pytest> does not launch: the
265
+ // repair, on the environment of the package at the root.
266
+ function ligneDeReparation(racine, dossier, pytest) {
267
+ const venv = environnementDe(racine, dossier);
268
+ const paquet = path.relative(racine, dossier) || '.';
269
+ return `⛔ ${paquet} : pytest de son environnement absent ou cassé (${pytest}) ; le réparer, dans ${paquet} : \`UV_PROJECT_ENVIRONMENT='${venv}' uv sync --locked --group ${GROUPE} --reinstall\`\n`;
270
+ }
271
+
235
272
  const UV_RUN = ['run', '--locked'];
236
273
  // The code of pytest for « no tests collected », distinct from a failure (1).
237
274
  const AUCUN_TEST = 5;
@@ -259,7 +296,9 @@ function declareXdist(dossier) {
259
296
  function jouerLesTests(p, choix, options) {
260
297
  for (const { c, chemins } of choix) {
261
298
  const cache = path.join(p.racine, CACHE_DE_PYTEST, path.relative(p.racine, c.dossier));
262
- const args = [...UV_RUN, '--group', GROUPE, 'pytest', '-o', `cache_dir=${cache}`];
299
+ // By its path: by its name, uv falls back to the pytest of the PATH.
300
+ const pytest = path.join(environnementDe(p.racine, c.dossier), 'bin', 'pytest');
301
+ const args = [...UV_RUN, '--group', GROUPE, pytest, '-o', `cache_dir=${cache}`];
263
302
  args.push(...p.junit(c.nom, c.dossier));
264
303
  // The workers of the task (GRILLHOUSE_TRAVAILLEURS, which a session and a pass set): `-n` of
265
304
  // pytest-xdist, for a package whose test group declares it; without the variable, one process.
@@ -268,10 +307,14 @@ function jouerLesTests(p, choix, options) {
268
307
  args.push('-n', String(travailleurs));
269
308
  }
270
309
  const entier = chemins.every(ch => ch === '.');
271
- p.jouer(
310
+ const code = p.jouer(
272
311
  p.prevoir(c.nom, c.dossier, 'pytest', true, [...args, ...selection(chemins), ...options]),
273
312
  entier ? [AUCUN_TEST] : []
274
313
  );
314
+ // Read after the run: `uv run` syncs the environment first, which lays a pytest it lacks.
315
+ if (code !== 0 && !p.uvAbsent() && !seLance(pytest)) {
316
+ process.stderr.write(ligneDeReparation(p.racine, c.dossier, pytest));
317
+ }
275
318
  }
276
319
  }
277
320
 
@@ -72,8 +72,9 @@ export default {
72
72
  throw new Error('sortie non prise en charge pour python');
73
73
  },
74
74
  // The reader of TOML of a pyproject.toml, and Turborepo, which plays the tasks of the projects
75
- // (./commandes.mjs).
76
- outils: ['smol-toml', 'turbo'],
75
+ // (./commandes.mjs); jsonc-parser, by which the generator of the graph reads and writes their
76
+ // turbo.json.
77
+ outils: ['jsonc-parser', 'smol-toml', 'turbo'],
77
78
  // The programs the installer of Temporal requires in the PATH of the workers.
78
79
  executables: ['python3'],
79
80
  binaires: JSON.parse(readFileSync(ici('binaires.json'), 'utf8')),
@@ -94,6 +95,8 @@ export default {
94
95
  composantDe: (racine, fichier) => composantDans(composants(racine), racine, fichier),
95
96
  matieres: () => [],
96
97
  joueDesTests,
98
+ // No declaration of a test of Python is read yet: its comments open with `#`.
99
+ lecturesDesTests: () => [],
97
100
  lecteurs,
98
101
  elementsDuLot,
99
102
  // The hashes of the inputs of the tests tasks of the projects and their dependents, as
@@ -15,7 +15,8 @@
15
15
  // grillhouse maj`, which installs it.
16
16
  // - Its files: its pyproject.toml (PEP 621: its name, its version 0.1.0, the Python it requires, no
17
17
  // dependency; its group `test` of `[dependency-groups]`, PEP 735, pytest, which the module runs
18
- // by `uv run --group test pytest`; the configuration of pytest, `[tool.pytest.ini_options]`, its
18
+ // by its path in the environment of the package (./commandes.mjs); the configuration of pytest,
19
+ // `[tool.pytest.ini_options]`, its
19
20
  // tests under `tests/` and its code importable from `src/`, as uv's layout of a library has it);
20
21
  // `src/<module>/__init__.py`, without code; `tests/.gitkeep`, its folder of tests. The typing is
21
22
  // `python -m compileall`, which needs no configuration. No build system: uv neither builds nor
@@ -16,7 +16,7 @@
16
16
  // directory of tests, which the frame does not find in what the test reads nor under the
17
17
  // package's `grillhouse.lit` (`nonDeclares`): a script launched by a path built at run time
18
18
  // (`path.join(SCRIPTS, nom)`). The test writes the path whole (`path.resolve(__dirname,
19
- // '../scripts/verrous/verrou.mjs')`), or its package declares it in its `grillhouse.lit`.
19
+ // '../scripts/verrous/ecriture-hors-enveloppe.mjs')`), or its package declares it in its `grillhouse.lit`.
20
20
  // - The packages are those of the workspace, out of `docs/agents/hors-cadre.txt` (../../paquets.mjs);
21
21
  // a repository without one is its own package. A finding inscribed in the project's debt
22
22
  // (`grillhouse-dette.json`, ../../dette.mjs) passes: those that exist when the guard arrives are
@@ -25,8 +25,8 @@
25
25
  // removed in `afterAll`, and its guard: each run of Vitest plays under a base of its own,
26
26
  // named in TMPDIR, TMP and TEMP, and fails naming what its tests left there
27
27
  // (./vitest-config/base.mjs).
28
- // - The verdict: the summaries of Turborepo and the reports of Vitest of a results directory
29
- // (./verdict.mjs).
28
+ // - The verdict: the summaries of Turborepo and the reports of Vitest of a results directory, and
29
+ // the lines of the log of a runner without a report test by test (./verdict.mjs).
30
30
  // - The rule of a test file, the sibling of HEAD's version of a test file and what the testwriter
31
31
  // writes of the manifests (./regle-des-tests.mjs).
32
32
  // - The generated files, each its command, the guard that checks it and the names its findings
@@ -37,9 +37,10 @@
37
37
  // - The migrations of a project of TypeScript (./migrations/): the base configuration of Vitest,
38
38
  // and the ones that replay a guard of this module, which the update plays with the core's
39
39
  // (scripts/migrations.mjs), as each plugin of Nx carries its own.
40
- // - No binary of the machine (`binaires`); what its tools write in a project, `.turbo`
41
- // (`ignorer`); its share of the update (./mise-a-jour.mjs, `miseAJour`): the tests by Vitest,
42
- // the frame's package declared, the typing, the turbo.json, and the generators.
40
+ // - No binary of the machine (`binaires`); what its tools write in a project, Vitest's reports
41
+ // and the cache of the tools (`ignorer`); its share of the update (./mise-a-jour.mjs,
42
+ // `miseAJour`): the tests by Vitest, the frame's package declared, the typing, the turbo.json,
43
+ // and the generators.
43
44
  // - The skeleton of a new package (./squelette.mjs, `squelette`), which `grillhouse paquet` writes.
44
45
  import { spawnSync } from 'node:child_process';
45
46
  import { mkdtempSync, readFileSync, rmSync } from 'node:fs';
@@ -62,6 +63,7 @@ import { garderLesResumes, lireLesResumes, resumesDuLancement } from './resume-d
62
63
  import { miseAJour } from './mise-a-jour.mjs';
63
64
  import { squelette } from './squelette.mjs';
64
65
  import { estHorsDuJour } from './vitest-config/cibles.mjs';
66
+ import { lecturesDesTests } from './vitest-config/lances.mjs';
65
67
  import { moduleAbsent } from './module-absent.mjs';
66
68
  import * as configVitest from './migrations/0.23.0-config-vitest.mjs';
67
69
  import * as nomsDeclaresInutilises from './migrations/0.24.4-noms-declares-inutilises.mjs';
@@ -218,16 +220,15 @@ export default {
218
220
  // runs and cache (`.turbo`) are the frame's, every language playing by it: IGNORES_DU_CADRE of
219
221
  // scripts/grillhouse-maj.mjs ignores them.
220
222
  ignorer: ['.vitest-reports', '.cache-outils'],
221
- // Where its tools write: the cache of Turborepo in the main tree, shared by every copy, written;
222
- // the logs of Turborepo's tasks (`.turbo/turbo-<task>.log`, written on every run, a task replayed
223
- // from its cache included, and which no option of Turborepo sends elsewhere) and the cache of
224
- // Vite, where Vitest writes the results of a run (`.cache-outils/vite/vitest/`, the `cacheDir` of
225
- // the base configurations: a copy's `node_modules` is a link, so nothing under it is a clean
226
- // output) and whose failure fails it; and the cache of ESLint and Prettier (`.cache-outils/`),
227
- // proper to the session, an empty one costing a whole reading, as without a cache.
223
+ // Where its tools write, Turborepo's outputs being the core's (`sortiesDuLangage` of
224
+ // scripts/enveloppe/enveloppe.mjs): the cache of Vite, where Vitest writes the results of a run
225
+ // (`.cache-outils/vite/vitest/`, the `cacheDir` of the base configurations: a copy's
226
+ // `node_modules` is a link, so nothing under it is a clean output) and whose failure fails it;
227
+ // and the cache of ESLint and Prettier (`.cache-outils/`), proper to the session, an empty one
228
+ // costing a whole reading, as without a cache.
228
229
  sorties: {
229
- ecrites: ['//.turbo/cache/'],
230
- propres: ['.turbo', '.cache-outils'],
230
+ ecrites: [],
231
+ propres: ['.cache-outils'],
231
232
  lues: [],
232
233
  },
233
234
  // The test tool run directly, Vitest or Turborepo that plays it: `npm test` and `npm run
@@ -252,6 +253,7 @@ export default {
252
253
  matieres: racine =>
253
254
  matieres(racine).map(({ nom, dir, paquet }) => ({ nom, dossier: dir, paquet })),
254
255
  joueDesTests,
256
+ lecturesDesTests,
255
257
  lecteurs,
256
258
  elementsDuLot,
257
259
  // The hashes of the inputs of the tests tasks of the packages and their dependents, as
@@ -358,7 +358,7 @@ export const miseAJour = joueDesTests => ({
358
358
  generateurs: [
359
359
  { commande: 'frontieres', args: ['--ecrire'], sortie: '.dependency-cruiser.cjs' },
360
360
  { commande: 'index-interfaces', args: [], sortie: 'docs/agents/index-des-interfaces.md' },
361
- { commande: 'turbo-des-paquets', args: ['--ecrire'], sortie: null },
361
+ { commande: 'turbo-des-paquets', args: ['--ecrire'], sortie: null, importe: ['jsonc-parser'] },
362
362
  ],
363
363
  // No binary of the machine: nothing to install.
364
364
  installation: null,
@@ -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
+ }