@roomi-fields/grillhouse 0.55.1 → 0.55.3
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 +28 -2
- package/charte/plan.md +8 -0
- package/charte/preuve.md +6 -2
- package/charte/superviseur.md +19 -0
- package/charte/tests.md +15 -0
- package/charte.md +1 -1
- package/dist/temporal/circuit/activites.js +2 -2
- package/dist/temporal/circuit/activites.js.map +1 -1
- package/dist/temporal/circuit/client.d.ts +2 -1
- package/dist/temporal/circuit/client.js +19 -7
- package/dist/temporal/circuit/client.js.map +1 -1
- package/dist/temporal/nuits/activites.d.ts +0 -4
- package/dist/temporal/nuits/activites.js +1 -7
- package/dist/temporal/nuits/activites.js.map +1 -1
- package/dist/temporal/nuits/choix.d.ts +0 -15
- package/dist/temporal/nuits/choix.js +0 -20
- package/dist/temporal/nuits/choix.js.map +1 -1
- package/dist/temporal/nuits/contrat.d.ts +0 -8
- package/dist/temporal/places/client.d.ts +2 -2
- package/dist/temporal/places/client.js +3 -2
- package/dist/temporal/places/client.js.map +1 -1
- package/dist/temporal/places/deroule.js +7 -1
- package/dist/temporal/places/deroule.js.map +1 -1
- package/docs/INTERFACE.md +2 -1
- package/docs/architecture/circuit.md +3 -3
- package/docs/architecture/entree.md +1 -1
- package/docs/architecture/greffon.md +2 -3
- package/docs/architecture/installation.md +2 -2
- package/docs/architecture/machine.md +6 -4
- package/docs/architecture/tests.md +51 -7
- package/hooks/hooks.json +0 -4
- package/package.json +1 -1
- package/scripts/aiguillage.mjs +1 -2
- package/scripts/bilan.mjs +116 -25
- package/scripts/branche-de-nuit.mjs +1 -15
- package/scripts/coeurs-dedies.mjs +19 -2
- package/scripts/composition-des-langages.mjs +2 -2
- package/scripts/consommation-des-passes.mjs +0 -4
- package/scripts/consommation.mjs +2 -2
- package/scripts/crochets.mjs +1 -1
- package/scripts/etapes.mjs +1 -10
- package/scripts/integration/file.mjs +2 -12
- package/scripts/jointure.d.ts +3 -0
- package/scripts/langages/c/index.mjs +2 -0
- package/scripts/langages/cargo/index.mjs +2 -0
- package/scripts/langages/python/index.mjs +2 -0
- package/scripts/langages/typescript/index.mjs +2 -0
- package/scripts/machine.mjs +0 -1
- package/scripts/mesure-de-la-machine.d.mts +3 -0
- package/scripts/mesure-de-la-machine.mjs +10 -2
- package/scripts/migrations/nuit-yml-retire.mjs +34 -4
- package/scripts/migrations/table-des-consommations.mjs +36 -0
- package/scripts/migrations.mjs +2 -0
- package/scripts/nuit.sh +3 -14
- package/scripts/passe-de-la-machine.mjs +25 -2
- package/scripts/places-de-la-machine.mjs +4 -39
- package/scripts/places-du-serveur.mjs +18 -4
- package/scripts/plafond-de-la-machine.d.mts +1 -1
- package/scripts/plafond-de-la-machine.mjs +15 -17
- package/scripts/regles-des-places.d.mts +2 -0
- package/scripts/regles-des-places.mjs +12 -4
- package/scripts/resultats.mjs +18 -14
- package/scripts/seances.mjs +7 -1
- package/scripts/sous-commandes.mjs +0 -1
- package/scripts/suiveur.mjs +96 -19
- package/scripts/tableau.mjs +16 -14
- package/scripts/transitions.mjs +3 -0
- package/scripts/un-commit-par-ticket.mjs +8 -0
- package/skills/developpeur/SKILL.md +1 -1
- package/skills/explorateur/SKILL.md +2 -2
- package/skills/questionneur/SKILL.md +3 -2
- package/skills/relecteur/SKILL.md +1 -1
- package/skills/testwriter/SKILL.md +1 -1
- package/scripts/attente-au-tour.mjs +0 -93
- package/scripts/poussee-retiree.mjs +0 -19
package/scripts/suiveur.mjs
CHANGED
|
@@ -130,15 +130,67 @@ export function rebondir(ms, mesure) {
|
|
|
130
130
|
};
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
+
|
|
134
|
+
// The version a package folder's package.json holds, or null when the file is unreadable,
|
|
135
|
+
// incomplete or without a version.
|
|
136
|
+
function versionDe(paquet) {
|
|
137
|
+
try {
|
|
138
|
+
const v = JSON.parse(readFileSync(path.join(paquet, 'package.json'), 'utf8')).version;
|
|
139
|
+
return typeof v === 'string' ? v : null;
|
|
140
|
+
} catch {
|
|
141
|
+
return null;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Watches the folder of the package the follower runs (the folder survives the replacement of its
|
|
147
|
+
* package.json by an upgrade): on a change, once the burst is over (`rebond`), the version is
|
|
148
|
+
* read again, and `surVersion` is asked, at most once, when it differs from the one read at the
|
|
149
|
+
* start. An unreadable or incomplete file changes nothing.
|
|
150
|
+
* @param {{ paquet: string, rebond?: number, surVersion: () => void }} o
|
|
151
|
+
* @returns {{ fermer: () => void }}
|
|
152
|
+
*/
|
|
153
|
+
export function veillerLaVersion({ paquet, rebond = REBOND, surVersion }) {
|
|
154
|
+
const depart = versionDe(paquet);
|
|
155
|
+
let fini = false;
|
|
156
|
+
const r = rebondir(rebond, () => {
|
|
157
|
+
const v = versionDe(paquet);
|
|
158
|
+
if (!fini && v !== null && v !== depart) {
|
|
159
|
+
fini = true;
|
|
160
|
+
surVersion();
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
let veille = null;
|
|
164
|
+
try {
|
|
165
|
+
veille = watch(paquet, {}, () => {
|
|
166
|
+
if (!fini) {
|
|
167
|
+
r.demander();
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
} catch {
|
|
171
|
+
// A folder that cannot be watched is not followed.
|
|
172
|
+
}
|
|
173
|
+
return {
|
|
174
|
+
fermer() {
|
|
175
|
+
fini = true;
|
|
176
|
+
r.annuler();
|
|
177
|
+
veille?.close();
|
|
178
|
+
},
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
|
|
133
182
|
/**
|
|
134
183
|
* Watches the files that tell the board changed: `.beads/`, and the git state (HEAD, packed-refs,
|
|
135
|
-
* the references) of the common directory. Each change asks, folded by `rebond`, for `quand`.
|
|
136
|
-
*
|
|
184
|
+
* the references) of the common directory. Each change asks, folded by `rebond`, for `quand`. With
|
|
185
|
+
* `paquet` and `surVersion`, it also watches the package's version (`veillerLaVersion`): on a new
|
|
186
|
+
* version it closes itself, then calls `surVersion`.
|
|
187
|
+
* @param {{ racine: string, commun: string, rebond?: number, quand: () => void, paquet?: string, surVersion?: () => void }} o
|
|
137
188
|
* @returns {{ fermer: () => void }}
|
|
138
189
|
*/
|
|
139
|
-
export function veiller({ racine, commun, rebond = REBOND, quand }) {
|
|
190
|
+
export function veiller({ racine, commun, rebond = REBOND, quand, paquet, surVersion }) {
|
|
140
191
|
const r = rebondir(rebond, quand);
|
|
141
192
|
const veilles = [];
|
|
193
|
+
let version = null;
|
|
142
194
|
const sur = (dossier, options, garde) => {
|
|
143
195
|
try {
|
|
144
196
|
veilles.push(
|
|
@@ -157,14 +209,24 @@ export function veiller({ racine, commun, rebond = REBOND, quand }) {
|
|
|
157
209
|
const duCommun = ['HEAD', 'packed-refs', 'tableau-repere.json', FICHIER_BD];
|
|
158
210
|
sur(commun, {}, nom => duCommun.includes(nom));
|
|
159
211
|
sur(path.join(commun, 'refs'), { recursive: true }, () => true);
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
},
|
|
212
|
+
const fermer = () => {
|
|
213
|
+
r.annuler();
|
|
214
|
+
version?.fermer();
|
|
215
|
+
for (const v of veilles) {
|
|
216
|
+
v.close();
|
|
217
|
+
}
|
|
167
218
|
};
|
|
219
|
+
if (paquet && surVersion) {
|
|
220
|
+
version = veillerLaVersion({
|
|
221
|
+
paquet,
|
|
222
|
+
rebond,
|
|
223
|
+
surVersion: () => {
|
|
224
|
+
fermer();
|
|
225
|
+
surVersion();
|
|
226
|
+
},
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
return { fermer };
|
|
168
230
|
}
|
|
169
231
|
|
|
170
232
|
/**
|
|
@@ -261,10 +323,15 @@ export function relayer(commun, surLigne) {
|
|
|
261
323
|
* The follower: measures on events, writes (or relays) and gives each line to `surLigne`, until
|
|
262
324
|
* `fermer`.
|
|
263
325
|
* @param {string} racine
|
|
264
|
-
*
|
|
326
|
+
* When the version of `paquet` (its folder) changes, the follower closes everything it holds (watches,
|
|
327
|
+
* poll, lock) and calls `surVersion`, once: the command ends and the pane starts it again.
|
|
328
|
+
* @param {{ projets?: string[], surLigne: (ligne: string) => void, mesure: Function, dossierCommun: (racine: string) => string | null, paquet?: string, surVersion?: () => void }} o
|
|
265
329
|
* @returns {Promise<{ fermer: () => void }>}
|
|
266
330
|
*/
|
|
267
|
-
export async function suivre(
|
|
331
|
+
export async function suivre(
|
|
332
|
+
racine,
|
|
333
|
+
{ projets = [], surLigne, mesure, dossierCommun, paquet, surVersion }
|
|
334
|
+
) {
|
|
268
335
|
const { circuitsDuServeur } = await import('./circuits-du-serveur.mjs');
|
|
269
336
|
const commun = dossierCommun(racine);
|
|
270
337
|
if (!commun) {
|
|
@@ -359,12 +426,22 @@ export async function suivre(racine, { projets = [], surLigne, mesure, dossierCo
|
|
|
359
426
|
relais = relayer(commun, surLigne);
|
|
360
427
|
releve = setInterval(() => void ecrire_(), RELEVE);
|
|
361
428
|
}
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
429
|
+
let version = null;
|
|
430
|
+
const fermer = () => {
|
|
431
|
+
ferme = true;
|
|
432
|
+
clearInterval(releve);
|
|
433
|
+
relais?.fermer();
|
|
434
|
+
ecrivain?.fermer();
|
|
435
|
+
version?.fermer();
|
|
369
436
|
};
|
|
437
|
+
if (paquet && surVersion) {
|
|
438
|
+
version = veillerLaVersion({
|
|
439
|
+
paquet,
|
|
440
|
+
surVersion: () => {
|
|
441
|
+
fermer();
|
|
442
|
+
surVersion();
|
|
443
|
+
},
|
|
444
|
+
});
|
|
445
|
+
}
|
|
446
|
+
return { fermer };
|
|
370
447
|
}
|
package/scripts/tableau.mjs
CHANGED
|
@@ -110,7 +110,7 @@ import {
|
|
|
110
110
|
} from 'node:fs';
|
|
111
111
|
import os from 'node:os';
|
|
112
112
|
import path from 'node:path';
|
|
113
|
-
import { pathToFileURL } from 'node:url';
|
|
113
|
+
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
114
114
|
import {
|
|
115
115
|
AUTO,
|
|
116
116
|
bouclesDe,
|
|
@@ -1142,8 +1142,8 @@ export const remonteesDe = racine =>
|
|
|
1142
1142
|
* The stops gone up of the repository at <racine>, each with its key, `depuis` (the time of its
|
|
1143
1143
|
* first going up) and `presentee` (the time of its last presentation), in ms; `lue` (the time a
|
|
1144
1144
|
* turn of the session read the message that held it) and `chez` (the time the supervisor carried
|
|
1145
|
-
* it to the owner) when it has them. An
|
|
1146
|
-
*
|
|
1145
|
+
* it to the owner) when it has them. An entry without its `depuis` or `presentee` takes the time
|
|
1146
|
+
* <maintenant> of the reading; an entry that is a bare key is ignored. A file that does not read
|
|
1147
1147
|
* holds none.
|
|
1148
1148
|
* @param {string} racine
|
|
1149
1149
|
* @param {number} maintenant
|
|
@@ -1155,17 +1155,15 @@ export function lireLesRemontees(racine, maintenant) {
|
|
|
1155
1155
|
if (!Array.isArray(lu?.remontees)) {
|
|
1156
1156
|
return [];
|
|
1157
1157
|
}
|
|
1158
|
-
return lu.remontees
|
|
1159
|
-
typeof r === '
|
|
1160
|
-
|
|
1161
|
-
:
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
}
|
|
1168
|
-
);
|
|
1158
|
+
return lu.remontees
|
|
1159
|
+
.filter(r => typeof r === 'object' && r !== null)
|
|
1160
|
+
.map(r => ({
|
|
1161
|
+
cle: String(r.cle),
|
|
1162
|
+
depuis: Number.isFinite(r.depuis) ? r.depuis : maintenant,
|
|
1163
|
+
presentee: Number.isFinite(r.presentee) ? r.presentee : maintenant,
|
|
1164
|
+
...(Number.isFinite(r.lue) ? { lue: r.lue } : {}),
|
|
1165
|
+
...(Number.isFinite(r.chez) ? { chez: r.chez } : {}),
|
|
1166
|
+
}));
|
|
1169
1167
|
} catch {
|
|
1170
1168
|
return [];
|
|
1171
1169
|
}
|
|
@@ -3781,6 +3779,10 @@ if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) {
|
|
|
3781
3779
|
mesure: tableau,
|
|
3782
3780
|
dossierCommun,
|
|
3783
3781
|
surLigne: ligne => process.stdout.write(`${ligne}\n`),
|
|
3782
|
+
// The package folder this code runs from: a new version ends the follower, the pane starts
|
|
3783
|
+
// it again with the new code.
|
|
3784
|
+
paquet: fileURLToPath(new URL('..', import.meta.url)),
|
|
3785
|
+
surVersion: () => fin(),
|
|
3784
3786
|
});
|
|
3785
3787
|
// The pane that started the follower is gone when the standard output closes or its process
|
|
3786
3788
|
// is no longer the parent. The end closes the follower and the watch of the parent; the
|
package/scripts/transitions.mjs
CHANGED
|
@@ -294,6 +294,9 @@ export const phaseDuFait = (fait, parametres) => {
|
|
|
294
294
|
if (fait === 'seanceDuGeste') {
|
|
295
295
|
return phaseDeLaSeance('explorateur', 'geste');
|
|
296
296
|
}
|
|
297
|
+
if (fait === 'relecture') {
|
|
298
|
+
return phaseDeLaSeance('relecteur', undefined);
|
|
299
|
+
}
|
|
297
300
|
return fait === 'seance' && typeof parametres.role === 'string'
|
|
298
301
|
? phaseDeLaSeance(
|
|
299
302
|
parametres.role,
|
|
@@ -52,6 +52,14 @@ function named(line, prefix) {
|
|
|
52
52
|
return [...new Set(line.match(re) ?? [])];
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
+
// The ticket a commit subject names in the forms the circuit and its projects write it, under any
|
|
56
|
+
// prefix: last, in parentheses (« feat(x): titre (demo-7) »), or first, before « : »
|
|
57
|
+
// (« demo-7 : lot »); null without one.
|
|
58
|
+
const SUJET_NOMME = /(?:^|\()([a-z][a-z0-9]*(?:-[a-z0-9]+)*-[a-z0-9]+(?:\.[0-9]+)*)(?:\)$| :)/;
|
|
59
|
+
export function ticketDuSujet(sujet) {
|
|
60
|
+
return SUJET_NOMME.exec(sujet)?.[1] ?? null;
|
|
61
|
+
}
|
|
62
|
+
|
|
55
63
|
// The ticket ids the title line of a message names, without duplicates.
|
|
56
64
|
export function tickets(message, prefix) {
|
|
57
65
|
return named(title(message), prefix);
|
|
@@ -220,7 +220,7 @@ son adresse) : le circuit la consigne fermée sous ton ticket, et tu continues.
|
|
|
220
220
|
tu ne tournes jamais sur un rouge que tu as dit hors de ta portée.
|
|
221
221
|
- **Un fait repris porte sa pièce** : un fait que tu reprends d'un autre agent (une passation, un
|
|
222
222
|
rapport, un constat) se relit à sa pièce avant que tu t'appuies dessus, et ta raison ou ta
|
|
223
|
-
question porte la sienne, `piece` (fichier:ligne depuis la racine de la copie, ou « $ commande »
|
|
223
|
+
question porte la sienne, `piece` (fichier:ligne, plage fichier:ligne-ligne ou liste fichier:ligne,ligne depuis la racine de la copie, ou « $ commande »
|
|
224
224
|
et sa sortie), que le circuit cherche dans la copie. Ainsi une ligne mal lue s'arrête à toi.
|
|
225
225
|
- **Une relance reprend ta séance** : après des contrôles rouges, le circuit reprend ta séance avec
|
|
226
226
|
une consigne courte, le rapport neuf ; ta consigne, ta compétence et ce que tu as lu restent
|
|
@@ -70,7 +70,7 @@ avant de nommer un correctif ou un verdict. Ainsi le plan part de la cause.
|
|
|
70
70
|
`mcp__codegraph__codegraph_explore` ou `codegraph explore <symboles>` pour l'appel. _Fini quand_ je sais quel paquet fournit chaque élément, et quel
|
|
71
71
|
paquet le lit.
|
|
72
72
|
2. **Le plan.** Ma fiche porte le plan, que le circuit écrit au ticket :
|
|
73
|
-
- `criteres` : chacun un comportement que ses tests mesurent, sans son numéro ; un critère
|
|
73
|
+
- `criteres` : chacun un comportement que ses tests mesurent, sans son numéro, écrit comme un comportement observable selon la règle du plan (charte, module `plan`, « Un critère dit un comportement observable ») ; un critère
|
|
74
74
|
répond à un besoin réel de l'usage actuel, et se confronte à la spécification. **Je fixe la
|
|
75
75
|
taille du test au critère** (charte, module `preuve`, « La taille d'un test suit la pyramide ») : par défaut il
|
|
76
76
|
se prouve petit, et je ne dis rien ; je ne nomme que l'exception, avec sa raison (comme un
|
|
@@ -164,7 +164,7 @@ avant de nommer un correctif ou un verdict. Ainsi le plan part de la cause.
|
|
|
164
164
|
- `questions` : seulement ce que je ne sais pas trancher, ou ce qui revient au responsable. Ce
|
|
165
165
|
que je sais trancher et recommande, je l'applique au plan (écarter un paquet qui n'a rien à
|
|
166
166
|
changer, par exemple) et je le dis dans ma fiche. Chaque question : chacune avec ses options, ma recommandation et sa
|
|
167
|
-
`piece` (fichier:ligne depuis la racine de la copie, ou « $ commande » et sa sortie), que le
|
|
167
|
+
`piece` (fichier:ligne, plage fichier:ligne-ligne ou liste fichier:ligne,ligne depuis la racine de la copie, ou « $ commande » et sa sortie), que le
|
|
168
168
|
circuit cherche dans la copie ; elles montent au superviseur. Chacune dit pourquoi elle monte,
|
|
169
169
|
son `motif` : `langage`, `architecture` ou `écart à la référence`, ce qui revient au
|
|
170
170
|
responsable, ou `sans réponse`, je n'ai pas la réponse. Une question sans motif, ou au motif
|
|
@@ -27,12 +27,13 @@ la charte commune est dans mon contexte. Aucune question ne m'est donnée d'avan
|
|
|
27
27
|
2. **Trouver le flou.** Je relève les endroits où la phrase ne vient pas : un mot que je ne
|
|
28
28
|
comprends pas, un cas sans exemple, une référence mûre qui ferait autrement, un symptôme traité
|
|
29
29
|
à la place de sa cause, un critère ou une règle du cadre que la proposition côtoie sans la
|
|
30
|
-
nommer
|
|
30
|
+
nommer, un critère qui impose un texte ou une forme hors de l'exception de la règle du plan
|
|
31
|
+
(charte, module `plan`, « Un critère dit un comportement observable »). _Fini quand_ chaque endroit relevé a son appui : la phrase de la proposition, et la
|
|
31
32
|
règle, le critère ou la référence qui le fait paraître flou.
|
|
32
33
|
3. **Poser mes questions.** Deux à quatre, choisies à l'intuition là où le flou pèse le plus sur
|
|
33
34
|
le produit, courtes, dans les mots de la proposition. Souvent la plus utile est la plus simple :
|
|
34
35
|
« je n'ai pas compris », « donne plus de détails », « illustre par un exemple ». Chacune dit ce
|
|
35
|
-
qu'elle vise : `flou`, `intention`, `référence`, `règle` ou `critère
|
|
36
|
+
qu'elle vise : `flou`, `intention`, `référence`, `règle` ou `critère` ; un critère relevé pour son texte ou sa forme se pose en question `règle`, qui monte. _Fini quand_ chaque
|
|
36
37
|
question porte sur un endroit relevé à l'étape 2. Quand un critère affirme ce que contient ou
|
|
37
38
|
fait une pièce fichier:ligne et que cette pièce dit autre chose, je le signale : une question
|
|
38
39
|
`critère`, sa pièce la ligne citée ; l'explorateur la corrige sans que rien monte. Je ne
|
|
@@ -183,7 +183,7 @@ par son exemple. Ainsi le verdict repose sur des pièces.
|
|
|
183
183
|
|
|
184
184
|
Ton verdict est ta fiche, que ton schéma décrit et qui finit ta séance : `verdict` `ACCEPTÉ` ou
|
|
185
185
|
`RENDU`, ta `conformite` (une ligne par élément du lot), et chaque constat de `constats`, son sujet
|
|
186
|
-
(`titre`), son genre (`genre`), sa preuve (`corps`) et sa pièce (`piece`, fichier:ligne depuis la
|
|
186
|
+
(`titre`), son genre (`genre`), sa preuve (`corps`) et sa pièce (`piece`, fichier:ligne, plage fichier:ligne-ligne ou liste fichier:ligne,ligne depuis la
|
|
187
187
|
racine de la copie, ou « $ commande » et sa sortie). Un fait que tu reprends d'un autre agent (une
|
|
188
188
|
passation, un rapport, ta relecture d'avant) se relit à sa pièce avant que tu t'appuies dessus ; le
|
|
189
189
|
circuit cherche chaque pièce fichier:ligne dans la copie et refuse une fiche dont une pièce est
|
|
@@ -308,7 +308,7 @@ séance finit sur ce que tu sais, et le circuit le lit.
|
|
|
308
308
|
|
|
309
309
|
**Un fait repris porte sa pièce** : un fait que tu reprends d'un autre agent (une passation, un
|
|
310
310
|
rapport, un constat) se relit à sa pièce avant que tu t'appuies dessus, et ta raison ou ta question
|
|
311
|
-
porte la sienne, `piece` (fichier:ligne depuis la racine de la copie, ou « $ commande » et sa
|
|
311
|
+
porte la sienne, `piece` (fichier:ligne, plage fichier:ligne-ligne ou liste fichier:ligne,ligne depuis la racine de la copie, ou « $ commande » et sa
|
|
312
312
|
sortie), que le circuit cherche dans la copie. Ainsi une ligne mal lue s'arrête à toi.
|
|
313
313
|
|
|
314
314
|
Une preuve refusée reprend ta séance, avec une consigne courte, le rapport neuf de la preuve ;
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// The signal of the supervisor's turn: the hook UserPromptSubmit of the mod runs it at each turn
|
|
3
|
-
// of a session of supervision (`npx grillhouse attente-au-tour`), and what it writes reaches the
|
|
4
|
-
// session. A question of a circuit is named again until it is answered, as a review requested on
|
|
5
|
-
// GitHub is. Mechanism: greffon.md, §5.1.
|
|
6
|
-
//
|
|
7
|
-
// - It names each circuit that waits for the supervisor (`questionsEnAttente`, the one source of
|
|
8
|
-
// the opening and of the greffon's reading), a circuit ended without its issue included: its
|
|
9
|
-
// ticket, its question, the command that answers it. It asks for no wait and reads no lock.
|
|
10
|
-
// - A question already pushed by the greffon is named again: the file of the stops gone up is not
|
|
11
|
-
// read.
|
|
12
|
-
// - Out of a git repository, in an agent's copy (a worktree) and in the session of a role that
|
|
13
|
-
// the circuit launches (BEADS_ACTOR set), nothing is said.
|
|
14
|
-
// Exit 0, whatever it finds.
|
|
15
|
-
import { spawnSync } from 'node:child_process';
|
|
16
|
-
import path from 'node:path';
|
|
17
|
-
import { pathToFileURL } from 'node:url';
|
|
18
|
-
import { circuitsDuServeur } from './circuits-du-serveur.mjs';
|
|
19
|
-
import { ligneDeQuestion, questionsEnAttente, ticketsHorsAttente } from './superviseur.mjs';
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* The root of the repository whose session of supervision works in <dossier>: null out of a git
|
|
23
|
-
* repository, in an agent's copy (a worktree) and in the session of a role that the circuit
|
|
24
|
-
* launches (BEADS_ACTOR set).
|
|
25
|
-
* @param {string} dossier
|
|
26
|
-
* @param {Record<string, string | undefined>} env
|
|
27
|
-
* @returns {string | null}
|
|
28
|
-
*/
|
|
29
|
-
function racineDeLaSupervision(dossier, env = process.env) {
|
|
30
|
-
if (env.BEADS_ACTOR) {
|
|
31
|
-
return null;
|
|
32
|
-
}
|
|
33
|
-
const r = spawnSync(
|
|
34
|
-
'git',
|
|
35
|
-
['-C', dossier, 'rev-parse', '--path-format=absolute', '--git-dir', '--git-common-dir'],
|
|
36
|
-
{ encoding: 'utf8' }
|
|
37
|
-
);
|
|
38
|
-
if (r.status !== 0) {
|
|
39
|
-
return null;
|
|
40
|
-
}
|
|
41
|
-
const [dossierGit, commun] = r.stdout.trim().split('\n');
|
|
42
|
-
if (path.resolve(dossierGit) !== path.resolve(commun)) {
|
|
43
|
-
return null;
|
|
44
|
-
}
|
|
45
|
-
return path.dirname(commun);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* What the session of supervision in <dossier> reads at its turn: the circuits that wait for the
|
|
50
|
-
* supervisor, each with its ticket, its question and the command that answers it; empty when no
|
|
51
|
-
* circuit waits, or out of a session of supervision.
|
|
52
|
-
* @param {string} dossier the directory the session works in
|
|
53
|
-
* @param {{ env?: Record<string, string | undefined>,
|
|
54
|
-
* fermes?: (racine: string, ids: string[]) => Set<string> | null,
|
|
55
|
-
* circuitsDe?: (racine: string) => Promise<import('./circuits-du-serveur.mjs').CircuitDuServeur[]> }} options
|
|
56
|
-
* @returns {Promise<string>}
|
|
57
|
-
*/
|
|
58
|
-
export async function attenteAuTour(
|
|
59
|
-
dossier,
|
|
60
|
-
{ env = process.env, fermes = ticketsHorsAttente, circuitsDe = circuitsDuServeur } = {}
|
|
61
|
-
) {
|
|
62
|
-
const racine = racineDeLaSupervision(dossier, env);
|
|
63
|
-
if (!racine) {
|
|
64
|
-
return '';
|
|
65
|
-
}
|
|
66
|
-
let circuits;
|
|
67
|
-
try {
|
|
68
|
-
circuits = await circuitsDe(racine);
|
|
69
|
-
} catch {
|
|
70
|
-
return '';
|
|
71
|
-
}
|
|
72
|
-
const questions = questionsEnAttente(racine, circuits, { fermes });
|
|
73
|
-
if (!questions.length) {
|
|
74
|
-
return '';
|
|
75
|
-
}
|
|
76
|
-
return [
|
|
77
|
-
questions.length > 1
|
|
78
|
-
? '## Circuits en attente du superviseur'
|
|
79
|
-
: '## Circuit en attente du superviseur',
|
|
80
|
-
...questions.map(q =>
|
|
81
|
-
q.interrompu
|
|
82
|
-
? `- ${q.ticket} a fini sans son issue, à ${q.etape} : \`${q.commande}\`.`
|
|
83
|
-
: `- ${ligneDeQuestion(q, { courte: true })}`
|
|
84
|
-
),
|
|
85
|
-
].join('\n');
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) {
|
|
89
|
-
const texte = await attenteAuTour(process.cwd());
|
|
90
|
-
if (texte) {
|
|
91
|
-
process.stdout.write(`${texte}\n`);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
// The refusal of the key `grillhouse.poussee` (packages/grillhouse/docs/architecture/entree.md
|
|
2
|
-
// §3.3, « La file et main »; §5.1): the frame carries no such key, one branch, main, receives every lot (the
|
|
3
|
-
// trunk-based development of Google and Chromium). This one reading serves the queue
|
|
4
|
-
// (scripts/integration/file.mjs), the night (scripts/nuit.sh) and the pre-push guard
|
|
5
|
-
// (scripts/branche-de-nuit.mjs): whatever the value of the key (null, an object, a string), the
|
|
6
|
-
// project that carries it is refused by its name, with the gesture (remove the key).
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* The refusal line of a package.json that carries `grillhouse.poussee`, or null without it.
|
|
10
|
-
* @param {unknown} pkg
|
|
11
|
-
* @returns {string | null}
|
|
12
|
-
*/
|
|
13
|
-
export function pousseeRetiree(pkg) {
|
|
14
|
-
const grillhouse = pkg?.grillhouse;
|
|
15
|
-
if (!grillhouse || typeof grillhouse !== 'object' || !Object.hasOwn(grillhouse, 'poussee')) {
|
|
16
|
-
return null;
|
|
17
|
-
}
|
|
18
|
-
return 'La clé grillhouse.poussee est retirée du cadre : main reçoit seule chaque lot. Retire-la du package.json (npm pkg delete grillhouse.poussee).';
|
|
19
|
-
}
|