@roomi-fields/grillhouse 0.30.0 → 0.31.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 (129) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/CHANGELOG.md +30 -0
  3. package/agents/developpeur.md +0 -1
  4. package/agents/explorateur.md +0 -1
  5. package/agents/questionneur.md +0 -1
  6. package/agents/testwriter.md +0 -1
  7. package/dist/temporal/circuit/client.d.ts +2 -2
  8. package/dist/temporal/circuit/client.js.map +1 -1
  9. package/dist/temporal/circuit/commande.js +4 -4
  10. package/dist/temporal/circuit/commande.js.map +1 -1
  11. package/dist/temporal/circuit/contrat.d.ts +3 -3
  12. package/dist/temporal/circuit/contrat.js +8 -2
  13. package/dist/temporal/circuit/contrat.js.map +1 -1
  14. package/dist/temporal/circuit/deroule.js +3 -3
  15. package/dist/temporal/circuit/deroule.js.map +1 -1
  16. package/dist/temporal/commande.js +5 -6
  17. package/dist/temporal/commande.js.map +1 -1
  18. package/dist/temporal/installation.d.ts +0 -4
  19. package/dist/temporal/installation.js +12 -34
  20. package/dist/temporal/installation.js.map +1 -1
  21. package/docs/ARCHITECTURE.md +49 -19
  22. package/docs/CADRE.md +10 -0
  23. package/docs/INTERFACE.md +8 -3
  24. package/package.json +2 -2
  25. package/scripts/activites.mjs +150 -77
  26. package/scripts/aiguillage.mjs +33 -11
  27. package/scripts/avancement.mjs +27 -10
  28. package/scripts/bilan.mjs +101 -25
  29. package/scripts/cadre.mjs +5 -2
  30. package/scripts/circuit.mjs +153 -57
  31. package/scripts/composants-affectes.mjs +64 -21
  32. package/scripts/composition-des-langages.mjs +5 -3
  33. package/scripts/conformite.mjs +54 -19
  34. package/scripts/dependances-internes.mjs +9 -3
  35. package/scripts/dernier-vert.mjs +54 -19
  36. package/scripts/dette.mjs +32 -11
  37. package/scripts/donnees-cles.mjs +24 -8
  38. package/scripts/droits.mjs +40 -15
  39. package/scripts/empreinte-d-etape.mjs +17 -0
  40. package/scripts/engendres.mjs +15 -5
  41. package/scripts/enveloppe/enveloppe.mjs +141 -48
  42. package/scripts/enveloppe/travail-de-la-copie.mjs +36 -12
  43. package/scripts/faits-du-circuit.mjs +1 -1
  44. package/scripts/flux-des-paquets.mjs +21 -7
  45. package/scripts/gardes-du-cadre.mjs +9 -3
  46. package/scripts/init.mjs +11 -4
  47. package/scripts/integration/file.mjs +84 -29
  48. package/scripts/integration/integrer.mjs +70 -24
  49. package/scripts/integration/rejeu.mjs +26 -9
  50. package/scripts/jointure.d.ts +6 -1
  51. package/scripts/langages/cargo/commandes.mjs +97 -18
  52. package/scripts/langages/cargo/composants.mjs +24 -8
  53. package/scripts/langages/cargo/index.mjs +4 -0
  54. package/scripts/langages/cargo/tests-de-head.mjs +25 -9
  55. package/scripts/langages/python/commandes.mjs +3 -1
  56. package/scripts/langages/python/index.mjs +4 -0
  57. package/scripts/langages/typescript/chemins-des-tests.mjs +6 -2
  58. package/scripts/langages/typescript/composants.mjs +9 -3
  59. package/scripts/langages/typescript/consommateurs-arbitres.mjs +40 -14
  60. package/scripts/langages/typescript/consommateurs.mjs +39 -14
  61. package/scripts/langages/typescript/elements-du-lot.mjs +36 -12
  62. package/scripts/langages/typescript/frontieres.mjs +66 -22
  63. package/scripts/langages/typescript/index-interfaces.mjs +36 -13
  64. package/scripts/langages/typescript/index.mjs +10 -3
  65. package/scripts/langages/typescript/interfaces-contre-code.mjs +109 -41
  66. package/scripts/langages/typescript/lecteurs.mjs +36 -11
  67. package/scripts/langages/typescript/migrations/0.23.0-config-vitest.mjs +15 -5
  68. package/scripts/langages/typescript/migrations/0.25.0-chemins-des-tests.mjs +6 -2
  69. package/scripts/langages/typescript/migrations/0.25.0-tailles-des-tests.mjs +6 -2
  70. package/scripts/langages/typescript/migrations/0.30.0-tailles-des-outils-lourds.mjs +3 -1
  71. package/scripts/langages/typescript/parcours.mjs +12 -4
  72. package/scripts/langages/typescript/regle-des-tests.mjs +9 -3
  73. package/scripts/langages/typescript/resumes.mjs +9 -3
  74. package/scripts/langages/typescript/tailles-des-tests.mjs +58 -16
  75. package/scripts/langages/typescript/tests-de-nuit.mjs +3 -1
  76. package/scripts/langages/typescript/tests.mjs +24 -8
  77. package/scripts/langages/typescript/titres-de-tests.mjs +35 -12
  78. package/scripts/langages/typescript/turbo-des-paquets.mjs +152 -51
  79. package/scripts/langages/typescript/verdict.mjs +3 -1
  80. package/scripts/langages/typescript/verifier.mjs +28 -10
  81. package/scripts/langages/typescript/vitest-config/avancement.reporter.mjs +15 -5
  82. package/scripts/langages/typescript/vitest-config/base.mjs +7 -2
  83. package/scripts/langages/typescript/vitest-config/changements.mjs +21 -8
  84. package/scripts/langages/typescript/vitest-config/delais.mjs +9 -3
  85. package/scripts/langages/typescript/vitest-config/duree.classement.mjs +12 -4
  86. package/scripts/langages/typescript/vitest-config/duree.reporter.mjs +17 -6
  87. package/scripts/langages/typescript/vitest-config/lances.mjs +83 -27
  88. package/scripts/langages/typescript/vitest-config/machine.setup.mjs +7 -0
  89. package/scripts/langages/typescript/vitest-config/resultats.mjs +3 -1
  90. package/scripts/lint-des-scripts.mjs +58 -0
  91. package/scripts/mesure/base-de-passe.mjs +117 -25
  92. package/scripts/mesure/pression.mjs +9 -3
  93. package/scripts/migrations/0.23.0-charte-importee.mjs +6 -2
  94. package/scripts/migrations/0.23.0-crochets-de-seance.mjs +25 -8
  95. package/scripts/migrations/0.23.0-marche-du-projet.mjs +18 -6
  96. package/scripts/migrations/0.23.2-copies-du-cadre.mjs +48 -16
  97. package/scripts/migrations/0.24.12-tri-des-decouvertes.mjs +6 -2
  98. package/scripts/migrations/0.25.0-script-des-tests.mjs +15 -5
  99. package/scripts/migrations/0.30.0-ci-appelle-la-verification.mjs +6 -2
  100. package/scripts/migrations/0.31.0-paquets-dans-le-graphe.mjs +7 -7
  101. package/scripts/nuit.sh +15 -0
  102. package/scripts/outil.mjs +3 -1
  103. package/scripts/outils-cles.mjs +18 -7
  104. package/scripts/paquet-npm.mjs +15 -5
  105. package/scripts/paquets.mjs +12 -4
  106. package/scripts/passe-de-la-machine.mjs +7 -2
  107. package/scripts/places-de-la-machine.mjs +66 -12
  108. package/scripts/preparation.mjs +15 -5
  109. package/scripts/registre.mjs +6 -2
  110. package/scripts/reprise.mjs +66 -0
  111. package/scripts/resultats.mjs +105 -37
  112. package/scripts/seances.mjs +22 -4
  113. package/scripts/services-du-noyau.mjs +1 -0
  114. package/scripts/sous-commandes.mjs +3 -1
  115. package/scripts/style-a-l-ecriture.mjs +48 -17
  116. package/scripts/tableau.mjs +34 -9
  117. package/scripts/taches-du-graphe.mjs +33 -13
  118. package/scripts/ticket-du-circuit.mjs +10 -0
  119. package/scripts/transitions.mjs +141 -24
  120. package/scripts/verrou-de-fichier.mjs +6 -2
  121. package/scripts/verrou-de-machine.mjs +123 -39
  122. package/scripts/verrous/commande.mjs +50 -17
  123. package/scripts/verrous/ticket-du-sous-agent.mjs +9 -3
  124. package/scripts/verrous/verrou.mjs +42 -14
  125. package/skills/explorateur/SKILL.md +7 -1
  126. package/skills/grill/SKILL.md +1 -1
  127. package/skills/mesure/SKILL.md +3 -0
  128. package/skills/relecteur/SKILL.md +1 -1
  129. package/skills/testwriter/SKILL.md +12 -6
