@roomi-fields/grillhouse 0.50.3 → 0.52.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/CHANGELOG.md +68 -0
  3. package/agents/developpeur.md +1 -1
  4. package/agents/direct.md +1 -1
  5. package/agents/explorateur.md +1 -1
  6. package/agents/questionneur.md +1 -1
  7. package/agents/relecteur.md +1 -1
  8. package/agents/testwriter.md +1 -1
  9. package/cadre/templates/c/package.json +1 -0
  10. package/cadre/templates/cargo/package.json +1 -0
  11. package/cadre/templates/python/package.json +1 -0
  12. package/charte/plan.md +47 -0
  13. package/charte/preuve.md +39 -0
  14. package/charte/superviseur.md +61 -0
  15. package/charte/tests.md +38 -0
  16. package/charte.md +39 -189
  17. package/dist/machine/part-par-sorte.d.ts +16 -0
  18. package/dist/machine/part-par-sorte.js +36 -0
  19. package/dist/machine/part-par-sorte.js.map +1 -0
  20. package/dist/temporal/circuit/appel.js +1 -1
  21. package/dist/temporal/circuit/appel.js.map +1 -1
  22. package/dist/temporal/circuit/client.d.ts +4 -4
  23. package/dist/temporal/circuit/client.js +38 -16
  24. package/dist/temporal/circuit/client.js.map +1 -1
  25. package/dist/temporal/circuit/contrat.d.ts +11 -7
  26. package/dist/temporal/circuit/contrat.js +5 -9
  27. package/dist/temporal/circuit/contrat.js.map +1 -1
  28. package/dist/temporal/circuit/deroule.js +18 -6
  29. package/dist/temporal/circuit/deroule.js.map +1 -1
  30. package/dist/temporal/commande.js +12 -3
  31. package/dist/temporal/commande.js.map +1 -1
  32. package/dist/temporal/installation.d.ts +54 -3
  33. package/dist/temporal/installation.js +187 -17
  34. package/dist/temporal/installation.js.map +1 -1
  35. package/dist/temporal/places/client.d.ts +5 -1
  36. package/dist/temporal/places/client.js +23 -11
  37. package/dist/temporal/places/client.js.map +1 -1
  38. package/docs/ARCHITECTURE.md +23 -2700
  39. package/docs/INTERFACE.md +26 -10
  40. package/docs/architecture/circuit.md +61 -14
  41. package/docs/architecture/entree.md +21 -8
  42. package/docs/architecture/greffon.md +49 -20
  43. package/docs/architecture/installation.md +46 -17
  44. package/docs/architecture/machine.md +79 -39
  45. package/docs/architecture/tests.md +59 -16
  46. package/docs/lexique.md +163 -0
  47. package/hooks/hooks.json +0 -10
  48. package/hooks/register.tsx +92 -4
  49. package/package.json +2 -1
  50. package/scripts/activites.mjs +105 -65
  51. package/scripts/aiguillage.mjs +15 -8
  52. package/scripts/attente-au-tour.mjs +2 -3
  53. package/scripts/attente-de-la-machine.mjs +4 -8
  54. package/scripts/avancement.mjs +12 -8
  55. package/scripts/bilan.mjs +126 -63
  56. package/scripts/bilans-gardes.mjs +37 -0
  57. package/scripts/branche-de-nuit.mjs +2 -2
  58. package/scripts/ci-de-main.mjs +18 -21
  59. package/scripts/circuit.mjs +89 -44
  60. package/scripts/circuits-du-serveur.mjs +5 -5
  61. package/scripts/composants-affectes.mjs +30 -12
  62. package/scripts/composition-des-langages.mjs +5 -3
  63. package/scripts/conformite.mjs +1 -1
  64. package/scripts/consommation-des-passes.mjs +8 -6
  65. package/scripts/copies-finies.mjs +3 -14
  66. package/scripts/depart-du-ticket.d.mts +8 -2
  67. package/scripts/depart-du-ticket.mjs +26 -8
  68. package/scripts/direct.mjs +158 -72
  69. package/scripts/droits.mjs +165 -208
  70. package/scripts/engendres.mjs +3 -14
  71. package/scripts/entree-de-seance.mjs +35 -0
  72. package/scripts/enveloppe/enveloppe.mjs +98 -46
  73. package/scripts/enveloppe/lancer.sh +90 -66
  74. package/scripts/enveloppe/paquets-du-plan.mjs +38 -11
  75. package/scripts/enveloppe/travail-de-la-copie.mjs +192 -3
  76. package/scripts/etapes.mjs +84 -22
  77. package/scripts/faits-du-circuit.mjs +8 -2
  78. package/scripts/grillhouse-maj.mjs +43 -18
  79. package/scripts/groupe-cles.d.mts +15 -0
  80. package/scripts/groupe-cles.mjs +77 -2
  81. package/scripts/init.mjs +9 -2
  82. package/scripts/integration/rejeu.mjs +8 -1
  83. package/scripts/jointure.d.ts +24 -4
  84. package/scripts/langages/c/index.mjs +5 -2
  85. package/scripts/langages/cargo/commandes.mjs +35 -15
  86. package/scripts/langages/cargo/composants.mjs +45 -3
  87. package/scripts/langages/cargo/index.mjs +6 -3
  88. package/scripts/langages/python/commandes.mjs +50 -7
  89. package/scripts/langages/python/index.mjs +5 -2
  90. package/scripts/langages/python/squelette.mjs +2 -1
  91. package/scripts/langages/typescript/chemins-des-tests.mjs +1 -1
  92. package/scripts/langages/typescript/index.mjs +16 -14
  93. package/scripts/langages/typescript/mise-a-jour.mjs +1 -1
  94. package/scripts/langages/typescript/rapports-aux-lignes.mjs +74 -0
  95. package/scripts/langages/typescript/turbo-des-paquets.mjs +151 -38
  96. package/scripts/langages/typescript/verdict.mjs +29 -3
  97. package/scripts/langages/typescript/verifier.mjs +28 -3
  98. package/scripts/langages/typescript/vitest-config/changements.mjs +8 -6
  99. package/scripts/langages/typescript/vitest-config/lances.mjs +15 -32
  100. package/scripts/langages.mjs +54 -4
  101. package/scripts/matieres-lues.mjs +1 -1
  102. package/scripts/mesure/base-de-passe.mjs +32 -90
  103. package/scripts/migrations/serveurs-de-l-index.mjs +79 -0
  104. package/scripts/migrations/suivi-du-superviseur-retire.mjs +56 -0
  105. package/scripts/migrations.mjs +23 -7
  106. package/scripts/nuit.sh +3 -2
  107. package/scripts/paquet.mjs +1 -1
  108. package/scripts/paquets.d.ts +3 -0
  109. package/scripts/paquets.mjs +88 -1
  110. package/scripts/passe-de-la-machine.mjs +109 -36
  111. package/scripts/places-de-la-machine.mjs +81 -29
  112. package/scripts/plafond-de-la-machine.d.mts +2 -5
  113. package/scripts/plafond-de-la-machine.mjs +9 -9
  114. package/scripts/reprise.mjs +42 -13
  115. package/scripts/resultats.mjs +78 -56
  116. package/scripts/retirer-les-copies-finies.mjs +1 -1
  117. package/scripts/seances.mjs +471 -133
  118. package/scripts/services-du-noyau.mjs +9 -1
  119. package/scripts/session-start.sh +22 -7
  120. package/scripts/sortie-de-seance.mjs +70 -0
  121. package/scripts/sortie.mjs +37 -6
  122. package/scripts/sous-commandes.mjs +0 -3
  123. package/scripts/superviseur.mjs +400 -162
  124. package/scripts/tableau.mjs +188 -65
  125. package/scripts/transitions.d.mts +25 -2
  126. package/scripts/transitions.mjs +137 -29
  127. package/scripts/verrous/ecriture-hors-enveloppe.mjs +31 -9
  128. package/skills/codebase-design/DESIGN-IT-TWICE.md +1 -1
  129. package/skills/developpeur/SKILL.md +38 -15
  130. package/skills/direct/SKILL.md +29 -9
  131. package/skills/domain-modeling/GLOSSARY-FORMAT.md +9 -9
  132. package/skills/domain-modeling/SKILL.md +14 -12
  133. package/skills/explorateur/SKILL.md +32 -8
  134. package/skills/grill/SKILL.md +3 -2
  135. package/skills/pitmaster/SKILL.md +80 -50
  136. package/skills/pitmaster/references/cadre.md +1 -1
  137. package/skills/pitmaster/references/consigne-agent.md +12 -11
  138. package/skills/pitmaster/references/tour.md +6 -5
  139. package/skills/relecteur/SKILL.md +13 -6
  140. package/skills/systematic-debugging/SKILL.md +281 -0
  141. package/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
  142. package/skills/systematic-debugging/condition-based-waiting.md +115 -0
  143. package/skills/systematic-debugging/defense-in-depth.md +122 -0
  144. package/skills/systematic-debugging/find-polluter.sh +72 -0
  145. package/skills/systematic-debugging/root-cause-tracing.md +169 -0
  146. package/skills/testwriter/SKILL.md +37 -31
  147. package/cadre/templates/projet/pitmaster/SUIVI.md +0 -22
  148. package/scripts/attente-a-l-arret.mjs +0 -114
  149. package/scripts/verrous/commande.mjs +0 -214
  150. package/scripts/verrous/verrou.mjs +0 -311
