@roomi-fields/grillhouse 0.51.0 → 0.53.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 +68 -0
- package/agents/direct.md +1 -1
- package/cadre/templates/projet/vitest.config.cjs +45 -0
- package/charte/plan.md +47 -0
- package/charte/preuve.md +39 -0
- package/charte/superviseur.md +60 -0
- package/charte/tests.md +38 -0
- package/charte.md +23 -178
- package/dist/temporal/circuit/appel.d.ts +2 -0
- package/dist/temporal/circuit/appel.js +24 -2
- package/dist/temporal/circuit/appel.js.map +1 -1
- package/dist/temporal/circuit/client.d.ts +15 -7
- package/dist/temporal/circuit/client.js +42 -11
- package/dist/temporal/circuit/client.js.map +1 -1
- package/dist/temporal/circuit/commande.js +17 -6
- package/dist/temporal/circuit/commande.js.map +1 -1
- package/dist/temporal/circuit/contrat.d.ts +9 -0
- package/dist/temporal/circuit/contrat.js +6 -0
- package/dist/temporal/circuit/contrat.js.map +1 -1
- package/dist/temporal/circuit/deroule.js +25 -4
- package/dist/temporal/circuit/deroule.js.map +1 -1
- package/dist/temporal/client.d.ts +35 -1
- package/dist/temporal/client.js +144 -1
- package/dist/temporal/client.js.map +1 -1
- package/dist/temporal/commande.js +31 -13
- package/dist/temporal/commande.js.map +1 -1
- package/dist/temporal/etat.d.ts +3 -1
- package/dist/temporal/etat.js +31 -17
- package/dist/temporal/etat.js.map +1 -1
- package/dist/temporal/file/activites.js +1 -1
- package/dist/temporal/file/activites.js.map +1 -1
- package/dist/temporal/file/contrat.d.ts +4 -5
- package/dist/temporal/file/contrat.js +2 -2
- package/dist/temporal/file/contrat.js.map +1 -1
- package/dist/temporal/file/deroule.js +7 -5
- package/dist/temporal/file/deroule.js.map +1 -1
- package/dist/temporal/installation.d.ts +103 -53
- package/dist/temporal/installation.js +842 -237
- package/dist/temporal/installation.js.map +1 -1
- package/dist/temporal/nuits/deroule.js +3 -1
- package/dist/temporal/nuits/deroule.js.map +1 -1
- package/dist/temporal/places/deroule.js +2 -1
- package/dist/temporal/places/deroule.js.map +1 -1
- package/dist/temporal/sonde/deroule.js +2 -1
- package/dist/temporal/sonde/deroule.js.map +1 -1
- package/dist/temporal/tickets/deroule.js +4 -3
- package/dist/temporal/tickets/deroule.js.map +1 -1
- package/dist/temporal/travailleur.d.ts +7 -1
- package/dist/temporal/travailleur.js +49 -25
- package/dist/temporal/travailleur.js.map +1 -1
- package/docs/INTERFACE.md +20 -14
- package/docs/architecture/circuit.md +19 -16
- package/docs/architecture/entree.md +8 -9
- package/docs/architecture/greffon.md +54 -20
- package/docs/architecture/installation.md +99 -60
- package/docs/architecture/machine.md +31 -4
- package/docs/architecture/tests.md +22 -8
- package/docs/lexique.md +12 -3
- package/hooks/hooks.json +10 -10
- package/hooks/register.tsx +84 -2
- package/package.json +4 -2
- package/scripts/activites.mjs +25 -9
- package/scripts/aiguillage.mjs +1 -1
- package/scripts/attente-au-tour.mjs +2 -3
- package/scripts/bilan.mjs +116 -56
- package/scripts/bilans-gardes.mjs +37 -0
- package/scripts/circuit.mjs +256 -42
- package/scripts/circuits-du-serveur.mjs +3 -2
- package/scripts/circuits-tenus.d.mts +7 -0
- package/scripts/circuits-tenus.mjs +17 -0
- package/scripts/copie-de-montee.mjs +354 -0
- package/scripts/copies-du-depot.d.mts +13 -0
- package/scripts/copies-du-depot.mjs +66 -0
- package/scripts/copies-finies.mjs +6 -40
- package/scripts/crochets.mjs +16 -2
- package/scripts/direct.mjs +2 -2
- package/scripts/droits.mjs +117 -38
- package/scripts/engendres.mjs +5 -3
- package/scripts/entree-de-seance.mjs +35 -0
- package/scripts/enveloppe/enveloppe.mjs +23 -16
- package/scripts/enveloppe/lancer.sh +32 -22
- package/scripts/enveloppe/travail-de-la-copie.mjs +154 -0
- package/scripts/etapes.mjs +11 -3
- package/scripts/faits-du-circuit.mjs +12 -5
- package/scripts/file-des-tickets.d.mts +13 -2
- package/scripts/file-des-tickets.mjs +44 -12
- package/scripts/greffons.mjs +42 -27
- package/scripts/grillhouse-maj.mjs +105 -85
- package/scripts/init.mjs +1 -1
- package/scripts/integration/file.mjs +5 -2
- package/scripts/integration/integrer.mjs +14 -4
- package/scripts/jointure.d.ts +18 -1
- package/scripts/langages/c/commandes.mjs +17 -7
- package/scripts/langages/cargo/commandes.mjs +87 -34
- package/scripts/langages/cargo/index.mjs +6 -3
- package/scripts/langages/cargo/sccache.mjs +15 -12
- package/scripts/langages/python/commandes.mjs +68 -15
- package/scripts/langages/python/squelette.mjs +4 -3
- package/scripts/langages/typescript/configurations-de-vitest.mjs +118 -0
- package/scripts/langages/typescript/index.mjs +14 -12
- package/scripts/langages/typescript/migrations/configurations-en-commonjs.mjs +299 -0
- package/scripts/langages/typescript/squelette.mjs +20 -17
- package/scripts/langages/typescript/tests-de-nuit.mjs +3 -3
- package/scripts/langages/typescript/turbo-des-paquets.mjs +76 -39
- package/scripts/langages/typescript/verifier.mjs +27 -2
- package/scripts/langages/typescript/vitest-config/base.mjs +1 -1
- package/scripts/langages/typescript/vitest-config/bornes.mjs +1 -1
- package/scripts/langages/typescript/vitest-config/cibles.mjs +2 -2
- package/scripts/langages/typescript/{vitest.nuit.config.mjs → vitest.nuit.config.cjs} +61 -50
- package/scripts/mesure/pression.mjs +5 -3
- package/scripts/migrations/serveurs-de-l-index.mjs +1 -1
- package/scripts/migrations/suivi-du-superviseur-retire.mjs +56 -0
- package/scripts/migrations.mjs +2 -0
- package/scripts/montee.mjs +524 -0
- package/scripts/nuit.sh +3 -2
- package/scripts/outil.mjs +5 -3
- package/scripts/paquet-npm.mjs +22 -0
- package/scripts/paquet.mjs +5 -5
- package/scripts/pre-compact.mjs +25 -0
- package/scripts/reponses-du-circuit.d.mts +17 -2
- package/scripts/reponses-du-circuit.mjs +78 -20
- package/scripts/resultats.mjs +42 -14
- package/scripts/retirer-les-copies-finies.mjs +4 -7
- package/scripts/seances.mjs +81 -29
- package/scripts/services-du-noyau.mjs +7 -2
- package/scripts/session-start.sh +19 -10
- package/scripts/sortie-de-seance.mjs +70 -0
- package/scripts/sortie.mjs +4 -7
- package/scripts/sous-commandes.mjs +1 -1
- package/scripts/superviseur.mjs +417 -159
- package/scripts/tableau.mjs +249 -152
- package/scripts/ticket-du-circuit.mjs +22 -0
- package/scripts/transitions.d.mts +6 -9
- package/scripts/transitions.mjs +123 -36
- package/scripts/verrou-de-fichier.d.mts +11 -0
- package/skills/direct/SKILL.md +21 -11
- package/skills/explorateur/SKILL.md +8 -3
- package/skills/grill/SKILL.md +11 -8
- package/skills/grill/references/paquets.md +4 -4
- package/skills/pitmaster/SKILL.md +99 -53
- package/skills/pitmaster/references/cadre.md +1 -1
- package/skills/pitmaster/references/consigne-agent.md +1 -1
- package/skills/pitmaster/references/tour.md +6 -5
- package/skills/relecteur/SKILL.md +9 -2
- package/skills/testwriter/SKILL.md +3 -3
- package/cadre/templates/projet/pitmaster/SUIVI.md +0 -22
- package/cadre/templates/projet/vitest.config.ts +0 -44
- package/scripts/attente-a-l-arret.mjs +0 -114
|
@@ -78,11 +78,9 @@
|
|
|
78
78
|
// writes its exclusion, `!$TURBO_ROOT$/<path>/.git` (`!<path>/.git` for a global dependency), in
|
|
79
79
|
// the root's turbo.json and in the inputs of a package's; the check refuses a root input lacking it.
|
|
80
80
|
//
|
|
81
|
-
// The configuration of Vitest
|
|
82
|
-
//
|
|
83
|
-
//
|
|
84
|
-
// beside it (`vitest.config.mjs.timestamp-<n>.mjs`). The check refuses a `vitest.config.mjs` or
|
|
85
|
-
// `.mts` of that package, and a `.js` or `.ts` when its `type` is `module`.
|
|
81
|
+
// The check refuses a configuration of Vitest that Vite would write beside to load, in the root
|
|
82
|
+
// and in each package: a configuration of Vitest is CommonJS (`vitest.config.cjs`,
|
|
83
|
+
// ./configurations-de-vitest.mjs), the known debt aside.
|
|
86
84
|
//
|
|
87
85
|
// The root's tasks, in its turbo.json or turbo.jsonc (the rest of the file is the project's,
|
|
88
86
|
// its comments and layout kept by jsonc-parser; a repository without one has nothing written or
|
|
@@ -92,7 +90,9 @@
|
|
|
92
90
|
// project's guards; a root without it plays none): each waits for the build of each package of
|
|
93
91
|
// the frame that has a `build` script, sorted (`//#grillhouse:gardes`, `//#gardes` in a
|
|
94
92
|
// repository of packages), or for the root's build in a repository without packages; the task
|
|
95
|
-
// added is `{ dependsOn, outputs: [] }`;
|
|
93
|
+
// added is `{ dependsOn, outputs: [] }`; in a repository of packages, the `env` of each `//#…`
|
|
94
|
+
// names `GRILLHOUSE_INDEX_DU_DEPOT`, the fingerprint of the list of the files of the index, the
|
|
95
|
+
// project's entries kept;
|
|
96
96
|
// - `typecheck`, cached per package: it waits for `build` and, in a repository of packages, for
|
|
97
97
|
// `^build`; a package without a `typecheck` script plays none; the task added is
|
|
98
98
|
// `{ dependsOn: ["build", "^build"], outputs: [] }` (`["build"]` without packages), and a
|
|
@@ -119,7 +119,7 @@ import {
|
|
|
119
119
|
TRACE,
|
|
120
120
|
VARIABLE_TRAVAILLEURS as TRAVAILLEURS,
|
|
121
121
|
} from '../../services-du-noyau.mjs';
|
|
122
|
-
import {
|
|
122
|
+
import { configurationsRefusees, GARDE, trancherLaGarde } from './configurations-de-vitest.mjs';
|
|
123
123
|
import { lecturesDesTests } from './vitest-config/lances.mjs';
|
|
124
124
|
import { parcourir } from './parcours.mjs';
|
|
125
125
|
import {
|
|
@@ -130,7 +130,8 @@ import {
|
|
|
130
130
|
recouvreLaLecture,
|
|
131
131
|
TYPAGE,
|
|
132
132
|
} from '../../paquets.mjs';
|
|
133
|
-
import {
|
|
133
|
+
import { juger, lire as lireLaDette } from '../../dette.mjs';
|
|
134
|
+
import { RESULTATS } from '../../resultats.mjs';
|
|
134
135
|
import {
|
|
135
136
|
SCRIPT_DES_TESTS as TESTS,
|
|
136
137
|
SCRIPTS_DE_GARDES,
|
|
@@ -147,6 +148,10 @@ const TOPOLOGIE = ['dependencies', 'devDependencies', 'optionalDependencies'];
|
|
|
147
148
|
const RACINES = ['turbo.json', 'turbo.jsonc'];
|
|
148
149
|
// The guard tasks of the root: the frame's controls, and the project's own guards.
|
|
149
150
|
export const GARDES = SCRIPTS_DE_GARDES;
|
|
151
|
+
// The variable that carries the fingerprint of the list of the files of the index, which the
|
|
152
|
+
// verification pass gives (verifier.mjs) and the guard tasks of the root hash: a guard reads the
|
|
153
|
+
// index.
|
|
154
|
+
export const INDEX_DU_DEPOT = 'GRILLHOUSE_INDEX_DU_DEPOT';
|
|
150
155
|
// The controls of the root that the CI plays beside the verification: the format check and the
|
|
151
156
|
// lint. A root plays those its package.json holds a script for, none demanded.
|
|
152
157
|
export const CONTROLES = ['format:check', 'lint'];
|
|
@@ -908,6 +913,36 @@ function gardesEcartees(racine) {
|
|
|
908
913
|
return { f, texte, ecarts };
|
|
909
914
|
}
|
|
910
915
|
|
|
916
|
+
// Whether the task <cle> is written as one of the root package, in a repository of packages.
|
|
917
|
+
const estDeLaRacine = cle => cle.startsWith('//#');
|
|
918
|
+
|
|
919
|
+
// The guard task <cle> the generator adds to a root that lacks it.
|
|
920
|
+
const gardeNeuve = (cle, dependsOn) => ({
|
|
921
|
+
dependsOn,
|
|
922
|
+
...(estDeLaRacine(cle) ? { env: [INDEX_DU_DEPOT] } : {}),
|
|
923
|
+
outputs: [],
|
|
924
|
+
});
|
|
925
|
+
|
|
926
|
+
// The guard tasks of the root's turbo.json at <racine>, in a repository of packages (`//#…`), whose
|
|
927
|
+
// `env` lacks INDEX_DU_DEPOT, added to the project's: [{ f, cle, attendu }]; a task absent aside,
|
|
928
|
+
// which `gardesEcartees` adds whole.
|
|
929
|
+
function gardesSansIndex(racine) {
|
|
930
|
+
const r = confRacine(racine);
|
|
931
|
+
if (!r) {
|
|
932
|
+
return [];
|
|
933
|
+
}
|
|
934
|
+
return [...gardesAttendues(racine).keys()].filter(estDeLaRacine).flatMap(cle => {
|
|
935
|
+
const tache = r.conf.tasks?.[cle];
|
|
936
|
+
if (!tache || typeof tache !== 'object') {
|
|
937
|
+
return [];
|
|
938
|
+
}
|
|
939
|
+
const actuel = Array.isArray(tache.env) ? tache.env : [];
|
|
940
|
+
return actuel.includes(INDEX_DU_DEPOT)
|
|
941
|
+
? []
|
|
942
|
+
: [{ f: r.f, cle, attendu: [...actuel, INDEX_DU_DEPOT] }];
|
|
943
|
+
});
|
|
944
|
+
}
|
|
945
|
+
|
|
911
946
|
// The typing task of the root's turbo.json at <racine> when it lacks it, or when its `dependsOn`
|
|
912
947
|
// lacks one of the builds it waits for (`attenteDuTypage`): { f, chemin, valeur, manques }, the
|
|
913
948
|
// path of the edit and the value it sets (the task, `{ dependsOn, outputs: [] }`; or its
|
|
@@ -1030,12 +1065,21 @@ export function ecrire(racine) {
|
|
|
1030
1065
|
for (const { cle, attendu, present } of racineEcartee.ecarts) {
|
|
1031
1066
|
const [chemin, valeur] = present
|
|
1032
1067
|
? [['tasks', cle, 'dependsOn'], attendu]
|
|
1033
|
-
: [['tasks', cle],
|
|
1068
|
+
: [['tasks', cle], gardeNeuve(cle, attendu)];
|
|
1034
1069
|
texte = applyEdits(texte, modify(texte, chemin, valeur, MISE_EN_FORME));
|
|
1035
1070
|
}
|
|
1036
1071
|
writeFileSync(path.join(racine, racineEcartee.f), texte);
|
|
1037
1072
|
ecrits.push(racineEcartee.f);
|
|
1038
1073
|
}
|
|
1074
|
+
for (const { f, cle, attendu } of gardesSansIndex(racine)) {
|
|
1075
|
+
const abs = path.join(racine, f);
|
|
1076
|
+
const texte = readFileSync(abs, 'utf8');
|
|
1077
|
+
const chemin = ['tasks', cle, 'env'];
|
|
1078
|
+
writeFileSync(abs, applyEdits(texte, modify(texte, chemin, attendu, MISE_EN_FORME)));
|
|
1079
|
+
if (!ecrits.includes(f)) {
|
|
1080
|
+
ecrits.push(f);
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
1039
1083
|
const typage = typageEcarte(racine);
|
|
1040
1084
|
if (typage) {
|
|
1041
1085
|
const abs = path.join(racine, typage.f);
|
|
@@ -1198,26 +1242,6 @@ function declarationsRefusees(racine) {
|
|
|
1198
1242
|
return refus;
|
|
1199
1243
|
}
|
|
1200
1244
|
|
|
1201
|
-
// The refusals of the configurations of Vitest that Vite loads as ESM in a package of the shared
|
|
1202
|
-
// test material of <racine>: one line per such file, as Vite judges it (`.mjs`, `.mts`, or `.js`,
|
|
1203
|
-
// `.ts` in a package of `"type": "module"`).
|
|
1204
|
-
function configsMatiereRefusees(racine) {
|
|
1205
|
-
const refus = [];
|
|
1206
|
-
for (const { dir } of matieres(racine)) {
|
|
1207
|
-
const { type } = JSON.parse(readFileSync(path.join(dir, 'package.json'), 'utf8'));
|
|
1208
|
-
for (const ext of ['mjs', 'mts', ...(type === 'module' ? ['js', 'ts'] : [])]) {
|
|
1209
|
-
const f = path.relative(racine, path.join(dir, `vitest.config.${ext}`));
|
|
1210
|
-
if (!existsSync(path.join(racine, f))) {
|
|
1211
|
-
continue;
|
|
1212
|
-
}
|
|
1213
|
-
refus.push(
|
|
1214
|
-
`⛔ ${f} : la configuration de Vitest du paquet de la matière s'écrit en CommonJS, \`vitest.config.cjs\` ; Vite écrit un fichier à côté d'une configuration ESM pour la charger, et la matière est en lecture seule chez tout rôle autre que le testwriter.`
|
|
1215
|
-
);
|
|
1216
|
-
}
|
|
1217
|
-
}
|
|
1218
|
-
return refus;
|
|
1219
|
-
}
|
|
1220
|
-
|
|
1221
1245
|
// Whether the pattern <motif> (from the root) can name a file of one of the <dossiers>: its fixed
|
|
1222
1246
|
// part, before the first glob character, lies in one, or holds one under a glob.
|
|
1223
1247
|
function visePaquet(motif, dossiers) {
|
|
@@ -1271,13 +1295,22 @@ function racineRefusee(racine) {
|
|
|
1271
1295
|
// or that does not wait for the build of its package and of its dependencies, for a root `test:unit` whose `env`
|
|
1272
1296
|
// lacks TESTS_CIBLES, per variable of PASSAGES the root's `globalPassThroughEnv` lacks, per configuration
|
|
1273
1297
|
// of a package written by hand in the root's turbo.json, and per declaration of data or trace
|
|
1274
|
-
// refused.
|
|
1298
|
+
// refused, and per configuration of Vitest refused that the known debt does not hold.
|
|
1299
|
+
/**
|
|
1300
|
+
* @param {string} racine
|
|
1301
|
+
* @returns {string[]}
|
|
1302
|
+
*/
|
|
1275
1303
|
export function verifier(racine) {
|
|
1304
|
+
const configurations = juger(lireLaDette(racine), GARDE, configurationsRefusees(racine)).refus;
|
|
1305
|
+
return [...refusDuGraphe(racine), ...configurations.map(c => c.message)];
|
|
1306
|
+
}
|
|
1307
|
+
|
|
1308
|
+
// The refusals of <racine> but those of the configurations of Vitest, none of which a debt holds.
|
|
1309
|
+
function refusDuGraphe(racine) {
|
|
1276
1310
|
const refus = [
|
|
1277
1311
|
...racineRefusee(racine),
|
|
1278
1312
|
...controlesDeRacineRefuses(racine),
|
|
1279
1313
|
...declarationsRefusees(racine),
|
|
1280
|
-
...configsMatiereRefusees(racine),
|
|
1281
1314
|
];
|
|
1282
1315
|
const gits = gitsAbsents(racine);
|
|
1283
1316
|
for (const { ou, e, m, ligne } of (gits?.listes ?? []).flatMap(l => l.manques)) {
|
|
@@ -1324,6 +1357,11 @@ export function verifier(racine) {
|
|
|
1324
1357
|
: `⛔ ${f} : la tâche \`${cle}\` manque ; \`${COMMANDE}\` l'ajoute, après la construction de chaque paquet du cadre.`
|
|
1325
1358
|
);
|
|
1326
1359
|
}
|
|
1360
|
+
for (const { f, cle } of gardesSansIndex(racine)) {
|
|
1361
|
+
refus.push(
|
|
1362
|
+
`⛔ ${f} : l'\`env\` de \`${cle}\` doit nommer ${INDEX_DU_DEPOT}, l'empreinte de la liste des fichiers de l'index, qu'une garde lit ; \`${COMMANDE}\` l'ajoute.`
|
|
1363
|
+
);
|
|
1364
|
+
}
|
|
1327
1365
|
for (const [f, t] of attendus(racine)) {
|
|
1328
1366
|
const abs = path.join(racine, f);
|
|
1329
1367
|
if (!existsSync(abs)) {
|
|
@@ -1352,16 +1390,15 @@ if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) {
|
|
|
1352
1390
|
if (args.includes('--ecrire')) {
|
|
1353
1391
|
ecrire(racine);
|
|
1354
1392
|
} else {
|
|
1355
|
-
|
|
1356
|
-
|
|
1393
|
+
// A refusal of the graph judges the root's configuration: a finding without a file of a
|
|
1394
|
+
// component, that no debt holds.
|
|
1395
|
+
const { refus, lignes } = trancherLaGarde(racine, [
|
|
1396
|
+
...refusDuGraphe(racine).map(message => ({ message })),
|
|
1397
|
+
...configurationsRefusees(racine),
|
|
1398
|
+
]);
|
|
1399
|
+
for (const l of [...refus.map(r => r.message), ...lignes]) {
|
|
1357
1400
|
process.stderr.write(`${l}\n`);
|
|
1358
1401
|
}
|
|
1359
|
-
// Each refusal judges the root's configuration: a finding without a file of a component.
|
|
1360
|
-
ecrireSarif({
|
|
1361
|
-
garde: 'turbo-des-paquets',
|
|
1362
|
-
racine,
|
|
1363
|
-
constats: refus.map(l => ({ message: l })),
|
|
1364
|
-
});
|
|
1365
1402
|
process.exitCode = refus.length ? 1 : 0;
|
|
1366
1403
|
}
|
|
1367
1404
|
} catch (e) {
|
|
@@ -19,6 +19,8 @@
|
|
|
19
19
|
// keeps its tree as the last green; a red one leaves it. The pass alone keeps it, for every
|
|
20
20
|
// language: it plays the tasks of every package of the graph, a crate's and a Python
|
|
21
21
|
// project's beside a TypeScript package's (their `test:unit` and `typecheck`).
|
|
22
|
+
// - Every pass gives its tasks the fingerprint of the list of the files of the index
|
|
23
|
+
// (`GRILLHOUSE_INDEX_DU_DEPOT`), which the guard tasks hash (./turbo-des-paquets.mjs).
|
|
22
24
|
// - `--tout`, and `--force` (the night, scripts/nuit.sh), play the complete pass: each task of
|
|
23
25
|
// tests for real (`GRILLHOUSE_TESTS` carries only `rejouer`, the moment of the pass, no path).
|
|
24
26
|
// - The part of the budget of the machine (scripts/places-de-la-machine.mjs, `avecLaPasse`): a
|
|
@@ -73,6 +75,7 @@
|
|
|
73
75
|
// TMPDIR, TMP and TEMP (`globalPassThroughEnv`, ./turbo-des-paquets.mjs); removed at the end,
|
|
74
76
|
// green, red or interrupted (SIGINT, SIGTERM, SIGHUP).
|
|
75
77
|
import { spawnSync } from 'node:child_process';
|
|
78
|
+
import { createHash } from 'node:crypto';
|
|
76
79
|
import { existsSync, readdirSync, readFileSync, rmdirSync, rmSync, writeFileSync } from 'node:fs';
|
|
77
80
|
import { availableParallelism, tmpdir } from 'node:os';
|
|
78
81
|
import path from 'node:path';
|
|
@@ -112,7 +115,7 @@ import { paquets, TYPAGE } from '../../paquets.mjs';
|
|
|
112
115
|
import { RESULTATS } from '../../resultats.mjs';
|
|
113
116
|
import { fichiersDeLaTranche, RAPPORTS } from './tranches.mjs';
|
|
114
117
|
import { garderLesResumes } from './resume-du-lanceur.mjs';
|
|
115
|
-
import { controlesDuDepot, planifier } from './turbo-des-paquets.mjs';
|
|
118
|
+
import { controlesDuDepot, INDEX_DU_DEPOT, planifier } from './turbo-des-paquets.mjs';
|
|
116
119
|
|
|
117
120
|
const TACHES = [...GARDES, TYPAGE, SCRIPT_DES_TESTS];
|
|
118
121
|
const CONCURRENCE = /^--concurrency(?:=|$)/;
|
|
@@ -125,6 +128,17 @@ const rejeu = id => {
|
|
|
125
128
|
return `npx turbo run ${id.slice(i + 1)} --filter=${id.slice(0, i)}`;
|
|
126
129
|
};
|
|
127
130
|
|
|
131
|
+
// The fingerprint of the list of the files of the index of the repository at <racine>, under
|
|
132
|
+
// <env>: it moves when a file enters or leaves the index, whatever the contents. null when git
|
|
133
|
+
// gives no list.
|
|
134
|
+
function empreinteDeLIndex(racine, env) {
|
|
135
|
+
const r = spawnSync('git', ['-C', racine, 'ls-files', '-z'], {
|
|
136
|
+
env,
|
|
137
|
+
maxBuffer: 1024 * 1024 * 1024,
|
|
138
|
+
});
|
|
139
|
+
return r.status === 0 ? createHash('sha256').update(r.stdout).digest('hex') : null;
|
|
140
|
+
}
|
|
141
|
+
|
|
128
142
|
const lister = dossier => (existsSync(dossier) ? readdirSync(dossier) : []);
|
|
129
143
|
|
|
130
144
|
// The tasks side by side <args> ask for (`--concurrency=<n>`, `--concurrency <n>`), null without
|
|
@@ -411,7 +425,18 @@ function passe({ racine, demandes, env, dire, coeurs }) {
|
|
|
411
425
|
|
|
412
426
|
function jouerLaPasse({ racine, demandes, args, tout, ajouts, env, dire, coeurs, taches }) {
|
|
413
427
|
const { gardesSeules, sansTests, tranche } = demandes;
|
|
414
|
-
const {
|
|
428
|
+
const {
|
|
429
|
+
[TESTS_CIBLES]: _,
|
|
430
|
+
[CHANGEMENTS]: __,
|
|
431
|
+
[BASE_DU_LOT]: ___,
|
|
432
|
+
[INDEX_DU_DEPOT]: ____,
|
|
433
|
+
...herite
|
|
434
|
+
} = env;
|
|
435
|
+
// The fingerprint of this repository's index, never the caller's: a guard reads the index, and
|
|
436
|
+
// Turborepo, which hashes an untracked file as a tracked one, plays the guards again when the
|
|
437
|
+
// list moves.
|
|
438
|
+
const index = empreinteDeLIndex(racine, herite);
|
|
439
|
+
const propre = index === null ? herite : { ...herite, [INDEX_DU_DEPOT]: index };
|
|
415
440
|
// The environment of the run: measured against the last green; the moment of a complete pass,
|
|
416
441
|
// which moves the hash of every task of tests, so that each plays for real; a tranche, with it.
|
|
417
442
|
const cibles = tranche
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
// day, and every measure of time, a time budget bench (`*.budget.test.*`, `*.budget.spec.*`) or
|
|
17
17
|
// a time witness (a test file that imports `mesurerAuRepos`), moves with the load of the day:
|
|
18
18
|
// `npm test`, `npm run verifier` and the integration leave them out, and the night plays them
|
|
19
|
-
// (scripts/nuit.sh, scripts/langages/typescript/vitest.nuit.config.
|
|
19
|
+
// (scripts/nuit.sh, scripts/langages/typescript/vitest.nuit.config.cjs); a targeted run that
|
|
20
20
|
// names the file of one itself plays it, under the measure of time below (./cibles.mjs, where
|
|
21
21
|
// the patterns live, and whose plugin leaves the witnesses out). `mergeConfig` adds the
|
|
22
22
|
// exclusions of a configuration that extends this one to these.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// The delays of the sizes of test, in ms, on the model of Bazel's test-encyclopedia: small, medium,
|
|
2
2
|
// large. A module of its own, with no import: the configurations of Vitest (./base.mjs,
|
|
3
|
-
// ../vitest.nuit.config.
|
|
3
|
+
// ../vitest.nuit.config.cjs) are bundled by Vite and read only these numbers, while the
|
|
4
4
|
// classification that deduces a file's size (./delais.mjs) reads the guard of the sizes, a script.
|
|
5
5
|
// Mechanism: packages/grillhouse/docs/architecture/tests.md, §3.4 (the guard of the sizes).
|
|
6
6
|
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
// named leaves them out, as the day does.
|
|
37
37
|
// - A run whose paths name no test file plays none, and fails: the base configuration keeps
|
|
38
38
|
// Vitest's `passWithNoTests: false`.
|
|
39
|
-
// - The night's configuration (scripts/langages/typescript/vitest.nuit.config.
|
|
39
|
+
// - The night's configuration (scripts/langages/typescript/vitest.nuit.config.cjs) plays what the
|
|
40
40
|
// day leaves out, through the plugin `nuit`: the night tests, the benches and the witnesses; the
|
|
41
41
|
// variable `GRILLHOUSE_TESTS_DE_NUIT` (NUIT_VARIABLE) chooses `nuit`, the night tests alone,
|
|
42
42
|
// `hors-poste`, the night tests but those that bear the tag `@poste` at their head (the night of
|
|
@@ -61,7 +61,7 @@ import { lireChangements, restreindre } from './changements.mjs';
|
|
|
61
61
|
// The name of the variable is the core's (`TESTS_CIBLES`); this module reads it under its own name.
|
|
62
62
|
export const VARIABLE = TESTS_CIBLES;
|
|
63
63
|
// The day's exclusions, which the base configuration (./base.mjs) sets and the night plays
|
|
64
|
-
// (scripts/langages/typescript/vitest.nuit.config.
|
|
64
|
+
// (scripts/langages/typescript/vitest.nuit.config.cjs): the night tests, too long for the day, and the time budget
|
|
65
65
|
// benches, whose measures move with the load of the day.
|
|
66
66
|
export const NUIT = '**/*.nuit.{test,spec}.?(c|m)[jt]s?(x)';
|
|
67
67
|
export const BUDGET = '**/*.budget.{test,spec}.?(c|m)[jt]s?(x)';
|
|
@@ -28,59 +28,70 @@
|
|
|
28
28
|
// it leaves out; this configuration takes it out of the environment once read, as the plugin of
|
|
29
29
|
// the night does its choice and its tranche: the unit is the run's own, and a Vitest that a night
|
|
30
30
|
// test starts itself, in another package, plays under no configuration but its own. Node (>= 26)
|
|
31
|
-
// reads the package's configuration itself, TypeScript included
|
|
32
|
-
// function is called
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
// reads the package's configuration itself, TypeScript included, and takes what it exports as Vite
|
|
32
|
+
// does: a function is called for a test run, and a promise, exported or returned, is awaited.
|
|
33
|
+
//
|
|
34
|
+
// CommonJS, exporting a promise: Vite loads it without writing beside it, and the frame's package
|
|
35
|
+
// is read-only where its tests load it (./turbo-des-paquets.mjs asks the same of a project). No
|
|
36
|
+
// `require`: a configuration in ESM that imports this one has it bundled as ESM, where Node gives
|
|
37
|
+
// none.
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
async function charger() {
|
|
40
|
+
const { pathToFileURL } = await import('node:url');
|
|
41
|
+
const { mergeConfig } = await import('vitest/config');
|
|
42
|
+
const { default: base } = await import('./vitest-config/base.mjs');
|
|
43
|
+
const { HORS_DU_JOUR, nuit, NUIT_PAQUET } = await import('./vitest-config/cibles.mjs');
|
|
44
|
+
const { DELAI_NUIT_MS } = await import('./vitest-config/bornes.mjs');
|
|
43
45
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
config(config) {
|
|
49
|
-
const test = (config.test ??= {});
|
|
50
|
-
test.exclude = ['**/node_modules/**', '**/dist/**', '**/.git/**', ...exclus];
|
|
51
|
-
test.reporters = base.test.reporters;
|
|
52
|
-
test.setupFiles = [...new Set([...(test.setupFiles ?? []), ...base.test.setupFiles])];
|
|
53
|
-
},
|
|
54
|
-
};
|
|
46
|
+
const { config: fichier, exclus = [] } = process.env[NUIT_PAQUET]
|
|
47
|
+
? JSON.parse(process.env[NUIT_PAQUET])
|
|
48
|
+
: {};
|
|
49
|
+
delete process.env[NUIT_PAQUET];
|
|
55
50
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
passWithNoTests: true,
|
|
68
|
-
// The large delay of Bazel for a night test: 900 s (./vitest-config/delais.mjs).
|
|
69
|
-
testTimeout: DELAI_NUIT_MS,
|
|
70
|
-
hookTimeout: DELAI_NUIT_MS,
|
|
71
|
-
watch: false,
|
|
72
|
-
},
|
|
73
|
-
};
|
|
51
|
+
// What the night sets wins over the configuration of a package, whose plugins have run first: the
|
|
52
|
+
// exclusions of its unit, the reporters, and the setup files, the package's before the base's.
|
|
53
|
+
const nuitGagne = {
|
|
54
|
+
name: 'grillhouse:nuit-gagne',
|
|
55
|
+
config(config) {
|
|
56
|
+
const test = (config.test ??= {});
|
|
57
|
+
test.exclude = ['**/node_modules/**', '**/dist/**', '**/.git/**', ...exclus];
|
|
58
|
+
test.reporters = base.test.reporters;
|
|
59
|
+
test.setupFiles = [...new Set([...(test.setupFiles ?? []), ...base.test.setupFiles])];
|
|
60
|
+
},
|
|
61
|
+
};
|
|
74
62
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
63
|
+
const cadre = {
|
|
64
|
+
plugins: [nuitGagne, nuit()],
|
|
65
|
+
cacheDir: base.cacheDir,
|
|
66
|
+
test: {
|
|
67
|
+
env: base.test.env,
|
|
68
|
+
environment: base.test.environment,
|
|
69
|
+
reporters: base.test.reporters,
|
|
70
|
+
setupFiles: base.test.setupFiles,
|
|
71
|
+
include: HORS_DU_JOUR,
|
|
72
|
+
exclude: ['**/node_modules/**', '**/dist/**', '**/.git/**'],
|
|
73
|
+
// A unit may hold none of the files the run chooses.
|
|
74
|
+
passWithNoTests: true,
|
|
75
|
+
// The large delay of Bazel for a night test: 900 s (./vitest-config/delais.mjs).
|
|
76
|
+
testTimeout: DELAI_NUIT_MS,
|
|
77
|
+
hookTimeout: DELAI_NUIT_MS,
|
|
78
|
+
watch: false,
|
|
79
|
+
},
|
|
80
|
+
};
|
|
82
81
|
|
|
83
|
-
|
|
84
|
-
const
|
|
82
|
+
async function dePaquet(f) {
|
|
83
|
+
const { default: exporte } = await import(pathToFileURL(f).href);
|
|
84
|
+
// Awaited before the test: the promise a CommonJS configuration exports may give a function.
|
|
85
|
+
const attendu = await exporte;
|
|
86
|
+
const paquet = await (typeof attendu === 'function'
|
|
87
|
+
? attendu({ command: 'serve', mode: 'test' })
|
|
88
|
+
: attendu);
|
|
89
|
+
// The environment and the setup files of the package are its own to set.
|
|
90
|
+
const { environment: _e, setupFiles: _s, ...test } = cadre.test;
|
|
91
|
+
return mergeConfig(paquet ?? {}, { ...cadre, test });
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return fichier ? await dePaquet(fichier) : cadre;
|
|
95
|
+
}
|
|
85
96
|
|
|
86
|
-
|
|
97
|
+
module.exports = charger();
|
|
@@ -12,8 +12,10 @@
|
|
|
12
12
|
// - A_REPASSER (scripts/codes-de-sortie.mjs), 75, is the exit code of « à repasser » (EX_TEMPFAIL
|
|
13
13
|
// of sysexits.h: try again later), neither green nor red: the measure of time of each module of language gives it
|
|
14
14
|
// (scripts/langages/typescript/vitest-config/duree.reporter.mjs, the benches of the module cargo),
|
|
15
|
-
// and the night reads it (scripts/nuit.sh). The
|
|
16
|
-
//
|
|
15
|
+
// and the night reads it (scripts/nuit.sh). The module cargo also waits for rest, one minute at
|
|
16
|
+
// most, before it plays each time budget bench (scripts/langages/cargo/commandes.mjs). A day pass
|
|
17
|
+
// plays no measure of time: `npm run verifier` takes a task at 75 for a red
|
|
18
|
+
// (scripts/langages/typescript/verifier.mjs).
|
|
17
19
|
//
|
|
18
20
|
// npx grillhouse pression attendre
|
|
19
21
|
//
|
|
@@ -60,7 +62,7 @@ export function attendreLeRepos({
|
|
|
60
62
|
for (;;) {
|
|
61
63
|
const p = lire();
|
|
62
64
|
if (p === null) {
|
|
63
|
-
dire('⏳ pression CPU illisible : la
|
|
65
|
+
dire('⏳ pression CPU illisible : la mesure part sans attendre, verdict des tests.');
|
|
64
66
|
return true;
|
|
65
67
|
}
|
|
66
68
|
if (p < SEUIL_PRESSION) {
|
|
@@ -74,6 +74,6 @@ export function restes(projet) {
|
|
|
74
74
|
return [];
|
|
75
75
|
}
|
|
76
76
|
return [
|
|
77
|
-
'.claude/settings.json : le greffon rtfm n’est pas activé, qui porte le programme rtfm-serve que .mcp.json nomme, et tient son index ; active-le (« enabledPlugins » : « rtfm@roomi-fields »: true, comme le gabarit), puis
|
|
77
|
+
'.claude/settings.json : le greffon rtfm n’est pas activé, qui porte le programme rtfm-serve que .mcp.json nomme, et tient son index ; active-le (« enabledPlugins » : « rtfm@roomi-fields »: true, comme le gabarit), puis lance npx grillhouse greffons dans l’arbre principal.',
|
|
78
78
|
];
|
|
79
79
|
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// A project holds no follow-up of its supervisor: the note of resumption replaces
|
|
2
|
+
// `pitmaster/SUIVI.md` (greffon.md, §5.2). The file the template placed is removed; one the project
|
|
3
|
+
// filled stays, left to the project. Mechanism: installation.md §5.4
|
|
4
|
+
// (packages/grillhouse/docs/architecture/).
|
|
5
|
+
import { existsSync, readdirSync, readFileSync, rmdirSync, rmSync } from 'node:fs';
|
|
6
|
+
import path from 'node:path';
|
|
7
|
+
|
|
8
|
+
export const version = '0.52.0';
|
|
9
|
+
export const nom = 'suivi du superviseur retire';
|
|
10
|
+
|
|
11
|
+
const FICHIER = 'pitmaster/SUIVI.md';
|
|
12
|
+
// The file as the template of a project placed it, its one form.
|
|
13
|
+
const GABARIT = `# Suivi de la supervision
|
|
14
|
+
|
|
15
|
+
Tenu par la compétence \`pitmaster\`. Une question s'écrit ici dès qu'elle naît ; tranchée, elle en
|
|
16
|
+
sort et sa réponse va dans son ticket.
|
|
17
|
+
|
|
18
|
+
## Dernier tour
|
|
19
|
+
|
|
20
|
+
- Date : aucun tour encore
|
|
21
|
+
- Agents lancés : aucun
|
|
22
|
+
- À vérifier au prochain tour : rien
|
|
23
|
+
|
|
24
|
+
## R — à confirmer par le responsable
|
|
25
|
+
|
|
26
|
+
Chaque point : contexte, exemple, règle, recommandation, question, ticket.
|
|
27
|
+
|
|
28
|
+
## S — à surveiller
|
|
29
|
+
|
|
30
|
+
Chaque point : ce qui se surveille, ce qui le fermera.
|
|
31
|
+
|
|
32
|
+
## F — fermés
|
|
33
|
+
|
|
34
|
+
Chaque point : ce qui l'a fermé, le ticket.
|
|
35
|
+
`;
|
|
36
|
+
|
|
37
|
+
/** The `pitmaster/SUIVI.md` of <projet> retired; returns what it did, or leaves to the project. */
|
|
38
|
+
export function migrer(projet) {
|
|
39
|
+
const fichier = path.join(projet, FICHIER);
|
|
40
|
+
if (!existsSync(fichier)) {
|
|
41
|
+
return [];
|
|
42
|
+
}
|
|
43
|
+
if (readFileSync(fichier, 'utf8') !== GABARIT) {
|
|
44
|
+
return [
|
|
45
|
+
{
|
|
46
|
+
aFaire: `${FICHIER} : rempli par le projet, il n'a plus de lecteur ; reprends son contenu ouvert dans la note de reprise du superviseur (\`npx grillhouse superviseur --question <fichier>\`) ou dans des tickets, puis retire-le`,
|
|
47
|
+
},
|
|
48
|
+
];
|
|
49
|
+
}
|
|
50
|
+
rmSync(fichier);
|
|
51
|
+
const dossier = path.dirname(fichier);
|
|
52
|
+
if (readdirSync(dossier).length === 0) {
|
|
53
|
+
rmdirSync(dossier);
|
|
54
|
+
}
|
|
55
|
+
return [`${FICHIER} : retiré, identique au gabarit ; la note de reprise du superviseur le remplace`];
|
|
56
|
+
}
|
package/scripts/migrations.mjs
CHANGED
|
@@ -54,6 +54,7 @@ import * as reservationDeTroisCoeurs from './migrations/0.49.0-reservation-de-tr
|
|
|
54
54
|
|
|
55
55
|
import * as reglagesHorsDeLaCharte from './migrations/0.50.0-reglages-hors-de-la-charte.mjs';
|
|
56
56
|
import * as serveursDeLIndex from './migrations/serveurs-de-l-index.mjs';
|
|
57
|
+
import * as suiviDuSuperviseurRetire from './migrations/suivi-du-superviseur-retire.mjs';
|
|
57
58
|
|
|
58
59
|
/** The migrations of the core. */
|
|
59
60
|
export const MIGRATIONS = [
|
|
@@ -80,6 +81,7 @@ export const MIGRATIONS = [
|
|
|
80
81
|
reservationDeTroisCoeurs,
|
|
81
82
|
reglagesHorsDeLaCharte,
|
|
82
83
|
serveursDeLIndex,
|
|
84
|
+
suiviDuSuperviseurRetire,
|
|
83
85
|
];
|
|
84
86
|
|
|
85
87
|
/**
|