@roomi-fields/grillhouse 0.29.0 → 0.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (222) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/CHANGELOG.md +739 -0
  3. package/bin/grillhouse.mjs +79 -18
  4. package/cadre/templates/projet/.github/workflows/ci.yml +2 -13
  5. package/cadre/templates/projet/CLAUDE.md +5 -1
  6. package/cadre/templates/projet/docs/agents/issue-tracker.md +1 -1
  7. package/cadre/templates/projet/package.json +2 -2
  8. package/charte.md +24 -0
  9. package/dist/temporal/acte.d.ts +24 -0
  10. package/dist/temporal/acte.js +139 -0
  11. package/dist/temporal/acte.js.map +1 -0
  12. package/dist/temporal/attributs.d.ts +6 -0
  13. package/dist/temporal/attributs.js +15 -0
  14. package/dist/temporal/attributs.js.map +1 -0
  15. package/dist/temporal/circuit/activites.d.ts +13 -0
  16. package/dist/temporal/circuit/activites.js +33 -0
  17. package/dist/temporal/circuit/activites.js.map +1 -0
  18. package/dist/temporal/circuit/client.d.ts +72 -0
  19. package/dist/temporal/circuit/client.js +247 -0
  20. package/dist/temporal/circuit/client.js.map +1 -0
  21. package/dist/temporal/circuit/commande.d.ts +2 -0
  22. package/dist/temporal/circuit/commande.js +238 -0
  23. package/dist/temporal/circuit/commande.js.map +1 -0
  24. package/dist/temporal/circuit/contrat.d.ts +305 -0
  25. package/dist/temporal/circuit/contrat.js +24 -0
  26. package/dist/temporal/circuit/contrat.js.map +1 -0
  27. package/dist/temporal/circuit/deroule.d.ts +3 -0
  28. package/dist/temporal/circuit/deroule.js +540 -0
  29. package/dist/temporal/circuit/deroule.js.map +1 -0
  30. package/dist/temporal/client.d.ts +47 -0
  31. package/dist/temporal/client.js +69 -0
  32. package/dist/temporal/client.js.map +1 -0
  33. package/dist/temporal/commande.d.ts +2 -0
  34. package/dist/temporal/commande.js +95 -0
  35. package/dist/temporal/commande.js.map +1 -0
  36. package/dist/temporal/deroules.d.ts +5 -0
  37. package/dist/temporal/deroules.js +10 -0
  38. package/dist/temporal/deroules.js.map +1 -0
  39. package/dist/temporal/etat.d.ts +33 -0
  40. package/dist/temporal/etat.js +59 -0
  41. package/dist/temporal/etat.js.map +1 -0
  42. package/dist/temporal/file/activites.d.ts +10 -0
  43. package/dist/temporal/file/activites.js +25 -0
  44. package/dist/temporal/file/activites.js.map +1 -0
  45. package/dist/temporal/file/client.d.ts +4 -0
  46. package/dist/temporal/file/client.js +6 -0
  47. package/dist/temporal/file/client.js.map +1 -0
  48. package/dist/temporal/file/contrat.d.ts +158 -0
  49. package/dist/temporal/file/contrat.js +14 -0
  50. package/dist/temporal/file/contrat.js.map +1 -0
  51. package/dist/temporal/file/deroule.d.ts +15 -0
  52. package/dist/temporal/file/deroule.js +235 -0
  53. package/dist/temporal/file/deroule.js.map +1 -0
  54. package/dist/temporal/installation.d.ts +124 -0
  55. package/dist/temporal/installation.js +408 -0
  56. package/dist/temporal/installation.js.map +1 -0
  57. package/dist/temporal/places/activites.d.ts +8 -0
  58. package/dist/temporal/places/activites.js +13 -0
  59. package/dist/temporal/places/activites.js.map +1 -0
  60. package/dist/temporal/places/client.d.ts +28 -0
  61. package/dist/temporal/places/client.js +64 -0
  62. package/dist/temporal/places/client.js.map +1 -0
  63. package/dist/temporal/places/contrat.d.ts +106 -0
  64. package/dist/temporal/places/contrat.js +21 -0
  65. package/dist/temporal/places/contrat.js.map +1 -0
  66. package/dist/temporal/places/deroule.d.ts +3 -0
  67. package/dist/temporal/places/deroule.js +198 -0
  68. package/dist/temporal/places/deroule.js.map +1 -0
  69. package/dist/temporal/sonde/activites.d.ts +6 -0
  70. package/dist/temporal/sonde/activites.js +52 -0
  71. package/dist/temporal/sonde/activites.js.map +1 -0
  72. package/dist/temporal/sonde/contrat.d.ts +35 -0
  73. package/dist/temporal/sonde/contrat.js +10 -0
  74. package/dist/temporal/sonde/contrat.js.map +1 -0
  75. package/dist/temporal/sonde/deroule.d.ts +3 -0
  76. package/dist/temporal/sonde/deroule.js +39 -0
  77. package/dist/temporal/sonde/deroule.js.map +1 -0
  78. package/dist/temporal/tickets/activites.d.ts +7 -0
  79. package/dist/temporal/tickets/activites.js +81 -0
  80. package/dist/temporal/tickets/activites.js.map +1 -0
  81. package/dist/temporal/tickets/client.d.ts +10 -0
  82. package/dist/temporal/tickets/client.js +31 -0
  83. package/dist/temporal/tickets/client.js.map +1 -0
  84. package/dist/temporal/tickets/contrat.d.ts +56 -0
  85. package/dist/temporal/tickets/contrat.js +13 -0
  86. package/dist/temporal/tickets/contrat.js.map +1 -0
  87. package/dist/temporal/tickets/deroule.d.ts +3 -0
  88. package/dist/temporal/tickets/deroule.js +94 -0
  89. package/dist/temporal/tickets/deroule.js.map +1 -0
  90. package/dist/temporal/travailleur.d.ts +2 -0
  91. package/dist/temporal/travailleur.js +69 -0
  92. package/dist/temporal/travailleur.js.map +1 -0
  93. package/docs/ARCHITECTURE.md +609 -80
  94. package/docs/CADRE.md +17 -0
  95. package/docs/INTERFACE.md +134 -42
  96. package/hooks/crochet.mjs +19 -2
  97. package/hooks/hooks.json +11 -0
  98. package/package.json +16 -4
  99. package/scripts/activites.mjs +2182 -0
  100. package/scripts/aiguillage.d.mts +37 -0
  101. package/scripts/aiguillage.mjs +7 -3
  102. package/scripts/avancement.mjs +128 -16
  103. package/scripts/bilan.mjs +37 -19
  104. package/scripts/cadre.mjs +11 -2
  105. package/scripts/circuit.mjs +881 -4059
  106. package/scripts/circuits-cles.d.mts +4 -0
  107. package/scripts/circuits-cles.mjs +21 -0
  108. package/scripts/circuits-du-serveur.mjs +105 -0
  109. package/scripts/codes-de-sortie.mjs +9 -0
  110. package/scripts/commandes-composees.mjs +45 -41
  111. package/scripts/commandes-du-path.d.mts +7 -0
  112. package/scripts/commandes-du-path.mjs +25 -0
  113. package/scripts/composition-des-langages.mjs +16 -12
  114. package/scripts/conformite.mjs +6 -13
  115. package/scripts/copies-finies.mjs +52 -47
  116. package/scripts/depart-du-ticket.d.mts +53 -0
  117. package/scripts/depart-du-ticket.mjs +124 -0
  118. package/scripts/dependances-internes.mjs +115 -0
  119. package/scripts/dernier-vert.mjs +7 -15
  120. package/scripts/donnees-cles.mjs +228 -0
  121. package/scripts/droits.mjs +11 -1
  122. package/scripts/effets.mjs +352 -0
  123. package/scripts/enveloppe/enveloppe.mjs +119 -8
  124. package/scripts/enveloppe/lancer.sh +14 -18
  125. package/scripts/enveloppe/paquets-du-plan.mjs +2 -2
  126. package/scripts/enveloppe/travail-de-la-copie.mjs +5 -1
  127. package/scripts/etapes.mjs +5 -2
  128. package/scripts/faits-du-circuit.mjs +493 -0
  129. package/scripts/file-des-tickets.d.mts +21 -0
  130. package/scripts/file-des-tickets.mjs +58 -0
  131. package/scripts/flux-des-paquets.mjs +187 -0
  132. package/scripts/gardes-du-cadre.mjs +12 -2
  133. package/scripts/integration/file.mjs +475 -420
  134. package/scripts/integration/integrer.mjs +17 -19
  135. package/scripts/integration/rejeu.mjs +19 -4
  136. package/scripts/jointure.d.ts +145 -27
  137. package/scripts/langages/cargo/commandes.mjs +289 -109
  138. package/scripts/langages/cargo/composants.mjs +130 -34
  139. package/scripts/langages/cargo/exemples.mjs +12 -21
  140. package/scripts/langages/cargo/index.mjs +18 -8
  141. package/scripts/langages/cargo/sccache.mjs +8 -14
  142. package/scripts/langages/python/commandes.mjs +216 -100
  143. package/scripts/langages/python/composants.mjs +53 -21
  144. package/scripts/langages/python/exemples.mjs +6 -16
  145. package/scripts/langages/python/index.mjs +24 -8
  146. package/scripts/langages/python/lot.mjs +1 -36
  147. package/scripts/langages/typescript/construire.mjs +6 -163
  148. package/scripts/langages/typescript/exemples.mjs +3 -11
  149. package/scripts/langages/typescript/frontieres.mjs +1 -1
  150. package/scripts/langages/typescript/index.mjs +43 -61
  151. package/scripts/langages/typescript/interfaces-contre-code.mjs +4 -4
  152. package/scripts/langages/typescript/migrations/0.30.0-prefixe-des-tickets.mjs +63 -0
  153. package/scripts/langages/typescript/migrations/0.30.0-tailles-des-outils-lourds.mjs +31 -0
  154. package/scripts/langages/typescript/migrations/0.30.0-titres-nommant-un-ticket.mjs +40 -0
  155. package/scripts/langages/typescript/mise-a-jour.mjs +1 -2
  156. package/scripts/langages/typescript/tailles-des-tests.mjs +40 -9
  157. package/scripts/langages/typescript/tests-de-nuit.mjs +12 -9
  158. package/scripts/langages/typescript/tests.mjs +17 -8
  159. package/scripts/langages/typescript/titres-de-tests.mjs +297 -0
  160. package/scripts/langages/typescript/turbo-des-paquets.mjs +183 -38
  161. package/scripts/langages/typescript/verdict.mjs +1 -1
  162. package/scripts/langages/typescript/verifier.mjs +31 -11
  163. package/scripts/langages/typescript/vitest-config/base.mjs +22 -1
  164. package/scripts/langages/typescript/vitest-config/bornes.mjs +13 -0
  165. package/scripts/langages/typescript/vitest-config/cibles.mjs +36 -14
  166. package/scripts/langages/typescript/vitest-config/delais.mjs +54 -0
  167. package/scripts/langages/typescript/vitest-config/delais.setup.mjs +11 -0
  168. package/scripts/langages/typescript/vitest-config/duree.classement.mjs +100 -0
  169. package/scripts/langages/typescript/vitest-config/duree.reporter.mjs +49 -63
  170. package/scripts/langages/typescript/vitest-config/machine.setup.mjs +3 -0
  171. package/scripts/langages/typescript/vitest.nuit.config.mjs +4 -0
  172. package/scripts/mesure/pression.mjs +3 -3
  173. package/scripts/mesure-de-la-machine.d.mts +21 -0
  174. package/scripts/mesure-de-la-machine.mjs +76 -0
  175. package/scripts/migrations/0.23.2-copies-du-cadre.mjs +8 -2
  176. package/scripts/migrations/0.30.0-ci-appelle-la-verification.mjs +120 -0
  177. package/scripts/migrations/0.31.0-paquets-dans-le-graphe.mjs +81 -0
  178. package/scripts/migrations.mjs +5 -0
  179. package/scripts/nuit.sh +10 -3
  180. package/scripts/outils-cles.d.mts +24 -0
  181. package/scripts/outils-cles.mjs +0 -1
  182. package/scripts/paquet-npm.mjs +147 -0
  183. package/scripts/paquet.mjs +73 -4
  184. package/scripts/paquets.mjs +34 -6
  185. package/scripts/passe-de-la-machine.mjs +66 -0
  186. package/scripts/places-de-la-machine.mjs +360 -0
  187. package/scripts/places-du-serveur.mjs +170 -0
  188. package/scripts/prefixe-des-tickets.mjs +68 -0
  189. package/scripts/preparation.mjs +10 -3
  190. package/scripts/registre.mjs +3 -2
  191. package/scripts/regles-des-places.d.mts +36 -0
  192. package/scripts/regles-des-places.mjs +70 -0
  193. package/scripts/reponses-du-circuit.d.mts +6 -0
  194. package/scripts/reponses-du-circuit.mjs +28 -0
  195. package/scripts/resultats.mjs +7 -9
  196. package/scripts/retirer-les-copies-finies.mjs +25 -0
  197. package/scripts/sans-reponse.d.mts +4 -0
  198. package/scripts/sans-reponse.mjs +13 -0
  199. package/scripts/seances.mjs +918 -0
  200. package/scripts/services-du-noyau.mjs +26 -8
  201. package/scripts/session-start.sh +2 -2
  202. package/scripts/sortie.mjs +3 -3
  203. package/scripts/sous-commandes.mjs +38 -9
  204. package/scripts/style-a-l-ecriture.mjs +229 -0
  205. package/scripts/superviseur.mjs +122 -111
  206. package/scripts/tableau.mjs +148 -110
  207. package/scripts/taches-du-graphe.mjs +328 -0
  208. package/scripts/ticket-du-circuit.mjs +206 -0
  209. package/scripts/transitions.d.mts +148 -0
  210. package/scripts/transitions.mjs +901 -0
  211. package/scripts/verrou-de-fichier.mjs +2 -2
  212. package/scripts/verrou-de-machine.mjs +28 -13
  213. package/skills/explorateur/SKILL.md +2 -1
  214. package/skills/pitmaster/SKILL.md +17 -18
  215. package/skills/pitmaster/references/consigne-agent.md +5 -1
  216. package/skills/release/SKILL.md +3 -3
  217. package/skills/relecteur/SKILL.md +4 -2
  218. package/skills/testwriter/SKILL.md +36 -24
  219. package/scripts/demon.mjs +0 -251
  220. package/scripts/integration/file-attente.mjs +0 -61
  221. package/scripts/langages/cargo/touches.mjs +0 -93
  222. package/scripts/langages/typescript/script-des-tests.mjs +0 -6
