@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
@@ -0,0 +1,4 @@
1
+ // The types of the reading of the key `grillhouse.circuits` (./circuits-cles.mjs).
2
+
3
+ /** The number of circuits at once (1 when absent), or the fault by its name. */
4
+ export function reglageDesCircuits(pkg: unknown): { max: number | null; faute: string | null };
@@ -0,0 +1,21 @@
1
+ // The reading of the key `grillhouse.circuits` of a package.json (grillhouse-4nr.9, decision D9,
2
+ // the owner's word of 2026-11-04), read as written: an integer of 1 or more, the number of
3
+ // circuits of the project that run at once, which the queue of its tickets
4
+ // (src/temporal/tickets/) holds; absent or null, 1. Any other value is a fault, which the queue
5
+ // names before any work.
6
+
7
+ // Returns { max, faute }: `max` the number of circuits at once, null on a fault; `faute` the
8
+ // fault by its name, null when the key reads.
9
+ export function reglageDesCircuits(pkg) {
10
+ const c = pkg?.grillhouse?.circuits;
11
+ if (c === undefined || c === null) {
12
+ return { max: 1, faute: null };
13
+ }
14
+ if (!Number.isInteger(c) || c < 1) {
15
+ return {
16
+ max: null,
17
+ faute: `grillhouse.circuits vaut ${JSON.stringify(c)}, pas un entier ≥ 1.`,
18
+ };
19
+ }
20
+ return { max: c, faute: null };
21
+ }
@@ -0,0 +1,105 @@
1
+ // The circuits of a repository as the board (scripts/tableau.mjs) and the supervisor
2
+ // (scripts/superviseur.mjs) read them: one call to the Temporal server (src/temporal/circuit/
3
+ // client.ts `lireLesCircuits`, the memo and the status of each workflow, no worker living), as the
4
+ // UI of Temporal lists its workflows, and the progress of the pass under way of each one that runs,
5
+ // read in its working directory (scripts/avancement.mjs `avancementDuTravail`).
6
+ import { existsSync } from 'node:fs';
7
+ import path from 'node:path';
8
+ import { avancementDuTravail } from './avancement.mjs';
9
+ import { sansReponseEn } from './sans-reponse.mjs';
10
+
11
+ /**
12
+ * A circuit as the server gives it (`CircuitLu` of src/temporal/circuit/client.ts) with its
13
+ * progress and the page of its workflow on the web UI of the server (`lien`).
14
+ * @typedef {import('../dist/temporal/circuit/client.js').CircuitLu & { avancement: ReturnType<typeof avancementDuTravail>, lien?: string }} CircuitDuServeur
15
+ */
16
+
17
+ /**
18
+ * The circuits <circuits> of the repository at <racine>, each with the progress of its pass under
19
+ * way while it runs (`avancement`, in `.claude/worktrees/<ticket>.travail`, null without one).
20
+ * @template {{ ticket: string, vivant: boolean }} C
21
+ * @param {string} racine
22
+ * @param {C[]} circuits
23
+ * @returns {(C & { avancement: ReturnType<typeof avancementDuTravail> })[]}
24
+ */
25
+ export const avecLeurAvancement = (racine, circuits) =>
26
+ circuits.map(c => ({
27
+ ...c,
28
+ avancement: c.vivant
29
+ ? avancementDuTravail(path.join(racine, '.claude', 'worktrees', `${c.ticket}.travail`))
30
+ : null,
31
+ }));
32
+
33
+ // The built client of the package (`dist/`), which a fresh clone has unbuilt.
34
+ const CONSTRUIT = path.join(import.meta.dirname, '..', 'dist', 'temporal', 'circuit', 'client.js');
35
+
36
+ /** The client of the circuits is not built: the reading names the command that builds it. */
37
+ export class ClientNonConstruit extends Error {
38
+ constructor() {
39
+ super(
40
+ `le client Temporal n'est pas construit (${CONSTRUIT} n'existe pas) : la construction du paquet le pose, \`npm run build --workspace @roomi-fields/grillhouse\``
41
+ );
42
+ this.name = 'ClientNonConstruit';
43
+ }
44
+ }
45
+
46
+ // How long the reading waits for the server: a guard, far above a reading's few milliseconds, so
47
+ // that a server down keeps neither the board nor the opening of a session waiting (the client's
48
+ // own retries last some twenty seconds).
49
+ export const DELAI_MS = 5_000;
50
+
51
+ /** What a reading that waited DELAI_MS in vain says: « Temporal ne répond pas en 5 s ». */
52
+ export const SANS_REPONSE_EN = sansReponseEn(DELAI_MS);
53
+
54
+ // The gRPC statuses of a server that does not answer in time: none listens (UNAVAILABLE, 14), or
55
+ // none answers within the delay (DEADLINE_EXCEEDED, 4), a server slow under load as a port closed.
56
+ const SANS_REPONSE = new Set([4, 14]);
57
+
58
+ /** The server at <adresse> did not answer the reading of the circuits within DELAI_MS. */
59
+ export class ServeurMuet extends Error {
60
+ /**
61
+ * @param {string} adresse
62
+ * @param {unknown} cause
63
+ */
64
+ constructor(adresse, cause) {
65
+ super(`${SANS_REPONSE_EN} sur ${adresse}`, { cause });
66
+ this.name = 'ServeurMuet';
67
+ this.adresse = adresse;
68
+ }
69
+ }
70
+
71
+ // Whether <e>, an error of the client, says that the server did not answer: its gRPC status, on
72
+ // itself or its cause (a `ServiceError` of the client carries the gRPC error as its cause).
73
+ const sansReponse = e =>
74
+ [e, e?.cause].some(x => typeof x?.code === 'number' && SANS_REPONSE.has(x.code));
75
+
76
+ /**
77
+ * The circuits of the repository at <racine>, read from the Temporal server of the environment in
78
+ * one call, with their progress (`avecLeurAvancement`) and the page of each one's workflow on the
79
+ * web UI of the server (`lienDuTableauWeb`). A server that does not answer within
80
+ * DELAI_MS throws `ServeurMuet`, which its caller tells from a repository without circuits and
81
+ * from any other fault, thrown as it is; a client not built throws `ClientNonConstruit`.
82
+ * @param {string} racine
83
+ */
84
+ export async function circuitsDuServeur(racine) {
85
+ if (!existsSync(CONSTRUIT)) {
86
+ throw new ClientNonConstruit();
87
+ }
88
+ const { lienDuTableauWeb, ouvrirLeClient } = await import('../dist/temporal/client.js');
89
+ const { lireLesCircuits } = await import('../dist/temporal/circuit/client.js');
90
+ const { idDuCircuit } = await import('../dist/temporal/circuit/contrat.js');
91
+ const c = ouvrirLeClient();
92
+ try {
93
+ const lus = await c.client.connection.withDeadline(Date.now() + DELAI_MS, () =>
94
+ lireLesCircuits(c.client, racine)
95
+ );
96
+ return avecLeurAvancement(racine, lus).map(x => ({
97
+ ...x,
98
+ lien: lienDuTableauWeb(c.adresse, c.client.options.namespace, idDuCircuit(racine, x.ticket)),
99
+ }));
100
+ } catch (e) {
101
+ throw sansReponse(e) ? new ServeurMuet(c.adresse, e) : e;
102
+ } finally {
103
+ await c.fermer();
104
+ }
105
+ }
@@ -0,0 +1,9 @@
1
+ // The exit codes the frame's processes share, with no input nor output, as sysexits.h names them:
2
+ // a module a pure module (scripts/etapes.mjs, scripts/transitions.mjs) imports with no reading of
3
+ // the machine.
4
+ //
5
+ // - A_REPASSER, 75, is the exit code of « à repasser » (EX_TEMPFAIL of sysexits.h: try again
6
+ // later), neither green nor red: a measure of time under load (scripts/mesure/pression.mjs), the
7
+ // wait of the lock of the machine at its bound (scripts/verrou-de-machine.mjs), a stop of the
8
+ // circuit that a gesture settles (scripts/etapes.mjs, ARRETS).
9
+ export const A_REPASSER = 75;
@@ -13,25 +13,29 @@
13
13
  // results directory included (`GRILLHOUSE_RESULTATS`), where each module writes under names of