@@ -11,14 +11,16 @@
11
11
  //
12
12
  // Lines: the head, AGENTS, CHANTIER, then FAITS AUJOURD'HUI, every line of each list shown; a
13
13
  // line folds only lines of another state (« + 2 prêts ») or chantiers not in progress.
14
- // - Head: the work tickets (a ticket without children; a mother is a grouping) by state; its first
15
- // line counts the signs AGENTS shows (`etatsDAgents`, « ▶ N · ⏸ N · ⛔ N · N faits »; a ticket
16
- // closed and not integrated counts under its sign, not as done), one line per project on a board
17
- // of several; the status line says the same signs in the same words.
14
+ // - Head: the project's name, then the work tickets (a ticket without children; a mother is a
15
+ // grouping) by state, in lines by who acts: « toi » (sans go, à valider, N question: the
16
+ // questions that wait for the owner), one « ❓ » line per such question, « file » (the queues),
17
+ // « en cours » (in progress, done, deferred; a circuit launched and not integrated is in
18
+ // progress, not done); these lines once per project on a board of several. Then the day's
19
+ // discoveries, and the day's and cumulative time and tokens.
18
20
  // - AGENTS: the tree of the steps (scripts/etapes.mjs), one block per step and sub-step. A ticket
19
21
  // stands at a step only by its circuit or by an agent that runs on it; a ticket in the queue,
20
22
  // its circuit not launched, stands at no step. A circuit (scripts/circuit.mjs) launched and not
21
- // integrated is read from the Temporal server in one call (scripts/circuits-du-serveur.mjs): it
23
+ // integrated is read from the Temporal server (scripts/circuits-du-serveur.mjs): it
22
24
  // stands at the step of its last state, else at the plan (1), also while the explorateur or the
23
25
  // questionneur works (`questionnement`). One that waits for the supervisor
24
26
  // (`attendLeSuperviseur`, the rule `questionsEnAttente` of scripts/superviseur.mjs reads too)
@@ -28,6 +30,8 @@
28
30
  // - Readings: a reading of the circuits or of the tickets that fails gives way to the last one
29
31
  // that succeeded (`lectureGardee`, `tableau-lu-<quoi>.json` in the common git directory), its
30
32
  // age in the alert that names the fault; a project beside the session's says its own faults.
33
+ // - A path of `grillhouse.groupe` that leads to no project of the frame is an alert of its project,
34
+ // its key on the first line, its value below (`signalementsDuGroupe`, scripts/groupe-cles.mjs).
31
35
  // - Bilans: the card of a ticket whose circuit kept its bilan (scripts/bilan.mjs,
32
36
  // `.claude/worktrees/<ticket>.bilan.json`) opens on its key figures.
33
37
  // - CHANTIER: a root epic with work in progress, its tree of mothers with their work tickets done
@@ -50,10 +54,12 @@
50
54
  // Past FIGEE without a sign: « figée <durée> · faits/prévus », signed ⛔.
51
55
  // - Parts (scripts/places-de-la-machine.mjs, read by `lireLaMesure`), as Slurm's `squeue` names
