@roomi-fields/grillhouse 0.29.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 (263) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/CHANGELOG.md +769 -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/bin/grillhouse.mjs +79 -18
  8. package/cadre/templates/projet/.github/workflows/ci.yml +2 -13
  9. package/cadre/templates/projet/CLAUDE.md +5 -1
  10. package/cadre/templates/projet/docs/agents/issue-tracker.md +1 -1
  11. package/cadre/templates/projet/package.json +2 -2
  12. package/charte.md +24 -0
  13. package/dist/temporal/acte.d.ts +24 -0
  14. package/dist/temporal/acte.js +139 -0
  15. package/dist/temporal/acte.js.map +1 -0
  16. package/dist/temporal/attributs.d.ts +6 -0
  17. package/dist/temporal/attributs.js +15 -0
  18. package/dist/temporal/attributs.js.map +1 -0
  19. package/dist/temporal/circuit/activites.d.ts +13 -0
  20. package/dist/temporal/circuit/activites.js +33 -0
  21. package/dist/temporal/circuit/activites.js.map +1 -0
  22. package/dist/temporal/circuit/client.d.ts +72 -0
  23. package/dist/temporal/circuit/client.js +247 -0
  24. package/dist/temporal/circuit/client.js.map +1 -0
  25. package/dist/temporal/circuit/commande.d.ts +2 -0
  26. package/dist/temporal/circuit/commande.js +238 -0
  27. package/dist/temporal/circuit/commande.js.map +1 -0
  28. package/dist/temporal/circuit/contrat.d.ts +305 -0
  29. package/dist/temporal/circuit/contrat.js +30 -0
  30. package/dist/temporal/circuit/contrat.js.map +1 -0
  31. package/dist/temporal/circuit/deroule.d.ts +3 -0
  32. package/dist/temporal/circuit/deroule.js +540 -0
  33. package/dist/temporal/circuit/deroule.js.map +1 -0
  34. package/dist/temporal/client.d.ts +47 -0
  35. package/dist/temporal/client.js +69 -0
  36. package/dist/temporal/client.js.map +1 -0
  37. package/dist/temporal/commande.d.ts +2 -0
  38. package/dist/temporal/commande.js +94 -0
  39. package/dist/temporal/commande.js.map +1 -0
  40. package/dist/temporal/deroules.d.ts +5 -0
  41. package/dist/temporal/deroules.js +10 -0
  42. package/dist/temporal/deroules.js.map +1 -0
  43. package/dist/temporal/etat.d.ts +33 -0
  44. package/dist/temporal/etat.js +59 -0
  45. package/dist/temporal/etat.js.map +1 -0
  46. package/dist/temporal/file/activites.d.ts +10 -0
  47. package/dist/temporal/file/activites.js +25 -0
  48. package/dist/temporal/file/activites.js.map +1 -0
  49. package/dist/temporal/file/client.d.ts +4 -0
  50. package/dist/temporal/file/client.js +6 -0
  51. package/dist/temporal/file/client.js.map +1 -0
  52. package/dist/temporal/file/contrat.d.ts +158 -0
  53. package/dist/temporal/file/contrat.js +14 -0
  54. package/dist/temporal/file/contrat.js.map +1 -0
  55. package/dist/temporal/file/deroule.d.ts +15 -0
  56. package/dist/temporal/file/deroule.js +235 -0
  57. package/dist/temporal/file/deroule.js.map +1 -0
  58. package/dist/temporal/installation.d.ts +120 -0
  59. package/dist/temporal/installation.js +386 -0
  60. package/dist/temporal/installation.js.map +1 -0
  61. package/dist/temporal/places/activites.d.ts +8 -0
  62. package/dist/temporal/places/activites.js +13 -0
  63. package/dist/temporal/places/activites.js.map +1 -0
  64. package/dist/temporal/places/client.d.ts +28 -0
  65. package/dist/temporal/places/client.js +64 -0
  66. package/dist/temporal/places/client.js.map +1 -0
  67. package/dist/temporal/places/contrat.d.ts +106 -0
  68. package/dist/temporal/places/contrat.js +21 -0
  69. package/dist/temporal/places/contrat.js.map +1 -0
  70. package/dist/temporal/places/deroule.d.ts +3 -0
  71. package/dist/temporal/places/deroule.js +198 -0
  72. package/dist/temporal/places/deroule.js.map +1 -0
  73. package/dist/temporal/sonde/activites.d.ts +6 -0
  74. package/dist/temporal/sonde/activites.js +52 -0
  75. package/dist/temporal/sonde/activites.js.map +1 -0
  76. package/dist/temporal/sonde/contrat.d.ts +35 -0
  77. package/dist/temporal/sonde/contrat.js +10 -0
  78. package/dist/temporal/sonde/contrat.js.map +1 -0
  79. package/dist/temporal/sonde/deroule.d.ts +3 -0
  80. package/dist/temporal/sonde/deroule.js +39 -0
  81. package/dist/temporal/sonde/deroule.js.map +1 -0
  82. package/dist/temporal/tickets/activites.d.ts +7 -0
  83. package/dist/temporal/tickets/activites.js +81 -0
  84. package/dist/temporal/tickets/activites.js.map +1 -0
  85. package/dist/temporal/tickets/client.d.ts +10 -0
  86. package/dist/temporal/tickets/client.js +31 -0
  87. package/dist/temporal/tickets/client.js.map +1 -0
  88. package/dist/temporal/tickets/contrat.d.ts +56 -0
  89. package/dist/temporal/tickets/contrat.js +13 -0
  90. package/dist/temporal/tickets/contrat.js.map +1 -0
  91. package/dist/temporal/tickets/deroule.d.ts +3 -0
  92. package/dist/temporal/tickets/deroule.js +94 -0
  93. package/dist/temporal/tickets/deroule.js.map +1 -0
  94. package/dist/temporal/travailleur.d.ts +2 -0
  95. package/dist/temporal/travailleur.js +69 -0
  96. package/dist/temporal/travailleur.js.map +1 -0
  97. package/docs/ARCHITECTURE.md +646 -87
  98. package/docs/CADRE.md +27 -0
  99. package/docs/INTERFACE.md +139 -42
  100. package/hooks/crochet.mjs +19 -2
  101. package/hooks/hooks.json +11 -0
  102. package/package.json +16 -4
  103. package/scripts/activites.mjs +2255 -0
  104. package/scripts/aiguillage.d.mts +37 -0
  105. package/scripts/aiguillage.mjs +40 -14
  106. package/scripts/avancement.mjs +155 -26
  107. package/scripts/bilan.mjs +137 -43
  108. package/scripts/cadre.mjs +16 -4
  109. package/scripts/circuit.mjs +993 -4075
  110. package/scripts/circuits-cles.d.mts +4 -0
  111. package/scripts/circuits-cles.mjs +21 -0
  112. package/scripts/circuits-du-serveur.mjs +105 -0
  113. package/scripts/codes-de-sortie.mjs +9 -0
  114. package/scripts/commandes-composees.mjs +45 -41
  115. package/scripts/commandes-du-path.d.mts +7 -0
  116. package/scripts/commandes-du-path.mjs +25 -0
  117. package/scripts/composants-affectes.mjs +64 -21
  118. package/scripts/composition-des-langages.mjs +18 -12
  119. package/scripts/conformite.mjs +56 -28
  120. package/scripts/copies-finies.mjs +52 -47
  121. package/scripts/depart-du-ticket.d.mts +53 -0
  122. package/scripts/depart-du-ticket.mjs +124 -0
  123. package/scripts/dependances-internes.mjs +121 -0
  124. package/scripts/dernier-vert.mjs +61 -34
  125. package/scripts/dette.mjs +32 -11
  126. package/scripts/donnees-cles.mjs +244 -0
  127. package/scripts/droits.mjs +51 -16
  128. package/scripts/effets.mjs +352 -0
  129. package/scripts/empreinte-d-etape.mjs +17 -0
  130. package/scripts/engendres.mjs +15 -5
  131. package/scripts/enveloppe/enveloppe.mjs +259 -55
  132. package/scripts/enveloppe/lancer.sh +14 -18
  133. package/scripts/enveloppe/paquets-du-plan.mjs +2 -2
  134. package/scripts/enveloppe/travail-de-la-copie.mjs +41 -13
  135. package/scripts/etapes.mjs +5 -2
  136. package/scripts/faits-du-circuit.mjs +493 -0
  137. package/scripts/file-des-tickets.d.mts +21 -0
  138. package/scripts/file-des-tickets.mjs +58 -0
  139. package/scripts/flux-des-paquets.mjs +201 -0
  140. package/scripts/gardes-du-cadre.mjs +21 -5
  141. package/scripts/init.mjs +11 -4
  142. package/scripts/integration/file.mjs +544 -434
  143. package/scripts/integration/integrer.mjs +87 -43
  144. package/scripts/integration/rejeu.mjs +45 -13
  145. package/scripts/jointure.d.ts +151 -28
  146. package/scripts/langages/cargo/commandes.mjs +383 -124
  147. package/scripts/langages/cargo/composants.mjs +154 -42
  148. package/scripts/langages/cargo/exemples.mjs +12 -21
  149. package/scripts/langages/cargo/index.mjs +22 -8
  150. package/scripts/langages/cargo/sccache.mjs +8 -14
  151. package/scripts/langages/cargo/tests-de-head.mjs +25 -9
  152. package/scripts/langages/python/commandes.mjs +218 -100
  153. package/scripts/langages/python/composants.mjs +53 -21
  154. package/scripts/langages/python/exemples.mjs +6 -16
  155. package/scripts/langages/python/index.mjs +28 -8
  156. package/scripts/langages/python/lot.mjs +1 -36
  157. package/scripts/langages/typescript/chemins-des-tests.mjs +6 -2
  158. package/scripts/langages/typescript/composants.mjs +9 -3
  159. package/scripts/langages/typescript/consommateurs-arbitres.mjs +40 -14
  160. package/scripts/langages/typescript/consommateurs.mjs +39 -14
  161. package/scripts/langages/typescript/construire.mjs +6 -163
  162. package/scripts/langages/typescript/elements-du-lot.mjs +36 -12
  163. package/scripts/langages/typescript/exemples.mjs +3 -11
  164. package/scripts/langages/typescript/frontieres.mjs +66 -22
  165. package/scripts/langages/typescript/index-interfaces.mjs +36 -13
  166. package/scripts/langages/typescript/index.mjs +50 -61
  167. package/scripts/langages/typescript/interfaces-contre-code.mjs +113 -45
  168. package/scripts/langages/typescript/lecteurs.mjs +36 -11
  169. package/scripts/langages/typescript/migrations/0.23.0-config-vitest.mjs +15 -5
  170. package/scripts/langages/typescript/migrations/0.25.0-chemins-des-tests.mjs +6 -2
  171. package/scripts/langages/typescript/migrations/0.25.0-tailles-des-tests.mjs +6 -2
  172. package/scripts/langages/typescript/migrations/0.30.0-prefixe-des-tickets.mjs +63 -0
  173. package/scripts/langages/typescript/migrations/0.30.0-tailles-des-outils-lourds.mjs +33 -0
  174. package/scripts/langages/typescript/migrations/0.30.0-titres-nommant-un-ticket.mjs +40 -0
  175. package/scripts/langages/typescript/mise-a-jour.mjs +1 -2
  176. package/scripts/langages/typescript/parcours.mjs +12 -4
  177. package/scripts/langages/typescript/regle-des-tests.mjs +9 -3
  178. package/scripts/langages/typescript/resumes.mjs +9 -3
  179. package/scripts/langages/typescript/tailles-des-tests.mjs +93 -20
  180. package/scripts/langages/typescript/tests-de-nuit.mjs +15 -10
  181. package/scripts/langages/typescript/tests.mjs +40 -15
  182. package/scripts/langages/typescript/titres-de-tests.mjs +320 -0
  183. package/scripts/langages/typescript/turbo-des-paquets.mjs +327 -81
  184. package/scripts/langages/typescript/verdict.mjs +4 -2
  185. package/scripts/langages/typescript/verifier.mjs +58 -20
  186. package/scripts/langages/typescript/vitest-config/avancement.reporter.mjs +15 -5
  187. package/scripts/langages/typescript/vitest-config/base.mjs +29 -3
  188. package/scripts/langages/typescript/vitest-config/bornes.mjs +13 -0
  189. package/scripts/langages/typescript/vitest-config/changements.mjs +21 -8
  190. package/scripts/langages/typescript/vitest-config/cibles.mjs +36 -14
  191. package/scripts/langages/typescript/vitest-config/delais.mjs +60 -0
  192. package/scripts/langages/typescript/vitest-config/delais.setup.mjs +11 -0
  193. package/scripts/langages/typescript/vitest-config/duree.classement.mjs +108 -0
  194. package/scripts/langages/typescript/vitest-config/duree.reporter.mjs +56 -59
  195. package/scripts/langages/typescript/vitest-config/lances.mjs +83 -27
  196. package/scripts/langages/typescript/vitest-config/machine.setup.mjs +10 -0
  197. package/scripts/langages/typescript/vitest-config/resultats.mjs +3 -1
  198. package/scripts/langages/typescript/vitest.nuit.config.mjs +4 -0
  199. package/scripts/lint-des-scripts.mjs +58 -0
  200. package/scripts/mesure/base-de-passe.mjs +117 -25
  201. package/scripts/mesure/pression.mjs +12 -6
  202. package/scripts/mesure-de-la-machine.d.mts +21 -0
  203. package/scripts/mesure-de-la-machine.mjs +76 -0
  204. package/scripts/migrations/0.23.0-charte-importee.mjs +6 -2
  205. package/scripts/migrations/0.23.0-crochets-de-seance.mjs +25 -8
  206. package/scripts/migrations/0.23.0-marche-du-projet.mjs +18 -6
  207. package/scripts/migrations/0.23.2-copies-du-cadre.mjs +56 -18
  208. package/scripts/migrations/0.24.12-tri-des-decouvertes.mjs +6 -2
  209. package/scripts/migrations/0.25.0-script-des-tests.mjs +15 -5
  210. package/scripts/migrations/0.30.0-ci-appelle-la-verification.mjs +124 -0
  211. package/scripts/migrations/0.31.0-paquets-dans-le-graphe.mjs +81 -0
  212. package/scripts/migrations.mjs +5 -0
  213. package/scripts/nuit.sh +25 -3
  214. package/scripts/outil.mjs +3 -1
  215. package/scripts/outils-cles.d.mts +24 -0
  216. package/scripts/outils-cles.mjs +18 -8
  217. package/scripts/paquet-npm.mjs +157 -0
  218. package/scripts/paquet.mjs +73 -4
  219. package/scripts/paquets.mjs +46 -10
  220. package/scripts/passe-de-la-machine.mjs +71 -0
  221. package/scripts/places-de-la-machine.mjs +414 -0
  222. package/scripts/places-du-serveur.mjs +170 -0
  223. package/scripts/prefixe-des-tickets.mjs +68 -0
  224. package/scripts/preparation.mjs +25 -8
  225. package/scripts/registre.mjs +9 -4
  226. package/scripts/regles-des-places.d.mts +36 -0
  227. package/scripts/regles-des-places.mjs +70 -0
  228. package/scripts/reponses-du-circuit.d.mts +6 -0
  229. package/scripts/reponses-du-circuit.mjs +28 -0
  230. package/scripts/reprise.mjs +66 -0
  231. package/scripts/resultats.mjs +112 -46
  232. package/scripts/retirer-les-copies-finies.mjs +25 -0
  233. package/scripts/sans-reponse.d.mts +4 -0
  234. package/scripts/sans-reponse.mjs +13 -0
  235. package/scripts/seances.mjs +936 -0
  236. package/scripts/services-du-noyau.mjs +27 -8
  237. package/scripts/session-start.sh +2 -2
  238. package/scripts/sortie.mjs +3 -3
  239. package/scripts/sous-commandes.mjs +41 -10
  240. package/scripts/style-a-l-ecriture.mjs +260 -0
  241. package/scripts/superviseur.mjs +122 -111
  242. package/scripts/tableau.mjs +180 -117
  243. package/scripts/taches-du-graphe.mjs +348 -0
  244. package/scripts/ticket-du-circuit.mjs +216 -0
  245. package/scripts/transitions.d.mts +148 -0
  246. package/scripts/transitions.mjs +1018 -0
  247. package/scripts/verrou-de-fichier.mjs +8 -4
  248. package/scripts/verrou-de-machine.mjs +150 -51
  249. package/scripts/verrous/commande.mjs +50 -17
  250. package/scripts/verrous/ticket-du-sous-agent.mjs +9 -3
  251. package/scripts/verrous/verrou.mjs +42 -14
  252. package/skills/explorateur/SKILL.md +9 -2
  253. package/skills/grill/SKILL.md +1 -1
  254. package/skills/mesure/SKILL.md +3 -0
  255. package/skills/pitmaster/SKILL.md +17 -18
  256. package/skills/pitmaster/references/consigne-agent.md +5 -1
  257. package/skills/release/SKILL.md +3 -3
  258. package/skills/relecteur/SKILL.md +5 -3
  259. package/skills/testwriter/SKILL.md +49 -31
  260. package/scripts/demon.mjs +0 -251
  261. package/scripts/integration/file-attente.mjs +0 -61
  262. package/scripts/langages/cargo/touches.mjs +0 -93
  263. package/scripts/langages/typescript/script-des-tests.mjs +0 -6