14
14
  // its own. A line on the error stream names each module before it plays, so that what a
15
15
  // command prints on its standard output stays its own.
16
- // - `tester`: an argument that begins with « - » is an option, given to every module; any other is
16
+ // - `tester`, `tests-du-paquet`, `construire` and `typer` (the last three: one package, as the
17
+ // scripts of its package.json call them): an argument that begins with « - » is an option, given to every module; any other is
17
18
  // a path from the root, given to the module of the component that holds it
18
19
  // (`moduleDuFichier`), or out of every component to the first module whose rule of a test file
19
20
  // judges it (`estUnTest`). With paths, the modules that receive none do not play. A path no
20
21
  // module takes is refused, named, and nothing plays (code 2).
21
- // - The last green (scripts/dernier-vert.mjs) is kept once, after the last module: while the
22
- // modules play, a module green defers its own (`VERT_DIFFERE`); when every module played green
23
- // and each deferred one, the first deferred is kept, the state of the repository when the pass
24
- // began. A pass with one module red keeps none, so that the next pass plays its changes again.
22
+ // - The launcher's `construire --echec <fichier> <plan>` is one implementation for every language
23
+ // (scripts/taches-du-graphe.mjs): the first module plays it, once.
24
+ // - No green is kept here, and no module is given one to defer: the last green
25
+ // (scripts/dernier-vert.mjs) is kept by the one pass of the verification, once, when every task
26
+ // of every language of the graph is green (scripts/langages/typescript/verifier.mjs). A module
27
+ // that plays after a red one gets `PASSE_ROUGE` in its environment: that pass keeps none.
28
+ // - `verifier`: the module of package.json passes over the whole graph (every task of every
29
+ // language, once); the others get `GRAPHE_JOUE` and play no task of it again (cargo: its
30
+ // `deny check` alone), so that nextest and pytest play once.
25
31
  // - The exit code: 0 when every module is green, 75 when the only reds are « à repasser », else the