52
56
  // who holds what: a part held or waited for stands on the ticket's line, « 🔒 » (holds) or « ⏳ »
53
- // (waits) after the head, before the subject: « · <sorte> · 2 cœurs · <durée> », with « ⚠ » when
54
- // it consumes beyond its part, « · <sorte> figée <durée> » past FIGEE, « · attend 2 cœurs · 26
55
- // réservés sur 28 · <durée> » for a wait. The block at the head of AGENTS (`lignesDesParts`)
56
- // keeps the budget taken, « Parts · 2 passes · 6 sur 8 cœurs · 11 sur 16 Go », which counts
57
+ // (waits) after the head, before the subject: « · <sorte> · 2 cœurs · 4 Go, limite 8 Go ·
58
+ // <durée> » (the memory reserved and where the group is cut, « sans limite » for a session), with
59
+ // « ⚠ » when it consumes beyond its part, « · <sorte> figée <durée> » past FIGEE, « · attend 2
60
+ // cœurs · 26 réservés sur 28 · 4 Go réservés, limite 8 Go · <durée> » for a wait. The block at
61
+ // the head of AGENTS (`lignesDesParts`) keeps the budget taken, « Parts · 2 passes · 6 sur 8
62
+ // cœurs · 11 sur 16 Go », which counts
57
63
  // every pass that holds a part, a ticket the board does not show included, then the passes with
58
64
  // no ticket (« 🔒 <sorte> · <projet> · 4 cœurs · 8 Go »), then each wait in the order of its
59
65
  // rank (« ⏳ <sorte> · <projet> · attend <raison> »). Such a line is marked `avancement`, which
@@ -96,12 +102,13 @@ import {
96
102
  libelle,
97
103
  quiDe,
98
104
  roleDeLAgent,
105
+ RESPONSABLE,
99
106
  SUITE,
100
107
  SUPERVISEUR,
101
108
  } from './etapes.mjs';
102
109
  import { echecDeLOutil } from './aiguillage.mjs';
103
110
  import { maxDuProjet } from './circuits-cles.mjs';
104
- import { bilansGardes, enBref } from './bilan.mjs';
111
+ import { bilansGardes, enBref } from './bilans-gardes.mjs';
105
112
  import { REGISTRE } from './adresse-du-registre.mjs';
106
113
  import { lireLaMesure } from './avancement.mjs';
