@roomi-fields/grillhouse 0.50.0 → 0.50.2
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 +16 -0
- package/docs/ARCHITECTURE.md +9 -3
- package/docs/architecture/circuit.md +1 -0
- package/docs/architecture/entree.md +1 -1
- package/docs/architecture/machine.md +1 -1
- package/hooks/crochet.mjs +3 -1
- package/package.json +1 -1
- package/scripts/activites.mjs +18 -8
- package/scripts/attente-a-l-arret.mjs +7 -8
- package/scripts/attente-au-tour.mjs +2 -2
- package/scripts/bilan.mjs +39 -61
- package/scripts/cadre.mjs +25 -6
- package/scripts/circuit.mjs +28 -4
- package/scripts/commande-du-plan.mjs +15 -0
- package/scripts/crochet.mjs +1 -0
- package/scripts/dette.mjs +84 -7
- package/scripts/direct.mjs +64 -5
- package/scripts/droits.mjs +13 -7
- package/scripts/engendres.mjs +32 -0
- package/scripts/enveloppe/travail-de-la-copie.mjs +6 -1
- package/scripts/etapes.mjs +8 -0
- package/scripts/integration/file.mjs +25 -24
- package/scripts/integration/integrer.mjs +31 -30
- package/scripts/integration/rejeu.mjs +4 -4
- package/scripts/langages/cargo/sccache.mjs +42 -6
- package/scripts/langages/typescript/titres-de-tests.mjs +27 -10
- package/scripts/ligne-etat/defaut.sh +2 -1
- package/scripts/ligne-etat/ligne-etat.mjs +1 -0
- package/scripts/messages-non-lus.mjs +2 -4
- package/scripts/newday.mjs +2 -2
- package/scripts/registre.mjs +14 -16
- package/scripts/reponses-du-circuit.mjs +5 -0
- package/scripts/resultats.mjs +11 -2
- package/scripts/session-start.sh +33 -46
- package/scripts/sigle-du-projet.mjs +1 -2
- package/scripts/structure-guard.sh +2 -1
- package/scripts/suiveur.mjs +1 -1
- package/scripts/superviseur.mjs +36 -55
- package/scripts/tableau.mjs +78 -121
- package/skills/explorateur/SKILL.md +5 -1
- package/types/index.d.ts +3 -0
|
@@ -40,9 +40,12 @@
|
|
|
40
40
|
// (`demarrerLeServeur`): sccache 0.19.0 starts its server by binding a socket of a path under
|
|
41
41
|
// TMPDIR (`<TMPDIR>/sccacheXXXXXX/sock`, src/commands.rs, `run_server_process`), which fails
|
|
42
42
|
// past the 108 bytes of a socket's path (« path must be shorter than SUN_LEN »), and the
|
|
43
|
-
// temporary directory of a pass of tests under the working directory of a session passes them
|
|
44
|
-
// Cargo then finds the server running and starts none; it
|
|
45
|
-
// keeps its own temporary directory, the pass's.
|
|
43
|
+
// temporary directory of a pass of tests under the working directory of a session passes them
|
|
44
|
+
// (grillhouse-qmk, OSC Bridge OB-p58). Cargo then finds the server running and starts none; it
|
|
45
|
+
// keeps its own temporary directory, the pass's. Its wrapper still runs the client under `/tmp`
|
|
46
|
+
// (`lanceurCourt`): a client that must start the server itself, which cargo's long TMPDIR
|
|
47
|
+
// would break, binds its socket there (grillhouse-3uv.239, OSD-sf1.25.1). The two ends of the
|
|
48
|
+
// start are so short whoever begins it, rather than one more rescue of the first.
|
|
46
49
|
// - A wrapper the project sets already is its own: the run keeps it, without sccache. It is read
|
|
47
50
|
// as cargo reads it: the environment (`RUSTC_WRAPPER`, `CARGO_BUILD_RUSTC_WRAPPER`), then
|
|
48
51
|
// `build.rustc-wrapper` of each `.cargo/config.toml` (or `.cargo/config`) from the project up to
|
|
@@ -57,7 +60,15 @@
|
|
|
57
60
|
// installation.md §4.2 nor of the post's files of §4.3.
|
|
58
61
|
import { spawnSync } from 'node:child_process';
|
|
59
62
|
import { createHash } from 'node:crypto';
|
|
60
|
-
import {
|
|
63
|
+
import {
|
|
64
|
+
mkdirSync,
|
|
65
|
+
readFileSync,
|
|
66
|
+
readlinkSync,
|
|
67
|
+
realpathSync,
|
|
68
|
+
renameSync,
|
|
69
|
+
statSync,
|
|
70
|
+
writeFileSync,
|
|
71
|
+
} from 'node:fs';
|
|
61
72
|
import { createRequire } from 'node:module';
|
|
62
73
|
import { homedir, tmpdir } from 'node:os';
|
|
63
74
|
import path from 'node:path';
|
|
@@ -118,6 +129,30 @@ function lanceurDuProjet(racine, env) {
|
|
|
118
129
|
return null;
|
|
119
130
|
}
|
|
120
131
|
|
|
132
|
+
const LANCEUR = '#!/bin/sh\nTMPDIR=/tmp exec sccache "$@"\n';
|
|
133
|
+
|
|
134
|
+
// The wrapper of rustc of the run: a script of the cache directory <cache> that runs sccache under
|
|
135
|
+
// the machine's `COURT` temporary directory. Cargo hands its wrapper its own TMPDIR, which a
|
|
136
|
+
// client that has to start the server (a server stopped by its idle time, killed, or born in
|
|
137
|
+
// another envelope) binds a socket under, refused past 108 bytes of a path (« path must be
|
|
138
|
+
// shorter than SUN_LEN », OSD-sf1.25.1); the compilations keep cargo's TMPDIR. Written once, then
|
|
139
|
+
// read: a file cannot carry an executable bit in a package, so the script is made here.
|
|
140
|
+
function lanceurCourt(cache) {
|
|
141
|
+
const fichier = path.join(cache, 'sccache-court');
|
|
142
|
+
try {
|
|
143
|
+
if (readFileSync(fichier, 'utf8') === LANCEUR && (statSync(fichier).mode & 0o111) !== 0) {
|
|
144
|
+
return fichier;
|
|
145
|
+
}
|
|
146
|
+
} catch {
|
|
147
|
+
// Absent: written below.
|
|
148
|
+
}
|
|
149
|
+
mkdirSync(cache, { recursive: true });
|
|
150
|
+
const temporaire = `${fichier}.${process.pid}`;
|
|
151
|
+
writeFileSync(temporaire, LANCEUR, { mode: 0o755 });
|
|
152
|
+
renameSync(temporaire, fichier);
|
|
153
|
+
return fichier;
|
|
154
|
+
}
|
|
155
|
+
|
|
121
156
|
/** The namespace of processes this process runs in, `pid:[<inode>]`. */
|
|
122
157
|
export const espaceDesProcessus = () => readlinkSync('/proc/self/ns/pid');
|
|
123
158
|
|
|
@@ -262,11 +297,12 @@ export function avecSccache(racine, env) {
|
|
|
262
297
|
if (lanceurDuProjet(racine, env)) {
|
|
263
298
|
return { ...env, ...cible };
|
|
264
299
|
}
|
|
300
|
+
const cache = cacheDeCompilation('sccache', env);
|
|
265
301
|
return {
|
|
266
302
|
...env,
|
|
267
303
|
...cible,
|
|
268
|
-
RUSTC_WRAPPER:
|
|
269
|
-
SCCACHE_DIR:
|
|
304
|
+
RUSTC_WRAPPER: lanceurCourt(cache),
|
|
305
|
+
SCCACHE_DIR: cache,
|
|
270
306
|
SCCACHE_SERVER_UDS: socketDuServeur(racine, env.TMPDIR || tmpdir()),
|
|
271
307
|
};
|
|
272
308
|
}
|
|
@@ -29,8 +29,8 @@ import { spawnSync } from 'node:child_process';
|
|
|
29
29
|
import { readFileSync, writeFileSync } from 'node:fs';
|
|
30
30
|
import path from 'node:path';
|
|
31
31
|
import { pathToFileURL } from 'node:url';
|
|
32
|
-
import { FICHIER, lire as lireDette, mesureDuPlan, trancher } from '../../dette.mjs';
|
|
33
|
-
import { A_ELAGUER, ecrireSarif } from '../../resultats.mjs';
|
|
32
|
+
import { deplacer, FICHIER, lire as lireDette, mesureDuPlan, trancher } from '../../dette.mjs';
|
|
33
|
+
import { A_DEPLACER, A_ELAGUER, ecrireSarif } from '../../resultats.mjs';
|
|
34
34
|
import { prefixe } from '../../services-du-noyau.mjs';
|
|
35
35
|
import { testsDuDepot } from './tailles-des-tests.mjs';
|
|
36
36
|
import { TEST } from './vitest-config/lances.mjs';
|
|
@@ -251,6 +251,19 @@ export function jugerLesTitres(dette, constats, renommes = {}, mesure = () => tr
|
|
|
251
251
|
message: `${fichier} : aucun titre ne nomme plus un ticket ou un « critère N », pour ${permis(fichier)} inscrit(s) dans ${FICHIER} : la dette s'abaisse (npm run grillhouse:dette:elaguer), jamais à la main. ${MESSAGE_FIN}`,
|
|
252
252
|
});
|
|
253
253
|
}
|
|
254
|
+
// A debt that stands under the former path of a moved file is red: the commit drops the rename,
|
|
255
|
+
// and the key stays under a path that no longer exists. The regeneration carries it (`a-deplacer`).
|
|
256
|
+
for (const [fichier, ancien] of Object.entries(renommes)) {
|
|
257
|
+
if (permis(ancien) > 0) {
|
|
258
|
+
refus.push({
|
|
259
|
+
fichier,
|
|
260
|
+
regle: REGLE,
|
|
261
|
+
aDeplacer: true,
|
|
262
|
+
trouve: comptes.get(fichier) ?? 0,
|
|
263
|
+
message: `${fichier} : ${permis(ancien)} titre(s) inscrit(s) dans ${FICHIER} sous l'ancien chemin ${ancien} : la dette se déplace (npm run grillhouse:dette:elaguer), jamais à la main.`,
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
}
|
|
254
267
|
return refus.sort((a, b) => (a.fichier < b.fichier ? -1 : a.fichier > b.fichier ? 1 : 0));
|
|
255
268
|
}
|
|
256
269
|
|
|
@@ -272,14 +285,8 @@ function main() {
|
|
|
272
285
|
// A write of the debt (`inscrire`, `elaguer`): a file moved takes the debt of its former name
|
|
273
286
|
// first, so that the write keeps it.
|
|
274
287
|
const dette = lireDette(racine);
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
for (const [nouveau, ancien] of Object.entries(renommes)) {
|
|
278
|
-
if (section[ancien] && !section[nouveau]) {
|
|
279
|
-
section[nouveau] = section[ancien];
|
|
280
|
-
}
|
|
281
|
-
delete section[ancien];
|
|
282
|
-
}
|
|
288
|
+
if (dette[GARDE]) {
|
|
289
|
+
deplacer({ [GARDE]: dette[GARDE] }, renommes);
|
|
283
290
|
writeFileSync(path.join(racine, FICHIER), `${JSON.stringify(dette, null, 2)}\n`);
|
|
284
291
|
}
|
|
285
292
|
const r = trancher(racine, GARDE, constats);
|
|
@@ -304,6 +311,16 @@ function main() {
|
|
|
304
311
|
trouve: r.trouve,
|
|
305
312
|
message: `${r.trouve} constat(s) pour une dette plus haute : la dette s'abaisse.`,
|
|
306
313
|
})),
|
|
314
|
+
...refus
|
|
315
|
+
.filter(r => r.aDeplacer)
|
|
316
|
+
.map(r => ({
|
|
317
|
+
fichier: r.fichier,
|
|
318
|
+
regle: r.regle,
|
|
319
|
+
niveau: 'note',
|
|
320
|
+
genre: A_DEPLACER,
|
|
321
|
+
trouve: r.trouve,
|
|
322
|
+
message: `la dette de l'ancien chemin se déplace sous ${r.fichier}.`,
|
|
323
|
+
})),
|
|
307
324
|
],
|
|
308
325
|
});
|
|
309
326
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
# The default left part of the Grillhouse status line, for a person without a status line command
|
|
3
3
|
# of their own: the model, the context used, the OpenRouter credit (cache 30 s) or the Anthropic
|
|
4
|
-
# rate limits over 5 h and 7 days. Reads Claude Code's status line input on stdin.
|
|
4
|
+
# rate limits over 5 h and 7 days. Reads Claude Code's status line input on stdin. Played by
|
|
5
|
+
# scripts/ligne-etat/ligne-etat.mjs (greffon.md, §3.1).
|
|
5
6
|
|
|
6
7
|
input=$(cat)
|
|
7
8
|
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
// - The right part: `grillhouse-etat.txt` in the project's common git directory, which each
|
|
10
10
|
// measure of the follower writes (`scripts/suiveur.mjs`), dim, aligned on the terminal's width
|
|
11
11
|
// (COLUMNS), on the first line; nothing when that measure is older than 10 minutes.
|
|
12
|
+
// Mechanism: greffon.md, §3.1 (the status line) and §4.3 (the status text).
|
|
12
13
|
import { execFileSync } from 'node:child_process';
|
|
13
14
|
import { readFileSync } from 'node:fs';
|
|
14
15
|
import os from 'node:os';
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
// The stop of an agent of a team with an unread message: the hooks SubagentStop and TeammateIdle
|
|
2
|
-
// of the frame's plugin run it (`grillhouse messages-non-lus`), as a consumer of a queue
|
|
3
|
-
//
|
|
4
|
-
// box of an agent while the agent writes its last answer is otherwise read by no one: the agent
|
|
5
|
-
// ends its turn and waits, and the instruction waits with it.
|
|
2
|
+
// of the frame's plugin run it (`grillhouse messages-non-lus`), as a consumer of a queue does not
|
|
3
|
+
// stop with messages it has not acknowledged. Mechanism: greffon.md, §3.2.
|
|
6
4
|
//
|
|
7
5
|
// - The box of an agent is `~/.claude/teams/<équipe>/inboxes/<nom>.json`, an array of entries
|
|
8
6
|
// `{ from, text, summary, timestamp, msg_id, read }`, which Claude Code writes and marks read
|
package/scripts/newday.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// `grillhouse newday`: sets the day's marker of the project to now (scripts/tableau.mjs,
|
|
2
2
|
// `poserLeRepere`). FAITS AUJOURD'HUI and the board's « rejetés » and « validés » cases then count
|
|
3
|
-
// only since it, while « new » and « →check » stay
|
|
4
|
-
//
|
|
3
|
+
// only since it, while « new » and « →check » stay. The mod's command /grillhouse:newday runs it
|
|
4
|
+
// (greffon.md, §4.1, the day's marker).
|
|
5
5
|
import { pathToFileURL } from 'node:url';
|
|
6
6
|
import { poserLeRepere } from './tableau.mjs';
|
|
7
7
|
|
package/scripts/registre.mjs
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// The register of finished agents: one JSON line per agent that ends, written by a hook of the
|
|
3
3
|
// frame's plugin (`grillhouse registre`: SubagentStop for a sub-agent, SessionEnd for a session, a
|
|
4
|
-
// role agent launched in a shell included).
|
|
5
|
-
//
|
|
6
|
-
// (scripts/circuit.mjs) writes a line at the end of each step it leads itself
|
|
4
|
+
// role agent launched in a shell included). Mechanism: greffon.md, §5.5.
|
|
5
|
+
// An agent resumed by a message has one line per stop; the board reads an agent's latest line. The
|
|
6
|
+
// circuit of a ticket (scripts/circuit.mjs) writes a line at the end of each step it leads itself
|
|
7
7
|
// (`ligneDEtape`: its role `circuit`, its step, one turn, no tokens). The workflow of the nights
|
|
8
8
|
// (src/temporal/nuits/) writes a line for each night it skips (`ligneDeNuit`: its role `nuit`, no
|
|
9
|
-
// ticket, no turn, the reason, the top and the reference compared), which the board counts
|
|
10
|
-
// the projects the register names are those whose night it plays.
|
|
9
|
+
// ticket, no turn, the reason, the top and the reference compared), which the board counts
|
|
10
|
+
// nowhere; the projects the register names are those whose night it plays.
|
|
11
11
|
//
|
|
12
12
|
// - The line: the project (the main tree of the directory the session opened in, which the hook
|
|
13
13
|
// reads in CLAUDE_PROJECT_DIR, else in its input's `cwd`), the agent, its ticket (« TON TICKET : »),
|
|
14
|
-
// its role,
|
|
15
|
-
//
|
|
16
|
-
//
|
|
17
|
-
// the agent's transcript; the agent declares nothing.
|
|
14
|
+
// its role, its start and end, its working time and the turns it sums (start and end in
|
|
15
|
+
// milliseconds, the waits for a message left out), its tokens, its cache reads and its cost. All
|
|
16
|
+
// of it is read from the agent's transcript; the agent declares nothing.
|
|
18
17
|
// - The cost is the total the session writes, as ccusage keeps it; without one, or with a total of
|
|
19
18
|
// 0 for tokens spent (a sub-agent's transcript holds none), it is the usage of each model at its
|
|
20
19
|
// tariff (`TARIFS`), as Claude Code reckons it. A model without a tariff that spent tokens leaves
|
|
@@ -22,20 +21,19 @@
|
|
|
22
21
|
// - The register is `~/.claude/grillhouse/registre.jsonl` (GRILLHOUSE_REGISTRE replaces it): the
|
|
23
22
|
// envelope of a role agent leaves it writable.
|
|
24
23
|
// - A hook never stops the session, and never waits for a transcript: it hands the fields of its
|
|
25
|
-
// input that the line reads to a detached process (`--ecrire`) and ends at once,
|
|
26
|
-
//
|
|
27
|
-
//
|
|
24
|
+
// input that the line reads to a detached process (`--ecrire`) and ends at once, within Claude
|
|
25
|
+
// Code's hook time limit. The detached process reads the transcript in chunks (`lireFichier` in
|
|
26
|
+
// tableau.mjs), never whole; a transcript it cannot read writes nothing.
|
|
28
27
|
// - One stop has one line: the write holds the register's lock (`prendreVerrou`, judged by the
|
|
29
28
|
// lock's age, since a role agent's envelope and the outside do not share process numbers),
|
|
30
29
|
// and skips a line whose agent and end the register already holds. The hook and
|
|
31
30
|
// `--rattraper` write the same way.
|
|
32
31
|
// - `npx grillhouse registre --copie <copie>` writes the lines of the sessions of an agent's copy
|
|
33
32
|
// the register does not hold yet, whatever their age: the launcher (scripts/enveloppe/lancer.sh)
|
|
34
|
-
// runs it once the envelope has ended, outside it
|
|
35
|
-
// end hook alone.
|
|
33
|
+
// runs it once the envelope has ended, outside it.
|
|
36
34
|
// - `npx grillhouse registre --rattraper` writes the lines of the project's finished agents the
|
|
37
|
-
// register does not hold yet
|
|
38
|
-
//
|
|
35
|
+
// register does not hold yet, read from their transcripts (the project's sessions and their
|
|
36
|
+
// sub-agents, the agents' copies). A transcript
|
|
39
37
|
// that the board shows running (`tourne` in tableau.mjs: moved in the last 2 minutes, or, for a
|
|
40
38
|
// sub-agent, its last tool call awaiting its answer within 30 minutes) waits for its hook.
|
|
41
39
|
import { execFileSync, spawn } from 'node:child_process';
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
// circuits it reads), the opening, the wait, the board and the line of a stop name; and the
|
|
5
5
|
// answer `--mecanique`, which turns the sort of a ticket stopped on the testwriter or on the proof
|
|
6
6
|
// of the red.
|
|
7
|
+
import { refusDeLaCommande } from './commande-du-plan.mjs';
|
|
7
8
|
import { CODE, GESTE, PREUVE, TESTS } from './transitions.mjs';
|
|
8
9
|
|
|
9
10
|
/** The statuses of a workflow ended without its issue. */
|
|
@@ -94,6 +95,10 @@ export function reponseMecanique({ etat, sorte, commande, contexte }) {
|
|
|
94
95
|
return { refus: 'le ticket est déjà mécanique : sa commande est celle de son plan.' };
|
|
95
96
|
}
|
|
96
97
|
const geste = String(commande ?? '').trim();
|
|
98
|
+
const refusGit = refusDeLaCommande(geste);
|
|
99
|
+
if (refusGit) {
|
|
100
|
+
return { refus: refusGit };
|
|
101
|
+
}
|
|
97
102
|
return geste
|
|
98
103
|
? { sorte: { genre: 'mécanique', raison, commande: geste }, suivant: { etape: GESTE } }
|
|
99
104
|
: { sorte: { genre: 'comportement', raison, comportement: 'inchangé' }, suivant: { etape: CODE } };
|
package/scripts/resultats.mjs
CHANGED
|
@@ -117,6 +117,7 @@
|
|
|
117
117
|
import { existsSync, mkdirSync, readdirSync, readFileSync, statSync, writeFileSync } from 'node:fs';
|
|
118
118
|
import path from 'node:path';
|
|
119
119
|
import { pathToFileURL } from 'node:url';
|
|
120
|
+
import { refusDeLaCommande } from './commande-du-plan.mjs';
|
|
120
121
|
import { paquets } from './paquets.mjs';
|
|
121
122
|
import { AUTEUR_DU_CIRCUIT, EXPLORATEUR } from './etapes.mjs';
|
|
122
123
|
|
|
@@ -128,12 +129,16 @@ const SARIF = 'sarif';
|
|
|
128
129
|
export const A_ELAGUER = 'a-elaguer';
|
|
129
130
|
// The kinds of a guard's finding: to fix (a developpeur's work), to settle (a person's decision),
|
|
130
131
|
// to lower (a note).
|
|
131
|
-
const GENRES = ['a-corriger', 'a-arbitrer', A_ELAGUER, 'a-inscrire'];
|
|
132
|
+
const GENRES = ['a-corriger', 'a-arbitrer', A_ELAGUER, 'a-inscrire', 'a-deplacer'];
|
|
133
|
+
// The kind of a note of a guard whose debt stands under the former path of a file the lot moves:
|
|
134
|
+
// the regeneration carries the key to the new path (scripts/dette.mjs, `abaisser`).
|
|
135
|
+
export const A_DEPLACER = 'a-deplacer';
|
|
132
136
|
// The kind of a note of a guard the lot adds (absent from the guards of main): the findings of a
|
|
133
137
|
// key, which the circuit inscribes as its debt (scripts/dette.mjs, scripts/circuit.mjs).
|
|
134
138
|
export const A_INSCRIRE = 'a-inscrire';
|
|
135
139
|
// Whether a finding is a note of the debt, lowered or inscribed by the circuit: no red.
|
|
136
|
-
export const estNoteDeDette = k =>
|
|
140
|
+
export const estNoteDeDette = k =>
|
|
141
|
+
k.genre === A_ELAGUER || k.genre === A_INSCRIRE || k.genre === A_DEPLACER;
|
|
137
142
|
const texte = description => ({ type: 'string', description });
|
|
138
143
|
const liste = (items, description) => ({ type: 'array', description, items });
|
|
139
144
|
const objet = (properties, required = [], description) => ({
|
|
@@ -956,6 +961,10 @@ function manques(role, f) {
|
|
|
956
961
|
if (!(f.paquets ?? []).length) {
|
|
957
962
|
out.push('paquets : manque, pour un plan');
|
|
958
963
|
}
|
|
964
|
+
const refus = refusDeLaCommande(f.sorte?.commande);
|
|
965
|
+
if (refus) {
|
|
966
|
+
out.push(`sorte.commande : ${refus}`);
|
|
967
|
+
}
|
|
959
968
|
for (const [i, e] of (f.ecartes ?? []).entries()) {
|
|
960
969
|
if (!(typeof e.raison === 'string' && e.raison.trim())) {
|
|
961
970
|
out.push(`ecartes[${i}].raison : manque, pour un composant écarté`);
|
package/scripts/session-start.sh
CHANGED
|
@@ -1,53 +1,40 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
# SessionStart hook: tells the session what the project still lacks
|
|
3
|
-
# Silent once the project is set up and initialised. It changes nothing,
|
|
4
|
-
# supervisor
|
|
2
|
+
# SessionStart hook (`grillhouse session-start`): tells the session what the project still lacks
|
|
3
|
+
# before work can start. Silent once the project is set up and initialised. It changes nothing,
|
|
4
|
+
# save the lock of the supervisor. Mechanism: greffon.md, §5.2 (the missing and the unfilled:
|
|
5
|
+
# installation.md).
|
|
5
6
|
#
|
|
6
|
-
#
|
|
7
|
-
#
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
#
|
|
11
|
-
#
|
|
12
|
-
#
|
|
7
|
+
# Each check below joins the list « Manque » or « Pas encore renseignés ».
|
|
8
|
+
# - The project's own check: `grillhouse.demarrage` in the root package.json names an npm script;
|
|
9
|
+
# `npm run --silent <script>` runs at the root, 10 s (past them its whole process group is
|
|
10
|
+
# stopped), and each non-blank line it writes joins « Pas encore renseignés ». A failure or a
|
|
11
|
+
# stop adds a line that says so; the session start goes on. Without the key (or with null)
|
|
12
|
+
# nothing runs; a value that is not a non-blank string runs nothing and adds a line that says
|
|
13
|
+
# so. An agent's copy does not play it.
|
|
14
|
+
# - The Node of the dependencies: installed (`npm ci`) under another binary interface of Node than
|
|
15
|
+
# the current one, the project joins « Manque » with `npm ci` (scripts/abi-des-dependances.mjs).
|
|
16
|
+
# - The languages: no language declared in the column « Langage » of the table of the components of
|
|
17
|
+
# docs/ARCHITECTURE.md (scripts/langages.mjs) joins « Manque » as « le langage de chaque
|
|
18
|
+
# paquet », with the grill, or with `npx grillhouse maj` for a declaration of a former version.
|
|
19
|
+
# A document that holds a field <…> of its template stays under « Pas encore renseignés ».
|
|
20
|
+
# - The plugins: scripts/greffons.mjs --absents reads `.claude/settings.json` and
|
|
21
|
+
# `claude plugin list --json` (each call stopped after 5 s). Each declared plugin not installed
|
|
22
|
+
# joins « Manque » as « le greffon <id> », the missing claude command as « la commande claude »
|
|
23
|
+
# (with `npx grillhouse maj`), a failed or stopped reading as « la lecture des greffons … »; the
|
|
24
|
+
# same reading names the mod installed at another version than the package, with the command
|
|
25
|
+
# that aligns it. An agent's copy does not read them.
|
|
26
|
+
# - The worker of Temporal on a former version after a change of `grillhouse.outil` (`grillhouse
|
|
27
|
+
# temporal perime`) joins « Manque » with `npx grillhouse temporal installer`. An agent's copy
|
|
28
|
+
# does not read it.
|
|
13
29
|
#
|
|
14
|
-
# The
|
|
15
|
-
#
|
|
16
|
-
#
|
|
30
|
+
# The supervisor (scripts/superviseur.mjs): the session takes the lock of its repository; when its
|
|
31
|
+
# opening takes it (not when it keeps it) it receives « Les questions des circuits » then « Les
|
|
32
|
+
# circuits du dépôt »; a second session while the first lives receives first « Un autre
|
|
33
|
+
# superviseur tient ce dépôt ». An agent's copy takes nothing and receives nothing.
|
|
17
34
|
#
|
|
18
|
-
#
|
|
19
|
-
#
|
|
20
|
-
#
|
|
21
|
-
# project that holds the declaration of a former version, which it reports. A document of the project that holds
|
|
22
|
-
# a field <…> of its template (the template's docs/ARCHITECTURE.md declares its language, its
|
|
23
|
-
# other fields left to the grill) is not yet written: it stays under « Pas encore renseignés », and
|
|
24
|
-
# the line of the night waits for it.
|
|
25
|
-
#
|
|
26
|
-
# The frame's plugins: scripts/greffons.mjs --absents reads `.claude/settings.json` and
|
|
27
|
-
# `claude plugin list --json` (each call stopped after 5 s). Each declared plugin not installed for
|
|
28
|
-
# the project joins « Manque » as « le greffon <id> », the missing claude command as « la commande
|
|
29
|
-
# claude » (the line gives `npx grillhouse maj`, which installs them), and a reading that fails
|
|
30
|
-
# or is stopped as « la lecture des greffons … ». The same reading names the frame's mod installed
|
|
31
|
-
# for the project at another version than the package @roomi-fields/grillhouse, both released under
|
|
32
|
-
# one version, with the command that aligns the one behind. An agent's copy does not read them.
|
|
33
|
-
#
|
|
34
|
-
# The worker of Temporal on a former version after a rise of `grillhouse.outil` (see below, the
|
|
35
|
-
# detection `grillhouse temporal perime`): joins « Manque » with `npx grillhouse temporal installer`.
|
|
36
|
-
# An agent's copy does not read it.
|
|
37
|
-
#
|
|
38
|
-
# One supervisor per project (scripts/superviseur.mjs): the session takes the lock of its
|
|
39
|
-
# repository, and, when its opening takes the lock (not when it keeps it, after a compaction or a
|
|
40
|
-
# /clear), receives the section « Les questions des circuits » (the greffon pushes the questions, the answer
|
|
41
|
-
# acknowledges them; no wait to launch), then « Les circuits du dépôt » when there are some: each circuit that runs, each one stopped on a
|
|
42
|
-
# question with its question and the command that answers it, each one whose workflow ended
|
|
43
|
-
# without its issue with the command that resumes it; a second session, while the first one lives, receives first the section « Un autre
|
|
44
|
-
# superviseur tient ce dépôt », which asks it to say so to the owner and to launch no circuit. An
|
|
45
|
-
# agent's copy and a session of a role the circuit launches take nothing and receive nothing.
|
|
46
|
-
#
|
|
47
|
-
# A session of a role agent of the frame (`claude --agent <rôle>`, the circuit's sessions: the
|
|
48
|
-
# hook's input names it, `agent_type`, bare or as `grillhouse:<rôle>`, and the frame's plugin
|
|
49
|
-
# defines it, `$CLAUDE_PLUGIN_ROOT/agents/<rôle>.md`, the plugin whose hook runs this script) receives nothing:
|
|
50
|
-
# what the project lacks is the supervisor's to deal with.
|
|
35
|
+
# A session of a role of the frame (`claude --agent <rôle>`: the hook's input names it,
|
|
36
|
+
# `agent_type`, bare or `grillhouse:<rôle>`, and the plugin defines it,
|
|
37
|
+
# `$CLAUDE_PLUGIN_ROOT/agents/<rôle>.md`) receives nothing.
|
|
51
38
|
set -uo pipefail
|
|
52
39
|
|
|
53
40
|
# The project is Claude Code's, else the working directory; the frame's scripts are this one's
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// The short name of a project on the displays shared between projects (the line of the places, the
|
|
2
|
-
// board of several projects): the key `grillhouse.sigle` of its package.json (
|
|
3
|
-
// owner's word of 2026-11-12), else its ticket prefix (`issue-prefix` of .beads/config.yaml,
|
|
2
|
+
// board of several projects): the key `grillhouse.sigle` of its package.json, else its ticket prefix (`issue-prefix` of .beads/config.yaml,
|
|
4
3
|
// ./prefixe-des-tickets.mjs). Read like the other keys `grillhouse.*` (./circuits-cles.mjs): as
|
|
5
4
|
// written, a faulty value is named by its key.
|
|
6
5
|
import { readFileSync } from 'node:fs';
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
# the grill. Read-only; silent on every other message, including one that merely mentions structure,
|
|
5
5
|
# and to a session of a role agent of the frame (`claude --agent <rôle>`: the input names it,
|
|
6
6
|
# `agent_type`, bare or as `grillhouse:<rôle>`, and the frame's plugin defines it,
|
|
7
|
-
# `$CLAUDE_PLUGIN_ROOT/agents/<rôle>.md`), whose instruction is a ticket's.
|
|
7
|
+
# `$CLAUDE_PLUGIN_ROOT/agents/<rôle>.md`), whose instruction is a ticket's. Mechanism: greffon.md,
|
|
8
|
+
# §3.2.
|
|
8
9
|
entree="$(cat)"
|
|
9
10
|
role="$(printf '%s' "$entree" | node -e 'let s="";process.stdin.on("data",d=>s+=d).on("end",()=>{try{const a=JSON.parse(s).agent_type;if(typeof a==="string"&&/^[A-Za-z0-9_:-]+$/.test(a))process.stdout.write(a)}catch{}})')"
|
|
10
11
|
racine="${CLAUDE_PROJECT_DIR:-$PWD}"
|
package/scripts/suiveur.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// The follower of the board (`grillhouse tableau --suivre`): one producer that follows the events
|
|
2
2
|
// and, at each measure, writes the status line's text (`grillhouse-etat.txt`) and the pane's line
|
|
3
3
|
// (`grillhouse-tableau.ligne`) from that one measure, in the common git directory. The status line
|
|
4
|
-
// and the pane are readers
|
|
4
|
+
// and the pane are readers. Mechanism: greffon.md, §5.3.
|
|
5
5
|
//
|
|
6
6
|
// - A measure follows an event: a change under `.beads/`, a change of the git state (HEAD, the
|
|
7
7
|
// references), a change of the set of circuits (a light poll of Temporal), the end of a bd or git
|
package/scripts/superviseur.mjs
CHANGED
|
@@ -1,70 +1,51 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
2
|
+
// The lock of the supervisor of a project, and the reading of the questions of its circuits.
|
|
3
|
+
// Mechanism: greffon.md, §5.1 and §5.2. Played by the session start (scripts/session-start.sh),
|
|
4
|
+
// which writes what it says to the session.
|
|
5
5
|
//
|
|
6
6
|
// npx grillhouse superviseur <racine>
|
|
7
7
|
//
|
|
8
8
|
// - Out of a git repository, in an agent's copy (a worktree whose git directory is not the common
|
|
9
|
-
// one) and in a session of a role that the circuit launches (BEADS_ACTOR set
|
|
10
|
-
//
|
|
9
|
+
// one) and in a session of a role that the circuit launches (BEADS_ACTOR set), nothing is taken
|
|
10
|
+
// and nothing is said.
|
|
11
11
|
// - The lock is `<git common dir>/grillhouse-superviseur.lock`, one for the repository and its
|
|
12
12
|
// copies, taken through scripts/verrou-de-fichier.mjs for the session's own process: the first
|
|
13
|
-
// process above this one named `claude`, whatever stands between them
|
|
14
|
-
//
|
|
15
|
-
//
|
|
16
|
-
//
|
|
17
|
-
//
|
|
18
|
-
//
|
|
19
|
-
//
|
|
20
|
-
//
|
|
21
|
-
//
|
|
22
|
-
//
|
|
23
|
-
//
|
|
24
|
-
//
|
|
25
|
-
//
|
|
26
|
-
//
|
|
27
|
-
// named; each circuit stopped on a question, with its question and the command that answers it; each
|
|
28
|
-
// circuit ended without its issue, with the command that resumes it (`--reprendre` from its last
|
|
29
|
-
// state written, else `--depuis <testwriter|developpeur> --contexte <texte>`), which the
|
|
30
|
-
// supervisor launches without waiting for the owner's word; their ticket open, and the stopped
|
|
31
|
-
// and the ended ones then gone up; a server that does not answer is said; then « ## La file des
|
|
32
|
-
// tickets », the tickets of the queue without their section « ## Architecture », which the
|
|
33
|
-
// queue never starts (scripts/file-des-tickets.mjs), for the supervisor to write it. A circuit
|
|
34
|
-
// runs on the worker of the project, apart from the sessions, its launch returns at once, and its
|
|
35
|
-
// question reaches the supervisor by the push of the greffon (below). The queue of the
|
|
36
|
-
// tickets under Temporal (src/temporal/tickets/) launches the tickets `circuit`, not the opening.
|
|
13
|
+
// process above this one named `claude`, whatever stands between them; without one, the first
|
|
14
|
+
// that is not a shell (sh, bash, dash, zsh). It holds as long as that process lives.
|
|
15
|
+
// - Free, or held by a process that is gone: taken, nothing said. Held by the session itself (a
|
|
16
|
+
// compaction or a /clear): kept, nothing said, circuits included. Held by another live session:
|
|
17
|
+
// the section « ## Un autre superviseur tient ce dépôt » names its process and since when, and
|
|
18
|
+
// asks to say so to the owner and to launch no circuit.
|
|
19
|
+
// - The session whose opening takes the lock (`circuitsALOuverture`) receives « ## Les questions
|
|
20
|
+
// des circuits », then, when the repository has circuits (read from the Temporal server in one
|
|
21
|
+
// call, scripts/circuits-du-serveur.mjs), « ## Les circuits du dépôt »: each circuit that runs;
|
|
22
|
+
// each circuit stopped on a question, with the command that answers it; each circuit ended
|
|
23
|
+
// without its issue, with the command that resumes it (`--reprendre` from its last state
|
|
24
|
+
// written, else `--depuis <testwriter|developpeur> --contexte <texte>`); a server that does not
|
|
25
|
+
// answer is said; then « ## La file des tickets », the tickets of the queue without their
|
|
26
|
+
// section « ## Architecture », which the queue never starts (scripts/file-des-tickets.mjs).
|
|
37
27
|
// Exit 0, whatever it finds.
|
|
38
28
|
//
|
|
39
29
|
// npx grillhouse superviseur --relever [<dossier>]
|
|
40
30
|
//
|
|
41
|
-
// - One reading of the circuits for the greffon
|
|
42
|
-
//
|
|
43
|
-
//
|
|
44
|
-
//
|
|
45
|
-
//
|
|
46
|
-
//
|
|
47
|
-
//
|
|
48
|
-
//
|
|
49
|
-
// fault. A reading is one reading: no process waits.
|
|
50
|
-
// - A question has three states the greffon keeps in the file of the stops gone up: sent (put in the
|
|
51
|
-
// message of the session by `relever`), read (a turn of the session started with that message,
|
|
52
|
-
// `superviseur --lue <dossier> <lueA> <envoyeesAvant>`, or the opening listed it), answered (it
|
|
53
|
-
// leaves the file). It comes back only once read, <rappelMs> after its reading, as SQS counts the
|
|
54
|
-
// visibility timeout of a message from its reception: one still in the queue is never sent again.
|
|
55
|
-
// `superviseur --chez-le-responsable <dossier> <ticket>` (the answer `--chez-le-responsable` of
|
|
56
|
-
// the circuit) marks a question carried to the owner: silent until the circuit answers.
|
|
31
|
+
// - One reading of the circuits for the greffon (mods/grillhouse/hooks/register.tsx), which runs
|
|
32
|
+
// it at each period and submits what it writes. It reads and writes nothing unless the session
|
|
33
|
+
// that runs it holds the lock; a lock whose process is gone is taken over by the session that
|
|
34
|
+
// reads. It writes the message (`texteDesQuestions`) when `relever` gives something, nothing
|
|
35
|
+
// otherwise; exit 1 and the fault on the error stream when `grillhouse.rappel` is at fault.
|
|
36
|
+
// - `superviseur --lue <dossier> <lueA> <envoyeesAvant>` marks read the questions sent up to
|
|
37
|
+
// `envoyeesAvant`; `superviseur --chez-le-responsable <dossier> <ticket>` marks a question
|
|
38
|
+
// carried to the owner: silent until the circuit answers.
|
|
57
39
|
// - `relever` is the one function of the reading, of the re-presentation and of the file of the
|
|
58
|
-
// stops gone up:
|
|
59
|
-
//
|
|
60
|
-
//
|
|
61
|
-
//
|
|
62
|
-
//
|
|
63
|
-
//
|
|
64
|
-
//
|
|
65
|
-
//
|
|
66
|
-
//
|
|
67
|
-
// cleared at the next green.
|
|
40
|
+
// stops gone up: a question that never went up, or was read <rappelMs> ago (`grillhouse.rappel`
|
|
41
|
+
// minutes, 10 by default, scripts/circuits-cles.mjs), is given once per due time while its
|
|
42
|
+
// circuit stands on the same stop; one answered leaves the file
|
|
43
|
+
// `.claude/worktrees/questions-remontees.json`. A stop is kept there by its ticket, the run of
|
|
44
|
+
// its workflow, the rank of its question in that run and its stop, with the times of the first
|
|
45
|
+
// going up and of the last presentation. The end of a circuit integrated is given once
|
|
46
|
+
// (`integre`), kept in `.claude/worktrees/integrations-rendues.json`, and the alert of the CI of
|
|
47
|
+
// main (a red, or a CI not read, scripts/ci-de-main.mjs) once per passage
|
|
48
|
+
// (`.claude/worktrees/ci-de-main-rendue.json`), cleared at the next green.
|
|
68
49
|
// - The reading covers the project and each other project of its group (`grillhouse.groupe`) that
|
|
69
50
|
// no other live session of supervision holds, each under its name and its folder.
|
|
70
51
|
import { spawnSync } from 'node:child_process';
|