package/scripts/bilan.mjs CHANGED
@@ -162,11 +162,15 @@ function nuits([d, f], nuit) {
162
162
  const a = new Date(jour);
163
163
  a.setHours(nuit.debut);
164
164
  const b = new Date(jour);
165
- if (nuit.fin < nuit.debut) b.setDate(b.getDate() + 1);
165
+ if (nuit.fin < nuit.debut) {
166
+ b.setDate(b.getDate() + 1);
167
+ }
166
168
  b.setHours(nuit.fin);
167
169
  const x = Math.max(a.getTime(), d);
168
170
  const y = Math.min(b.getTime(), f);
169
- if (y > x) out.push([x, y]);
171
+ if (y > x) {
172
+ out.push([x, y]);
173
+ }
170
174
  jour.setDate(jour.getDate() + 1);
171
175
  }
172
176
  return out;
@@ -201,7 +205,9 @@ function longueur(l) {
201
205
  let total = 0;
202
206
  let fin = -Infinity;
203
207
  for (const [d, f] of [...l].sort((x, y) => x[0] - y[0])) {
204
- if (f <= fin) continue;
208
+ if (f <= fin) {
209
+ continue;
210
+ }
205
211
  total += f - Math.max(d, fin);
206
212
  fin = f;
207
213
  }
@@ -232,9 +238,13 @@ export function bilan({
232
238
  const derniere = new Map();
233
239
  for (const x of lignes) {
234
240
  const l = { ...x, role: roleDeLAgent(x.role) };
235
- if (l.ticket !== ticket || (l.role !== CIRCUIT && !ROLES.has(l.role))) continue;
241
+ if (l.ticket !== ticket || (l.role !== CIRCUIT && !ROLES.has(l.role))) {
242
+ continue;
243
+ }
236
244
  const avant = derniere.get(l.agent);
237
- if (!avant || Date.parse(l.fin) > Date.parse(avant.fin)) derniere.set(l.agent, l);
245
+ if (!avant || Date.parse(l.fin) > Date.parse(avant.fin)) {
246
+ derniere.set(l.agent, l);
247
+ }
238
248
  }
239
249
  const hors = [...derniere.values()].filter(l => l.role !== CIRCUIT && !lancees.has(l.agent));
240
250
  const agents = [...derniere.values()].filter(l => !hors.includes(l));
@@ -281,13 +291,17 @@ export function bilan({
281
291
  }
282
292
  const etapes = segments.filter(s => s.role === CIRCUIT);
283
293
  const preuves = etapes.filter(s => s.etape === 'preuve');
284
- for (const p of preuves) p.preuve = p.entree?.resultat ?? null;
294
+ for (const p of preuves) {
295
+ p.preuve = p.entree?.resultat ?? null;
296
+ }
285
297
  // A proof and the category it gives the testwriter before it: the lot unchanged since the proof
286
298
  // before, or none.
287
299
  const avantLa = p => preuves.findLast(x => x.f <= p.d);
288
300
  const parLaPreuve = p => {
289
301
  const avant = avantLa(p);
290
- if (!p.preuve) return null;
302
+ if (!p.preuve) {
303
+ return null;
304
+ }
291
305
  if (avant?.preuve && signature(avant.preuve) === signature(p.preuve)) {
292
306
  return avant.preuve.ok ? 'rejeu' : 'sansEffet';
293
307
  }
@@ -301,13 +315,16 @@ export function bilan({
301
315
 
302
316
  // The sessions first: the checks read what they delivered.
303
317
  for (const s of segments.filter(x => x.role !== CIRCUIT)) {
304
- if (s.role === QUESTIONNEUR) s.categorie = 'questionnement';
305
- else if (s.role === 'developpeur') {
318
+ if (s.role === QUESTIONNEUR) {
319
+ s.categorie = 'questionnement';
320
+ } else if (s.role === 'developpeur') {
306
321
  s.categorie = inchangee(s) ? 'sansEffet' : 'travail';
307
322
  } else if (s.role === 'testwriter') {
308
323
  const p = preuves.find(x => x.d >= s.f - JEU);
309
324
  s.categorie = p ? (parLaPreuve(p) ?? (p.preuve?.vide ? 'sansEffet' : 'travail')) : 'travail';
310
- } else s.categorie = 'travail';
325
+ } else {
326
+ s.categorie = 'travail';
327
+ }
311
328
  }
312
329
  // A session that changed the lot: the testwriter's or the developpeur's, that delivered.
313
330
  const livre = s => AGENTS_DU_LOT.includes(s.role) && s.categorie === 'travail';
@@ -332,7 +349,9 @@ export function bilan({
332
349
  : i === 'vert'
333
350
  ? 'rejeu'
334
351
  : 'sansEffet';
335
- } else s.categorie = 'automatique';
352
+ } else {
353
+ s.categorie = 'automatique';
354
+ }
336
355
  }
337
356
 
338
357
  // The waits: from each end of a run on a stop to the answer, the run after; the owner's when he
@@ -344,7 +363,9 @@ export function bilan({
344
363
  const f = Math.min(tour, suivant, fin);
345
364
  const ecrit = duResponsable.some(t => t > e.t && t <= f);
346
365
  const qui = ecrit ? RESPONSABLE : SUPERVISEUR;
347
- if (f > e.t) lesAttentes.push({ i: [e.t, f], qui, nuit: nuits([e.t, f], nuit) });
366
+ if (f > e.t) {
367
+ lesAttentes.push({ i: [e.t, f], qui, nuit: nuits([e.t, f], nuit) });
368
+ }
348
369
  }
349
370
  const attentes = lesAttentes.map(a => a.i);
350
371
 
@@ -360,7 +381,9 @@ export function bilan({
360
381
  const fenetre = s => [Math.max(s.d, debut), Math.min(s.f, fin)];
361
382
  for (const s of segments) {
362
383
  const [d, f] = fenetre(s);
363
- if (f <= d) continue;
384
+ if (f <= d) {
385
+ continue;
386
+ }
364
387
  const ms = f - d - commun([d, f], attentes);
365
388
  const c = categories[s.categorie];
366
389
  c.ms += ms;
@@ -389,7 +412,9 @@ export function bilan({
389
412
  const out = {};
390
413
  for (const role of new Set(SUITE.flatMap(e => e.qui))) {
391
414
  const n = l.filter(x => x.role === role).length;
392
- if (n) out[role] = n;
415
+ if (n) {
416
+ out[role] = n;
417
+ }
393
418
  }
394
419
  return out;
395
420
  };
@@ -400,7 +425,9 @@ export function bilan({
400
425
  parEtape[titre] = (parEtape[titre] ?? 0) + 1;
401
426
  }
402
427
  const arrets = {};
403
- for (const e of duCircuit.filter(x => x.arret)) arrets[e.arret] = (arrets[e.arret] ?? 0) + 1;
428
+ for (const e of duCircuit.filter(x => x.arret)) {
429
+ arrets[e.arret] = (arrets[e.arret] ?? 0) + 1;
430
+ }
404
431
  // The ends of the questionings of the plan: the questions asked, the plans an answer changed, the
405
432
  // questions left open.
406
433
  const fins = duCircuit.map(e => e.questionnement).filter(Boolean);
@@ -422,6 +449,31 @@ export function bilan({
422
449
  verdicts: finDuTri.verdicts ?? {},
423
450
  }
424
451
  : null;
452
+ // The time replayed after a red and the time read back without replaying, apart, by step
453
+ // (« passe-finale » for the checks once final): a step that plays again after a pass of its own
454
+ // that ended red adds its duration to the first; a step the circuit read back (the result
455
+ // `relue`) adds the duration of its last green, which the reading spared, to the second. A
456
+ // ticket without a red replays nothing.
457
+ const nomDeLEtape = (etape, finale) => (etape === 'controles' && finale ? 'passe-finale' : etape);
458
+ const reprise = { rejoue: { ms: 0, parEtape: {} }, relu: { ms: 0, parEtape: {} } };
459
+ const ajouter = (c, nom, ms) => {
460
+ c.ms += ms;
461
+ c.parEtape[nom] = (c.parEtape[nom] ?? 0) + ms;
462
+ };
463
+ for (const s of etapes) {
464
+ const memes = x => x.etape === s.etape && Boolean(x.finale) === Boolean(s.finale);
465
+ const avant = etapes.findLast(x => memes(x) && x.f <= s.d);
466
+ if (!avant?.entree || issue(avant.entree) === 'vert') {
467
+ continue;
468
+ }
469
+ const [d, f] = fenetre(s);
470
+ if (f > d) {
471
+ ajouter(reprise.rejoue, nomDeLEtape(s.etape, s.finale), f - d - commun([d, f], attentes));
472
+ }
473
+ }
474
+ for (const e of duCircuit.filter(x => x.relue)) {
475
+ ajouter(reprise.relu, nomDeLEtape(e.etape, e.finale), e.relue.ms ?? 0);
476
+ }
425
477
  const somme = k => sessions.reduce((m, l) => m + (l[k] ?? 0), 0);
426
478
  const perdu = CATEGORIES.filter(([k]) => !GARDE.has(k)).reduce(
427
479
  (m, [k]) => m + categories[k].ms,
@@ -438,6 +490,7 @@ export function bilan({
438
490
  perdu,
439
491
  perduHorsAttentes: perdu - ATTENTES.reduce((m, k) => m + categories[k].ms, 0),
440
492
  categories,
493
+ reprise,
441
494
  seances: {
442
495
  total: sessions.length,
443
496
  parRole: parRoleDe(sessions),
@@ -459,8 +512,12 @@ export function bilan({
459
512
 
460
513
  // Where the circuit of the state <etat> ended, in words.
461
514
  function statutDe(etat) {
462
- if (etat?.etape === 'integre') return 'intégré';
463
- if (etat?.raison) return `arrêt ${etat.raison}${etat.code != null ? ` (${etat.code})` : ''}`;
515
+ if (etat?.etape === 'integre') {
516
+ return 'intégré';
517
+ }
518
+ if (etat?.raison) {
519
+ return `arrêt ${etat.raison}${etat.code !== null && etat.code !== undefined ? ` (${etat.code})` : ''}`;
520
+ }
464
521
  return 'en cours';
465
522
  }
466
523
 
@@ -519,7 +576,12 @@ export function texteDuBilan(b, avant) {
519
576
  const base = avant
520
577
  ? `Face au bilan de ${avant.ticket}, recalculé : mur ${minutes(avant.mur)} → ${minutes(b.mur)} min, perte ${pourcent(avant.perdu, avant.mur)} → ${pourcent(b.perdu, b.mur)} %, séances ${avant.seances.total} → ${b.seances.total}, coût ${dollars(avant.cout)} → ${dollars(b.cout)} $.`
521
578
  : "Aucun bilan d'avant dans ce projet : pas de base.";
522
- return [tete, ...lignes, ...tri, `Arrêts : ${arrets || 'aucun'}.`, base].join('\n');
579
+ const parEtape = c =>
580
+ Object.entries(c.parEtape)
581
+ .map(([nom, ms]) => `${nom} ${minutes(ms)} min`)
582
+ .join(', ');
583
+ const reprise = `Reprise après un rouge : ${minutes(b.reprise.rejoue.ms)} min rejouées${b.reprise.rejoue.ms ? ` (${parEtape(b.reprise.rejoue)})` : ''}, ${minutes(b.reprise.relu.ms)} min relues sans rejouer${b.reprise.relu.ms ? ` (${parEtape(b.reprise.relu)})` : ''}.`;
584
+ return [tete, ...lignes, ...tri, reprise, `Arrêts : ${arrets || 'aucun'}.`, base].join('\n');
523
585
  }
524
586
 
525
587
  const dossier = racine => path.join(racine, '.claude', 'worktrees');
@@ -537,11 +599,15 @@ export function garder(racine, b) {
537
599
  export function bilansGardes(racine) {
538
600
  const d = dossier(racine);
539
601
  const out = {};
540
- if (!existsSync(d)) return out;
602
+ if (!existsSync(d)) {
603
+ return out;
604
+ }
541
605
  for (const n of readdirSync(d).filter(x => x.endsWith(SUFFIXE))) {
542
606
  try {
543
607
  const b = JSON.parse(readFileSync(path.join(d, n), 'utf8'));
544
- if (b?.ticket) out[b.ticket] = b;
608
+ if (b?.ticket) {
609
+ out[b.ticket] = b;
610
+ }
545
611
  } catch {
546
612
  // A torn bilan counts nothing.
547
613
  }
@@ -558,7 +624,9 @@ export function precedent(racine, ticket) {
558
624
  const avant = Object.values(bilansGardes(racine))
559
625
  .filter(b => b.ticket !== ticket)
560
626
  .sort((x, y) => Date.parse(y.calcule ?? 0) - Date.parse(x.calcule ?? 0))[0];
561
- if (!avant) return null;
627
+ if (!avant) {
628
+ return null;
629
+ }
562
630
  const b = calculer(racine, avant.ticket, { responsable: false });
563
631
  return b.mur > 0 ? b : null;
564
632
  }
@@ -583,11 +651,15 @@ export function messagesDuResponsable(texte) {
583
651
  const out = [];
584
652
  for (const l of texte.split('\n')) {
585
653
  // Only a line that names the person can be his message: the others are not parsed.
586
- if (!l.includes('"human"')) continue;
654
+ if (!l.includes('"human"')) {
655
+ continue;
656
+ }
587
657
  try {
588
658
  const e = JSON.parse(l);
589
659
  const t = Date.parse(e.timestamp ?? '');
590
- if (e.type === 'user' && e.origin?.kind === 'human' && !Number.isNaN(t)) out.push(t);
660
+ if (e.type === 'user' && e.origin?.kind === 'human' && !Number.isNaN(t)) {
661
+ out.push(t);
662
+ }
591
663
  } catch {
592
664
  // A torn line holds no message.
593
665
  }
@@ -608,7 +680,9 @@ function messagesDeLaSeance(seance) {
608
680
  .map(d => path.join(projets, d, `${seance}.jsonl`))
609
681
  .find(g => existsSync(g))
610
682
  : null;
611
- if (!f) return [];
683
+ if (!f) {
684
+ return [];
685
+ }
612
686
  const out = [];
613
687
  const decodeur = new StringDecoder('utf8');
614
688
  const tampon = Buffer.alloc(MORCEAU);
@@ -701,7 +775,9 @@ if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) {
701
775
  void finSurLeServeur(racine, ticket).then(fin => {
702
776
  const b = calculer(racine, ticket, fin);
703
777
  process.stdout.write(`${texteDuBilan(b, precedent(racine, ticket))}\n`);
704
- if (options.includes('--garder')) garder(racine, b);
778
+ if (options.includes('--garder')) {
779
+ garder(racine, b);
780
+ }
705
781
  });
706
782
  }
707
783
  }
package/scripts/cadre.mjs CHANGED
@@ -96,15 +96,18 @@ function empaqueter() {
96
96
  );
97
97
  for (const f of FICHIERS_DU_CADRE) {
98
98
  const source = path.join(DEPOT, f);
99
- if (!existsSync(source)) throw new Error(`${f} manque au dépôt du cadre (${DEPOT})`);
99
+ if (!existsSync(source)) {
100
+ throw new Error(`${f} manque au dépôt du cadre (${DEPOT})`);
101
+ }
100
102
  cpSync(source, path.join(COPIE, f), { recursive: true });
101
103
  }
102
104
  }
103
105
 
104
106
  // Removes the copies of the plugin and cadre/.
105
107
  function nettoyer() {
106
- for (const e of ELEMENTS_DU_GREFFON)
108
+ for (const e of ELEMENTS_DU_GREFFON) {
107
109
  rmSync(path.join(PAQUET, e), { recursive: true, force: true });
110
+ }
108
111
  rmSync(COPIE, { recursive: true, force: true });
109
112
  }
110
113