@roomi-fields/grillhouse 0.46.0 → 0.47.1

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 (66) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/CHANGELOG.md +20 -0
  3. package/cadre/templates/c/package.json +19 -0
  4. package/cadre/templates/projet/.github/workflows/ci.yml +34 -49
  5. package/cadre/templates/projet/CLAUDE.md +6 -0
  6. package/cadre/templates/projet/docs/agents/issue-tracker.md +1 -1
  7. package/charte.md +17 -9
  8. package/dist/temporal/circuit/client.d.ts +14 -5
  9. package/dist/temporal/circuit/client.js +39 -9
  10. package/dist/temporal/circuit/client.js.map +1 -1
  11. package/dist/temporal/file/activites.d.ts +2 -0
  12. package/dist/temporal/file/activites.js +7 -0
  13. package/dist/temporal/file/activites.js.map +1 -1
  14. package/dist/temporal/file/contrat.d.ts +26 -18
  15. package/dist/temporal/file/contrat.js +8 -5
  16. package/dist/temporal/file/contrat.js.map +1 -1
  17. package/dist/temporal/file/deroule.d.ts +1 -1
  18. package/dist/temporal/file/deroule.js +91 -42
  19. package/dist/temporal/file/deroule.js.map +1 -1
  20. package/dist/temporal/tickets/activites.js +4 -13
  21. package/dist/temporal/tickets/activites.js.map +1 -1
  22. package/docs/ARCHITECTURE.md +117 -82
  23. package/docs/INTERFACE.md +36 -19
  24. package/hooks/register.tsx +1 -1
  25. package/package.json +1 -1
  26. package/scripts/activites.mjs +5 -11
  27. package/scripts/arbres-juges.mjs +59 -0
  28. package/scripts/avancement.mjs +2 -38
  29. package/scripts/branche-de-nuit.mjs +14 -45
  30. package/scripts/ci-de-main.mjs +276 -0
  31. package/scripts/circuit.mjs +2 -1
  32. package/scripts/commandes-composees.mjs +36 -6
  33. package/scripts/dernier-vert.mjs +12 -8
  34. package/scripts/etapes.mjs +1 -1
  35. package/scripts/faits-du-circuit.mjs +41 -25
  36. package/scripts/integration/file.mjs +126 -587
  37. package/scripts/integration/integrer.mjs +6 -5
  38. package/scripts/langages/c/binaires.json +4 -0
  39. package/scripts/langages/c/binaires.mjs +83 -0
  40. package/scripts/langages/c/clang-format.mjs +62 -0
  41. package/scripts/langages/c/clang-tidy.mjs +93 -0
  42. package/scripts/langages/c/clang.mjs +42 -0
  43. package/scripts/langages/c/commandes.mjs +530 -0
  44. package/scripts/langages/c/composants.mjs +209 -0
  45. package/scripts/langages/c/exemples.mjs +250 -0
  46. package/scripts/langages/c/index-interfaces.mjs +77 -0
  47. package/scripts/langages/c/index.mjs +120 -0
  48. package/scripts/langages/c/lot.mjs +41 -0
  49. package/scripts/langages/c/mise-a-jour.mjs +70 -0
  50. package/scripts/langages/c/squelette.mjs +61 -0
  51. package/scripts/langages/c/verdict.mjs +99 -0
  52. package/scripts/langages/typescript/turbo-des-paquets.mjs +16 -5
  53. package/scripts/langages-des-paquets.mjs +30 -2
  54. package/scripts/langages.mjs +1 -0
  55. package/scripts/mesure/avancement.mjs +1 -1
  56. package/scripts/migrations/0.47.0-ci-de-main.mjs +48 -0
  57. package/scripts/migrations.mjs +2 -2
  58. package/scripts/session-start.sh +0 -9
  59. package/scripts/sortie.mjs +1 -1
  60. package/scripts/superviseur.mjs +146 -88
  61. package/scripts/tableau.mjs +23 -8
  62. package/skills/grill/SKILL.md +6 -5
  63. package/skills/pitmaster/SKILL.md +9 -7
  64. package/skills/redacteur/references/documents-d-un-composant.md +1 -1
  65. package/scripts/ci-des-branches.mjs +0 -93
  66. package/scripts/migrations/0.33.0-ci-des-branches-de-ticket.mjs +0 -31
@@ -10,7 +10,8 @@
10
10
  // comments at the ticket), nothing is taken and nothing is said.
11
11
  // - The lock is `<git common dir>/grillhouse-superviseur.lock`, one for the repository and its
12
12
  // copies, taken through scripts/verrou-de-fichier.mjs for the session's own process: the first
13
- // process above this one that is not a shell (sh, bash, dash, zsh), the claude of the session.
13
+ // process above this one named `claude`, whatever stands between them (the hook of the greffon,
14
+ // the frame's command, a shell); without one, the first that is not a shell (sh, bash, dash, zsh).
14
15
  // It holds as long as that process lives: a lock whose process is gone is taken over.
15
16
  // - Free, or held by a process that is gone: taken, nothing said of it. Held by the session itself
16
17
  // (a session reopened in the same process, by a compaction or a /clear): kept, nothing said of
