@roomi-fields/grillhouse 0.30.0 → 0.32.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 (153) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/CHANGELOG.md +48 -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 +3 -6
  19. package/dist/temporal/installation.js +19 -38
  20. package/dist/temporal/installation.js.map +1 -1
  21. package/dist/temporal/tickets/activites.d.ts +1 -0
  22. package/dist/temporal/tickets/activites.js +5 -0
  23. package/dist/temporal/tickets/activites.js.map +1 -1
  24. package/dist/temporal/tickets/contrat.d.ts +10 -0
  25. package/dist/temporal/tickets/deroule.js +8 -1
  26. package/dist/temporal/tickets/deroule.js.map +1 -1
  27. package/docs/ARCHITECTURE.md +119 -27
  28. package/docs/CADRE.md +20 -0
  29. package/docs/INTERFACE.md +17 -4
  30. package/hooks/hooks.json +4 -0
  31. package/package.json +2 -2
  32. package/scripts/activites.mjs +155 -84
  33. package/scripts/aiguillage.mjs +35 -11
  34. package/scripts/attente-au-tour.mjs +99 -0
  35. package/scripts/avancement.mjs +27 -10
  36. package/scripts/base-des-workflows.mjs +57 -0
  37. package/scripts/bilan.mjs +101 -25
  38. package/scripts/cadre.mjs +5 -2
  39. package/scripts/circuit.mjs +173 -58
  40. package/scripts/composants-affectes.mjs +64 -21
  41. package/scripts/composition-des-langages.mjs +5 -3
  42. package/scripts/conformite.mjs +54 -19
  43. package/scripts/copies-finies.mjs +8 -1
  44. package/scripts/dependances-internes.mjs +9 -3
  45. package/scripts/dernier-vert.mjs +84 -23
  46. package/scripts/dette.mjs +32 -11
  47. package/scripts/donnees-cles.mjs +24 -8
  48. package/scripts/droits.mjs +40 -15
  49. package/scripts/effets.mjs +9 -0
  50. package/scripts/empreinte-d-etape.mjs +17 -0
  51. package/scripts/engendres.mjs +15 -5
  52. package/scripts/enveloppe/enveloppe.mjs +141 -48
  53. package/scripts/enveloppe/travail-de-la-copie.mjs +36 -12
  54. package/scripts/etapes.mjs +1 -1
  55. package/scripts/faits-du-circuit.mjs +1 -1
  56. package/scripts/flux-des-paquets.mjs +21 -7
  57. package/scripts/gardes-du-cadre.mjs +9 -3
  58. package/scripts/init.mjs +11 -4
  59. package/scripts/integration/file.mjs +84 -29
  60. package/scripts/integration/integrer.mjs +70 -24
  61. package/scripts/integration/rejeu.mjs +26 -9
  62. package/scripts/jointure.d.ts +10 -1
  63. package/scripts/journal-des-etats.d.mts +41 -0
  64. package/scripts/journal-des-etats.mjs +273 -0
  65. package/scripts/journal.mjs +119 -0
  66. package/scripts/langages/cargo/commandes.mjs +97 -18
  67. package/scripts/langages/cargo/composants.mjs +24 -8
  68. package/scripts/langages/cargo/index.mjs +7 -0
  69. package/scripts/langages/cargo/tests-de-head.mjs +25 -9
  70. package/scripts/langages/python/commandes.mjs +3 -1
  71. package/scripts/langages/python/index.mjs +6 -0
  72. package/scripts/langages/typescript/chemins-des-tests.mjs +6 -2
  73. package/scripts/langages/typescript/composants.mjs +9 -3
  74. package/scripts/langages/typescript/consommateurs-arbitres.mjs +40 -14
  75. package/scripts/langages/typescript/consommateurs.mjs +39 -14
  76. package/scripts/langages/typescript/elements-du-lot.mjs +36 -12
  77. package/scripts/langages/typescript/frontieres.mjs +112 -22
  78. package/scripts/langages/typescript/index-interfaces.mjs +36 -13
  79. package/scripts/langages/typescript/index.mjs +12 -3
  80. package/scripts/langages/typescript/interfaces-contre-code.mjs +109 -41
  81. package/scripts/langages/typescript/lecteurs.mjs +36 -11
  82. package/scripts/langages/typescript/migrations/0.23.0-config-vitest.mjs +15 -5
  83. package/scripts/langages/typescript/migrations/0.25.0-chemins-des-tests.mjs +6 -2
  84. package/scripts/langages/typescript/migrations/0.25.0-tailles-des-tests.mjs +6 -2
  85. package/scripts/langages/typescript/migrations/0.30.0-tailles-des-outils-lourds.mjs +3 -1
  86. package/scripts/langages/typescript/parcours.mjs +12 -4
  87. package/scripts/langages/typescript/regle-des-tests.mjs +9 -3
  88. package/scripts/langages/typescript/resumes.mjs +9 -3
  89. package/scripts/langages/typescript/tailles-des-tests.mjs +58 -16
  90. package/scripts/langages/typescript/tests-de-nuit.mjs +3 -1
  91. package/scripts/langages/typescript/tests.mjs +24 -8
  92. package/scripts/langages/typescript/titres-de-tests.mjs +35 -12
  93. package/scripts/langages/typescript/turbo-des-paquets.mjs +152 -51
  94. package/scripts/langages/typescript/verdict.mjs +3 -1
  95. package/scripts/langages/typescript/verifier.mjs +61 -14
  96. package/scripts/langages/typescript/vitest-config/avancement.reporter.mjs +15 -5
  97. package/scripts/langages/typescript/vitest-config/base.mjs +10 -2
  98. package/scripts/langages/typescript/vitest-config/changements.mjs +21 -8
  99. package/scripts/langages/typescript/vitest-config/delais.mjs +9 -3
  100. package/scripts/langages/typescript/vitest-config/duree.classement.mjs +12 -4
  101. package/scripts/langages/typescript/vitest-config/duree.reporter.mjs +17 -6
  102. package/scripts/langages/typescript/vitest-config/lances.mjs +83 -27
  103. package/scripts/langages/typescript/vitest-config/machine.setup.mjs +7 -0
  104. package/scripts/langages/typescript/vitest-config/resultats.mjs +3 -1
  105. package/scripts/langages.d.mts +20 -0
  106. package/scripts/lint-des-scripts.mjs +58 -0
  107. package/scripts/matiere-de-test.d.ts +11 -0
  108. package/scripts/mesure/base-de-passe.mjs +117 -25
  109. package/scripts/mesure/pression.mjs +9 -3
  110. package/scripts/migrations/0.23.0-charte-importee.mjs +6 -2
  111. package/scripts/migrations/0.23.0-crochets-de-seance.mjs +25 -8
  112. package/scripts/migrations/0.23.0-marche-du-projet.mjs +18 -6
  113. package/scripts/migrations/0.23.2-copies-du-cadre.mjs +48 -16
  114. package/scripts/migrations/0.24.12-tri-des-decouvertes.mjs +6 -2
  115. package/scripts/migrations/0.25.0-script-des-tests.mjs +15 -5
  116. package/scripts/migrations/0.30.0-ci-appelle-la-verification.mjs +6 -2
  117. package/scripts/migrations/0.31.0-paquets-dans-le-graphe.mjs +7 -7
  118. package/scripts/nuit.sh +24 -0
  119. package/scripts/outil.mjs +3 -1
  120. package/scripts/outils-cles.mjs +18 -7
  121. package/scripts/paquet-npm.mjs +15 -5
  122. package/scripts/paquets.mjs +12 -4
  123. package/scripts/passe-de-la-machine.mjs +7 -2
  124. package/scripts/places-de-la-machine.mjs +72 -12
  125. package/scripts/preparation.mjs +15 -5
  126. package/scripts/registre.mjs +6 -2
  127. package/scripts/reprise.mjs +66 -0
  128. package/scripts/resultats.mjs +105 -37
  129. package/scripts/seances.mjs +22 -4
  130. package/scripts/services-du-noyau.mjs +1 -0
  131. package/scripts/sous-commandes.mjs +5 -1
  132. package/scripts/style-a-l-ecriture.mjs +48 -17
  133. package/scripts/superviseur.mjs +127 -75
  134. package/scripts/tableau.mjs +133 -10
  135. package/scripts/taches-du-graphe.mjs +33 -13
  136. package/scripts/ticket-du-circuit.mjs +40 -0
  137. package/scripts/transitions.mjs +159 -29
  138. package/scripts/verrou-de-fichier.mjs +6 -2
  139. package/scripts/verrou-de-machine.mjs +123 -39
  140. package/scripts/verrous/commande.mjs +50 -17
  141. package/scripts/verrous/ticket-du-sous-agent.mjs +9 -3
  142. package/scripts/verrous/verrou.mjs +42 -14
  143. package/skills/developpeur/SKILL.md +1 -1
  144. package/skills/explorateur/SKILL.md +8 -2
  145. package/skills/grill/SKILL.md +3 -57
  146. package/skills/grill/references/paquets.md +60 -0
  147. package/skills/mesure/SKILL.md +3 -0
  148. package/skills/pitmaster/SKILL.md +16 -27
  149. package/skills/questionneur/SKILL.md +1 -1
  150. package/skills/relecteur/SKILL.md +2 -2
  151. package/skills/testwriter/SKILL.md +19 -7
  152. package/skills/release/SKILL.md +0 -134
  153. package/skills/release/scripts/update-version.cjs +0 -92