@@ -19,15 +19,15 @@
19
19
  // roles of the flow that ran on it and the reviewer's last verdict (`ACCEPTÉ` or `RENDU` at the
20
20
  // start of a comment).
21
21
  // - Circuits: one entry per open ticket whose circuit (scripts/circuit.mjs) runs or stopped, read
22
- // in its state `.claude/worktrees/<ticket>.circuit.json`: it runs while the process its state
23
- // names runs (`processus`, the same one by its start `depart`), and stands at the step of its
24
- // state, with its attempt, every step one for the whole ticket; while the explorateur or
25
- // the questionneur works on its plan (its state names that work, `questionnement`, of the
26
- // plan), it stands at the plan (1); waiting for the supervisor (`attendLeSuperviseur`, the one
27
- // rule the opening and the wait of the questions read too: stopped, « à repasser » included, but
28
- // by the supervisor's « arrete », or dead without a final state), it stands under the stopped
22
+ // from the Temporal server in one call (scripts/circuits-du-serveur.mjs, the memo of its
23
+ // workflow): it runs while its workflow runs with no question awaited, and stands at the step of
24
+ // its last state, with its attempt, every step one for the whole ticket; while the explorateur
25
+ // or the questionneur works on its plan (`questionnement`, of the plan), it stands at the plan
26
+ // (1); waiting for the supervisor (`attendLeSuperviseur`, the one rule the opening and the wait
27
+ // of the questions read too: stopped, « à repasser » included, but by the supervisor's
28
+ // « arrete », or ended without its issue), it stands under the stopped
29
29
  // step after a line « ⤷ Question · <qui> », who must answer it, the supervisor or the owner, the