26
32
  // first other code; 128 plus the number of a signal that ended a module.
27
33
  import { spawnSync } from 'node:child_process';
28
- import { mkdtempSync, readFileSync, rmSync } from 'node:fs';
29
- import { constants, tmpdir } from 'node:os';
30
- import path from 'node:path';
34
+ import { constants } from 'node:os';
31
35
  import { fileURLToPath, pathToFileURL } from 'node:url';
32
36
  import { moduleDuFichier } from './composition-des-langages.mjs';
33
- import { garderLeVert, VERT_DIFFERE } from './dernier-vert.mjs';
34
37
  import { langagesDe } from './langages.mjs';
38
+ import { GRAPHE_JOUE, PASSE_ROUGE } from './taches-du-graphe.mjs';
35
39
 
36
40
  /** This script, the one every composed command runs. */
37
41
  export const SCRIPT = fileURLToPath(import.meta.url);
@@ -46,10 +50,19 @@ export const unir = codes =>
46
50
  codes.find(c => c !== 0 && c !== A_REPASSER) ??
47
51
  (codes.some(c => c === A_REPASSER) ? A_REPASSER : 0);
48
52
 
53
+ // The commands whose path arguments go to the module of the component that holds each.
54
+ const PAR_CHEMIN = ['tester', 'tests-du-paquet', 'construire', 'typer'];
55
+
49
56
  // The arguments of each module of <modules> for the command <nom>: `{ parts: [{ module, args }] }`,
50
57
  // or `{ refus }`, the paths no module takes.