@@ -504,25 +504,35 @@ export function sorteDuPlan(fiche) {
504
504
  function erreurs(schema, valeur, ou) {
505
505
  const nom = ou || 'la fiche';
506
506
  if (schema.type === 'object') {
507
- if (!valeur || typeof valeur !== 'object' || Array.isArray(valeur))
507
+ if (!valeur || typeof valeur !== 'object' || Array.isArray(valeur)) {
508
508
  return [`${nom} : un objet`];
509
+ }
509
510
  const out = [];
510
511
  for (const k of schema.required ?? []) {
511
- if (!(k in valeur)) out.push(`${ou ? `${ou}.` : ''}${k} : manque`);
512
+ if (!(k in valeur)) {
513
+ out.push(`${ou ? `${ou}.` : ''}${k} : manque`);
514
+ }
512
515
  }
513
516
  for (const [k, v] of Object.entries(valeur)) {
514
517
  const sous = schema.properties[k];
515
518
  const chemin = `${ou ? `${ou}.` : ''}${k}`;
516
- if (!sous) out.push(`${chemin} : hors du schéma`);
517
- else out.push(...erreurs(sous, v, chemin));
519
+ if (!sous) {
520
+ out.push(`${chemin} : hors du schéma`);
521
+ } else {
522
+ out.push(...erreurs(sous, v, chemin));
523
+ }
518
524
  }
519
525
  return out;
520
526
  }
521
527
  if (schema.type === 'array') {
522
- if (!Array.isArray(valeur)) return [`${nom} : une liste`];
528
+ if (!Array.isArray(valeur)) {
529
+ return [`${nom} : une liste`];
530
+ }
523
531
  return valeur.flatMap((v, i) => erreurs(schema.items, v, `${ou}[${i}]`));
524
532
  }
525
- if (typeof valeur !== 'string') return [`${nom} : un texte`];
533
+ if (typeof valeur !== 'string') {
534
+ return [`${nom} : un texte`];
535
+ }
526
536
  if (schema.enum && !schema.enum.includes(valeur)) {
527
537
  return [`${nom} : « ${valeur} » n'est pas l'un de ${schema.enum.join(', ')}`];
528
538
  }
@@ -561,13 +571,17 @@ export function conformiteDuLot(fiche, { elements, fichiers }) {
561
571
  const ids = new Set(elements.map(e => e.id));
562
572
  const hors = new Set(fichiers ?? []);
563
573
  const duLot = element => {
564
- if (ids.has(element) || hors.has(element)) return true;
574
+ if (ids.has(element) || hors.has(element)) {
575
+ return true;
576
+ }
565
577
  const diese = element.lastIndexOf('#');
566
578
  return diese > 0 && diese < element.length - 1 && hors.has(element.slice(0, diese));
567
579
  };
568
580
  const fautes = [];
569
581
  const sans = elements.filter(e => !lignes.some(l => l.element === e.id)).map(e => e.id);
570
- if (sans.length) fautes.push(`conformite : sans ligne pour ${sans.join(', ')}`);
582
+ if (sans.length) {
583
+ fautes.push(`conformite : sans ligne pour ${sans.join(', ')}`);
584
+ }
571
585
  for (const [i, l] of lignes.entries()) {
572
586
  if (!duLot(l.element)) {
573
587
  fautes.push(`conformite[${i}].element : ${l.element} n'est pas un élément du lot`);
@@ -610,10 +624,14 @@ export function cleDuConstat(titre) {
610
624
  // (<titres>), as the author answers in each thread of a review: a FAIT without the answer to one,
611
625
  // by its title (a BLOQUÉ or a BESOIN stops the circuit before any review). The fault, or null.
612
626
  export function reponsesAuxConstats(fiche, titres) {
613
- if (fiche.statut !== 'FAIT') return null;
627
+ if (fiche.statut !== 'FAIT') {
628
+ return null;
629
+ }
614
630
  const repondus = new Set((fiche.reponses ?? []).map(r => cleDuConstat(r.titre)));
615
631
  const sans = titres.filter(t => !repondus.has(t)).map(t => `« ${t} »`);
616
- if (!sans.length) return null;
632
+ if (!sans.length) {
633
+ return null;
634
+ }
617
635
  return `reponses : sans réponse ${sans.length > 1 ? 'aux constats' : 'au constat'} ${sans.join(', ')}`;
618
636
  }
619
637
 
@@ -629,7 +647,9 @@ export function suiviDesConstats(fiche, titres) {
629
647
  return `suivi : sans ligne pour ${sans.length > 1 ? 'les constats' : 'le constat'} ${liste(sans)}`;
630
648
  }
631
649
  const tenus = fiche.verdict === 'ACCEPTÉ' ? titres.filter(t => etats.get(t) !== 'levé') : [];
632
- if (!tenus.length) return null;
650
+ if (!tenus.length) {
651
+ return null;
652
+ }
633
653
  return `suivi : un ACCEPTÉ tient ${tenus.length > 1 ? 'les constats' : 'le constat'} ${liste(tenus)} non levé${tenus.length > 1 ? 's' : ''}`;
634
654
  }
635
655
 
@@ -641,10 +661,15 @@ export function conformiteDuTri(fiche, decouvertes) {
641
661
  const lignes = (fiche.verdicts ?? []).map(l => l.decouverte);
642
662
  const fautes = [];
643
663
  const sans = decouvertes.filter(d => !lignes.includes(d));
644
- if (sans.length) fautes.push(`verdicts : sans ligne pour ${sans.join(', ')}`);
664
+ if (sans.length) {
665
+ fautes.push(`verdicts : sans ligne pour ${sans.join(', ')}`);
666
+ }
645
667
  for (const d of new Set(lignes)) {
646
- if (!decouvertes.includes(d)) fautes.push(`verdicts : ${d} n'est pas une découverte du ticket`);
647
- else if (lignes.filter(x => x === d).length > 1) fautes.push(`verdicts : ${d} a deux lignes`);
668
+ if (!decouvertes.includes(d)) {
669
+ fautes.push(`verdicts : ${d} n'est pas une découverte du ticket`);
670
+ } else if (lignes.filter(x => x === d).length > 1) {
671
+ fautes.push(`verdicts : ${d} a deux lignes`);
672
+ }
648
673
  }
649
674
  return fautes.length ? fautes.join(' ; ') : null;
650
675
  }
@@ -661,7 +686,9 @@ export function conformiteDuTri(fiche, decouvertes) {
661
686
  export function lirePiece(texte) {
662
687
  const t = String(texte ?? '').trim();
663
688
  const ticket = /^ticket\s*,\s*/i.exec(t);
664
- if (ticket) return pieceDuTicket(t.slice(ticket[0].length));
689
+ if (ticket) {
690
+ return pieceDuTicket(t.slice(ticket[0].length));
691
+ }
665
692
  if (t.startsWith('$ ')) {
666
693
  const vrai = t.indexOf('\n');
667
694
  const saut = vrai < 0 ? t.indexOf('\\n') : vrai;
@@ -670,15 +697,25 @@ export function lirePiece(texte) {
670
697
  return commande && sortie ? { commande, sortie } : null;
671
698
  }
672
699
  let lieu = t.split(/\s/)[0];
673
- while (lieu && '`.,;:)'.includes(lieu.at(-1))) lieu = lieu.slice(0, -1);
674
- while (lieu.startsWith('`')) lieu = lieu.slice(1);
700
+ while (lieu && '`.,;:)'.includes(lieu.at(-1))) {
701
+ lieu = lieu.slice(0, -1);
702
+ }
703
+ while (lieu.startsWith('`')) {
704
+ lieu = lieu.slice(1);
705
+ }
675
706
  const deux = lieu.lastIndexOf(':');
676
707
  const [debut, fin, ...reste] = lieu.slice(deux + 1).split('-');
677
708
  const nombre = n => (/^\d+$/.test(n ?? '') && Number(n) >= 1 ? Number(n) : null);
678
709
  const ligne = nombre(debut);
679
- if (deux < 1 || !ligne || reste.length) return null;
680
- if (fin === undefined) return { fichier: lieu.slice(0, deux), ligne };
681
- if (!nombre(fin) || nombre(fin) < ligne) return null;
710
+ if (deux < 1 || !ligne || reste.length) {
711
+ return null;
712
+ }
713
+ if (fin === undefined) {
714
+ return { fichier: lieu.slice(0, deux), ligne };
715
+ }
716
+ if (!nombre(fin) || nombre(fin) < ligne) {
717
+ return null;
718
+ }
682
719
  return { fichier: lieu.slice(0, deux), ligne, fin: nombre(fin) };
683
720
  }
684
721
 
@@ -687,8 +724,12 @@ export function lirePiece(texte) {
687
724
  // piece cites one criterion: « critère 1 et 7 » is none.
688
725
  function pieceDuTicket(reste) {
689
726
  const critere = /^critère\s+([1-9]\d*)(?!\d)(?!\s*(?:et|,)\s*\d)(?:$|[\s.,;:])/i.exec(reste);
690
- if (critere) return { critere: Number(critere[1]) };
691
- if (!reste.startsWith('§')) return null;
727
+ if (critere) {
728
+ return { critere: Number(critere[1]) };
729
+ }
730
+ if (!reste.startsWith('§')) {
731
+ return null;
732
+ }
692
733
  const apres = reste.slice(1).trim();
693
734
  const cite = /^«\s*([^»]*?)\s*»/.exec(apres);
694
735
  const section = (cite ? cite[1] : apres.split(/\s:(?:\s|$)|:$/)[0]).trim();
@@ -712,7 +753,9 @@ function introuvables(f, copie) {
712
753
  const racine = path.resolve(copie);
713
754
  for (const [ou, p] of piecesDe(f)) {
714
755
  const lu = lirePiece(p);
715
- if (!lu?.fichier) continue;
756
+ if (!lu?.fichier) {
757
+ continue;
758
+ }
716
759
  const abs = path.resolve(racine, lu.fichier);
717
760
  const lieu = `${lu.fichier}:${lu.ligne}${lu.fin ? `-${lu.fin}` : ''}`;
718
761
  if (!abs.startsWith(`${racine}${path.sep}`) || !existsSync(abs) || !statSync(abs).isFile()) {
@@ -746,7 +789,9 @@ function horsDuTicket(f, description) {
746
789
  continue;
747
790
  }
748
791
  const numero = /^\s*(\d+)[.)]\s/.exec(ligne);
749
- if (dedans && numero) criteres.add(Number(numero[1]));
792
+ if (dedans && numero) {
793
+ criteres.add(Number(numero[1]));
794
+ }
750
795
  }
751
796
  const out = [];
752
797
  for (const [ou, p] of piecesDe(f)) {
@@ -776,8 +821,12 @@ function horsDuTicket(f, description) {
776
821
  function manques(role, f) {
777
822
  const out = [];
778
823
  const plein = k => typeof f[k] === 'string' && f[k].trim() !== '';
779
- if (f.statut === 'BLOQUÉ' && !plein('raison')) out.push('raison : manque, pour BLOQUÉ');
780
- if (f.statut === 'BESOIN' && !plein('question')) out.push('question : manque, pour BESOIN');
824
+ if (f.statut === 'BLOQUÉ' && !plein('raison')) {
825
+ out.push('raison : manque, pour BLOQUÉ');
826
+ }
827
+ if (f.statut === 'BESOIN' && !plein('question')) {
828
+ out.push('question : manque, pour BESOIN');
829
+ }
781
830
  if (['BLOQUÉ', 'BESOIN'].includes(f.statut) && !('piece' in f)) {
782
831
  out.push(`piece : manque, pour ${f.statut}`);
783
832
  }
@@ -829,7 +878,9 @@ function manques(role, f) {
829
878
  }
830
879
  }
831
880
  if (role === 'explorateur') {
832
- if (!(f.paquets ?? []).length) out.push('paquets : manque, pour un plan');
881
+ if (!(f.paquets ?? []).length) {
882
+ out.push('paquets : manque, pour un plan');
883
+ }
833
884
  for (const [i, r] of (f.reponses ?? []).entries()) {
834
885
  if (!/^[1-9]\d*$/.test(r.numero)) {
835
886
  out.push(`reponses[${i}].numero : « ${r.numero} » n'est pas le numéro d'une question`);
@@ -838,7 +889,9 @@ function manques(role, f) {
838
889
  }
839
890
  if (role === 'tri') {
840
891
  for (const [i, l] of (f.verdicts ?? []).entries()) {
841
- if (!l.texte.trim()) out.push(`verdicts[${i}].texte : manque, pour ${l.verdict}`);
892
+ if (!l.texte.trim()) {
893
+ out.push(`verdicts[${i}].texte : manque, pour ${l.verdict}`);
894
+ }
842
895
  if (VERDICTS_PROUVES.includes(l.verdict) && !('piece' in l)) {
843
896
  out.push(
844
897
  `verdicts[${i}].piece : manque, pour ${l.verdict} : « $ <commande> » rejouée sur main et sa sortie, ou fichier:ligne ; sans elle, le verdict est non-confirmee`
@@ -861,7 +914,9 @@ function manques(role, f) {
861
914
  // the description of the ticket, each piece of the ticket names a criterion or a section of it.
862
915
  export function lireFiche(role, sortie, { copie, ticket } = {}) {
863
916
  const schema = schemaDeFiche(role);
864
- if (!schema) return { erreur: `le rôle ${role} n'a pas de fiche` };
917
+ if (!schema) {
918
+ return { erreur: `le rôle ${role} n'a pas de fiche` };
919
+ }
865
920
  let resultat;
866
921
  try {
867
922
  resultat = JSON.parse(String(sortie ?? ''));
@@ -873,16 +928,26 @@ export function lireFiche(role, sortie, { copie, ticket } = {}) {
873
928
  }
874
929
  const fiche = resultat.structured_output;
875
930
  const fautes = erreurs(schema, fiche, '');
876
- if (!fautes.length) fautes.push(...manques(role, fiche));
877
- if (!fautes.length && copie) fautes.push(...introuvables(fiche, copie));
878
- if (!fautes.length && typeof ticket === 'string') fautes.push(...horsDuTicket(fiche, ticket));
879
- if (fautes.length) return { erreur: `fiche non conforme : ${fautes.join(' ; ')}` };
931
+ if (!fautes.length) {
932
+ fautes.push(...manques(role, fiche));
933
+ }
934
+ if (!fautes.length && copie) {
935
+ fautes.push(...introuvables(fiche, copie));
936
+ }
937
+ if (!fautes.length && typeof ticket === 'string') {
938
+ fautes.push(...horsDuTicket(fiche, ticket));
939
+ }
940
+ if (fautes.length) {
941
+ return { erreur: `fiche non conforme : ${fautes.join(' ; ')}` };
942
+ }
880
943
  return { fiche, seance: resultat.session_id ?? null };
881
944
  }
882
945
 
883
946
  // The directory of the package of <racine> that holds <fichier> (from the root), null for none.
884
947
  function paquetDe(racine, fichier) {
885
- if (!fichier) return null;
948
+ if (!fichier) {
949
+ return null;
950
+ }
886
951
  const p = paquets(racine)
887
952
  .filter(({ dossier }) => fichier === dossier || fichier.startsWith(`${dossier}/`))
888
953
  .sort((a, b) => b.dossier.length - a.dossier.length)[0];
@@ -932,7 +997,9 @@ let numero = 0;
932
997
  // its path, or null without the variable.
933
998
  export function ecrireSarif({ garde, constats, racine = process.cwd(), env = process.env }) {
934
999
  const dossier = env[RESULTATS];
935
- if (!dossier) return null;
1000
+ if (!dossier) {
1001
+ return null;
1002
+ }
936
1003
  const f = path.join(dossier, SARIF, `${garde}-${process.pid}-${++numero}.sarif`);
937
1004
  mkdirSync(path.dirname(f), { recursive: true });
938
1005
  writeFileSync(f, `${JSON.stringify(sarif({ garde, constats, racine }), null, 2)}\n`);
@@ -987,8 +1054,9 @@ export function lireSarif(dossier) {
987
1054
  if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) {
988
1055
  const [option, role] = process.argv.slice(2);
989
1056
  const schema = option === '--schema' ? schemaDeFiche(role) : null;
990
- if (schema) process.stdout.write(`${JSON.stringify(schema)}\n`);
991
- else {
1057
+ if (schema) {
1058
+ process.stdout.write(`${JSON.stringify(schema)}\n`);
1059
+ } else {
992
1060
  process.stderr.write(
993
1061
  option === '--schema'
994
1062
  ? `⛔ le rôle ${role} n'a pas de fiche.\n`
@@ -82,7 +82,10 @@ export class SeanceAnnulee extends Error {
82
82
  }
83
83
  }
84
84
 
85
- const FORT = ['--modele', 'opus', '--effort', 'high'];
85
+ // The model of each session under the envelope is named by the circuit, never taken from the
86
+ // account; no session fixes the effort, which stays adaptive.
87
+ const SONNET = ['--modele', 'sonnet'];
88
+ const FORT = ['--modele', 'opus'];
86
89
 
87
90
  const LANCEUR = path.join(import.meta.dirname, 'enveloppe', 'lancer.sh');
88
91
 
@@ -281,7 +284,7 @@ export async function lancer(
281
284
  args: [
282
285
  // GRILLHOUSE_LANCEUR names a launcher of trial in place of lancer.sh, as CLAUDE_BIN does claude.
283
286
  process.env.GRILLHOUSE_LANCEUR || LANCEUR,
284
- ...(fort ? FORT : []),
287
+ ...(fort ? FORT : SONNET),
285
288
  ...(ouvre ? ['--seance', ouvre] : []),
286
289
  ...(reprend ? ['--reprise', reprend] : []),
287
290
  // The schema of its sheet when it is not its role's (the explorateur's gesture).
@@ -560,7 +563,8 @@ export async function seance(
560
563
  role,
561
564
  {
562
565
  tentative,
563
- rapport,
566
+ rapport: rapportBrut,
567
+ fichiers = null,
564
568
  fort,
565
569
  derniere,
566
570
  change,
@@ -572,6 +576,11 @@ export async function seance(
572
576
  ...activite
573
577
  }
574
578
  ) {
579
+ // A resumption at the step that carries a red (`fichiers`, the files the red names): the session
580
+ // carries these files alone, the rest of the lot being green.
581
+ const rapport = fichiers?.length
582
+ ? `${rapportBrut ?? ''}\n\nCette séance ne porte que ${fichiers.join(', ')} : le reste du lot est vert et ne se touche pas.`.trim()
583
+ : rapportBrut;
575
584
  const nom = nomDuRole(role);
576
585
  const reprise = tentative > 1 && !derniere && gardee?.agent === role ? gardee : null;
577
586
  const { tache, ouverts, constats, valider, repondre } = constatsDeLaSeance(
@@ -628,7 +637,7 @@ export async function seance(
628
637
  `reprise de la séance ${reprise.seance} finie en erreur : séance neuve et entière.`
629
638
  );
630
639
  }
631
- const lots = lectures.lots();
640
+ const lots = fichiers?.length ? fichiers : lectures.lots();
632
641
  const { description, notes } = leTicket(ctx);
633
642
  // The last handover of this agent; for a developpeur without one yet, the testwriter's last.
634
643
  const passation =
@@ -756,6 +765,15 @@ export function seanceLancee(ctx, role, r) {
756
765
  `La transcription de la séance du ${role} n'a pas bougé en ${minutes ? `${minutes} min` : `${ctx.immobileMs} ms`} : la séance est arrêtée. Les dernières lignes du journal :\n\n${fin(lire(ctx.journal), 40)}`
757
766
  );
758
767
  }
768
+ // The envelope's refusal (a line of the error stream that begins with `bwrap: `) of a session
769
+ // that wrote no transcript: the launch died before its session, as bwrap says.
770
+ const refus = (r.erreur ?? '').split('\n').find(l => l.startsWith('bwrap: '));
771
+ if (refus !== undefined && r.seance !== 0 && derniereTrace(ctx.transcriptions) === 0) {
772
+ throw new Arret(
773
+ 'lancement',
774
+ `L'enveloppe refuse le lancement de la séance du ${role} (code ${r.seance ?? r.code}).\n${refus.trim()}\n\n${fin(lire(ctx.journal), 20)}`
775
+ );
776
+ }
759
777
  if (r.seance === null) {
760
778
  throw new Arret(
761
779
  'lancement',
@@ -21,6 +21,7 @@ export { paquetsSansPackageJson } from './paquet-npm.mjs';
21
21
  export {
22
22
  cheminsDeLaTache,
23
23
  construireDepuisLesArguments,
24
+ empreintesDesTaches,
24
25
  GRAPHE_JOUE,
25
26
  lancerLesTaches,
26
27
  nomDuPaquet,
@@ -27,6 +27,7 @@ const SCRIPTS = path.dirname(fileURLToPath(import.meta.url));
27
27
  // Each subcommand and its script, under `scripts/`, or the command of the module of the language
28
28
  // that runs it (`{ langage }`, its name in `commandes`).
29
29
  export const SOUS_COMMANDES = {
30
+ 'attente-au-tour': 'attente-au-tour.mjs',
30
31
  bilan: 'bilan.mjs',
31
32
  circuit: '../dist/temporal/circuit/commande.js',
32
33
  commande: 'verrous/commande.mjs',
@@ -44,6 +45,7 @@ export const SOUS_COMMANDES = {
44
45
  'langages-des-paquets': 'langages-des-paquets.mjs',
45
46
  integrer: 'integration/integrer.mjs',
46
47
  lancer: 'enveloppe/lancer.sh',
48
+ journal: 'journal.mjs',
47
49
  'ligne-etat': 'ligne-etat/ligne-etat.mjs',
48
50
  maj: 'grillhouse-maj.mjs',
49
51
  nuit: 'nuit.sh',
@@ -97,7 +99,9 @@ export function sousCommandes(racine = process.cwd()) {
97
99
  */
98
100
  export function commandeDe(nom, racine = process.cwd()) {
99
101
  const s = Object.hasOwn(SOUS_COMMANDES, nom) ? SOUS_COMMANDES[nom] : null;
100
- if (typeof s === 'string') return { script: path.join(SCRIPTS, s), args: [] };
102
+ if (typeof s === 'string') {
103
+ return { script: path.join(SCRIPTS, s), args: [] };
104
+ }
101
105
  const commandes = langageDe(racine).commandes(racine);
102
106
  const n = s?.langage ?? (DU_NOYAU.has(nom) ? null : nom);
103
107
  return n !== null && Object.hasOwn(commandes, n) ? commandes[n] : null;
@@ -48,21 +48,32 @@ const AVEC_VALEUR = new Set([
48
48
  // The patterns and the extensions the script <script> names for the tool <outil> (`prettier` or
49
49
  // `eslint`), or null when the script does not run it.
50
50
  function motifsDuScript(script, outil) {
51
- if (typeof script !== 'string') return null;
51
+ if (typeof script !== 'string') {
52
+ return null;
53
+ }
52
54
  const mots = (script.match(/"[^"]*"|'[^']*'|\S+/g) ?? []).map(m =>
53
55
  m.replace(/^(["'])(.*)\1$/, '$2')
54
56
  );
55
57
  const i = mots.findIndex(m => m === outil || m.endsWith(`/${outil}`));
56
- if (i < 0) return null;
58
+ if (i < 0) {
59
+ return null;
60
+ }
57
61
  const motifs = [];
58
62
  const ext = [];
59
63
  for (let j = i + 1; j < mots.length; j++) {
60
64
  const m = mots[j];
61
- if (['&&', '||', ';', '|'].includes(m)) break;
62
- if (m === '--ext') ext.push(...String(mots[++j] ?? '').split(','));
63
- else if (m.startsWith('--ext=')) ext.push(...m.slice(6).split(','));
64
- else if (AVEC_VALEUR.has(m)) j++;
65
- else if (!m.startsWith('-')) motifs.push(m.replace(/^\.\//, ''));
65
+ if (['&&', '||', ';', '|'].includes(m)) {
66
+ break;
67
+ }
68
+ if (m === '--ext') {
69
+ ext.push(...String(mots[++j] ?? '').split(','));
70
+ } else if (m.startsWith('--ext=')) {
71
+ ext.push(...m.slice(6).split(','));
72
+ } else if (AVEC_VALEUR.has(m)) {
73
+ j++;
74
+ } else if (!m.startsWith('-')) {
75
+ motifs.push(m.replace(/^\.\//, ''));
76
+ }
66
77
  }
67
78
  return { motifs, ext: ext.filter(Boolean).map(e => (e.startsWith('.') ? e : `.${e}`)) };
68
79
  }
@@ -72,9 +83,13 @@ function motifsDuScript(script, outil) {
72
83
  // decides, when given, which files of a folder count).
73
84
  function couvre(rel, motifs, extension) {
74
85
  return motifs.some(m => {
75
- if (/[*?[\]{}]/.test(m)) return path.matchesGlob(rel, m);
86
+ if (/[*?[\]{}]/.test(m)) {
87
+ return path.matchesGlob(rel, m);
88
+ }
76
89
  const net = m.replace(/\/+$/, '');
77
- if (net === '.' || net === '') return extension(rel);
90
+ if (net === '.' || net === '') {
91
+ return extension(rel);
92
+ }
78
93
  return rel === net || (rel.startsWith(`${net}/`) && extension(rel));
79
94
  });
80
95
  }
@@ -91,7 +106,9 @@ function paquetDe(projet, fichier) {
91
106
  return null;
92
107
  }
93
108
  }
94
- if (dossier === projet || path.dirname(dossier) === dossier) return null;
109
+ if (dossier === projet || path.dirname(dossier) === dossier) {
110
+ return null;
111
+ }
95
112
  dossier = path.dirname(dossier);
96
113
  }
97
114
  }
@@ -106,9 +123,13 @@ async function main() {
106
123
  } catch {
107
124
  return [];
108
125
  }
109
- if (!['Write', 'Edit', 'MultiEdit'].includes(entree?.tool_name)) return [];
126
+ if (!['Write', 'Edit', 'MultiEdit'].includes(entree?.tool_name)) {
127
+ return [];
128
+ }
110
129
  const brut = entree.tool_input?.file_path;
111
- if (typeof brut !== 'string') return [];
130
+ if (typeof brut !== 'string') {
131
+ return [];
132
+ }
112
133
  const projet = realpathSync(process.env.CLAUDE_PROJECT_DIR || process.cwd());
113
134
  let fichier;
114
135
  try {
@@ -116,9 +137,13 @@ async function main() {
116
137
  } catch {
117
138
  return [];
118
139
  }
119
- if (!fichier.startsWith(`${projet}${path.sep}`)) return [];
140
+ if (!fichier.startsWith(`${projet}${path.sep}`)) {
141
+ return [];
142
+ }
120
143
  const paquet = paquetDe(projet, fichier);
121
- if (!paquet) return [];
144
+ if (!paquet) {
145
+ return [];
146
+ }
122
147
  const rel = path.relative(paquet.dossier, fichier).split(path.sep).join('/');
123
148
  const depuisRacine = path.relative(projet, fichier).split(path.sep).join('/');
124
149
 
@@ -149,9 +174,13 @@ async function main() {
149
174
  const eslint = fix => new ESLint({ cwd: paquet.dossier, fix });
150
175
  const juger = async fix => {
151
176
  const moteur = eslint(fix);
152
- if (await moteur.isPathIgnored(fichier)) return null;
177
+ if (await moteur.isPathIgnored(fichier)) {
178
+ return null;
179
+ }
153
180
  const [resultat] = await moteur.lintFiles([fichier]);
154
- if (fix) await ESLint.outputFixes([resultat]);
181
+ if (fix) {
182
+ await ESLint.outputFixes([resultat]);
183
+ }
155
184
  return resultat;
156
185
  };
157
186
  let dernier = null;
@@ -196,7 +225,9 @@ async function main() {
196
225
  for (const m of resultat?.messages ?? []) {
197
226
  if (m.severity === 2) {
198
227
  dit(m.line ?? 1, m.column ?? 1, m.ruleId ?? 'erreur', m.message);
199
- if (m.fatal) fatale = true;
228
+ if (m.fatal) {
229
+ fatale = true;
230
+ }
200
231
  }
201
232
  }
202
233
  } catch (e) {