@@ -41,7 +42,8 @@
41
42
  // hooks/register.tsx), which runs it at each period and submits what it writes to the session,
42
43
  // in the queue of its messages (`$.prompt.submit`): the questions of a circuit are given as a
43
44
  // queue gives its messages, and the answer acknowledges them. It reads nothing and writes
44
- // nothing unless the session that runs it holds the lock of the supervisor (the one above). It
45
+ // nothing unless the session that runs it holds the lock of the supervisor (the one above); a
46
+ // lock whose process is gone is taken over by the session that reads, as the opening does. It
45
47
  // writes the message of the reading (`texteDesQuestions`) when `relever` gives something,
46
48
  // nothing otherwise; exit 1 and the fault on the error stream when `grillhouse.rappel` is at
47
49
  // fault. A reading is one reading: no process waits.
@@ -54,13 +56,16 @@
54
56
  // given again. The stops are kept there each by its ticket, the run of its workflow, the rank of
55
57
  // its question in that run and its stop, with the time of the first going up and of the last
56
58
  // presentation. The end of a circuit integrated is given once (`integre`), kept in
57
- // `.claude/worktrees/integrations-rendues.json`, and a ticket the queue reopened for a red
58
- // workflow of main once per run (`.claude/worktrees/flux-rouges-rendus.json`).
59
- import { execFile, spawnSync } from 'node:child_process';
60
- import { promisify } from 'node:util';
61
- import { existsSync, mkdirSync, readFileSync, renameSync, statSync, writeFileSync } from 'node:fs';
59
+ // `.claude/worktrees/integrations-rendues.json`, and the alert of the CI of main (a red, or a CI
60
+ // not read, scripts/ci-de-main.mjs) once per passage (`.claude/worktrees/ci-de-main-rendue.json`),
61
+ // cleared at the next green.
62
+ // - The reading covers the project and each other project of its group (`grillhouse.groupe`) that
63
+ // no other live session of supervision holds, each under its name and its folder.
64
+ import { spawnSync } from 'node:child_process';
65
+ import { mkdirSync, readFileSync, renameSync, statSync, writeFileSync } from 'node:fs';
62
66
  import path from 'node:path';
63
67
  import { pathToFileURL } from 'node:url';
68
+ import { alerteDuProjet, ciDeMainGardee } from './ci-de-main.mjs';
64
69
  import { lacherVerrou, prendreVerrou } from './verrou-de-fichier.mjs';
65
70
  import { vivant } from './mesure/base-de-passe.mjs';
66
71
  import { circuitsDuServeur, ServeurMuet } from './circuits-du-serveur.mjs';
@@ -71,11 +76,14 @@ import {
71
76
  remonteesDe,
72
77
  } from './tableau.mjs';
73
78
  import { rappelDuProjet, reglageDuRappel } from './circuits-cles.mjs';
79
+ import { lireGroupe } from './groupe-cles.mjs';
74
80
  import { etapeDuCircuit, libelle, SUPERVISEUR } from './etapes.mjs';
75
81
  import { enFileSansArchitecture, lireLesTickets } from './file-des-tickets.mjs';
76
82
 
77
83
  const VERROU_SUPERVISEUR = 'grillhouse-superviseur.lock';
78
84
  const COQUILLES = new Set(['sh', 'bash', 'dash', 'zsh']);
85
+ // The name of the process of a session of the engine.
86
+ const MOTEUR = 'claude';
79
87
 
80
88
  // The parent and the name of the process <pid>, from /proc; null when it does not read.
81
89
  function processus(pid) {
@@ -90,20 +98,32 @@ function processus(pid) {
90
98
  }
91
99
  }
92
100
 