107
114
  import {
@@ -130,6 +137,7 @@ import { duree as dureeDeLaFermeture } from './regles-des-places.mjs';
130
137
  import { prefixe as prefixeDeLaRacine } from './prefixe-des-tickets.mjs';
131
138
  import { sigleDuProjet } from './sigle-du-projet.mjs';
132
139
  import { versionDuPaquet } from './greffons.mjs';
140
+ import { signalementsDuGroupe } from './groupe-cles.mjs';
133
141
  import { estLeCircuitCourt, sorteDesFiches } from './resultats.mjs';
134
142
 
135
143
  // The version of the package whose code draws the panel, « v0.47.1 », read once, at the first
@@ -308,6 +316,17 @@ function reunir(intervalles) {
308
316
  // transcript, a turn starts at its incoming message.
309
317
  const horsDuTour = e => e.type === 'queue-operation' || e.message?.model === '<synthetic>';
310
318
 
319
+ // The usage of a session's first request, from its response's `u`: `{ entree, cacheEcrit, cacheLu
320
+ // }`, or null when one of the three is not a number.
321
+ function tourDeLUsage(u) {
322
+ const tour = {
323
+ entree: u?.input_tokens,
324
+ cacheEcrit: u?.cache_creation_input_tokens,
325
+ cacheLu: u?.cache_read_input_tokens,
326
+ };
327
+ return Object.values(tour).every(n => Number.isFinite(n)) ? tour : null;
328
+ }
329
+
311
330
  // Adds the lines of `texte` to the state `etat`, which it returns.
312
331
  function avancer(etat, texte) {
313
332
  const vus = new Set(etat.vus);
@@ -367,6 +386,15 @@ function avancer(etat, texte) {
367
386
  const m = /TON TICKET : ([A-Za-z0-9_-]+-[A-Za-z0-9]+(?:\.[0-9]+)*)/.exec(texteUser);
368
387
  etat.ticket = m ? m[1] : '';
369
388
  }
389
+ // The first response of a model, absent from the state until it is read.
390
+ if (
391
+ etat.premierTour === undefined &&
392
+ e.type === 'assistant' &&
393
+ e.message &&
394
+ e.message.model !== '<synthetic>'
395
+ ) {
396
+ etat.premierTour = tourDeLUsage(e.message.usage);
397
+ }
370
398
  const u = e.message?.usage;
371
399
  const id = e.message?.id ?? e.requestId;
372
400
  if (!u || (id && vus.has(id))) {
@@ -409,8 +437,9 @@ function avancer(etat, texte) {
409
437
 
410
438
  // The measures of a state: the tokens, the turns and their working time (the union of the turns,
411
439
  // the waits left out), the start (the oldest date) and the end (the latest), the ticket, the role
412
- // (a session launched with `--agent`), the cost (the total a session writes) and the usage by
413
- // model. `entre` is the
440
+ // (a session launched with `--agent`), the cost (the total a session writes), the usage by
441
+ // model and the one of the first response of a model (`premierTour`, null without a readable
442
+ // one). `entre` is the
414
443
  // time of the latest incoming message, or null; `attend` tells whether the last tool call still
415
444
  // awaits its answer, the call and its answer paired by their identifier.
416
445
  const mesurer = etat => ({
@@ -427,6 +456,7 @@ const mesurer = etat => ({
427
456
  cout: etat.cout,
428
457
  modeles: structuredClone(etat.modeles),
429
458
  minutes: { ...(etat.minutes ?? {}) },
459
+ premierTour: etat.premierTour ? { ...etat.premierTour } : null,
430
460
  });
431
461
 
432
462
  // The measures of the transcript text `texte` held in memory.
@@ -804,11 +834,13 @@ export function lecture(t, prefix) {
804
834
  /**
805
835
  * Who holds a part of the machine, or waits for one, as the board shows it (`lireLaMesure` of
806
836
  * scripts/avancement.mjs, its project named as the board names it, `nommerLesProjets`; `copie`,
807
- * its working tree; `ici`, it is of the board's project; `coeurs` and `memoire` (bytes) its part;
837
+ * its working tree; `ici`, it is of the board's project; `coeurs` and `memoire` (bytes) its part,
838
+ * `limite` where its group is cut (null, a session);
808
839
  * `depasse`, what it consumes beyond it; `raison`, what a wait waits for).
809
840
  * @typedef {{ id?: string, depot?: string | null, copie?: string | null, ici?: boolean,
810
841
  * projet: string, ticket: string | null, sorte: string, depuis?: number | null, coeurs?: number,
811
- * memoire?: number, depasse?: string | null, raison?: string, rang?: number,
842
+ * memoire?: number, limite?: number | null, depasse?: string | null, raison?: string,
843
+ * rang?: number,
812
844
  * avancement?: { faits: number, prevus: number, debut?: number, dernier: number } | null }} DUnePart
813
845
  * @typedef {{ budget: { coeurs: number, memoire: number } | null, faute?: string | null,
814
846
  * prises: DUnePart[], attentes: DUnePart[] }} Machine
@@ -819,13 +851,23 @@ const chiffre = n => (Number.isInteger(n) ? String(n) : n.toFixed(1).replace('.'
819
851
  // Bytes as GB, to a tenth.
820
852
  const goDe = octets => chiffre(Math.round((octets / 1024 ** 3) * 10) / 10);
821
853
 
854
+ // The limit of the part of a pass, after its reservation: « , limite 7,5 Go », « , sans limite »
855
+ // for a session; nothing for a part that names none.
856
+ const limiteDite = p =>
857
+ p.limite === undefined ? '' : p.limite === null ? ', sans limite' : `, limite ${goDe(p.limite)} Go`;
858
+ // What a pass that waits asks of the memory, its reservation and its limit.
859
+ const demandeDite = p =>
860
+ p.limite === undefined ? '' : ` · ${goDe(p.memoire ?? 0)} Go réservés${limiteDite(p)}`;
861
+
822
862
  /**
823
863
  * The parts of the machine as the board says them, in lines: first the budget taken, « Parts · 2
824
864
  * passes · 6 sur 8 cœurs · 11 sur 16 Go » (the passes that hold a part, the cores and the memory
825
865
  * they reserve of the total: the passes that wait reserve nothing), then each pass that holds a
826
- * part, « 🔒 <sorte> · <projet> · <qui> · 4 cœurs · 8 Go » (with « ⚠ » and what it consumes beyond
827
- * its part, when it does), then each pass that waits, in the order of its rank, « ⏳ <sorte> ·
828
- * <projet> · <qui> · attend <raison> », what it waits for (cores, memory, load) with its figures.
866
+ * part, « 🔒 <sorte> · <projet> · <qui> · 4 cœurs · 8 Go, limite 10 Go » (the memory reserved,
867
+ * then where its group is cut, « sans limite » for a session; with « ⚠ » and what it consumes
868
+ * beyond its part, when it does), then each pass that waits, in the order of its rank,
869
+ * « ⏳ <sorte> · <projet> · <qui> · attend <raison> · 2 Go réservés, limite 10 Go », what it waits
870
+ * for (cores, memory, load) with its figures, then what it asks of the memory.
829
871
  * <masquer> leaves out the lines of the passes it names (those of a ticket, shown on its line or
830
872
  * not shown at all: the count keeps them), <court> gives the ticket as the board names it.
831
873
  * @param {{ budget: { coeurs: number, memoire: number }, prises: DUnePart[], attentes: DUnePart[],
@@ -848,11 +890,13 @@ export function lignesDesParts({
848
890
  .filter(p => !masquer(p))
849
891
  .map(
850
892
  p =>
851
- `🔒 ${p.sorte} · ${p.projet} · ${qui(p)}${p.coeurs} cœurs · ${goDe(p.memoire ?? 0)} Go${p.depasse ? ` · ⚠ ${p.depasse}` : ''}`
893
+ `🔒 ${p.sorte} · ${p.projet} · ${qui(p)}${p.coeurs} cœurs · ${goDe(p.memoire ?? 0)} Go${limiteDite(p)}${p.depasse ? ` · ⚠ ${p.depasse}` : ''}`
852
894
  ),
853
895
  ...attentes
854
896
  .filter(p => !masquer(p))
855
- .map(p => `⏳ ${p.sorte} · ${p.projet} · ${qui(p)}attend ${p.raison ?? ''}`.trimEnd()),
897
+ .map(p =>
898
+ `⏳ ${p.sorte} · ${p.projet} · ${qui(p)}attend ${p.raison ?? ''}${demandeDite(p)}`.trimEnd()
899
+ ),
856
900
  ];
857
901
  }
858
902
 
@@ -1502,13 +1546,30 @@ export function assembler({
1502
1546
  numero: numero(c.ticket),
1503
1547
  sujet: titre(parId.get(c.ticket)).sujet,
1504
1548
  }));
1549
+ // The questions that wait for the owner (`enQuestion`), in the tickets' order, whatever AGENTS
1550
+ // shows of their ticket (in direct, deferred): each with the time it was carried to him, else of
1551
+ // its first going up (`depuis`, from the file of the stops gone up), null for a stop that file
1552
+ // does not hold. The head shows one line each.
1553
+ const chez = chezLui({ remontees });
1554
+ const auResponsable = [...parCircuit.values()]
1555
+ .filter(c => enQuestion(c, chez) === RESPONSABLE)
1556
+ .sort((a, b) => ordre({ id: a.ticket }, { id: b.ticket }))
1557
+ .map(c => {
1558
+ const r = remontees.find(x => x.cle === cleDe(c));
1559
+ return {
1560
+ id: c.ticket,
1561
+ numero: numero(c.ticket),
1562
+ sujet: titre(parId.get(c.ticket)).sujet,
1563
+ depuis: r?.chez ?? r?.depuis ?? null,
1564
+ };
1565
+ });
1505
1566
  // The limit of circuits of the project (`limite`, its `grillhouse.circuits`): when it is held,
1506
1567
  // the circuits that hold it waiting for the supervisor (a question to no one, or to the
1507
1568
  // supervisor; the owner's releases the place, as does a ticket deferred), by id.
1508
1569
  const tenantsDeLaLimite = [...parCircuit.values()].filter(
1509
1570
  c =>
1510
1571
  parId.get(c.ticket).status !== 'deferred' &&
1511
- (c.vivant || (attendLeSuperviseur(c) && (c.qui ?? SUPERVISEUR) !== 'responsable'))
1572
+ (c.vivant || (attendLeSuperviseur(c) && (c.qui ?? SUPERVISEUR) !== RESPONSABLE))
1512
1573
  );
1513
1574
  const tenueLaLimite = limite !== null && tenantsDeLaLimite.length >= limite;
1514
1575
  const limiteTenue = tenueLaLimite
@@ -1528,6 +1589,7 @@ export function assembler({
1528
1589
  limite: limiteTenue,
1529
1590
  circuits: lesCircuits,
1530
1591
  remontees,
1592
+ auResponsable,
1531
1593
  horsCircuit,
1532
1594
  chantiers,
1533
1595
  autres,
@@ -1563,6 +1625,14 @@ export const duree = ms => {
1563
1625
  return min < 60 ? `${min} min` : `${Math.floor(min / 60)}h${String(min % 60).padStart(2, '0')}`;
1564
1626
  };
1565
1627
 
1628
+ // The local hour of the instant <t>, « 12:44 ».
1629
+ const heureEtMinute = t =>
1630
+ new Date(t).toLocaleTimeString('fr-FR', {
1631
+ hour: '2-digit',
1632
+ minute: '2-digit',
1633
+ hourCycle: 'h23',
1634
+ });
1635
+
1566
1636
  // The local day and month of the instant <t>, « 16/10 ».
1567
1637
  const jourEtMois = t => {
1568
1638
  const d = new Date(t);
@@ -1643,9 +1713,9 @@ export function voiesDesCircuits(racine, tickets) {
1643
1713
  const conso = (ms, jetons) =>
1644
1714
  Math.round(ms / MINUTE) === 0 && !jetons ? '' : `${duree(ms)} · ${k(jetons)}`;
1645
1715
 
1646
- // The columns <s> takes in a terminal: a character one, ⏳ and ⛔ two, as the signs out of the
1716
+ // The columns <s> takes in a terminal: a character one, ⏳, ⛔ and ❓ two, as the signs out of the
1647
1717
  // basic plane (🔒 💤 🌙), which count two code units, take two.
1648
- const colonnes = s => s.length + (s.match(/[⏳⛔]/g)?.length ?? 0);
1718
+ const colonnes = s => s.length + (s.match(/[⏳⛔❓]/g)?.length ?? 0);
1649
1719
  // The start of <s> that holds in <n> columns, a sign out of the basic plane never split.
1650
1720
  const debutDe = (s, n) => {
1651
1721
  let out = '';
@@ -1657,6 +1727,17 @@ const debutDe = (s, n) => {
1657
1727
  }
1658
1728
  return out;
1659
1729
  };
1730
+ // The end of <s> that holds in <n> columns, « … » at its head when cut.
1731
+ const finDe = (s, n) => {
1732
+ if (colonnes(s) <= n) {
1733
+ return s;
1734
+ }
1735
+ const c = [...s];
1736
+ while (c.length && colonnes(c.join('')) > n - 1) {
1737
+ c.shift();
1738
+ }
1739
+ return `…${c.join('')}`;
1740
+ };
1660
1741
  // A line of `largeur` columns: the left part cut to leave the right part whole.
1661
1742
  const couper = (gauche, droite, largeur) => {
1662
1743
  if (!droite) {
@@ -1700,7 +1781,7 @@ const etapeDuCircuitLu = c => etapeDuCircuit({ ...c, raison: c.arret });
1700
1781
  // A question the supervisor carried to the owner (`chez` in the file of the stops gone up) is the
1701
1782
  // owner's.
1702
1783
  const enQuestion = (c, chez = new Set()) =>
1703
- attendLeSuperviseur(c) ? (chez.has(cleDe(c)) ? 'responsable' : (c.qui ?? SUPERVISEUR)) : null;
1784
+ attendLeSuperviseur(c) ? (chez.has(cleDe(c)) ? RESPONSABLE : (c.qui ?? SUPERVISEUR)) : null;
1704
1785
  const chezLui = t =>
1705
1786
  new Set((t.remontees ?? []).filter(r => Number.isFinite(r.chez)).map(r => r.cle));
1706
1787
  // The state at the right of the line « ⤷ Question » of the circuit <c>: « chez lui · N min » (N from
@@ -1721,15 +1802,15 @@ const etatDeLaQuestion = (c, t) => {
1721
1802
 
1722
1803
  /**
1723
1804
  * The state of each ticket's line of AGENTS on the board <t>, the one source of its signs, which
1724
- * AGENTS draws and the head and the status line count. Each circuit (`circuits`, by its ticket):
1805
+ * AGENTS draws and the status line counts. Each circuit (`circuits`, by its ticket):
1725
1806
  * its state (`etat`, whose tone TONS gives), the reason of its wait (`raison`), its tone, its sign
1726
1807
  * and its witness (`temoin`: the part it holds or waits for, « · <sorte> faits/prévus · <durée> »,
1727
1808
  * « · part <sorte> · <durée> », else the progress of its automatic pass, `temoinDe`), in this
1728
1809
  * order: frozen; ended without its issue; its question (to the supervisor or to another); stopped;
1729
1810
  * its wait for the disk, a place, a part or its first
1730
1811
  * state; else it runs. `lignes`: one entry per
1731
- * ticket's line of AGENTS, its id, its project on a board of several and its sign: each circuit,
1732
- * each ticket led in direct (▶) and each agent shown out of a circuit (▶). `parts`: by ticket, the
1812
+ * ticket's line of AGENTS, its id and its sign: each circuit, each ticket led in direct (▶) and
1813
+ * each agent shown out of a circuit (▶). `parts`: by ticket, the
1733
1814
  * pass of each ticket AGENTS shows (circuit, direct, out of a circuit, agent), its icon (`icone`,
1734
1815
  * 🔒 it holds a part, ⏳ it waits for one) and its text (`texte`), which the ticket's line bears.
1735
1816
  */
@@ -1763,7 +1844,7 @@ export function etatsDAgents(t) {
1763
1844
  icone: '🔒',
1764
1845
  texte: fige
1765
1846
  ? ` · ${sorte} figée ${ilYa(age)}${compte ? ` · ${compte}` : ''}`
1766
- : ` · ${sorte}${compte ? ` ${compte}` : ''}${tenu.coeurs ? ` · ${tenu.coeurs} cœurs` : ''} · ${ilYa(maintenant - (tenu.depuis ?? maintenant))}${tenu.depasse ? ` · ⚠ ${tenu.depasse}` : ''}`,
1847
+ : ` · ${sorte}${compte ? ` ${compte}` : ''}${tenu.coeurs ? ` · ${tenu.coeurs} cœurs` : ''}${tenu.limite === undefined ? '' : ` · ${goDe(tenu.memoire ?? 0)} Go${limiteDite(tenu)}`} · ${ilYa(maintenant - (tenu.depuis ?? maintenant))}${tenu.depasse ? ` · ⚠ ${tenu.depasse}` : ''}`,
1767
1848
  });
1768
1849
  }
1769
1850
  const reserves = (t.machine?.prises ?? []).reduce((n, x) => n + (x.coeurs ?? 0), 0);
@@ -1773,7 +1854,7 @@ export function etatsDAgents(t) {
1773
1854
  partDe.set(w.ticket, {
1774
1855
  fige: false,
1775
1856
  icone: '⏳',
1776
- texte: ` · attend ${w.coeurs} cœurs · ${reserves} réservés sur ${budget} · ${ilYa(maintenant - w.depuis)}`,
1857
+ texte: ` · attend ${w.coeurs} cœurs · ${reserves} réservés sur ${budget}${demandeDite(w)} · ${ilYa(maintenant - w.depuis)}`,
1777
1858
  });
1778
1859
  }
1779
1860
  }
@@ -1787,12 +1868,7 @@ export function etatsDAgents(t) {
1787
1868
  // A circuit that waits for the usage limit to lift (its kept report): its reason and the hour
1788
1869
  // the usage returns, local time, apart from a ticket a person deferred.
1789
1870
  if (c.report?.raison === 'limite-d-usage') {
1790
- const heure = new Date(c.report.reprise).toLocaleTimeString('fr-FR', {
1791
- hour: '2-digit',
1792
- minute: '2-digit',
1793
- hourCycle: 'h23',
1794
- });
1795
- return ['reporteLimite', `limite d'usage · reprise ${heure}`];
1871
+ return ['reporteLimite', `limite d'usage · reprise ${heureEtMinute(c.report.reprise)}`];
1796
1872
  }
1797
1873
  if (!c.vivant) {
1798
1874
  const qui = enQuestion(c, chezLui(t));
@@ -1833,7 +1909,7 @@ export function etatsDAgents(t) {
1833
1909
  temoin,
1834
1910
  });
1835
1911
  }
1836
- const ligne = (x, signe) => ({ id: x.id, projet: x.projet, signe });
1912
+ const ligne = (x, signe) => ({ id: x.id, signe });
1837
1913
  return {
1838
1914
  circuits,
1839
1915
  parts: partDe,
@@ -1848,13 +1924,12 @@ export function etatsDAgents(t) {
1848
1924
  }
1849
1925
 
1850
1926
  /**
1851
- * The counts of the signs of AGENTS on the board <t> (`etatsDAgents`), of the project <projet> on a
1852
- * board of several, of all its lines otherwise: `enCours` ▶, `enAttente` ⏸, `arretes` ⛔.
1927
+ * The counts of the signs of AGENTS on the board <t> (`etatsDAgents`): `enCours` ▶, `enAttente` ⏸,
1928
+ * `arretes` ⛔.
1853
1929
  * @param {any} t
1854
- * @param {string} [projet]
1855
1930
  */
1856
- export function comptesDAgents(t, projet) {
1857
- const l = etatsDAgents(t).lignes.filter(x => projet === undefined || x.projet === projet);
1931
+ export function comptesDAgents(t) {
1932
+ const l = etatsDAgents(t).lignes;
1858
1933
  const n = s => l.filter(x => x.signe === s).length;
1859
1934
  return { enCours: n('▶') + n('▷'), enAttente: n('⏸'), arretes: n('⛔') };
1860
1935
  }
@@ -1887,43 +1962,75 @@ export function lignes(t, nom, largeur = LARGEUR, groupes = {}) {
1887
1962
  // The first line: the project's name, the frame's version at its right edge.
1888
1963
  const version = versionDuPanneau();
1889
1964
  L(version ? couper(nom.toUpperCase(), version, largeur) : nom.toUpperCase(), TONS.titre);
1890
- // The state of each ticket's line of AGENTS, which AGENTS draws and the head counts.
1965
+ // The state of each ticket's line of AGENTS.
1891
1966
  const etats = etatsDAgents(t);
1892
- // The three lines of the head, grouped by who acts, each with its tone from TONS; an absent
1893
- // counter reads 0. « toi »: what the owner decides or validates (sans go, à valider, question: the
1894
- // circuits of AGENTS stopped on a question, `comptesDAgents`); « file »: the queues (● ready,
1895
- // ✎ direct, ⧗ attend archi, ⊘ blocked); « en cours »: where nobody acts (▶ in progress, ✓ done,
1896
- // ⏸ deferred).
1897
- const lignesDActeurs = (c, questions) => {
1967
+ // The lines of the head, grouped by who acts, each with its tone from TONS; an absent
1968
+ // counter reads 0. « toi »: what the owner decides or validates (sans go, à valider, question:
1969
+ // the questions that wait for him, `auResponsable`), then one line per such question,
1970
+ // « ❓ <number> <subject> · depuis <HH:MM> » (« jj/mm » for another day), the subject alone cut;
1971
+ // « file »: the queues (● ready, ✎ direct, ⧗ attend archi, ⊘ blocked); « en cours »: where
1972
+ // nobody acts (▶ in progress, ✓ done, ⏸ deferred). On a board of several projects, <projet>
1973
+ // names the one whose lines these are, and each line is laid under its label.
1974
+ const lignesDActeurs = (c, projet) => {
1898
1975
  const n = k => c[k] ?? 0;
1976
+ const questions = (t.auResponsable ?? []).filter(x => x.projet === projet);
1977
+ const maintenant = t.maintenant ?? Date.now();
1978
+ const depuis = d =>
1979
+ d === null
1980
+ ? ''
1981
+ : ` · depuis ${jourEtMois(d) === jourEtMois(maintenant) ? heureEtMinute(d) : jourEtMois(d)}`;
1982
+ const sousLeProjet = (texte, tete) =>
1983
+ cadre(projet === undefined ? texte : `${tete}${texte}`, '', largeur);
1984
+ const retrait = ' '.repeat(large);
1899
1985
  return [
1900
1986
  {
1901
- texte: `toi : ${n('sansGo')} sans go · ${n('aValider')} à valider · ${questions} question`,
1902
- ton: n('sansGo') ? TONS.sansGo : n('aValider') || questions ? TONS.aValider : TONS.fermes,
1987
+ texte: sousLeProjet(
1988
+ `toi : ${n('sansGo')} sans go · ${n('aValider')} à valider · ${questions.length} question`,
1989
+ projet === undefined ? '' : colonneDe(projet)
1990
+ ),
1991
+ ton: n('sansGo')
1992
+ ? TONS.sansGo
1993
+ : n('aValider') || questions.length
1994
+ ? TONS.aValider
1995
+ : TONS.fermes,
1903
1996
  },
1997
+ ...questions.map(x => ({
1998
+ texte: couperAvant(
1999
+ `❓ ${duProjet(x)}${x.numero} ${x.sujet}`,
2000
+ depuis(x.depuis),
2001
+ '',
2002
+ largeur
2003
+ ),
2004
+ ton: TONS.attendLeResponsable,
2005
+ })),
1904
2006
  {
1905
- texte: `file : ● ${n('enAttente')} · ✎ ${n('fileDirecte')} · ⧗ ${n('attendArchi')} · ⊘ ${n('bloques')}`,
2007
+ texte: sousLeProjet(
2008
+ `file : ● ${n('enAttente')} · ✎ ${n('fileDirecte')} · ⧗ ${n('attendArchi')} · ⊘ ${n('bloques')}`,
2009
+ retrait
2010
+ ),
1906
2011
  ton: TONS.enAttente,
1907
2012
  },
1908
2013
  {
1909
- texte: `en cours : ▶ ${n('enCours')} · ✓ ${n('fermes')} · ⏸ ${n('reportes')}`,
2014
+ texte: sousLeProjet(
2015
+ `en cours : ▶ ${n('enCours')} · ✓ ${n('fermes')} · ⏸ ${n('reportes')}`,
2016
+ retrait
2017
+ ),
1910
2018
  ton: n('enCours') ? TONS.enCours : TONS.fermes,
1911
2019
  },
1912
2020
  ];
1913
2021
  };
1914
2022
  if (plusieurs) {
1915
- // The three lines of each project, as one project's board says them: the first under its
1916
- // label, the two others aligned below it; or the fault that keeps its board out.
1917
- const retrait = ' '.repeat(large);
2023
+ // The lines of each project, as one project's board says them: « toi » under its label, its
2024
+ // questions with the label on each, « file » and « en cours » aligned below; or the fault that
2025
+ // keeps its board out.
1918
2026
  for (const p of t.projets) {
1919
2027
  if (p.erreur) {
1920
2028
  L(cadre(`${colonneDe(p.etiquette)}⚠ ${p.erreur}`, '', largeur), TONS.panne);
1921
2029
  continue;
1922
2030
  }
1923
- const c = p.compteurs;
1924
- lignesDActeurs(c, comptesDAgents(t, p.etiquette).arretes).forEach((x, i) =>
1925
- L(cadre(`${i ? retrait : colonneDe(p.etiquette)}${x.texte}`, '', largeur), x.ton)
1926
- );
2031
+ for (const x of lignesDActeurs(p.compteurs, p.etiquette)) {
2032
+ L(x.texte, x.ton);
2033
+ }
1927
2034
  }
1928
2035
  // The discoveries of the day, summed across the projects.
1929
2036
  const d96 = t.decouvertes ?? { new: 0, check: 0, rejetes: 0, valides: 0 };
@@ -1950,9 +2057,9 @@ export function lignes(t, nom, largeur = LARGEUR, groupes = {}) {
1950
2057
  } else {
1951
2058
  const g = t.global;
1952
2059
  const c = g.compteurs;
1953
- // Three lines of states, grouped by who acts.
1954
- for (const x of lignesDActeurs(c, comptesDAgents(t).arretes)) {
1955
- L(cadre(x.texte, '', largeur), x.ton);
2060
+ // The lines of states, grouped by who acts.
2061
+ for (const x of lignesDActeurs(c)) {
2062
+ L(x.texte, x.ton);
1956
2063
  }
1957
2064
  // The discoveries of the day, one count per case: always shown, at 0 when
1958
2065
  // nothing counts, like the other head lines.
@@ -1983,6 +2090,9 @@ export function lignes(t, nom, largeur = LARGEUR, groupes = {}) {
1983
2090
  : cadre(`${signeDe(a)} ${duProjet(a)}${a.texte}`, '', largeur),
1984
2091
  a.ton
1985
2092
  );
2093
+ if (a.detail) {
2094
+ L(` ${finDe(a.detail, largeur - 2)}`, a.ton);
2095
+ }
1986
2096
  }
1987
2097
  if (t.ciDeMain) {
1988
2098
  L(cadre(t.ciDeMain.texte, '', largeur), t.ciDeMain.ton);
@@ -2180,7 +2290,7 @@ export function lignes(t, nom, largeur = LARGEUR, groupes = {}) {
2180
2290
  };
2181
2291
  const ligneDuCircuit = c => {
2182
2292
  const etape = etapeDe(c);
2183
- // Its state, its sign, its reason and its witness, as the head counts them.
2293
+ // Its state, its sign, its reason and its witness.
2184
2294
  const { ton, signe, raison, temoin } = etats.circuits.get(c.id);
2185
2295
  const droite = droiteDe(
2186
2296
  signe,
@@ -2634,7 +2744,7 @@ export function dernierBouge(tous, lignesDuTableau, vivants = [], maintenant = D
2634
2744
 
2635
2745
  // The status line: the chantier in progress; first the alerts, counted by their signs as the board
2636
2746
  // shows them (🌙, 💤, ⚠), then the passes that hold a part of the machine, « 🔒 <n> », and the
2637
- // count of those that wait for one, « ⏳ <n> »; then the signs of AGENTS counted as the head counts them
2747
+ // count of those that wait for one, « ⏳ <n> »; then the signs of AGENTS counted
2638
2748
  // (`comptesDAgents`), « ▶ N · ⏸ N · ⛔ N ». The alerts of the other projects of a board of several
2639
2749
  // (<voisins>, their boards) count beside the session's, as a multi-root status bar counts the problems
2640
2750
  // of every root; the counters and the chantier stay the session's.
@@ -2946,6 +3056,7 @@ export function ensemble(lus) {
2946
3056
  alertes: tous('alertes'),
2947
3057
  ciDeMain: premier.t.ciDeMain,
2948
3058
  circuits: tous('circuits'),
3059
+ auResponsable: tous('auResponsable'),
2949
3060
  horsCircuit: tous('horsCircuit'),
2950
3061
  directs: tous('directs'),
2951
3062
  chantiers: lisibles.flatMap(l => l.t.chantiers.map(noeud(l.etiquette))),
@@ -3053,8 +3164,8 @@ export function nommerLesProjets(machine, noms, ici = null) {
3053
3164
  // The board of the repository at <racine>; with <projets>, the folders of other projects, the
3054
3165
  // board of them all (`ensemble`), named « <dépôt> + <projet> + … », with the folder of each
3055
3166
  // ticket's project (`dossiers`), where the pane runs Beads for it. The status line is the
3056
- // session's project's alone. Each project's circuits are read by <circuitsDe> (one call to the
3057
- // Temporal server, scripts/circuits-du-serveur.mjs, by default), and the night under way on the
3167
+ // session's project's alone. Each project's circuits are read by <circuitsDe> (lists of the
3168
+ // Temporal server that it filters, scripts/circuits-du-serveur.mjs, by default), and the night under way on the
3058
3169
  // machine by <nuitDe> (`nuitDuServeur` by default); a night that does not read shows none.
3059
3170
  /**
3060
3171
  * @param {string} racine
@@ -3152,6 +3263,18 @@ export async function tableau(
3152
3263
  ),
3153
3264
  ici.commun ? path.dirname(ici.commun) : null
3154
3265
  );
3266
+ // A path of a project's `grillhouse.groupe` that leads to no project of the frame, or any other
3267
+ // fault of the key (scripts/groupe-cles.mjs): the alert names the key, the line below its value.
3268
+ for (const l of lus) {
3269
+ for (const { cle, valeur, motif } of l.t ? signalementsDuGroupe(l.dossier) : []) {
3270
+ l.t.alertes.push({
3271
+ etat: 'panne',
3272
+ ton: TONS.panne,
3273
+ texte: `${cle} : ${motif === 'sans-projet' ? 'sans projet du cadre' : 'valeur refusée'}`,
3274
+ detail: valeur,
3275
+ });
3276
+ }
3277
+ }
3155
3278
  const etat = ligneEtat(ici.t, autres.map(l => l.t).filter(Boolean));
3156
3279
  const t = projets.length
3157
3280
  ? ensemble(
@@ -14,7 +14,7 @@ export interface EtatDeLaTransition {
14
14
  export interface EntreeDeLaTransition {
15
15
  etat: EtatDeLaTransition;
16
16
  memoire: Record<string, unknown>;
17
- ticket: { id: string; paquets: string[]; sorte: unknown; copie: string };
17
+ ticket: { id: string; paquets: string[]; sorte: unknown; copie: string; circuit?: string | null };
18
18
  reprend?: boolean;
19
19
  faits?: Record<string, unknown>;
20
20
  /**
@@ -35,9 +35,28 @@ export interface Transition {
35
35
  usage?: string;
36
36
  }
37
37
 
38
+ /** The circuit (`long` or `court`) the sort of a ticket makes. */
39
+ export function circuitDeLaSorte(
40
+ sorte: { genre?: string; comportement?: string } | null | undefined
41
+ ): 'long' | 'court';
42
+
43
+ /** The circuit <circuit> once the sort of its ticket turns to <sorte>: a direct circuit stays so. */
44
+ export function circuitSuivant(
45
+ circuit: 'long' | 'court' | 'direct' | null | undefined,
46
+ sorte: unknown
47
+ ): 'long' | 'court' | 'direct';
48
+
38
49
  /** What the circuit keeps between steps, which the decisions read and change. */
39
50
  export const MEMOIRE: string[];
40
51
 
52
+ /** The steps `--depuis` names. */
53
+ export const ETAPES_DE_REPRISE: (
54
+ 'testwriter' | 'preuve' | 'developpeur' | 'direct' | 'controles' | 'passe-finale'
55
+ )[];
56
+
57
+ /** The refusal of `--depuis <depuis>` in the circuit <circuit>, naming the resumptions it accepts, or null. */
58
+ export function refusDeLaReprise(entree: { depuis: string; circuit?: string | null }): string | null;
59
+
41
60
  /** The decision of the step of <entree>, or the next fact it needs. */
42
61
  export function transition(entree: EntreeDeLaTransition): Transition;
43
62
 
@@ -49,6 +68,7 @@ export function depart(entree: {
49
68
  etat?: (Partial<EtatDeLaTransition> & { etape: string; raison?: string }) | null;
50
69
  refus?: { rapport: string; [cle: string]: unknown } | null;
51
70
  ticket?: string;
71
+ circuit?: string | null;
52
72
  }): { suivant?: EtatDeLaTransition; memoire?: Record<string, unknown>; usage?: string };
53
73
 
54
74
  /** What the testwriter receives of a developpeur's sheet that sends the red back; null without a sending. */
@@ -201,7 +221,10 @@ interface Constat {
201
221
  export function rapportDuRefus(refus: { rapport: string }): string;
202
222
 
203
223
  /** The stop of a ticket the queue reopens on its issue: its motive and its own question, or null. */
204
- export function refusDeLaFile(issue?: { raison?: string | null; conflit?: boolean }): {
224
+ export function refusDeLaFile(
225
+ issue?: { raison?: string | null; conflit?: boolean },
226
+ circuit?: string | null
227
+ ): {
205
228
  motif: string;
206
229
  question: string | null;
207
230
  };