@@ -1,7 +1,7 @@
1
1
  // The components of a workspace of cargo, as cargo itself describes them (`cargo metadata
2
2
  // --format-version 1 --no-deps --offline`): the crates the module cargo answers the join with
3
3
  // (scripts/jointure.d.ts, `composants`, `composantDe`, `matieres`, `joueDesTests`, `lecteurs`,
4
- // `estUnTest`, `soeurDAvant`, `testsDeHead`).
4
+ // `estUnTest`, `arbreDAvant`, `testsDeHead`).
5
5
  //
6
6
  // - A component is a member of the workspace (`workspace_members`): its folder, the manifest's;
7
7
  // its name and its package, the crate's name. A directory without a Cargo.toml at its root holds
@@ -29,12 +29,13 @@
29
29
  // `tests.rs` under `src/`, and any file of a folder `tests/` under `src/`, is a unit test file,
30
30
  // played with its crate when it is Rust; a file of a crate of the shared test material is
31
31
  // material; any other file of a crate (the code of `src/`) is none of them.
32
- // - The sibling of HEAD's version of a test file (`soeurDAvant`), which the proof of the red plays
33
- // beside it: `tests/<nom>_circuit_avant.rs` for a target `tests/<nom>.rs`, a target cargo finds
34
- // by itself, the end `_nuit` or `_budget` kept last; none for `tests/<dossier>/main.rs` nor a
35
- // unit test of `src/`, whose names of tests HEAD's version holds are read without playing them
36
- // (`testsDeHead`, ./tests-de-head.mjs), the proof holding each for a green HEAD holds; those of
37
- // a target `tests/<nom>.rs` too, when its sibling no longer compiles (grillhouse-3e2.2).
32
+ // - HEAD's version of a test file plays in a tree of its own (`arbreDAvant`), never beside the
33
+ // file: a target `tests/<nom>.rs`, a target cargo finds by itself, its tree the copy's with that
34
+ // file replaced, built in the cargo target directory of the copy (`envDArbre`); none for
35
+ // `tests/<dossier>/main.rs` nor a unit test of `src/`, whose names of tests HEAD's version holds
36
+ // are read without playing them (`testsDeHead`, ./tests-de-head.mjs), the proof holding each for
37
+ // a green HEAD holds; those of a target `tests/<nom>.rs` too, when its tree no longer compiles
38
+ // (grillhouse-3e2.2).
38
39
  // - What the testwriter writes of the manifests (`manifestes`): the tables that declare what the