51
58
  function repartir(nom, args, modules, racine) {
52
- if (nom !== 'tester') {
59
+ // `construire` and `typer` name a package by its path, as `tester`.
60
+ // The launcher's build is one implementation for every language (scripts/taches-du-graphe.mjs): it
61
+ // plays once, by the first module, not once per module (each would build the same copy again).
62
+ if (nom === 'construire' && args.includes('--echec')) {
63
+ return { parts: modules.slice(0, 1).map(module => ({ module, args })) };
64
+ }
65
+ if (!PAR_CHEMIN.includes(nom)) {
53
66
  return { parts: modules.map(module => ({ module, args })) };
54
67
  }
55
68
  const estChemin = a => !a.startsWith('-');
@@ -109,40 +122,31 @@ export function jouer(
109
122
  }
110
123
  return 2;
111
124
  }
112
- const dossier = mkdtempSync(path.join(tmpdir(), 'grillhouse-vert-differe-'));
113
- const differe = path.join(dossier, 'verts');
114
- try {
115
- const codes = r.parts.map(({ module, args: siens }) => {
116
- const c = module.commandes(racine)[nom];
117
- dire(`▶ ${module.nom} : ${nom}`);
118
- const p = spawnSync(process.execPath, [c.script, ...c.args, ...siens], {
119
- cwd: racine,
120
- stdio: 'inherit',
121
- env: { ...env, [VERT_DIFFERE]: differe },
122
- });
123
- if (p.error) {
124
- process.stderr.write(`⛔ ${module.nom} : ${nom} : ${p.error.message}\n`);
125
- return 1;
126
- }
127
- return p.status ?? 128 + (constants.signals[p.signal ?? 'SIGTERM'] ?? 0);
125
+ // A module that plays after a red one is told so (PASSE_ROUGE): the one pass of the verification
126
+ // keeps no green then.
127
+ const codes = [];
128
+ const duGraphe = r.parts.find(x => x.module.manifeste === 'package.json')?.module;
129
+ for (const { module, args: siens } of r.parts) {
130
+ const c = module.commandes(racine)[nom];
131
+ dire(`▶ ${module.nom} : ${nom}`);
132
+ const rouge = codes.some(x => x !== 0);
133
+ const p = spawnSync(process.execPath, [c.script, ...c.args, ...siens], {
134
+ cwd: racine,
135
+ stdio: 'inherit',
136
+ env: {
137
+ ...env,
138
+ ...(rouge ? { [PASSE_ROUGE]: '1' } : {}),
139
+ ...(nom === 'verifier' && module !== duGraphe && duGraphe ? { [GRAPHE_JOUE]: '1' } : {}),
140
+ },
128
141
  });
129
- const code = unir(codes);
130
- let verts = [];
131
- try {
132
- verts = readFileSync(differe, 'utf8')
133
- .split('\n')
134
- .filter(Boolean)
135
- .map(l => JSON.parse(l));
136
- } catch {
137
- verts = [];
138
- }
139
- if (code === 0 && verts.length > 0 && verts.length === r.parts.length) {
140
- garderLeVert(verts[0], {});
142
+ if (p.error) {
143
+ process.stderr.write(`⛔ ${module.nom} : ${nom} : ${p.error.message}\n`);
144
+ codes.push(1);
145
+ } else {
146
+ codes.push(p.status ?? 128 + (constants.signals[p.signal ?? 'SIGTERM'] ?? 0));
141
147
  }
142
- return code;
143
- } finally {
144
- rmSync(dossier, { recursive: true, force: true });
145
148
  }
149
+ return unir(codes);
146
150
  }
147
151
 
148
152
  if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) {
@@ -0,0 +1,7 @@
1
+ // The types of ./commandes-du-path.mjs, for the frame's TypeScript (src/temporal/installation.ts).
2
+
3
+ /** The path of the command <nom> in the PATH of <env>, or null. */
4
+ export function trouverDansLePath(
5
+ nom: string,
6
+ env?: Record<string, string | undefined>
7
+ ): string | null;
@@ -0,0 +1,25 @@
1
+ // The search of a command in the PATH, as `command -v` finds it: the first folder of PATH that
2
+ // holds an executable file of its name. The one search of the core, which the installation of
3
+ // Temporal (src/temporal/installation.ts), the preparation of a project (./preparation.mjs) and
4
+ // the modules of language (by ./services-du-noyau.mjs) call.
5
+ import { accessSync, constants } from 'node:fs';
6
+ import path from 'node:path';
7
+
8
+ /**
9
+ * The path of the command <nom> in the PATH of <env>, or null.
10
+ * @param {string} nom
11
+ * @param {Record<string, string | undefined>} [env]
12
+ * @returns {string | null}
13
+ */
14
+ export function trouverDansLePath(nom, env = process.env) {
15
+ for (const d of (env.PATH ?? '').split(path.delimiter).filter(Boolean)) {
16
+ const f = path.join(d, nom);
17
+ try {
18
+ accessSync(f, constants.X_OK);
19
+ return f;
20
+ } catch {
21
+ // not in this folder
22
+ }
23
+ }
24
+ return null;
25
+ }
@@ -8,7 +8,7 @@
8
8
  // is refused, named with both languages: a package has one language. A file belongs to the
9
9
  // module of the component that holds it, the deepest (`moduleDuFichier`); a file out of every
10
10
  // component stays the core's, as with one language: the first module, in the order of the
11
- // declaration, whose answer is not null judges it (`estUnTest`, `soeurDAvant`,
11
+ // declaration, whose answer is not null judges it (`estUnTest`, `soeurDAvant`, `arbreDAvant`,
12
12
  // `testsDeHead`, `manifestes.horsDesTests`).
13
13
  // - Whether a component plays tests, the readers of components and the components touched are
14
14
  // each module's on its own components, the results joined: a name without supplier is without
@@ -223,16 +223,6 @@ export function composer(modules) {
223
223
  parLesTests: new Map(parts.flatMap(p => [...p.parLesTests])),
224
224
  };
225
225
  },
226
- touches(racine, o) {
227
- const parts = modules.map(m => m.touches(racine, o));
228
- const touches = parts.flatMap(p => p.touches);
229
- const vus = new Set(touches.map(c => c.dossier));
230
- return {
231
- touches,
232
- dependants: parts.flatMap(p => p.dependants).filter(c => !vus.has(c.dossier)),
233
- horsGraphe: parts[0].horsGraphe.filter(f => parts.every(p => p.horsGraphe.includes(f))),
234
- };
235
- },
236
226
  elementsDuLot(racine, o) {
237
227
  const parts = modules.map(m => ({ m, l: m.elementsDuLot(racine, o) }));
238
228
  const impossibles = parts.filter(p => p.l.etat !== 'fait');
@@ -270,8 +260,22 @@ export function composer(modules) {
270
260
  },
271
261
  estUnTest: (chemin, racine) =>
272
262
  premiereReponse(modules, racine, chemin, m => m.estUnTest(chemin, racine)),
263
+ horsDuJour: (chemin, racine) =>
264
+ Boolean(
265
+ premiereReponse(modules, racine, chemin, m => m.horsDuJour(chemin, racine))
266
+ ),
273
267
  soeurDAvant: (chemin, racine) =>
274
- premiereReponse(modules, racine, chemin, m => m.soeurDAvant(chemin, racine)),
268
+ premiereReponse(modules, racine, chemin, m =>
269
+ typeof m.soeurDAvant === 'function' ? m.soeurDAvant(chemin, racine) : null
270
+ ),
271
+ arbreDAvant: (chemin, racine) =>
272
+ Boolean(
273
+ premiereReponse(modules, racine, chemin, m =>
274
+ typeof m.arbreDAvant === 'function' ? m.arbreDAvant(chemin, racine) : null
275
+ )
276
+ ),
277
+ envDArbre: (chemin, racine) =>
278
+ moduleDuFichier(modules, racine, chemin)?.envDArbre?.(chemin, racine) ?? {},
275
279
  testsDeHead: (chemin, racine, lire, options) =>
276
280
  premiereReponse(modules, racine, chemin, m => m.testsDeHead(chemin, racine, lire, options)),
277
281
  manifestes: {
@@ -17,15 +17,13 @@
17
17
  // - composantDe: each file of the entry lies in the component it names, among `composants`;
18
18
  // - lecteurs: what each component reads of another, by its code, and each name of the entry no
19
19
  // component provides;
20
- // - touches: what changed since the commit of the entry, each component touched, each dependent
21
- // and each file out of the graph;
22
20
  // - commandes: each command named is described (`{ script, args }`, the script a file), and asking
23
21
  // them writes nothing in the repository;
24
22
  // - verdict: each task neither green nor unplayed (« à repasser » at 75, red otherwise), the one
25
23
  // that plays the tests marked, and each test failed;
26
24
  // - estUnTest: each path the testwriter writes, with what it is (`joue`, `test`, `matiere`);
27
- // - versionDeHead (`soeurDAvant`, `testsDeHead`): each path that has a sibling for HEAD's version,
28
- // with it, said when the sibling is the path itself or lies in another folder, and each path
25
+ // - versionDeHead (`soeurDAvant`, `arbreDAvant`, `testsDeHead`): each path whose HEAD's version
26
+ // plays in a tree (`→ un arbre`), and each that has a sibling for it, with it, said when the sibling is the path itself or lies in another folder, and each path
29
27
  // whose names of tests the module reads in HEAD's version (the entry a path, or `{ chemin,
30
28
  // textes }`, HEAD's text of each file by its path), with them, said when it has both; the
31
29
  // entry's expected siblings are names the module's tool plays, of their file's class;
@@ -118,14 +116,6 @@ export function cas(langage, exemples, { dans = tmpdir() } = {}) {
118
116
  ...l.sansFournisseur.map(n => `${n} : sans fournisseur`),
119
117
  ];
120
118
  },
121
- touches: ({ racine, depuis }) => {
122
- const t = langage.touches(racine, { depuis });
123
- return [
124
- ...t.touches.map(c => `touché ${c.nom}`),
125
- ...t.dependants.map(c => `dépendant ${c.nom}`),
126
- ...t.horsGraphe.map(f => `hors ${f}`),
127
- ];
128
- },
129
119
  commandes: noms => {
130
120
  const avant = etat(e.racine);
131
121
  const c = langage.commandes(e.racine);
@@ -162,8 +152,11 @@ export function cas(langage, exemples, { dans = tmpdir() } = {}) {
162
152
  versionDeHead: entrees =>
163
153
  entrees.flatMap(x => {
164
154
  const { chemin, textes = {} } = typeof x === 'string' ? { chemin: x } : x;
165
- const s = langage.soeurDAvant(chemin, e.racine);
155
+ const s = typeof langage.soeurDAvant === 'function' ? langage.soeurDAvant(chemin, e.racine) : null;
156
+ const arbre = typeof langage.arbreDAvant === 'function' && langage.arbreDAvant(chemin, e.racine);
166
157
  const noms = langage.testsDeHead(chemin, e.racine, f => textes[f] ?? null);
158
+ if (s !== null && arbre) return [`${chemin} : une sœur et un arbre`];
159
+ if (arbre) return [`${chemin} → un arbre`];
167
160
  if (s !== null && noms !== null) return [`${chemin} : une sœur et des noms lus`];
168
161
  if (noms !== null) return [`${chemin} : ${noms.join(', ') || 'aucun test'}`];
169
162
  if (s === null) return [];
@@ -4,7 +4,9 @@
4
4
  // CI pipeline (Jenkins « Workspace Cleanup »): no copy outlives the entry of its content on main,
5
5
  // and no target directory its ticket (grillhouse-cyr: 34 GB of target/ under synthhub's copies).
6
6
  //
7
- // node scripts/copies-finies.mjs [<copie finie de jouer>…] from the main tree of the repository
7
+ // Its command is ./retirer-les-copies-finies.mjs, which reads the circuits that run on the Temporal
8
+ // server; this module imports nothing of the built `dist/`, since the lock of the machine and the
9
+ // base configuration of the tests import it.
8
10
  //
9
11
  // - The night's copy (`.claude/worktrees/nuit`) is always left out: the night prepares and
10
12
  // removes its own.
@@ -26,18 +28,21 @@
26
28
  // progress (the copy's folder bears the ticket's id, `.claude/worktrees/<ticket>`, as the
27
29
  // circuit and the launcher name it; read by `bd list --status in_progress`), the working
28
30
  // directory of its circuit (`<copie>.travail`, which lives as long as the ticket,
29
- // scripts/circuit.mjs), or, for the integration copy and the queue copy
30
- // (`.claude/worktrees/integration`, `.claude/worktrees/file`), their lock in git's common
31
- // directory (`integration.lock`, `file-integration.lock`, scripts/integration/). Tickets in
31
+ // scripts/circuit.mjs), or, for the integration copy (`.claude/worktrees/integration`), its
32
+ // lock in git's common directory (`integration.lock`, scripts/integration/integrer.mjs). The
33
+ // queue copy (`.claude/worktrees/file`) always stays: the workflow of the queue plays in it
34
+ // without a lock, one entry at a time, and prepares it again before each replay. Tickets in
32
35
  // progress that do not read, or not within a minute, hold every copy: none is removed. They are
33
36
  // read only when a copy is left to judge: a repository with no copy but the night's calls no bd.
34
37
  // A locked copy (`git worktree lock`, as Claude Code locks the copy of a live agent) stays too.
35
- // A copy whose circuit no longer runs (its `<copie>.travail` there, the state
36
- // `<copie>.circuit.json` naming a process gone, `leMemeVivant`), its ticket still open, stays,
37
- // its code and commits untouched, and its line says so with the place it holds and that of each
38
- // of its tools' outputs (« son circuit ne tourne plus (son processus 4242 est parti) ; target y
39
- // tient 5,1 Go ; son code et ses commits restent »): 5.2 GB of SyntHub's SH-cgi.8.2 were kept
40
- // so under the words of a running circuit (grillhouse-k5y).
38
+ // A copy whose circuit no longer runs (its `<copie>.travail` there, its ticket out of the
39
+ // circuits the Temporal server runs, which its caller gives, `vivants`), its ticket still open,
40
+ // stays, its code and commits untouched, and its line says so with the place it holds and that
41
+ // of each of its tools' outputs (« son circuit ne tourne plus ; target y tient 5,1 Go ; son code
42
+ // et ses commits restent »): 5.2 GB of SyntHub's SH-cgi.8.2 were kept so under the words of a
43
+ // running circuit (grillhouse-k5y). Without the circuits that run (the server unread, or the end
44
+ // of a circuit, whose act reads no server), its line says only that its circuit has its
45
+ // working directory.
41
46
  // - The count of what holds the disk of a copy (`occupantsDesCopies`), which the wait for room of
42
47
  // a heavy pass names (scripts/verrou-de-machine.mjs): the copies of its repository, the five
43
48
  // largest first, each with its ticket (the copy's folder, but the frame's copies that last and
@@ -72,17 +77,18 @@
72
77
  // output, which the night adds to its log. The exit is
73
78
  // 0 whatever is removed or kept: the removal never changes the night's verdict.
74
79
  import { spawnSync } from 'node:child_process';
75
- import { existsSync, lstatSync, readFileSync, realpathSync, rmSync } from 'node:fs';
80
+ import { existsSync, lstatSync, realpathSync, rmSync } from 'node:fs';
76
81
  import path from 'node:path';
77
- import { pathToFileURL } from 'node:url';
78
82
  import { PILOTE } from './fusion-du-changelog.mjs';
79
83
  import { langageDe } from './langages.mjs';
80
- import { balayerLesTickets, leMemeVivant } from './mesure/base-de-passe.mjs';
84
+ import { balayerLesTickets } from './mesure/base-de-passe.mjs';
81
85
 
82
86
  const RETIRER = path.join(import.meta.dirname, 'retirer-copie.sh');
83
87
  const PRINCIPALE = 'main';
84
88
  // The copies of the integration and of the queue, each held while its lock stands.
85
- const VERROUS = { integration: 'integration.lock', file: 'file-integration.lock' };
89
+ const VERROUS = { integration: 'integration.lock' };
90
+ // The queue copy, which the workflow of the queue holds without a lock (src/temporal/file/).
91
+ const DE_LA_FILE = 'file';
86
92
  // The install of a copy: a link to the main tree's, or its own directory.
87
93
  const INSTALLATION = 'node_modules';
88
94
  // The folder of the copies of a repository, from its main tree.
@@ -92,7 +98,7 @@ const NUIT = path.join(COPIES, 'nuit');
92
98
  // The frame's copies that last, each prepared again before its pass, every untracked file removed
93
99
  // (`git clean -x`, scripts/nuit.sh and scripts/integration/rejeu.mjs): the night's, the
94
100
  // integration's, the queue's. Their folder bears no ticket.
95
- const DURABLES = new Set(['nuit', ...Object.keys(VERROUS)]);
101
+ const DURABLES = new Set(['nuit', DE_LA_FILE, ...Object.keys(VERROUS)]);
96
102
 
97
103
  const lancer = (dossier, cmd, args) =>
98
104
  spawnSync(cmd, args, { cwd: dossier, encoding: 'utf8', maxBuffer: 64 * 1024 * 1024 });
@@ -121,25 +127,16 @@ function lesCopies(racine) {
121
127
  }));
122
128
  }
123
129
 
124
- const lireJson = f => {
125
- try {
126
- return JSON.parse(readFileSync(f, 'utf8'));
127
- } catch {
128
- return null;
129
- }
130
- };
131
-
132
130
  // What holds the copy <chemin> for a running circuit or a live process (its lock), or null. A
133
- // copy whose circuit no longer runs (the state `<copie>.circuit.json` beside its `.travail` names
134
- // a process gone, scripts/circuit.mjs) stays held, and its line names the place its tools'
135
- // outputs (<ignorer>) hold there.
136
- function tenue({ chemin, verrou: raison }, enCours, commun, ignorer) {
131
+ // copy whose circuit no longer runs (its ticket out of <vivants>, the tickets whose circuit the
132
+ // server runs, null when unread) stays held beside its `.travail`, and its line names the place
133
+ // its tools' outputs (<ignorer>) hold there.
134
+ function tenue({ chemin, verrou: raison }, enCours, commun, ignorer, vivants) {
137
135
  const nom = path.basename(chemin);
138
136
  if (existsSync(`${chemin}.travail`)) {
139
- const etat = lireJson(`${chemin}.circuit.json`);
140
- if (etat && !leMemeVivant(etat.processus, etat.depart)) {
137
+ if (vivants && !vivants.has(nom)) {
141
138
  const sorties = placeDesSorties(chemin, ignorer).map(s => ` ; ${s}`);
142
- return `son circuit ne tourne plus (son processus ${etat.processus} est parti)${sorties.join('')} ; son code et ses commits restent`;
139
+ return `son circuit ne tourne plus${sorties.join('')} ; son code et ses commits restent`;
143
140
  }
144
141
  return `son circuit a son dossier ${nom}.travail`;
145
142
  }
@@ -150,8 +147,11 @@ function tenue({ chemin, verrou: raison }, enCours, commun, ignorer) {
150
147
  return `elle est verrouillée${raison ? ` (${raison})` : ''}`;
151
148
  }
152
149
  const verrou = VERROUS[nom];
153
- if (verrou && path.dirname(chemin).endsWith(path.join('.claude', 'worktrees'))) {
154
- if (existsSync(path.join(commun, verrou))) {
150
+ if (path.dirname(chemin).endsWith(path.join('.claude', 'worktrees'))) {
151
+ if (nom === DE_LA_FILE) {
152
+ return 'la file y rejoue ses entrées';
153
+ }
154
+ if (verrou && existsSync(path.join(commun, verrou))) {
155
155
  return `le verrou ${verrou} est posé`;
156
156
  }
157
157
  }
@@ -335,11 +335,17 @@ function elaguer(chemin, ignorer) {
335
335
  * wrote there (<ignorer>, the directories the module of the language names, and `node_modules`).
336
336
  * <elaguer> names copies left out too, whose owner has played its pass (the night's own): each
337
337
  * loses its tools' outputs, its install kept; so does a copy of the integration or of the queue
338
- * kept that no lock holds.
338
+ * kept that no lock holds. <vivants> names the tickets whose circuit the Temporal server runs
339
+ * (null when its caller does not read them): a copy beside its `.travail` whose ticket is out of
340
+ * them stays, its line saying its circuit no longer runs, with the place of its tools' outputs.
341
+ * @param {string} racine
342
+ * @param {{ garder?: string[], elaguer?: string[], lireEnCours: () => Set<string> | null,
343
+ * lireFermes: () => Set<string> | null, ignorer: string[], vivants?: Set<string> | null }} o
344
+ * @returns {string[]}
339
345
  */
340
346
  export function retirerLesCopiesFinies(
341
347
  racine,
342
- { garder = [], elaguer: aElaguer = [], lireEnCours, lireFermes, ignorer }
348
+ { garder = [], elaguer: aElaguer = [], lireEnCours, lireFermes, ignorer, vivants = null }
343
349
  ) {
344
350
  const [principale, ...listees] = lesCopies(racine);
345
351
  const ici = reel(racine);
@@ -379,7 +385,10 @@ export function retirerLesCopiesFinies(
379
385
  // preparation removes; then the place it holds.
380
386
  const gardee = (chemin, raison) => {
381
387
  const nom = path.basename(chemin);
382
- if (Object.hasOwn(VERROUS, nom) && path.dirname(chemin).endsWith(COPIES)) {
388
+ if (
389
+ (Object.hasOwn(VERROUS, nom) || nom === DE_LA_FILE) &&
390
+ path.dirname(chemin).endsWith(COPIES)
391
+ ) {
383
392
  const retirees = elaguer(chemin, ignorer);
384
393
  const perte = retirees.length
385
394
  ? ` ; sa prochaine préparation l'efface : ${retirees.join(', ')}`
@@ -396,7 +405,7 @@ export function retirerLesCopiesFinies(
396
405
  if (ecartees.has(reel(chemin))) {
397
406
  continue;
398
407
  }
399
- const raison = tenue(copie, enCours, commun, ignorer);
408
+ const raison = tenue(copie, enCours, commun, ignorer, vivants);
400
409
  if (raison) {
401
410
  lignes.push(`· copie gardée : ${vu(chemin)} (${place(chemin)}) : ${raison}.`);
402
411
  continue;
@@ -470,15 +479,18 @@ function ignoresDuLangage(racine) {
470
479
  /**
471
480
  * The removal of the copies of the repository at <racine> (`retirerLesCopiesFinies`), the copy of
472
481
  * the night left out, the copies <finies> left out and pruned, their owner having played its pass
473
- * in them (the night's own, which scripts/nuit.sh names), the tickets read by bd, then of the
474
- * temporary directories of its closed tickets (`balayerLesTickets`): what the night and the end
475
- * of each circuit (scripts/circuit.mjs) run. Its lines.
482
+ * in them (the night's own, which scripts/nuit.sh names), the tickets read by bd, the tickets
483
+ * whose circuit runs <vivants> (null when unread), then of the temporary directories of its closed
484
+ * tickets (`balayerLesTickets`): what the night and the end of each circuit (scripts/circuit.mjs)
485
+ * run. Its lines.
476
486
  * @param {string} racine the main tree
477
487
  * @param {string[]} [finies]
488
+ * @param {Set<string> | null} [vivants]
478
489
  * @returns {string[]}
479
490
  */
480
- export function retirerLesCopiesDuDepot(racine, finies = []) {
491
+ export function retirerLesCopiesDuDepot(racine, finies = [], vivants = null) {
481
492
  const lignes = retirerLesCopiesFinies(racine, {
493
+ vivants,
482
494
  garder: [path.join(racine, NUIT)],
483
495
  elaguer: finies,
484
496
  lireEnCours: () => tickets(racine, 'in_progress'),
@@ -488,10 +500,3 @@ export function retirerLesCopiesDuDepot(racine, finies = []) {
488
500
  const retires = balayerLesTickets(() => tickets(racine, 'closed'));
489
501
  return [...lignes, ...retires.map(t => `✓ dossier temporaire du ticket ${t} retiré.`)];
490
502
  }
491
-
492
- if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
493
- const lignes = retirerLesCopiesDuDepot(process.cwd(), process.argv.slice(2));
494
- if (lignes.length) {
495
- process.stdout.write(`${lignes.join('\n')}\n`);
496
- }
497
- }