@roomi-fields/grillhouse 0.43.2 → 0.45.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 +32 -0
- package/cadre/templates/projet/.claude/settings.json +5 -0
- package/cadre/templates/projet/.github/workflows/ci.yml +11 -17
- package/cadre/templates/projet/.github/workflows/nuit.yml +3 -3
- package/cadre/templates/projet/CLAUDE.md +15 -2
- package/cadre/templates/projet/docs/agents/issue-tracker.md +1 -1
- package/cadre/templates/projet/package.json +1 -1
- package/charte.md +3 -2
- package/dist/temporal/circuit/client.d.ts +7 -0
- package/dist/temporal/circuit/client.js +12 -2
- package/dist/temporal/circuit/client.js.map +1 -1
- package/dist/temporal/commande.js +5 -1
- package/dist/temporal/commande.js.map +1 -1
- package/dist/temporal/installation.d.ts +21 -1
- package/dist/temporal/installation.js +207 -16
- package/dist/temporal/installation.js.map +1 -1
- package/dist/temporal/tickets/activites.js +3 -1
- package/dist/temporal/tickets/activites.js.map +1 -1
- package/docs/ARCHITECTURE.md +238 -77
- package/docs/INTERFACE.md +30 -15
- package/package.json +2 -2
- package/scripts/activites.mjs +59 -43
- package/scripts/aiguillage.mjs +1 -0
- package/scripts/attente-de-la-machine.mjs +312 -0
- package/scripts/avancement.mjs +38 -31
- package/scripts/bilan.mjs +30 -5
- package/scripts/circuit.mjs +10 -7
- package/scripts/codes-de-sortie.mjs +1 -1
- package/scripts/coeurs-dedies.mjs +427 -0
- package/scripts/composants-affectes.mjs +3 -1
- package/scripts/consommation-des-passes.mjs +382 -0
- package/scripts/consommation.mjs +45 -0
- package/scripts/copies-finies.mjs +2 -2
- package/scripts/depart-du-ticket.mjs +7 -5
- package/scripts/disque-des-copies.mjs +1 -1
- package/scripts/echantillonneur-de-la-passe.mjs +103 -0
- package/scripts/enveloppe/enveloppe.mjs +3 -13
- package/scripts/enveloppe/lancer.sh +1 -1
- package/scripts/enveloppe/travail-de-la-copie.mjs +3 -2
- package/scripts/grillhouse-maj.mjs +8 -4
- package/scripts/integration/file.mjs +10 -4
- package/scripts/jointure.d.ts +20 -9
- package/scripts/langages/cargo/commandes.mjs +8 -8
- package/scripts/langages/python/commandes.mjs +7 -6
- package/scripts/langages/typescript/tests-de-nuit.mjs +17 -4
- package/scripts/langages/typescript/tests.mjs +15 -6
- package/scripts/langages/typescript/verifier.mjs +23 -17
- package/scripts/langages/typescript/vitest-config/base.mjs +3 -3
- package/scripts/langages/typescript/vitest-config/machine.setup.mjs +7 -7
- package/scripts/langages.d.mts +2 -0
- package/scripts/langages.mjs +79 -0
- package/scripts/mesure/base-de-passe.mjs +1 -1
- package/scripts/migrations/0.44.0-node-26-seul.mjs +47 -0
- package/scripts/migrations/0.44.0-seuil-des-codes-de-tickets.mjs +47 -0
- package/scripts/migrations.mjs +4 -0
- package/scripts/passe-de-la-machine.mjs +456 -31
- package/scripts/places-de-la-machine.mjs +508 -61
- package/scripts/plafond-de-la-machine.d.mts +47 -2
- package/scripts/plafond-de-la-machine.mjs +197 -5
- package/scripts/preparation.mjs +1 -0
- package/scripts/regles-des-places.d.mts +40 -0
- package/scripts/regles-des-places.mjs +91 -0
- package/scripts/retirer-les-copies-finies.mjs +1 -1
- package/scripts/seances.mjs +4 -3
- package/scripts/services-du-noyau.mjs +3 -3
- package/scripts/sortie.mjs +3 -2
- package/scripts/sous-commandes.mjs +6 -7
- package/scripts/tableau.mjs +121 -112
- package/scripts/ticket-du-circuit.mjs +5 -1
- package/scripts/verrous/verrou.mjs +3 -3
- package/scripts/verrou-de-machine.mjs +0 -829
|
@@ -41,9 +41,10 @@
|
|
|
41
41
|
// project's own an earlier update wrote (scripts/migrations/0.23.0-marche-du-projet.mjs).
|
|
42
42
|
// - The status line is a setting of the project, as Husky writes the project's own configuration:
|
|
43
43
|
// in a project whose `.claude/settings.json` exists, `statusLine` becomes the frame's
|
|
44
|
-
// (`"$CLAUDE_PROJECT_DIR/node_modules/.bin/grillhouse" ligne-etat`
|
|
45
|
-
//
|
|
46
|
-
//
|
|
44
|
+
// (`"$CLAUDE_PROJECT_DIR/node_modules/.bin/grillhouse" ligne-etat`, `refreshInterval` 10: the line
|
|
45
|
+
// redraws on a clock, as a session at rest sends no event) when it is absent or names the
|
|
46
|
+
// frame's status line (`ligne-etat`, whatever its former form), which is then rewritten whole;
|
|
47
|
+
// a status line of the project's own stays. The settings keep their other keys, in their order.
|
|
47
48
|
// - `package.json`, when there is one: the version of the frame it is brought to
|
|
48
49
|
// (`grillhouse.version`, the package's version once no migration leaves anything to do), the
|
|
49
50
|
// frame's npm scripts (`tableau`,
|
|
@@ -176,6 +177,9 @@ const PREPARE = 'grillhouse hooks';
|
|
|
176
177
|
|
|
177
178
|
/** The frame's status line, as the settings of a project run it. */
|
|
178
179
|
export const LIGNE_ETAT = '"$CLAUDE_PROJECT_DIR/node_modules/.bin/grillhouse" ligne-etat';
|
|
180
|
+
// Seconds between two redraws of the status line: at rest a session sends no event (`refreshInterval`
|
|
181
|
+
// of Claude Code's `statusLine`).
|
|
182
|
+
const REDESSIN_LIGNE_ETAT = 10;
|
|
179
183
|
|
|
180
184
|
const CHAMPS_INSTALLES = ['dependencies', 'devDependencies', 'optionalDependencies'];
|
|
181
185
|
|
|
@@ -260,7 +264,7 @@ function reglerLigneEtat(projet) {
|
|
|
260
264
|
if (actuelle !== undefined && !commande.includes('ligne-etat')) {
|
|
261
265
|
return false;
|
|
262
266
|
}
|
|
263
|
-
const voulue = { type: 'command', command: LIGNE_ETAT };
|
|
267
|
+
const voulue = { type: 'command', command: LIGNE_ETAT, refreshInterval: REDESSIN_LIGNE_ETAT };
|
|
264
268
|
if (JSON.stringify(actuelle) === JSON.stringify(voulue)) {
|
|
265
269
|
return false;
|
|
266
270
|
}
|
|
@@ -372,10 +372,11 @@ export const TITRE_DU_FLUX_ROUGE = '## Flux de main rouge';
|
|
|
372
372
|
/**
|
|
373
373
|
* Each reading due of the workflows of main read once, without waiting, with the tools <o> at
|
|
374
374
|
* <maintenant> ms and the bounds <ci> (`rechercheMs`, `attenteMs`, from the push of main). A workflow
|
|
375
|
-
* red (any conclusion but `success`) reopens the ticket of the commit pushed
|
|
376
|
-
* `flux-rouge`, a comment giving the address of the run, and closes the reading;
|
|
377
|
-
* nothing; with no run past the search bound, a run unfinished past the wait bound,
|
|
378
|
-
*
|
|
375
|
+
* red (any conclusion but `success` and `cancelled`) reopens the ticket of the commit pushed
|
|
376
|
+
* under the label `flux-rouge`, a comment giving the address of the run, and closes the reading;
|
|
377
|
+
* green, it says nothing; with no run past the search bound, a run unfinished past the wait bound,
|
|
378
|
+
* a run cancelled (a later run of its concurrency group replaced it, or a person stopped it), or
|
|
379
|
+
* `gh` failing, a comment names the workflow and why, nothing is reopened. A reading with a workflow
|
|
379
380
|
* still to come stays due. `{ dues }`: the readings still due.
|
|
380
381
|
*/
|
|
381
382
|
export function relireLesLecturesDues(o, { maintenant, ci }) {
|
|
@@ -429,6 +430,11 @@ export function relireLesLecturesDues(o, { maintenant, ci }) {
|
|
|
429
430
|
} else {
|
|
430
431
|
encore.push(f);
|
|
431
432
|
}
|
|
433
|
+
} else if (v.conclusion === 'cancelled') {
|
|
434
|
+
nonJuge(
|
|
435
|
+
f.nom,
|
|
436
|
+
`le passage ${id} a été annulé (remplacé par un passage plus récent, ou arrêté à la main).`
|
|
437
|
+
);
|
|
432
438
|
} else if (v.conclusion !== 'success') {
|
|
433
439
|
rouge = { nom: f.nom, id };
|
|
434
440
|
break;
|
package/scripts/jointure.d.ts
CHANGED
|
@@ -385,8 +385,9 @@ export function ouvrirAvancement(o: {
|
|
|
385
385
|
export function inscrireLePlan(dossier: string, o: { racine: string; taches: unknown[] }): void;
|
|
386
386
|
/** Keeps the total of a pass that ended, for the next one's measure. */
|
|
387
387
|
export function garderLeTotal(dossier: string): void;
|
|
388
|
-
/** Names the progress directory of the
|
|
389
|
-
*
|
|
388
|
+
/** Names the progress directory of the pass that holds the part its `env` marks, in the file of its
|
|
389
|
+
* part (scripts/places-de-la-machine.mjs), where the board reads it; the function that takes it
|
|
390
|
+
* out. */
|
|
390
391
|
export function nommerLAvancement(o: { env?: NodeJS.ProcessEnv; dossier: string }): () => void;
|
|
391
392
|
/** Opens the base of a pass of the kind `genre` (scripts/mesure/base-de-passe.mjs). */
|
|
392
393
|
export function ouvrirBase(genre: string, o?: { dans?: string }): unknown;
|
|
@@ -466,14 +467,24 @@ export function mesure(racine: string, o?: { tout?: boolean; dans?: string }): u
|
|
|
466
467
|
* and a pass set), or null without the variable (the tool's own default); refuses a value that is
|
|
467
468
|
* not a positive integer, by name. */
|
|
468
469
|
export function travailleursDeLaSeance(env?: NodeJS.ProcessEnv): number | null;
|
|
469
|
-
/** The wait for the
|
|
470
|
+
/** The wait of a pass for the room or the part of the machine, ended without it
|
|
471
|
+
* (scripts/attente-de-la-machine.mjs). */
|
|
470
472
|
export class AttenteDeLaMachine extends Error {}
|
|
471
|
-
/**
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
473
|
+
/**
|
|
474
|
+
* Plays a pass on its part of the machine, held to it by the system, keeping its consumption when
|
|
475
|
+
* heavy (scripts/passe-de-la-machine.mjs).
|
|
476
|
+
*/
|
|
477
|
+
export function avecLaPasse(...args: unknown[]): unknown;
|
|
478
|
+
/** Plays a pass on its part of the machine: its exit code, or the code of the wait that stops. */
|
|
479
|
+
export function surUnePart(
|
|
480
|
+
passe: (env: NodeJS.ProcessEnv, part: { coeurs: number; memoire: number } | null) => number,
|
|
481
|
+
o?: {
|
|
482
|
+
env?: NodeJS.ProcessEnv;
|
|
483
|
+
racine?: string;
|
|
484
|
+
entiere?: boolean;
|
|
485
|
+
mesure?: boolean;
|
|
486
|
+
dire?: (l: string) => void;
|
|
487
|
+
}
|
|
477
488
|
): number;
|
|
478
489
|
/** Waits for room in the temporary directory, as a heavy pass does before it plays. */
|
|
479
490
|
export function attendreDeLaPlace(o?: Record<string, unknown>): void;
|
|
@@ -74,10 +74,9 @@
|
|
|
74
74
|
// green: the one pass of the verification keeps it (scripts/dernier-vert.mjs,
|
|
75
75
|
// scripts/langages/typescript/verifier.mjs). Beside the module of package.json, whose pass plays
|
|
76
76
|
// every task of the graph, the composed command sets `GRAPHE_JOUE` and `verifier` plays `cargo
|
|
77
|
-
// deny check` alone (scripts/commandes-composees.mjs). It plays on
|
|
78
|
-
//
|
|
79
|
-
//
|
|
80
|
-
// running cargo.
|
|
77
|
+
// deny check` alone (scripts/commandes-composees.mjs). It plays on its part of the machine
|
|
78
|
+
// (`avecLaPasse` of ./jointure, as the module typescript's verifier): a pass whose part does not
|
|
79
|
+
// fit makes it wait, and the bound of the wait reached, it stops at 75 without running cargo.
|
|
81
80
|
// - `verifier --gardes` plays the guards alone, the same verdict as the module typescript's: the
|
|
82
81
|
// project's root scripts `grillhouse:gardes` (the frame's guards) then `gardes` (its own), each
|
|
83
82
|
// one the package.json holds a task of the root, by npm, without its tests nor cargo deny, and
|
|
@@ -138,8 +137,8 @@ import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
|
138
137
|
import { RESULTATS } from '../../resultats.mjs';
|
|
139
138
|
import {
|
|
140
139
|
AttenteDeLaMachine,
|
|
141
|
-
|
|
142
|
-
|
|
140
|
+
surUnePart,
|
|
141
|
+
avecLaPasse,
|
|
143
142
|
cheminsDeLaTache,
|
|
144
143
|
construireDepuisLesArguments,
|
|
145
144
|
ecrirePression,
|
|
@@ -876,7 +875,8 @@ export function lancer(nom, args, { racine = process.cwd(), env = process.env }
|
|
|
876
875
|
const dire = l => process.stdout.write(`${l}\n`);
|
|
877
876
|
try {
|
|
878
877
|
return sousLaBase('verification', env, envBase =>
|
|
879
|
-
|
|
878
|
+
avecLaPasse(envMachine => verifier(racine, args, envMachine), {
|
|
879
|
+
lourde: true,
|
|
880
880
|
env: envBase,
|
|
881
881
|
racine,
|
|
882
882
|
dire,
|
|
@@ -892,7 +892,7 @@ export function lancer(nom, args, { racine = process.cwd(), env = process.env }
|
|
|
892
892
|
}
|
|
893
893
|
const tous = crates(racine);
|
|
894
894
|
if (nom === 'tester') {
|
|
895
|
-
return
|
|
895
|
+
return surUnePart(e => tester(racine, tous, args, e), { env, racine });
|
|
896
896
|
}
|
|
897
897
|
if (nom === 'tests-du-paquet') {
|
|
898
898
|
return sousLaBase('tests', env, (envBase, pp) =>
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
// `GRILLHOUSE_TESTS`). It keeps no green: the one pass of the verification keeps it
|
|
47
47
|
// (scripts/dernier-vert.mjs, scripts/langages/typescript/verifier.mjs). Beside the module of
|
|
48
48
|
// package.json, whose pass plays every task of the graph, the composed command sets
|
|
49
|
-
// `GRAPHE_JOUE` and `verifier` plays nothing again. It plays on
|
|
50
|
-
// the machine
|
|
49
|
+
// `GRAPHE_JOUE` and `verifier` plays nothing again. It plays on its part of
|
|
50
|
+
// the machine (`avecLaPasse` of ./jointure), as the module cargo's. `verifier --gardes` plays
|
|
51
51
|
// the guards alone: the project's root scripts `grillhouse:gardes` then `gardes` the package.json
|
|
52
52
|
// holds.
|
|
53
53
|
// - `typer`: `uv run --locked python -m compileall`, the folders whose name begins with a dot (the
|
|
@@ -87,8 +87,8 @@ import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
|
87
87
|
import { RESULTATS } from '../../resultats.mjs';
|
|
88
88
|
import {
|
|
89
89
|
AttenteDeLaMachine,
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
surUnePart,
|
|
91
|
+
avecLaPasse,
|
|
92
92
|
cacheDeCompilation,
|
|
93
93
|
cheminsDeLaTache,
|
|
94
94
|
construireDepuisLesArguments,
|
|
@@ -492,7 +492,7 @@ function sousLaBase(genre, env, jouer) {
|
|
|
492
492
|
*/
|
|
493
493
|
export function lancer(nom, args, { racine = process.cwd(), env = process.env } = {}) {
|
|
494
494
|
if (nom === 'tester') {
|
|
495
|
-
return
|
|
495
|
+
return surUnePart(e => tester(racine, args, e), { env, racine });
|
|
496
496
|
}
|
|
497
497
|
if (nom === 'tests-du-paquet') {
|
|
498
498
|
return sousLaBase('tests', env, e => testsDuPaquet(racine, args, e));
|
|
@@ -516,7 +516,8 @@ export function lancer(nom, args, { racine = process.cwd(), env = process.env }
|
|
|
516
516
|
const dire = l => process.stdout.write(`${l}\n`);
|
|
517
517
|
try {
|
|
518
518
|
return sousLaBase('verification', env, envBase =>
|
|
519
|
-
|
|
519
|
+
avecLaPasse(envMachine => verifier(racine, args, envMachine), {
|
|
520
|
+
lourde: true,
|
|
520
521
|
env: envBase,
|
|
521
522
|
racine,
|
|
522
523
|
dire,
|
|
@@ -36,15 +36,16 @@
|
|
|
36
36
|
// - The exit code: 0 when every run is green; 75, « à repasser », when every red run is at 75
|
|
37
37
|
// (every failure depended on a duration, one under load, ./vitest-config/duree.reporter.mjs);
|
|
38
38
|
// else the code of the first red run.
|
|
39
|
-
// - They play
|
|
40
|
-
//
|
|
39
|
+
// - They play on the whole budget of the machine as their part (`avecLaPasse` of
|
|
40
|
+
// scripts/passe-de-la-machine.mjs, `entiere`), alone, once the temporary directory and the disk of
|
|
41
|
+
// the copy have room, as every pass: a wait that reaches its bound ends at 75.
|
|
41
42
|
import { spawnSync } from 'node:child_process';
|
|
42
43
|
import { readdirSync, rmSync } from 'node:fs';
|
|
43
44
|
import path from 'node:path';
|
|
44
45
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
45
46
|
import {
|
|
46
47
|
A_REPASSER,
|
|
47
|
-
|
|
48
|
+
avecLaPasse,
|
|
48
49
|
LA_FORME,
|
|
49
50
|
lireLaTranche,
|
|
50
51
|
} from '../../services-du-noyau.mjs';
|
|
@@ -135,8 +136,15 @@ export function testsDeNuit(racine, options = {}) {
|
|
|
135
136
|
if (runs.length === 0) {
|
|
136
137
|
return 0;
|
|
137
138
|
}
|
|
139
|
+
// The night tests and the measures of time ask for the whole budget as their part: they play
|
|
140
|
+
// alone, once the room of the temporary directory and of the copy is there.
|
|
138
141
|
try {
|
|
139
|
-
|
|
142
|
+
return avecLaPasse(() => jouerLesRuns(racine, runs, options), {
|
|
143
|
+
lourde: false,
|
|
144
|
+
entiere: true,
|
|
145
|
+
racine,
|
|
146
|
+
sorte: 'Tests de nuit',
|
|
147
|
+
});
|
|
140
148
|
} catch (e) {
|
|
141
149
|
if (e?.name !== 'AttenteDeLaMachine') {
|
|
142
150
|
throw e;
|
|
@@ -144,6 +152,11 @@ export function testsDeNuit(racine, options = {}) {
|
|
|
144
152
|
process.stdout.write(`${e.message}\n`);
|
|
145
153
|
return e.code;
|
|
146
154
|
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// The runs <runs> of Vitest of the night, in the copy at <racine>: the code of the first red one,
|
|
158
|
+
// 75 when every red is « à repasser ».
|
|
159
|
+
function jouerLesRuns(racine, runs, options) {
|
|
147
160
|
const { tranche } = options;
|
|
148
161
|
const rapports = path.join(racine, RAPPORTS);
|
|
149
162
|
if (tranche) {
|
|
@@ -93,11 +93,12 @@ import {
|
|
|
93
93
|
paquetsDeLEnveloppe,
|
|
94
94
|
retirerALInterruption,
|
|
95
95
|
SCRIPT_DES_TESTS,
|
|
96
|
-
|
|
96
|
+
surUnePart,
|
|
97
97
|
TESTS_CIBLES,
|
|
98
98
|
testsCibles,
|
|
99
99
|
tracesDuPlan,
|
|
100
100
|
} from '../../services-du-noyau.mjs';
|
|
101
|
+
import { estHorsDuJour } from './vitest-config/cibles.mjs';
|
|
101
102
|
import { paquets } from '../../paquets.mjs';
|
|
102
103
|
import { RESULTATS } from '../../resultats.mjs';
|
|
103
104
|
import { garderLesResumes } from './resume-du-lanceur.mjs';
|
|
@@ -265,12 +266,20 @@ const lancer = () => {
|
|
|
265
266
|
};
|
|
266
267
|
|
|
267
268
|
try {
|
|
268
|
-
// The run takes
|
|
269
|
-
// of Turborepo carries to its tasks
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
269
|
+
// The run takes its part of the machine (scripts/passe-de-la-machine.mjs `surUnePart`), whose
|
|
270
|
+
// mark every run of Turborepo carries to its tasks; a measure of time named plays on dedicated
|
|
271
|
+
// cores (`mesure`), the rest of the machine going on.
|
|
272
|
+
const mesureDeTemps = chemins.some(c => {
|
|
273
|
+
const abs = path.resolve(racine, c);
|
|
274
|
+
return existsSync(abs) && statSync(abs).isFile() && estHorsDuJour(abs);
|
|
273
275
|
});
|
|
276
|
+
process.exitCode = surUnePart(
|
|
277
|
+
env => {
|
|
278
|
+
Object.assign(process.env, env);
|
|
279
|
+
return lancer();
|
|
280
|
+
},
|
|
281
|
+
{ racine, mesure: mesureDeTemps }
|
|
282
|
+
);
|
|
274
283
|
} finally {
|
|
275
284
|
lacher();
|
|
276
285
|
depuis?.retirer();
|
|
@@ -29,12 +29,13 @@
|
|
|
29
29
|
// - `--tout`, and `--force` (the night, scripts/nuit.sh), play the complete pass: no measure
|
|
30
30
|
// against the last green, and each task of tests played for real (the variable of the tests
|
|
31
31
|
// carries the moment of the pass, `rejouer`, which no cached run holds).
|
|
32
|
-
// - The pass
|
|
33
|
-
// shared by every repository of the machine: a pass
|
|
34
|
-
//
|
|
35
|
-
//
|
|
36
|
-
//
|
|
37
|
-
//
|
|
32
|
+
// - The pass takes its part of the budget of the machine (scripts/places-de-la-machine.mjs,
|
|
33
|
+
// `avecLaPasse`), shared by every repository of the machine: a pass whose part does not fit in
|
|
34
|
+
// what the parts held leave, or that the load and the memory refuse, waits, and says so, with
|
|
35
|
+
// what it waits for, when it begins and every 30 s. The wait bounded (60 min), the pass ends at
|
|
36
|
+
// 75, « à repasser »; a key `grillhouse.part` or a reserve that is faulty ends it at once, red
|
|
37
|
+
// (1); either way without playing. A pass in the frame's own repository passes before a
|
|
38
|
+
// project's. It plays held to its part by the system, in a control group of its own.
|
|
38
39
|
// - Turborepo plays the build, then the guards (the frame's, `grillhouse:gardes`, and the
|
|
39
40
|
// project's own, its root script `gardes`), the typing of each package (`typecheck`, its
|
|
40
41
|
// sources and its tests, cached per package: scripts/langages/typescript/turbo-des-paquets.mjs) and the tests
|
|
@@ -42,7 +43,7 @@
|
|
|
42
43
|
// `turbo run grillhouse:gardes gardes typecheck test:unit --continue=dependencies-successful
|
|
43
44
|
// --concurrency=<n> --summarize`, each argument given after it. A red does not stop the pass:
|
|
44
45
|
// every task whose prerequisites passed plays, and each red is named. <n>, the tasks side by
|
|
45
|
-
// side, is half the cores of the
|
|
46
|
+
// side, is half the cores of the pass's part, one at least (`concurrence`): each task of tests is
|
|
46
47
|
// itself parallel (Vitest's workers), as make's `-j` and Bazel's `--local_cpu_resources` bound a
|
|
47
48
|
// build by the machine; a `--concurrency` among the arguments replaces it. The workers of each
|
|
48
49
|
// task of tests are the cores shared between the tasks of tests side by side
|
|
@@ -75,8 +76,8 @@
|
|
|
75
76
|
// - A task at 0 is green. A task at any other code, 75 included, and a summary that does not read
|
|
76
77
|
// while Turborepo failed: red, code 1, each task named.
|
|
77
78
|
// - The progress of the pass (scripts/avancement.mjs): the directory its caller names in
|
|
78
|
-
// GRILLHOUSE_AVANCEMENT (the circuit's), else one of its own, which it names
|
|
79
|
-
//
|
|
79
|
+
// GRILLHOUSE_AVANCEMENT (the circuit's), else one of its own, which it names in the file of the
|
|
80
|
+
// part it holds while it plays (`nommerLAvancement`), as the board shows its holder, and
|
|
80
81
|
// removes at its end, its total kept. Before its run of Turborepo, the plan of
|
|
81
82
|
// the run (`turbo run … --dry=json`) names its tasks of tests and counts done the files of those
|
|
82
83
|
// Turborepo replays from its cache.
|
|
@@ -115,7 +116,7 @@ import {
|
|
|
115
116
|
A_REPASSER,
|
|
116
117
|
AttenteDeLaMachine,
|
|
117
118
|
AVANCEMENT,
|
|
118
|
-
|
|
119
|
+
avecLaPasse,
|
|
119
120
|
BASE_DU_LOT,
|
|
120
121
|
CHANGEMENTS,
|
|
121
122
|
consignerLesRegressions,
|
|
@@ -137,6 +138,7 @@ import {
|
|
|
137
138
|
SCRIPT_DES_TESTS,
|
|
138
139
|
TESTS_CIBLES,
|
|
139
140
|
testsCibles,
|
|
141
|
+
travailleursDeLaSeance,
|
|
140
142
|
VARIABLE_TRAVAILLEURS,
|
|
141
143
|
} from '../../services-du-noyau.mjs';
|
|
142
144
|
import { paquets, TYPAGE } from '../../paquets.mjs';
|
|
@@ -183,8 +185,10 @@ export const travailleursDeLaPasse = ({ coeurs, coteACote, paquets: n }) =>
|
|
|
183
185
|
Math.max(1, Math.floor(coeurs / Math.max(1, Math.min(coteACote, n))));
|
|
184
186
|
|
|
185
187
|
// The full pass in <racine>, its arguments <args> (`--gardes` among them: the guards alone), under
|
|
186
|
-
// <env> and
|
|
187
|
-
// room in the temporary directory, reaches its bound, or when the watch of the memory cuts the run.
|
|
188
|
+
// <env> and its part of the machine; its verdict, 0 or 1, or 75 when the wait for the part, or for
|
|
189
|
+
// room in the temporary directory, reaches its bound, or when the watch of the memory cuts the run.
|
|
190
|
+
// `dire` writes a line; `coeurs`, the cores the pass shares between its tasks when no part is
|
|
191
|
+
// held (the part's cores otherwise, or those its parent's part gives: GRILLHOUSE_TRAVAILLEURS).
|
|
188
192
|
export function verifier({
|
|
189
193
|
racine = process.cwd(),
|
|
190
194
|
args: demandes = [],
|
|
@@ -203,10 +207,12 @@ export function verifier({
|
|
|
203
207
|
const base = ouvrirBase('verification', { dans: env.TMPDIR || tmpdir() });
|
|
204
208
|
const lacher = retirerALInterruption(base.fermer);
|
|
205
209
|
try {
|
|
206
|
-
return
|
|
207
|
-
envMachine => {
|
|
210
|
+
return avecLaPasse(
|
|
211
|
+
(envMachine, { part }) => {
|
|
212
|
+
// The cores the pass shares between its tasks: its part's, else its parent's part's.
|
|
213
|
+
const sesCoeurs = part?.coeurs ?? travailleursDeLaSeance(envMachine) ?? coeurs;
|
|
208
214
|
// The progress of the pass: the directory its caller names (the circuit's), else its own,
|
|
209
|
-
// named
|
|
215
|
+
// named in the file of its part while it plays.
|
|
210
216
|
const propre = !envMachine[AVANCEMENT];
|
|
211
217
|
const dossier =
|
|
212
218
|
envMachine[AVANCEMENT] || ouvrirAvancement({ racine, genre: 'verification' });
|
|
@@ -217,7 +223,7 @@ export function verifier({
|
|
|
217
223
|
demandes,
|
|
218
224
|
env: { ...envMachine, [AVANCEMENT]: dossier, ...base.env },
|
|
219
225
|
dire,
|
|
220
|
-
coeurs,
|
|
226
|
+
coeurs: sesCoeurs,
|
|
221
227
|
});
|
|
222
228
|
} finally {
|
|
223
229
|
effacer();
|
|
@@ -227,7 +233,7 @@ export function verifier({
|
|
|
227
233
|
}
|
|
228
234
|
}
|
|
229
235
|
},
|
|
230
|
-
{ env, racine, dire }
|
|
236
|
+
{ lourde: true, env, racine, dire }
|
|
231
237
|
);
|
|
232
238
|
} catch (e) {
|
|
233
239
|
if (!(e instanceof AttenteDeLaMachine)) {
|
|
@@ -43,9 +43,9 @@
|
|
|
43
43
|
// `@roomi-fields/grillhouse/vitest-config/mesure`). `mergeConfig` adds the reporters and the setup files of
|
|
44
44
|
// a configuration that extends this one to these; a reporter named on the command line
|
|
45
45
|
// (`--reporter`) replaces them, and Vitest's code then stands.
|
|
46
|
-
// - The machine of a test file is its own: a setup file gives it a
|
|
47
|
-
// its own, so that a `npm run verifier` a test plays in a repository of trial
|
|
48
|
-
//
|
|
46
|
+
// - The machine of a test file is its own: a setup file gives it a directory of the state of the
|
|
47
|
+
// parts of its own, so that a `npm run verifier` a test plays in a repository of trial takes its
|
|
48
|
+
// part among its own parts alone (./machine.setup.mjs, scripts/places-de-la-machine.mjs).
|
|
49
49
|
// - While a run names its results directory (`GRILLHOUSE_RESULTATS`, ./resultats.mjs), the JSON
|
|
50
50
|
// reporter writes Vitest's report there too, which the circuit reads (scripts/resultats.mjs); a
|
|
51
51
|
// setup file gives each test file's processes a results directory of their own, so that a run a
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// A setup file of the base configuration: the machine of a test file is its own. The file gets a
|
|
2
|
-
//
|
|
3
|
-
// directory named after its process and a token, scripts/
|
|
4
|
-
// process it starts inherits: a `npm run verifier` or a circuit that a test plays in
|
|
5
|
-
// of trial
|
|
6
|
-
// user's
|
|
2
|
+
// directory of the state of the parts of its own (GRILLHOUSE_PARTS_DE_LA_MACHINE, a directory of
|
|
3
|
+
// the temporary directory named after its process and a token, scripts/places-de-la-machine.mjs),
|
|
4
|
+
// which every process it starts inherits: a `npm run verifier` or a circuit that a test plays in
|
|
5
|
+
// a repository of trial takes its part there, among its own parts alone, and no test writes in the
|
|
6
|
+
// user's state. A directory already named in the environment stays. Its passes want no room in
|
|
7
7
|
// the temporary directory (GRILLHOUSE_TEMPORAIRE_LIBRE, 0) nor on the disk of their copy
|
|
8
8
|
// (GRILLHOUSE_COPIE_LIBRE, 0): the room of the machine is the pass's that plays the file, which
|
|
9
9
|
// waited for it.
|
|
@@ -14,9 +14,9 @@ import { randomUUID } from 'node:crypto';
|
|
|
14
14
|
import { tmpdir } from 'node:os';
|
|
15
15
|
import path from 'node:path';
|
|
16
16
|
|
|
17
|
-
process.env.
|
|
17
|
+
process.env.GRILLHOUSE_PARTS_DE_LA_MACHINE ||= path.join(
|
|
18
18
|
tmpdir(),
|
|
19
|
-
`grillhouse-
|
|
19
|
+
`grillhouse-parts-${process.pid}-${randomUUID()}`
|
|
20
20
|
);
|
|
21
21
|
// The machine a test reads is a fixed one (GRILLHOUSE_MESURE_D_ESSAI, scripts/places-de-la-machine.mjs
|
|
22
22
|
// `etatDesPlaces`): no test reads the real load or memory of the user's machine.
|
package/scripts/langages.d.mts
CHANGED
|
@@ -18,3 +18,5 @@ export function langagesDe(racine: string): Langage[];
|
|
|
18
18
|
/** The join of the modules that serve the project at <racine>: the module itself when the project
|
|
19
19
|
* declares one, else their composition. */
|
|
20
20
|
export function langageDe(racine: string): Composition;
|
|
21
|
+
/** The join of the copy <copie>, its readings played in the main tree when they throw in it. */
|
|
22
|
+
export function langageDeLaCopie(copie: string, principal?: () => string | null): Composition;
|
package/scripts/langages.mjs
CHANGED
|
@@ -15,8 +15,18 @@
|
|
|
15
15
|
// `langageDe` their join (./composition-des-langages.mjs), which gives each file to the module
|
|
16
16
|
// of its component, the module itself when one is declared. A name out of the list is refused,
|
|
17
17
|
// named.
|
|
18
|
+
// - A copy its tool no longer loads is still read: `langageDeLaCopie` gives the join whose
|
|
19
|
+
// readings of the tree (LECTURES: the components, the test material, the class of a file; and
|
|
20
|
+
// the part of a manifest its tests own) are
|
|
21
|
+
// played in the main tree of the repository when they throw in the copy, the paths carried from
|
|
22
|
+
// one tree to the other. A session leaves such a copy between two writes of one change (cargo:
|
|
23
|
+
// a dependency moved in the manifest of the workspace and not yet in a crate's, osc-bridge
|
|
24
|
+
// OB-ud1.6); the lock of its writes, its envelope and the acts of its circuit read on, as
|
|
25
|
+
// rust-analyzer keeps the last graph that loaded, and the write that repairs the copy passes.
|
|
26
|
+
// `langageDe` stays strict: a guard, a build and the red of a reading read the tree as it is.
|
|
18
27
|
// - A module is loaded once per process, synchronously (`require` of an ES module, Node 22): the
|
|
19
28
|
// locks and the guards ask it in a hook, where nothing waits.
|
|
29
|
+
import { spawnSync } from 'node:child_process';
|
|
20
30
|
import { createRequire } from 'node:module';
|
|
21
31
|
import path from 'node:path';
|
|
22
32
|
import { composer } from './composition-des-langages.mjs';
|
|
@@ -102,3 +112,72 @@ export function langageDe(racine) {
|
|
|
102
112
|
}
|
|
103
113
|
return composes.get(cle);
|
|
104
114
|
}
|
|
115
|
+
|
|
116
|
+
// The main tree of the repository the copy <copie> belongs to, from git's common directory; null
|
|
117
|
+
// out of git.
|
|
118
|
+
function arbrePrincipal(copie) {
|
|
119
|
+
const r = spawnSync(
|
|
120
|
+
'git',
|
|
121
|
+
['-C', copie, 'rev-parse', '--path-format=absolute', '--git-common-dir'],
|
|
122
|
+
{ encoding: 'utf8' }
|
|
123
|
+
);
|
|
124
|
+
return r.status === 0 && r.stdout.trim() ? path.dirname(r.stdout.trim()) : null;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// <v> with each path under the tree <de> carried under the tree <vers>, in its strings, its arrays
|
|
128
|
+
// and its objects; a path under <sauf> (the copy, which lies under the main tree) is left.
|
|
129
|
+
function porter(v, de, vers, sauf = null) {
|
|
130
|
+
const sous = (p, d) => p === d || p.startsWith(d + path.sep);
|
|
131
|
+
if (typeof v === 'string') {
|
|
132
|
+
return sous(v, de) && !(sauf && sous(v, sauf)) ? vers + v.slice(de.length) : v;
|
|
133
|
+
}
|
|
134
|
+
if (Array.isArray(v)) {
|
|
135
|
+
return v.map(x => porter(x, de, vers, sauf));
|
|
136
|
+
}
|
|
137
|
+
if (v !== null && typeof v === 'object') {
|
|
138
|
+
return Object.fromEntries(Object.entries(v).map(([k, x]) => [k, porter(x, de, vers, sauf)]));
|
|
139
|
+
}
|
|
140
|
+
return v;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* The readings of the tree a copy its tool no longer loads still answers (see the header), and
|
|
145
|
+
* with them the part of a manifest its tests own (`manifestes.horsDesTests`).
|
|
146
|
+
*/
|
|
147
|
+
const LECTURES = ['composants', 'matieres', 'estUnTest'];
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* The join of the languages of the copy <copie> (`langageDe`), each of its readings of the tree
|
|
151
|
+
* (LECTURES) played in the main tree <principal> of its repository when it throws in the copy:
|
|
152
|
+
* the paths of its arguments carried to the main tree, those of its answer back to the copy.
|
|
153
|
+
* Without a main tree, in the main tree itself, or when the main tree throws too, the error of
|
|
154
|
+
* the copy is thrown.
|
|
155
|
+
* @param {string} copie the root of the copy
|
|
156
|
+
* @param {() => string | null} [principal] the main tree of its repository, read when needed
|
|
157
|
+
* @returns {import('./jointure.js').Composition}
|
|
158
|
+
*/
|
|
159
|
+
export function langageDeLaCopie(copie, principal = () => arbrePrincipal(copie)) {
|
|
160
|
+
const langage = langageDe(copie);
|
|
161
|
+
const ici = path.resolve(copie);
|
|
162
|
+
const tolerer = lecture =>
|
|
163
|
+
function (...args) {
|
|
164
|
+
try {
|
|
165
|
+
return lecture.apply(langage, args);
|
|
166
|
+
} catch (e) {
|
|
167
|
+
const p = principal();
|
|
168
|
+
const la = p === null ? null : path.resolve(p);
|
|
169
|
+
if (la === null || la === ici) {
|
|
170
|
+
throw e;
|
|
171
|
+
}
|
|
172
|
+
try {
|
|
173
|
+
return porter(lecture.apply(langage, porter(args, ici, la)), la, ici, ici);
|
|
174
|
+
} catch {
|
|
175
|
+
throw e;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
return Object.assign(Object.create(langage), {
|
|
180
|
+
...Object.fromEntries(LECTURES.map(n => [n, tolerer(langage[n])])),
|
|
181
|
+
manifestes: { ...langage.manifestes, horsDesTests: tolerer(langage.manifestes.horsDesTests) },
|
|
182
|
+
});
|
|
183
|
+
}
|
|
@@ -412,7 +412,7 @@ export function dansLeTemporaire(chemin, env = process.env) {
|
|
|
412
412
|
|
|
413
413
|
/**
|
|
414
414
|
* The cache of compilation of <outil> under <env>: `${XDG_CACHE_HOME:-$HOME/.cache}/grillhouse/
|
|
415
|
-
* <outil>`,
|
|
415
|
+
* <outil>`, never in the temporary directory.
|
|
416
416
|
* @param {string} outil `sccache`, `uv`, `cargo`…
|
|
417
417
|
* @param {Record<string, string | undefined>} [env]
|
|
418
418
|
*/
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// From 0.44.0 the frame supports Node 26 alone (grillhouse-3uv.103): the CI and the night of
|
|
2
|
+
// GitHub play Node 26 only, and the template declares `engines.node` `>=26.0.0`.
|
|
3
|
+
//
|
|
4
|
+
// - A project's package.json that holds the exact value the template held before (`>=22.0.0` or
|
|
5
|
+
// `>=24.0.0`) receives `>=26.0.0`; only that value changes in the text.
|
|
6
|
+
// - Any other value stays, and a line names it: the workflows of the project play Node 26 alone,
|
|
7
|
+
// with no proof of the version it declares; the project raises it or widens its matrix.
|
|
8
|
+
// - The frame's workflows of the project are written again from the template
|
|
9
|
+
// (scripts/workflows-du-cadre.mjs): a project that holds none receives none.
|
|
10
|
+
// - A project already migrated, or without package.json, changes nothing and returns no line.
|
|
11
|
+
import { existsSync, readFileSync, writeFileSync } from 'node:fs';
|
|
12
|
+
import path from 'node:path';
|
|
13
|
+
import { CADRE } from '../cadre.mjs';
|
|
14
|
+
import { poserLesWorkflows } from '../workflows-du-cadre.mjs';
|
|
15
|
+
|
|
16
|
+
export const version = '0.44.0';
|
|
17
|
+
export const nom = 'node 26 seul';
|
|
18
|
+
|
|
19
|
+
// The values of the template before this version, and the one it holds from it.
|
|
20
|
+
const MOTEURS_AVANT = ['>=22.0.0', '>=24.0.0'];
|
|
21
|
+
const MOTEUR = '>=26.0.0';
|
|
22
|
+
|
|
23
|
+
// A text as a pattern that matches it alone.
|
|
24
|
+
const litteral = t => t.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
25
|
+
|
|
26
|
+
/** Gives the project `engines.node` `>=26.0.0` and the template's workflows. */
|
|
27
|
+
export function migrer(projet) {
|
|
28
|
+
const lignes = [];
|
|
29
|
+
const f = path.join(projet, 'package.json');
|
|
30
|
+
if (existsSync(f)) {
|
|
31
|
+
const texte = readFileSync(f, 'utf8');
|
|
32
|
+
const actuel = JSON.parse(texte).engines?.node;
|
|
33
|
+
if (MOTEURS_AVANT.includes(actuel)) {
|
|
34
|
+
const motif = new RegExp(`("node"\\s*:\\s*)${litteral(JSON.stringify(actuel))}`);
|
|
35
|
+
writeFileSync(f, texte.replace(motif, (_, debut) => `${debut}${JSON.stringify(MOTEUR)}`));
|
|
36
|
+
lignes.push(`package.json : engines.node passe à ${MOTEUR}`);
|
|
37
|
+
} else if (typeof actuel === 'string' && actuel !== MOTEUR) {
|
|
38
|
+
lignes.push(
|
|
39
|
+
`package.json : engines.node vaut ${actuel}, laissé tel quel ; les workflows du cadre jouent Node 26 seul, sans preuve sur cette version : la relever (${MOTEUR}) ou étendre la matrice des workflows`
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
for (const ecrit of poserLesWorkflows(projet, CADRE)) {
|
|
44
|
+
lignes.push(`${ecrit} : réécrit depuis le gabarit (Node 26 seul)`);
|
|
45
|
+
}
|
|
46
|
+
return lignes;
|
|
47
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// From 0.44.0 the frame sets the threshold of Beads that keeps the codes of the tickets at three
|
|
2
|
+
// characters (`max_collision_prob`, 0.99) in every project (grillhouse-3uv.104).
|
|
3
|
+
//
|
|
4
|
+
// - A project whose Beads has no value gets 0.99, and the update says so once.
|
|
5
|
+
// - A project whose Beads has another value keeps it; the update names it, with the command that
|
|
6
|
+
// aligns it. The line is information, not a to-do, and never fails the update.
|
|
7
|
+
// - A project that already has 0.99 is not touched: a second pass changes nothing and returns no line.
|
|
8
|
+
// - A project whose Beads cannot be reached (no `bd`, no store) is not written; the update says so.
|
|
9
|
+
import { spawnSync } from 'node:child_process';
|
|
10
|
+
|
|
11
|
+
export const version = '0.44.0';
|
|
12
|
+
export const nom = 'seuil des codes de tickets';
|
|
13
|
+
|
|
14
|
+
const CLE = 'max_collision_prob';
|
|
15
|
+
const SEUIL = '0.99';
|
|
16
|
+
|
|
17
|
+
const bd = (projet, args) =>
|
|
18
|
+
spawnSync('bd', args, { cwd: projet, encoding: 'utf8', maxBuffer: 256 * 1024 * 1024 });
|
|
19
|
+
|
|
20
|
+
/** Sets `max_collision_prob` to 0.99 in the Beads of a project that has no value. */
|
|
21
|
+
export function migrer(projet) {
|
|
22
|
+
const lu = bd(projet, ['config', 'get', CLE]);
|
|
23
|
+
if (lu.error || lu.status !== 0) {
|
|
24
|
+
return [
|
|
25
|
+
`Beads : ${CLE} non posé (Beads n'est pas joignable : pas de bd ou pas de store) ; ` +
|
|
26
|
+
`le cadre pose ${SEUIL} : bd config set ${CLE} ${SEUIL}`,
|
|
27
|
+
];
|
|
28
|
+
}
|
|
29
|
+
const valeur = (lu.stdout ?? '').trim();
|
|
30
|
+
if (valeur === SEUIL) {
|
|
31
|
+
return [];
|
|
32
|
+
}
|
|
33
|
+
if (valeur !== '' && !valeur.includes('(not set)')) {
|
|
34
|
+
return [
|
|
35
|
+
`Beads : ${CLE} vaut ${valeur}, gardé (le cadre pose ${SEUIL} ; ` +
|
|
36
|
+
`pour l'aligner : bd config set ${CLE} ${SEUIL})`,
|
|
37
|
+
];
|
|
38
|
+
}
|
|
39
|
+
const pose = bd(projet, ['config', 'set', CLE, SEUIL]);
|
|
40
|
+
if (pose.error || pose.status !== 0) {
|
|
41
|
+
return [
|
|
42
|
+
`Beads : ${CLE} non posé (bd config set a échoué) ; ` +
|
|
43
|
+
`le cadre pose ${SEUIL} : bd config set ${CLE} ${SEUIL}`,
|
|
44
|
+
];
|
|
45
|
+
}
|
|
46
|
+
return [`Beads : ${CLE} posé à ${SEUIL} (les codes de tickets restent à trois caractères)`];
|
|
47
|
+
}
|