39
40
  // tests of a crate depend on, `[dev-dependencies]` and `[target.<cible>.dev-dependencies]` of
40
41
  // its Cargo.toml (cargo's book, « Development dependencies »), as the author of a test of Bazel
@@ -48,7 +49,7 @@
48
49
  // when a manifest is judged, so that a project of another language, which loads this module
49
50
  // without it, never needs it.
50
51
  import { spawnSync } from 'node:child_process';
51
- import { existsSync, readdirSync, statSync } from 'node:fs';
52
+ import { existsSync, readdirSync, readFileSync, statSync } from 'node:fs';
52
53
  import { createRequire } from 'node:module';
53
54
  import path from 'node:path';
54
55
  import { isDeepStrictEqual } from 'node:util';
@@ -270,16 +271,15 @@ export const DE_NUIT = '_nuit';
270
271
  export const BANC = '_budget';
271
272
 
272
273
  /**
273
- * The sibling of HEAD's version of the test file <chemin> (from the root <racine>), which cargo
274
- * plays in the same run: `tests/<nom>_circuit_avant.rs` beside a test target `tests/<nom>.rs`, a
275
- * target cargo finds by itself (`autotests`), its `mod` of the same folder read as the file's,
276
- * and nextest names its tests as the file's, without the target; the end of a night test or of a
277
- * bench kept, so that the sibling plays as its file does (`tests/<nom>_circuit_avant_budget.rs`
278
- * beside `tests/<nom>_budget.rs`, alone on one thread). Null for any other file: a target
279
- * `tests/<dossier>/main.rs` holds its modules beside it, and a unit test of `src/` is compiled in
280
- * its crate's module.
274
+ * Whether HEAD's version of the test file <chemin> (from the root <racine>) plays in a tree of its
275
+ * own, in the same proof as the lot's: a test target `tests/<nom>.rs`, a target cargo finds by
276
+ * itself (`autotests`), its `mod` of the same folder read as the file's; false for any other
277
+ * file: a target `tests/<dossier>/main.rs` holds its modules beside it, and a unit test of
278
+ * `src/` is compiled in its crate's module (`testsDeHead` reads their names).
279
+ * @param {string} chemin
280
+ * @param {string} racine
281
281
  */
