@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
package/bin/grillhouse.mjs
CHANGED
|
@@ -20,6 +20,14 @@
|
|
|
20
20
|
// main tree, `environnementDe` of scripts/sous-commandes.mjs), each variable set to its path,
|
|
21
21
|
// whatever the caller's environment; a faulty key is refused by its name on the error stream,
|
|
22
22
|
// nothing run, and the exit code is 2.
|
|
23
|
+
// - In a project whose package.json names its published version (`grillhouse.outil`, the frame's
|
|
24
|
+
// repository), a subcommand of the orchestration (circuit, superviseur, nuit, tableau, the status
|
|
25
|
+
// line and the hooks of Claude Code) runs by that version, installed under
|
|
26
|
+
// ~/.cache/grillhouse/outil/<version>/ at its first launch, its arguments, streams and exit
|
|
27
|
+
// code this command's; every other subcommand runs here (scripts/aiguillage.mjs). A faulty key
|
|
28
|
+
// is refused by its name on the error stream, nothing run, and the exit code is 2; a version
|
|
29
|
+
// that cannot be installed is said in one line on the error stream, and the subcommand runs
|
|
30
|
+
// here.
|
|
23
31
|
// - A subcommand missing or unknown writes the usage and the list of the subcommands on the error
|
|
24
32
|
// stream, and the exit code is 2.
|
|
25
33
|
// - A script finds its neighbours by its own directory, and the project by the working directory
|
|
@@ -28,6 +36,7 @@ import { spawn } from 'node:child_process';
|
|
|
28
36
|
import { realpathSync } from 'node:fs';
|
|
29
37
|
import { constants } from 'node:os';
|
|
30
38
|
import { pathToFileURL } from 'node:url';
|
|
39
|
+
import { aiguillage, installer } from '../scripts/aiguillage.mjs';
|
|
31
40
|
import {
|
|
32
41
|
commandeDe,
|
|
33
42
|
environnementDe,
|
|
@@ -60,9 +69,54 @@ const lance = () => {
|
|
|
60
69
|
}
|
|
61
70
|
};
|
|
62
71
|
|
|
72
|
+
// Runs the script <commande> (by bash for a `.sh`, else by Node) with <args> and this process's
|
|
73
|
+
// streams; a signal this process receives goes to it, which decides how it ends; its exit code is
|
|
74
|
+
// this command's.
|
|
75
|
+
function lancerLeScript(nom, commande, args, env = process.env) {
|
|
76
|
+
const enfant = commande.endsWith('.sh')
|
|
77
|
+
? spawn('bash', [commande, ...args], { stdio: 'inherit', env })
|
|
78
|
+
: spawn(process.execPath, [commande, ...args], { stdio: 'inherit', env });
|
|
79
|
+
const relais = s => enfant.kill(s);
|
|
80
|
+
for (const s of ['SIGINT', 'SIGTERM', 'SIGHUP']) process.on(s, relais);
|
|
81
|
+
enfant.on('error', e => {
|
|
82
|
+
process.stderr.write(`⛔ grillhouse ${nom} : ${e.message}\n`);
|
|
83
|
+
process.exitCode = 1;
|
|
84
|
+
});
|
|
85
|
+
enfant.on('exit', (code, signal) => {
|
|
86
|
+
process.exitCode = code ?? 128 + (constants.signals[signal] ?? 0);
|
|
87
|
+
for (const s of ['SIGINT', 'SIGTERM', 'SIGHUP']) process.off(s, relais);
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// The subcommand <nom> handed to the published version the project names (scripts/aiguillage.mjs),
|
|
92
|
+
// installed at its first launch: true when it is handed, false when it runs here, a version that
|
|
93
|
+
// cannot be installed said in one line.
|
|
94
|
+
function aiguiller(nom, args) {
|
|
95
|
+
let vers;
|
|
96
|
+
try {
|
|
97
|
+
vers = nom === undefined ? null : aiguillage(nom);
|
|
98
|
+
} catch (e) {
|
|
99
|
+
process.stderr.write(`⛔ grillhouse ${nom} : ${e.message}\n`);
|
|
100
|
+
process.exitCode = 2;
|
|
101
|
+
return true;
|
|
102
|
+
}
|
|
103
|
+
if (vers === null) return false;
|
|
104
|
+
try {
|
|
105
|
+
installer(vers.version);
|
|
106
|
+
} catch (e) {
|
|
107
|
+
process.stderr.write(
|
|
108
|
+
`⚠️ grillhouse ${nom} : version publiée ${vers.version} non installable : ${e.message} ; le code du dépôt la remplace.\n`
|
|
109
|
+
);
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
lancerLeScript(nom, vers.commande, [nom, ...args]);
|
|
113
|
+
return true;
|
|
114
|
+
}
|
|
115
|
+
|
|
63
116
|
// The script of the subcommand, run (see the header); the exit code is set, never forced
|
|
64
117
|
// (`process.exitCode`), so that what the command wrote on a pipe reaches its reader.
|
|
65
118
|
async function lancer([nom, ...args]) {
|
|
119
|
+
if (aiguiller(nom, args)) return;
|
|
66
120
|
let commande;
|
|
67
121
|
try {
|
|
68
122
|
commande = nom === undefined ? null : commandeDe(nom);
|
|
@@ -94,20 +148,7 @@ async function lancer([nom, ...args]) {
|
|
|
94
148
|
process.exitCode = 2;
|
|
95
149
|
return;
|
|
96
150
|
}
|
|
97
|
-
|
|
98
|
-
? spawn('bash', [script, ...args], { stdio: 'inherit', env })
|
|
99
|
-
: spawn(process.execPath, [script, ...args], { stdio: 'inherit', env });
|
|
100
|
-
// A signal this process receives goes to the script, which decides how it ends.
|
|
101
|
-
const relais = s => enfant.kill(s);
|
|
102
|
-
for (const s of ['SIGINT', 'SIGTERM', 'SIGHUP']) process.on(s, relais);
|
|
103
|
-
enfant.on('error', e => {
|
|
104
|
-
process.stderr.write(`⛔ grillhouse ${nom} : ${e.message}\n`);
|
|
105
|
-
process.exitCode = 1;
|
|
106
|
-
});
|
|
107
|
-
enfant.on('exit', (code, signal) => {
|
|
108
|
-
process.exitCode = code ?? 128 + (constants.signals[signal] ?? 0);
|
|
109
|
-
for (const s of ['SIGINT', 'SIGTERM', 'SIGHUP']) process.off(s, relais);
|
|
110
|
-
});
|
|
151
|
+
lancerLeScript(nom, script, args, env);
|
|
111
152
|
}
|
|
112
153
|
|
|
113
154
|
if (import.meta.url === lance()) {
|
|
@@ -37,7 +37,7 @@ interface publiée…>. Le cadre et l'architecture montent toujours (charte comm
|
|
|
37
37
|
|
|
38
38
|
## Commandes
|
|
39
39
|
|
|
40
|
-
- `npm test` (Turborepo : construction, puis tests ; une tâche dont rien n'a bougé est relue de son cache, `npm run test:forcer` rejoue) · `npm test -- <chemins>` (un lancement ciblé : chaque chemin écrit depuis la racine, joué dans son paquet, avec les constructions dont ses tests dépendent, relues du cache ; ses tests rejouent dès que bouge ce qu'ils importent ; un lancement qui ne joue aucun test échoue ; un
|
|
40
|
+
- `npm test` (Turborepo : construction, puis tests ; une tâche dont rien n'a bougé est relue de son cache, `npm run test:forcer` rejoue) · `npm test -- <chemins>` (un lancement ciblé : chaque chemin écrit depuis la racine, joué dans son paquet, avec les constructions dont ses tests dépendent, relues du cache ; ses tests rejouent dès que bouge ce qu'ils importent ; un lancement qui ne joue aucun test échoue ; un test de nuit ou une mesure de temps — un banc, un témoin de temps — se joue quand son propre fichier est nommé, sous la mesure du temps) · `npm run verifier` (après la construction, les gardes du cadre, celles du projet — son script `gardes` —, le typage de chaque paquet — son script `typecheck`, ses sources et ses tests — et les tests, côte à côte, sous le verrou de la machine, sans aucune mesure de temps, que joue la nuit seule : ce que jouent l'intégration, la file, la CI et la nuit ; mesuré contre le dernier vert, un paquet rejoué joue les tests que Vitest relie aux fichiers changés depuis, tous quand un changement sort de son graphe ; 0 vert, 1 rouge, un délai dépassé compris ; 75 quand l'attente du verrou de la machine ou de place sous /tmp atteint sa borne) · `npm run verifier -- --tout` (la passe complète, chaque test joué pour de vrai : ce que joue la nuit) · `npm run verifier -- --gardes` (les gardes seules, même verdict : ce que joue le relecteur) · `npm run typecheck` · `npm run lint` · `npm run format:check`.
|
|
41
41
|
- Préfixe des tickets : `<prefixe>-`.
|
|
42
42
|
- La politique de poussée : la clé `grillhouse.poussee` du `package.json` (`commit` : la branche où
|
|
43
43
|
part chaque commit, main par défaut ; `nuit` : la branche où la nuit pousse son commit vert ;
|
|
@@ -115,17 +115,17 @@ npm test
|
|
|
115
115
|
|
|
116
116
|
### Available Scripts
|
|
117
117
|
|
|
118
|
-
| Script | Description
|
|
119
|
-
| ------------------------------ |
|
|
120
|
-
| `npm run build` | Compile TypeScript to JavaScript
|
|
121
|
-
| `npm run dev` | Run in development mode with watch
|
|
122
|
-
| `npm test` | Build, then run the tests (Turborepo; an unchanged task is replayed from its cache); `npm test -- <paths>` plays the paths written from the root, each in its package, its tests played again once what they import changes
|
|
123
|
-
| `npm run test:forcer` | The same, every task run for real; with paths, the tests named run for real, their builds replayed from the cache
|
|
124
|
-
| `npm run verifier` | Build, then run the frame's guards, the project's own (`gardes`) and the tests beside each other (what the integration and the CI run), measured against the last green: a package played again runs the tests Vitest relates to the files changed since; 0 green, 1 red
|
|
125
|
-
| `npm run verifier -- --tout` | The complete pass: every test run for real, never measured against the last green (what the night runs)
|
|
126
|
-
| `npm run verifier -- --gardes` | The guards alone (the frame's and the project's), same verdict: what the reviewer runs on the ticket's copy
|
|
127
|
-
| `npm run lint` | Run ESLint
|
|
128
|
-
| `npm run format` | Format code with Prettier
|
|
118
|
+
| Script | Description |
|
|
119
|
+
| ------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
120
|
+
| `npm run build` | Compile TypeScript to JavaScript |
|
|
121
|
+
| `npm run dev` | Run in development mode with watch |
|
|
122
|
+
| `npm test` | Build, then run the tests (Turborepo; an unchanged task is replayed from its cache); `npm test -- <paths>` plays the paths written from the root, each in its package, its tests played again once what they import changes |
|
|
123
|
+
| `npm run test:forcer` | The same, every task run for real; with paths, the tests named run for real, their builds replayed from the cache |
|
|
124
|
+
| `npm run verifier` | Build, then run the frame's guards, the project's own (`gardes`) and the tests beside each other (what the integration and the CI run), measured against the last green: a package played again runs the tests Vitest relates to the files changed since; 0 green, 1 red (a delay past included; the measures of time play at night); 75 when the wait for the lock of the machine, or for room under /tmp, reaches its bound |
|
|
125
|
+
| `npm run verifier -- --tout` | The complete pass: every test run for real, never measured against the last green (what the night runs) |
|
|
126
|
+
| `npm run verifier -- --gardes` | The guards alone (the frame's and the project's), same verdict: what the reviewer runs on the ticket's copy |
|
|
127
|
+
| `npm run lint` | Run ESLint |
|
|
128
|
+
| `npm run format` | Format code with Prettier |
|
|
129
129
|
|
|
130
130
|
## Contributing
|
|
131
131
|
|
|
@@ -84,8 +84,5 @@ pids/
|
|
|
84
84
|
.rtfm/
|
|
85
85
|
.codegraph/
|
|
86
86
|
|
|
87
|
-
#
|
|
88
|
-
.
|
|
89
|
-
|
|
90
|
-
# Turborepo: its local cache and its runs
|
|
91
|
-
.turbo/
|
|
87
|
+
# The directories the frame and the tools of its language write (the copies of the tickets,
|
|
88
|
+
# Turborepo's cache) are laid by grillhouse maj, which init runs.
|
package/charte.md
CHANGED
|
@@ -82,12 +82,20 @@ ticket par ticket.
|
|
|
82
82
|
**La taille d'un test suit la pyramide** (la pyramide des tests de Google, les tailles de
|
|
83
83
|
Bazel) : un test petit vérifie son module par son interface, sans processus ; un test moyen
|
|
84
84
|
assemble quelques modules sur la machine, avec des processus locaux ; un test grand monte un
|
|
85
|
-
projet d'essai et y lance le produit ou le cadre entier : il est un test de nuit (`*.nuit.test
|
|
86
|
-
jamais joué au fil du travail. Chaque test prend la plus petite taille qui prouve son critère, dans
|
|
85
|
+
projet d'essai et y lance le produit ou le cadre entier : il est un test de nuit (`*.nuit.test.*`,
|
|
86
|
+
`*_nuit_test.py`, `tests/*_nuit.rs` en Rust), jamais joué au fil du travail. Chaque test prend la plus petite taille qui prouve son critère, dans
|
|
87
87
|
Grillhouse comme dans chaque projet. La garde des tailles (`grillhouse tailles-des-tests`) refuse
|
|
88
88
|
un grand test de jour, et la dette inscrite des grands tests existants ne fait que baisser. Ainsi
|
|
89
89
|
le jour reste court, et la preuve longue tourne la nuit.
|
|
90
90
|
|
|
91
|
+
**Une mesure de temps joue la nuit** (les tests `manual` de Bazel, les bancs de rustc-perf hors de
|
|
92
|
+
la CI de chaque commit) : le jour sert l'activité, et sa machine est toujours chargée. Un test qui
|
|
93
|
+
mesure un temps (un banc de temps, un témoin de temps) est hors du jour dans chaque langage, comme
|
|
94
|
+
un test de nuit ; la nuit le joue seul, au repos, et un échec sous charge y est « à repasser »
|
|
95
|
+
(75). Le jour n'attend aucun repos : un délai de test est un garde-fou, pas une mesure ; dépassé,
|
|
96
|
+
il est rouge, et un délai trop juste s'élargit, très au-dessus de la durée normale du test. Ainsi
|
|
97
|
+
le jour avance, et une mesure se prend au repos.
|
|
98
|
+
|
|
91
99
|
**Un projet a plusieurs langages, un paquet un seul** : chaque paquet relève du langage de son
|
|
92
100
|
outil, et `npm test`, la vérification et le circuit jouent chaque paquet avec cet outil. Ainsi
|
|
93
101
|
chaque paquet se construit et se teste d'une seule façon.
|
|
@@ -172,7 +180,8 @@ dossier.
|
|
|
172
180
|
|
|
173
181
|
## Outils
|
|
174
182
|
|
|
175
|
-
- ⛔ **Des commandes sans invite** : tout fichier temporaire dans le scratchpad de session
|
|
183
|
+
- ⛔ **Des commandes sans invite** : tout fichier temporaire dans le scratchpad de session, ou
|
|
184
|
+
dans le dossier temporaire du ticket ;
|
|
176
185
|
`env -C <dossier>` ou `git -C` à la place de `cd`, et le greffon refuse une commande qui
|
|
177
186
|
commence par `cd` ; une suppression passe par un script node du
|
|
178
187
|
scratchpad (`rmSync` de `node:fs`) sur un chemin nommé et lu ; un signal vise seulement un
|
|
@@ -191,6 +200,18 @@ dossier.
|
|
|
191
200
|
qu'un test y laisse ; le module de chaque langage nomme son outil et porte cette garde. Ainsi le
|
|
192
201
|
dossier temporaire, souvent un disque en mémoire que partagent les séances du poste, ne sature
|
|
193
202
|
jamais.
|
|
203
|
+
- **Un fichier temporaire meurt avec son propriétaire** : une passe ou une séance hors ticket (la
|
|
204
|
+
nuit, une vérification) écrit sous un dossier temporaire à elle, retiré à sa fin, même
|
|
205
|
+
interrompue, et balayé par la suivante quand son processus est tué ; un agent écrit sous celui
|
|
206
|
+
de son ticket, que donne `npx grillhouse temporaire <ticket>`, qui vit le temps de son ticket,
|
|
207
|
+
d'une séance et d'une reprise à l'autre, gel compris, et part quand le ticket se ferme. Ce qu'un
|
|
208
|
+
agent doit avoir pour
|
|
209
|
+
reprendre vit dans la copie du ticket ou sa passation, jamais dans le seul dossier temporaire,
|
|
210
|
+
qui ne porte que ce qui se refait. Le dossier temporaire ne tient ni copie du dépôt, ni
|
|
211
|
+
`node_modules`, ni cache : un cache de compilation va sous `~/.cache/grillhouse/`. Une passe
|
|
212
|
+
lourde qui trouve moins de 4 Go libres, sous le dossier temporaire ou sur le disque de sa copie,
|
|
213
|
+
attend la place et dit ce qui l'occupe, le ticket nommé. Ainsi le poste ne sature jamais ses
|
|
214
|
+
disques.
|
|
194
215
|
- **Main reste vert** : l'intégration exige un `npm run verifier` vert. Un test connu rouge se met
|
|
195
216
|
en quarantaine dans le test lui-même (`it.skip` ou `it.fails`), avec le ticket qui le corrige.
|
|
196
217
|
Ainsi chaque rouge a son ticket.
|