@roomi-fields/grillhouse 0.51.0 → 0.52.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.
Files changed (60) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/CHANGELOG.md +20 -0
  3. package/charte/plan.md +47 -0
  4. package/charte/preuve.md +39 -0
  5. package/charte/superviseur.md +61 -0
  6. package/charte/tests.md +38 -0
  7. package/charte.md +22 -177
  8. package/dist/temporal/circuit/client.d.ts +1 -2
  9. package/dist/temporal/circuit/client.js +1 -2
  10. package/dist/temporal/circuit/client.js.map +1 -1
  11. package/docs/INTERFACE.md +4 -3
  12. package/docs/architecture/circuit.md +2 -2
  13. package/docs/architecture/entree.md +1 -1
  14. package/docs/architecture/greffon.md +43 -18
  15. package/docs/architecture/installation.md +17 -7
  16. package/docs/architecture/machine.md +30 -3
  17. package/docs/architecture/tests.md +8 -3
  18. package/docs/lexique.md +10 -1
  19. package/hooks/hooks.json +0 -10
  20. package/hooks/register.tsx +91 -3
  21. package/package.json +2 -1
  22. package/scripts/activites.mjs +20 -5
  23. package/scripts/aiguillage.mjs +0 -1
  24. package/scripts/attente-au-tour.mjs +2 -3
  25. package/scripts/bilan.mjs +116 -56
  26. package/scripts/bilans-gardes.mjs +37 -0
  27. package/scripts/circuit.mjs +3 -1
  28. package/scripts/direct.mjs +1 -1
  29. package/scripts/droits.mjs +115 -36
  30. package/scripts/entree-de-seance.mjs +35 -0
  31. package/scripts/enveloppe/enveloppe.mjs +23 -16
  32. package/scripts/enveloppe/lancer.sh +32 -22
  33. package/scripts/enveloppe/travail-de-la-copie.mjs +77 -0
  34. package/scripts/jointure.d.ts +2 -1
  35. package/scripts/langages/python/commandes.mjs +50 -7
  36. package/scripts/langages/python/squelette.mjs +2 -1
  37. package/scripts/langages/typescript/index.mjs +12 -12
  38. package/scripts/langages/typescript/turbo-des-paquets.mjs +52 -2
  39. package/scripts/langages/typescript/verifier.mjs +27 -2
  40. package/scripts/migrations/serveurs-de-l-index.mjs +1 -1
  41. package/scripts/migrations/suivi-du-superviseur-retire.mjs +56 -0
  42. package/scripts/migrations.mjs +2 -0
  43. package/scripts/nuit.sh +3 -2
  44. package/scripts/paquet.mjs +1 -1
  45. package/scripts/resultats.mjs +2 -2
  46. package/scripts/seances.mjs +53 -26
  47. package/scripts/session-start.sh +8 -6
  48. package/scripts/sortie-de-seance.mjs +70 -0
  49. package/scripts/sous-commandes.mjs +0 -1
  50. package/scripts/superviseur.mjs +373 -155
  51. package/scripts/tableau.mjs +127 -49
  52. package/skills/explorateur/SKILL.md +2 -2
  53. package/skills/grill/SKILL.md +3 -2
  54. package/skills/pitmaster/SKILL.md +68 -34
  55. package/skills/pitmaster/references/cadre.md +1 -1
  56. package/skills/pitmaster/references/tour.md +6 -5
  57. package/skills/relecteur/SKILL.md +1 -1
  58. package/skills/testwriter/SKILL.md +2 -2
  59. package/cadre/templates/projet/pitmaster/SUIVI.md +0 -22
  60. package/scripts/attente-a-l-arret.mjs +0 -114
@@ -110,7 +110,7 @@ qu'il rend, sans simuler ce que le composant fait lui-même. Ainsi ils restent v
110
110
  change de forme.
111
111
 
112
112
  **La plus petite taille qui prouve** : la taille d'un test — petit, moyen, grand — est une décision
113
- d'architecture, que le plan du ticket fixe (charte, « La taille d'un test suit la pyramide »). Par
113
+ d'architecture, que le plan du ticket fixe (charte, module `preuve`, « La taille d'un test suit la pyramide »). Par
114
114
  défaut, chaque critère se prouve **petit** : un test qui appelle son module par son interface, dans
115
115
  son processus, sans rien lancer. Le plan ne nomme que l'exception, avec sa raison : **moyen** (une
116
116
  couture entre quelques modules que le petit n'atteint pas, avec des processus locaux) ou **grand**
@@ -244,7 +244,7 @@ gardes, un plafond). Un critère qui porte sur cette matière est prouvé par sa
244
244
  au circuit ; tu écris le test du comportement du ticket, jamais un double de ce qu'une référence
245
245
  tient. Ainsi une seule chose prouve chaque fait, et le relecteur n'a pas un doublon à retirer.
246
246
 
247
- **Une mesure de temps joue la nuit** (la charte commune) : un test dont le verdict dépend d'une
247
+ **Une mesure de temps joue la nuit** (charte, module `tests`) : un test dont le verdict dépend d'une
248
248
  durée (une attente bornée, un écart de temps comparé à un seuil) s'écrit dans un banc, un fichier
249
249
  `*.budget.test.ts` (en Rust, un module de `tests/it_budget/`), ou dans un témoin de temps, un fichier à
250
250
  lui, sans test ordinaire à côté, où sa mesure s'enveloppe dans `mesurerAuRepos(ctx, () => …)`,