282
- export function soeurDAvant(chemin, racine) {
282
+ export function arbreDAvant(chemin, racine) {
283
283
  const abs = path.resolve(racine, chemin);
284
284
  const c = composantDans(
285
285
  crates(racine).map(x => x.composant),
@@ -287,30 +287,45 @@ export function soeurDAvant(chemin, racine) {
287
287
  abs
288
288
  );
289
289
  const parts = c ? path.relative(c.dossier, abs).split(path.sep) : [];
290
- const cible = parts.length === 2 && parts[0] === 'tests' && parts[1].endsWith('.rs');
291
- if (!cible) {
292
- return null;
293
- }
294
- const base = chemin.slice(0, -'.rs'.length);
295
- const fin = [DE_NUIT, BANC].find(f => base.endsWith(f)) ?? '';
296
- return `${base.slice(0, base.length - fin.length)}_circuit_avant${fin}.rs`;
290
+ return parts.length === 2 && parts[0] === 'tests' && parts[1].endsWith('.rs');
291
+ }
292
+
293
+ /** The variable that names, to the launcher, the copy whose git tracks the `Cargo.lock` of a tree. */
294
+ export const COPIE_DE_L_ARBRE = 'GRILLHOUSE_COPIE_DE_L_ARBRE';
295
+
296
+ /**
297
+ * The environment a tree of HEAD's version plays under: the target directory of the copy's
298
+ * compilations, so that the tree builds there, whatever its place (`cibleDeCompilation`
299
+ * (./sccache.mjs) for a copy in the temporary directory, its `target/` otherwise; the caller's
300
+ * own `CARGO_TARGET_DIR` stays), and the copy itself (`COPIE_DE_L_ARBRE`), where git tracks the
301
+ * `Cargo.lock` the tree, which has no `.git`, carries.
302
+ * @param {string} _chemin
303
+ * @param {string} racine
304
+ * @returns {NodeJS.ProcessEnv}
305
+ */
306
+ export function envDArbre(_chemin, racine) {
307
+ const cible = cibleDeCompilation(racine, process.env, { creer: false });
308
+ return {
309
+ ...(process.env.CARGO_TARGET_DIR || cible.CARGO_TARGET_DIR
310
+ ? cible
311
+ : { CARGO_TARGET_DIR: path.join(racine, 'target') }),
312
+ [COPIE_DE_L_ARBRE]: racine,
313
+ };
297
314
  }
298
315
 
299
316
  /**
300
317
  * The names of the tests of HEAD's version of the test file <chemin> (from the root <racine>),
301
- * read without playing them, for a file cargo cannot play twice in a run and that has no sibling
302
- * (`soeurDAvant`): a unit test file of `src/` (`tests.rs`, a file of a folder `tests/` under
303
- * `src/`, out of `src/bin/`) and a target `tests/<dossier>/main.rs` (./tests-de-head.mjs); with
304
- * <sansSoeur>, a target `tests/<nom>.rs` too, whose sibling the proof does not play because it no
305
- * longer compiles (grillhouse-3e2.2): its names as nextest gives them, without the target, its
306
- * out-of-line modules read (`mod common;`, `common::<fn>`). <lire> gives HEAD's text of a file
307
- * from the root. Null for any other file, or one HEAD does not hold.
318
+ * read without playing them, for a file whose tree the proof does not play: a unit test file of
319
+ * `src/` (`tests.rs`, a file of a folder `tests/` under `src/`, out of `src/bin/`) and a target
320
+ * `tests/<dossier>/main.rs` (./tests-de-head.mjs), and a target `tests/<nom>.rs`, whose tree the
321
+ * proof plays unless it no longer compiles (grillhouse-3e2.2): its names as nextest gives them,
322
+ * without the target, its out-of-line modules read (`mod common;`, `common::<fn>`). <lire> gives
323
+ * HEAD's text of a file from the root. Null for any other file, or one HEAD does not hold.
308
324
  * @param {string} chemin
309
325
  * @param {string} racine
310
326
  * @param {(f: string) => string | null} lire
311
- * @param {{ sansSoeur?: boolean }} [options]
312
327
  */
313
- export function testsDeHead(chemin, racine, lire, { sansSoeur = false } = {}) {
328
+ export function testsDeHead(chemin, racine, lire) {
314
329
  const abs = path.resolve(racine, chemin);
315
330
  const c = composantDans(
316
331
  crates(racine).map(x => x.composant),
@@ -324,7 +339,7 @@ export function testsDeHead(chemin, racine, lire, { sansSoeur = false } = {}) {
324
339
  if (parts.length === 3 && parts[0] === 'tests' && parts[2] === 'main.rs') {
325
340
  return nomsDeHead(chemin, null, lire);
326
341
  }
327
- if (sansSoeur && soeurDAvant(chemin, racine) !== null) {
342
+ if (arbreDAvant(chemin, racine)) {
328
343
  return nomsDeHead(chemin, null, lire);
329
344
  }
330
345
  if (!unitaire(parts) || parts[1] === 'bin') {
@@ -508,3 +523,84 @@ function horsDesTests(chemin, racine, avant, apres) {
508
523
 
509
524
  /** What the testwriter writes of the manifests (scripts/jointure.d.ts, `manifestes`). */
510
525
  export const manifestes = { verrous: ['Cargo.lock'], horsDesTests };
526
+
527
+ /**
528
+ * The name a Cargo.toml <texte> gives its package: the `name` of its `[package]`; null for none.
529
+ * @param {string} texte
530
+ */
531
+ export function nomDuManifeste(texte) {
532
+ let section = null;
533
+ for (const l of texte.split('\n')) {
534
+ const s = /^\s*\[([^\]]+)\]\s*(?:#.*)?$/.exec(l);
535
+ if (s) {
536
+ section = s[1].trim();
537
+ continue;
538
+ }
539
+ const n = /^\s*name\s*=\s*["']([^"']+)["']/.exec(l);
540
+ if (section === 'package' && n) {
541
+ return n[1];
542
+ }
543
+ }
544
+ return null;
545
+ }
546
+
547
+ const TABLES = ['dependencies', 'dev-dependencies', 'build-dependencies'];
548
+
549
+ /**
550
+ * The absolute path of the binary <sortie> of the crate at <chemin> (from the root of the workspace
551
+ * at <racine>): a target of kind `bin` of `cargo metadata`, in its target directory, under
552
+ * `release` or `debug`. Throws, named, for a folder that holds no crate and for a crate without
553
+ * that binary.
554
+ * @param {string} racine
555
+ * @param {string} chemin
556
+ * @param {string} sortie
557
+ * @param {{ release?: boolean }} [o]
558
+ */
559
+ export function sortieDuPaquet(racine, chemin, sortie, { release = false } = {}) {
560
+ const m = metadonnees(racine);
561
+ const crate = m?.packages.find(
562
+ p => path.relative(m.workspace_root, path.dirname(p.manifest_path)) === path.normalize(chemin)
563
+ );
564
+ if (!crate) {
565
+ throw new Error(`${chemin} ne tient aucun crate du dépôt.`);
566
+ }
567
+ const binaires = crate.targets.filter(t => t.kind.includes('bin')).map(t => t.name);
568
+ if (!binaires.includes(sortie)) {
569
+ throw new Error(
570
+ `le crate ${crate.name} ne produit pas de binaire « ${sortie} » (ses binaires : ${binaires.join(', ') || 'aucun'}).`
571
+ );
572
+ }
573
+ return path.join(m.target_directory, release ? 'release' : 'debug', sortie);
574
+ }
575
+
576
+ /**
577
+ * The internal dependencies of the crate at <chemin> (from <racine>): each dependency with a
578
+ * `path` (in `[dependencies]`, `[dev-dependencies]`, `[build-dependencies]` and the same under
579
+ * `[target.*]`; a `workspace = true` one takes the `path` of `[workspace.dependencies]` of the
580
+ * root Cargo.toml), named by <nomA> of the folder at that path, else by its key.
581
+ * @param {string} racine
582
+ * @param {string} chemin
583
+ * @param {(dossier: string) => string | null} nomA
584
+ */
585
+ export function liensDuManifeste(racine, chemin, nomA) {
586
+ const { parse } = require('smol-toml');
587
+ const lire = f => (existsSync(f) ? parse(readFileSync(f, 'utf8')) : null);
588
+ const dossier = path.join(racine, chemin);
589
+ const m = lire(path.join(dossier, 'Cargo.toml')) ?? {};
590
+ const communes = lire(path.join(racine, 'Cargo.toml'))?.workspace?.dependencies ?? {};
591
+ const noms = new Set();
592
+ const tables = [
593
+ ...TABLES.map(t => m[t]),
594
+ ...Object.values(m.target ?? {}).flatMap(c => TABLES.map(t => c?.[t])),
595
+ ];
596
+ for (const table of tables) {
597
+ for (const [cle, spec] of Object.entries(table ?? {})) {
598
+ const commune = spec?.workspace === true;
599
+ const lien = commune ? communes[cle]?.path : spec?.path;
600
+ if (typeof lien === 'string') {
601
+ noms.add(nomA(path.resolve(commune ? racine : dossier, lien)) ?? cle);
602
+ }
603
+ }
604
+ }
605
+ return { noms: [...noms], table: 'path', outil: 'cargo' };
606
+ }
@@ -8,8 +8,7 @@
8
8
  // `ws-outil`, which depends on `ws-app` for its tests (`dev`) and on `ws-core` for its build
9
9
  // script (`build`); `ws-matiere`, the shared test material (`[package.metadata.grillhouse]
10
10
  // matiere = true`); the interfaces of `ws-core`, of `ws-app` and of the root, and the index of the
11
- // interfaces they give, up to date (grillhouse-pkl.6). Committed: `espace`; the same, a source of `ws-core` then changed and a file
12
- // out of every crate added: `change`, measured from its commit; the same with a second commit
11
+ // interfaces they give, up to date (grillhouse-pkl.6). Committed: `espace`; the same with a second commit
13
12
  // that changes `ws-core`, adds the crate `ws-neuf` and removes `ws-outil`: `lot`; the same, the
14
13
  // interface of `ws-core` then changed, its index late: `enRetard`.
15
14
  // - Each workspace commits its Cargo.lock, the one cargo writes (grillhouse-rph): the commands
@@ -124,6 +123,12 @@ function espace(dans) {
124
123
  ecrire('Cargo.lock', verrou(Object.entries(DEPENDANCES)));
125
124
  ecrire('.gitignore', '/target\n');
126
125
  ecrire('README.md', "# L'espace d'essai\n");
126
+ ecrire(
127
+ 'docs/ARCHITECTURE.md',
128
+ `# Architecture\n\n| Composant | Langage |\n| --- | --- |\n${Object.keys(CRATES)
129
+ .map(n => `| \`crates/${n}\` | cargo |\n`)
130
+ .join('')}`
131
+ );
127
132
  for (const [n, m] of Object.entries(CRATES)) {
128
133
  ecrire(`crates/${n}/Cargo.toml`, m);
129
134
  ecrire(`crates/${n}/src/lib.rs`, `pub fn ${n}() -> i32 {\n 1\n}\n`);
@@ -245,13 +250,6 @@ export default {
245
250
  'crates/aide/Cargo.toml': manifeste('aide'),
246
251
  'crates/aide/src/lib.rs': 'pub fn aide() {}\n',
247
252
  });
248
- const change = espace(dans);
249
- const depuis = tete(change);
250
- writeFileSync(
251
- path.join(change, 'crates/core/src/lib.rs'),
252
- 'pub fn core() -> i32 {\n 2\n}\n'
253
- );
254
- writeFileSync(path.join(change, 'notes.txt'), 'hors des crates\n');
255
253
  const lot = espace(dans);
256
254
  const avantLeLot = tete(lot);
257
255
  const ecrireLot = ecrireDans(lot);
@@ -283,8 +281,6 @@ export default {
283
281
  espace: aJour,
284
282
  seul,
285
283
  imbrique,
286
- change,
287
- depuis,
288
284
  lot,
289
285
  avantLeLot,
290
286
  enRetard,
@@ -319,11 +315,6 @@ export default {
319
315
  'ws-absent : sans fournisseur',
320
316
  ],
321
317
  },
322
- touches: {
323
- valide: { racine: aJour, depuis: 'HEAD' },
324
- invalide: { racine: change, depuis },
325
- attendu: ['touché ws-core', 'dépendant ws-app', 'dépendant ws-outil', 'hors notes.txt'],
326
- },
327
318
  commandes: {
328
319
  valide: ['tester', 'verifier', 'typer', 'preparer'],
329
320
  invalide: ['tester', 'deployer'],
@@ -382,12 +373,12 @@ export default {
382
373
  'crates/core/tests/scenario/main.rs',
383
374
  'Cargo.toml',
384
375
  ],
385
- // A night test and a bench keep their end, so that their sibling plays as they do.
376
+ // A target, a night test and a bench play in a tree, under their own name.
386
377
  invalide: [
387
378
  'crates/core/tests/t.rs',
388
379
  'crates/core/tests/t_nuit.rs',
389
380
  'crates/core/tests/t_budget.rs',
390
- // A unit test of `src/` and a target `tests/<dossier>/main.rs` have no sibling: the
381
+ // A unit test of `src/` and a target `tests/<dossier>/main.rs` have no tree: the
391
382
  // names of HEAD's tests are read, as nextest reports them (its module path), the
392
383
  // braces of a comment, a string or a character not counted, a `mod` of main.rs read.
393
384
  {
@@ -403,9 +394,9 @@ export default {
403
394
  },
404
395
  ],
405
396
  attendu: [
406
- 'crates/core/tests/t.rs → crates/core/tests/t_circuit_avant.rs',
407
- 'crates/core/tests/t_nuit.rs → crates/core/tests/t_circuit_avant_nuit.rs',
408
- 'crates/core/tests/t_budget.rs → crates/core/tests/t_circuit_avant_budget.rs',
397
+ 'crates/core/tests/t.rs → un arbre',
398
+ 'crates/core/tests/t_nuit.rs → un arbre',
399
+ 'crates/core/tests/t_budget.rs → un arbre',
409
400
  'crates/core/src/rendu/tests.rs : rendu::tests::ancien, rendu::tests::groupe::interne',
410
401
  'crates/core/tests/scenario/main.rs : principal, m::dedans, aide::aidant',
411
402
  ],
@@ -15,14 +15,14 @@
15
15
  // - The components, a file's, the shared test material, the components that play tests, the
16
16
  // readers of a crate, the rule of a test file and what the testwriter writes of the manifests
17
17
  // (./composants.mjs).
18
- // - The crates touched since a commit and their dependents (./touches.mjs).
19
18
  // - The elements of a lot, one per crate (./elements-du-lot.mjs).
20
- // - The commands `tester`, `verifier`, `typer`, `preparer` and `tests-de-nuit` (./commandes.mjs),
19
+ // - The commands `tester` (the crates' tasks of Turborepo), `tests-du-paquet` (the body of a crate's
20
+ // task), `verifier`, `typer`, `preparer` and `tests-de-nuit` (./commandes.mjs),
21
21
  // each described, `{ script, args }`, never run, `preparer` played by the integration before the
22
22
  // verification, `tests-de-nuit` by the night (the test targets `tests/*_nuit.rs`, then the time
23
23
  // budget benches `tests/*_budget.rs`, which the day leaves out);
24
24
  // the verdict of a run (./verdict.mjs). The tool of a test's temporary directory, the crate
25
- // `tempfile`, and its guard: `tester` and `verifier` play under a base of their pass, named in
25
+ // `tempfile`, and its guard: `tests-du-paquet` and `verifier` play under a base of their pass, named in
26
26
  // TMPDIR, TMP and TEMP, and fail naming what the tests left there (./commandes.mjs).
27
27
  // - The generated file, the index of the interfaces (./index-interfaces.mjs), its command and its
28
28
  // check; the guards of structure, in the order they play: the sizes of the tests
@@ -38,17 +38,21 @@
38
38
  import { readFileSync } from 'node:fs';
39
39
  import path from 'node:path';
40
40
  import { fileURLToPath } from 'node:url';
41
- import { commandes, GARDES } from './commandes.mjs';
41
+ import { commandes, fichierHorsDuJour, GARDES } from './commandes.mjs';
42
42
  import {
43
43
  composantDans,
44
44
  composants,
45
45
  estUnTest,
46
- soeurDAvant,
46
+ arbreDAvant,
47
+ envDArbre,
47
48
  testsDeHead,
48
49
  joueDesTests,
49
50
  lecteurs,
51
+ liensDuManifeste,
50
52
  manifestes,
51
53
  matieres,
54
+ nomDuManifeste,
55
+ sortieDuPaquet,
52
56
  } from './composants.mjs';
53
57
  import { elementsDuLot } from './elements-du-lot.mjs';
54
58
  import { enRetard, entreesDeLIndex, SORTIE } from './index-interfaces.mjs';
@@ -56,7 +60,6 @@ import { miseAJour } from './mise-a-jour.mjs';
56
60
  import * as taillesDesTests from './migrations/0.28.4-tailles-des-tests.mjs';
57
61
  import { squelette } from './squelette.mjs';
58
62
  import { CACHE, CIBLES } from './sccache.mjs';
59
- import { touches } from './touches.mjs';
60
63
  import { verdict } from './verdict.mjs';
61
64
 
62
65
  // The scripts of this module, beside this file.
@@ -65,6 +68,12 @@ const ici = nom => path.join(path.dirname(fileURLToPath(import.meta.url)), nom);
65
68
  export default {
66
69
  nom: 'cargo',
67
70
  manifeste: 'Cargo.toml',
71
+ nomDuManifeste,
72
+ liensDuManifeste,
73
+ sortieDuPaquet,
74
+ construireLesPaquets: () => {
75
+ throw new Error('construction non prise en charge pour cargo');
76
+ },
68
77
  // The reader of TOML by which the lock judges a Cargo.toml (./composants.mjs, `manifestes`).
69
78
  outils: ['smol-toml'],
70
79
  // The binaries the module runs, each at an exact version: nextest and cargo-deny at the ones the
@@ -110,12 +119,13 @@ export default {
110
119
  matieres,
111
120
  joueDesTests,
112
121
  lecteurs,
113
- touches,
114
122
  elementsDuLot,
115
123
  commandes,
116
124
  verdict,
117
125
  estUnTest,
118
- soeurDAvant,
126
+ horsDuJour: fichierHorsDuJour,
127
+ arbreDAvant,
128
+ envDArbre,
119
129
  testsDeHead,
120
130
  manifestes,
121
131
  fichiersEngendres: () => [
@@ -49,11 +49,16 @@
49
49
  // error of cargo that cannot run its wrapper.
50
50
  import { spawnSync } from 'node:child_process';
51
51
  import { createHash } from 'node:crypto';
52
- import { accessSync, constants, readFileSync, readlinkSync, realpathSync } from 'node:fs';
52
+ import { readFileSync, readlinkSync, realpathSync } from 'node:fs';
53
53
  import { createRequire } from 'node:module';
54
54
  import { homedir } from 'node:os';
55
55
  import path from 'node:path';
56
- import { cacheDeCompilation, cacheDeLaRacine, dansLeTemporaire } from '../../services-du-noyau.mjs';
56
+ import {
57
+ cacheDeCompilation,
58
+ cacheDeLaRacine,
59
+ dansLeTemporaire,
60
+ trouverDansLePath,
61
+ } from '../../services-du-noyau.mjs';
57
62
 
58
63
  // The loader of smol-toml, an optional peer of the package, a tool of this module.
59
64
  const require = createRequire(import.meta.url);
@@ -140,18 +145,7 @@ export function sccacheAbsent(racine, env) {
140
145
  if (lanceurDuProjet(racine, env)) {
141
146
  return null;
142
147
  }
143
- const present = (env.PATH ?? '')
144
- .split(path.delimiter)
145
- .filter(Boolean)
146
- .some(d => {
147
- try {
148
- accessSync(path.join(d, 'sccache'), constants.X_OK);
149
- return true;
150
- } catch {
151
- return false;
152
- }
153
- });
154
- return present
148
+ return trouverDansLePath('sccache', env)
155
149
  ? null
156
150
  : "⛔ sccache absent du PATH : cargo compile à travers lui (RUSTC_WRAPPER=sccache) ; `npx grillhouse maj` l'installe avec les autres binaires du module cargo.";
157
151
  }