@roomi-fields/grillhouse 0.29.0 → 0.31.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 +769 -0
- package/agents/developpeur.md +0 -1
- package/agents/explorateur.md +0 -1
- package/agents/questionneur.md +0 -1
- package/agents/testwriter.md +0 -1
- package/bin/grillhouse.mjs +79 -18
- package/cadre/templates/projet/.github/workflows/ci.yml +2 -13
- package/cadre/templates/projet/CLAUDE.md +5 -1
- package/cadre/templates/projet/docs/agents/issue-tracker.md +1 -1
- package/cadre/templates/projet/package.json +2 -2
- package/charte.md +24 -0
- 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 +30 -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 +94 -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 +120 -0
- package/dist/temporal/installation.js +386 -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 +646 -87
- package/docs/CADRE.md +27 -0
- package/docs/INTERFACE.md +139 -42
- package/hooks/crochet.mjs +19 -2
- package/hooks/hooks.json +11 -0
- package/package.json +16 -4
- package/scripts/activites.mjs +2255 -0
- package/scripts/aiguillage.d.mts +37 -0
- package/scripts/aiguillage.mjs +40 -14
- package/scripts/avancement.mjs +155 -26
- package/scripts/bilan.mjs +137 -43
- package/scripts/cadre.mjs +16 -4
- package/scripts/circuit.mjs +993 -4075
- 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/composants-affectes.mjs +64 -21
- package/scripts/composition-des-langages.mjs +18 -12
- package/scripts/conformite.mjs +56 -28
- package/scripts/copies-finies.mjs +52 -47
- package/scripts/depart-du-ticket.d.mts +53 -0
- package/scripts/depart-du-ticket.mjs +124 -0
- package/scripts/dependances-internes.mjs +121 -0
- package/scripts/dernier-vert.mjs +61 -34
- package/scripts/dette.mjs +32 -11
- package/scripts/donnees-cles.mjs +244 -0
- package/scripts/droits.mjs +51 -16
- package/scripts/effets.mjs +352 -0
- package/scripts/empreinte-d-etape.mjs +17 -0
- package/scripts/engendres.mjs +15 -5
- package/scripts/enveloppe/enveloppe.mjs +259 -55
- package/scripts/enveloppe/lancer.sh +14 -18
- package/scripts/enveloppe/paquets-du-plan.mjs +2 -2
- package/scripts/enveloppe/travail-de-la-copie.mjs +41 -13
- package/scripts/etapes.mjs +5 -2
- 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 +201 -0
- package/scripts/gardes-du-cadre.mjs +21 -5
- package/scripts/init.mjs +11 -4
- package/scripts/integration/file.mjs +544 -434
- package/scripts/integration/integrer.mjs +87 -43
- package/scripts/integration/rejeu.mjs +45 -13
- package/scripts/jointure.d.ts +151 -28
- package/scripts/langages/cargo/commandes.mjs +383 -124
- package/scripts/langages/cargo/composants.mjs +154 -42
- package/scripts/langages/cargo/exemples.mjs +12 -21
- package/scripts/langages/cargo/index.mjs +22 -8
- package/scripts/langages/cargo/sccache.mjs +8 -14
- package/scripts/langages/cargo/tests-de-head.mjs +25 -9
- package/scripts/langages/python/commandes.mjs +218 -100
- package/scripts/langages/python/composants.mjs +53 -21
- package/scripts/langages/python/exemples.mjs +6 -16
- package/scripts/langages/python/index.mjs +28 -8
- package/scripts/langages/python/lot.mjs +1 -36
- package/scripts/langages/typescript/chemins-des-tests.mjs +6 -2
- package/scripts/langages/typescript/composants.mjs +9 -3
- package/scripts/langages/typescript/consommateurs-arbitres.mjs +40 -14
- package/scripts/langages/typescript/consommateurs.mjs +39 -14
- package/scripts/langages/typescript/construire.mjs +6 -163
- package/scripts/langages/typescript/elements-du-lot.mjs +36 -12
- package/scripts/langages/typescript/exemples.mjs +3 -11
- package/scripts/langages/typescript/frontieres.mjs +66 -22
- package/scripts/langages/typescript/index-interfaces.mjs +36 -13
- package/scripts/langages/typescript/index.mjs +50 -61
- package/scripts/langages/typescript/interfaces-contre-code.mjs +113 -45
- package/scripts/langages/typescript/lecteurs.mjs +36 -11
- package/scripts/langages/typescript/migrations/0.23.0-config-vitest.mjs +15 -5
- package/scripts/langages/typescript/migrations/0.25.0-chemins-des-tests.mjs +6 -2
- package/scripts/langages/typescript/migrations/0.25.0-tailles-des-tests.mjs +6 -2
- 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 +33 -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/parcours.mjs +12 -4
- package/scripts/langages/typescript/regle-des-tests.mjs +9 -3
- package/scripts/langages/typescript/resumes.mjs +9 -3
- package/scripts/langages/typescript/tailles-des-tests.mjs +93 -20
- package/scripts/langages/typescript/tests-de-nuit.mjs +15 -10
- package/scripts/langages/typescript/tests.mjs +40 -15
- package/scripts/langages/typescript/titres-de-tests.mjs +320 -0
- package/scripts/langages/typescript/turbo-des-paquets.mjs +327 -81
- package/scripts/langages/typescript/verdict.mjs +4 -2
- package/scripts/langages/typescript/verifier.mjs +58 -20
- package/scripts/langages/typescript/vitest-config/avancement.reporter.mjs +15 -5
- package/scripts/langages/typescript/vitest-config/base.mjs +29 -3
- package/scripts/langages/typescript/vitest-config/bornes.mjs +13 -0
- package/scripts/langages/typescript/vitest-config/changements.mjs +21 -8
- package/scripts/langages/typescript/vitest-config/cibles.mjs +36 -14
- package/scripts/langages/typescript/vitest-config/delais.mjs +60 -0
- package/scripts/langages/typescript/vitest-config/delais.setup.mjs +11 -0
- package/scripts/langages/typescript/vitest-config/duree.classement.mjs +108 -0
- package/scripts/langages/typescript/vitest-config/duree.reporter.mjs +56 -59
- package/scripts/langages/typescript/vitest-config/lances.mjs +83 -27
- package/scripts/langages/typescript/vitest-config/machine.setup.mjs +10 -0
- package/scripts/langages/typescript/vitest-config/resultats.mjs +3 -1
- package/scripts/langages/typescript/vitest.nuit.config.mjs +4 -0
- package/scripts/lint-des-scripts.mjs +58 -0
- package/scripts/mesure/base-de-passe.mjs +117 -25
- package/scripts/mesure/pression.mjs +12 -6
- package/scripts/mesure-de-la-machine.d.mts +21 -0
- package/scripts/mesure-de-la-machine.mjs +76 -0
- package/scripts/migrations/0.23.0-charte-importee.mjs +6 -2
- package/scripts/migrations/0.23.0-crochets-de-seance.mjs +25 -8
- package/scripts/migrations/0.23.0-marche-du-projet.mjs +18 -6
- package/scripts/migrations/0.23.2-copies-du-cadre.mjs +56 -18
- package/scripts/migrations/0.24.12-tri-des-decouvertes.mjs +6 -2
- package/scripts/migrations/0.25.0-script-des-tests.mjs +15 -5
- package/scripts/migrations/0.30.0-ci-appelle-la-verification.mjs +124 -0
- package/scripts/migrations/0.31.0-paquets-dans-le-graphe.mjs +81 -0
- package/scripts/migrations.mjs +5 -0
- package/scripts/nuit.sh +25 -3
- package/scripts/outil.mjs +3 -1
- package/scripts/outils-cles.d.mts +24 -0
- package/scripts/outils-cles.mjs +18 -8
- package/scripts/paquet-npm.mjs +157 -0
- package/scripts/paquet.mjs +73 -4
- package/scripts/paquets.mjs +46 -10
- package/scripts/passe-de-la-machine.mjs +71 -0
- package/scripts/places-de-la-machine.mjs +414 -0
- package/scripts/places-du-serveur.mjs +170 -0
- package/scripts/prefixe-des-tickets.mjs +68 -0
- package/scripts/preparation.mjs +25 -8
- package/scripts/registre.mjs +9 -4
- 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/reprise.mjs +66 -0
- package/scripts/resultats.mjs +112 -46
- 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 +936 -0
- package/scripts/services-du-noyau.mjs +27 -8
- package/scripts/session-start.sh +2 -2
- package/scripts/sortie.mjs +3 -3
- package/scripts/sous-commandes.mjs +41 -10
- package/scripts/style-a-l-ecriture.mjs +260 -0
- package/scripts/superviseur.mjs +122 -111
- package/scripts/tableau.mjs +180 -117
- package/scripts/taches-du-graphe.mjs +348 -0
- package/scripts/ticket-du-circuit.mjs +216 -0
- package/scripts/transitions.d.mts +148 -0
- package/scripts/transitions.mjs +1018 -0
- package/scripts/verrou-de-fichier.mjs +8 -4
- package/scripts/verrou-de-machine.mjs +150 -51
- package/scripts/verrous/commande.mjs +50 -17
- package/scripts/verrous/ticket-du-sous-agent.mjs +9 -3
- package/scripts/verrous/verrou.mjs +42 -14
- package/skills/explorateur/SKILL.md +9 -2
- package/skills/grill/SKILL.md +1 -1
- package/skills/mesure/SKILL.md +3 -0
- package/skills/pitmaster/SKILL.md +17 -18
- package/skills/pitmaster/references/consigne-agent.md +5 -1
- package/skills/release/SKILL.md +3 -3
- package/skills/relecteur/SKILL.md +5 -3
- package/skills/testwriter/SKILL.md +49 -31
- package/scripts/demon.mjs +0 -251
- 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/scripts/superviseur.mjs
CHANGED
|
@@ -21,14 +21,17 @@
|
|
|
21
21
|
// - The session whose opening takes the lock (not one that keeps it) receives
|
|
22
22
|
// (`circuitsALOuverture`) the section « ## L'attente des questions », which asks it to launch the
|
|
23
23
|
// wait of the questions in the background (`--attendre`, below) without waiting for the owner's
|
|
24
|
-
// word, then, when the repository has some (read
|
|
25
|
-
// circuits du dépôt »: each circuit that runs, named;
|
|
26
|
-
// its question and the command that answers it; each
|
|
27
|
-
// the command that resumes it (`--reprendre`
|
|
28
|
-
//
|
|
29
|
-
//
|
|
24
|
+
// word, then, when the repository has some (read from the Temporal server in one call,
|
|
25
|
+
// scripts/circuits-du-serveur.mjs), « ## Les circuits du dépôt »: each circuit that runs, named;
|
|
26
|
+
// each circuit stopped on a question, with its question and the command that answers it; each
|
|
27
|
+
// circuit ended without its issue, with the command that resumes it (`--reprendre` from its last
|
|
28
|
+
// state written, else `--depuis <testwriter|developpeur> --contexte <texte>`), which the
|
|
29
|
+
// supervisor launches without waiting for the owner's word; their ticket open, and the stopped
|
|
30
|
+
// and the ended ones then gone up; a server that does not answer is said. A circuit
|
|
31
|
+
// runs on the worker of the project, apart from the sessions, its launch returns at once, and its
|
|
30
32
|
// question wakes the supervisor by the wait alone (grillhouse-mwz: SyntHub's SH-br0.1 stopped
|
|
31
|
-
// 27 s after a relaunch of its session, read only on a word of the owner).
|
|
33
|
+
// 27 s after a relaunch of its session, read only on a word of the owner). The queue of the
|
|
34
|
+
// tickets under Temporal (src/temporal/tickets/) launches the tickets `circuit`, not the opening.
|
|
32
35
|
// Exit 0, whatever it finds.
|
|
33
36
|
//
|
|
34
37
|
// npx grillhouse superviseur --attendre [<dossier>]
|
|
@@ -42,16 +45,19 @@
|
|
|
42
45
|
// the end of its task wakes the session, which spends nothing while it waits (grillhouse-pq6:
|
|
43
46
|
// SyntHub's SH-ae6.5.2, SH-ae6.5.6 and SH-br0.1.5, launched by a queue, waited hours on their
|
|
44
47
|
// question). The stops gone up, by a wait or named at the opening, are kept in
|
|
45
|
-
// `.claude/worktrees/questions-remontees.json`, each one by its ticket, the run of its
|
|
46
|
-
// and its stop: one never wakes the session twice,
|
|
48
|
+
// `.claude/worktrees/questions-remontees.json`, each one by its ticket, the run of its workflow,
|
|
49
|
+
// the rank of its question in that run and its stop: one never wakes the session twice, a
|
|
50
|
+
// session closed then opened again finds every one that waits, and one answered leaves them.
|
|
51
|
+
// Exit 0 on its
|
|
47
52
|
// questions, 1 when another wait already runs (`.claude/worktrees/attente-des-questions.lock`).
|
|
48
53
|
import { spawnSync } from 'node:child_process';
|
|
49
|
-
import { mkdirSync, readFileSync, renameSync, statSync,
|
|
54
|
+
import { mkdirSync, readFileSync, renameSync, statSync, writeFileSync } from 'node:fs';
|
|
50
55
|
import path from 'node:path';
|
|
51
56
|
import { pathToFileURL } from 'node:url';
|
|
52
57
|
import { lacherVerrou, prendreVerrou } from './verrou-de-fichier.mjs';
|
|
53
58
|
import { vivant } from './mesure/base-de-passe.mjs';
|
|
54
|
-
import {
|
|
59
|
+
import { circuitsDuServeur, ServeurMuet } from './circuits-du-serveur.mjs';
|
|
60
|
+
import { attendLeSuperviseur } from './tableau.mjs';
|
|
55
61
|
import { etapeDuCircuit, libelle, SUPERVISEUR } from './etapes.mjs';
|
|
56
62
|
|
|
57
63
|
const VERROU_SUPERVISEUR = 'grillhouse-superviseur.lock';
|
|
@@ -106,10 +112,10 @@ function ticketsFermes(racine, ids) {
|
|
|
106
112
|
}
|
|
107
113
|
}
|
|
108
114
|
|
|
109
|
-
// One stop of the circuit <c>: its ticket, the run
|
|
110
|
-
// stop, so that the next stop of a circuit resumed is
|
|
111
|
-
|
|
112
|
-
|
|
115
|
+
// One stop of the circuit <c>: its ticket, the run of its workflow (`run`), the rank of its
|
|
116
|
+
// question in that run (`numero`) and its stop, so that the next stop of a circuit resumed is
|
|
117
|
+
// another one.
|
|
118
|
+
const cleDe = c => [c.ticket, c.run, c.numero, c.arret ?? 'interrompu'].join(':');
|
|
113
119
|
|
|
114
120
|
// The step where the circuit <c> stands, in words (« 3.1 Contrôles »), else its state's.
|
|
115
121
|
const ou = c => {
|
|
@@ -133,26 +139,21 @@ function lireRemontees(racine) {
|
|
|
133
139
|
}
|
|
134
140
|
}
|
|
135
141
|
|
|
136
|
-
// The stops gone up of the repository at <racine>,
|
|
137
|
-
// those gone up before) returns the keys it makes go up (`cles`)
|
|
138
|
-
// file is written whole with them and those of <avant> whose stop
|
|
139
|
-
//
|
|
140
|
-
// (`inscrireLaQuestionLue`) until its process ends. A question answered so leaves them. Its
|
|
142
|
+
// The stops gone up of the repository at <racine>, its circuits <circuits> read, under the lock
|
|
143
|
+
// of their file: <faire>(<avant>, those gone up before) returns the keys it makes go up (`cles`)
|
|
144
|
+
// and what it gives (`rendu`); the file is written whole with them and those of <avant> whose stop
|
|
145
|
+
// still stands, its circuit waiting for the supervisor. A question answered so leaves them. Its
|
|
141
146
|
// `rendu`.
|
|
142
|
-
function remonter(racine, faire) {
|
|
147
|
+
function remonter(racine, circuits, faire) {
|
|
143
148
|
const f = remonteesDe(racine);
|
|
144
149
|
mkdirSync(path.dirname(f), { recursive: true });
|
|
145
150
|
const verrou = `${f}.verrou`;
|
|
146
|
-
// Held for one reading of the
|
|
151
|
+
// Held for one reading of the circuits: older than that, abandoned.
|
|
147
152
|
prendreVerrou(verrou, { attendre: true, perime: 30_000 });
|
|
148
153
|
try {
|
|
149
154
|
const avant = lireRemontees(racine);
|
|
150
155
|
const { cles, rendu } = faire(avant);
|
|
151
|
-
const debout = new Set(
|
|
152
|
-
lireCircuits({ racine })
|
|
153
|
-
.filter(c => attendLeSuperviseur(c) || (c.vivant && c.arret))
|
|
154
|
-
.map(cleDe)
|
|
155
|
-
);
|
|
156
|
+
const debout = new Set(circuits.filter(attendLeSuperviseur).map(cleDe));
|
|
156
157
|
const apres = new Set([...cles, ...[...avant].filter(c => debout.has(c))]);
|
|
157
158
|
if (avant.size !== apres.size || [...apres].some(c => !avant.has(c))) {
|
|
158
159
|
const provisoire = `${f}.${process.pid}`;
|
|
@@ -165,18 +166,6 @@ function remonter(racine, faire) {
|
|
|
165
166
|
}
|
|
166
167
|
}
|
|
167
168
|
|
|
168
|
-
/**
|
|
169
|
-
* Inscribes as gone up the question of the circuit of <ticket>, its run (`processus`, `depart`)
|
|
170
|
-
* stopped on <arret>, that its caller read on its output (grillhouse-pq6.1: a launch in the
|
|
171
|
-
* foreground that stops before any session, scripts/circuit.mjs `monter`): the wait of the
|
|
172
|
-
* questions does not wake on it, by the one source of the stops gone up.
|
|
173
|
-
* @param {string} racine
|
|
174
|
-
* @param {{ ticket: string, processus: number, depart: string, arret: string }} arret
|
|
175
|
-
*/
|
|
176
|
-
export function inscrireLaQuestionLue(racine, arret) {
|
|
177
|
-
remonter(racine, () => ({ cles: [cleDe(arret)] }));
|
|
178
|
-
}
|
|
179
|
-
|
|
180
169
|
// The question that waits for the supervisor from the circuit <c>: its ticket, its step, its
|
|
181
170
|
// question, who must answer it, the command that answers it, and its stop's key.
|
|
182
171
|
const enQuestion = c => ({
|
|
@@ -186,9 +175,8 @@ const enQuestion = c => ({
|
|
|
186
175
|
c.question ??
|
|
187
176
|
`arrêt ${c.arret}${c.code === null ? '' : ` (code ${c.code})`}${c.raison ? ` : ${c.raison}` : ''}`,
|
|
188
177
|
qui: c.qui ?? SUPERVISEUR,
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
: `npx grillhouse circuit ${c.ticket} --reprendre\`, \`--depuis <testwriter|developpeur>\`, \`--etendre <paquet>\` ou \`--arreter`,
|
|
178
|
+
// The answers the client accepts, as it gives them (src/temporal/circuit/client.ts).
|
|
179
|
+
commande: c.reponse,
|
|
192
180
|
cle: cleDe(c),
|
|
193
181
|
interrompu: c.interrompu,
|
|
194
182
|
arret: c.arret,
|
|
@@ -209,21 +197,26 @@ function enAttente(lus, racine, fermes) {
|
|
|
209
197
|
}
|
|
210
198
|
|
|
211
199
|
/**
|
|
212
|
-
* The questions that wait for the supervisor
|
|
213
|
-
*
|
|
214
|
-
*
|
|
215
|
-
*
|
|
216
|
-
* supervisor's own « arrete », « à repasser » included) or
|
|
217
|
-
* those whose stop's key <sauf> holds left out, then those whose ticket
|
|
218
|
-
* (bd is asked of the others alone), sorted by ticket. Each one says whether
|
|
219
|
-
* without
|
|
200
|
+
* The questions that wait for the supervisor among the circuits <circuits> of the repository at
|
|
201
|
+
* <racine> (scripts/circuits-du-serveur.mjs), the one source of the opening
|
|
202
|
+
* (`circuitsALOuverture`) and of the wait (`attendreUneQuestion`), by the rule the board's
|
|
203
|
+
* « ⤷ Question » reads too (scripts/tableau.mjs `attendLeSuperviseur`): each circuit stopped on a
|
|
204
|
+
* question (any stop but the supervisor's own « arrete », « à repasser » included) or ended
|
|
205
|
+
* without its issue, those whose stop's key <sauf> holds left out, then those whose ticket
|
|
206
|
+
* <fermes> gives closed (bd is asked of the others alone), sorted by ticket. Each one says whether
|
|
207
|
+
* its circuit ended without its issue (`interrompu`) and its stop (`arret`).
|
|
220
208
|
* @param {string} racine the root of the repository
|
|
209
|
+
* @param {import('./circuits-du-serveur.mjs').CircuitDuServeur[]} circuits
|
|
221
210
|
* @param {{ fermes?: (racine: string, ids: string[]) => Set<string>, sauf?: Set<string> }} options
|
|
222
211
|
* @returns {{ ticket: string, etape: string, question: string, qui: string, commande: string, cle: string, interrompu: boolean, arret: string | null }[]}
|
|
223
212
|
*/
|
|
224
|
-
export function questionsEnAttente(
|
|
213
|
+
export function questionsEnAttente(
|
|
214
|
+
racine,
|
|
215
|
+
circuits,
|
|
216
|
+
{ fermes = ticketsFermes, sauf = new Set() } = {}
|
|
217
|
+
) {
|
|
225
218
|
return enAttente(
|
|
226
|
-
|
|
219
|
+
circuits.filter(c => attendLeSuperviseur(c) && !sauf.has(cleDe(c))),
|
|
227
220
|
racine,
|
|
228
221
|
fermes
|
|
229
222
|
).map(enQuestion);
|
|
@@ -232,13 +225,14 @@ export function questionsEnAttente(racine, { fermes = ticketsFermes, sauf = new
|
|
|
232
225
|
// No ticket closed: the questions read without asking bd.
|
|
233
226
|
const aucunFerme = () => new Set();
|
|
234
227
|
|
|
235
|
-
// The questions of the repository at <racine> that never went up
|
|
236
|
-
// and now gone up; a question answered (its circuit runs again,
|
|
237
|
-
// one whose ticket <fermes> gives closed goes up without a
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
228
|
+
// The questions of the repository at <racine>, its circuits <circuits> read, that never went up
|
|
229
|
+
// (`questionsEnAttente`): returned, and now gone up; a question answered (its circuit runs again,
|
|
230
|
+
// or ended) leaves those gone up, and one whose ticket <fermes> gives closed goes up without a
|
|
231
|
+
// word. bd is asked of the new ones alone.
|
|
232
|
+
function releverLesNeuves(racine, circuits, fermes) {
|
|
233
|
+
return remonter(racine, circuits, avant => ({
|
|
234
|
+
cles: questionsEnAttente(racine, circuits, { fermes: aucunFerme }).map(q => q.cle),
|
|
235
|
+
rendu: questionsEnAttente(racine, circuits, { fermes, sauf: avant }),
|
|
242
236
|
}));
|
|
243
237
|
}
|
|
244
238
|
|
|
@@ -248,24 +242,24 @@ function releverLesNeuves(racine, fermes) {
|
|
|
248
242
|
* GitHub or Gerrit's attention set calls the one a change waits for): it ends only when a question
|
|
249
243
|
* that never went up waits for the supervisor (`questionsEnAttente`), whatever launched its
|
|
250
244
|
* circuit, and gives those questions, now gone up; a question already gone up (by a wait, or named
|
|
251
|
-
* at the opening) never ends it again,
|
|
252
|
-
*
|
|
253
|
-
*
|
|
254
|
-
* its
|
|
255
|
-
* nothing while it waits. One wait at a time per repository: a
|
|
256
|
-
* first runs. Its <signal> ends it with no question.
|
|
257
|
-
* @param {{ racine: string, fermes?: (racine: string, ids: string[]) => Set<string>, pas?: number, signal?: AbortSignal }} options
|
|
245
|
+
* at the opening) never ends it again, a question answered leaves those gone up, and the normal end
|
|
246
|
+
* of a circuit is never one. It reads the circuits every <pas> ms by <circuitsDe> (one call to the
|
|
247
|
+
* Temporal server, scripts/circuits-du-serveur.mjs, by default), as the UI of Temporal refreshes
|
|
248
|
+
* its list; a reading that fails (the server down) is tried again at the next step, the questions
|
|
249
|
+
* gone up kept. The session spends nothing while it waits. One wait at a time per repository: a
|
|
250
|
+
* second one is refused while the first runs. Its <signal> ends it with no question.
|
|
251
|
+
* @param {{ racine: string, fermes?: (racine: string, ids: string[]) => Set<string>, pas?: number, signal?: AbortSignal, circuitsDe?: (racine: string) => Promise<import('./circuits-du-serveur.mjs').CircuitDuServeur[]> }} options
|
|
258
252
|
* @returns {Promise<{ ticket: string, etape: string, question: string, qui: string, commande: string, cle: string }[]>}
|
|
259
253
|
* @throws {Error} another wait runs
|
|
260
254
|
*/
|
|
261
255
|
export async function attendreUneQuestion({
|
|
262
256
|
racine,
|
|
263
257
|
fermes = ticketsFermes,
|
|
264
|
-
pas =
|
|
258
|
+
pas = 5_000,
|
|
265
259
|
signal,
|
|
260
|
+
circuitsDe = circuitsDuServeur,
|
|
266
261
|
}) {
|
|
267
|
-
|
|
268
|
-
mkdirSync(dossier, { recursive: true });
|
|
262
|
+
mkdirSync(etatsDe(racine), { recursive: true });
|
|
269
263
|
const verrou = verrouDeLAttente(racine);
|
|
270
264
|
if (!prendreVerrou(verrou, { attendre: false })) {
|
|
271
265
|
let qui = '';
|
|
@@ -279,42 +273,38 @@ export async function attendreUneQuestion({
|
|
|
279
273
|
);
|
|
280
274
|
}
|
|
281
275
|
try {
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
276
|
+
while (!signal?.aborted) {
|
|
277
|
+
let circuits = null;
|
|
278
|
+
try {
|
|
279
|
+
circuits = await circuitsDe(racine);
|
|
280
|
+
} catch {
|
|
281
|
+
circuits = null;
|
|
286
282
|
}
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
const voir = () => {
|
|
290
|
-
if (fini) {
|
|
291
|
-
return;
|
|
292
|
-
}
|
|
293
|
-
const neuves = releverLesNeuves(racine, fermes);
|
|
283
|
+
if (circuits && !signal?.aborted) {
|
|
284
|
+
const neuves = releverLesNeuves(racine, circuits, fermes);
|
|
294
285
|
if (neuves.length) {
|
|
295
|
-
|
|
286
|
+
return neuves;
|
|
296
287
|
}
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
});
|
|
302
|
-
const minuteur = setInterval(voir, pas);
|
|
303
|
-
const finir = q => {
|
|
304
|
-
fini = true;
|
|
305
|
-
surveillance.close();
|
|
306
|
-
clearTimeout(differe);
|
|
307
|
-
clearInterval(minuteur);
|
|
308
|
-
resolve(q);
|
|
309
|
-
};
|
|
310
|
-
signal?.addEventListener('abort', () => finir([]), { once: true });
|
|
311
|
-
voir();
|
|
312
|
-
});
|
|
288
|
+
}
|
|
289
|
+
await attendre(pas, signal);
|
|
290
|
+
}
|
|
291
|
+
return [];
|
|
313
292
|
} finally {
|
|
314
293
|
lacherVerrou(verrou);
|
|
315
294
|
}
|
|
316
295
|
}
|
|
317
296
|
|
|
297
|
+
// Waits <ms> ms, or until <signal> ends the wait.
|
|
298
|
+
const attendre = (ms, signal) =>
|
|
299
|
+
new Promise(resolve => {
|
|
300
|
+
const fin = () => {
|
|
301
|
+
clearTimeout(minuteur);
|
|
302
|
+
resolve();
|
|
303
|
+
};
|
|
304
|
+
const minuteur = setTimeout(fin, ms);
|
|
305
|
+
signal?.addEventListener('abort', fin, { once: true });
|
|
306
|
+
});
|
|
307
|
+
|
|
318
308
|
/**
|
|
319
309
|
* The text that wakes the session of supervision on the questions <questions>: for each one, its
|
|
320
310
|
* ticket, step, who must answer it, its question and the command that answers it; then the wait to
|
|
@@ -341,26 +331,46 @@ export function texteDesQuestions(questions) {
|
|
|
341
331
|
* the one way a question of a circuit wakes the session; then the circuits of the repository,
|
|
342
332
|
* those whose ticket <fermes> gives closed left out: each one that runs, named; each one stopped on
|
|
343
333
|
* a question (a stop other than the supervisor's own « arrete »), with its question and the command
|
|
344
|
-
* that answers it; each one
|
|
345
|
-
* stopped and the
|
|
334
|
+
* that answers it; each one ended without its issue, with the command that resumes it. The
|
|
335
|
+
* stopped and the ended ones are then gone up: the wait does not give them again.
|
|
346
336
|
* @param {string} racine the root of the repository
|
|
347
|
-
*
|
|
348
|
-
*
|
|
337
|
+
* The circuits are read once, by <circuitsDe> (one call to the Temporal server,
|
|
338
|
+
* scripts/circuits-du-serveur.mjs, by default); a server that does not answer is said, and no
|
|
339
|
+
* question goes up.
|
|
340
|
+
* @param {{ fermes?: (racine: string, ids: string[]) => Set<string>,
|
|
341
|
+
* circuitsDe?: (racine: string) => Promise<import('./circuits-du-serveur.mjs').CircuitDuServeur[]> }} options
|
|
342
|
+
* @returns {Promise<string>}
|
|
349
343
|
*/
|
|
350
|
-
export function circuitsALOuverture(
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
344
|
+
export async function circuitsALOuverture(
|
|
345
|
+
racine,
|
|
346
|
+
{ fermes = ticketsFermes, circuitsDe = circuitsDuServeur } = {}
|
|
347
|
+
) {
|
|
348
|
+
let circuits = null;
|
|
349
|
+
let panne = null;
|
|
350
|
+
try {
|
|
351
|
+
circuits = await circuitsDe(racine);
|
|
352
|
+
} catch (e) {
|
|
353
|
+
const message = String(e?.message ?? e).split('\n')[0];
|
|
354
|
+
panne =
|
|
355
|
+
e instanceof ServeurMuet
|
|
356
|
+
? `${e.message} : les circuits ne se lisent pas.`
|
|
357
|
+
: `Les circuits ne se lisent pas : ${message}.`;
|
|
358
|
+
}
|
|
359
|
+
const questions = circuits
|
|
360
|
+
? remonter(racine, circuits, () => {
|
|
361
|
+
const q = questionsEnAttente(racine, circuits, { fermes });
|
|
362
|
+
return { cles: q.map(x => x.cle), rendu: q };
|
|
363
|
+
})
|
|
364
|
+
: [];
|
|
355
365
|
const tournent = enAttente(
|
|
356
|
-
|
|
366
|
+
(circuits ?? []).filter(c => c.vivant),
|
|
357
367
|
racine,
|
|
358
368
|
fermes
|
|
359
369
|
).map(c => ({ ticket: c.ticket, ligne: `- ${c.ticket} tourne, à ${ou(c)}.` }));
|
|
360
370
|
const enLigne = q => ({
|
|
361
371
|
ticket: q.ticket,
|
|
362
372
|
ligne: q.interrompu
|
|
363
|
-
? `- ${q.ticket}
|
|
373
|
+
? `- ${q.ticket} a fini sans son issue (aucun arrêt écrit), à ${q.etape} : relance-le sans attendre le mot du responsable, \`${q.commande}\`.`
|
|
364
374
|
: [
|
|
365
375
|
`- ${q.ticket} est arrêté sur une question (${q.arret}), à ${q.etape}, au ${q.qui} : ${q.question.replace(/\n/g, '\n ')}`,
|
|
366
376
|
` La réponse : \`${q.commande}\`.`,
|
|
@@ -372,6 +382,7 @@ export function circuitsALOuverture(racine, { fermes = ticketsFermes } = {}) {
|
|
|
372
382
|
return [
|
|
373
383
|
"## L'attente des questions",
|
|
374
384
|
"Dès ta première réponse, sans attendre le mot du responsable, lance en arrière-plan (`run_in_background`) l'attente des questions : `npx grillhouse superviseur --attendre`. Elle se termine sur la question neuve d'un circuit, quel que soit son lanceur, et te réveille ainsi ; un lancement de circuit rend la main tout de suite, et la fin normale d'un circuit ne te réveille pas : le panneau la montre.",
|
|
385
|
+
...(panne ? ['', '## Les circuits du dépôt', panne] : []),
|
|
375
386
|
...(nommes.length ? ['', '## Les circuits du dépôt', ...nommes.map(n => n.ligne)] : []),
|
|
376
387
|
].join('\n');
|
|
377
388
|
}
|
|
@@ -386,9 +397,9 @@ const git = (racine, ...args) =>
|
|
|
386
397
|
* nothing), the lock taken when it is free.
|
|
387
398
|
* @param {string} racine the directory the session opens in
|
|
388
399
|
* @param {{ env?: Record<string, string | undefined> }} options
|
|
389
|
-
* @returns {string}
|
|
400
|
+
* @returns {Promise<string>}
|
|
390
401
|
*/
|
|
391
|
-
function superviseur(racine, { env = process.env } = {}) {
|
|
402
|
+
async function superviseur(racine, { env = process.env } = {}) {
|
|
392
403
|
if (env.BEADS_ACTOR) {
|
|
393
404
|
return '';
|
|
394
405
|
}
|
|
@@ -449,7 +460,7 @@ if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) {
|
|
|
449
460
|
process.exitCode = 1;
|
|
450
461
|
}
|
|
451
462
|
} else {
|
|
452
|
-
const texte = superviseur(process.argv[2] ?? process.cwd());
|
|
463
|
+
const texte = await superviseur(process.argv[2] ?? process.cwd());
|
|
453
464
|
if (texte) {
|
|
454
465
|
process.stdout.write(`${texte}\n`);
|
|
455
466
|
}
|