30
- // supervisor when its state names no question; its card opens on that question, or on the stop
30
+ // supervisor when it names no question; its card opens on that question, or on the stop
31
31
  // (its name and code) and the first line of its reason. A ticket with a circuit waits in no
32
32
  // block.
33
33
  // - Bilans: the card of a ticket whose circuit kept its bilan (scripts/bilan.mjs,
@@ -73,7 +73,7 @@
73
73
  // machine), « 🔒 <sorte> · <projet> · <ticket> · faits/prévus · <durée> » since it took the
74
74
  // lock, « ⚠ <sorte> figée <durée> · … » past FIGEE without a sign of its progress; then each
75
75
  // pass that waits for the lock or for room under /tmp, the oldest first, « ⏳ <sorte> ·
76
- // <projet> · <ticket> · attend · <durée> ». The ticket shows without its prefix and its epic
76
+ // <projet> · <ticket> · attend · <durée> ». The ticket shows without its prefix
77
77
  // (`courtDuTicket`). Such a line is marked `avancement`, which the pane measures again more
78
78
  // often. A circuit that waits shows ⏳ on its ticket's line, ▶ while it waits for nothing.
79
79
  // - Signs: each sign keeps one sense (the owner's decision of 2026-11-01): ▶ in progress, ⏸ a
