@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.
Files changed (42) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/CHANGELOG.md +16 -0
  3. package/docs/ARCHITECTURE.md +9 -3
  4. package/docs/architecture/circuit.md +1 -0
  5. package/docs/architecture/entree.md +1 -1
  6. package/docs/architecture/machine.md +1 -1
  7. package/hooks/crochet.mjs +3 -1
  8. package/package.json +1 -1
  9. package/scripts/activites.mjs +18 -8
  10. package/scripts/attente-a-l-arret.mjs +7 -8
  11. package/scripts/attente-au-tour.mjs +2 -2
  12. package/scripts/bilan.mjs +39 -61
  13. package/scripts/cadre.mjs +25 -6
  14. package/scripts/circuit.mjs +28 -4
  15. package/scripts/commande-du-plan.mjs +15 -0
  16. package/scripts/crochet.mjs +1 -0
  17. package/scripts/dette.mjs +84 -7
  18. package/scripts/direct.mjs +64 -5
  19. package/scripts/droits.mjs +13 -7
  20. package/scripts/engendres.mjs +32 -0
  21. package/scripts/enveloppe/travail-de-la-copie.mjs +6 -1
  22. package/scripts/etapes.mjs +8 -0
  23. package/scripts/integration/file.mjs +25 -24
  24. package/scripts/integration/integrer.mjs +31 -30
  25. package/scripts/integration/rejeu.mjs +4 -4
  26. package/scripts/langages/cargo/sccache.mjs +42 -6
  27. package/scripts/langages/typescript/titres-de-tests.mjs +27 -10
  28. package/scripts/ligne-etat/defaut.sh +2 -1
  29. package/scripts/ligne-etat/ligne-etat.mjs +1 -0
  30. package/scripts/messages-non-lus.mjs +2 -4
  31. package/scripts/newday.mjs +2 -2
  32. package/scripts/registre.mjs +14 -16
  33. package/scripts/reponses-du-circuit.mjs +5 -0
  34. package/scripts/resultats.mjs +11 -2
  35. package/scripts/session-start.sh +33 -46
  36. package/scripts/sigle-du-projet.mjs +1 -2
  37. package/scripts/structure-guard.sh +2 -1
  38. package/scripts/suiveur.mjs +1 -1
  39. package/scripts/superviseur.mjs +36 -55
  40. package/scripts/tableau.mjs +78 -121
  41. package/skills/explorateur/SKILL.md +5 -1
  42. package/types/index.d.ts +3 -0
@@ -5,5 +5,5 @@
5
5
  "author": {
6
6
  "name": "Romain Peyrichou"
7
7
  },
8
- "version": "0.50.0"
8
+ "version": "0.50.2"
9
9
  }
package/CHANGELOG.md CHANGED
@@ -6,6 +6,22 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.50.2] - 2026-11-25
10
+
11
+ - **A generated file the lot feeds is played again before the tests that read it** (grillhouse-3uv.245): before the proof of the red, the checks and the final pass, the circuit plays in the copy the command of each entry of `grillhouse.engendres` whose `lit` covers a file the lot changes, its files entering the lot as those of 4.2, so a ticket that adds cases no longer turns red on the test that reads their sums. **Action for projects**: none.
12
+ - **The circuit's regeneration of the debt no longer inscribes new findings, and carries the debt of a moved file** (grillhouse-3uv.223): at 4.2 the circuit inscribed as the debt of a guard the lot adds the new findings of a guard the project already had (synthhub, `constructeur-appele`), and a lot that moved a test file entered main with its debt still under the former path, which the CI of main then found red (BPScript). The regeneration now only lowers the debt and moves the key of a file the lot renames. **Action for projects**: none.
13
+ - **A lot that adds or renames a dependency enters main** (grillhouse-3uv.248): the integration installed its copy with main's lock file before writing it again from the lot's manifests, so `npm ci` refused every such lot (« Missing: … from lock file », seen by SynthHub). The integration and the queue now play the command that writes `package-lock.json` before the install, the other generated files after it. **Action for projects**: none.
14
+ - **A plan whose command calls git is refused at the plan** (grillhouse-3uv.240): the command of a mechanical ticket runs at 1.1 in the envelope, which mounts the git directory of the copy read-only, so `git mv` failed on `index.lock` (BPScript). The sheet of the plan and the answer `--mecanique` now refuse a command that calls git, naming the equivalent (`mv` for `git mv`, `rm` for `git rm`; the commit of the circuit records the tree, where git detects the rename), and the explorer's skill says so. **Action for projects**: none.
15
+ - **The sccache server starts in the envelope of a copy with a long path** (grillhouse-3uv.239): cargo's sccache client now runs under a short temporary directory, so a server it starts binds its socket under the 108 bytes of a socket's path (« path must be shorter than SUN_LEN », seen by OSD in its agents' checks). **Action for projects**: none.
16
+
17
+ ## [0.50.1] - 2026-11-24
18
+
19
+ - **The copy of the plugin into the package leaves out what git ignores** (grillhouse-3uv.243): an entry of `mods/grillhouse` that git ignores (a cache a tool of the plugin's package writes, `.cache-outils/`) no longer enters the published package nor the list its tests check. **Action for projects**: none.
20
+
21
+ - **The direct command survives a copy already locked and hands an advance conflict to its agent** (grillhouse-3uv.242): it reads the lock of the copy on `git worktree list --porcelain` instead of the English message of git, so a resumption no longer stops on « est déjà verrouillé » under a French git; and the copy moves onto main before the agent's session, the files its work meets in conflict named in the agent's instruction, instead of stopping and leaving them to the supervisor, whom the lock keeps from writing code. **Action for projects**: none.
22
+
23
+ - **The sessions of the agents play in Code Mode** (grillhouse-3uv.241): decided by the owner (2026-11-24). The settings of every role set `CLAUDE_CODE_EXPERIMENTAL_CODE_MODE` in their `env` block, in and out of the envelope, so the agents call their tools from the REPL; the role's hooks and permissions still apply to them, and the sheet still comes out. **Action for projects**: none.
24
+
9
25
  ## [0.50.0] - 2026-11-24
10
26
 
11
27
  - **The typed lint runs after the build of its package**: the task `lint` depends on `build` and `^build`, like `typecheck`, in the frame's `turbo.json` and in the templates of a project's; it no longer reads types from a `dist/` being written, which turned a type to `any` and made the final pass red at random. **Action for projects**: none.
@@ -380,7 +380,11 @@ finale, qui mesure le dépôt entier, hors de toute enveloppe) et régénèrent
380
380
  ajoute, absente des gardes de main (le circuit les nomme à la passe par `GRILLHOUSE_GARDES_DE_LA_BASE`) :
381
381
  chaque fichier et règle de ses constats est une note `a-inscrire`, au compte trouvé, que la
382
382
  régénération inscrit en section entière et écrit au ticket (garde, fichier, règle, compte). Une garde
383
- de main n'en émet jamais. Un plafond ne monte jamais : un lot qui dépasse celui d'une garde de main
383
+ de main n'en émet jamais : elle l'est par son nom dans cette liste, ou, pour la garde d'un projet que
384
+ la liste ne nomme pas, par son script que HEAD détient. La même régénération porte la dette d'un
385
+ fichier que le lot déplace sous son nouveau chemin (les renommages que git détecte sur le lot tel que
386
+ le circuit le commite) ; la garde des titres de tests refuse, par une note `a-deplacer`, une dette
387
+ restée sous l'ancien chemin. Un plafond ne monte jamais : un lot qui dépasse celui d'une garde de main
384
388
  reste rouge. Ainsi aucun fichier engendré n'attend une main (BP 320.9 : 292 min autour des
385
389
  références, dont 163 d'attente).
386
390
 
@@ -410,8 +414,10 @@ un arrêt `references` sur « le plafond ne monte pas »).
410
414
  sur l'arbre fusionné, et `npm install` le `package-lock.json` après une fusion, l'intégration