@@ -1,22 +0,0 @@
1
- # Suivi de la supervision
2
-
3
- Tenu par la compétence `pitmaster`. Une question s'écrit ici dès qu'elle naît ; tranchée, elle en
4
- sort et sa réponse va dans son ticket.
5
-
6
- ## Dernier tour
7
-
8
- - Date : aucun tour encore
9
- - Agents lancés : aucun
10
- - À vérifier au prochain tour : rien
11
-
12
- ## R — à confirmer par le responsable
13
-
14
- Chaque point : contexte, exemple, règle, recommandation, question, ticket.
15
-
16
- ## S — à surveiller
17
-
18
- Chaque point : ce qui se surveille, ce qui le fermera.
19
-
20
- ## F — fermés
21
-
22
- Chaque point : ce qui l'a fermé, le ticket.
@@ -1,114 +0,0 @@
1
- #!/usr/bin/env node
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: 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).
6
- //
7
- // - Stop runs for the session itself, never for a sub-agent (SubagentStop). The session is the
8
- // supervisor's as for the signal of the turn (`racineDeLaSupervision` of
9
- // scripts/attente-au-tour.mjs): out of a git repository, in an agent's copy and in the session
10
- // of a role the circuit launches, the stop passes.
11
- // - A question of a circuit waits for the supervisor (`questionsEnAttente` of
12
- // scripts/superviseur.mjs, a circuit ended without its issue included): the stop is blocked
13
- // with each question, its ticket, its step and the command that answers it.
14
- // - Each question blocks once, by its key: it is noted in `.claude/worktrees/signale-a-l-arret.json`,
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 »).
19
- // - The block: the reason on the error stream, exit code 2, which Claude Code gives the session as
20
- // its next instruction (hooks.md, « Exit code 2 behavior per event »).
21
- // - A server that does not answer, a note that cannot be written, an input that is no JSON: the
22
- // stop passes, exit 0.
23
- import { mkdirSync, readFileSync, renameSync, writeFileSync } from 'node:fs';
24
- import path from 'node:path';
25
- import { pathToFileURL } from 'node:url';
26
- import { racineDeLaSupervision } from './attente-au-tour.mjs';
27
- import { circuitsDuServeur } from './circuits-du-serveur.mjs';
28
- import { ligneDeQuestion, questionsEnAttente, ticketsHorsAttente } from './superviseur.mjs';
29
-
30
- // The note of what blocked the stop in the repository at <racine>.
31
- const noteDe = racine => path.join(racine, '.claude', 'worktrees', 'signale-a-l-arret.json');
32
-
33
- // The keys of the questions the note holds; an older note's other keys are ignored.
34
- function lireLaNote(racine) {
35
- try {
36
- const lu = JSON.parse(readFileSync(noteDe(racine), 'utf8'));
37
- return {
38
- questions: new Set(Array.isArray(lu?.questions) ? lu.questions.map(String) : []),
39
- // Only `questions`: a note that holds another key (an older `etat`) is written again.
40
- nette: Object.keys(lu ?? {}).join() === 'questions',
41
- };
42
- } catch {
43
- return { questions: new Set(), nette: true };
44
- }
45
- }
46
-
47
- /**
48
- * What the stop of the session of supervision in <dossier> gets: the reason that blocks it, or
49
- * null when the stop passes (see the header). The questions it gives are noted, so that each
50
- * blocks once.
51
- * @param {string} dossier the directory the session works in
52
- * @param {{ env?: Record<string, string | undefined>,
53
- * fermes?: (racine: string, ids: string[]) => Set<string> | null,
54
- * circuitsDe?: (racine: string) => Promise<import('./circuits-du-serveur.mjs').CircuitDuServeur[]> }} [options]
55
- * @returns {Promise<string | null>}
56
- */
57
- export async function attenteALArret(
58
- dossier,
59
- { env = process.env, fermes = ticketsHorsAttente, circuitsDe = circuitsDuServeur } = {}
60
- ) {
61
- const racine = racineDeLaSupervision(dossier, env);
62
- if (!racine) {
63
- return null;
64
- }
65
- let circuits;
66
- try {
67
- circuits = await circuitsDe(racine);
68
- } catch {
69
- return null;
70
- }
71
- const questions = questionsEnAttente(racine, circuits, { fermes });
72
- const note = lireLaNote(racine);
73
- const neuves = questions.filter(q => !note.questions.has(q.cle));
74
- if (!note.nette || questions.length !== note.questions.size || neuves.length) {
75
- const f = noteDe(racine);
76
- try {
77
- mkdirSync(path.dirname(f), { recursive: true });
78
- writeFileSync(
79
- `${f}.${process.pid}`,
80
- `${JSON.stringify({ questions: questions.map(q => q.cle).sort() })}\n`
81
- );
82
- renameSync(`${f}.${process.pid}`, f);
83
- } catch {
84
- // A note that cannot be written would block at each stop: the stop passes.
85
- return null;
86
- }
87
- }
88
- if (!neuves.length) {
89
- return null;
90
- }
91
- return [
92
- neuves.length > 1
93
- ? `Ne te mets pas en attente : ${neuves.length} circuits attendent ta réponse. Réponds à chacun, ou porte sa question au responsable en le lui disant, puis termine ton tour.`
94
- : 'Ne te mets pas en attente : un circuit attend ta réponse. Réponds-lui, ou porte sa question au responsable en le lui disant, puis termine ton tour.',
95
- ...neuves.map(q =>
96
- q.interrompu
97
- ? `- ${q.ticket} a fini sans son issue, à ${q.etape} : \`${q.commande}\`.`
98
- : ligneDeQuestion(q)
99
- ),
100
- ].join('\n');
101
- }
102
-
103
- if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) {
104
- let raison = null;
105
- try {
106
- raison = await attenteALArret(process.cwd());
107
- } catch {
108
- // A fault lets the stop pass.
109
- }
110
- if (raison) {
111
- process.stderr.write(`${raison}\n`);
112
- process.exitCode = 2;
113
- }
114
- }