@@ -114,8 +114,9 @@ import {
114
114
  import { echecDeLOutil } from './aiguillage.mjs';
115
115
  import { bilansGardes, enBref } from './bilan.mjs';
116
116
  import { verdictDe } from './integration/verdict.mjs';
117
- import { lireAvancement, lireLaMesure } from './avancement.mjs';
118
- import { leMemeVivant } from './mesure/base-de-passe.mjs';
117
+ import { lireLaMesure } from './avancement.mjs';
118
+ import { SANS_REPONSE_EN, ServeurMuet, circuitsDuServeur } from './circuits-du-serveur.mjs';
119
+ import { etatDesPlaces } from './places-de-la-machine.mjs';
119
120
 
120
121
  const MINUTE = 60_000;
121
122
  export const SILENCE = 10 * MINUTE;
@@ -597,66 +598,11 @@ export function lireVivant({ racine, home, prefix, maintenant, ps, cache = {} })
597
598
  return vivants;
598
599
  }
599
600
 
600
- // The circuits of the repository at <racine>: each state `.claude/worktrees/<ticket>.circuit.json`
601
- // scripts/circuit.mjs writes, but those at « integre », with `vivant` when the process its state
602
- // names lives (`processus`, the same one by its start `depart`: a circuit is a daemon, apart from
603
- // the command that launched it), `questionnement` the object of the work on the plan
604
- // under way (`plan`), null without one, `question` the whole question of a circuit ended on one
605
- // and `qui` who must answer it (`superviseur` or `responsable`), null without one,
606
- // the counters of its bounded loops (`boucles`, by their key), the progress of the automatic pass under way (`avancement`, read in the directory its state
607
- // names, scripts/avancement.mjs: `{ faits, prevus, dernier }`, null without one), and `interrompu`
608
- // for a circuit dead without a final state (its process gone, neither a stop nor a code written,
609
- // as a circuit killed with the group of control that held it, grillhouse-mwz): its question, to
610
- // the supervisor, gives the command that resumes it; `processus` and `depart` as the state names
611
- // them, null without them, which tell one run of a circuit from the next. A state that does not
612
- // parse is left out.
613
- export function lireCircuits({ racine }) {
614
- const dossier = path.join(racine, '.claude', 'worktrees');
615
- const out = [];
616
- for (const f of fichiers(dossier, '.circuit.json')) {
617
- let e;
618
- try {
619
- e = JSON.parse(readFileSync(f, 'utf8'));
620
- } catch {
621
- continue;
622
- }
623
- if (!e || e.etape === 'integre') {
624
- continue;
625
- }
626
- const ticket = path.basename(f, '.circuit.json');
627
- const vivant = leMemeVivant(e.processus, e.depart);
628
- const interrompu = !vivant && (e.code ?? null) === null && !e.raison;
629
- out.push({
630
- ticket,
631
- etape: e.etape ?? null,
632
- tentative: e.tentative ?? null,
633
- finale: e.finale === true,
634
- code: e.code ?? null,
635
- arret: e.raison ?? null,
636
- raison: premiereLigne(e.rapport),
637
- question: interrompu
638
- ? `Le circuit est mort sans état final : son processus est parti, aucun arrêt écrit. \`npx grillhouse circuit ${ticket} --reprendre\` le reprend.`
639
- : String(e.question?.question ?? '').trim() || null,
640
- qui: interrompu ? SUPERVISEUR : e.question ? String(e.question.qui ?? SUPERVISEUR) : null,
641
- questionnement: e.questionnement?.objet ?? null,
642
- boucles: e.boucles && typeof e.boucles === 'object' ? e.boucles : {},
643
- mene:
644
- typeof e.mene === 'string' && !Number.isNaN(Date.parse(e.mene)) ? Date.parse(e.mene) : null,
645
- avancement:
646
- typeof e.avancement?.dossier === 'string' ? lireAvancement(e.avancement.dossier) : null,
647
- vivant,
648
- interrompu,
649
- processus: e.processus ?? null,
650
- depart: e.depart ?? null,
651
- });
652
- }
653
- return out;
654
- }
655
-
656
601
  /**
657
- * Whether the circuit <c>, as `lireCircuits` reads it, waits for the supervisor: its process gone,
658
- * dead without a final state, on a question, or stopped (any stop but the supervisor's own
659
- * « arrete », « à repasser » included: the supervisor resumes it once the machine is free). The
602
+ * Whether the circuit <c>, as scripts/circuits-du-serveur.mjs reads it, waits for the supervisor:
603
+ * not running on its own, and ended without its issue, on a question, or stopped (any stop but the
604
+ * supervisor's own « arrete », « à repasser » included: the supervisor resumes it once the machine
605
+ * is free). The
660
606
  * one rule of the questions that wait for the supervisor (grillhouse-pq6), which the board reads,
661
607
  * and `questionsEnAttente` of scripts/superviseur.mjs, the one source of the opening and of the
662
608
  * wait of the questions.
@@ -666,13 +612,6 @@ export function lireCircuits({ racine }) {
666
612
  export const attendLeSuperviseur = c =>
667
613
  !c.vivant && Boolean(c.interrompu || c.question || (c.arret && c.arret !== 'arrete'));
668
614
 
669
- // The first line of a report that is not blank, or null.
670
- const premiereLigne = r =>
671
- String(r ?? '')
672
- .split('\n')
673
- .map(x => x.trim())
674
- .find(Boolean) ?? null;
675
-
676
615
  // The reviewer's last verdict among a ticket's comments (verdictDe: a comment of the reviewer's
677
616
  // author), or null.
678
617
  export function verdict(commentaires) {
@@ -743,10 +682,17 @@ export function lecture(t, prefix) {
743
682
  /**
744
683
  * The board, from what was read. Pure: every source comes in, the time included; `machine`, the
745
684
  * lock of the machine; `outil`, the failed installation of the published version that leads the
746
- * repository (scripts/aiguillage.mjs `echecDeLOutil`).
685
+ * repository (scripts/aiguillage.mjs `echecDeLOutil`); `places`, the places of the machine
686
+ * (scripts/places-de-la-machine.mjs `etatDesPlaces`), whose line heads AGENTS; `muet`, the Temporal
687
+ * server did not answer the reading of the circuits, which the first alert says; `faute`, any
688
+ * other fault of that reading, said in the first alert as it is; `echecPrefixe`, the cause of a
689
+ * ticket prefix that did not read, named in an alert.
747
690
  * @param {{ tous: any[], prefix?: string, registre: any[], vivants: any[], circuits?: any[],
748
691
  * verdicts?: Record<string, any>, maintenant: number, jour: number,
749
- * machine?: Machine | null, outil?: { version: string, raison: string } | null }} lu
692
+ * machine?: Machine | null, outil?: { version: string, raison: string } | null,
693
+ * places?: { prises: number, plafond: number, charge: number, coeurs: number, memoireGo: number,
694
+ * attentes: { ticket: string, depuis: number }[] } | null, muet?: boolean, faute?: string | null,
695
+ * echecPrefixe?: string | null }} lu
750
696
  */