411
415
  n'applique pas du lot un fichier qu'une référence écrit en entier (`entiers` : l'index des
412
416
  interfaces, les `turbo.json` des paquets) ; elle rejoue la référence qui l'écrit dans la copie
413
- d'intégration, sur main à jour, après l'installation et avant la vérification, et ce qu'elle écrit
414
- entre dans le commit. Le circuit lui passe les références du cadre (`--references`), tirées de
417
+ d'intégration, sur main à jour, avant la vérification, et ce qu'elle écrit entre dans le commit ;
418
+ la référence du verrou des dépendances (`package-lock.json`) se joue avant l'installation, qui suit
419
+ le verrou régénéré des manifestes du lot (Renovate, la file de fusion), les autres après
420
+ l'installation. Le circuit lui passe les références du cadre (`--references`), tirées de
415
421
  sa seule liste. L'avance d'une copie sur main suit la même règle pour ces références, sans clé du
416
422
  projet : la version de main, puis le générateur du cadre sur le travail appliqué
417
423
  (`scripts/enveloppe/travail-de-la-copie.mjs` ; BPScript, 2026-11-22, l'index des interfaces en
@@ -354,6 +354,7 @@ Un geste est ce que le circuit fait seul sur un cas qu'une règle tranche ; chac
354
354
  | renvoi après `RENDU` | un constat bloquant va au rôle qu'il nomme | la boucle des relectures |
355
355
  | rien à livrer | un auteur qui ne change rien quand les contrôles sont verts passe aux contrôles | l'arrêt `sans-livraison` quand un rouge reste |
356
356
  | régénération | un rouge qui est celui d'une référence déclarée ou engendrée va à 4.2 | une fois par arbre |
357
+ | rejeu des engendrés | avant la preuve du rouge, les contrôles et la passe finale, la commande de chaque fichier engendré (`grillhouse.engendres`) dont un motif `lit` couvre un fichier que le lot change se joue dans la copie, comme 4.2 : ses fichiers entrent au lot (Bazel, Nx, Turborepo : une sortie se construit avant les tests qui la lisent) | à chaque passe ; une commande qui échoue arrête à `references` |
357
358
  | conflit de l'avance | l'avance de la copie sur main laisse des fichiers en conflit : ils vont au rôle qui les écrit | une séance par rôle, puis `lancement` |
358
359
  | extension du plan | une écriture dans un fichier que le ticket nomme, un composant écarté qui rougit, les tests d'un paquet lecteur que le lot fait rougir : le plan s'étend, la pièce écrite au ticket | les paquets que le ticket ou le relevé du plan nomment |
359
360
  | arrêt d'un ticket fermé hors de son circuit | la file des tickets arrête le circuit d'un ticket que Beads dit fermé | une fois |
@@ -185,7 +185,7 @@ sequenceDiagram
185
185
  F->>F: déclenche puis lit la CI de main
186
186
  ```
187
187
 
188
- Le circuit porte les étapes qui mènent un lot jusqu'à la file, et leur ordre (document du circuit, §5.3) ; la file porte ce qui suit. Une branche qui ne se repose pas (des fichiers en conflit hors des fichiers engendrés) sort de la file, son ticket rouvert, les fichiers nommés, l'issue portant `conflit` ; une branche sans rien en avance sur main sort sans être rouverte ; une copie qui ne se prépare pas garde la branche en file, l'issue `en-file`. Un fichier engendré que le projet déclare (`grillhouse.engendres`) ne se fusionne jamais : en conflit, la version de main est prise, puis sa commande le réécrit sur la branche reposée, et le rejugement couvre ce qu'elle écrit. Un acte qui échoue rend l'issue `echec` et sa raison, et la file passe à l'entrée suivante ; quand l'échec suit l'avance de main, la raison dit que le main local porte le lot, non poussé, et que la reprise du circuit le repasse par la file, qui le ferme et le pousse. Une fermeture que Beads refuse laisse le lot sur main, le ticket ouvert et l'issue `echec` ; la file des tickets ne relance jamais un ticket dont le lot est sur main.
188
+ Le circuit porte les étapes qui mènent un lot jusqu'à la file, et leur ordre (document du circuit, §5.3) ; la file porte ce qui suit. Une branche qui ne se repose pas (des fichiers en conflit hors des fichiers engendrés) sort de la file, son ticket rouvert, les fichiers nommés, l'issue portant `conflit` ; une branche sans rien en avance sur main sort sans être rouverte ; une copie qui ne se prépare pas garde la branche en file, l'issue `en-file`. Un fichier engendré que le projet déclare (`grillhouse.engendres`) ne se fusionne jamais : en conflit, la version de main est prise, puis sa commande le réécrit sur la branche reposée, et le rejugement couvre ce qu'elle écrit. À l'acte du commit comme dans la file, la commande d'un fichier engendré qui écrit `package-lock.json` se joue depuis les manifestes du lot posé sur main avant l'installation de la copie (`npm ci`), les autres après elle : un lot qui ajoute ou renomme une dépendance s'installe, et une commande lit ce que l'installation a posé. Un acte qui échoue rend l'issue `echec` et sa raison, et la file passe à l'entrée suivante ; quand l'échec suit l'avance de main, la raison dit que le main local porte le lot, non poussé, et que la reprise du circuit le repasse par la file, qui le ferme et le pousse. Une fermeture que Beads refuse laisse le lot sur main, le ticket ouvert et l'issue `echec` ; la file des tickets ne relance jamais un ticket dont le lot est sur main.
189
189
 
190
190
  Une poussée que `origin` refuse est écrite au ticket et n'arrête pas la file. Un lot que la voie de secours mène passe par la même garde : sa vérification a inscrit l'arbre (document du circuit, §5.8).
191
191
 
@@ -94,7 +94,7 @@ Chaque séance de rôle reçoit ses options d'une seule source, la liste des rô
94
94
 
95
95
  Toute séance de rôle reçoit, en plus :
96
96
 
97
- - **les sources de réglages du projet seules** (`--setting-sources project,local`), la charte personnelle de l'utilisateur exclue par son chemin (`claudeMdExcludes`) et absente de l'enveloppe ; la mémoire automatique, les compétences intégrées de Claude Code, les compétences propres du projet et les greffons autres que celui du cadre coupés ; les tâches de fond coupées, si bien qu'une séance finit avec sa fiche ;
97
+ - **les sources de réglages du projet seules** (`--setting-sources project,local`), la charte personnelle de l'utilisateur exclue par son chemin (`claudeMdExcludes`) et absente de l'enveloppe ; la mémoire automatique, les compétences intégrées de Claude Code, les compétences propres du projet et les greffons autres que celui du cadre coupés ; les tâches de fond coupées, si bien qu'une séance finit avec sa fiche ; le mode code de Claude Code (le REPL) activé par le bloc `env` des réglages, que `claude -p` ne prend que là : les crochets et les permissions du rôle s'appliquent aux outils que le REPL appelle, et la fiche sort comme avant ;
98
98
  - **ses permissions** : les commandes que sa compétence nomme, la lecture de sa compétence et du métacadre dans le greffon installé ; refusés, le changement de son auteur au ticket, et pour un rôle qui n'écrit pas au ticket toute écriture de `bd` ;
99
99
  - **pour un rôle qui écrit**, refusés de plus l'édition par script (`python`, `sed -i`, `perl -i`), l'outil de test lancé directement, que le module du langage nomme, et la relecture de son propre ticket, que sa consigne porte ; ses deux verrous en crochets `PreToolUse` ;
100
100
  - **ses outils** (`--tools`) : la lecture, l'écriture pour un rôle qui écrit, la recherche d'outils pour un rôle à index ; **ses serveurs** (`--strict-mcp-config`) : ceux de l'index, codegraph et rtfm, lus dans le `.mcp.json` du projet et les greffons qu'il active, aucun autre.
package/hooks/crochet.mjs CHANGED
@@ -4,6 +4,7 @@
4
4
  // node "${CLAUDE_PLUGIN_ROOT}/hooks/crochet.mjs" <sous-commande>
5
5
  //
6
6
  // with Node alone, before any installation, as Husky's hooks run before the project's tools.
7
+ // Mechanism: greffon.md, §2 (choices 1 and 6) and §3.1.
7
8
  //
8
9
  // - The project is `CLAUDE_PROJECT_DIR`, else the working directory; its command is
9
10
  // `node_modules/.bin/grillhouse`, which the project's `npm install` links (the package
@@ -11,7 +12,8 @@
11
12
  // tree's (the parent of `git rev-parse --git-common-dir`) and runs with the worktree as its
12
13
  // working directory: the code that judges is not the code of the copy it judges.
13
14
  // - The common charter reaches each session, a subagent's included, by the import of the
14
- // project's CLAUDE.md, from the package installed, which Claude Code loads whole; no hook writes it, since Claude Code caps a hook's output (10,000 characters).
15
+ // project's CLAUDE.md, from the package installed, which Claude Code loads whole; no hook writes
16
+ // it, since Claude Code caps a hook's output (10,000 characters).
15
17
  // - Each subcommand runs `grillhouse <sous-commande>`; without the command, `session-start` writes
16
18
  // a section that says to run `npm install`, and any other subcommand exits 0 and writes nothing.
17
19
  // - The command receives the hook's input on its standard input, writes on the hook's outputs, and
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@roomi-fields/grillhouse",
3
- "version": "0.50.0",
3
+ "version": "0.50.2",
4
4
  "description": "Roomi's Grillhouse: the frame's scripts, called by one command, grillhouse <sous-commande>",
5
5
  "keywords": [
6
6
  "claude-code",
@@ -337,7 +337,8 @@ export async function relire(
337
337
  valider: f =>
338
338
  [
339
339
  conformiteDuLot(f, { ...liste, references: differences.map(d => d.fichier) }),
340
- suiviDesConstats(f, ouvertsALaRelecture)]
340
+ suiviDesConstats(f, ouvertsALaRelecture),
341
+ ]
341
342
  .filter(Boolean)
342
343
  .join(' ; ') || null,
343
344
  });
@@ -843,6 +844,20 @@ export function regenerer(
843
844
  };
844
845
  }
845
846
 
847
+ // The generated files the project declares that the lot reads through (`lit`) a file it changes,
848
+ // played again in the copy before any pass that plays the lot's tests (the proof, the checks, the
849
+ // final pass), as a build graph (Bazel, Nx, Turborepo) builds an output before the tests that read
850
+ // it: the regeneration of 4.2 (`regenerer`) on those references alone, their files entering the
851
+ // lot as its. Null when the lot changes nothing they read; else the regeneration's outcome. It
852
+ // throws the stop « references » of `regenerer` when a command fails.
853
+ export function rejouerLesEngendres(ctx) {
854
+ const changes = changements(ctx).map(c => c.fichier);
855
+ const noms = (ctx.engendres ?? [])
856
+ .filter(e => changes.some(f => couvertPar(e.lit, f)))
857
+ .map(e => e.nom);
858
+ return noms.length ? regenerer(ctx, { noms, avant: leLotGarde(ctx).lot }) : null;
859
+ }
860
+
846
861
  // The copy of <ctx> restored to the commit <commit> of a lot kept: each file that differs between
847
862
  // that commit and the copy as it stands (`arbreDeLaCopie`, its files git does not track included)
848
863
  // takes its version there, or goes when the commit does not hold it. A copy that is that lot changes
@@ -1873,10 +1888,7 @@ export function preuve(ctx, { mesure: derniere = null, fichiers: duRouge = null
1873
1888
  : fichiers.length || rouges.length || misDeCote.length
1874
1889
  ? []
1875
1890
  : inchange
1876
- ? [
1877
- 'Aucun fichier de test du lot : le plan dit « tests-adaptés », rien à prouver.',
1878
- '',
1879
- ]
1891
+ ? ['Aucun fichier de test du lot : le plan dit « tests-adaptés », rien à prouver.', '']
1880
1892
  : ['Aucun fichier de test du lot dans le plan : rien ne prouve le rouge.', '']),
1881
1893
  ...section('Rouges', rouges),
1882
1894
  ...sections,
@@ -2250,9 +2262,7 @@ export function controles(ctx, finale, restreinte = null, reportes = null, fichi
2250
2262
  // red lies in a test file (not yet extended to its tests): the plan extends to those test files
2251
2263
  // alone, and its reds go on as the plan's. One red in its code, or in a task of the package (a
2252
2264
  // build, a typing), keeps the package out of the plan: the circuit does not guess the repair.
2253
- const testsLecteurs = [
2254
- ...new Set(lus.filter(r => r.lecteur && r.test).map(r => r.lecteur)),
2255
- ]
2265
+ const testsLecteurs = [...new Set(lus.filter(r => r.lecteur && r.test).map(r => r.lecteur))]
2256
2266
  .filter(d => lus.filter(r => r.lecteur === d).every(r => r.test))
2257
2267
  .sort();
2258
2268
  const tous = lus.map(r =>
@@ -1,9 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  // The stop of the session of supervision: the hook Stop of the frame's plugin runs it
3
- // (`grillhouse attente-a-l-arret`) when the session ends its turn, to wait for the owner. As an
4
- // alert not acknowledged pages again (PagerDuty), the supervisor does not go to sleep while a
5
- // circuit waits for it (grillhouse-d4n.9: bf5 stopped on a question at 17:06, read 40 min later,
6
- // on the owner's word). It asks for no wait: the greffon pushes the questions of the circuits.
3
+ // (`grillhouse attente-a-l-arret`) when the session ends its turn: the supervisor does not end its
4
+ // turn while a circuit waits for it, as an alert not acknowledged pages again (PagerDuty). It asks
5
+ // for no wait: the greffon pushes the questions of the circuits (greffon.md, §5.1).
7
6
  //
8
7
  // - Stop runs for the session itself, never for a sub-agent (SubagentStop). The session is the
9
8
  // supervisor's as for the signal of the turn (`racineDeLaSupervision` of
@@ -13,10 +12,10 @@
13
12
  // scripts/superviseur.mjs, a circuit ended without its issue included): the stop is blocked
14
13
  // with each question, its ticket, its step and the command that answers it.
15
14
  // - Each question blocks once, by its key: it is noted in `.claude/worktrees/signale-a-l-arret.json`,
16
- // which keeps the questions that still wait alone (an older note that holds a `etat` reads
17
- // without error, the state dropped), so that a stop the supervisor decides (a question
18
- // carried to the owner) is never held in a loop (`stop_hook_active` is not read; Claude Code
19
- // caps the blocks in a row at eight in any case, hooks.md « Stop »).
15
+ // which keeps the questions that still wait alone (a note that holds an `etat` reads without
16
+ // error, the state dropped), so that a stop the supervisor decides (a question carried to the
17
+ // owner) is never held in a loop (`stop_hook_active` is not read; Claude Code caps the blocks
18
+ // in a row at eight in any case, hooks.md « Stop »).
20
19
  // - The block: the reason on the error stream, exit code 2, which Claude Code gives the session as
21
20
  // its next instruction (hooks.md, « Exit code 2 behavior per event »).
22
21
  // - A server that does not answer, a note that cannot be written, an input that is no JSON: the
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  // The signal of the supervisor's turn: the hook UserPromptSubmit of the mod runs it at each turn
3
3
  // of a session of supervision (`npx grillhouse attente-au-tour`), and what it writes reaches the
4
- // session. A question of a circuit must never stay mute, as a review requested on GitHub is named
5
- // again until it is answered.
4
+ // session. A question of a circuit is named again until it is answered, as a review requested on
5
+ // GitHub is. Mechanism: greffon.md, §5.1.
6
6
  //
7
7
  // - It names each circuit that waits for the supervisor (`questionsEnAttente`, the one source of
8
8
  // the opening and of the greffon's reading), a circuit ended without its issue included: its
package/scripts/bilan.mjs CHANGED
@@ -9,79 +9,57 @@
9
9
  // prints the bilan of <ticket>, read from the main tree of the current directory; `--garder` keeps
10
10
  // it too, as the circuit does, so the next ticket's bilan names it as its base.
11
11
  //
12
- // - Its sources are structured results, never a text (tests/unit/circuit-sans-texte-libre.spec.ts):
13
- // the register of finished agents (`~/.claude/grillhouse/registre.jsonl`, GRILLHOUSE_REGISTRE
14
- // replaces it), each agent's latest line on the ticket (its project the main tree, or a folder
15
- // of it), its turns, its tokens, its cache reads and its cost, and the lines of the role
16
- // `circuit` of the steps the circuit leads itself; the results the circuit keeps,
17
- // `.claude/worktrees/<ticket>.fiches.jsonl`, each with its time: the launch of each session the
18
- // circuit opens or resumes (`lancement`: its role and its session id, the register line's
19
- // `agent`), the sheet of each session (`{ role, fiche }`), the outcome of each proof
20
- // (`resultat`: `ok`, its counts, `vide`) and of each check (`resultat`: `issue` vert, rouge or a-repasser, `finale`, its reds `rouges`), each
21
- // stop (`arret`, its name, `finale`, the outcome of the checks it stops), each developpeur session that changed no file of the plan (`inchange`), the
22
- // end of the questioning of the plan (`questionnement`: its `objet`, the questions the
23
- // questionneur asked, `questions`, whether an answer changed the plan, `change`, its `issue`,
24
- // AUCUNE, QUESTIONS or DÉSACCORD, and the questions left open, `ouvertes`), the end of the tri
25
- // of the discoveries (`tri`: the discoveries it read, `decouvertes`, whether its sheet
26
- // conformed, `conforme`, its verdicts by kind, `verdicts`; its sessions, the launches of object
27
- // `tri`), each end of a run on
28
- // a stop (`montee`: its code, its stop and the supervisor's session that ran it, `superviseur`);
29
- // where the circuit ended (`{ etape, raison, code }`), which the end of the circuit gives its
30
- // bilan (the effect `bilan`, scripts/effets.mjs) and the command reads from the Temporal server;
31
- // the night the project declares in its package.json (`grillhouse.plageDeNuit`); the transcript
32
- // of each supervisor's session a stop names (`~/.claude/projects/<projet>/<séance>.jsonl`), of
33
- // which the origin and the time of each message, as ccusage measures from the transcripts. It
34
- // reads no comment of the ticket. Every agent declares nothing: the bilan measures.
35
- // - The steps and the roles are those of scripts/etapes.mjs; a register line's role is read as the
36
- // board reads it (`roleDeLAgent`: bare, or scoped by the frame's plugin, `grillhouse:<rôle>`, as
37
- // the register writes it). Only the circuit's roles count, the
38
- // explorateur of the plan among them. Only the sessions the circuit launched count in
39
- // the window, the categories, the tokens and the cost; a session of a circuit's role on the
40
- // ticket the circuit did not launch, the supervisor's, counts apart (`seances.horsCircuit`: its
41
- // number, by role, its cost).
42
- // - The window: from the first turn of a session or a step to the last result of the circuit or
43
- // the last turn; its length is the wall time.
12
+ // - Its sources are structured results, never a text (tests/unit/circuit-sans-texte-libre.spec.ts),
13
+ // and no comment of the ticket: the register of finished agents (`~/.claude/grillhouse/
14
+ // registre.jsonl`, GRILLHOUSE_REGISTRE replaces it), each agent's latest line on the ticket
15
+ // (turns, tokens, cache reads, cost) and the lines of the role `circuit`; the results the circuit
16
+ // keeps, `.claude/worktrees/<ticket>.fiches.jsonl`, each with its time (`lancement`, the sheet
17
+ // `{ role, fiche }`, `resultat` of a proof or of a check, `arret`, `inchange`, `questionnement`,
18
+ // `tri`, `montee`), and where the circuit ended (`{ etape, raison, code }`, given by the effect
19
+ // `bilan` of scripts/effets.mjs and read from the Temporal server by the command); the night
20
+ // the project declares (`grillhouse.plageDeNuit`); the transcript of each supervisor's session
21
+ // a stop names (`~/.claude/projects/<projet>/<séance>.jsonl`), for the origin and the time of
22
+ // each message.
23
+ // - The steps and the roles are those of scripts/etapes.mjs; a register line's role is read as
24
+ // the board reads it (`roleDeLAgent`: bare, or scoped `grillhouse:<rôle>`). Only the circuit's
25
+ // roles count; only the sessions the circuit launched count in the window, the categories, the
26
+ // tokens and the cost; a session of a circuit's role the circuit did not launch counts apart
27
+ // (`seances.horsCircuit`: its number, by role, its cost).
28
+ // - The window runs from the first turn of a session or a step to the last result of the circuit
29
+ // or the last turn; its length is the wall time. A step `controles` whose outcome or stop is
30
+ // the final pass's (`finale`) is the final pass.
44
31
  // - Each turn of a session and each step finds its result: a step, the last outcome or stop of
45
32
  // its step kept during it, before the next step of its name; a session, the first sheet of its
46
- // role kept after its turn, before the next turn of any other. Every step is one for the whole ticket. A step `controles` whose
47
- // outcome or stop is the final pass's (`finale`) is the final pass.
33
+ // role kept after its turn, before the next turn of any other.
48
34
  // - The categories, each instant once:
49
35
  // - travail resté au lot: a session that delivered, the reviewer's included;
50
- // - relance sans effet: a developer whose session changed no file of the plan (`inchange`, which
51
- // the circuit measures), whatever stop follows it; a testwriter whose next
52
- // proof finds the lot of the proof before it (the same counts of reds, greens of the lot,
53
- // broken files and greens of HEAD), after a refused proof, or no file of the lot (`vide`:
54
- // reds that exist already or of a build alone, no green of the lot); that proof; checks that
55
- // play the same measure again (their outcome and their reds) with no delivery of the testwriter or the developpeur since the
56
- // checks of their kind before (the final pass: since the final pass before);
57
- // - questionnement: a session of the questionneur (kept: a look that did not write the plan, as
58
- // a review);
59
- // - attente du superviseur, attente du responsable, nuit: as the lead time of DORA separates the
60
- // wait for review from the work, each wait runs from an end of a run on a stop (`montee`) to
61
- // the first turn of a session or step after it, or the next result of the circuit, the first
62
- // of the two; it is the owner's when he wrote during it, a message of the person
63
- // (`origin.kind` « human ») in the supervisor's session the stop names; else the supervisor's;
64
- // but its part in the night: the hours of
65
- // `grillhouse.plageDeNuit` in the project's package.json (`{ debut, fin }`, in local time), from 23 h to 8 h without it;
36
+ // - relance sans effet: a developer whose session changed no file of the plan (`inchange`); a
37
+ // testwriter whose next proof finds the lot of the proof before it (same counts of reds,
38
+ // greens of the lot, broken files, greens of HEAD) or no file of the lot (`vide`), and that
39
+ // proof; checks that play the same measure again with no delivery since the checks of their
40
+ // kind before (the final pass: since the final pass before);
41
+ // - questionnement: a session of the questionneur;
42
+ // - attente du superviseur, attente du responsable, nuit: each wait runs from an end of a run on
43
+ // a stop (`montee`) to the first turn of a session or step after it, or the next result of the
44
+ // circuit; it is the owner's when a message of the person (`origin.kind` « human ») came in
45
+ // the supervisor's session the stop names, else the supervisor's; its part in the night is
46
+ // the hours of `grillhouse.plageDeNuit` (`{ debut, fin }`, local time), 23 h to 8 h without it;
66
47
  // - étapes automatiques: the other steps the circuit leads, but the final passes;
67
48
  // - passes finales: the final passes, but those without effect or replayed;
68
- // - rejeu d'étapes déjà vertes: the same, on a lot unchanged since green: checks green again,
69
- // a testwriter run again on a proven lot, its proof;
49
+ // - rejeu d'étapes déjà vertes: the same, on a lot unchanged since green;
70
50
  // - entre deux étapes: the rest of the window.
71
51
  // What is lost is the wall time out of the work, the questioning, the automatic steps and the
72
52
  // final passes. The text gives the wall time and the wall time out of the night spent waiting
73
53
  // (« hors nuit d'attente »: a night at work stays in it), the time lost and the time lost out of
74
54
  // the waits.
75
- // - The bilan counts the sessions by role, the steps by their titles, the stops by kind (`arret`),
76
- // the ends on a stop (the waits), the questions of the plan asked, the plans they changed and the
77
- // questions left open, the tri of the discoveries on a line of its own when there was one (its
78
- // sessions, its discoveries and its verdicts, or its sheet that did not conform), the tokens,
79
- // the cache reads and the cost (a session without a cost
80
- // counts 0); a session's tokens go to its turns by their time.
55
+ // - It counts the sessions by role, the steps by title, the stops by kind (`arret`), the waits,
56
+ // the questions of the plan asked, the plans they changed and the questions left open, the tri
57
+ // of the discoveries on a line of its own, the tokens, the cache reads and the cost (a session
58
+ // without a cost counts 0); a session's tokens go to its turns by their time.
81
59
  // - It is kept in the main tree, `.claude/worktrees/<ticket>.bilan.json`, and compares itself with
82
- // the latest other ticket of the project whose bilan is kept, its bilan computed again by this
83
- // version from its sources (`precedent`), or with nothing when they give none: no figure kept by
84
- // an earlier version, and none of another project, is written here.
60
+ // the latest other ticket of the project whose bilan is kept, recomputed by this version from
61
+ // its sources (`precedent`), or with nothing when none is: no figure kept by an earlier version,
62
+ // and none of another project, is written here.
85
63
  import { spawnSync } from 'node:child_process';
86
64
  import {
87
65
  closeSync,
package/scripts/cadre.mjs CHANGED
@@ -18,7 +18,8 @@
18
18
  // repository, two levels above the package. CADRE is the root the template is read from:
19
19
  // `cadre/` of the installed package, else the repository. So the package reads the same files
20
20
  // wherever it is installed, and the repository keeps one address for each.
21
- // - The copy of the plugin, ELEMENTS_DU_GREFFON, is each entry of `mods/grillhouse/` but its tests
21
+ // - The copy of the plugin, ELEMENTS_DU_GREFFON, is each entry of `mods/grillhouse/` that git does
22
+ // not ignore, but its tests
22
23
  // (`tests/`), its configuration of TypeScript (`tsconfig.json`) and what makes it a package of the
23
24
  // workspace (`package.json`, `turbo.json`, `.turbo`, `node_modules`), at the package's root,
24
25
  // beside the package's own entries, PROPRES_DU_PAQUET; an entry of the plugin of the same name
@@ -27,6 +28,7 @@
27
28
  // carries none.
28
29
  // - VERSION is the `version` of the package's package.json, the one version of the package and its
29
30
  // plugin.
31
+ import { spawnSync } from 'node:child_process';
30
32
  import { cpSync, existsSync, readdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
31
33
  import path from 'node:path';
32
34
  import { pathToFileURL } from 'node:url';
@@ -66,12 +68,29 @@ export const HORS_DU_GREFFON = [
66
68
  'node_modules',
67
69
  ];
68
70
 
71
+ /**
72
+ * The entries of a plugin's source directory the package copies: each one but HORS_DU_GREFFON and
73
+ * what git ignores (a cache a tool wrote there), as `npm pack` leaves out what .gitignore names.
74
+ */
75
+ export function elementsDuGreffon(source) {
76
+ if (!existsSync(source)) {
77
+ return [];
78
+ }
79
+ const entrees = readdirSync(source).filter(e => !HORS_DU_GREFFON.includes(e));
80
+ if (entrees.length === 0) {
81
+ return [];
82
+ }
83
+ const { stdout } = spawnSync('git', ['check-ignore', '-z', '--stdin'], {
84
+ cwd: source,
85
+ input: entrees.join('\0'),
86
+ encoding: 'utf8',
87
+ });
88
+ const ignorees = new Set(stdout.split('\0').filter(Boolean));
89
+ return entrees.filter(e => !ignorees.has(e)).sort();
90
+ }
91
+
69
92
  /** The entries of the plugin, which `--empaqueter` copies at the package's root. */
70
- export const ELEMENTS_DU_GREFFON = existsSync(SOURCE_DU_GREFFON)
71
- ? readdirSync(SOURCE_DU_GREFFON)
72
- .filter(e => !HORS_DU_GREFFON.includes(e))
73
- .sort()
74
- : [];
93
+ export const ELEMENTS_DU_GREFFON = elementsDuGreffon(SOURCE_DU_GREFFON);
75
94
 
76
95
  /** The root of the frame's files: the package's copy when installed, else the repository. */
77
96
  export const CADRE = INSTALLE ? COPIE : DEPOT;
@@ -132,6 +132,7 @@ import {
132
132
  } from './etapes.mjs';
133
133
  import {
134
134
  CONTROLES,
135
+ PREUVE,
135
136
  correctionsDuPlan,
136
137
  ouvertesDuPlan,
137
138
  pasDuPlan,
@@ -160,6 +161,7 @@ import {
160
161
  preuve,
161
162
  referencesDesRouges,
162
163
  regenerer,
164
+ rejouerLesEngendres,
163
165
  relire,
164
166
  sansTests,
165
167
  testsDuLot,
@@ -416,7 +418,7 @@ const fichiersRougesDe = (rouges, dossier) => [
416
418
  rouges
417
419
  .flatMap(r => [r.fichier, ...String(r.texte ?? '').split(' ')])
418
420
  .filter(t => typeof t === 'string' && t.startsWith(`${dossier}/`))
419
- .map(t => t.split(':')[0]),
421
+ .map(t => t.split(':')[0])
420
422
  ),
421
423
  ];
422
424
 
@@ -592,6 +594,22 @@ function inscrireEtape(ctx, { etape, debut }) {
592
594
  // prepared on the tip of main before each of them.
593
595
  export const SUR_LA_POINTE = new Set([CONTROLES]);
594
596
 
597
+ // The generated files the lot feeds, played again before a pass that plays its tests
598
+ // (`rejouerLesEngendres`): `{}`, or `{ arret }`, the stop « references » of a command that fails.
599
+ function rejeuDesEngendres(ctx) {
600
+ try {
601
+ if (rejouerLesEngendres(ctx)) {
602
+ geste(ctx, 'rejeu-des-engendres');
603
+ }
604
+ return {};
605
+ } catch (e) {
606
+ if (!(e instanceof Arret)) {
607
+ throw e;
608
+ }
609
+ return { arret: { nom: e.nom, rapport: e.rapport, piece: e.piece, question: e.question } };
610
+ }
611
+ }
612
+
595
613
  // What the circuit does before the step <etape>, whose regeneration before it is <regeneration>
596
614
  // (`ctx.regeneration`), as a merge queue plays its checks on the branch set on the tip of main: at a
597
615
  // step of SUR_LA_POINTE, the copy prepared by the launcher's own preparation
@@ -610,7 +628,9 @@ export function avantLaPasse(
610
628
  { estUnTest = rouleDeTest(ctx) } = {}
611
629
  ) {
612
630
  if (!SUR_LA_POINTE.has(etape)) {
613
- return { avancee: false, regeneration };
631
+ return etape === PREUVE
632
+ ? { avancee: false, regeneration, ...rejeuDesEngendres(ctx) }
633
+ : { avancee: false, regeneration };
614
634
  }
615
635
  const tete = dossier =>
616
636
  spawnSync('git', ['-C', dossier, 'rev-parse', 'HEAD'], { encoding: 'utf8' });
@@ -638,7 +658,9 @@ export function avantLaPasse(
638
658
  }
639
659
  if (r.ok) {
640
660
  const avancee = tete(ctx.copie).stdout.trim() !== avant.stdout.trim();
641
- return { avancee, regeneration: avancee ? null : regeneration };
661
+ // The generated files the lot's files feed play again on the copy as prepared.
662
+ const rejeu = rejeuDesEngendres(ctx);
663
+ return { avancee, regeneration: avancee ? null : regeneration, ...rejeu };
642
664
  }
643
665
  const fichiers = [...(r.conflits ?? []), ...(r.enAttente ?? [])];
644
666
  if (fichiers.length) {
@@ -1566,7 +1588,9 @@ export function testsEtendusDuPlan(ctx, paquets) {
1566
1588
  const dedans = d => paquets.some(p => p === '.' || d === p || d.startsWith(`${p}/`));
1567
1589
  return [
1568
1590
  ...new Set(
1569
- lesFiches(ctx).flatMap(e => (e.role === AUTEUR_DU_CIRCUIT ? (e.plan?.testsEtendus ?? []) : []))
1591
+ lesFiches(ctx).flatMap(e =>
1592
+ e.role === AUTEUR_DU_CIRCUIT ? (e.plan?.testsEtendus ?? []) : []
1593
+ )
1570
1594
  ),
1571
1595
  ].filter(d => !dedans(d));
1572
1596
  }
@@ -0,0 +1,15 @@
1
+ // The command of the plan of a mechanical ticket: whether it calls git, and the refusal that says so.
2
+ // No import, so the code of a workflow may bring it in (no node module there).
3
+
4
+ // Whether the command of a plan calls git: a word `git` that starts the command or follows a
5
+ // separator (space-less operators included), as in `git mv a b` or `x && git add .`. The envelope
6
+ // mounts the git directory of the copy read-only (machine.md), so git cannot write its index there;
7
+ // the commit of the circuit records the tree after 1.1.
8
+ export const appelleGit = commande => /(^|[\s;&|(`])git(\s|$)/.test(String(commande ?? ''));
9
+
10
+ // The refusal of a command that calls git, naming the equivalent; null for any other command.
11
+ export function refusDeLaCommande(commande) {
12
+ return appelleGit(commande)
13
+ ? `la commande du plan appelle git (« ${String(commande).trim()} ») : l'enveloppe monte le dossier git de la copie en lecture seule, git n'y écrit pas son index ; la commande joue sur l'arbre de travail (mv au lieu de git mv, rm au lieu de git rm), et le commit du circuit enregistre l'arbre, git y détecte le renommage`
14
+ : null;
15
+ }
@@ -7,6 +7,7 @@
7
7
  // - The guard runs in this process, as if Node had been given its path, as `grillhouse` runs a
8
8
  // subcommand (bin/grillhouse.mjs).
9
9
  // - A name that is not a hook of the frame is refused, named on the error stream; exit code 2.
10
+ // These are git hooks; the hooks of Claude Code are those of mods/grillhouse/hooks/crochet.mjs.
10
11
  import path from 'node:path';
11
12
  import { fileURLToPath, pathToFileURL } from 'node:url';
12
13
  import { CROCHETS } from './crochets.mjs';