93
- // The session's process: the first process above <depart> that is not a shell.
94
- function seance(depart = process.ppid) {
101
+ /**
102
+ * The session's process above <depart>: the first process named `claude`, whatever stands between
103
+ * it and the command (the hook of the greffon, the frame's command, a shell), all gone at the end
104
+ * of the command; without one (another engine), the first process that is not a shell. <lire>
105
+ * gives the parent and the name of a process, null when it does not read.
106
+ * @param {number} [depart]
107
+ * @param {(pid: number) => { nom: string, parent: number } | null} [lire]
108
+ * @returns {number}
109
+ */
110
+ export function seance(depart = process.ppid, lire = processus) {
111
+ let horsCoquille = null;
95
112
  let pid = depart;
96
113
  for (let i = 0; i < 32 && pid > 1; i++) {
97
- const p = processus(pid);
114
+ const p = lire(pid);
98
115
  if (!p) {
99
- return depart;
116
+ break;
100
117
  }
101
- if (!COQUILLES.has(p.nom)) {
118
+ if (p.nom === MOTEUR) {
102
119
  return pid;
103
120
  }
121
+ if (horsCoquille === null && !COQUILLES.has(p.nom)) {
122
+ horsCoquille = pid;
123
+ }
104
124
  pid = p.parent;
105
125
  }
106
- return depart;
126
+ return horsCoquille ?? depart;
107
127
  }
108
128
 
109
129
  // Whether the process <pid> is above this one: the session that runs the command, whatever the
@@ -187,83 +207,63 @@ function lireLesIntegrations(racine, maintenant) {
187
207
  }
188
208
  return { depuis: maintenant, rendues: new Set() };
189
209
  }
190
- // The tickets the queue reopened for a red workflow of main (label `flux-rouge`) that wait open, with
191
- // the address of the run, which the title of the queue's comment (scripts/integration/file.mjs)
192
- // gives in its second paragraph; null when bd does not read them, which says nothing of the reds.
193
- export async function fluxRougesDe(racine) {
194
- // A repository without its base of tickets has no ticket to give, and bd is never launched.
195
- if (!existsSync(path.join(racine, '.beads'))) {
196
- return [];
197
- }
198
- const bd = async (...a) =>
199
- (
200
- await promisify(execFile)('bd', a, {
201
- cwd: racine,
202
- encoding: 'utf8',
203
- timeout: 5000,
204
- maxBuffer: 64 * 1024 * 1024,
205
- })
206
- ).stdout;
207
- try {
208
- const l = JSON.parse(await bd('list', '--label', 'flux-rouge', '--status', 'open', '--json'));
209
- const lots = await Promise.all(
210
- l.map(async t => {
211
- const dits = JSON.parse((await bd('comments', t.id, '--json')) || '[]');
212
- const c = dits.findLast(x => String(x?.text ?? '').startsWith('## Flux de main rouge'));
213
- return c ? [{ ticket: t.id, adresse: String(c.text).split('\n\n')[1] ?? '' }] : [];
214
- })
215
- );
216
- return lots.flat();
217
- } catch {
218
- // A reading that fails says nothing of the reds: null, never « none ».
219
- return null;
210
+ // The alert of the CI of main of the project at <racine> (scripts/ci-de-main.mjs), read for the
211
+ // supervisor: `{ cle, texte }` for a red or a CI not read, null for a green (the alert clears),
212
+ // undefined for a project with no CI to read. The lots entered since the last green are named by
213
+ // git; nothing is kept but the reading, for five minutes.
214
+ export function ciDeMainDe(racine) {
215
+ const lecture = ciDeMainGardee(racine);
216
+ if (!lecture) {
217
+ return undefined;
220
218
  }
219
+ const a = alerteDuProjet(racine, lecture);
220
+ return a ? { cle: a.cle, texte: a.texte } : null;
221
221
  }
222
222
 
223
- // The red workflows of main given by the waits of the repository at <racine>, `ticket adresse` keys:
224
- // those that still stand are kept, so that one is given once and again at another run.
225
- const fluxRougesRendus = racine => path.join(etatsDe(racine), 'flux-rouges-rendus.json');
226
- function lireLesFluxRougesRendus(racine) {
223
+ // The alert of the CI of main given by the waits of the repository at <racine>, its key: kept while
224
+ // it stands, so that one is given once, cleared at the next green and given again if it comes back.
225
+ const ciDeMainRendue = racine => path.join(etatsDe(racine), 'ci-de-main-rendue.json');
226
+ function lireLaCiDeMainRendue(racine) {
227
227
  try {
228
- const lu = JSON.parse(readFileSync(fluxRougesRendus(racine), 'utf8'));
229
- return new Set(Array.isArray(lu?.rendus) ? lu.rendus.map(String) : []);
228
+ const lu = JSON.parse(readFileSync(ciDeMainRendue(racine), 'utf8'));
229
+ return typeof lu?.cle === 'string' ? lu.cle : null;
230
230
  } catch {
231
- return new Set();
231
+ return null;
232
232
  }
233
233
  }
234
- function ecrireLesFluxRougesRendus(racine, cles) {
235
- const f = fluxRougesRendus(racine);
234
+ function ecrireLaCiDeMainRendue(racine, cle) {
235
+ const f = ciDeMainRendue(racine);
236
236
  try {
237
237
  mkdirSync(path.dirname(f), { recursive: true });
238
238
  const provisoire = `${f}.${process.pid}`;
239
- writeFileSync(provisoire, `${JSON.stringify({ rendus: [...cles].sort() })}\n`);
239
+ writeFileSync(provisoire, `${JSON.stringify({ cle })}\n`);
240
240
  renameSync(provisoire, f);
241
241
  } catch {
242
242
  // kept as it was
243
243
  }
244
244
  }
245
245
 
246
- // The batch of the tickets reopened by a red workflow of main among <rouges> and not yet given, as
247
- // questions sorted by ticket; the file of those given keeps the ones that stand.
248
- function releverLesFluxRouges(racine, rouges) {
249
- const cleDuRouge = r => `${r.ticket} ${r.adresse}`;
250
- const avant = lireLesFluxRougesRendus(racine);
251
- const debout = new Set(rouges.map(cleDuRouge));
252
- const neufs = rouges.filter(r => !avant.has(cleDuRouge(r)));
253
- if (neufs.length || debout.size !== avant.size || [...debout].some(k => !avant.has(k))) {
254
- ecrireLesFluxRougesRendus(racine, debout);
255
- }
256
- return neufs
257
- .sort((a, b) => a.ticket.localeCompare(b.ticket, 'en'))
258
- .map(r => ({
259
- ticket: r.ticket,
246
+ // The alert of the CI of main <alerte> (`{ cle, texte }`, null at a green) as a question, when it is
247
+ // not the one already given; the file keeps the key that stands.
248
+ function releverLaCiDeMain(racine, alerte, toutes) {
249
+ const avant = lireLaCiDeMainRendue(racine);
250
+ const cle = alerte?.cle ?? null;
251
+ if (cle !== avant) {
252
+ ecrireLaCiDeMainRendue(racine, cle);
253
+ }
254
+ if (!alerte || (cle === avant && !toutes)) {
255
+ return [];
256
+ }
257
+ return [
258
+ {
259
+ ticket: 'CI de main',
260
260
  etape: '5 Intégration',
261
- question: `un flux de main est rouge après l'entrée de son lot, le ticket est rouvert : ${r.adresse}`,
261
+ question: alerte.texte,
262
262
  qui: SUPERVISEUR,
263
- commande: `bd show ${r.ticket}`,
264
- cle: `flux-rouge ${cleDuRouge(r)}`,
265
- adresse: r.adresse,
266
- }));
263
+ commande: 'gh run list --branch main',
264
+ cle: `ci-de-main ${alerte.cle}`,
265
+ },
266
+ ];
267
267
  }
268
268
 
269
269
  // A file that cannot be written never costs the batch: the next wait reads the former one.
@@ -289,19 +289,19 @@ function ecrireLesIntegrations(racine, depuis, rendues) {
289
289
  * with the stops that still stand, their circuit waiting for the supervisor: a question answered
290
290
  * so leaves it, and the next stop of its circuit is new. The end of a circuit integrated since the
291
291
  * last reading is given once (`integre`; the file of the integrations holds the time of that
292
- * reading), and each ticket of <fluxRouges> (the tickets the queue reopened for a red workflow of
293
- * main, `{ ticket, adresse }`; null when bd does not read them, undefined when they are not read)
294
- * once per run (`adresse`). The result is the questions given, each marked `representee` when it
295
- * comes back, then the ends, then the reds.
292
+ * reading), and the alert of the CI of main <ciDeMain> (`{ cle, texte }`; null at a green, which
293
+ * clears it; undefined when it is not read, which keeps what was given) once per passage. The
294
+ * result is the questions given, each marked `representee` when it comes back, then the ends, then
295
+ * the alert of the CI of main.
296
296
  * @param {string} racine
297
297
  * @param {import('./circuits-du-serveur.mjs').CircuitDuServeur[]} circuits
298
- * @param {{ fermes: (racine: string, ids: string[]) => Set<string> | null, maintenant: number, rappelMs: number, toutes?: boolean, fluxRouges?: { ticket: string, adresse: string }[] | null }} options
299
- * @returns {{ ticket: string, etape: string, question: string, qui: string, commande: string, cle: string, representee?: boolean, integre?: boolean, adresse?: string }[]}
298
+ * @param {{ fermes: (racine: string, ids: string[]) => Set<string> | null, maintenant: number, rappelMs: number, toutes?: boolean, ciDeMain?: { cle: string, texte: string } | null }} options
299
+ * @returns {{ ticket: string, etape: string, question: string, qui: string, commande: string, cle: string, representee?: boolean, integre?: boolean }[]}
300
300
  */
301
301
  export function relever(
302
302
  racine,
303
303
  circuits,
304
- { fermes, maintenant, rappelMs, toutes = false, fluxRouges }
304
+ { fermes, maintenant, rappelMs, toutes = false, ciDeMain }
305
305
  ) {
306
306
  const f = remonteesDe(racine);
307
307
  mkdirSync(path.dirname(f), { recursive: true });
@@ -320,7 +320,7 @@ export function relever(
320
320
  maintenant,
321
321
  [...rendues, ...integres.map(i => i.cle)].filter(k => (fins.get(k) ?? -Infinity) >= maintenant)
322
322
  );
323
- const rouges = Array.isArray(fluxRouges) ? releverLesFluxRouges(racine, fluxRouges) : [];
323
+ const rouges = ciDeMain === undefined ? [] : releverLaCiDeMain(racine, ciDeMain, toutes);
324
324
  circuits = circuits.filter(c => !c.integre);
325
325
  const avant = new Map(lireLesRemontees(racine, maintenant).map(r => [r.cle, r]));
326
326
  const debout = questionsEnAttente(racine, circuits, { fermes: aucunFerme });
@@ -550,6 +550,7 @@ export async function circuitsALOuverture(
550
550
  maintenant: Date.now(),
551
551
  rappelMs: rappelDuProjet(racine) * 60_000,
552
552
  toutes: true,
553
+ ciDeMain: ciDeMainDe(racine),
553
554
  }).filter(q => !q.integre)
554
555
  : [];
555
556
  const tournent = enAttente(
@@ -651,7 +652,10 @@ async function superviseur(racine, { env = process.env } = {}) {
651
652
  * circuits do not read, or when the session that runs it is not the one that holds the lock of the
652
653
  * supervisor (a role's session, an agent's copy, another project's, a session that took no lock).
653
654
  * The interval of the re-presentation is the key `grillhouse.rappel` of the project, applied at
654
- * each reading.
655
+ * each reading. The session reads too each other project of its group (`grillhouse.groupe`) that
656
+ * no other live session of supervision holds (`voisinsSansSuperviseur`): its part follows, under
657
+ * the name and the folder of that project, where its answers are played, with that project's own
658
+ * interval and state.
655
659
  * @param {string} racine
656
660
  * @param {{ env?: Record<string, string | undefined>, circuitsDe?: (racine: string, options?: { integres?: boolean }) => Promise<import('./circuits-du-serveur.mjs').CircuitDuServeur[]> }} [options]
657
661
  * @returns {Promise<string>}
@@ -672,24 +676,53 @@ export async function releverPourLeGreffon(
672
676
  if (path.resolve(dossierGit) !== path.resolve(commun)) {
673
677
  return '';
674
678
  }
679
+ const verrou = path.join(commun, VERROU_SUPERVISEUR);
675
680
  let tenant = null;
676
681
  try {
677
- tenant = Number(/^(\d+)/.exec(readFileSync(path.join(commun, VERROU_SUPERVISEUR), 'utf8'))?.[1]);
682
+ tenant = Number(/^(\d+)/.exec(readFileSync(verrou, 'utf8'))?.[1]);
678
683
  } catch {
679
684
  return '';
680
685
  }
686
+ // A lock whose process is gone is taken over, as the opening does: the session that reads holds it.
687
+ if (Number.isInteger(tenant) && !estAuDessus(tenant) && !vivant(tenant)) {
688
+ const moi = seance();
689
+ tenant = prendreVerrou(verrou, { attendre: false, pid: moi }) ? moi : null;
690
+ }
681
691
  if (!Number.isInteger(tenant) || !estAuDessus(tenant)) {
682
692
  return '';
683
693
  }
684
- let pkg = {};
694
+ const parts = [await leReleveDe(racine, circuitsDe)];
695
+ for (const p of voisinsSansSuperviseur(racine)) {
696
+ const texte = await leReleveDe(p.chemin, circuitsDe);
697
+ if (texte) {
698
+ parts.push(
699
+ [
700
+ `# Projet ${p.nom} (${p.chemin})`,
701
+ `Ses réponses se jouent dans son dossier : \`env -C ${p.chemin} <la réponse>\`.`,
702
+ texte,
703
+ ].join('\n')
704
+ );
705
+ }
706
+ }
707
+ return parts.filter(Boolean).join('\n\n');
708
+ }
709
+
710
+ // The package.json of the project at <racine>; empty when it does not read.
711
+ function paquetDe(racine) {
685
712
  try {
686
- pkg = JSON.parse(readFileSync(path.join(racine, 'package.json'), 'utf8'));
713
+ return JSON.parse(readFileSync(path.join(racine, 'package.json'), 'utf8'));
687
714
  } catch {
688
- // a package.json that does not read sets no key: the default interval
715
+ return {};
689
716
  }
690
- const { minutes, faute } = reglageDuRappel(pkg);
717
+ }
718
+
719
+ // The message of one reading of the project at <racine>, under its own interval
720
+ // (`grillhouse.rappel`) and its own state of the questions presented; empty when it gives nothing
721
+ // or when its circuits do not read. A faulty interval throws, the project named.
722
+ async function leReleveDe(racine, circuitsDe) {
723
+ const { minutes, faute } = reglageDuRappel(paquetDe(racine));
691
724
  if (faute) {
692
- throw new Error(faute);
725
+ throw new Error(`${path.basename(racine)} : ${faute}`);
693
726
  }
694
727
  let circuits;
695
728
  try {
@@ -701,11 +734,36 @@ export async function releverPourLeGreffon(
701
734
  fermes: ticketsHorsAttente,
702
735
  maintenant: Date.now(),
703
736
  rappelMs: minutes * 60_000,
704
- fluxRouges: await fluxRougesDe(racine),
737
+ ciDeMain: ciDeMainDe(racine),
705
738
  });
706
739
  return lot.length ? texteDesQuestions(lot) : '';
707
740
  }
708
741
 
742
+ // The other projects of the group of the project at <racine> (`grillhouse.groupe`) that no other
743
+ // live session of supervision holds: one session supervises them with its own, and reads them
744
+ // too; a project whose lock another live session holds is read by that session.
745
+ function voisinsSansSuperviseur(racine) {
746
+ const soi = path.resolve(racine);
747
+ const { groupe } = lireGroupe(paquetDe(racine), racine);
748
+ return (groupe?.projets ?? [])
749
+ .filter(p => p.chemin !== soi)
750
+ .filter(p => {
751
+ const r = git(p.chemin, '--git-common-dir');
752
+ if (r.status !== 0) {
753
+ return false;
754
+ }
755
+ let tenant;
756
+ try {
757
+ tenant = Number(
758
+ /^(\d+)/.exec(readFileSync(path.join(r.stdout.trim(), VERROU_SUPERVISEUR), 'utf8'))?.[1]
759
+ );
760
+ } catch {
761
+ return true;
762
+ }
763
+ return !Number.isInteger(tenant) || estAuDessus(tenant) || !vivant(tenant);
764
+ });
765
+ }
766
+
709
767
  // The root of the repository at <dossier>, its main tree for a copy; <dossier> out of git.
710
768
  function racineDe(dossier) {
711
769
  const r = git(dossier, '--git-common-dir');
@@ -74,7 +74,7 @@
74
74
  // its pass, read in the progress directory its state names (scripts/avancement.mjs), in
75
75
  // figures, as Bazel's counter of actions: « faits/prévus · <durée> » since the start of the
76
76
  // pass, after the counters of its loops, or in their place when room lacks (the subject is cut,
77
- // never the figures nor the ticket's number); the queue (5.2), the steps of its CI. Past FIGEE
77
+ // never the figures nor the ticket's number); the queue (5.2) shows no wait for a CI. Past FIGEE
78
78
  // without a sign, « figée <durée> · faits/prévus », the time since its last sign, signed ⛔ in
79
79
  // the tone of an alert.
80
80
  // - The parts of the machine (scripts/places-de-la-machine.mjs, read by `lireLaMesure`), as Slurm's
@@ -92,7 +92,7 @@
92
92
  // - Signs: each sign keeps one sense (the owner's decisions of 2026-11-01 and 2026-11-12). A
93
93
  // ticket's line in AGENTS takes one of three, by the tone of its state: ▶ its step works (cyan),
94
94
  // a ticket led in direct included; ⏸ it waits, under the step about to be launched, the reason
95
- // on its right (« attend une place », « verrou », « CI », « disque », « démarre » in grey, the
95
+ // on its right (« attend une place », « verrou », « disque », « démarre » in grey, the
96
96
  // circuit waiting for the machine; « question au superviseur », « question au responsable »,
97
97
  // « arrêté » in yellow, the circuit waiting for someone); ⛔ it stopped on a fault or its pass is
98
98
  // frozen, to correct (red). The head of AGENTS, the machine's lines: 🔒 a pass that holds a part,
@@ -140,6 +140,7 @@ import { maxDuProjet } from './circuits-cles.mjs';
140
140
  import { bilansGardes, enBref } from './bilan.mjs';
141
141
  import { REGISTRE } from './adresse-du-registre.mjs';
142
142
  import { lireLaMesure } from './avancement.mjs';
143
+ import { ciDeMainGardee, ligneDeLaCiDeMain } from './ci-de-main.mjs';
143
144
  import {
144
145
  SANS_REPONSE_EN,
145
146
  ServeurMuet,
@@ -217,7 +218,6 @@ export const TONS = Object.freeze({
217
218
  reporteLimite: 'discret',
218
219
  attendUnePart: 'discret',
219
220
  attendLeDisque: 'discret',
220
- attendLaCI: 'discret',
221
221
  sansEtape: 'discret',
222
222
  enDirect: 'actif',
223
223
  nuitEnCours: 'actif',
@@ -1693,8 +1693,8 @@ const enQuestion = c => (attendLeSuperviseur(c) ? (c.qui ?? SUPERVISEUR) : null)
1693
1693
  * and its witness (`temoin`: the part it holds or waits for, « · <sorte> faits/prévus · <durée> »,
1694
1694
  * « · part <sorte> · <durée> », else the progress of its automatic pass, `temoinDe`), in this
1695
1695
  * order: frozen; ended without its issue; its question (to the supervisor or to another); stopped;
1696
- * its wait for the disk, a place (« nuit » while the night holds the machine), a part, the CI of
1697
- * its queue (5.2, no part held) or its first state; else it runs. `lignes`: one entry per
1696
+ * its wait for the disk, a place (« nuit » while the night holds the machine), a part or its first
1697
+ * state; else it runs. `lignes`: one entry per
1698
1698
  * ticket's line of AGENTS, its id, its project on a board of several and its sign: each circuit,
1699
1699
  * each ticket led in direct (▶) and each agent shown out of a circuit (▶).
1700
1700
  */
@@ -1766,9 +1766,7 @@ export function etatsDAgents(t) {
1766
1766
  ? ['attendUnePart', '']
1767
1767
  : !etape
1768
1768
  ? ['sansEtape', 'démarre']
1769
- : etape.etat === 'file' && !tientUnePart.has(c.id)
1770
- ? ['attendLaCI', 'CI']
1771
- : ['enCours', ''];
1769
+ : ['enCours', ''];
1772
1770
  };
1773
1771
  const circuits = new Map();
1774
1772
  for (const c of t.circuits ?? []) {
@@ -1925,6 +1923,9 @@ export function lignes(t, nom, largeur = LARGEUR, groupes = {}) {
1925
1923
  a.ton
1926
1924
  );
1927
1925
  }
1926
+ if (t.ciDeMain) {
1927
+ L(cadre(t.ciDeMain.texte, '', largeur), t.ciDeMain.ton);
1928
+ }
1928
1929
 
1929
1930
  L('', undefined);
1930
1931
  L('AGENTS ▶ en cours · en attente', TONS.titre);
@@ -2815,6 +2816,7 @@ export function ensemble(lus) {
2815
2816
  : { etiquette: l.etiquette, erreur: l.erreur }
2816
2817
  ),
2817
2818
  alertes: tous('alertes'),
2819
+ ciDeMain: premier.t.ciDeMain,
2818
2820
  circuits: tous('circuits'),
2819
2821
  horsCircuit: tous('horsCircuit'),
2820
2822
  chantiers: lisibles.flatMap(l => l.t.chantiers.map(noeud(l.etiquette))),
@@ -2932,6 +2934,7 @@ export async function tableau(
2932
2934
  projets = [],
2933
2935
  circuitsDe = circuitsDuServeur,
2934
2936
  nuitDe = () => nuitDuServeur(),
2937
+ ciDeMainDe = () => ciDeMainGardee(racine, { maintenant }),
2935
2938
  } = {}
2936
2939
  ) {
2937
2940
  const [nuit, { circuits, muet, faute }, ...autres] = await Promise.all([
@@ -2955,6 +2958,18 @@ export async function tableau(
2955
2958
  }),
2956
2959
  };
2957
2960
  const lus = [ici, ...autres];
2961
+ // The CI of main (scripts/ci-de-main.mjs), read after the lots entered: a red, or a CI not read,
2962
+ // is an alert; a green is a line with its last green. A project with no CI to read shows nothing.
2963
+ const ci = await Promise.resolve()
2964
+ .then(ciDeMainDe)
2965
+ .catch(() => null);
2966
+ if (ci && ici.t) {
2967
+ if (ci.etat === 'verte') {
2968
+ ici.t.ciDeMain = { texte: ligneDeLaCiDeMain(ci), ton: TONS.fermes };
2969
+ } else {
2970
+ ici.t.alertes.push({ etat: 'panne', ton: TONS.panne, texte: ligneDeLaCiDeMain(ci) });
2971
+ }
2972
+ }
2958
2973
  // A project is labelled by its sigle (scripts/sigle-du-projet.mjs: the key `grillhouse.sigle`, else
2959
2974
  // its ticket prefix), as the line of the places names it; a project with neither keeps its
2960
2975
  // folder's name. A faulty key is said in an alert, the prefix staying the sigle; two projects of
@@ -126,13 +126,13 @@ remplace jamais le grill. Les branches de l'arbre :
126
126
  refuse, invariants, coût. Puis la forme : un paquet ou plusieurs, bibliothèque ou service (un
127
127
  service garde `deployment/`, le démon et `.env`), et son langage (la rubrique suivante le déclare).
128
128
  **Le langage de chaque paquet** : le tableau des composants de `docs/ARCHITECTURE.md` porte une
129
- colonne « Langage » (`typescript`, `cargo`, `python`), une ligne par paquet, comme le fichier BUILD de
129
+ colonne « Langage » (`typescript`, `cargo`, `python`, `c`), une ligne par paquet, comme le fichier BUILD de
130
130
  Bazel nomme la règle de chaque cible ; le cadre lit là les langages du projet, rien ne se devine
131
131
  aux fichiers, et un projet qui n'en déclare aucun est refusé. L'`INTERFACE.md` de chaque paquet
132
132
  le reprend (`**Langage** : <nom>`). La garde `grillhouse langages-des-paquets` refuse un paquet
133
133
  que le tableau ne déclare pas, un paquet dont le manifeste suit un autre langage (un
134
134
  `package.json` pour `typescript`, un `Cargo.toml` pour `cargo`, un `pyproject.toml` pour
135
- `python`), un dossier déclaré sans ce manifeste, et une interface qui en nomme un autre.
135
+ `python`, un `CMakeLists.txt` pour `c`), un dossier déclaré sans ce manifeste, et une interface qui en nomme un autre.
136
136
  **Un paquet neuf naît en quatre temps, hors du circuit** (charte commune) : ce grill tranche
137
137
  son rôle, sa frontière, ses refus, son interface et son langage (1) ; le superviseur écrit sa
138
138
  ligne et ses documents, relus par le responsable (2) ; `npx grillhouse paquet <chemin>` bâtit
@@ -146,9 +146,10 @@ remplace jamais le grill. Les branches de l'arbre :
146
146
  sauf `--heure <0-23>`) lance la nuit de chaque projet du registre
147
147
  qui a bougé depuis sa dernière nuit verte, l'un après l'autre ; `npx grillhouse nuit <racine>`
148
148
  la demande à la main. La nuit rejoue pour de vrai la passe complète, puis les tests de nuit et
149
- les bancs de budget, que le jour ne joue pas. La CI de
150
- chaque branche de ticket (`agent/**`, qu'elle écoute) joue `npm run verifier` en entier (les
151
- gardes, le typage de chaque paquet et les tests) avant que main avance.
149
+ les bancs de budget, que le jour ne joue pas. La passe
150
+ finale du circuit joue `npm run verifier` en entier (les gardes, le typage de chaque paquet et
151
+ les tests) sur le lot posé sur la pointe de main avant que main avance ; la CI du projet joue
152
+ ensuite sur main, chaque heure, par paquets.
152
153
  Restent des choix selon la taille du projet, que le responsable tranche :
153
154
  - **le contrôle de l'interface contre le code** (`packages/grillhouse/scripts/langages/typescript/interfaces-contre-code.mjs`) : une
154
155
  seule passe avant les tests (petit projet), ou un banc par composant qui appelle
@@ -106,10 +106,13 @@ nomme le responsable, ce qui décide, les documents qu'il valide et les commande
106
106
  le ticket, et 3.1 les contrôles du plan), 4 Passe finale et relecture (4.1 la passe
107
107
  finale, 4.2 la régénération des références, 4.3 le relecteur ; le détail de 4.2 est plus bas,
108
108
  « Le circuit d'un ticket »), 5 Intégration (5.1
109
- le commit, 5.2 la file : la branche poussée, sa CI lue, main avancé sur l'arbre qu'elle a jugé
110
- vert ; une CI rouge rouvre le ticket, main intact ; un rejeu vert des jobs rouges,
111
- `gh run rerun <id> --failed`, puis `--reprendre`, la fait entrer ; un test instable
112
- se met en quarantaine dans le test, avec son ticket ; 5.3 le tri des découvertes par l'explorateur, sur
109
+ le commit, 5.2 File : passe finale, main (la passe finale rejouée sur le lot posé sur la pointe de
110
+ main, puis main avancé sur l'arbre qu'elle a jugé vert ; aucune branche poussée, aucune CI de
111
+ branche lue ; une passe rouge rouvre le ticket, main intact ; un test instable
112
+ se met en quarantaine dans le test, avec son ticket ; la CI joue ensuite sur main, par paquets,
113
+ une fois par heure : un rouge alerte le superviseur avec les lots entrés depuis le dernier vert et
114
+ ouvre un ticket de défaut sous `a-valider`, que je lance dans le circuit ; la file continue ;
115
+ 5.3 le tri des découvertes par l'explorateur, sur
113
116
  le lot entré sur main, qui ne retarde pas la file et ne défait pas l'intégration) ; aucun composant n'est une unité du circuit, chaque
114
117
  étape joue une fois pour tout le ticket, dans l'enveloppe de tous les paquets du plan ; je dis
115
118
  où en est un ticket par son étape, « 3 Code » ; son en-tête dit ses arrêts et leurs codes. Ainsi
@@ -305,7 +308,7 @@ place de 2 et de 3 ;
305
308
  les tests du lot, trois essais au plus ; 3 Code, le `developpeur`, une séance pour tout le ticket,
306
309
  et 3.1 Contrôles, auto, sur le plan, trois essais au plus ; 4 Passe finale et relecture :
307
310
  4.1 Passe finale, auto, trois essais au plus (les contrôles et la passe finale ne jouent que les
308
- tests que le lot atteint depuis sa base, la passe complète à la CI de la branche du ticket et à la
311
+ tests que le lot atteint depuis sa base, la passe complète à la CI de main et à la
309
312
  nuit ; un projet sans cette CI les mesure contre le dernier vert), puis 4.2 Régénération des références, auto : celles
310
313
  que le projet tire de la copie entière (`grillhouse.references` de son `package.json`, chacune
311
314
  `{ nom, commande, fichiers, tests, lit, gardes }` : `fichiers`, des chemins, des dossiers ou des
@@ -327,8 +330,7 @@ conformité par élément que le lot ajoute, change ou supprime (la liste mécan
327
330
  lui donne, chaque ligne avec sa règle : CADRE, INTERFACE ou ARCHITECTURE), un « non » rendant le
328
331
  lot et un élément sans ligne refusant sa fiche, un lot rendu revenant à
329
332
  l'agent que nomme chaque constat, en 2 ou en 3, chaque constat ouvert jusqu'à la relecture qui le
330
- juge levé ; 5 Intégration : 5.1 Commit et 5.2 File : main,
331
- poussée, CI, auto, puis 5.3 Tri des découvertes, l'`explorateur`, une ligne par découverte du
333
+ juge levé ; 5 Intégration : 5.1 Commit et 5.2 File : passe finale, main, auto, puis 5.3 Tri des découvertes, l'`explorateur`, une ligne par découverte du
332
334
  ticket. Le questionneur ne décide rien, et ses questions vont au ticket. Ainsi chaque
333
335
  agent travaille dans son cadre, et le numéro d'une étape dit où en est chaque ticket. Un plan que le superviseur rend au responsable passe aussi par le questionneur.
334
336
  Ainsi une décision se mesure à des questions qu'elle ne s'est pas posées, comme le code à des
@@ -102,7 +102,7 @@ modèle et renvoie à l'architecture de chaque paquet.
102
102
 
103
103
  **Le tableau des composants porte la colonne « Langage »** : à la racine, la section des
104
104
  composants liste chaque paquet dans un tableau dont la colonne « Langage » nomme son langage
105
- (`typescript`, `cargo`, `python`), comme le fichier BUILD de Bazel nomme la règle de chaque cible ; une ligne
105
+ (`typescript`, `cargo`, `python`, `c`), comme le fichier BUILD de Bazel nomme la règle de chaque cible ; une ligne
106
106
  sans langage nomme une partie qui n'est pas un paquet du projet (un crate d'un autre dépôt). Un
107
107
  paquet qu'un tableau propre à une vue ne nomme pas (le tableau des étages d'une chaîne, où chaque
108
108
  ligne fait une étape) va dans une section « Les paquets », un tableau `Paquet | Langage`. Le cadre