751
697
  export function assembler({
752
698
  tous,
@@ -759,6 +705,10 @@ export function assembler({
759
705
  jour,
760
706
  machine = null,
761
707
  outil = null,
708
+ places: placesDeLaMachine = null,
709
+ muet = false,
710
+ faute = null,
711
+ echecPrefixe = null,
762
712
  }) {
763
713
  // A circuit's lines are its steps, no agent's passage.
764
714
  const etapesFinies = lignesDuRegistre.filter(r => r.role === ROLE_DU_CIRCUIT);
@@ -795,8 +745,13 @@ export function assembler({
795
745
  for (const l of enfants.values()) {
796
746
  l.sort(ordre);
797
747
  }
798
- // The circuits of the open tickets; a ticket whose circuit runs is in progress.
799
- const parCircuit = new Map(circuits.filter(c => ouvert(c.ticket)).map(c => [c.ticket, c]));
748
+ // The circuits of the open tickets, and the running ones of the closed tickets (the queue closes
749
+ // a ticket before it reads the CI); a ticket whose circuit runs is in progress.
750
+ const parCircuit = new Map(
751
+ circuits
752
+ .filter(c => ouvert(c.ticket) || (c.vivant && parId.has(c.ticket)))
753
+ .map(c => [c.ticket, c])
754
+ );
800
755
  const actifs = new Set([
801
756
  ...enCoursMesures.map(v => v.ticket).filter(Boolean),
802
757
  ...[...parCircuit.values()].filter(c => c.vivant).map(c => c.ticket),
@@ -815,12 +770,12 @@ export function assembler({
815
770
  // A ticket's state: done, in progress, deferred, awaiting validation; else, with the owner's go,
816
771
  // waiting (ready) or blocked (an open ticket it depends on); without it, awaiting his go.
817
772
  const etat = t => {
818
- if (t.status === 'closed') {
819
- return 'fermes';
820
- }
821
773
  if (t.status === 'in_progress' || actifs.has(t.id)) {
822
774
  return 'enCours';
823
775
  }
776
+ if (t.status === 'closed') {
777
+ return 'fermes';
778
+ }
824
779
  if (t.status === 'deferred') {
825
780
  return 'reportes';
826
781
  }
@@ -1043,7 +998,9 @@ export function assembler({
1043
998
  }
1044
999
  const debutJour = jour;
1045
1000
  const faitsDuJour = tous
1046
- .filter(t => travail(t) && t.closed_at && Date.parse(t.closed_at) >= debutJour)
1001
+ .filter(
1002
+ t => travail(t) && !actifs.has(t.id) && t.closed_at && Date.parse(t.closed_at) >= debutJour
1003
+ )
1047
1004
  .sort((a, b) => Date.parse(b.closed_at) - Date.parse(a.closed_at))
1048
1005
  .map(t => ({
1049
1006
  id: t.id,
@@ -1054,6 +1011,17 @@ export function assembler({
1054
1011
 
1055
1012
  // Alerts.
1056
1013
  const alertes = [];
1014
+ // The Temporal server does not answer: the board shows the tickets without their circuits, and
1015
+ // its first alert names the command that tells the state of the service.
1016
+ if (muet) {
1017
+ alertes.push({ niveau: 'rouge', texte: `${SANS_REPONSE_EN} · temporal etat` });
1018
+ } else if (faute) {
1019
+ alertes.push({ niveau: 'rouge', texte: `Circuits illisibles : ${faute}` });
1020
+ }
1021
+ // The ticket prefix did not read: the project keeps its folder's name, and the alert says why.
1022
+ if (echecPrefixe) {
1023
+ alertes.push({ niveau: 'rouge', texte: `Préfixe des tickets illisible : ${echecPrefixe}` });
1024
+ }
1057
1025
  // A red night says the night it turned red, short enough to stand whole on its line: the local
1058
1026
  // day and month its ticket was opened, the night's date (scripts/nuit.sh), whatever its title names, a
1059
1027
  // commit in older ones.
@@ -1141,6 +1109,7 @@ export function assembler({
1141
1109
  agents: blocs,
1142
1110
  maintenant,
1143
1111
  machine,
1112
+ places: placesDeLaMachine,
1144
1113
  faitsDuJour,
1145
1114
  etats,
1146
1115
  parTicket,
@@ -1238,13 +1207,10 @@ const couperAvant = (gauche, suite, droite, largeur) => {
1238
1207
  // The sign of the alert <a>: its kind's (`signe`: 🌙 a red night, 💤 a ticket claimed with
1239
1208
  // nothing running), ⚠ for the others.
1240
1209
  const signeDe = a => a.signe ?? '⚠';
1241
- // A ticket's short name on the line of the lock, whatever its project: its id after the prefix,
1242
- // without the epic's part when it has children's numbers, « bp-mono-vbwf.320.11 » → « 320.11 »,
1243
- // « grillhouse-wui » → « wui ».
1244
- const courtDuTicket = id => {
1245
- const n = id.slice(id.lastIndexOf('-') + 1);
1246
- return n.includes('.') ? n.slice(n.indexOf('.') + 1) : n;
1247
- };
1210
+ // A ticket's short name on the line of the lock, whatever its project: its id without the
1211
+ // project's prefix, which the line already names, « bp-mono-vbwf.320.11 » → « vbwf.320.11 »,
1212
+ // « SH-ae6.5 » → « ae6.5 ».
1213
+ const courtDuTicket = id => id.slice(id.lastIndexOf('-') + 1);
1248
1214
  // The board's lines, `largeur` columns wide, each with its tone (titre, alerte, attention, actif,
1249
1215
  // discret, or none), its section (`section`: agents, chantier or faits, in that order) and, for a
1250
1216
  // ticket's line, its id (`ticket`), which the pane makes selectable; an epic's line is marked
@@ -1331,6 +1297,21 @@ export function lignes(t, nom, largeur = LARGEUR, groupes = {}) {
1331
1297
  // alert. Then each wait, the oldest first, « ⏳ <sorte> · <projet> · <ticket> · attend ·
1332
1298
  // <durée> ». The project and the ticket are cut, never the figures nor the time.
1333
1299
  const maintenant = t.maintenant ?? Date.now();
1300
+ // The places of the machine (scripts/places-de-la-machine.mjs), the first line of AGENTS:
1301
+ // « Places 3/3 · charge 11,2/12 · mémoire 9 Go », the places taken of the ceiling, the load over
1302
+ // one minute of the cores, the free memory.
1303
+ const p = t.places;
1304
+ if (p) {
1305
+ const nb = n => (Number.isInteger(n) ? String(n) : n.toFixed(1).replace('.', ','));
1306
+ poser({
1307
+ texte: cadre(
1308
+ `Places ${p.prises}/${p.plafond} · charge ${nb(p.charge)}/${p.coeurs} · mémoire ${p.memoireGo} Go`,
1309
+ '',
1310
+ largeur
1311
+ ),
1312
+ ton: p.charge >= p.coeurs ? 'attention' : 'discret',
1313
+ });
1314
+ }
1334
1315
  const deQui = x => `${x.sorte} · ${x.projet}${x.ticket ? ` · ${courtDuTicket(x.ticket)}` : ''}`;
1335
1316
  const tenu = t.machine?.detenteur;
1336
1317
  if (tenu) {
@@ -1370,6 +1351,11 @@ export function lignes(t, nom, largeur = LARGEUR, groupes = {}) {
1370
1351
  }
1371
1352
  // The tickets whose circuit waits for the lock or for room.
1372
1353
  const enAttente = new Set((t.machine?.attentes ?? []).map(w => w.ticket).filter(Boolean));
1354
+ // The tickets whose circuit waits for a place of the machine.
1355
+ const attendUnePlace = new Set((p?.attentes ?? []).map(w => w.ticket).filter(Boolean));
1356
+ for (const id of attendUnePlace) {
1357
+ enAttente.add(id);
1358
+ }
1373
1359
  // The tree of the steps (scripts/etapes.mjs), in its order, as a pipeline of GitLab CI shows its
1374
1360
  // stages and folds the jobs of a stage that has nothing: a step with sub-steps is folded
1375
1361
  // (« ▸ 2 · Composants ») while none of them holds a ticket, unfolded (« ▾ ») once one does, all
@@ -1440,11 +1426,14 @@ export function lignes(t, nom, largeur = LARGEUR, groupes = {}) {
1440
1426
  // in their place otherwise.
1441
1427
  const reste = avec =>
1442
1428
  largeur - (droite ? colonnes(droite) + 1 : 0) - colonnes(tete) - colonnes(avec);
1443
- const suite = !temoin
1444
- ? boucles
1445
- : reste(`${boucles}${temoin.texte}`) >= Math.min(PLACE_DU_SUJET, c.sujet.length)
1446
- ? `${boucles}${temoin.texte}`
1447
- : temoin.texte;
1429
+ const place = attendUnePlace.has(c.id) ? ' · attend une place' : '';
1430
+ const suite = `${
1431
+ !temoin
1432
+ ? boucles
1433
+ : reste(`${boucles}${temoin.texte}`) >= Math.min(PLACE_DU_SUJET, c.sujet.length)
1434
+ ? `${boucles}${temoin.texte}`
1435
+ : temoin.texte
1436
+ }${place}`;
1448
1437
  poser({
1449
1438
  texte: couperAvant(`${tete}${c.sujet}`, suite, droite, largeur),
1450
1439
  ton: temoin?.fige ? 'alerte' : c.vivant ? 'actif' : 'attention',
@@ -1743,6 +1732,7 @@ export function fiches(
1743
1732
  bilans = {}
1744
1733
  ) {
1745
1734
  const arretes = new Map(circuits.filter(c => !c.vivant).map(c => [c.ticket, c]));
1735
+ const liens = new Map(circuits.filter(c => c.lien).map(c => [c.ticket, c.lien]));
1746
1736
  const ids = new Set(lignesDuTableau.map(l => l.ticket).filter(Boolean));
1747
1737
  const out = {};
1748
1738
  for (const t of tous) {
@@ -1755,15 +1745,20 @@ export function fiches(
1755
1745
  .filter(x => x && !x.startsWith('#'))
1756
1746
  .join(' ');
1757
1747
  // A stopped circuit's card opens on its question and who must answer it, or on where it
1758
- // stopped and why.
1748
+ // stopped and why; a circuit whose workflow ended without its issue, on the answers the client
1749
+ // accepts (`reponse`), named once.
1759
1750
  const a = arretes.get(t.id);
1751
+ const reprise = a?.sansIssue && a.reponse ? ` \`${a.reponse}\` le reprend.` : '';
1760
1752
  const tete = a?.question
1761
- ? `Question · ${a.qui ?? SUPERVISEUR} : ${a.question.replace(/\s+/g, ' ')} `
1753
+ ? `Question · ${a.qui ?? SUPERVISEUR} : ${a.question.replace(/\s+/g, ' ')}${reprise} `
1762
1754
  : a
1763
1755
  ? `Circuit arrêté en ${ouEnEst(a)} : ${a.raison ?? 'le circuit ne tourne plus'} `
1764
1756
  : '';
1765
1757
  const chiffres = bilans[t.id] ? `${enBref(bilans[t.id])} ` : '';
1766
1758
  const texte = `${tete}${chiffres}${resume}`;
1759
+ // The card of a ticket with a circuit ends on the page of its workflow on the web UI of the
1760
+ // server, whole, after the text.
1761
+ const lien = liens.has(t.id) ? `\nTemporal : ${liens.get(t.id)}` : '';
1767
1762
  out[t.id] = {
1768
1763
  numero: lecture(t, prefix).numero,
1769
1764
  titre: lecture(t, prefix).sujet,
@@ -1771,7 +1766,7 @@ export function fiches(
1771
1766
  statut: t.status,
1772
1767
  travail: mesures[t.id]?.travail ?? 0,
1773
1768
  jetons: mesures[t.id]?.jetons ?? 0,
1774
- resume: texte.length > 400 ? `${texte.slice(0, 399)}…` : texte,
1769
+ resume: `${texte.length > 400 ? `${texte.slice(0, 399)}…` : texte}${lien}`,
1775
1770
  };
1776
1771
  }
1777
1772
  return out;
@@ -1843,18 +1838,32 @@ const bdJson = (racine, ...args) => {
1843
1838
  }
1844
1839
  };
1845
1840
 
1846
- // What the board reads of the repository at <racine>: its tickets, its prefix, its running agents
1847
- // and its assembled board (`t`), with the folder git keeps its shared files in (`commun`).
1848
- function lire(racine, { home, maintenant, machine = null }) {
1841
+ // What the board reads of the repository at <racine>, its circuits <circuits> read: its tickets,
1842
+ // its prefix, its running agents and its assembled board (`t`), with the folder git keeps its
1843
+ // shared files in (`commun`).
1844
+ function lire(
1845
+ racine,
1846
+ { home, maintenant, circuits, muet = false, faute = null, machine = null, places = null }
1847
+ ) {
1848
+ // The prefix is read once, with no delay of its own; a read that fails leaves it empty (the
1849
+ // project is labelled by its folder) and its cause is named in an alert (`echecPrefixe`).
1849
1850
  let prefix = '';
1851
+ let echecPrefixe = null;
1850
1852
  try {
1851
1853
  prefix = execFileSync('bd', ['config', 'get', 'issue_prefix'], {
1852
1854
  cwd: racine,
1853
1855
  encoding: 'utf8',
1856
+ stdio: ['ignore', 'pipe', 'pipe'],
1854
1857
  maxBuffer: 256 * 1024 * 1024,
1855
1858
  }).trim();
1856
- } catch {
1859
+ } catch (e) {
1857
1860
  prefix = '';
1861
+ const message = String(e?.stderr ?? '').trim() || String(e?.message ?? e);
1862
+ const ligne = message.split('\n')[0];
1863
+ echecPrefixe =
1864
+ e?.status === null || e?.status === undefined
1865
+ ? `${e?.code ?? 'échec'} ${ligne}`.trim()
1866
+ : `code ${e.status} ${ligne}`.trim();
1858
1867
  }
1859
1868
  let ps = '';
1860
1869
  try {
@@ -1910,7 +1919,6 @@ function lire(racine, { home, maintenant, machine = null }) {
1910
1919
  ps,
1911
1920
  cache,
1912
1921
  });
1913
- const circuits = lireCircuits({ racine });
1914
1922
  try {
1915
1923
  if (fichierCache) {
1916
1924
  writeFileSync(
@@ -1933,11 +1941,26 @@ function lire(racine, { home, maintenant, machine = null }) {
1933
1941
  maintenant,
1934
1942
  jour: minuit.getTime(),
1935
1943
  machine,
1944
+ places,
1945
+ muet,
1946
+ faute,
1947
+ echecPrefixe,
1936
1948
  outil: echecDeLOutil(racine),
1937
1949
  });
1938
1950
  return { t, prefix, tous, vivants, commun };
1939
1951
  }
1940
1952
 
1953
+ // The places of the machine as the board shows them (`etatDesPlaces`), null when they do not read
1954
+ // (a faulty GRILLHOUSE_PLACES, a server of the places that does not answer): the board then shows
1955
+ // no line of places.
1956
+ function lireLesPlaces() {
1957
+ try {
1958
+ return etatDesPlaces();
1959
+ } catch {
1960
+ return null;
1961
+ }
1962
+ }
1963
+
1941
1964
  // The boards of several projects as one (grillhouse-erp.1), as the multi-root explorer of VS Code
1942
1965
  // keeps one view and files each root under its name: <lus> holds each project's label
1943
1966
  // (`etiquette`, its ticket prefix) and its board (`t`) or the fault that keeps it out (`erreur`),
@@ -1969,6 +1992,7 @@ export function ensemble(lus) {
1969
1992
  }),
1970
1993
  maintenant: premier.t.maintenant,
1971
1994
  machine: premier.t.machine,
1995
+ places: premier.t.places,
1972
1996
  faitsDuJour: tous('faitsDuJour'),
1973
1997
  etats: premier.t.etats.map(e => ({
1974
1998
  ...e,
@@ -1982,17 +2006,32 @@ export function ensemble(lus) {
1982
2006
 
1983
2007
  // A project beside the session's, read in its folder <dossier>: its board, or the fault that keeps
1984
2008
  // it out, on one line.
1985
- function lireUnAutre(dossier, o) {
2009
+ async function lireUnAutre(dossier, { circuitsDe, ...o }) {
1986
2010
  try {
1987
2011
  if (!existsSync(dossier)) {
1988
2012
  throw new Error('dossier introuvable');
1989
2013
  }
1990
- return { dossier, ...lire(dossier, o) };
2014
+ return {
2015
+ dossier,
2016
+ ...lire(dossier, { ...o, circuits: (await lesCircuits(circuitsDe, dossier)).circuits }),
2017
+ };
1991
2018
  } catch (e) {
1992
2019
  return { dossier, erreur: String(e.message ?? e).split('\n')[0] };
1993
2020
  }
1994
2021
  }
1995
2022
 
2023
+ // The circuits of the repository at <racine> by the reader <circuitsDe>; none when the reading
2024
+ // fails, the board shows the rest: the server stayed silent (`muet`, `ServeurMuet`), or another
2025
+ // fault, a client not built among them, by the first line of its message (`faute`).
2026
+ async function lesCircuits(circuitsDe, racine) {
2027
+ try {
2028
+ return { circuits: await circuitsDe(racine), muet: false, faute: null };
2029
+ } catch (e) {
2030
+ const muet = e instanceof ServeurMuet;
2031
+ return { circuits: [], muet, faute: muet ? null : String(e?.message ?? e).split('\n')[0] };
2032
+ }
2033
+ }
2034
+
1996
2035
  /**
1997
2036
  * The lock of the machine <machine> with each project named as the board names it: <noms> gives
1998
2037
  * the name of each project of the board by the root of its main tree (`depot`); a project out of
@@ -2015,16 +2054,39 @@ export function nommerLesProjets(machine, noms) {
2015
2054
  // The board of the repository at <racine>; with <projets>, the folders of other projects, the
2016
2055
  // board of them all (`ensemble`), named « <dépôt> + <projet> + … », with the folder of each
2017
2056
  // ticket's project (`dossiers`), where the pane runs Beads for it. The status line is the
2018
- // session's project's alone.
2019
- export function tableau(
2057
+ // session's project's alone. Each project's circuits are read by <circuitsDe> (one call to the
2058
+ // Temporal server, scripts/circuits-du-serveur.mjs, by default).
2059
+ /**
2060
+ * @param {string} racine
2061
+ * @param {{ home?: string, maintenant?: number, projets?: string[],
2062
+ * circuitsDe?: (racine: string) => Promise<object[]> }} [o]
2063
+ */
2064
+ export async function tableau(
2020
2065
  racine,
2021
- { home = os.homedir(), maintenant = Date.now(), projets = [] } = {}
2066
+ {
2067
+ home = os.homedir(),
2068
+ maintenant = Date.now(),
2069
+ projets = [],
2070
+ circuitsDe = circuitsDuServeur,
2071
+ } = {}
2022
2072
  ) {
2073
+ const [{ circuits, muet, faute }, ...autres] = await Promise.all([
2074
+ lesCircuits(circuitsDe, racine),
2075
+ ...projets.map(d => lireUnAutre(d, { home, maintenant, circuitsDe })),
2076
+ ]);
2023
2077
  const ici = {
2024
2078
  dossier: racine,
2025
- ...lire(racine, { home, maintenant, machine: lireLaMesure(process.env) }),
2079
+ ...lire(racine, {
2080
+ home,
2081
+ maintenant,
2082
+ circuits,
2083
+ muet,
2084
+ faute,
2085
+ machine: lireLaMesure(process.env),
2086
+ places: lireLesPlaces(),
2087
+ }),
2026
2088
  };
2027
- const lus = [ici, ...projets.map(d => lireUnAutre(d, { home, maintenant }))];
2089
+ const lus = [ici, ...autres];
2028
2090
  const etiquette = l => l.prefix || path.basename(l.dossier);
2029
2091
  // The lock of the machine names each project of the board as the board does: the session's by
2030
2092
  // its folder, another by its label; the root of its main tree, its common git directory's parent.
@@ -2087,10 +2149,11 @@ if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) {
2087
2149
  .slice(2)
2088
2150
  .filter(a => a !== '--texte')
2089
2151
  .map(d => path.resolve(d));
2090
- const t = tableau(process.cwd(), { projets });
2091
- process.stdout.write(
2092
- process.argv.includes('--texte')
2093
- ? `${t.lignes.map(l => l.texte).join('\n')}\n`
2094
- : JSON.stringify(t)
2152
+ void tableau(process.cwd(), { projets }).then(t =>
2153
+ process.stdout.write(
2154
+ process.argv.includes('--texte')
2155
+ ? `${t.lignes.map(l => l.texte).join('\n')}\n`
2156
+ : JSON.stringify(t)
2157
+ )
2095
2158
  );
2096
2159
  }