@roomi-fields/grillhouse 0.55.2 → 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 +24 -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/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/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 +3 -1
- 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/composition-des-langages.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/migrations/nuit-yml-retire.mjs +34 -4
- package/scripts/nuit.sh +3 -14
- package/scripts/places-de-la-machine.mjs +0 -34
- package/scripts/regles-des-places.mjs +2 -2
- 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/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/bilan.mjs
CHANGED
|
@@ -81,14 +81,7 @@ import os from 'node:os';
|
|
|
81
81
|
import path from 'node:path';
|
|
82
82
|
import { StringDecoder } from 'node:string_decoder';
|
|
83
83
|
import { REGISTRE } from './adresse-du-registre.mjs';
|
|
84
|
-
import {
|
|
85
|
-
bilansGardes,
|
|
86
|
-
dollars,
|
|
87
|
-
dossier,
|
|
88
|
-
minutes,
|
|
89
|
-
pourcent,
|
|
90
|
-
SUFFIXE,
|
|
91
|
-
} from './bilans-gardes.mjs';
|
|
84
|
+
import { bilansGardes, dollars, dossier, minutes, pourcent, SUFFIXE } from './bilans-gardes.mjs';
|
|
92
85
|
import { lireLaConsommation } from './consommation-des-passes.mjs';
|
|
93
86
|
import { lireLeJournal } from './journal-des-etats.mjs';
|
|
94
87
|
import { pathToFileURL } from 'node:url';
|
|
@@ -105,6 +98,8 @@ import {
|
|
|
105
98
|
} from './etapes.mjs';
|
|
106
99
|
import { lireFichier } from './tableau.mjs';
|
|
107
100
|
import { tauxDeRejeu } from './registre-des-entrees.mjs';
|
|
101
|
+
import { langageDe } from './langages.mjs';
|
|
102
|
+
import { ticketDuSujet } from './un-commit-par-ticket.mjs';
|
|
108
103
|
|
|
109
104
|
export { bilansGardes, enBref } from './bilans-gardes.mjs';
|
|
110
105
|
|
|
@@ -253,7 +248,9 @@ function fusion(l) {
|
|
|
253
248
|
// The parts of the disjoint intervals <a> that lie in the intervals <b>.
|
|
254
249
|
const dans = (a, b) =>
|
|
255
250
|
fusion(
|
|
256
|
-
a.flatMap(([d, f]) =>
|
|
251
|
+
a.flatMap(([d, f]) =>
|
|
252
|
+
b.map(([x, y]) => [Math.max(d, x), Math.min(f, y)]).filter(([x, y]) => y > x)
|
|
253
|
+
)
|
|
257
254
|
);
|
|
258
255
|
// The parts of the intervals <a> outside the intervals <b>.
|
|
259
256
|
function sansLes(a, b) {
|
|
@@ -502,10 +499,10 @@ export function bilan({
|
|
|
502
499
|
// The causes of « entre deux étapes »: each instant of the gaps goes to the first cause of the
|
|
503
500
|
// list that a trace covers (a session starting, a place or cores, another circuit, the queue),
|
|
504
501
|
// the rest unattributed.
|
|
505
|
-
const trous = sansLes(
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
);
|
|
502
|
+
const trous = sansLes(mur ? [[debut, fin]] : [], [
|
|
503
|
+
...segments.map(fenetre),
|
|
504
|
+
...attentes.map(([d, f]) => [Math.max(d, debut), Math.min(f, fin)]),
|
|
505
|
+
]);
|
|
509
506
|
const traces = tracesDuJournal(journal, ticket);
|
|
510
507
|
const demarrages = entrees
|
|
511
508
|
.filter(e => e.role === CIRCUIT && e.lancement)
|
|
@@ -702,13 +699,13 @@ export function texteDuBilan(b, avant, depassent = []) {
|
|
|
702
699
|
const sousLignes =
|
|
703
700
|
causes && b.categories.intervalles.journale
|
|
704
701
|
? [
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
702
|
+
["démarrage d'une séance", 'seance'],
|
|
703
|
+
['cœurs ou place', 'place'],
|
|
704
|
+
['autre circuit ou projet', 'autre'],
|
|
705
|
+
['file', 'file'],
|
|
706
|
+
['non attribué', 'nonAttribue'],
|
|
707
|
+
].map(([nom, k]) => ` - ${nom} : ${minutes(causes[k])} min`)
|
|
708
|
+
: [];
|
|
712
709
|
const lignes = CATEGORIES.flatMap(([k, nom]) => {
|
|
713
710
|
const c = b.categories[k];
|
|
714
711
|
const plus =
|
|
@@ -894,10 +891,7 @@ function messagesDeLaSeance(seance) {
|
|
|
894
891
|
// the owner's messages in the supervisor's sessions its stops name and the first request of each
|
|
895
892
|
// session it launched, unless <transcriptions> is false: then no transcript is read.
|
|
896
893
|
function calculer(racine, ticket, fin, { transcriptions = true } = {}) {
|
|
897
|
-
const lignes = lignesDuProjet(
|
|
898
|
-
existsSync(REGISTRE) ? readFileSync(REGISTRE, 'utf8') : '',
|
|
899
|
-
racine
|
|
900
|
-
);
|
|
894
|
+
const lignes = lignesDuProjet(existsSync(REGISTRE) ? readFileSync(REGISTRE, 'utf8') : '', racine);
|
|
901
895
|
const fiches = path.join(dossier(racine), `${ticket}.fiches.jsonl`);
|
|
902
896
|
const entrees = (existsSync(fiches) ? readFileSync(fiches, 'utf8') : '')
|
|
903
897
|
.split('\n')
|
|
@@ -921,13 +915,110 @@ function calculer(racine, ticket, fin, { transcriptions = true } = {}) {
|
|
|
921
915
|
});
|
|
922
916
|
}
|
|
923
917
|
|
|
918
|
+
// The drift sensor of the bilan (docs/architecture/tests.md §5.9): the lines of test a lot adds and
|
|
919
|
+
// removes against the lines of code it adds, compared with the median of the lots before it.
|
|
920
|
+
//
|
|
921
|
+
// - The lot of a ticket is the latest commit of main whose subject names it, measured against its
|
|
922
|
+
// first parent (`git diff --numstat`, renames read as a removal and an addition).
|
|
923
|
+
// - A file counts as a test when the module of its language says so (`estUnTest`), as code when it
|
|
924
|
+
// is no test, no test material and carries a source extension of one of the project's languages;
|
|
925
|
+
// any other file (a document, a JSON, a configuration, an unknown language) counts as neither.
|
|
926
|
+
// - The ratio of a lot is its lines of test added minus removed over its lines of code added;
|
|
927
|
+
// undefined without a line of code added. The median is that of the ratios of the last 20 commits
|
|
928
|
+
// of main that name a ticket, the lot itself left out, the undefined ratios out of it.
|
|
929
|
+
// - A failed reading of git gives no line: the bilan is written without it.
|
|
930
|
+
const FENETRE_DU_CAPTEUR = 20;
|
|
931
|
+
|
|
932
|
+
const gitLu = (racine, ...args) => {
|
|
933
|
+
const r = spawnSync('git', ['-C', racine, ...args], { encoding: 'utf8', maxBuffer: 1 << 28 });
|
|
934
|
+
if (r.status !== 0) {
|
|
935
|
+
throw new Error(`git ${args.join(' ')}`);
|
|
936
|
+
}
|
|
937
|
+
return r.stdout;
|
|
938
|
+
};
|
|
939
|
+
|
|
940
|
+
// The figures { ajoutes, retires, code } of the commit <sha>.
|
|
941
|
+
function chiffres(racine, sha, langage, extensions) {
|
|
942
|
+
const champs = gitLu(racine, 'diff', '--numstat', '--no-renames', '-z', `${sha}^`, sha).split(
|
|
943
|
+
'\0'
|
|
944
|
+
);
|
|
945
|
+
const c = { ajoutes: 0, retires: 0, code: 0 };
|
|
946
|
+
for (const champ of champs) {
|
|
947
|
+
// « <added>\t<removed>\t<path> »; a binary file gives « - » for both counts and is skipped.
|
|
948
|
+
const [add, del, ...reste] = champ.split('\t');
|
|
949
|
+
const fichier = reste.join('\t');
|
|
950
|
+
if (!fichier || add === '-' || del === '-') {
|
|
951
|
+
continue;
|
|
952
|
+
}
|
|
953
|
+
const jugement = langage.estUnTest(fichier, racine);
|
|
954
|
+
if (jugement?.test || jugement?.joue) {
|
|
955
|
+
c.ajoutes += Number(add);
|
|
956
|
+
c.retires += Number(del);
|
|
957
|
+
} else if (!jugement && extensions.some(e => fichier.endsWith(e))) {
|
|
958
|
+
c.code += Number(add);
|
|
959
|
+
}
|
|
960
|
+
}
|
|
961
|
+
return c;
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
const rapportDe = c => (c.code > 0 ? (c.ajoutes - c.retires) / c.code : null);
|
|
965
|
+
const mediane = rs => {
|
|
966
|
+
const t = [...rs].sort((a, b) => a - b);
|
|
967
|
+
const m = t.length >> 1;
|
|
968
|
+
return t.length % 2 ? t[m] : (t[m - 1] + t[m]) / 2;
|
|
969
|
+
};
|
|
970
|
+
const nombreFrancais = n => String(Math.round(n * 100) / 100).replace('.', ',');
|
|
971
|
+
|
|
972
|
+
/**
|
|
973
|
+
* The line of the sensor for <ticket> in the main tree <racine>; null when no commit of main names
|
|
974
|
+
* the ticket or when git cannot be read.
|
|
975
|
+
* @param {string} racine
|
|
976
|
+
* @param {string} ticket
|
|
977
|
+
* @returns {string | null}
|
|
978
|
+
*/
|
|
979
|
+
function ligneDuCapteur(racine, ticket) {
|
|
980
|
+
try {
|
|
981
|
+
const langage = langageDe(racine);
|
|
982
|
+
const extensions = langage.extensionsDuCode;
|
|
983
|
+
const commits = gitLu(racine, 'log', '--first-parent', '--format=%H%x09%s', 'main')
|
|
984
|
+
.split('\n')
|
|
985
|
+
.filter(Boolean)
|
|
986
|
+
.map(l => l.split('\t'));
|
|
987
|
+
const lot = commits.find(([, sujet]) => ticketDuSujet(sujet) === ticket);
|
|
988
|
+
if (!lot) {
|
|
989
|
+
return null;
|
|
990
|
+
}
|
|
991
|
+
const c = chiffres(racine, lot[0], langage, extensions);
|
|
992
|
+
const rapport = rapportDe(c);
|
|
993
|
+
const avant = commits
|
|
994
|
+
.filter(([sha, sujet]) => sha !== lot[0] && ticketDuSujet(sujet) !== null)
|
|
995
|
+
.slice(0, FENETRE_DU_CAPTEUR)
|
|
996
|
+
.map(([sha]) => rapportDe(chiffres(racine, sha, langage, extensions)))
|
|
997
|
+
.filter(r => r !== null);
|
|
998
|
+
const med = avant.length ? mediane(avant) : null;
|
|
999
|
+
const chiffre = `+${c.ajoutes} / −${c.retires} de test pour +${c.code} de code`;
|
|
1000
|
+
if (rapport === null) {
|
|
1001
|
+
return `- dérive des tests : ${chiffre}.`;
|
|
1002
|
+
}
|
|
1003
|
+
const suite =
|
|
1004
|
+
med === null
|
|
1005
|
+
? ''
|
|
1006
|
+
: ` contre une médiane de ${nombreFrancais(med)}${rapport > med ? ' : signal' : ''}`;
|
|
1007
|
+
return `- dérive des tests : ${chiffre}, rapport ${nombreFrancais(rapport)}${suite}.`;
|
|
1008
|
+
} catch {
|
|
1009
|
+
return null;
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
1012
|
+
|
|
924
1013
|
// The bilan of <ticket> computed, where its circuit ended <fin> (`calculer`), kept in the main tree
|
|
925
1014
|
// <racine>, and its text, compared with the bilan before it: what the circuit writes at the ticket.
|
|
926
1015
|
export function ecrireLeBilan(racine, ticket, fin) {
|
|
927
1016
|
const b = calculer(racine, ticket, fin);
|
|
928
1017
|
const avant = precedent(racine, ticket);
|
|
929
1018
|
garder(racine, b);
|
|
930
|
-
|
|
1019
|
+
const texte = texteDuBilan(b, avant, depassementsDuTicket(racine, ticket));
|
|
1020
|
+
const capteur = ligneDuCapteur(racine, ticket);
|
|
1021
|
+
return capteur ? `${texte}\n${capteur}` : texte;
|
|
931
1022
|
}
|
|
932
1023
|
|
|
933
1024
|
// Where the circuit of <ticket> in the repository at <racine> ended, as its workflow's memo on the
|
|
@@ -10,16 +10,12 @@
|
|
|
10
10
|
// - Only the remote `origin` is watched. Main is the one branch that receives the lots; the queue
|
|
11
11
|
// pushes such a commit, and the CI of main plays after, by batches. No CI of a ticket's branch is
|
|
12
12
|
// asked.
|
|
13
|
-
// - A project whose package.json carries the retired key `grillhouse.poussee` is refused by its
|
|
14
|
-
// name (scripts/poussee-retiree.mjs), whatever its value.
|
|
15
13
|
// - Exit 0 lets the push go on; exit 1 refuses it, the reason on the standard error.
|
|
16
14
|
import { execFileSync } from 'node:child_process';
|
|
17
|
-
import {
|
|
18
|
-
import path from 'node:path';
|
|
15
|
+
import { readFileSync } from 'node:fs';
|
|
19
16
|
import { pathToFileURL } from 'node:url';
|
|
20
17
|
import { commitEstJuge } from './arbres-juges.mjs';
|
|
21
18
|
import { ecartsDuDossier } from './etat-du-depot.mjs';
|
|
22
|
-
import { pousseeRetiree } from './poussee-retiree.mjs';
|
|
23
19
|
|
|
24
20
|
// A sha of zeros: the deletion of the remote branch.
|
|
25
21
|
const SUPPRESSION = /^0+$/;
|
|
@@ -48,13 +44,6 @@ export function refusSurMain(remote, refs, { jugee, tete, ecarts }) {
|
|
|
48
44
|
});
|
|
49
45
|
}
|
|
50
46
|
|
|
51
|
-
// The refusals for a push to `remote` of `refs` given the package.json object `pkg`: the retired
|
|
52
|
-
// key `grillhouse.poussee` refuses it by its name; an empty list lets the push go on.
|
|
53
|
-
export function refus(remote, refs, pkg) {
|
|
54
|
-
const ligne = remote === 'origin' ? pousseeRetiree(pkg) : null;
|
|
55
|
-
return ligne ? [`⛔ ${ligne}`] : [];
|
|
56
|
-
}
|
|
57
|
-
|
|
58
47
|
// The pushed refs of git's standard input.
|
|
59
48
|
export function lireRefs(texte) {
|
|
60
49
|
return texte
|
|
@@ -68,11 +57,8 @@ export function lireRefs(texte) {
|
|
|
68
57
|
|
|
69
58
|
if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) {
|
|
70
59
|
const racine = execFileSync('git', ['rev-parse', '--show-toplevel'], { encoding: 'utf8' }).trim();
|
|
71
|
-
const fichier = path.join(racine, 'package.json');
|
|
72
|
-
const pkg = existsSync(fichier) ? JSON.parse(readFileSync(fichier, 'utf8')) : null;
|
|
73
60
|
const refs = lireRefs(readFileSync(0, 'utf8'));
|
|
74
61
|
const lignes = [
|
|
75
|
-
...refus(process.argv[2], refs, pkg),
|
|
76
62
|
...refusSurMain(process.argv[2], refs, {
|
|
77
63
|
jugee: sha => commitEstJuge(racine, sha),
|
|
78
64
|
tete: execFileSync('git', ['-C', racine, 'rev-parse', 'HEAD'], { encoding: 'utf8' }).trim(),
|
|
@@ -188,6 +188,7 @@ export function composer(modules) {
|
|
|
188
188
|
outils: unique(modules.flatMap(m => m.outils)),
|
|
189
189
|
binaires: Object.assign({}, ...modules.map(m => m.binaires)),
|
|
190
190
|
ignorer: unique(modules.flatMap(m => m.ignorer)),
|
|
191
|
+
extensionsDuCode: unique(modules.flatMap(m => m.extensionsDuCode)),
|
|
191
192
|
sorties: {
|
|
192
193
|
ecrites: unique(modules.flatMap(m => m.sorties.ecrites)),
|
|
193
194
|
propres: unique(modules.flatMap(m => m.sorties.propres)),
|
|
@@ -199,8 +200,7 @@ export function composer(modules) {
|
|
|
199
200
|
matieres: racine => modules.flatMap(m => m.matieres(racine)),
|
|
200
201
|
joueDesTests: (racine, composant) =>
|
|
201
202
|
moduleDuComposant(racine, composant)?.joueDesTests(racine, composant) ?? false,
|
|
202
|
-
lecturesDesTests: dossier =>
|
|
203
|
-
unique(modules.flatMap(m => m.lecturesDesTests(dossier))).sort(),
|
|
203
|
+
lecturesDesTests: dossier => unique(modules.flatMap(m => m.lecturesDesTests(dossier))).sort(),
|
|
204
204
|
environnementDuPoste: env => modules.reduce((e, m) => m.environnementDuPoste(e), env),
|
|
205
205
|
empreintes(racine, noms) {
|
|
206
206
|
const parts = modules.map(m => m.empreintes(racine, noms));
|
package/scripts/crochets.mjs
CHANGED
|
@@ -51,7 +51,7 @@ export const CROCHETS = {
|
|
|
51
51
|
'pre-push': {
|
|
52
52
|
garde: 'branche-de-nuit.mjs',
|
|
53
53
|
lignes: [
|
|
54
|
-
'# Judged main guard (Grillhouse): main receives only a tree a final pass or a verification judged green
|
|
54
|
+
'# Judged main guard (Grillhouse): main receives only a tree a final pass or a verification judged green. Without the package @roomi-fields/grillhouse installed, nothing.',
|
|
55
55
|
COMMANDE,
|
|
56
56
|
'if [ -x "$_gh_commande" ]; then _gh_entree=$(mktemp) && cat > "$_gh_entree" && "$_gh_commande" hook pre-push "$@" < "$_gh_entree" || { rm -f "$_gh_entree"; exit 1; }; exec < "$_gh_entree"; rm -f "$_gh_entree"; fi',
|
|
57
57
|
],
|
package/scripts/etapes.mjs
CHANGED
|
@@ -276,27 +276,23 @@ export const etapeDuRole = role =>
|
|
|
276
276
|
// rules (retry, regenerate, skip a job without object) without asking anyone, and as the sheriffs
|
|
277
277
|
// of Chromium quarantine a flaky test by a rule, not by a judgement. Each gesture: `genre`, its
|
|
278
278
|
// name as the circuit writes it at the ticket and in the log; `geste`, what the circuit does;
|
|
279
|
-
// `regle`, the rule that settles it
|
|
280
|
-
// its stop A or its decision D, or that of 320.9). On each one, the circuit writes at the ticket
|
|
279
|
+
// `regle`, the rule that settles it. On each one, the circuit writes at the ticket
|
|
281
280
|
// `Circuit · geste : <genre> → <geste> (règle : <regle>)`, and the same line in the ticket's log.
|
|
282
281
|
export const GESTES = [
|
|
283
282
|
{
|
|
284
283
|
genre: 'a-repasser',
|
|
285
284
|
geste: 'le circuit finit à 75, que le superviseur rejoue au repos par --reprendre',
|
|
286
285
|
regle: 'seul le code 75 du vérificateur dit la charge de la machine',
|
|
287
|
-
cas: 'A12, A17, A18 : un vrai rouge pris pour la charge du processeur (D14, D20, D21)',
|
|
288
286
|
},
|
|
289
287
|
{
|
|
290
288
|
genre: 'rejeu',
|
|
291
289
|
geste: 'la commande joue une seconde fois',
|
|
292
290
|
regle: 'une commande des contrôles hors de la passe finale à 75 rejoue une fois avant l’arrêt',
|
|
293
|
-
cas: 'A12 : un contrôle à 75, rejoué avant de conclure à la charge',
|
|
294
291
|
},
|
|
295
292
|
{
|
|
296
293
|
genre: 'renvoi-au-testwriter',
|
|
297
294
|
geste: 'au testwriter, que la fiche du développeur nomme, puis la preuve et le développeur',
|
|
298
295
|
regle: 'le rouge qui reste est dans les tests du lot (`renvoi` de sa fiche)',
|
|
299
|
-
cas: 'A5, A7 : « Agent : testwriter » non lu, les tests périmés de 050 et de 130 (D6, D8) ; A2 (D2)',
|
|
300
296
|
},
|
|
301
297
|
{
|
|
302
298
|
genre: 'regeneration',
|
|
@@ -304,7 +300,6 @@ export const GESTES = [
|
|
|
304
300
|
'à la régénération des références (4.2), puis la passe qui juge l’arbre régénéré : après les contrôles, les contrôles du plan encore quand d’autres rouges s’y mêlent, sinon la passe finale qui est due ; après une passe finale, la passe finale encore, sur toute la bande du lot',
|
|
305
301
|
regle:
|
|
306
302
|
'un rouge des contrôles du plan ou de la passe finale est celui d’une référence, même mêlé à d’autres : une que le projet déclare (`grillhouse.references`), ou un fichier que le cadre engendre (l’index des interfaces, les fichiers que le module du langage engendre) ; ou la passe abaisse la dette des gardes (`dette.mjs --abaisser`, depuis ses notes)',
|
|
307
|
-
cas: 'BP 320.9 : 292 min autour des références, dont 163 min d’attente pour régénérer à la main l’index des interfaces, le plafond et l’empreinte, des rouges de références mêlés à d’autres ; BP 320.3.9 : le plafond rouge aux contrôles, laissé à une passe finale qui rejoue les mêmes tests sur le même arbre (6,1 min) ; BP 320.6.5 : un test qui lit les références des paquets, rouge à côté de leur garde, envoyé au développeur, qui n’a rien à livrer puis ne peut pas les écrire',
|
|
308
303
|
},
|
|
309
304
|
{
|
|
310
305
|
genre: 'rejeu-des-engendres',
|
|
@@ -312,14 +307,12 @@ export const GESTES = [
|
|
|
312
307
|
'avant la preuve du rouge, les contrôles et la passe finale, la commande de chaque fichier engendré (`grillhouse.engendres`) dont un motif `lit` couvre un fichier que le lot change, jouée dans la copie ; ses fichiers entrent au lot comme ceux de 4.2',
|
|
313
308
|
regle:
|
|
314
309
|
'un fichier engendré se construit avant les tests qui le lisent, et le graphe le rejoue quand ses entrées changent (Bazel, Nx, Turborepo) : aucun test du lot ne lit un fichier engendré périmé',
|
|
315
|
-
cas: 'OSD-sf1.25.8 : un ticket qui ajoute des cas de conformité rougit au test qui lit les sommes engendrées, sans-livraison ; OSD-sf1.25.13 : la commande jouée à la main deux fois',
|
|
316
310
|
},
|
|
317
311
|
{
|
|
318
312
|
genre: 'rien-a-livrer',
|
|
319
313
|
geste: 'aux contrôles, qui jugent le lot',
|
|
320
314
|
regle:
|
|
321
315
|
'un développeur qui ne change aucun fichier du plan n’a rien à livrer quand les contrôles sont verts ; rouges, l’arrêt monte (sans-livraison), sauf le rouge d’une référence que le lot fait baisser, la dette des gardes, qui se régénère au lieu d’arrêter, et le rouge qui nomme un fichier de test du lot, qui va au testwriter ; sur le lot que l’intégration refuse, pour un développeur que --depuis developpeur lance, le geste ne joue pas : il est relancé une fois avec le refus',
|
|
322
|
-
cas: 'BP 320.9 : 995-tools n’a rien à livrer, 4 montées et 49 min (B5)',
|
|
323
316
|
},
|
|
324
317
|
{
|
|
325
318
|
genre: 'mecanique',
|
|
@@ -327,7 +320,6 @@ export const GESTES = [
|
|
|
327
320
|
'ni testwriter, ni preuve du rouge, ni développeur : l’explorateur joue dans la copie la commande que le plan nomme (1.1), puis les contrôles, la passe finale, la relecture et l’intégration',
|
|
328
321
|
regle:
|
|
329
322
|
'le plan dit le ticket mécanique, avec sa raison et sa commande (`sorte` de la fiche de l’explorateur) : un geste sans comportement neuf ; tant qu’aucun testwriter ni développeur n’a travaillé le lot, un rouge des contrôles ou un RENDU monte, sans relancer personne',
|
|
330
|
-
cas: 'BP 320.16 : 38 outils déplacés par mv, 117 commentaires ; BP 320.40.1 : une variable inutilisée, 4 séances ; BP 322.11.1 : l’outil de test monté sur 31 paquets',
|
|
331
323
|
},
|
|
332
324
|
{
|
|
333
325
|
genre: 'conflit-de-l-avance',
|
|
@@ -335,7 +327,6 @@ export const GESTES = [
|
|
|
335
327
|
'au rôle qui écrit les fichiers en conflit ou au lot gardé, les marques posées dans la copie : le testwriter pour un test ou la matière de test partagée, quelle que soit la sorte du lot, le développeur pour le code, le testwriter d’abord puis le développeur sur les fichiers des deux ; après un lot que l’intégration (5.1) dit ne plus s’appliquer sur main, ou que la file (5.2) rend sur un conflit, le circuit revient à la passe qui juge le lot, dont la préparation joue ce geste',
|
|
336
328
|
regle:
|
|
337
329
|
'l’avance d’une copie sur main, avant une passe, ou après le conflit de la file à 5.2, laisse des fichiers en conflit ou un lot gardé : le rôle que `estUnTest` du module du langage désigne pour chacun les écrit ; un conflit que la seconde séance du rôle ne lève pas monte (lancement)',
|
|
338
|
-
cas: 'SH-b52.2 : marques dans 2 fichiers de test, résolues à la main par le superviseur ; SH-br0.3 : 8 fichiers de test dans le lot gardé, la copie sur main sans eux',
|
|
339
330
|
},
|
|
340
331
|
];
|
|
341
332
|
|
|
@@ -66,8 +66,7 @@
|
|
|
66
66
|
// circuit the issue « echec », on which it stops with its question; its resumption, once what
|
|
67
67
|
// holds the closure is lifted, plays the entry again, which closes the ticket; the queue of the
|
|
68
68
|
// tickets never starts again a ticket whose lot is on main (scripts/file-des-tickets.mjs). Then main is pushed to origin, to the branch
|
|
69
|
-
// main, which the pre-push hook lets go as the tree is judged (a
|
|
70
|
-
// retired key `grillhouse.poussee` is refused by its name, nothing pushed); a refused push is written to the ticket and does not stop the
|
|
69
|
+
// main, which the pre-push hook lets go as the tree is judged (a refused push is written to the ticket and does not stop the
|
|
71
70
|
// queue. The working directory of its circuit (`.claude/worktrees/<ticket>.travail`,
|
|
72
71
|
// scripts/circuit.mjs), which lives as long as the ticket, is removed then (`retirerLeTravail`).
|
|
73
72
|
// Every comment and change of the queue at a ticket is written under the author `file`, which bd
|
|
@@ -88,7 +87,6 @@ import { A_REPASSER } from '../codes-de-sortie.mjs';
|
|
|
88
87
|
import { avecLesDonnees, donneesDe } from '../donnees-cles.mjs';
|
|
89
88
|
import { matieresDeclareesDe } from '../matieres-cles.mjs';
|
|
90
89
|
import { avecLesOutils, empreintesDe, outilsDe } from '../outils-cles.mjs';
|
|
91
|
-
import { pousseeRetiree } from '../poussee-retiree.mjs';
|
|
92
90
|
import { ouvrirCopie } from './rejeu.mjs';
|
|
93
91
|
import { jugementDeLaFile, journalDuTicket } from './jugement.mjs';
|
|
94
92
|
import { releverLEntree } from '../registre-des-entrees.mjs';
|
|
@@ -472,8 +470,7 @@ function livrerLesCapacites(o, ticket, labels) {
|
|
|
472
470
|
* The ticket of <entree> (`{ ticket, branche, commit }`) entered on main at <commit>, with the
|
|
473
471
|
* tools <o>: it closes « intégré : <commit> » and loses `en-file` (a ticket already closed is left
|
|
474
472
|
* as it is), the branch is deleted, then main is pushed to origin on the branch
|
|
475
|
-
* main
|
|
476
|
-
* name, nothing pushed); the queue is then done with the ticket, and
|
|
473
|
+
* main; the queue is then done with the ticket, and
|
|
477
474
|
* removes the working directory of its circuit (`retirerLeTravail`). Each of its gestures replays
|
|
478
475
|
* without harm (a ticket closed is left closed, a branch gone stays gone, a commit pushed is pushed
|
|
479
476
|
* again as it is), and never reopens the ticket; its comments are effects (`commenterAu`), which
|
|
@@ -523,13 +520,6 @@ export function fermerLEntree(o, entree) {
|
|
|
523
520
|
if (!fermeture) {
|
|
524
521
|
retirerLeTravail(o, entree.ticket);
|
|
525
522
|
}
|
|
526
|
-
const paquet = git('show', `refs/heads/${o.principale}:package.json`);
|
|
527
|
-
const retiree = pousseeRetiree(paquet.status === 0 ? JSON.parse(paquet.stdout) : null);
|
|
528
|
-
if (retiree) {
|
|
529
|
-
const raison = `Poussée non faite : ${retiree}`;
|
|
530
|
-
commenter(raison);
|
|
531
|
-
return { poussee: null, raison: enUneLigne(raison), ...ferme };
|
|
532
|
-
}
|
|
533
523
|
const sansInvite = { encoding: 'utf8', env: { ...process.env, GIT_TERMINAL_PROMPT: '0' } };
|
|
534
524
|
const pousse = spawnSync(
|
|
535
525
|
'git',
|
package/scripts/jointure.d.ts
CHANGED
|
@@ -218,6 +218,9 @@ export interface Composition {
|
|
|
218
218
|
* out, the update writes them in the project's `.gitignore`, and the removal of the finished
|
|
219
219
|
* copies removes them from a kept copy whose ticket is closed (scripts/copies-finies.mjs). */
|
|
220
220
|
ignorer: string[];
|
|
221
|
+
/** The extensions of the source files of the language (`.rs`, `.py`…): the drift sensor of the
|
|
222
|
+
* bilan counts a file that is no test and carries one of them as code (scripts/bilan.mjs). */
|
|
223
|
+
extensionsDuCode: string[];
|
|
221
224
|
/** Where a run of the language's tools writes, which the envelope opens to a session;
|
|
222
225
|
* Turborepo's outputs are the core's, which no module declares. */
|
|
223
226
|
sorties: {
|
|
@@ -70,6 +70,8 @@ export default {
|
|
|
70
70
|
...JSON.parse(readFileSync(ici('binaires.json'), 'utf8')),
|
|
71
71
|
},
|
|
72
72
|
ignorer: [CONSTRUCTION],
|
|
73
|
+
// The extensions of the source files of the language (the drift sensor of the bilan counts them as code).
|
|
74
|
+
extensionsDuCode: ['.c', '.h'],
|
|
73
75
|
sorties: {
|
|
74
76
|
ecrites: [`${CONSTRUCTION}/`],
|
|
75
77
|
propres: [],
|
|
@@ -91,6 +91,8 @@ export default {
|
|
|
91
91
|
binaires: JSON.parse(readFileSync(ici('binaires.json'), 'utf8')),
|
|
92
92
|
// What cargo writes in a project: its target directory.
|
|
93
93
|
ignorer: ['target'],
|
|
94
|
+
// The extensions of the source files of the language (the drift sensor of the bilan counts them as code).
|
|
95
|
+
extensionsDuCode: ['.rs'],
|
|
94
96
|
// Where cargo writes, in writing: the target directory of the workspace; in its home, the
|
|
95
97
|
// registry's index and sources, the git dependencies, cargo-deny's advisories, and the files of
|
|
96
98
|
// its locks and of the SQLite cache of its packages (`.package-cache`, `.package-cache-mutate`,
|
|
@@ -80,6 +80,8 @@ export default {
|
|
|
80
80
|
executables: ['python3'],
|
|
81
81
|
binaires: JSON.parse(readFileSync(ici('binaires.json'), 'utf8')),
|
|
82
82
|
ignorer: ['.venv', '.pytest_cache', PYCACHE],
|
|
83
|
+
// The extensions of the source files of the language (the drift sensor of the bilan counts them as code).
|
|
84
|
+
extensionsDuCode: ['.py'],
|
|
83
85
|
sorties: {
|
|
84
86
|
ecrites: ['.venv/', '.pytest_cache/', '~/.cache/grillhouse/uv/'],
|
|
85
87
|
propres: [PYCACHE],
|
|
@@ -223,6 +223,8 @@ export default {
|
|
|
223
223
|
// runs and cache (`.turbo`) are the frame's, every language playing by it: IGNORES_DU_CADRE of
|
|
224
224
|
// scripts/grillhouse-maj.mjs ignores them.
|
|
225
225
|
ignorer: ['.vitest-reports', '.cache-outils'],
|
|
226
|
+
// The extensions of the source files of the language (the drift sensor of the bilan counts them as code).
|
|
227
|
+
extensionsDuCode: ['.ts', '.mts', '.cts', '.tsx', '.js', '.mjs', '.cjs', '.jsx'],
|
|
226
228
|
// Where its tools write, Turborepo's outputs being the core's (`sortiesDuLangage` of
|
|
227
229
|
// scripts/enveloppe/enveloppe.mjs): the cache of Vite, where Vitest writes the results of a run
|
|
228
230
|
// (`.cache-outils/vite/vitest/`, the `cacheDir` of the base configurations: a copy's
|
package/scripts/machine.mjs
CHANGED
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
// vide » when nothing plays; played again, it reads that state. With `--attendre` it returns
|
|
9
9
|
// only once the machine is empty: exit 0.
|
|
10
10
|
// - `rouvrir`: the circuits go on by themselves at the next step.
|
|
11
|
-
// - A night that holds the machine is never doubled nor lifted: the command says so (exit 0).
|
|
12
11
|
// - The closure lives in the state of the places on the Temporal server: it survives a restart of
|
|
13
12
|
// the poste, and no circuit starts again before the reopening.
|
|
14
13
|
import path from 'node:path';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// any more (entree.md §5.3). The file of a project that bears the frame's mark on its first line is
|
|
3
3
|
// removed; one without the mark is the project's own, stays, and is reported. Mechanism:
|
|
4
4
|
// installation.md §5.4 (packages/grillhouse/docs/architecture/).
|
|
5
|
-
import { existsSync, readFileSync, rmSync } from 'node:fs';
|
|
5
|
+
import { existsSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
|
|
6
6
|
import path from 'node:path';
|
|
7
7
|
import { estDuCadre, WORKFLOWS } from '../workflows-du-cadre.mjs';
|
|
8
8
|
|
|
@@ -10,16 +10,46 @@ import { estDuCadre, WORKFLOWS } from '../workflows-du-cadre.mjs';
|
|
|
10
10
|
export const version = '0.55.0';
|
|
11
11
|
export const nom = 'nuit yml retire';
|
|
12
12
|
|
|
13
|
-
/** The
|
|
13
|
+
/** The entry of `relatif` removed from `grillhouse.flux` of the root package.json; says whether it did. */
|
|
14
|
+
function retirerLEntree(projet, relatif) {
|
|
15
|
+
const fichier = path.join(projet, 'package.json');
|
|
16
|
+
if (!existsSync(fichier)) {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
const texte = readFileSync(fichier, 'utf8');
|
|
20
|
+
let pkg;
|
|
21
|
+
try {
|
|
22
|
+
pkg = JSON.parse(texte);
|
|
23
|
+
} catch {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
const flux = pkg?.grillhouse?.flux;
|
|
27
|
+
if (flux === null || typeof flux !== 'object' || !Object.hasOwn(flux, relatif)) {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
delete flux[relatif];
|
|
31
|
+
const indent = /^[ \t]+(?=")/m.exec(texte)?.[0] ?? 2;
|
|
32
|
+
writeFileSync(fichier, `${JSON.stringify(pkg, null, indent)}${texte.endsWith('\n') ? '\n' : ''}`);
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** The `nuit.yml` of the frame removed from the project at <projet>, with its entry of `grillhouse.flux`; returns what it did. */
|
|
14
37
|
export function migrer(projet) {
|
|
15
38
|
const relatif = `${WORKFLOWS}/nuit.yml`;
|
|
16
39
|
const fichier = path.join(projet, relatif);
|
|
17
40
|
if (!existsSync(fichier)) {
|
|
18
|
-
return
|
|
41
|
+
return retirerLEntree(projet, relatif)
|
|
42
|
+
? [
|
|
43
|
+
`package.json : l'entrée ${relatif} de grillhouse.flux est retirée, le fichier n'existe plus`,
|
|
44
|
+
]
|
|
45
|
+
: [];
|
|
19
46
|
}
|
|
20
47
|
if (estDuCadre(readFileSync(fichier, 'utf8'))) {
|
|
21
48
|
rmSync(fichier);
|
|
22
|
-
|
|
49
|
+
retirerLEntree(projet, relatif);
|
|
50
|
+
return [
|
|
51
|
+
`${relatif} : le flux de la nuit du cadre est retiré, avec son entrée de grillhouse.flux, la nuit ne tourne plus sur GitHub`,
|
|
52
|
+
];
|
|
23
53
|
}
|
|
24
54
|
return [`${relatif} : nuit.yml du projet, que le cadre ne lit plus : à retirer ou à garder`];
|
|
25
55
|
}
|
package/scripts/nuit.sh
CHANGED
|
@@ -80,10 +80,7 @@
|
|
|
80
80
|
# no script of the project; a value that is not a non-blank string, or a name absent from the scripts of
|
|
81
81
|
# that package.json, turns the night red, with a log line that cites it, and nothing runs.
|
|
82
82
|
# - The night pushes nothing: main receives every lot by the queue, on a tree judged; the night keeps
|
|
83
|
-
# its last green (`<git common dir>/nuit/dernier-vert`), a mark and not a branch.
|
|
84
|
-
# package.json carries the retired key `grillhouse.poussee`, whatever its value, turns the night
|
|
85
|
-
# red before any work, with a log line that names the key and the gesture (remove it,
|
|
86
|
-
# scripts/poussee-retiree.mjs).
|
|
83
|
+
# its last green (`<git common dir>/nuit/dernier-vert`), a mark and not a branch.
|
|
87
84
|
# - The copies whose content is on main: once its steps are played, whatever their verdict, the
|
|
88
85
|
# night passes each copy `git worktree list` names, the main tree and its own left out, through
|
|
89
86
|
# scripts/retirer-copie.sh without `--jetable` (scripts/retirer-les-copies-finies.mjs), as a CI cleans its
|
|
@@ -200,14 +197,11 @@ jouer() {
|
|
|
200
197
|
return 1
|
|
201
198
|
fi
|
|
202
199
|
# The reading gives one line per finding: « script<TAB>name », or a fault « nuit-invalide<TAB>value
|
|
203
|
-
# as JSON », « nuit-absent<TAB>name
|
|
204
|
-
# before any work.
|
|
200
|
+
# as JSON », or « nuit-absent<TAB>name ».
|
|
205
201
|
local lecture ligne nuit=
|
|
206
202
|
lecture="$(node --input-type=module -e '
|
|
207
203
|
import { readFileSync } from "node:fs";
|
|
208
|
-
import { pathToFileURL } from "node:url";
|
|
209
204
|
const pkg = JSON.parse(readFileSync(process.argv[1], "utf8"));
|
|
210
|
-
const { pousseeRetiree } = await import(pathToFileURL(process.argv[2]).href);
|
|
211
205
|
const out = (...l) => process.stdout.write(l.join("\t") + "\n");
|
|
212
206
|
const vide = v => typeof v !== "string" || !v.trim();
|
|
213
207
|
const v = pkg.grillhouse?.nuit;
|
|
@@ -216,9 +210,7 @@ jouer() {
|
|
|
216
210
|
else if (!Object.hasOwn(pkg.scripts ?? {}, v)) out("nuit-absent", v);
|
|
217
211
|
else out("script", v);
|
|
218
212
|
}
|
|
219
|
-
|
|
220
|
-
if (retiree) out("poussee-retiree", retiree);
|
|
221
|
-
' "$copie/package.json" "$ici/poussee-retiree.mjs" 2>/dev/null)"
|
|
213
|
+
' "$copie/package.json" 2>/dev/null)"
|
|
222
214
|
local faute=0
|
|
223
215
|
while IFS= read -r ligne; do
|
|
224
216
|
case "$ligne" in
|
|
@@ -229,9 +221,6 @@ jouer() {
|
|
|
229
221
|
nuit-absent$'\t'*)
|
|
230
222
|
echo "✗ la clé grillhouse.nuit nomme « ${ligne#nuit-absent$'\t'} », absent des scripts du package.json : rien n'est joué."
|
|
231
223
|
faute=1 ;;
|
|
232
|
-
poussee-retiree$'\t'*)
|
|
233
|
-
echo "✗ ${ligne#poussee-retiree$'\t'} Rien n'est joué."
|
|
234
|
-
faute=1 ;;
|
|
235
224
|
esac
|
|
236
225
|
done <<< "$lecture"
|
|
237
226
|
[ "$faute" -eq 0 ] || return 1
|
|
@@ -320,40 +320,6 @@ export function prendreUnePlace({
|
|
|
320
320
|
};
|
|
321
321
|
}
|
|
322
322
|
|
|
323
|
-
/**
|
|
324
|
-
* Plays <seance> holding a place, given back at its end, whether it returns, throws or (for an
|
|
325
|
-
* asynchronous one) settles; <seance> receives the place, its `env` the environment of its
|
|
326
|
-
* children.
|
|
327
|
-
* @param {(place: ReturnType<typeof prendreUnePlace>) => T} seance
|
|
328
|
-
* @param {Parameters<typeof prendreUnePlace>[0]} [options]
|
|
329
|
-
* @returns {T}
|
|
330
|
-
* @template T
|
|
331
|
-
*/
|
|
332
|
-
export function avecUnePlace(seance, options) {
|
|
333
|
-
const place = prendreUnePlace(options);
|
|
334
|
-
let r;
|
|
335
|
-
try {
|
|
336
|
-
r = seance(place);
|
|
337
|
-
} catch (e) {
|
|
338
|
-
place.rendre();
|
|
339
|
-
throw e;
|
|
340
|
-
}
|
|
341
|
-
if (r && typeof r.then === 'function') {
|
|
342
|
-
return r.then(
|
|
343
|
-
v => {
|
|
344
|
-
place.rendre();
|
|
345
|
-
return v;
|
|
346
|
-
},
|
|
347
|
-
e => {
|
|
348
|
-
place.rendre();
|
|
349
|
-
throw e;
|
|
350
|
-
}
|
|
351
|
-
);
|
|
352
|
-
}
|
|
353
|
-
place.rendre();
|
|
354
|
-
return r;
|
|
355
|
-
}
|
|
356
|
-
|
|
357
323
|
/**
|
|
358
324
|
* The machine a pass is judged on under <env>: the one a trial fixes (GRILLHOUSE_MESURE_D_ESSAI),
|
|
359
325
|
* else the real one.
|
|
@@ -283,7 +283,7 @@ export function phaseDeLaReservation({ prises, reservation = null }) {
|
|
|
283
283
|
* reprise?: { ticket: string, rang: number | null }, groupe?: string,
|
|
284
284
|
* priorites?: Record<string, { priorite: number, creation: string }>, max?: number }} demande
|
|
285
285
|
* @param {{ rang: number, plafond: number, maintenant: number, reservee?: boolean }} o `reservee`:
|
|
286
|
-
* the machine is
|
|
286
|
+
* the machine is closed by the supervisor, no place is given
|
|
287
287
|
*/
|
|
288
288
|
export function reserverDesCircuits(places, demande, o) {
|
|
289
289
|
const {
|
|
@@ -364,7 +364,7 @@ export function reserverDesCircuits(places, demande, o) {
|
|
|
364
364
|
// The places of circuits each project holds, under the bound its last demand carried (`max`).
|
|
365
365
|
const tenuesDe = r => circuits.filter(c => c.accordee && c.racine === r).length;
|
|
366
366
|
for (const c of circuits.filter(x => !x.accordee).sort((a, b) => a.rang - b.rang)) {
|
|
367
|
-
// Under the
|
|
367
|
+
// Under the closure of the machine no place is new: circuits alive keep theirs.
|
|
368
368
|
if (reservee || tenues >= plafond) {
|
|
369
369
|
break;
|
|
370
370
|
}
|