@roomi-fields/grillhouse 0.28.2 → 0.29.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/bin/grillhouse.mjs +55 -14
- package/cadre/templates/projet/CLAUDE.md +1 -1
- package/cadre/templates/projet/README.md +11 -11
- package/cadre/templates/projet/_gitignore +2 -5
- package/charte.md +24 -3
- package/docs/ARCHITECTURE.md +279 -31
- package/docs/INTERFACE.md +59 -11
- package/package.json +1 -1
- package/scripts/aiguillage.mjs +324 -0
- package/scripts/avancement.mjs +33 -50
- package/scripts/circuit.mjs +558 -146
- package/scripts/composition-des-langages.mjs +16 -1
- package/scripts/conformite.mjs +16 -0
- package/scripts/copies-finies.mjs +181 -29
- package/scripts/demon.mjs +134 -21
- package/scripts/enveloppe/enveloppe.mjs +8 -5
- package/scripts/enveloppe/lancer.sh +24 -15
- package/scripts/enveloppe/travail-de-la-copie.mjs +94 -11
- package/scripts/etapes.mjs +1 -1
- package/scripts/fusion-du-changelog.mjs +0 -1
- package/scripts/grillhouse-maj.mjs +16 -7
- package/scripts/integration/file.mjs +3 -3
- package/scripts/integration/integrer.mjs +3 -3
- package/scripts/jointure.d.ts +53 -17
- package/scripts/langages/cargo/commandes.mjs +152 -25
- package/scripts/langages/cargo/composants.mjs +94 -2
- package/scripts/langages/cargo/exemples.mjs +68 -1
- package/scripts/langages/cargo/index.mjs +21 -10
- package/scripts/langages/cargo/migrations/0.28.4-tailles-des-tests.mjs +35 -0
- package/scripts/langages/cargo/sccache.mjs +89 -6
- package/scripts/langages/cargo/squelette.mjs +72 -3
- package/scripts/langages/cargo/tailles-des-tests.mjs +195 -0
- package/scripts/langages/cargo/tests-de-head.mjs +159 -0
- package/scripts/langages/python/commandes.mjs +53 -9
- package/scripts/langages/python/composants.mjs +33 -3
- package/scripts/langages/python/exemples.mjs +19 -0
- package/scripts/langages/python/index.mjs +7 -2
- package/scripts/langages/python/squelette.mjs +119 -17
- package/scripts/langages/typescript/exemples.mjs +16 -0
- package/scripts/langages/typescript/index.mjs +6 -3
- package/scripts/langages/typescript/regle-des-tests.mjs +13 -0
- package/scripts/langages/typescript/squelette.mjs +18 -2
- package/scripts/langages/typescript/tests-de-nuit.mjs +50 -20
- package/scripts/langages/typescript/verifier.mjs +82 -288
- package/scripts/langages/typescript/vitest-config/base.mjs +8 -9
- package/scripts/langages/typescript/vitest-config/cibles.mjs +92 -53
- package/scripts/langages/typescript/vitest-config/duree.reporter.mjs +11 -5
- package/scripts/langages/typescript/vitest-config/machine.setup.mjs +6 -1
- package/scripts/langages/typescript/vitest-config/mesure.mjs +3 -2
- package/scripts/langages/typescript/vitest.nuit.config.mjs +18 -13
- package/scripts/lecture-unique.mjs +51 -0
- package/scripts/mesure/base-de-passe.mjs +202 -9
- package/scripts/mesure/pression.mjs +9 -7
- package/scripts/nuit.sh +19 -12
- package/scripts/outil.mjs +72 -0
- package/scripts/paquet.mjs +39 -10
- package/scripts/resultats.mjs +22 -5
- package/scripts/services-du-noyau.mjs +16 -10
- package/scripts/session-start.sh +10 -1
- package/scripts/sortie.mjs +20 -1
- package/scripts/sources.mjs +3 -3
- package/scripts/sous-commandes.mjs +2 -0
- package/scripts/superviseur.mjs +369 -14
- package/scripts/tableau.mjs +219 -58
- package/scripts/verrou-de-machine.mjs +425 -37
- package/skills/developpeur/SKILL.md +11 -3
- package/skills/pitmaster/SKILL.md +64 -23
- package/skills/pitmaster/references/consigne-agent.md +4 -0
- package/skills/relecteur/SKILL.md +18 -6
- package/skills/testwriter/SKILL.md +11 -15
|
@@ -49,8 +49,9 @@
|
|
|
49
49
|
// sudo's env_reset and bwrap's --clearenv give it: the base of a login session, claude's own
|
|
50
50
|
// configuration and credentials (`ANTHROPIC_*`, `CLAUDE_CODE_OAUTH_TOKEN`), the author of its
|
|
51
51
|
// comments at the ticket (`BEADS_ACTOR`, which bd reads), the npm cache it
|
|
52
|
-
// mounts, `npm_config_ignore_scripts=true`, and `TMPDIR`, the session's working
|
|
53
|
-
// `mktemp
|
|
52
|
+
// mounts, `npm_config_ignore_scripts=true`, and `TMPDIR`, `TMP` and `TEMP`, the session's working
|
|
53
|
+
// directory, where `mktemp`, `os.tmpdir()` and Python's `tempfile` write: under a launch, in the
|
|
54
|
+
// temporary directory of the ticket (scripts/enveloppe/lancer.sh), which goes with the ticket. With it npm runs no lifecycle script (`npm install` leaves the
|
|
54
55
|
// `prepare` that writes under the read-only `.git`; the launcher installs outside the session),
|
|
55
56
|
// while `npm test` and `npm run <script>` still run their script, without its `pre` or `post`
|
|
56
57
|
// (npm's `ignore-scripts`, docs/content/using-npm/config.md); no script of the frame has one. bwrap
|
|
@@ -221,7 +222,7 @@ function scratchpadsDe(copie, env = process.env) {
|
|
|
221
222
|
|
|
222
223
|
// The working directory of a session in <copie> under the environment <env> of the launch:
|
|
223
224
|
// `travail` in the copy's scratchpads, which the envelope mounts in writing. The envelope creates
|
|
224
|
-
// it and names it in `TMPDIR`; the launcher names it in the instruction.
|
|
225
|
+
// it and names it in `TMPDIR`, `TMP` and `TEMP`; the launcher names it in the instruction.
|
|
225
226
|
export function dossierDeTravail(copie, env = process.env) {
|
|
226
227
|
return path.join(scratchpadsDe(copie, env), 'travail');
|
|
227
228
|
}
|
|
@@ -230,8 +231,8 @@ export function dossierDeTravail(copie, env = process.env) {
|
|
|
230
231
|
// variables and families that <env> holds, `npm_config_cache` set to the npm cache that the
|
|
231
232
|
// envelope mounts in writing, `npm_config_ignore_scripts` set to `true` (npm runs no lifecycle
|
|
232
233
|
// script: a `prepare` that writes under the read-only `.git` would fail `npm install`; the
|
|
233
|
-
// launcher installs outside the session), `TMPDIR` set to the session's working
|
|
234
|
-
// <travail>, and `GRILLHOUSE_ENVELOPPE` set to the plan <paquets>; with them, each tool of the
|
|
234
|
+
// launcher installs outside the session), `TMPDIR`, `TMP` and `TEMP` set to the session's working
|
|
235
|
+
// directory <travail>, and `GRILLHOUSE_ENVELOPPE` set to the plan <paquets>; with them, each tool of the
|
|
235
236
|
// project <outils> (`grillhouse.outils`), its variable set to its path. Nothing else of <env>
|
|
236
237
|
// enters.
|
|
237
238
|
export function environnementDeLaSeance(env, { cacheNpm, paquets, travail, outils = {} }) {
|
|
@@ -246,6 +247,8 @@ export function environnementDeLaSeance(env, { cacheNpm, paquets, travail, outil
|
|
|
246
247
|
npm_config_cache: cacheNpm,
|
|
247
248
|
npm_config_ignore_scripts: 'true',
|
|
248
249
|
TMPDIR: travail,
|
|
250
|
+
TMP: travail,
|
|
251
|
+
TEMP: travail,
|
|
249
252
|
[VARIABLE]: ecrireLaListe(paquets),
|
|
250
253
|
};
|
|
251
254
|
}
|
|
@@ -39,15 +39,17 @@
|
|
|
39
39
|
# the copy, a conflict with main marked in its file; a branch with nothing ahead simply starts
|
|
40
40
|
# again from main. A ticket whose branch is still in the integration queue is not launched:
|
|
41
41
|
# the refusal goes to the log, which names the queue, CODE_COPIE, before any copy is made.
|
|
42
|
-
#
|
|
42
|
+
# The copy, new or existing, then goes through the one preparation of a copy, which the circuit
|
|
43
|
+
# also plays before each pass that judges the lot (scripts/enveloppe/travail-de-la-copie.mjs
|
|
44
|
+
# `preparer`, its output in the log). Moving forward keeps
|
|
43
45
|
# the work in progress of the copy in the copy, never in git's stash, which every copy of the
|
|
44
46
|
# repository shares: it is set aside as a lot, the copy fast-forwards, and the lot is applied
|
|
45
|
-
# three ways, as the lot of a branch sent back is
|
|
47
|
+
# three ways, as the lot of a branch sent back is.
|
|
46
48
|
# A refusal, such as a branch that has left main or conflicts left unresolved, goes to
|
|
47
49
|
# the log and stops the launch, CODE_COPIE; so does a reapplication that conflicts: the log
|
|
48
50
|
# names the copy and each file in conflict, the conflicts stay marked in the copy's files and
|
|
49
51
|
# unmerged in its index, and no agent starts on a half-merged copy. Its
|
|
50
|
-
# submodules go through
|
|
52
|
+
# submodules go through that preparation (scripts/sous-modules.sh): before moving forward,
|
|
51
53
|
# a submodule carrying local work stops the launch, CODE_COPIE, its log naming it, the work in
|
|
52
54
|
# place; then every submodule is set at the commit of HEAD, before any installation, except one the
|
|
53
55
|
# project shares (`grillhouse.partage`), which the copy reads from the main repository. Its
|
|
@@ -80,7 +82,10 @@
|
|
|
80
82
|
# --publie <plan>`, a command of the module of the copy's language, read in the prepared copy; a reading that fails stops the launch,
|
|
81
83
|
# CODE_COPIE), then the
|
|
82
84
|
# section « Ton dossier de travail », which names the session's working directory, where every
|
|
83
|
-
# temporary file goes (`dossierDeTravail` of enveloppe.mjs, the envelope's TMPDIR
|
|
85
|
+
# temporary file goes (`dossierDeTravail` of enveloppe.mjs, the envelope's TMPDIR, TMP and TEMP,
|
|
86
|
+
# in the temporary directory of the ticket, which the launcher opens once the call is judged and
|
|
87
|
+
# which stays from one session and one resumption to the next, removed when the ticket is
|
|
88
|
+
# closed, scripts/mesure/base-de-passe.mjs), then the
|
|
84
89
|
# section « La construction échoue » when it fails. The prompt
|
|
85
90
|
# carries « TON TICKET : <ticket> », which the role's locks read. The envelope is the sandbox, so
|
|
86
91
|
# the session runs without permission prompts, under the rights and the context of its role
|
|
@@ -184,11 +189,20 @@ if node --input-type=module -e "import { lireEntrees } from '$ici/../integration
|
|
|
184
189
|
echo "$refus" >&2
|
|
185
190
|
exit "$CODE_COPIE"
|
|
186
191
|
fi
|
|
192
|
+
# The temporary directory of the ticket (`ouvrirBaseDuTicket`, scripts/mesure/base-de-passe.mjs):
|
|
193
|
+
# TMPDIR, TMP and TEMP of the rest of the launch and of the session, whose scratchpads and working
|
|
194
|
+
# directory lie in it. It stays from one session and one resumption of the ticket to the next, and
|
|
195
|
+
# goes when the ticket is closed (scripts/copies-finies.mjs).
|
|
196
|
+
temporaire=$(node "$ici/../mesure/base-de-passe.mjs" "$ticket" 2>> "$journal") \
|
|
197
|
+
|| { echo "⛔ Le dossier temporaire du ticket n'a pas pu s'ouvrir : voir $journal." >&2; exit "$CODE_COPIE"; }
|
|
198
|
+
export TMPDIR="$temporaire" TMP="$temporaire" TEMP="$temporaire"
|
|
187
199
|
# The output of the session's build, when it fails, behind its first line, which says what failed
|
|
188
200
|
# and what was built: the module's command `construire` writes it.
|
|
189
201
|
echec=$(mktemp)
|
|
190
202
|
(
|
|
191
203
|
# Each step returns on failure: `set -e` does not act inside a subshell tested by `||`.
|
|
204
|
+
# An existing copy moves forward to main by the preparation (`cible`); a new one is made on it.
|
|
205
|
+
cible=
|
|
192
206
|
if [ ! -d "$copie" ]; then
|
|
193
207
|
tete=$(git -C "$racine" rev-parse HEAD) || exit 1
|
|
194
208
|
branche="agent/$ticket"
|
|
@@ -210,21 +224,16 @@ echec=$(mktemp)
|
|
|
210
224
|
node "$ici/travail-de-la-copie.mjs" reporter "$copie" "$base" "$pointe" || exit 1
|
|
211
225
|
fi
|
|
212
226
|
else
|
|
213
|
-
|
|
214
|
-
# The work in progress moves with the copy, in the copy: a conflict stops the launch, marked
|
|
215
|
-
# in the files, the log naming each one (travail-de-la-copie.mjs).
|
|
216
|
-
node "$ici/travail-de-la-copie.mjs" avancer "$copie" "$(git -C "$racine" rev-parse HEAD)" || exit 1
|
|
227
|
+
cible=$(git -C "$racine" rev-parse HEAD) || exit 1
|
|
217
228
|
fi
|
|
229
|
+
# The one preparation of a copy, which the circuit also plays before each pass that judges the
|
|
230
|
+
# lot (travail-de-la-copie.mjs `preparer`): for an existing copy, the guard of its submodules and
|
|
231
|
+
# its advance to main, its work kept in the copy, a conflict stopping the launch, marked in the
|
|
232
|
+
# files, the log naming each one; then the pose of the submodules, their mount, the installation.
|
|
218
233
|
# The list the pose fixes is the one every mount gets, whatever the installation rewrites.
|
|
219
|
-
partages=$(
|
|
234
|
+
partages=$(node "$ici/travail-de-la-copie.mjs" preparer "$copie" ${cible:+"$cible"}) || exit 1
|
|
220
235
|
monter() { bash "$ici/../sous-modules.sh" monter "$copie" --partages "$partages" "$@"; }
|
|
221
|
-
monter true || exit 1
|
|
222
236
|
if [ -f "$copie/package.json" ]; then
|
|
223
|
-
# --no-save leaves the lock file as committed, so a clean copy stays clean.
|
|
224
|
-
installe="$copie/node_modules/.package-lock.json"
|
|
225
|
-
if [ ! -d "$copie/node_modules" ] || [ "$copie/package-lock.json" -nt "$installe" ]; then
|
|
226
|
-
monter npm --prefix "$copie" install --no-save --no-audit --no-fund --silent || exit 1
|
|
227
|
-
fi
|
|
228
237
|
# The build of the copy for the session's plan, by the module of its language (`construire`),
|
|
229
238
|
# when it describes one: a build that fails writes its first line and its output in $echec,
|
|
230
239
|
# and the session opens with them; any other failure stops the launch.
|
|
@@ -1,17 +1,29 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// The local work of an agent's copy carried onto main,
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
2
|
+
// The local work of an agent's copy carried onto main, and the preparation of that copy, for the
|
|
3
|
+
// launcher (./lancer.sh) and for the circuit before each pass that judges the lot
|
|
4
|
+
// (scripts/circuit.mjs, `avantLaPasse`), in the copy alone: git's stash (refs/stash) is common to
|
|
5
|
+
// every copy of a repository, so the work never goes there; the copy keeps it, as a merge or a
|
|
6
|
+
// rebase in conflict does (its conflicts marked in the files, the unmerged entries in its own
|
|
7
|
+
// index).
|
|
6
8
|
//
|
|
7
9
|
// node scripts/enveloppe/travail-de-la-copie.mjs reporter <copie> <base> <pointe>
|
|
8
|
-
// node scripts/enveloppe/travail-de-la-copie.mjs
|
|
10
|
+
// node scripts/enveloppe/travail-de-la-copie.mjs preparer <copie> [<cible>]
|
|
9
11
|
//
|
|
12
|
+
// - `preparer`: the one preparation of a copy, which the launcher plays before each session and
|
|
13
|
+
// the circuit before each pass that judges the lot. With <cible> (an existing copy), the guard
|
|
14
|
+
// of its submodules (scripts/sous-modules.sh `garde`), then `avancer`; then, for every copy,
|
|
15
|
+
// the pose of its submodules (`pose`, the shared ones linked, the others set at the commit of
|
|
16
|
+
// HEAD), the check that their read-only mount plays (`monter … true`), and, when the copy has a
|
|
17
|
+
// package.json, the installation (`npm install --no-save`, under that mount) when node_modules
|
|
18
|
+
// is missing or the lock file is newer than the installation (`node_modules/.package-lock.json`).
|
|
19
|
+
// It prints on stdout the list its pose fixes, its messages on stderr; exit 1 on the first step
|
|
20
|
+
// that fails, named, its output after (BPScript: the lock file changed 27 times in two weeks,
|
|
21
|
+
// and the submodule vendor/bp3-engine, both stale in a copy moved forward without them).
|
|
10
22
|
// - `reporter`: the lot from <base> to <pointe> (`git diff --binary`), a branch the queue sent
|
|
11
23
|
// back, becomes local work of the copy: applied three ways (`git apply --3way`), a conflict
|
|
12
24
|
// marked in its file, the rest of the lot there; the index is then left as HEAD has it, so that
|
|
13
25
|
// all of it is local work. Exit 0, the conflicts included: the agent's session resolves them.
|
|
14
|
-
// - `avancer
|
|
26
|
+
// - The advance (`avancer`, a step of `preparer`): the copy moves forward to <cible> (the main tree's HEAD) by a fast-forward, its
|
|
15
27
|
// local work kept by the same application: the work as a lot (`git diff --binary HEAD`, the
|
|
16
28
|
// submodules left out, which the launcher sets afterwards; untracked files stay in place), the
|
|
17
29
|
// copy brought back to HEAD, moved forward, the lot applied three ways. The lot waits in the
|
|
@@ -41,7 +53,7 @@
|
|
|
41
53
|
// and open-synth-descriptors, each copy moved by hand). A lot in conflict on another file is not
|
|
42
54
|
// regenerated: its conflicts come first.
|
|
43
55
|
import { spawnSync } from 'node:child_process';
|
|
44
|
-
import { existsSync, rmSync, writeFileSync } from 'node:fs';
|
|
56
|
+
import { existsSync, rmSync, statSync, writeFileSync, writeSync } from 'node:fs';
|
|
45
57
|
import path from 'node:path';
|
|
46
58
|
import { pathToFileURL } from 'node:url';
|
|
47
59
|
import { couvertPar, engendresDe, regenerer, touchesPar } from '../engendres.mjs';
|
|
@@ -250,19 +262,90 @@ export function avancer(copie, cible) {
|
|
|
250
262
|
return r.status === 0 ? { ok: true, message: '' } : { ok: false, message: texte(r) };
|
|
251
263
|
}
|
|
252
264
|
|
|
265
|
+
const SOUS_MODULES = path.join(import.meta.dirname, '..', 'sous-modules.sh');
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Prepares <copie> for a pass or a session (see the header, `preparer`): with <cible>, the guard of
|
|
269
|
+
* its submodules and its advance to <cible>; then the pose of its submodules, the check of their
|
|
270
|
+
* read-only mount, and the installation when the lock file is newer than it. The output of each
|
|
271
|
+
* command goes to the file descriptor <sortie>; returns `{ ok, message, partages }`.
|
|
272
|
+
* @param {string} copie
|
|
273
|
+
* @param {string | null} cible
|
|
274
|
+
* @param {{ env?: NodeJS.ProcessEnv, sortie?: number }} [o]
|
|
275
|
+
*/
|
|
276
|
+
export function preparer(copie, cible, { env = process.env, sortie = 2 } = {}) {
|
|
277
|
+
// A command of the submodules whose error output is read: kept on <sortie> as well when it
|
|
278
|
+
// succeeds, as the launcher's log kept it.
|
|
279
|
+
const bash = (args, stdio) => {
|
|
280
|
+
const r = spawnSync('bash', [SOUS_MODULES, ...args], {
|
|
281
|
+
env,
|
|
282
|
+
stdio,
|
|
283
|
+
maxBuffer: 64 * 1024 * 1024,
|
|
284
|
+
});
|
|
285
|
+
if (r.status === 0 && r.stderr?.length) writeSync(sortie, r.stderr);
|
|
286
|
+
return r;
|
|
287
|
+
};
|
|
288
|
+
const echec = (r, quoi) => ({
|
|
289
|
+
ok: false,
|
|
290
|
+
message: `⛔ ${quoi} de la copie ${copie} échoue (code ${r.status ?? r.signal}).${r.stderr?.length ? `\n${String(r.stderr).trim()}` : ''}`,
|
|
291
|
+
partages: '',
|
|
292
|
+
});
|
|
293
|
+
if (cible !== null) {
|
|
294
|
+
const g = bash(['garde', copie], ['ignore', sortie, 'pipe']);
|
|
295
|
+
if (g.status !== 0) return echec(g, 'La garde des sous-modules');
|
|
296
|
+
const a = avancer(copie, cible);
|
|
297
|
+
if (!a.ok) return { ...a, partages: '' };
|
|
298
|
+
}
|
|
299
|
+
const p = bash(['pose', copie], ['ignore', 'pipe', 'pipe']);
|
|
300
|
+
if (p.status !== 0) return echec(p, 'La pose des sous-modules');
|
|
301
|
+
// As `$(…)` reads it: the final newlines dropped.
|
|
302
|
+
const partages = String(p.stdout).replace(/\n+$/, '');
|
|
303
|
+
const monter = (...commande) =>
|
|
304
|
+
bash(['monter', copie, '--partages', partages, ...commande], ['ignore', sortie, 'pipe']);
|
|
305
|
+
const m = monter('true');
|
|
306
|
+
if (m.status !== 0) return echec(m, 'Le montage des sous-modules partagés');
|
|
307
|
+
if (existsSync(path.join(copie, 'package.json'))) {
|
|
308
|
+
// As `[ lock -nt installed ]`: the lock newer than the installation, or no installation.
|
|
309
|
+
const verrou = path.join(copie, 'package-lock.json');
|
|
310
|
+
const installe = path.join(copie, 'node_modules', '.package-lock.json');
|
|
311
|
+
const plusRecent =
|
|
312
|
+
existsSync(verrou) &&
|
|
313
|
+
(!existsSync(installe) || statSync(verrou).mtimeMs > statSync(installe).mtimeMs);
|
|
314
|
+
if (!existsSync(path.join(copie, 'node_modules')) || plusRecent) {
|
|
315
|
+
// --no-save leaves the lock file as committed, so a clean copy stays clean.
|
|
316
|
+
const i = monter(
|
|
317
|
+
'npm',
|
|
318
|
+
'--prefix',
|
|
319
|
+
copie,
|
|
320
|
+
'install',
|
|
321
|
+
'--no-save',
|
|
322
|
+
'--no-audit',
|
|
323
|
+
'--no-fund',
|
|
324
|
+
'--silent'
|
|
325
|
+
);
|
|
326
|
+
if (i.status !== 0) return echec(i, "L'installation");
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
return { ok: true, message: '', partages };
|
|
330
|
+
}
|
|
331
|
+
|
|
253
332
|
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
|
|
254
333
|
const [geste, copie, ...reste] = process.argv.slice(2);
|
|
255
334
|
const r =
|
|
256
335
|
geste === 'reporter' && reste.length === 2
|
|
257
336
|
? reporter(copie, { base: reste[0], pointe: reste[1] })
|
|
258
|
-
: geste === '
|
|
259
|
-
?
|
|
337
|
+
: geste === 'preparer' && reste.length <= 1
|
|
338
|
+
? preparer(copie, reste[0] ?? null)
|
|
260
339
|
: {
|
|
261
340
|
ok: false,
|
|
262
341
|
message:
|
|
263
|
-
'usage: travail-de-la-copie.mjs reporter <copie> <base> <pointe> |
|
|
342
|
+
'usage: travail-de-la-copie.mjs reporter <copie> <base> <pointe> | preparer <copie> [<cible>]',
|
|
264
343
|
};
|
|
265
|
-
|
|
344
|
+
// `preparer` prints the list its pose fixes on stdout, its messages on stderr.
|
|
345
|
+
if (geste === 'preparer') {
|
|
346
|
+
if (r.message) process.stderr.write(`${r.message}\n`);
|
|
347
|
+
process.stdout.write(r.partages ?? '');
|
|
348
|
+
} else if (r.message) {
|
|
266
349
|
process.stdout.write(`${r.message}\n`);
|
|
267
350
|
}
|
|
268
351
|
process.exitCode = r.ok ? 0 : 1;
|
package/scripts/etapes.mjs
CHANGED
|
@@ -252,7 +252,7 @@ const REPONSES =
|
|
|
252
252
|
export const MONTEES = Object.fromEntries(
|
|
253
253
|
Object.entries({
|
|
254
254
|
lancement:
|
|
255
|
-
'Le lanceur s’arrête avant la séance : la machine se répare-t-elle, pour reprendre ?',
|
|
255
|
+
'Le lanceur s’arrête avant la séance, ou la copie n’avance pas sur la pointe de main avant une passe : la machine ou la copie se répare-t-elle, pour reprendre ?',
|
|
256
256
|
bloqué:
|
|
257
257
|
'La séance n’a plus bougé, et le circuit l’a arrêtée : reprendre l’étape, ou arrêter le circuit ?',
|
|
258
258
|
'sans-fiche':
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
1
|
// The frame's merge driver of the CHANGELOG, on the model of gnulib's git-merge-changelog: two
|
|
3
2
|
// lots that each add an entry under the same heading both keep their entry, wherever git merges
|
|
4
3
|
// three ways (the integration's `git apply --3way --index`, the relaunch's `git apply --3way`, the
|
|
@@ -85,9 +85,11 @@
|
|
|
85
85
|
// previous version added stays, and `devDependencies` are written sorted by name. The report
|
|
86
86
|
// names each tool added and `npm install`, which installs them. A project without
|
|
87
87
|
// `packageManager` receives the template's.
|
|
88
|
-
// - What the
|
|
89
|
-
//
|
|
90
|
-
//
|
|
88
|
+
// - What the frame writes in a project (IGNORES_DU_CADRE: the copies of the tickets,
|
|
89
|
+
// `.claude/worktrees`) and what the tools of the declared language write there (`ignorer` of its
|
|
90
|
+
// module: typescript's `.turbo`, cargo's `target`): a `.gitignore` that does not ignore one
|
|
91
|
+
// receives its line, `<nom>/`. The template's `.gitignore` lists none of them: the update is
|
|
92
|
+
// their one source, for a project `init` creates as for an existing one.
|
|
91
93
|
// - The binaries of the declared language (`binaires` of its module: cargo's nextest and
|
|
92
94
|
// cargo-deny), after the files: the command line runs the commands of its module
|
|
93
95
|
// (`miseAJour.installation`), which list what is installed and install each one missing or at
|
|
@@ -181,14 +183,21 @@ const lireJson = (f, defaut) => {
|
|
|
181
183
|
}
|
|
182
184
|
};
|
|
183
185
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
186
|
+
/**
|
|
187
|
+
* The directories the frame itself writes in a project, which its `.gitignore` ignores: the
|
|
188
|
+
* copies of the tickets. The template's `.gitignore` lists none of them, nor what the tools of its
|
|
189
|
+
* language write: the update lays both, in a new project as in an existing one.
|
|
190
|
+
*/
|
|
191
|
+
export const IGNORES_DU_CADRE = ['.claude/worktrees'];
|
|
192
|
+
|
|
193
|
+
// Adds to the `.gitignore` of the project at <projet> each directory the frame writes
|
|
194
|
+
// (IGNORES_DU_CADRE) and each its language's tools write (`ignorer` of its module), as `<nom>/`,
|
|
195
|
+
// when no line ignores it (`<nom>`, `<nom>/`, `/<nom>`, `/<nom>/`); its own lines stay.
|
|
187
196
|
function ignorer(projet) {
|
|
188
197
|
const f = path.join(projet, '.gitignore');
|
|
189
198
|
let texte = existsSync(f) ? readFileSync(f, 'utf8') : '';
|
|
190
199
|
const avant = texte;
|
|
191
|
-
for (const nom of langageDe(projet).ignorer) {
|
|
200
|
+
for (const nom of [...IGNORES_DU_CADRE, ...langageDe(projet).ignorer]) {
|
|
192
201
|
const lignes = texte.split('\n').map(l => l.trim());
|
|
193
202
|
if ([nom, `${nom}/`, `/${nom}`, `/${nom}/`].some(l => lignes.includes(l))) {
|
|
194
203
|
continue;
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
// the relaunch of its ticket (scripts/enveloppe/lancer.sh);
|
|
40
40
|
// - a branch whose replay cannot be done (the copy does not get ready, main does not take the
|
|
41
41
|
// branch, the main tree holds a file of the lot), or whose `npm run verifier` is « à repasser »
|
|
42
|
-
// once replaced (75:
|
|
43
|
-
// scripts/
|
|
42
|
+
// once replaced (75: the wait for the lock of the machine reached its bound,
|
|
43
|
+
// scripts/verrou-de-machine.mjs; neither green nor red), stays in the queue, the reason written to its
|
|
44
44
|
// ticket, which is neither reopened nor closed, and the queue goes on; the next queue takes it
|
|
45
45
|
// again. Any other code than 0 and 75 is red.
|
|
46
46
|
// At its entry on main, the branch's ticket closes « intégré : <commit> », loses `en-file`, the
|
|
@@ -541,7 +541,7 @@ function main(argv) {
|
|
|
541
541
|
const t = tester();
|
|
542
542
|
if (t.status === A_REPASSER) {
|
|
543
543
|
return {
|
|
544
|
-
garde: `son \`npm run verifier\` est à repasser (code ${A_REPASSER}) une fois replacée :
|
|
544
|
+
garde: `son \`npm run verifier\` est à repasser (code ${A_REPASSER}) une fois replacée : l'attente de la machine a atteint sa borne. Ni vert ni rouge ; la prochaine file la rejoue.`,
|
|
545
545
|
};
|
|
546
546
|
}
|
|
547
547
|
if (t.status !== 0) {
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
// main tree when its inputs are unchanged). Green is required: main stays green, and nothing is compared with a base. A test
|
|
45
45
|
// known red is put in quarantine in the test itself (`it.skip` or `it.fails`, with its
|
|
46
46
|
// ticket), as a mature continuous integration does; the integration admits none. A
|
|
47
|
-
// `npm run verifier` « à repasser » (75:
|
|
48
|
-
//
|
|
47
|
+
// `npm run verifier` « à repasser » (75: the wait for the lock of the machine reached its
|
|
48
|
+
// bound, scripts/verrou-de-machine.mjs) is neither green nor red: the run stops there, exit 75,
|
|
49
49
|
// nothing committed and nothing refused, the lot where it was, for the same command again;
|
|
50
50
|
// any other code than 0 refuses;
|
|
51
51
|
// 7. the commit in the copy, its hooks included, under GRILLHOUSE_INTEGRATION=1: a pre-commit
|
|
@@ -406,7 +406,7 @@ function main(argv) {
|
|
|
406
406
|
const verdict = tester().status;
|
|
407
407
|
if (verdict === A_REPASSER) {
|
|
408
408
|
dire(
|
|
409
|
-
`⏱ À repasser (code ${A_REPASSER}) :
|
|
409
|
+
`⏱ À repasser (code ${A_REPASSER}) : l'attente de la machine a atteint sa borne. Le lot n'est ni commis ni refusé ; relance la même commande.`
|
|
410
410
|
);
|
|
411
411
|
return A_REPASSER;
|
|
412
412
|
}
|
package/scripts/jointure.d.ts
CHANGED
|
@@ -240,6 +240,27 @@ export interface Composition {
|
|
|
240
240
|
): { tester: Commande; verifier: Commande; typer: Commande } & Record<string, Commande>;
|
|
241
241
|
verdict(dossier: string): { rapports: RapportDeTest[]; taches: TacheJouee[] };
|
|
242
242
|
estUnTest(chemin: string, racine: string): ClasseDeTest;
|
|
243
|
+
/** The sibling of HEAD's version of the test file `chemin` (from `racine`), from the root: a
|
|
244
|
+
* file beside it, a test the module's tool plays in the same run as it, its tests named in the
|
|
245
|
+
* run's report as the file's, of its class (day, night, bench), which the proof of the red
|
|
246
|
+
* writes, plays and removes; null for a file the tool cannot play twice in a run (cargo: a
|
|
247
|
+
* target `tests/<dossier>/main.rs`, a unit test of `src/`: `testsDeHead`) or does not play. */
|
|
248
|
+
soeurDAvant(chemin: string, racine: string): string | null;
|
|
249
|
+
/** The names of the tests of HEAD's version of the test file `chemin` (from `racine`), as the
|
|
250
|
+
* verdict names them, read without playing them, for a file that has no sibling because the
|
|
251
|
+
* tool cannot play two versions of it in one run (cargo: a unit test of `src/`, a target
|
|
252
|
+
* `tests/<dossier>/main.rs`, its out-of-line modules read too); the proof of the red holds each
|
|
253
|
+
* for a green HEAD already holds. `lire` gives HEAD's text of a file from the root, null for
|
|
254
|
+
* none. With `sansSoeur`, the names of a file whose sibling the proof does not play, because
|
|
255
|
+
* it breaks the build of its package while the lot alone builds (cargo: a target
|
|
256
|
+
* `tests/<nom>.rs` whose HEAD's version no longer compiles against the lot's `tests/common`,
|
|
257
|
+
* grillhouse-3e2.2). Null for any other file, or one HEAD does not hold. */
|
|
258
|
+
testsDeHead(
|
|
259
|
+
chemin: string,
|
|
260
|
+
racine: string,
|
|
261
|
+
lire: (fichier: string) => string | null,
|
|
262
|
+
options?: { sansSoeur?: boolean }
|
|
263
|
+
): string[] | null;
|
|
243
264
|
manifestes: Manifestes;
|
|
244
265
|
fichiersEngendres(racine: string): FichierEngendre[];
|
|
245
266
|
gardes(racine: string): string[][];
|
|
@@ -262,17 +283,22 @@ export interface Langage extends Composition {
|
|
|
262
283
|
* and its text (its manifest, the configuration of its tests and of its typing, a file of code,
|
|
263
284
|
* its folder of tests), which the core writes where absent; `espace`, the manifest of the
|
|
264
285
|
* workspace with the package's entry, from the root and its new text, null when it holds it
|
|
265
|
-
* already; `verrouiller`, the
|
|
266
|
-
* the versions in line with the new package
|
|
267
|
-
*
|
|
268
|
-
*
|
|
286
|
+
* already; `verrouiller`, the commands, each run in its `dossier` (from the root) in their order,
|
|
287
|
+
* that bring the lock of the versions in line with the new package, as `uv add -r` takes the
|
|
288
|
+
* dependencies a file declares. `modele`: the package.json of the module's template
|
|
289
|
+
* (`miseAJour.gabarit`), the versions of its tools; `existants`: the files the folder already
|
|
290
|
+
* holds, from it, its docs/, its hidden entries and the directories the sources of the project
|
|
291
|
+
* leave out (`hors` of scripts/sources.mjs: node_modules, dist, each `ignorer`) left out, which the
|
|
292
|
+
* skeleton takes as they are (as `cargo init` takes the code in place). Throws, named, for a
|
|
293
|
+
* path where the module holds no package, and for a folder whose files it cannot take, what is
|
|
294
|
+
* missing named. */
|
|
269
295
|
squelette(
|
|
270
296
|
racine: string,
|
|
271
|
-
o: { chemin: string; modele: Record<string, unknown
|
|
297
|
+
o: { chemin: string; modele: Record<string, unknown>; existants: string[] }
|
|
272
298
|
): {
|
|
273
299
|
fichiers: Record<string, string>;
|
|
274
300
|
espace: { fichier: string; texte: string } | null;
|
|
275
|
-
verrouiller: { commande: string; args: string[]; dossier: string };
|
|
301
|
+
verrouiller: { commande: string; args: string[]; dossier: string }[];
|
|
276
302
|
};
|
|
277
303
|
}
|
|
278
304
|
|
|
@@ -314,15 +340,23 @@ export function ouvrirAvancement(o: {
|
|
|
314
340
|
export function inscrireLePlan(dossier: string, o: { racine: string; taches: unknown[] }): void;
|
|
315
341
|
/** Keeps the total of a pass that ended, for the next one's measure. */
|
|
316
342
|
export function garderLeTotal(dossier: string, racine: string): void;
|
|
317
|
-
/**
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
depot: string;
|
|
321
|
-
commande: string;
|
|
322
|
-
dossier: string;
|
|
323
|
-
}): void;
|
|
343
|
+
/** Names the progress directory of the measure that holds the lock of the machine under `env`,
|
|
344
|
+
* beside the lock (scripts/verrou-de-machine.mjs); the function that takes it out. */
|
|
345
|
+
export function nommerLAvancement(o: { env?: NodeJS.ProcessEnv; dossier: string }): () => void;
|
|
324
346
|
/** Opens the base of a pass of the kind `genre` (scripts/mesure/base-de-passe.mjs). */
|
|
325
347
|
export function ouvrirBase(genre: string, o?: { dans?: string }): unknown;
|
|
348
|
+
/** Whether `chemin` lies in a temporary directory under `env` (scripts/mesure/base-de-passe.mjs). */
|
|
349
|
+
export function dansLeTemporaire(chemin: string, env?: NodeJS.ProcessEnv): boolean;
|
|
350
|
+
/** The cache of compilation of `outil`, under `~/.cache/grillhouse/`, never in the temporary
|
|
351
|
+
* directory. */
|
|
352
|
+
export function cacheDeCompilation(outil: string, env?: NodeJS.ProcessEnv): string;
|
|
353
|
+
/** The cache of `outil` for the build rooted at `racine`, swept once `racine` is gone. */
|
|
354
|
+
export function cacheDeLaRacine(
|
|
355
|
+
outil: string,
|
|
356
|
+
racine: string,
|
|
357
|
+
env?: NodeJS.ProcessEnv,
|
|
358
|
+
o?: { creer?: boolean }
|
|
359
|
+
): string;
|
|
326
360
|
/** The line of the guard of a pass of tests, what its tests left in their temporary directory
|
|
327
361
|
* named; null when they left nothing. */
|
|
328
362
|
export function ligneDesRestes(restes: string[]): string | null;
|
|
@@ -333,14 +367,10 @@ export function retirerALInterruption(retirer: () => void): () => void;
|
|
|
333
367
|
export const SEUIL_PRESSION: number;
|
|
334
368
|
/** The exit code of a pass « à repasser ». */
|
|
335
369
|
export const A_REPASSER: number;
|
|
336
|
-
/** The longest wait for the rest of the machine, in milliseconds. */
|
|
337
|
-
export const BORNE_ATTENTE_MS: number;
|
|
338
370
|
/** The pressure of the processor, in percent, or null when it cannot be read. */
|
|
339
371
|
export function lirePression(fichier?: string): number | null;
|
|
340
372
|
/** The pressure `p` as a line says it. */
|
|
341
373
|
export function ecrirePression(p: number | null): string;
|
|
342
|
-
/** Waits for the rest of the machine, within its bound. */
|
|
343
|
-
export function attendreLeRepos(o?: Record<string, unknown>): unknown;
|
|
344
374
|
/** The variable naming the files changed since the last green (scripts/dernier-vert.mjs). */
|
|
345
375
|
export const CHANGEMENTS: string;
|
|
346
376
|
/** The variable naming the commit of the last green a run measures itself from. */
|
|
@@ -354,9 +384,15 @@ export function mesure(racine: string, o?: { tout?: boolean; dans?: string }): u
|
|
|
354
384
|
export class AttenteDeLaMachine extends Error {}
|
|
355
385
|
/** Runs `faire` under the lock of the machine. */
|
|
356
386
|
export function avecLaMachine(...args: unknown[]): unknown;
|
|
387
|
+
/** Waits for room in the temporary directory, as a heavy pass does before it plays. */
|
|
388
|
+
export function attendreDeLaPlace(o?: Record<string, unknown>): void;
|
|
357
389
|
/** The source files of the project at `racine` under `dossier`, as paths from `racine`, what the
|
|
358
390
|
* tools of its language write left out (scripts/sources.mjs). */
|
|
359
391
|
export function sources(racine: string, dossier?: string): string[];
|
|
392
|
+
/** What `lire` returns, read once under `cle` while the core holds a scope of readings done once
|
|
393
|
+
* (a sweep that asks many questions of a tree that does not move), at each call otherwise
|
|
394
|
+
* (scripts/lecture-unique.mjs). */
|
|
395
|
+
export function luUneFois<T>(cle: string, lire: () => T): T;
|
|
360
396
|
/** True when the text of a ticket's comment is an arbitrage (scripts/arbitrages.mjs). */
|
|
361
397
|
export function estArbitrage(text: string | null | undefined): boolean;
|
|
362
398
|
/** True when the arbitrage `a` of `comments` is settled. */
|