@roomi-fields/grillhouse 0.28.3 → 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.
- package/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +739 -0
- package/bin/grillhouse.mjs +128 -26
- package/cadre/templates/projet/.github/workflows/ci.yml +2 -13
- package/cadre/templates/projet/CLAUDE.md +5 -1
- package/cadre/templates/projet/README.md +11 -11
- package/cadre/templates/projet/_gitignore +2 -5
- package/cadre/templates/projet/docs/agents/issue-tracker.md +1 -1
- package/cadre/templates/projet/package.json +2 -2
- package/charte.md +37 -4
- package/dist/temporal/acte.d.ts +24 -0
- package/dist/temporal/acte.js +139 -0
- package/dist/temporal/acte.js.map +1 -0
- package/dist/temporal/attributs.d.ts +6 -0
- package/dist/temporal/attributs.js +15 -0
- package/dist/temporal/attributs.js.map +1 -0
- package/dist/temporal/circuit/activites.d.ts +13 -0
- package/dist/temporal/circuit/activites.js +33 -0
- package/dist/temporal/circuit/activites.js.map +1 -0
- package/dist/temporal/circuit/client.d.ts +72 -0
- package/dist/temporal/circuit/client.js +247 -0
- package/dist/temporal/circuit/client.js.map +1 -0
- package/dist/temporal/circuit/commande.d.ts +2 -0
- package/dist/temporal/circuit/commande.js +238 -0
- package/dist/temporal/circuit/commande.js.map +1 -0
- package/dist/temporal/circuit/contrat.d.ts +305 -0
- package/dist/temporal/circuit/contrat.js +24 -0
- package/dist/temporal/circuit/contrat.js.map +1 -0
- package/dist/temporal/circuit/deroule.d.ts +3 -0
- package/dist/temporal/circuit/deroule.js +540 -0
- package/dist/temporal/circuit/deroule.js.map +1 -0
- package/dist/temporal/client.d.ts +47 -0
- package/dist/temporal/client.js +69 -0
- package/dist/temporal/client.js.map +1 -0
- package/dist/temporal/commande.d.ts +2 -0
- package/dist/temporal/commande.js +95 -0
- package/dist/temporal/commande.js.map +1 -0
- package/dist/temporal/deroules.d.ts +5 -0
- package/dist/temporal/deroules.js +10 -0
- package/dist/temporal/deroules.js.map +1 -0
- package/dist/temporal/etat.d.ts +33 -0
- package/dist/temporal/etat.js +59 -0
- package/dist/temporal/etat.js.map +1 -0
- package/dist/temporal/file/activites.d.ts +10 -0
- package/dist/temporal/file/activites.js +25 -0
- package/dist/temporal/file/activites.js.map +1 -0
- package/dist/temporal/file/client.d.ts +4 -0
- package/dist/temporal/file/client.js +6 -0
- package/dist/temporal/file/client.js.map +1 -0
- package/dist/temporal/file/contrat.d.ts +158 -0
- package/dist/temporal/file/contrat.js +14 -0
- package/dist/temporal/file/contrat.js.map +1 -0
- package/dist/temporal/file/deroule.d.ts +15 -0
- package/dist/temporal/file/deroule.js +235 -0
- package/dist/temporal/file/deroule.js.map +1 -0
- package/dist/temporal/installation.d.ts +124 -0
- package/dist/temporal/installation.js +408 -0
- package/dist/temporal/installation.js.map +1 -0
- package/dist/temporal/places/activites.d.ts +8 -0
- package/dist/temporal/places/activites.js +13 -0
- package/dist/temporal/places/activites.js.map +1 -0
- package/dist/temporal/places/client.d.ts +28 -0
- package/dist/temporal/places/client.js +64 -0
- package/dist/temporal/places/client.js.map +1 -0
- package/dist/temporal/places/contrat.d.ts +106 -0
- package/dist/temporal/places/contrat.js +21 -0
- package/dist/temporal/places/contrat.js.map +1 -0
- package/dist/temporal/places/deroule.d.ts +3 -0
- package/dist/temporal/places/deroule.js +198 -0
- package/dist/temporal/places/deroule.js.map +1 -0
- package/dist/temporal/sonde/activites.d.ts +6 -0
- package/dist/temporal/sonde/activites.js +52 -0
- package/dist/temporal/sonde/activites.js.map +1 -0
- package/dist/temporal/sonde/contrat.d.ts +35 -0
- package/dist/temporal/sonde/contrat.js +10 -0
- package/dist/temporal/sonde/contrat.js.map +1 -0
- package/dist/temporal/sonde/deroule.d.ts +3 -0
- package/dist/temporal/sonde/deroule.js +39 -0
- package/dist/temporal/sonde/deroule.js.map +1 -0
- package/dist/temporal/tickets/activites.d.ts +7 -0
- package/dist/temporal/tickets/activites.js +81 -0
- package/dist/temporal/tickets/activites.js.map +1 -0
- package/dist/temporal/tickets/client.d.ts +10 -0
- package/dist/temporal/tickets/client.js +31 -0
- package/dist/temporal/tickets/client.js.map +1 -0
- package/dist/temporal/tickets/contrat.d.ts +56 -0
- package/dist/temporal/tickets/contrat.js +13 -0
- package/dist/temporal/tickets/contrat.js.map +1 -0
- package/dist/temporal/tickets/deroule.d.ts +3 -0
- package/dist/temporal/tickets/deroule.js +94 -0
- package/dist/temporal/tickets/deroule.js.map +1 -0
- package/dist/temporal/travailleur.d.ts +2 -0
- package/dist/temporal/travailleur.js +69 -0
- package/dist/temporal/travailleur.js.map +1 -0
- package/docs/ARCHITECTURE.md +813 -53
- package/docs/CADRE.md +17 -0
- package/docs/INTERFACE.md +161 -30
- package/hooks/crochet.mjs +19 -2
- package/hooks/hooks.json +11 -0
- package/package.json +16 -4
- package/scripts/activites.mjs +2182 -0
- package/scripts/aiguillage.d.mts +37 -0
- package/scripts/aiguillage.mjs +328 -0
- package/scripts/avancement.mjs +159 -64
- package/scripts/bilan.mjs +37 -19
- package/scripts/cadre.mjs +11 -2
- package/scripts/circuit.mjs +888 -3654
- package/scripts/circuits-cles.d.mts +4 -0
- package/scripts/circuits-cles.mjs +21 -0
- package/scripts/circuits-du-serveur.mjs +105 -0
- package/scripts/codes-de-sortie.mjs +9 -0
- package/scripts/commandes-composees.mjs +45 -41
- package/scripts/commandes-du-path.d.mts +7 -0
- package/scripts/commandes-du-path.mjs +25 -0
- package/scripts/composition-des-langages.mjs +30 -11
- package/scripts/conformite.mjs +19 -10
- package/scripts/copies-finies.mjs +188 -42
- package/scripts/depart-du-ticket.d.mts +53 -0
- package/scripts/depart-du-ticket.mjs +124 -0
- package/scripts/dependances-internes.mjs +115 -0
- package/scripts/dernier-vert.mjs +7 -15
- package/scripts/donnees-cles.mjs +228 -0
- package/scripts/droits.mjs +11 -1
- package/scripts/effets.mjs +352 -0
- package/scripts/enveloppe/enveloppe.mjs +119 -8
- package/scripts/enveloppe/lancer.sh +27 -32
- package/scripts/enveloppe/paquets-du-plan.mjs +2 -2
- package/scripts/enveloppe/travail-de-la-copie.mjs +99 -12
- package/scripts/etapes.mjs +6 -3
- package/scripts/faits-du-circuit.mjs +493 -0
- package/scripts/file-des-tickets.d.mts +21 -0
- package/scripts/file-des-tickets.mjs +58 -0
- package/scripts/flux-des-paquets.mjs +187 -0
- package/scripts/fusion-du-changelog.mjs +0 -1
- package/scripts/gardes-du-cadre.mjs +12 -2
- package/scripts/grillhouse-maj.mjs +16 -7
- package/scripts/integration/file.mjs +477 -422
- package/scripts/integration/integrer.mjs +20 -22
- package/scripts/integration/rejeu.mjs +19 -4
- package/scripts/jointure.d.ts +168 -28
- package/scripts/langages/cargo/commandes.mjs +426 -119
- package/scripts/langages/cargo/composants.mjs +187 -3
- package/scripts/langages/cargo/exemples.mjs +75 -17
- package/scripts/langages/cargo/index.mjs +32 -13
- package/scripts/langages/cargo/migrations/0.28.4-tailles-des-tests.mjs +35 -0
- package/scripts/langages/cargo/sccache.mjs +62 -16
- package/scripts/langages/cargo/squelette.mjs +72 -3
- package/scripts/langages/cargo/tailles-des-tests.mjs +195 -0
- package/scripts/langages/cargo/tests-de-head.mjs +159 -0
- package/scripts/langages/python/commandes.mjs +232 -79
- package/scripts/langages/python/composants.mjs +65 -3
- package/scripts/langages/python/exemples.mjs +21 -12
- package/scripts/langages/python/index.mjs +25 -5
- package/scripts/langages/python/lot.mjs +1 -36
- package/scripts/langages/python/squelette.mjs +119 -17
- package/scripts/langages/typescript/construire.mjs +6 -163
- package/scripts/langages/typescript/exemples.mjs +19 -11
- package/scripts/langages/typescript/frontieres.mjs +1 -1
- package/scripts/langages/typescript/index.mjs +48 -63
- package/scripts/langages/typescript/interfaces-contre-code.mjs +4 -4
- package/scripts/langages/typescript/migrations/0.30.0-prefixe-des-tickets.mjs +63 -0
- package/scripts/langages/typescript/migrations/0.30.0-tailles-des-outils-lourds.mjs +31 -0
- package/scripts/langages/typescript/migrations/0.30.0-titres-nommant-un-ticket.mjs +40 -0
- package/scripts/langages/typescript/mise-a-jour.mjs +1 -2
- package/scripts/langages/typescript/regle-des-tests.mjs +13 -0
- package/scripts/langages/typescript/squelette.mjs +18 -2
- package/scripts/langages/typescript/tailles-des-tests.mjs +40 -9
- package/scripts/langages/typescript/tests-de-nuit.mjs +44 -21
- package/scripts/langages/typescript/tests.mjs +17 -8
- package/scripts/langages/typescript/titres-de-tests.mjs +297 -0
- package/scripts/langages/typescript/turbo-des-paquets.mjs +183 -38
- package/scripts/langages/typescript/verdict.mjs +1 -1
- package/scripts/langages/typescript/verifier.mjs +110 -296
- package/scripts/langages/typescript/vitest-config/base.mjs +30 -10
- package/scripts/langages/typescript/vitest-config/bornes.mjs +13 -0
- package/scripts/langages/typescript/vitest-config/cibles.mjs +123 -62
- package/scripts/langages/typescript/vitest-config/delais.mjs +54 -0
- package/scripts/langages/typescript/vitest-config/delais.setup.mjs +11 -0
- package/scripts/langages/typescript/vitest-config/duree.classement.mjs +100 -0
- package/scripts/langages/typescript/vitest-config/duree.reporter.mjs +56 -64
- package/scripts/langages/typescript/vitest-config/machine.setup.mjs +7 -2
- package/scripts/langages/typescript/vitest-config/mesure.mjs +3 -2
- package/scripts/langages/typescript/vitest.nuit.config.mjs +22 -13
- package/scripts/lecture-unique.mjs +51 -0
- package/scripts/mesure/pression.mjs +11 -9
- package/scripts/mesure-de-la-machine.d.mts +21 -0
- package/scripts/mesure-de-la-machine.mjs +76 -0
- package/scripts/migrations/0.23.2-copies-du-cadre.mjs +8 -2
- package/scripts/migrations/0.30.0-ci-appelle-la-verification.mjs +120 -0
- package/scripts/migrations/0.31.0-paquets-dans-le-graphe.mjs +81 -0
- package/scripts/migrations.mjs +5 -0
- package/scripts/nuit.sh +29 -15
- package/scripts/outil.mjs +72 -0
- package/scripts/outils-cles.d.mts +24 -0
- package/scripts/outils-cles.mjs +0 -1
- package/scripts/paquet-npm.mjs +147 -0
- package/scripts/paquet.mjs +112 -14
- package/scripts/paquets.mjs +34 -6
- package/scripts/passe-de-la-machine.mjs +66 -0
- package/scripts/places-de-la-machine.mjs +360 -0
- package/scripts/places-du-serveur.mjs +170 -0
- package/scripts/prefixe-des-tickets.mjs +68 -0
- package/scripts/preparation.mjs +10 -3
- package/scripts/registre.mjs +3 -2
- package/scripts/regles-des-places.d.mts +36 -0
- package/scripts/regles-des-places.mjs +70 -0
- package/scripts/reponses-du-circuit.d.mts +6 -0
- package/scripts/reponses-du-circuit.mjs +28 -0
- package/scripts/resultats.mjs +29 -14
- package/scripts/retirer-les-copies-finies.mjs +25 -0
- package/scripts/sans-reponse.d.mts +4 -0
- package/scripts/sans-reponse.mjs +13 -0
- package/scripts/seances.mjs +918 -0
- package/scripts/services-du-noyau.mjs +28 -11
- package/scripts/session-start.sh +10 -1
- package/scripts/sortie.mjs +23 -4
- package/scripts/sources.mjs +3 -3
- package/scripts/sous-commandes.mjs +39 -9
- package/scripts/style-a-l-ecriture.mjs +229 -0
- package/scripts/superviseur.mjs +382 -16
- package/scripts/tableau.mjs +329 -130
- package/scripts/taches-du-graphe.mjs +328 -0
- package/scripts/ticket-du-circuit.mjs +206 -0
- package/scripts/transitions.d.mts +148 -0
- package/scripts/transitions.mjs +901 -0
- package/scripts/verrou-de-fichier.mjs +2 -2
- package/scripts/verrou-de-machine.mjs +322 -62
- package/skills/developpeur/SKILL.md +11 -3
- package/skills/explorateur/SKILL.md +2 -1
- package/skills/pitmaster/SKILL.md +62 -28
- package/skills/pitmaster/references/consigne-agent.md +5 -1
- package/skills/release/SKILL.md +3 -3
- package/skills/relecteur/SKILL.md +22 -8
- package/skills/testwriter/SKILL.md +47 -39
- package/scripts/demon.mjs +0 -138
- package/scripts/integration/file-attente.mjs +0 -61
- package/scripts/langages/cargo/touches.mjs +0 -93
- package/scripts/langages/typescript/script-des-tests.mjs +0 -6
package/bin/grillhouse.mjs
CHANGED
|
@@ -20,6 +20,19 @@
|
|
|
20
20
|
// main tree, `environnementDe` of scripts/sous-commandes.mjs), each variable set to its path,
|
|
21
21
|
// whatever the caller's environment; a faulty key is refused by its name on the error stream,
|
|
22
22
|
// nothing run, and the exit code is 2.
|
|
23
|
+
// - In a project whose package.json names its published version (`grillhouse.outil`, the frame's
|
|
24
|
+
// repository), a subcommand of the orchestration (circuit, superviseur, nuit, tableau, the status
|
|
25
|
+
// line, the hooks of Claude Code and the write lock) runs by that version, installed under
|
|
26
|
+
// ~/.cache/grillhouse/outil/<version>/ at its first launch, its arguments, streams and exit
|
|
27
|
+
// code this command's; every other subcommand runs here (scripts/aiguillage.mjs). A faulty key
|
|
28
|
+
// is refused by its name on the error stream, nothing run, and the exit code is 2; a version
|
|
29
|
+
// that cannot be installed is said in one line on the error stream, and the subcommand runs
|
|
30
|
+
// here, or, when the code of this repository does not load either, is refused by its version
|
|
31
|
+
// and its cause, exit code 2. The code of the copy is loaded only once the subcommand is known to
|
|
32
|
+
// run here, so a module of the copy that no longer loads never stops a subcommand that the
|
|
33
|
+
// published version runs (the write lock).
|
|
34
|
+
// - A subcommand whose script is missing (the package's TypeScript unbuilt, `dist/`) says so with
|
|
35
|
+
// the command that builds it on the error stream, and the exit code is 1.
|
|
23
36
|
// - A subcommand missing or unknown writes the usage and the list of the subcommands on the error
|
|
24
37
|
// stream, and the exit code is 2.
|
|
25
38
|
// - A script finds its neighbours by its own directory, and the project by the working directory
|
|
@@ -28,27 +41,32 @@ import { spawn } from 'node:child_process';
|
|
|
28
41
|
import { realpathSync } from 'node:fs';
|
|
29
42
|
import { constants } from 'node:os';
|
|
30
43
|
import { pathToFileURL } from 'node:url';
|
|
31
|
-
import {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
44
|
+
import { aiguillage, installer } from '../scripts/aiguillage.mjs';
|
|
45
|
+
|
|
46
|
+
// The code of the copy, loaded once the subcommand is known to run here: a module of the copy that
|
|
47
|
+
// no longer loads must not stop a subcommand the published version runs (the write lock above all).
|
|
48
|
+
async function chargerLeCode() {
|
|
49
|
+
const [donnees, sous] = await Promise.all([
|
|
50
|
+
import('../scripts/donnees-cles.mjs'),
|
|
51
|
+
import('../scripts/sous-commandes.mjs'),
|
|
52
|
+
]);
|
|
53
|
+
return { ...donnees, ...sous };
|
|
54
|
+
}
|
|
37
55
|
|
|
38
56
|
// The subcommands in the working directory: the core's, and the ones of the module of its
|
|
39
57
|
// language; the core's alone when the frame refuses its language.
|
|
40
|
-
const lesSousCommandes =
|
|
58
|
+
const lesSousCommandes = code => {
|
|
41
59
|
try {
|
|
42
|
-
return sousCommandes();
|
|
60
|
+
return code.sousCommandes();
|
|
43
61
|
} catch {
|
|
44
|
-
return SOUS_COMMANDES;
|
|
62
|
+
return code.SOUS_COMMANDES;
|
|
45
63
|
}
|
|
46
64
|
};
|
|
47
65
|
|
|
48
66
|
// The usage and the list of the subcommands, as the error stream receives them.
|
|
49
|
-
const usage =
|
|
67
|
+
const usage = code =>
|
|
50
68
|
'Usage : grillhouse <sous-commande> [arguments…]\n' +
|
|
51
|
-
`Sous-commandes : ${Object.keys(lesSousCommandes()).join(', ')}\n`;
|
|
69
|
+
`Sous-commandes : ${Object.keys(lesSousCommandes(code)).join(', ')}\n`;
|
|
52
70
|
|
|
53
71
|
// The command is run by its link (`node_modules/.bin/grillhouse`), which Node resolves for the
|
|
54
72
|
// module, not for `process.argv[1]`.
|
|
@@ -60,9 +78,87 @@ const lance = () => {
|
|
|
60
78
|
}
|
|
61
79
|
};
|
|
62
80
|
|
|
81
|
+
// Runs the script <commande> (by bash for a `.sh`, else by Node) with <args> and this process's
|
|
82
|
+
// streams; a signal this process receives goes to it, which decides how it ends; its exit code is
|
|
83
|
+
// this command's.
|
|
84
|
+
function lancerLeScript(nom, commande, args, env = process.env) {
|
|
85
|
+
const enfant = commande.endsWith('.sh')
|
|
86
|
+
? spawn('bash', [commande, ...args], { stdio: 'inherit', env })
|
|
87
|
+
: spawn(process.execPath, [commande, ...args], { stdio: 'inherit', env });
|
|
88
|
+
const relais = s => enfant.kill(s);
|
|
89
|
+
for (const s of ['SIGINT', 'SIGTERM', 'SIGHUP']) process.on(s, relais);
|
|
90
|
+
enfant.on('error', e => {
|
|
91
|
+
process.stderr.write(`⛔ grillhouse ${nom} : ${e.message}\n`);
|
|
92
|
+
process.exitCode = 1;
|
|
93
|
+
});
|
|
94
|
+
enfant.on('exit', (code, signal) => {
|
|
95
|
+
process.exitCode = code ?? 128 + (constants.signals[signal] ?? 0);
|
|
96
|
+
for (const s of ['SIGINT', 'SIGTERM', 'SIGHUP']) process.off(s, relais);
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// The subcommand <nom> handed to the published version the project names (scripts/aiguillage.mjs),
|
|
101
|
+
// installed at its first launch: true when it is handed (or refused), false when it runs here, a
|
|
102
|
+
// version that cannot be installed said in one line; when the code here does not load either, the
|
|
103
|
+
// subcommand is refused (exit code 2) by the version and both causes.
|
|
104
|
+
async function aiguiller(nom, args) {
|
|
105
|
+
let vers;
|
|
106
|
+
try {
|
|
107
|
+
vers = nom === undefined ? null : aiguillage(nom);
|
|
108
|
+
} catch (e) {
|
|
109
|
+
process.stderr.write(`⛔ grillhouse ${nom} : ${e.message}\n`);
|
|
110
|
+
process.exitCode = 2;
|
|
111
|
+
return true;
|
|
112
|
+
}
|
|
113
|
+
if (vers === null) return false;
|
|
114
|
+
try {
|
|
115
|
+
installer(vers.version);
|
|
116
|
+
} catch (e) {
|
|
117
|
+
try {
|
|
118
|
+
await chargerLeCode();
|
|
119
|
+
} catch (c) {
|
|
120
|
+
process.stderr.write(
|
|
121
|
+
`⛔ grillhouse ${nom} : version publiée ${vers.version} non installable : ${e.message} ; ` +
|
|
122
|
+
`le code de ce dépôt ne se charge pas non plus : ${c.message} ; ` +
|
|
123
|
+
"la réparation de l'arbre principal revient au superviseur, hors séance d'agent.\n"
|
|
124
|
+
);
|
|
125
|
+
process.exitCode = 2;
|
|
126
|
+
return true;
|
|
127
|
+
}
|
|
128
|
+
process.stderr.write(
|
|
129
|
+
`⚠️ grillhouse ${nom} : version publiée ${vers.version} non installable : ${e.message} ; le code du dépôt la remplace.\n`
|
|
130
|
+
);
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
lancerLeScript(nom, vers.commande, [nom, ...args]);
|
|
134
|
+
return true;
|
|
135
|
+
}
|
|
136
|
+
|
|
63
137
|
// The script of the subcommand, run (see the header); the exit code is set, never forced
|
|
64
138
|
// (`process.exitCode`), so that what the command wrote on a pipe reaches its reader.
|
|
65
139
|
async function lancer([nom, ...args]) {
|
|
140
|
+
if (await aiguiller(nom, args)) return;
|
|
141
|
+
let code;
|
|
142
|
+
try {
|
|
143
|
+
code = await chargerLeCode();
|
|
144
|
+
} catch (e) {
|
|
145
|
+
process.stderr.write(
|
|
146
|
+
`⛔ grillhouse ${nom ?? ''} : le code de ce dépôt ne se charge pas : ${e.message}\n`
|
|
147
|
+
);
|
|
148
|
+
process.exitCode = 2;
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
const {
|
|
152
|
+
avecLesDonnees,
|
|
153
|
+
commandeDe,
|
|
154
|
+
construireLesFournisseurs,
|
|
155
|
+
controlerLesDonnees,
|
|
156
|
+
donneesDuPaquet,
|
|
157
|
+
environnementDe,
|
|
158
|
+
fournisseursDuPaquet,
|
|
159
|
+
scriptAbsent,
|
|
160
|
+
SOUS_COMMANDES,
|
|
161
|
+
} = code;
|
|
66
162
|
let commande;
|
|
67
163
|
try {
|
|
68
164
|
commande = nom === undefined ? null : commandeDe(nom);
|
|
@@ -73,12 +169,18 @@ async function lancer([nom, ...args]) {
|
|
|
73
169
|
}
|
|
74
170
|
if (commande === null) {
|
|
75
171
|
process.stderr.write(
|
|
76
|
-
nom === undefined ? usage() : `⛔ sous-commande inconnue : ${nom}\n${usage()}`
|
|
172
|
+
nom === undefined ? usage(code) : `⛔ sous-commande inconnue : ${nom}\n${usage(code)}`
|
|
77
173
|
);
|
|
78
174
|
process.exitCode = 2;
|
|
79
175
|
return;
|
|
80
176
|
}
|
|
81
177
|
const script = commande.script;
|
|
178
|
+
const absent = scriptAbsent(nom, script);
|
|
179
|
+
if (absent !== null) {
|
|
180
|
+
process.stderr.write(`${absent}\n`);
|
|
181
|
+
process.exitCode = 1;
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
82
184
|
args = [...commande.args, ...args];
|
|
83
185
|
const duNoyau = typeof SOUS_COMMANDES[nom] === 'string';
|
|
84
186
|
if (duNoyau && script.endsWith('.mjs')) {
|
|
@@ -89,25 +191,25 @@ async function lancer([nom, ...args]) {
|
|
|
89
191
|
let env;
|
|
90
192
|
try {
|
|
91
193
|
env = environnementDe(nom);
|
|
194
|
+
// The tests of a package, named by its folder or a path in it, get the data it declares. Run
|
|
195
|
+
// by the graph of the packages, its providers are built already; run by hand, they are built
|
|
196
|
+
// first (by the module of the language, which skips it inside the graph), then each output is
|
|
197
|
+
// checked once built.
|
|
198
|
+
if (nom === 'tests') {
|
|
199
|
+
for (const a of args.filter(x => !x.startsWith('-'))) {
|
|
200
|
+
const chemin = a.replace(/\/$/, '');
|
|
201
|
+
const donnees = donneesDuPaquet(process.cwd(), chemin);
|
|
202
|
+
construireLesFournisseurs(fournisseursDuPaquet(process.cwd(), chemin));
|
|
203
|
+
controlerLesDonnees(donnees);
|
|
204
|
+
env = avecLesDonnees(donnees, env);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
92
207
|
} catch (e) {
|
|
93
208
|
process.stderr.write(`⛔ grillhouse ${nom} : ${e.message}\n`);
|
|
94
209
|
process.exitCode = 2;
|
|
95
210
|
return;
|
|
96
211
|
}
|
|
97
|
-
|
|
98
|
-
? spawn('bash', [script, ...args], { stdio: 'inherit', env })
|
|
99
|
-
: spawn(process.execPath, [script, ...args], { stdio: 'inherit', env });
|
|
100
|
-
// A signal this process receives goes to the script, which decides how it ends.
|
|
101
|
-
const relais = s => enfant.kill(s);
|
|
102
|
-
for (const s of ['SIGINT', 'SIGTERM', 'SIGHUP']) process.on(s, relais);
|
|
103
|
-
enfant.on('error', e => {
|
|
104
|
-
process.stderr.write(`⛔ grillhouse ${nom} : ${e.message}\n`);
|
|
105
|
-
process.exitCode = 1;
|
|
106
|
-
});
|
|
107
|
-
enfant.on('exit', (code, signal) => {
|
|
108
|
-
process.exitCode = code ?? 128 + (constants.signals[signal] ?? 0);
|
|
109
|
-
for (const s of ['SIGINT', 'SIGTERM', 'SIGHUP']) process.off(s, relais);
|
|
110
|
-
});
|
|
212
|
+
lancerLeScript(nom, script, args, env);
|
|
111
213
|
}
|
|
112
214
|
|
|
113
215
|
if (import.meta.url === lance()) {
|
|
@@ -27,19 +27,8 @@ jobs:
|
|
|
27
27
|
- name: Install dependencies
|
|
28
28
|
run: npm ci
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
- name: Lint
|
|
34
|
-
run: npm run lint
|
|
35
|
-
|
|
36
|
-
- name: Typecheck
|
|
37
|
-
run: npm run typecheck
|
|
38
|
-
|
|
39
|
-
- name: Build
|
|
40
|
-
run: npm run build --if-present
|
|
41
|
-
|
|
42
|
-
- name: Guards and tests
|
|
30
|
+
# Formatting, lint, typing, build, guards and tests: the one command of the poste.
|
|
31
|
+
- name: Verification
|
|
43
32
|
run: npm run verifier
|
|
44
33
|
|
|
45
34
|
build:
|
|
@@ -37,7 +37,7 @@ interface publiée…>. Le cadre et l'architecture montent toujours (charte comm
|
|
|
37
37
|
|
|
38
38
|
## Commandes
|
|
39
39
|
|
|
40
|
-
- `npm test` (Turborepo : construction, puis tests ; une tâche dont rien n'a bougé est relue de son cache, `npm run test:forcer` rejoue) · `npm test -- <chemins>` (un lancement ciblé : chaque chemin écrit depuis la racine, joué dans son paquet, avec les constructions dont ses tests dépendent, relues du cache ; ses tests rejouent dès que bouge ce qu'ils importent ; un lancement qui ne joue aucun test échoue ; un
|
|
40
|
+
- `npm test` (Turborepo : construction, puis tests ; une tâche dont rien n'a bougé est relue de son cache, `npm run test:forcer` rejoue) · `npm test -- <chemins>` (un lancement ciblé : chaque chemin écrit depuis la racine, joué dans son paquet, avec les constructions dont ses tests dépendent, relues du cache ; ses tests rejouent dès que bouge ce qu'ils importent ; un lancement qui ne joue aucun test échoue ; un test de nuit nommé est refusé, la nuit seule le joue ; une mesure de temps — un banc, un témoin de temps — se joue quand son propre fichier est nommé, sous la mesure du temps) · `npm run verifier` (après la construction, les gardes du cadre, celles du projet — son script `gardes` —, le typage de chaque paquet — son script `typecheck`, ses sources et ses tests —, la mise en forme et le lint de la racine — ses scripts `format:check` et `lint`, joués quand ils existent — et les tests, côte à côte, sous le verrou de la machine, sans aucune mesure de temps, que joue la nuit seule : ce que jouent l'intégration, la file, la CI et la nuit ; mesuré contre le dernier vert, un paquet rejoué joue les tests que Vitest relie aux fichiers changés depuis, tous quand un changement sort de son graphe ; 0 vert, 1 rouge, un délai dépassé compris ; 75 quand l'attente du verrou de la machine ou de place sous /tmp atteint sa borne) · `npm run verifier -- --tout` (la passe complète, chaque test joué pour de vrai : ce que joue la nuit) · `npm run verifier -- --gardes` (les gardes, la mise en forme et le lint, même verdict : ce que joue le relecteur) · `npm run typecheck` · `npm run lint` · `npm run format:check`.
|
|
41
41
|
- Préfixe des tickets : `<prefixe>-`.
|
|
42
42
|
- La politique de poussée : la clé `grillhouse.poussee` du `package.json` (`commit` : la branche où
|
|
43
43
|
part chaque commit, main par défaut ; `nuit` : la branche où la nuit pousse son commit vert ;
|
|
@@ -61,3 +61,7 @@ interface publiée…>. Le cadre et l'architecture montent toujours (charte comm
|
|
|
61
61
|
sur main ne le fusionnent pas, elles prennent la version de main et rejouent sa commande sur le
|
|
62
62
|
lot appliqué ; lue dans l'arbre principal ; une clé sans commande, sans fichiers ou avec un
|
|
63
63
|
motif hors du dépôt est refusée par son nom avant tout travail).
|
|
64
|
+
- Le nombre de circuits à la fois : la clé `grillhouse.circuits` du `package.json` (un entier
|
|
65
|
+
≥ 1, **1** quand elle est absente : les circuits du projet qui tournent à la fois, que la file
|
|
66
|
+
des tickets tient ; un circuit qui attend la réponse du superviseur compte ; lue dans l'arbre
|
|
67
|
+
principal ; toute autre valeur est refusée par son nom avant tout travail).
|
|
@@ -115,17 +115,17 @@ npm test
|
|
|
115
115
|
|
|
116
116
|
### Available Scripts
|
|
117
117
|
|
|
118
|
-
| Script | Description
|
|
119
|
-
| ------------------------------ |
|
|
120
|
-
| `npm run build` | Compile TypeScript to JavaScript
|
|
121
|
-
| `npm run dev` | Run in development mode with watch
|
|
122
|
-
| `npm test` | Build, then run the tests (Turborepo; an unchanged task is replayed from its cache); `npm test -- <paths>` plays the paths written from the root, each in its package, its tests played again once what they import changes
|
|
123
|
-
| `npm run test:forcer` | The same, every task run for real; with paths, the tests named run for real, their builds replayed from the cache
|
|
124
|
-
| `npm run verifier` | Build, then run the frame's guards, the project's own (`gardes`) and the tests beside each other (what the integration and the CI run), measured against the last green: a package played again runs the tests Vitest relates to the files changed since; 0 green, 1 red
|
|
125
|
-
| `npm run verifier -- --tout` | The complete pass: every test run for real, never measured against the last green (what the night runs)
|
|
126
|
-
| `npm run verifier -- --gardes` | The guards alone (the frame's and the project's), same verdict: what the reviewer runs on the ticket's copy
|
|
127
|
-
| `npm run lint` | Run ESLint
|
|
128
|
-
| `npm run format` | Format code with Prettier
|
|
118
|
+
| Script | Description |
|
|
119
|
+
| ------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
120
|
+
| `npm run build` | Compile TypeScript to JavaScript |
|
|
121
|
+
| `npm run dev` | Run in development mode with watch |
|
|
122
|
+
| `npm test` | Build, then run the tests (Turborepo; an unchanged task is replayed from its cache); `npm test -- <paths>` plays the paths written from the root, each in its package, its tests played again once what they import changes |
|
|
123
|
+
| `npm run test:forcer` | The same, every task run for real; with paths, the tests named run for real, their builds replayed from the cache |
|
|
124
|
+
| `npm run verifier` | Build, then run the frame's guards, the project's own (`gardes`) and the tests beside each other (what the integration and the CI run), measured against the last green: a package played again runs the tests Vitest relates to the files changed since; 0 green, 1 red (a delay past included; the measures of time play at night); 75 when the wait for the lock of the machine, or for room under /tmp, reaches its bound |
|
|
125
|
+
| `npm run verifier -- --tout` | The complete pass: every test run for real, never measured against the last green (what the night runs) |
|
|
126
|
+
| `npm run verifier -- --gardes` | The guards alone (the frame's and the project's), same verdict: what the reviewer runs on the ticket's copy |
|
|
127
|
+
| `npm run lint` | Run ESLint |
|
|
128
|
+
| `npm run format` | Format code with Prettier |
|
|
129
129
|
|
|
130
130
|
## Contributing
|
|
131
131
|
|
|
@@ -84,8 +84,5 @@ pids/
|
|
|
84
84
|
.rtfm/
|
|
85
85
|
.codegraph/
|
|
86
86
|
|
|
87
|
-
#
|
|
88
|
-
.
|
|
89
|
-
|
|
90
|
-
# Turborepo: its local cache and its runs
|
|
91
|
-
.turbo/
|
|
87
|
+
# The directories the frame and the tools of its language write (the copies of the tickets,
|
|
88
|
+
# Turborepo's cache) are laid by grillhouse maj, which init runs.
|
|
@@ -6,7 +6,7 @@ Issues for this repo live in Beads, a git-backed tracker: data under `.beads/`,
|
|
|
6
6
|
|
|
7
7
|
- One ticket = one agent session's worth of work; the body holds the brief, the plan, and (on close) the answer.
|
|
8
8
|
- Every ticket opens with an **Architecture** section, three answers written before any code: the mature model (how the mature product of the domain handles it, named), the address (where it lives in the specified architecture), the common mechanism (existing, or missing — then the missing mechanism is the work, and the reported case only its witness). A ticket without it does not start.
|
|
9
|
-
- A realisation ticket is created with its **Acceptance criteria** section (`## Critères d'acceptation`) after « Architecture »: criteria numbered `1.`, `2.`… (cited « critère 1 » in tests and comments), each a checkable statement answering a real need of the current use, edge cases and refusals included, covering every place that applies the same rule (found through the index). So the flow starts on criteria already numbered, and no agent rewrites the ticket to number them; a ticket does not go to the `testwriter` without them. A criterion on the changelog reads « the CHANGELOG says it », never tied to a section title (each release moves the entry out of the open section): the `relecteur` judges the entry on the lot; no test reads it.
|
|
9
|
+
- A realisation ticket is created with its **Acceptance criteria** section (`## Critères d'acceptation`) after « Architecture »: criteria numbered `1.`, `2.`… (cited « critère 1 » in tests and comments), each a checkable statement answering a real need of the current use, edge cases and refusals included, covering every place that applies the same rule (found through the index). So the flow starts on criteria already numbered, and no agent rewrites the ticket to number them; a ticket does not go to the `testwriter` without them. A criterion on the changelog reads « the CHANGELOG says it », never tied to a section title (each release moves the entry out of the open section): the `relecteur` judges the entry on the lot; no test reads it. The entry goes in the CHANGELOG.md of the published package the lot touches, in the folder of that package (the root `CHANGELOG.md` only for a project whose root is its package).
|
|
10
10
|
- A change of behaviour is one ticket that passes from agent to agent, never a ticket per post: in the ticket's copy, the `testwriter` writes the tests; the `developpeur` finds them there and writes the code; the `relecteur` gives its verdict (`ACCEPTÉ` or `RENDU`, each finding naming its recipient, a role and a component) in its sheet, which the circuit writes on the same ticket; the circuit (`packages/grillhouse/scripts/circuit.mjs`) leads them, sends a lot RENDU back to the agents its findings name, and on `ACCEPTÉ` builds both lots from the copy and commits them in one commit on the branch `agent/<ticket>` through `packages/grillhouse/scripts/integration/integrer.mjs` (the ticket is labelled `en-file`); the queue (`packages/grillhouse/scripts/integration/file.mjs`) brings that branch onto main, closes the ticket and pushes main.
|
|
11
11
|
- One ticket, one delivery: a goal whose split is unknown opens an exploration ticket (no code, agent `explorateur`), which closes on the realisation tickets it proposes, recorded closed and labelled `decouverte`; the supervisor reopens those the owner validates. A realisation ticket names the components it touches (« Numéros et titres ») and enters in one commit, under its own number alone; the `commit-msg` hook refuses a second commit for a closed ticket whose delivery stands, and lets a ticket reopened after its delivery (open in Beads) take correction commits; a revert (`Revert "…"`, `Reapply "…"`) passes and withdraws the delivery it names.
|
|
12
12
|
- An open ticket is born of the owner's word, or of a direct need of a project that uses the frame (a defect it meets). A discovery during work is recorded, with its example and address, in a closed ticket under the ticket that found it, labelled `decouverte` (see « Numéros et titres »). Once the ticket's lot is on main, the tri of the discoveries (step 5.3, the `explorateur`) gives each one its verdict at its ticket, with its piece, as a label: `traitee`, `doublon` or `sans-suite` leave it closed; `a-porter` (a defect of the actual use) or `non-confirmee` (no proof played again, what lacks written) reopen it under `a-valider`, for the owner. A discovery that blocks stops the agent, and its handoff names it.
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
"test": "grillhouse tests",
|
|
20
20
|
"test:watch": "vitest",
|
|
21
21
|
"test:coverage": "vitest run --coverage",
|
|
22
|
-
"lint": "eslint src tests --ext .ts,.js,.mjs",
|
|
22
|
+
"lint": "eslint src tests --cache --cache-location node_modules/.cache/eslint/.eslintcache --ext .ts,.js,.mjs",
|
|
23
23
|
"lint:fix": "eslint src tests --ext .ts,.js,.mjs --fix",
|
|
24
24
|
"format": "prettier --write \"src/**/*.{ts,js,mjs}\" \"tests/**/*.{ts,js,mjs}\"",
|
|
25
|
-
"format:check": "prettier --check \"src/**/*.{ts,js,mjs}\" \"tests/**/*.{ts,js,mjs}\"",
|
|
25
|
+
"format:check": "prettier --check --cache --cache-location node_modules/.cache/prettier/.prettiercache \"src/**/*.{ts,js,mjs}\" \"tests/**/*.{ts,js,mjs}\"",
|
|
26
26
|
"prepare": "grillhouse hooks && npm run build",
|
|
27
27
|
"prepublishOnly": "npm run lint && npm run typecheck && npm run verifier && npm run build",
|
|
28
28
|
"daemon:start": "pm2 start ecosystem.config.cjs",
|
package/charte.md
CHANGED
|
@@ -79,15 +79,43 @@ en un seul commit, et se crée sous sa mère (`docs/agents/issue-tracker.md`). U
|
|
|
79
79
|
découpage n'est pas connu commence par une exploration, sans code. Ainsi l'avancement se lit
|
|
80
80
|
ticket par ticket.
|
|
81
81
|
|
|
82
|
+
**Le rouge prouve le travail du ticket** : un test qui échoue avant le code prouve qu'avant le
|
|
83
|
+
travail le comportement manque, et qu'après il est là ; c'est son seul sens. Seul un test qui
|
|
84
|
+
porte le travail du ticket rougit donc d'abord ; les autres sont verts avant le code, sans
|
|
85
|
+
justification à donner. Chaque sorte de test prouve une chose :
|
|
86
|
+
|
|
87
|
+
| Sorte | Ce qu'elle prouve | Rouge avant le code |
|
|
88
|
+
|---|---|---|
|
|
89
|
+
| Test du comportement développé | Le ticket fait ce que dit son critère | Oui : c'est la preuve du travail |
|
|
90
|
+
| Test d'un défaut corrigé | Le défaut est reproduit, puis corrigé | Oui : il montre le défaut |
|
|
91
|
+
| Test d'un comportement existant | Le lot ne casse rien | Non : vert attendu |
|
|
92
|
+
| Test d'interface | Un paquet tient ce qu'il publie | Oui s'il porte le travail du ticket, sinon non |
|
|
93
|
+
| Banc de temps, témoin de temps | Un temps reste sous sa borne | Non : mesuré la nuit |
|
|
94
|
+
| Test de nuit | Le produit entier, monté dans un projet d'essai | Oui s'il porte le travail du ticket, joué la nuit |
|
|
95
|
+
|
|
96
|
+
Ainsi la preuve du rouge mesure le travail, et aucun test ne rougit pour la forme.
|
|
97
|
+
|
|
82
98
|
**La taille d'un test suit la pyramide** (la pyramide des tests de Google, les tailles de
|
|
83
99
|
Bazel) : un test petit vérifie son module par son interface, sans processus ; un test moyen
|
|
84
100
|
assemble quelques modules sur la machine, avec des processus locaux ; un test grand monte un
|
|
85
|
-
projet d'essai et y lance le produit ou le cadre entier : il est un test de nuit (`*.nuit.test
|
|
86
|
-
jamais joué au fil du travail. Chaque test prend la plus petite taille qui prouve son critère, dans
|
|
101
|
+
projet d'essai et y lance le produit ou le cadre entier : il est un test de nuit (`*.nuit.test.*`,
|
|
102
|
+
`*_nuit_test.py`, `tests/*_nuit.rs` en Rust), jamais joué au fil du travail. Chaque test prend la plus petite taille qui prouve son critère, dans
|
|
87
103
|
Grillhouse comme dans chaque projet. La garde des tailles (`grillhouse tailles-des-tests`) refuse
|
|
88
104
|
un grand test de jour, et la dette inscrite des grands tests existants ne fait que baisser. Ainsi
|
|
89
105
|
le jour reste court, et la preuve longue tourne la nuit.
|
|
90
106
|
|
|
107
|
+
**Un test porte le nom du comportement qu'il prouve**, jamais le numéro de son ticket, qui va au
|
|
108
|
+
message du commit (Software Engineering at Google, chap. 12 : un test par comportement). Ainsi un
|
|
109
|
+
test vit autant que son comportement, pas que son ticket.
|
|
110
|
+
|
|
111
|
+
**Une mesure de temps joue la nuit** (les tests `manual` de Bazel, les bancs de rustc-perf hors de
|
|
112
|
+
la CI de chaque commit) : le jour sert l'activité, et sa machine est toujours chargée. Un test qui
|
|
113
|
+
mesure un temps (un banc de temps, un témoin de temps) est hors du jour dans chaque langage, comme
|
|
114
|
+
un test de nuit ; la nuit le joue seul, au repos, et un échec sous charge y est « à repasser »
|
|
115
|
+
(75). Le jour n'attend aucun repos : un délai de test est un garde-fou, pas une mesure ; dépassé,
|
|
116
|
+
il est rouge, et un délai trop juste s'élargit, très au-dessus de la durée normale du test. Ainsi
|
|
117
|
+
le jour avance, et une mesure se prend au repos.
|
|
118
|
+
|
|
91
119
|
**Un projet a plusieurs langages, un paquet un seul** : chaque paquet relève du langage de son
|
|
92
120
|
outil, et `npm test`, la vérification et le circuit jouent chaque paquet avec cet outil. Ainsi
|
|
93
121
|
chaque paquet se construit et se teste d'une seule façon.
|
|
@@ -159,6 +187,10 @@ dossier.
|
|
|
159
187
|
Ainsi le cadre ne maintient aucune spécificité par composant.
|
|
160
188
|
- **Une dette connue s'inscrit et se gèle** (`grillhouse-dette.json`) : une garde refuse tout
|
|
161
189
|
constat neuf, et le compte ne remonte jamais. Ainsi la dette ne fait que baisser.
|
|
190
|
+
- **Un flux de la CI déclare les paquets qu'il exerce, le relecteur le lit** (`grillhouse.flux` du
|
|
191
|
+
`package.json` racine) : une garde refuse un flux sans entrée ou un paquet inconnu, et la
|
|
192
|
+
consigne du relecteur nomme chaque flux que le lot touche. Ainsi un flux qui ne suit pas un
|
|
193
|
+
changement est lu avant le commit.
|
|
162
194
|
- **Un fichier engendré se construit** plutôt que de se commiter (au démarrage, au déploiement),
|
|
163
195
|
comme les index de Homebrew ou de caniuse. Un fichier qu'un lecteur ne peut pas construire
|
|
164
196
|
(une page lue sur GitHub, une somme de contrôle publiée) reste commité : le projet le déclare
|
|
@@ -201,8 +233,9 @@ dossier.
|
|
|
201
233
|
reprendre vit dans la copie du ticket ou sa passation, jamais dans le seul dossier temporaire,
|
|
202
234
|
qui ne porte que ce qui se refait. Le dossier temporaire ne tient ni copie du dépôt, ni
|
|
203
235
|
`node_modules`, ni cache : un cache de compilation va sous `~/.cache/grillhouse/`. Une passe
|
|
204
|
-
lourde qui
|
|
205
|
-
nommé. Ainsi le poste ne sature jamais
|
|
236
|
+
lourde qui trouve moins de 4 Go libres, sous le dossier temporaire ou sur le disque de sa copie,
|
|
237
|
+
attend la place et dit ce qui l'occupe, le ticket nommé. Ainsi le poste ne sature jamais ses
|
|
238
|
+
disques.
|
|
206
239
|
- **Main reste vert** : l'intégration exige un `npm run verifier` vert. Un test connu rouge se met
|
|
207
240
|
en quarantaine dans le test lui-même (`it.skip` ou `it.fails`), avec le ticket qui le corrige.
|
|
208
241
|
Ainsi chaque rouge a son ticket.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The group of the process <mort> of a dead attempt ended (SIGKILL) before the attempt played
|
|
3
|
+
* again plays, its leader gone or not (`groupeVivant`: a command of the dead act still running in
|
|
4
|
+
* its group); nothing without one.
|
|
5
|
+
*/
|
|
6
|
+
export declare function finirLaTentativeMorte(mort: {
|
|
7
|
+
pid: number;
|
|
8
|
+
depart: string | null;
|
|
9
|
+
} | null | undefined): void;
|
|
10
|
+
/**
|
|
11
|
+
* The key of the activity whose information is <info>: its workflow, its run and its activity id,
|
|
12
|
+
* the same for each of its attempts, as Temporal recommends an idempotency key (the run, because
|
|
13
|
+
* a workflow starts again under a new run, Continue-As-New or a circuit launched again, its
|
|
14
|
+
* activity ids counted anew); null out of a workflow.
|
|
15
|
+
*/
|
|
16
|
+
export declare function cleDeLActivite(info: {
|
|
17
|
+
workflowExecution?: {
|
|
18
|
+
workflowId: string;
|
|
19
|
+
runId: string;
|
|
20
|
+
} | null;
|
|
21
|
+
activityId: string;
|
|
22
|
+
}): string | null;
|
|
23
|
+
/** Plays the act <acte> on <entree> in the main tree <racine>: its outcome. */
|
|
24
|
+
export declare function jouer<T>(acte: string, entree: object, racine: string): Promise<T>;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
// One act of the circuit (scripts/faits-du-circuit.mjs), which the activities of the workflow of a
|
|
2
|
+
// ticket (./circuit/activites.ts) and of the queue of a project (./file/activites.ts) play, in a
|
|
3
|
+
// process of its own, in the main tree of the repository, as
|
|
4
|
+
// a CI runner plays each job in a child process. While the act plays, the activity sends a
|
|
5
|
+
// heartbeat every few seconds, the last sign of life of its session among its details; an attempt
|
|
6
|
+
// played again after its worker died hands that sign to its session (`precedent`), which waits
|
|
7
|
+
// for the group the dead attempt left before it launches its own (scripts/seances.mjs `lancer`),
|
|
8
|
+
// and kills the group of the dead attempt first, its leader gone or not (`finirLaTentativeMorte`).
|
|
9
|
+
// Each act receives the key of its activity (`cle`, `cleDeLActivite`), the same for each of its
|
|
10
|
+
// attempts, under which the act `effet` writes its effect once, the attempt of its activity
|
|
11
|
+
// (`essai`, 1 for the first), which says whether Temporal plays it again, and whether it is its
|
|
12
|
+
// last (`derniere`), past which Temporal tries it no more. The act leads a process group of its own, with
|
|
13
|
+
// the commands it runs (a rebase, a verification), as a session does (scripts/seances.mjs
|
|
14
|
+
// `jouerLeGroupe`). A cancellation (the supervisor's `--arreter`, a timeout of the activity) sends
|
|
15
|
+
// SIGTERM to its group, which ends its session, its group killed, then SIGKILL 10 s later; the
|
|
16
|
+
// activity fails once the whole group is gone, so that no command of the act outlives it. An act
|
|
17
|
+
// that fails is an error of the activity that is not tried again (`ApplicationFailure`, its
|
|
18
|
+
// message and its stack).
|
|
19
|
+
import { spawn } from 'node:child_process';
|
|
20
|
+
import { fileURLToPath } from 'node:url';
|
|
21
|
+
import { Context } from '@temporalio/activity';
|
|
22
|
+
import { ApplicationFailure } from '@temporalio/common';
|
|
23
|
+
import { departDe, groupeVivant, signalerGroupe } from '../../scripts/mesure-de-la-machine.mjs';
|
|
24
|
+
// The program of the acts: the circuit's, or a machine of trial's (GRILLHOUSE_ACTE_DU_CIRCUIT).
|
|
25
|
+
const ACTE = process.env.GRILLHOUSE_ACTE_DU_CIRCUIT ??
|
|
26
|
+
fileURLToPath(new URL('../../scripts/faits-du-circuit.mjs', import.meta.url));
|
|
27
|
+
// How often an act in progress sends its heartbeat.
|
|
28
|
+
const BATTEMENT_MS = 5_000;
|
|
29
|
+
// How long a cancelled act's group has after SIGTERM, before SIGKILL: beyond the 5 s the act gives
|
|
30
|
+
// its session's group (scripts/seances.mjs), so that the act kills that group first.
|
|
31
|
+
const GRACE_MS = 10_000;
|
|
32
|
+
/**
|
|
33
|
+
* The group of the process <mort> of a dead attempt ended (SIGKILL) before the attempt played
|
|
34
|
+
* again plays, its leader gone or not (`groupeVivant`: a command of the dead act still running in
|
|
35
|
+
* its group); nothing without one.
|
|
36
|
+
*/
|
|
37
|
+
export function finirLaTentativeMorte(mort) {
|
|
38
|
+
if (groupeVivant(mort)) {
|
|
39
|
+
signalerGroupe(mort.pid, 'SIGKILL');
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* The key of the activity whose information is <info>: its workflow, its run and its activity id,
|
|
44
|
+
* the same for each of its attempts, as Temporal recommends an idempotency key (the run, because
|
|
45
|
+
* a workflow starts again under a new run, Continue-As-New or a circuit launched again, its
|
|
46
|
+
* activity ids counted anew); null out of a workflow.
|
|
47
|
+
*/
|
|
48
|
+
export function cleDeLActivite(info) {
|
|
49
|
+
const d = info.workflowExecution;
|
|
50
|
+
return d ? `${d.workflowId}:${d.runId}:${info.activityId}` : null;
|
|
51
|
+
}
|
|
52
|
+
/** Plays the act <acte> on <entree> in the main tree <racine>: its outcome. */
|
|
53
|
+
export async function jouer(acte, entree, racine) {
|
|
54
|
+
const contexte = Context.current();
|
|
55
|
+
const avant = contexte.info.heartbeatDetails ?? null;
|
|
56
|
+
// The group of a dead attempt ends before this one plays; its session's group stays, which
|
|
57
|
+
// the session of this attempt waits for.
|
|
58
|
+
finirLaTentativeMorte(avant?.processus);
|
|
59
|
+
const precedent = avant?.vie ?? null;
|
|
60
|
+
const cle = cleDeLActivite(contexte.info);
|
|
61
|
+
const enfant = spawn(process.execPath, [ACTE, acte], {
|
|
62
|
+
cwd: racine,
|
|
63
|
+
stdio: ['pipe', 'pipe', 'inherit'],
|
|
64
|
+
env: process.env,
|
|
65
|
+
detached: true,
|
|
66
|
+
});
|
|
67
|
+
const moi = { pid: enfant.pid, depart: departDe(enfant.pid) };
|
|
68
|
+
let vie = precedent;
|
|
69
|
+
let resultat = null;
|
|
70
|
+
let reste = '';
|
|
71
|
+
enfant.stdout.on('data', (d) => {
|
|
72
|
+
reste += d.toString();
|
|
73
|
+
const lignes = reste.split('\n');
|
|
74
|
+
reste = lignes.pop() ?? '';
|
|
75
|
+
for (const l of lignes) {
|
|
76
|
+
const m = /^(vie|resultat|erreur) (.*)$/.exec(l);
|
|
77
|
+
if (!m) {
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
const valeur = JSON.parse(m[2]);
|
|
81
|
+
if (m[1] === 'vie') {
|
|
82
|
+
// The end of a launch (null) keeps the group it named: what remains of it may run.
|
|
83
|
+
if (valeur !== null) {
|
|
84
|
+
vie = valeur;
|
|
85
|
+
}
|
|
86
|
+
contexte.heartbeat({ processus: moi, vie });
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
resultat = { genre: m[1], valeur };
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
// An act dead before it reads its input says so by its exit, which the close gives.
|
|
94
|
+
enfant.stdin.on('error', () => { });
|
|
95
|
+
// Its last attempt: the one past which Temporal tries it no more (none under an unbounded policy,
|
|
96
|
+
// 0 or absent, as Temporal's default).
|
|
97
|
+
const tentatives = contexte.info.retryPolicy?.maximumAttempts ?? 0;
|
|
98
|
+
const derniere = tentatives > 0 && contexte.info.attempt >= tentatives;
|
|
99
|
+
enfant.stdin.end(JSON.stringify({ ...entree, precedent, cle, essai: contexte.info.attempt, derniere }));
|
|
100
|
+
contexte.heartbeat({ processus: moi, vie });
|
|
101
|
+
const battre = setInterval(() => contexte.heartbeat({ processus: moi, vie }), BATTEMENT_MS);
|
|
102
|
+
let tuer = null;
|
|
103
|
+
const annuler = () => {
|
|
104
|
+
signalerGroupe(moi.pid, 'SIGTERM');
|
|
105
|
+
tuer = setTimeout(() => signalerGroupe(moi.pid, 'SIGKILL'), GRACE_MS);
|
|
106
|
+
};
|
|
107
|
+
contexte.cancellationSignal.addEventListener('abort', annuler);
|
|
108
|
+
try {
|
|
109
|
+
const code = await new Promise(ok => enfant.on('close', c => ok(c)));
|
|
110
|
+
const r = resultat;
|
|
111
|
+
if (contexte.cancellationSignal.aborted) {
|
|
112
|
+
// What remains of the group ends before the activity fails.
|
|
113
|
+
while (signalerGroupe(moi.pid, 0)) {
|
|
114
|
+
await new Promise(ok => setTimeout(ok, 200));
|
|
115
|
+
}
|
|
116
|
+
throw ApplicationFailure.nonRetryable(`acte ${acte} annulé`, 'Annule');
|
|
117
|
+
}
|
|
118
|
+
if (r?.genre === 'resultat') {
|
|
119
|
+
return r.valeur;
|
|
120
|
+
}
|
|
121
|
+
const e = (r?.valeur ?? {});
|
|
122
|
+
// An effect not written before its last attempt: Temporal tries it again (its policy).
|
|
123
|
+
if (e.reessayable) {
|
|
124
|
+
throw ApplicationFailure.retryable(e.message ?? `acte ${acte} sans résultat`, 'EffetNonEcrit', {
|
|
125
|
+
message: e.message ?? null,
|
|
126
|
+
pile: e.pile ?? null,
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
throw ApplicationFailure.nonRetryable(e.message ?? `acte ${acte} sorti (${code}) sans résultat`, 'Inattendu', { message: e.message ?? null, pile: e.pile ?? null });
|
|
130
|
+
}
|
|
131
|
+
finally {
|
|
132
|
+
if (tuer) {
|
|
133
|
+
clearTimeout(tuer);
|
|
134
|
+
}
|
|
135
|
+
clearInterval(battre);
|
|
136
|
+
contexte.cancellationSignal.removeEventListener('abort', annuler);
|
|
137
|
+
}
|
|
138
|
+
}
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CAAC;QACzE,CAAC;QACD,IAAI,CAAC,EAAE,KAAK,KAAK,UAAU,EAAE,CAAC;YAC5B,OAAO,CAAC,CAAC,MAAW,CAAC;QACvB,CAAC;QACD,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,IAAI,EAAE,CAA+D,CAAC;QAC1F,uFAAuF;QACvF,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC;YAClB,MAAM,kBAAkB,CAAC,SAAS,CAChC,CAAC,CAAC,OAAO,IAAI,QAAQ,IAAI,gBAAgB,EACzC,eAAe,EACf;gBACE,OAAO,EAAE,CAAC,CAAC,OAAO,IAAI,IAAI;gBAC1B,IAAI,EAAE,CAAC,CAAC,IAAI,IAAI,IAAI;aACrB,CACF,CAAC;QACJ,CAAC;QACD,MAAM,kBAAkB,CAAC,YAAY,CACnC,CAAC,CAAC,OAAO,IAAI,QAAQ,IAAI,WAAW,IAAI,iBAAiB,EACzD,WAAW,EACX,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,IAAI,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,IAAI,IAAI,EAAE,CACrD,CAAC;IACJ,CAAC;YAAS,CAAC;QACT,IAAI,IAAI,EAAE,CAAC;YACT,YAAY,CAAC,IAAI,CAAC,CAAC;QACrB,CAAC;QACD,aAAa,CAAC,MAAM,CAAC,CAAC;QACtB,QAAQ,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACpE,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** The ticket a workflow carries. */
|
|
2
|
+
export declare const ATTRIBUT_TICKET: import("@temporalio/common/lib/search-attributes.js").SearchAttributeKey<"KEYWORD">;
|
|
3
|
+
/** The step a workflow is at. */
|
|
4
|
+
export declare const ATTRIBUT_ETAPE: import("@temporalio/common/lib/search-attributes.js").SearchAttributeKey<"KEYWORD">;
|
|
5
|
+
/** Each search attribute and its type, in the words of `temporal server start-dev`. */
|
|
6
|
+
export declare const ATTRIBUTS_DE_RECHERCHE: Readonly<Record<string, 'Keyword'>>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// The search attributes of the frame's workflows: the ticket and the step, two keywords, which the
|
|
2
|
+
// server registers at its start (`--search-attribute`, the unit of the server) and which a
|
|
3
|
+
// workflow upserts at each step, so that the board and `workflow list` read them from the server
|
|
4
|
+
// alone, no worker living. A module without network, which a workflow imports as the client does.
|
|
5
|
+
import { defineSearchAttributeKey, SearchAttributeType } from '@temporalio/common';
|
|
6
|
+
/** The ticket a workflow carries. */
|
|
7
|
+
export const ATTRIBUT_TICKET = defineSearchAttributeKey('GrillhouseTicket', SearchAttributeType.KEYWORD);
|
|
8
|
+
/** The step a workflow is at. */
|
|
9
|
+
export const ATTRIBUT_ETAPE = defineSearchAttributeKey('GrillhouseEtape', SearchAttributeType.KEYWORD);
|
|
10
|
+
/** Each search attribute and its type, in the words of `temporal server start-dev`. */
|
|
11
|
+
export const ATTRIBUTS_DE_RECHERCHE = {
|
|
12
|
+
[ATTRIBUT_TICKET.name]: 'Keyword',
|
|
13
|
+
[ATTRIBUT_ETAPE.name]: 'Keyword',
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=attributs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attributs.js","sourceRoot":"","sources":["../../src/temporal/attributs.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,2FAA2F;AAC3F,iGAAiG;AACjG,kGAAkG;AAClG,OAAO,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEnF,qCAAqC;AACrC,MAAM,CAAC,MAAM,eAAe,GAAG,wBAAwB,CACrD,kBAAkB,EAClB,mBAAmB,CAAC,OAAO,CAC5B,CAAC;AAEF,iCAAiC;AACjC,MAAM,CAAC,MAAM,cAAc,GAAG,wBAAwB,CACpD,iBAAiB,EACjB,mBAAmB,CAAC,OAAO,CAC5B,CAAC;AAEF,uFAAuF;AACvF,MAAM,CAAC,MAAM,sBAAsB,GAAwC;IACzE,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,SAAS;IACjC,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,SAAS;CACjC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Activites } from './contrat.js';
|
|
2
|
+
type Entree<K extends keyof Activites> = Parameters<Activites[K]>[0];
|
|
3
|
+
type Sortie<K extends keyof Activites> = Awaited<ReturnType<Activites[K]>>;
|
|
4
|
+
export declare function ouvrirLeCircuit(e: Entree<'ouvrirLeCircuit'>): Promise<Sortie<'ouvrirLeCircuit'>>;
|
|
5
|
+
export declare function preparerLaPasse(e: Entree<'preparerLaPasse'>): Promise<Sortie<'preparerLaPasse'>>;
|
|
6
|
+
export declare function lireUnFait(e: Entree<'lireUnFait'>): Promise<Sortie<'lireUnFait'>>;
|
|
7
|
+
export declare function appliquerLesEffets(e: Entree<'appliquerLesEffets'>): Promise<Sortie<'appliquerLesEffets'>>;
|
|
8
|
+
export declare function publierLArret(e: Entree<'publierLArret'>): Promise<Sortie<'publierLArret'>>;
|
|
9
|
+
export declare function finirLeTicket(e: Entree<'finirLeTicket'>): Promise<Sortie<'finirLeTicket'>>;
|
|
10
|
+
export declare function arreterLeTicket(e: Entree<'arreterLeTicket'>): Promise<Sortie<'arreterLeTicket'>>;
|
|
11
|
+
export declare function jouerUnEffet(e: Entree<'jouerUnEffet'>): Promise<void>;
|
|
12
|
+
export declare function jouerUnPasDuPlan(e: Entree<'jouerUnPasDuPlan'>): Promise<Sortie<'jouerUnPasDuPlan'>>;
|
|
13
|
+
export {};
|