@roomi-fields/grillhouse 0.24.14 → 0.24.15

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.
@@ -5,5 +5,5 @@
5
5
  "author": {
6
6
  "name": "Romain Peyrichou"
7
7
  },
8
- "version": "0.24.14"
8
+ "version": "0.24.15"
9
9
  }
@@ -395,3 +395,50 @@ projet dont le code de `src/` hors des tests importe une entrée déclare le paq
395
395
  ses `dependencies`, comme npm y met ce que le code publié importe : `npx grillhouse maj` l'y
396
396
  place, ses imports lus par TypeScript. Ainsi une version du paquet dit ce qu'un projet peut
397
397
  importer, et ce qu'elle lui retire.
398
+
399
+ ## La cible : un noyau et un paquet par langage
400
+
401
+ Décidée au grill du 2026-10-28 avec le responsable ; les paragraphes ci-dessus décrivent le cadre
402
+ d'aujourd'hui, et chaque ticket de l'épopée qui la mène les réécrit au présent quand il la livre.
403
+
404
+ **Une vérification à la mesure de ce qui change** : une vérification sur main qui ne touche
405
+ qu'un ou deux scripts du cadre prend moins de 5 minutes ; la passe complète reste à la nuit et à
406
+ la sortie. Le journal des tickets ne rejoue déjà aucun test : `grillhouse.lit` (la règle 5 de
407
+ `vitest-config/changements.mjs`) nomme un par un les fichiers de `.beads` que les tests lisent
408
+ (ses crochets, sa configuration), jamais ses journaux, que chaque commande de tickets réécrit. Un
409
+ changement d'un script du cadre rejoue encore les 3 200 tests (environ 22 minutes), ses tests le
410
+ lançant par son chemin ; la pyramide des tests (grillhouse-3dr.4) et les tests d'intégration dans
411
+ leur paquet (grillhouse-3dr.3) le ramènent aux tests qui le lisent.
412
+
413
+ **Un noyau, et un paquet par langage** : comme `nx` et ses greffons `@nx/js`, `@nx/vite`, le
414
+ cadre publie `@roomi-fields/grillhouse`, le **noyau** (les tickets, le circuit, les rôles et
415
+ leur relecture, le tableau, l'enveloppe, les crochets, la mise à jour, le greffon Claude), et un
416
+ **paquet de langage** par famille : `@roomi-fields/grillhouse-typescript` (la vérification par
417
+ Turborepo et Vitest, les gardes de structure et leurs outils) et `@roomi-fields/grillhouse-cargo`
418
+ (la même chose pour Rust, l'épopée grillhouse-pkl). Un projet installe le noyau et le paquet de
419
+ chacun de ses langages, et le noyau trouve ces paquets parmi ses dépendances, comme ESLint trouve
420
+ ses extensions. Ainsi chaque projet n'installe que ce qu'il utilise : BPScript n'a rien de Rust,
421
+ SyntHub a les deux.
422
+
423
+ **La jointure des langages** : le noyau ne demande à un paquet de langage que cinq choses — ses
424
+ composants et celui d'un fichier ; les composants touchés depuis un commit, avec leurs
425
+ dépendants ; les commandes qui testent, typent et vérifient un composant, et la lecture de leur
426
+ verdict ; la règle qui dit qu'un fichier est un test (le verrou du testwriter) ; ses fichiers
427
+ engendrés et leur commande. L'INTERFACE.md du noyau l'écrit, et une même suite de conformité la
428
+ tient sur chaque paquet de langage. Ainsi le reste du noyau ignore le langage du projet.
429
+
430
+ **Une version pour tous** : les paquets publiés sortent ensemble, à la même version, comme Nx et
431
+ Babel. La mise à jour installe le paquet de langage et réécrit les imports du projet vers leur
432
+ nouvelle adresse (la configuration de Vitest, la base TSDoc et `consommateurs` au paquet
433
+ TypeScript ; `paquets`, `dette` et `resultats` au noyau), sans alias. Ainsi un projet ne se
434
+ demande jamais quels paquets vont ensemble.
435
+
436
+ **Les tests d'intégration, un paquet à part** : les tests qui montent un dépôt d'essai et y
437
+ lancent le cadre entier (le circuit, plus de la moitié du temps des tests) vivent dans
438
+ `packages/grillhouse-essais`, privé, comme `turborepo-tests` de Turborepo ; ils se jouent quand
439
+ un fichier qu'ils lancent change, et en entier la nuit. Les tests du greffon
440
+ (`mods/grillhouse/tests`) entrent dans la vérification et la CI. Ainsi un test unitaire ne paie
441
+ jamais le prix d'un test d'intégration.
442
+
443
+ **L'ordre** : les deux causes du « tout rejoué », mesurées ; la jointure et le paquet
444
+ TypeScript ; le paquet des tests d'intégration ; le paquet cargo, sur la jointure.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@roomi-fields/grillhouse",
3
- "version": "0.24.14",
3
+ "version": "0.24.15",
4
4
  "description": "Roomi's Grillhouse: the frame's scripts, called by one command, grillhouse <sous-commande>",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -76,7 +76,15 @@
76
76
  },
77
77
  "grillhouse": {
78
78
  "lit": [
79
- ".beads",
79
+ ".beads/.gitignore",
80
+ ".beads/config.yaml",
81
+ ".beads/hooks/commit-msg",
82
+ ".beads/hooks/post-checkout",
83
+ ".beads/hooks/post-merge",
84
+ ".beads/hooks/pre-commit",
85
+ ".beads/hooks/pre-push",
86
+ ".beads/hooks/prepare-commit-msg",
87
+ ".beads/metadata.json",
80
88
  ".claude",
81
89
  ".dependency-cruiser.cjs",
82
90
  ".eslintrc.cjs",
@@ -31,7 +31,7 @@
31
31
  # circuit gives them, so that a relaunch of an agent on its step resumes its session. The two
32
32
  # together are refused, CODE_USAGE; each takes a value as --modele does.
33
33
  # A resumed session receives its instruction alone: the session it resumes holds the sections
34
- # the launcher adds below, save « La construction de ton paquet échoue », which it receives.
34
+ # the launcher adds below, save « La construction échoue », which it receives.
35
35
  # - The agent's copy is the worktree .claude/worktrees/<ticket> (branch agent/<ticket>), created
36
36
  # from the main tree's HEAD when absent and moved forward to it otherwise. When the branch exists
37
37
  # without a copy, it is brought back to the main tree's HEAD and the copy is made on it: the lot
@@ -68,10 +68,16 @@
68
68
  # traces> --filter=<paquet>...… --continue=dependencies-successful`), whose failure does not
69
69
  # stop it: each task whose
70
70
  # dependencies succeed goes to its end, so what their tests read without depending on them is
71
- # built whole; the session opens, its instruction ending with a section « La construction de ton
72
- # paquet échoue » with the end of that output, since repairing it is the session's work (a
71
+ # built whole; the session opens, its instruction ending with a section « La construction
72
+ # échoue » with the end of that output, since repairing it is the session's work (a
73
73
  # provider's lot that breaks its consumers). Their consumers are not built. Any other plan, the
74
- # whole repository (`.`) included, builds the copy whole (`turbo run build`). The
74
+ # whole repository (`.`) included, or a path that is no package of the frame (BPScript's
75
+ # libraries/), reads the graph of the whole copy dry (`turbo run build --dry=json`), whose
76
+ # failure (Turborepo absent, its configuration refused) stops the launch, CODE_COPIE, then builds
77
+ # the copy whole as far as it builds (`turbo run build --continue=dependencies-successful`): its
78
+ # failure does not stop the launch either, and goes into the same section. The first line of the
79
+ # section says which build failed and what was built. The installation and every other step of
80
+ # the preparation stop it, CODE_COPIE. The
75
81
  # installation and the build play through `scripts/sous-modules.sh monter`, each shared submodule
76
82
  # of the main repository read-only, by the list the pose printed, whatever the installation
77
83
  # rewrites afterwards; with a shared submodule and no possible mount (bwrap absent or
@@ -90,7 +96,7 @@
90
96
  # CODE_COPIE), then the
91
97
  # section « Ton dossier de travail », which names the session's working directory, where every
92
98
  # temporary file goes (`dossierDeTravail` of enveloppe.mjs, the envelope's TMPDIR), then the
93
- # section « La construction de ton paquet échoue » when it fails. The prompt
99
+ # section « La construction échoue » when it fails. The prompt
94
100
  # carries « TON TICKET : <ticket> », which the role's locks read. The envelope is the sandbox, so
95
101
  # the session runs without permission prompts, under the rights and the context of its role
96
102
  # (scripts/droits.mjs, given the main tree, the copy and the ticket; a reading that fails stops
@@ -189,8 +195,10 @@ if node --input-type=module -e "import { lireEntrees } from '$ici/../integration
189
195
  echo "$refus" >&2
190
196
  exit "$CODE_COPIE"
191
197
  fi
192
- # The output of the session package's build, when it fails.
198
+ # The output of the session's build, when it fails, behind its first line, which says what failed
199
+ # and what was built (`echouer`).
193
200
  echec=$(mktemp)
201
+ echouer() { local sortie; sortie=$(cat "$echec"); printf '%s\n%s\n' "$1" "$sortie" > "$echec"; }
194
202
  (
195
203
  # Each step returns on failure: `set -e` does not act inside a subshell tested by `||`.
196
204
  if [ ! -d "$copie" ]; then
@@ -243,7 +251,18 @@ echec=$(mktemp)
243
251
  # line; none when a path of the plan is no package of the frame (the root, `.`, a folder).
244
252
  noms=$(node --input-type=module -e "import path from 'node:path'; import { lireLaListe } from '$ici/paquets-du-plan.mjs'; import { paquets } from '$ici/../paquets.mjs'; const [r, liste] = process.argv.slice(1); const tous = paquets(r).filter(p => !p.hors); const l = lireLaListe(liste).map(d => tous.find(p => p.dossier === path.normalize(d).replace(/\/\$/, ''))?.pkg.name ?? null); process.stdout.write(l.length && l.every(Boolean) ? l.join('\n') : '');" "$copie" "$paquets") || exit 1
245
253
  if [ -z "$noms" ]; then
246
- (cd "$copie" && monter npx --no-install turbo run build) || exit 1
254
+ # The graph read dry first: Turborepo absent or its configuration refused is a preparation
255
+ # that fails, which stops the launch. Then the whole copy, built as far as it builds
256
+ # (--continue=dependencies-successful): a failure does not stop the launch, it goes into the
257
+ # instruction, as for a plan of packages.
258
+ (cd "$copie" && monter npx --no-install turbo run build --dry=json > /dev/null) || exit 1
259
+ if ! (cd "$copie" && monter npx --no-install turbo run build --continue=dependencies-successful) > "$echec" 2>&1; then
260
+ cat "$echec"
261
+ echo "⚠️ La construction de la copie échoue : la séance s'ouvre, la consigne porte l'erreur."
262
+ echouer "La construction de la copie entière échoue ; ce qui n'attend pas la construction en échec est construit."
263
+ else
264
+ : > "$echec"
265
+ fi
247
266
  else
248
267
  mapfile -t lesNoms <<<"$noms"
249
268
  cibles=() lecteurs=()
@@ -279,6 +298,7 @@ echec=$(mktemp)
279
298
  if ! (cd "$copie" && monter npx --no-install turbo run build ${ids[@]+"${ids[@]}"} "${lecteurs[@]}" --continue=dependencies-successful) > "$echec" 2>&1; then
280
299
  cat "$echec"
281
300
  echo "⚠️ La construction du plan (${lesNoms[*]}) échoue : la séance s'ouvre, la consigne porte l'erreur."
301
+ echouer "La construction des paquets de ton plan échoue ; leurs fournisseurs et ce que leurs tests lisent sans dépendre d'eux sont construits."
282
302
  else
283
303
  : > "$echec"
284
304
  fi
@@ -297,7 +317,7 @@ rm -f "$travail/hors-plan"
297
317
  dossier=$'\n\n'"## Ton dossier de travail"$'\n\n'"Tout fichier temporaire s'écrit dans \`$travail\`, que \`\$TMPDIR\` nomme aussi."
298
318
  construction=
299
319
  if [ -s "$echec" ]; then
300
- construction=$'\n\n'"## La construction de ton paquet échoue"$'\n\n'"Ses fournisseurs et ce que ses tests lisent sans dépendre de lui sont construits ; sa propre construction échoue, et la réparer fait partie de ta tâche. La fin de sa sortie :"$'\n\n```\n'"$(tail -n 100 "$echec")"$'\n```'
320
+ construction=$'\n\n'"## La construction échoue"$'\n\n'"$(head -n 1 "$echec") La réparer fait partie de ta tâche. La fin de sa sortie :"$'\n\n```\n'"$(tail -n +2 "$echec" | tail -n 100)"$'\n```'
301
321
  fi
302
322
  rm -f "$echec"
303
323
  # The prompt, assembled in a file: claude reads it on its standard input, since as an argument it
@@ -8,9 +8,9 @@
8
8
  //
9
9
  // npx grillhouse turbo-des-paquets refuses a turbo.json absent or stale, and a
10
10
  // declaration of a path read or trace refused (below)
11
- // npx grillhouse turbo-des-paquets --ecrire writes the turbo.json of each package, and the
12
- // guards' dependsOn, the typing task and the tests'
13
- // env in the root's
11
+ // npx grillhouse turbo-des-paquets --ecrire writes the guards' dependsOn, the typing task and
12
+ // the tests' env in the root's turbo.json, then the
13
+ // turbo.json of each package, in one pass
14
14
  //
15
15
  // Turborepo's `^build` waits for the build of every internal package a package declares, its
16
16
  // devDependencies included; a package whose tests import a neighbour that depends on it (the
@@ -704,17 +704,12 @@ function gitsAbsents(racine) {
704
704
  return listes.length ? { f: r.f, listes } : null;
705
705
  }
706
706
 
707
- // Writes the turbo.json of each package of <racine>, and in its root's the guards' dependsOn, the
708
- // typing task, the tests' env and the exclusion of a submodule's `.git` beside each input reaching it; returns the
707
+ // Writes in the root's turbo.json of <racine> the guards' dependsOn, the typing task, the tests' env
708
+ // and the exclusion of a submodule's `.git` beside each input reaching it, then the turbo.json of
709
+ // each package, which derive from the root's tasks: one pass reaches the fixed point. Returns the
709
710
  // paths written.
710
711
  export function ecrire(racine) {
711
712
  const ecrits = [];
712
- for (const [f, t] of attendus(racine)) {
713
- const abs = path.join(racine, f);
714
- if (existsSync(abs) && readFileSync(abs, 'utf8') === t) continue;
715
- writeFileSync(abs, t);
716
- ecrits.push(f);
717
- }
718
713
  const racineEcartee = gardesEcartees(racine);
719
714
  if (racineEcartee?.ecarts.length) {
720
715
  let texte = racineEcartee.texte;
@@ -763,6 +758,12 @@ export function ecrire(racine) {
763
758
  writeFileSync(abs, texte);
764
759
  if (!ecrits.includes(gits.f)) ecrits.push(gits.f);
765
760
  }
761
+ for (const [f, t] of attendus(racine)) {
762
+ const abs = path.join(racine, f);
763
+ if (existsSync(abs) && readFileSync(abs, 'utf8') === t) continue;
764
+ writeFileSync(abs, t);
765
+ ecrits.push(f);
766
+ }
766
767
  return ecrits;
767
768
  }
768
769
 
@@ -25,7 +25,9 @@
25
25
  // `vite.config.*`, `vitest.workspace.*`, `tsconfig*.json`; its `setupFiles` and its
26
26
  // `globalSetup`, which Vitest runs beside the graph;
27
27
  // 5. a path its tests declare they read (`grillhouse.lit` of its package.json, from the top):
28
- // a script they run, a file they read, as Bazel's `data`;
28
+ // a script they run, a file they read, as Bazel's `data`, named file by file where the
29
+ // frame rewrites their neighbours (the hooks and configuration of `.beads`, never its
30
+ // journals, `interactions.jsonl`, which each command of bd writes);
29
31
  // 6. a file, changed or removed, that the build of a package it depends on reads (its
30
32
  // `dependencies`, `devDependencies`, `optionalDependencies` and `peerDependencies` that
31
33
  // resolve to a directory of the repository, out of node_modules, transitively): its tests read