@roomi-fields/grillhouse 0.50.3 → 0.51.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 (131) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/CHANGELOG.md +48 -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.md +17 -12
  13. package/dist/machine/part-par-sorte.d.ts +16 -0
  14. package/dist/machine/part-par-sorte.js +36 -0
  15. package/dist/machine/part-par-sorte.js.map +1 -0
  16. package/dist/temporal/circuit/appel.js +1 -1
  17. package/dist/temporal/circuit/appel.js.map +1 -1
  18. package/dist/temporal/circuit/client.d.ts +5 -4
  19. package/dist/temporal/circuit/client.js +39 -16
  20. package/dist/temporal/circuit/client.js.map +1 -1
  21. package/dist/temporal/circuit/contrat.d.ts +11 -7
  22. package/dist/temporal/circuit/contrat.js +5 -9
  23. package/dist/temporal/circuit/contrat.js.map +1 -1
  24. package/dist/temporal/circuit/deroule.js +18 -6
  25. package/dist/temporal/circuit/deroule.js.map +1 -1
  26. package/dist/temporal/commande.js +12 -3
  27. package/dist/temporal/commande.js.map +1 -1
  28. package/dist/temporal/installation.d.ts +54 -3
  29. package/dist/temporal/installation.js +187 -17
  30. package/dist/temporal/installation.js.map +1 -1
  31. package/dist/temporal/places/client.d.ts +5 -1
  32. package/dist/temporal/places/client.js +23 -11
  33. package/dist/temporal/places/client.js.map +1 -1
  34. package/docs/ARCHITECTURE.md +23 -2700
  35. package/docs/INTERFACE.md +23 -8
  36. package/docs/architecture/circuit.md +59 -12
  37. package/docs/architecture/entree.md +20 -7
  38. package/docs/architecture/greffon.md +6 -2
  39. package/docs/architecture/installation.md +30 -11
  40. package/docs/architecture/machine.md +50 -37
  41. package/docs/architecture/tests.md +52 -14
  42. package/docs/lexique.md +154 -0
  43. package/hooks/register.tsx +1 -1
  44. package/package.json +1 -1
  45. package/scripts/activites.mjs +85 -60
  46. package/scripts/aiguillage.mjs +15 -7
  47. package/scripts/attente-de-la-machine.mjs +4 -8
  48. package/scripts/avancement.mjs +12 -8
  49. package/scripts/bilan.mjs +10 -7
  50. package/scripts/branche-de-nuit.mjs +2 -2
  51. package/scripts/ci-de-main.mjs +18 -21
  52. package/scripts/circuit.mjs +86 -43
  53. package/scripts/circuits-du-serveur.mjs +5 -5
  54. package/scripts/composants-affectes.mjs +30 -12
  55. package/scripts/composition-des-langages.mjs +5 -3
  56. package/scripts/conformite.mjs +1 -1
  57. package/scripts/consommation-des-passes.mjs +8 -6
  58. package/scripts/copies-finies.mjs +3 -14
  59. package/scripts/depart-du-ticket.d.mts +8 -2
  60. package/scripts/depart-du-ticket.mjs +26 -8
  61. package/scripts/direct.mjs +158 -72
  62. package/scripts/droits.mjs +63 -185
  63. package/scripts/engendres.mjs +3 -14
  64. package/scripts/enveloppe/enveloppe.mjs +75 -30
  65. package/scripts/enveloppe/lancer.sh +59 -45
  66. package/scripts/enveloppe/paquets-du-plan.mjs +38 -11
  67. package/scripts/enveloppe/travail-de-la-copie.mjs +115 -3
  68. package/scripts/etapes.mjs +84 -22
  69. package/scripts/faits-du-circuit.mjs +8 -2
  70. package/scripts/grillhouse-maj.mjs +43 -18
  71. package/scripts/groupe-cles.d.mts +15 -0
  72. package/scripts/groupe-cles.mjs +77 -2
  73. package/scripts/init.mjs +9 -2
  74. package/scripts/integration/rejeu.mjs +8 -1
  75. package/scripts/jointure.d.ts +22 -3
  76. package/scripts/langages/c/index.mjs +5 -2
  77. package/scripts/langages/cargo/commandes.mjs +35 -15
  78. package/scripts/langages/cargo/composants.mjs +45 -3
  79. package/scripts/langages/cargo/index.mjs +6 -3
  80. package/scripts/langages/python/index.mjs +5 -2
  81. package/scripts/langages/typescript/chemins-des-tests.mjs +1 -1
  82. package/scripts/langages/typescript/index.mjs +4 -2
  83. package/scripts/langages/typescript/mise-a-jour.mjs +1 -1
  84. package/scripts/langages/typescript/rapports-aux-lignes.mjs +74 -0
  85. package/scripts/langages/typescript/turbo-des-paquets.mjs +99 -36
  86. package/scripts/langages/typescript/verdict.mjs +29 -3
  87. package/scripts/langages/typescript/verifier.mjs +1 -1
  88. package/scripts/langages/typescript/vitest-config/changements.mjs +8 -6
  89. package/scripts/langages/typescript/vitest-config/lances.mjs +15 -32
  90. package/scripts/langages.mjs +54 -4
  91. package/scripts/matieres-lues.mjs +1 -1
  92. package/scripts/mesure/base-de-passe.mjs +32 -90
  93. package/scripts/migrations/serveurs-de-l-index.mjs +79 -0
  94. package/scripts/migrations.mjs +21 -7
  95. package/scripts/paquets.d.ts +3 -0
  96. package/scripts/paquets.mjs +88 -1
  97. package/scripts/passe-de-la-machine.mjs +109 -36
  98. package/scripts/places-de-la-machine.mjs +81 -29
  99. package/scripts/plafond-de-la-machine.d.mts +2 -5
  100. package/scripts/plafond-de-la-machine.mjs +9 -9
  101. package/scripts/reprise.mjs +42 -13
  102. package/scripts/resultats.mjs +76 -54
  103. package/scripts/retirer-les-copies-finies.mjs +1 -1
  104. package/scripts/seances.mjs +426 -115
  105. package/scripts/services-du-noyau.mjs +9 -1
  106. package/scripts/session-start.sh +14 -1
  107. package/scripts/sortie.mjs +37 -6
  108. package/scripts/sous-commandes.mjs +0 -2
  109. package/scripts/superviseur.mjs +33 -13
  110. package/scripts/tableau.mjs +61 -16
  111. package/scripts/transitions.d.mts +25 -2
  112. package/scripts/transitions.mjs +137 -29
  113. package/scripts/verrous/ecriture-hors-enveloppe.mjs +31 -9
  114. package/skills/codebase-design/DESIGN-IT-TWICE.md +1 -1
  115. package/skills/developpeur/SKILL.md +38 -15
  116. package/skills/direct/SKILL.md +29 -9
  117. package/skills/domain-modeling/GLOSSARY-FORMAT.md +9 -9
  118. package/skills/domain-modeling/SKILL.md +14 -12
  119. package/skills/explorateur/SKILL.md +30 -6
  120. package/skills/pitmaster/SKILL.md +12 -16
  121. package/skills/pitmaster/references/consigne-agent.md +12 -11
  122. package/skills/relecteur/SKILL.md +12 -5
  123. package/skills/systematic-debugging/SKILL.md +281 -0
  124. package/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
  125. package/skills/systematic-debugging/condition-based-waiting.md +115 -0
  126. package/skills/systematic-debugging/defense-in-depth.md +122 -0
  127. package/skills/systematic-debugging/find-polluter.sh +72 -0
  128. package/skills/systematic-debugging/root-cause-tracing.md +169 -0
  129. package/skills/testwriter/SKILL.md +35 -29
  130. package/scripts/verrous/commande.mjs +0 -214
  131. package/scripts/verrous/verrou.mjs +0 -311
@@ -11,7 +11,15 @@
11
11
  // What the core asks of a module, and the boundary: docs/architecture/tests.md §3.3 and §3.5.
12
12
  import { fileURLToPath } from 'node:url';
13
13
 
14
- export * from './langages.mjs';
14
+ // `generateursDe`, which the update alone reads, stays inside the core.
15
+ export {
16
+ LANGAGES,
17
+ langage,
18
+ langageDe,
19
+ langageDeLaCopie,
20
+ langagesDe,
21
+ langagesDeclares,
22
+ } from './langages.mjs';
15
23
 
16
24
  // The services of the core to a module of language: the plan of an envelope, the progress of a
17
25
  // pass and its measure, the tasks of the graph of the packages, the base of a pass, the pressure of the machine, its place and its lock, the last
@@ -27,6 +27,10 @@
27
27
  # temporal perime`) joins « Manque » with `npx grillhouse temporal installer`. An agent's copy
28
28
  # does not read it.
29
29
  #
30
+ # - The group (scripts/groupe-cles.mjs, `lignesDuGroupe`): each path of `grillhouse.groupe` that
31
+ # leads to no project of the frame, and each other fault of the key, in one line that names the
32
+ # key and the path. An agent's copy does not read it.
33
+ #
30
34
  # The supervisor (scripts/superviseur.mjs): the session takes the lock of its repository; when its
31
35
  # opening takes it (not when it keeps it) it receives « Les questions des circuits » then « Les
32
36
  # circuits du dépôt »; a second session while the first lives receives first « Un autre
@@ -123,6 +127,14 @@ while IFS= read -r crochet; do
123
127
  done < <(node "$ici/crochets.mjs" --absents "$root" 2>/dev/null)
124
128
  command -v bwrap >/dev/null || missing+=("bubblewrap (bwrap), l'enveloppe des agents : sudo apt install bubblewrap")
125
129
 
130
+ # The paths of grillhouse.groupe that lead to no project of the frame.
131
+ groupe=
132
+ [ -n "$copie_agent" ] || groupe="$(node --input-type=module -e '
133
+ const { pathToFileURL } = await import("node:url");
134
+ const { lignesDuGroupe } = await import(pathToFileURL(process.argv[1]).href);
135
+ process.stdout.write(lignesDuGroupe(process.argv[2]).join("\n"));
136
+ ' "$ici/groupe-cles.mjs" "$root" 2>/dev/null)"
137
+
126
138
  # The key elements the skills read; each one still empty is proposed for a grill.
127
139
  pending=()
128
140
  # Whether the document <$1> holds a field <…> of its template, outside code spans.
@@ -222,7 +234,7 @@ fi
222
234
  # An epic is a chantier, at the root: one with a mother is a mother ticket typed by mistake.
223
235
  epopees="$(cd "$root" && bd list --type epic --all --json --limit 0 2>/dev/null | node -e 'let s="";process.stdin.on("data",d=>s+=d).on("end",()=>{try{process.stdout.write(JSON.parse(s).filter(t=>t.parent).map(t=>t.id).join(" "))}catch{}})')"
224
236
 
225
- [ ${#missing[@]} -eq 0 ] && [ ${#pending[@]} -eq 0 ] && [ ${#wiring[@]} -eq 0 ] && [ -z "$nuit_en_table" ] && [ -z "$epopees" ] && [ -z "${inconnus:-}" ] && [ -z "${ecart_versions:-}" ] && exit 0
237
+ [ ${#missing[@]} -eq 0 ] && [ ${#pending[@]} -eq 0 ] && [ ${#wiring[@]} -eq 0 ] && [ -z "$nuit_en_table" ] && [ -z "$epopees" ] && [ -z "${inconnus:-}" ] && [ -z "${ecart_versions:-}" ] && [ -z "$groupe" ] && exit 0
226
238
 
227
239
  echo "## Éléments du projet à définir (Roomi's Grillhouse)"
228
240
  if [ ${#missing[@]} -gt 0 ]; then
@@ -246,4 +258,5 @@ if [ -n "${inconnus:-}" ]; then
246
258
  echo "docs/agents/hors-cadre.txt nomme un dossier absent de packages/ et de src/ : $inconnus. Corrige la ligne (faute de frappe) ou retire-la : un nom sans dossier n'écarte rien."
247
259
  fi
248
260
  [ -n "${ecart_versions:-}" ] && echo "$ecart_versions"
261
+ [ -z "$groupe" ] || echo "$groupe"
249
262
  exit 0
@@ -3,7 +3,8 @@
3
3
  // §5.4): a release of Grillhouse, its package npm, which carries the frame's plugin: Grillhouse's own
4
4
  // script, which no project runs (`grillhouse init` installs the template of a project alone).
5
5
  //
6
- // npx grillhouse sortie <x.y.z> the release's files: the package's package.json, packages/grillhouse/CHANGELOG.md
6
+ // npx grillhouse sortie <x.y.z> the release's files: the package's package.json, packages/grillhouse/CHANGELOG.md,
7
+ // the migrations it numbers
7
8
  // npx grillhouse sortie --etiqueter the annotated tag v<version> on HEAD, the release commit
8
9
  // and the gesture that leads Grillhouse with it once published
9
10
  // npx grillhouse sortie --verifier-etiquette <v> exits 0 when the tag <v> names the version of the package
@@ -17,6 +18,9 @@
17
18
  // other fields kept, and dates the changelog: « ## [Unreleased] » becomes « ## [<x.y.z>] - <today> » and an
18
19
  // empty « ## [Unreleased] » opens above it. A release with nothing under « [Unreleased] » is
19
20
  // refused. Nothing is written when a check fails.
21
+ // - Preparing numbers each migration not released yet (`export const version = null;`, under
22
+ // scripts/migrations/ and scripts/langages/*/migrations/ of the package, scripts/migrations.mjs)
23
+ // with the version given.
20
24
  // - Tagging creates the annotated tag `v<version>` on HEAD, once the release commit is made and
21
25
  // the working tree holds no change. Nothing is pushed: the owner validates the push, whose
22
26
  // command the script names; `.github/workflows/release.yml` then calls the CI on the tagged
@@ -30,7 +34,7 @@
30
34
  // installs the version published last. `--entree-du-marche` prints it; the owner sets it in that
31
35
  // repository once the package is published, a public gesture this script does not make.
32
36
  import { execFileSync } from 'node:child_process';
33
- import { readFileSync, writeFileSync } from 'node:fs';
37
+ import { existsSync, readdirSync, readFileSync, writeFileSync } from 'node:fs';
34
38
  import path from 'node:path';
35
39
  import { pathToFileURL } from 'node:url';
36
40
 
@@ -43,6 +47,9 @@ export const ENTREE_DU_MARCHE = {
43
47
  };
44
48
  const CHANGELOG = 'packages/grillhouse/CHANGELOG.md';
45
49
  const OUVERTE = '## [Unreleased]\n';
50
+ const SCRIPTS = 'packages/grillhouse/scripts';
51
+ // The line of a migration not released yet.
52
+ const SANS_VERSION = /^export const version = null;$/m;
46
53
  const SEMVER = /^(\d+)\.(\d+)\.(\d+)$/;
47
54
 
48
55
  const lire = (racine, f) => readFileSync(path.join(racine, f), 'utf8');
@@ -70,7 +77,23 @@ const audessus = (a, b) => {
70
77
  return false;
71
78
  };
72
79
 
73
- // Writes the release <version> of Grillhouse at <racine>, dated <date> (YYYY-MM-DD).
80
+ // The migrations of the package at <racine> that have no version yet, from the root.
81
+ function migrationsASortir(racine) {
82
+ const lister = dossier =>
83
+ existsSync(path.join(racine, dossier))
84
+ ? readdirSync(path.join(racine, dossier), { withFileTypes: true })
85
+ : [];
86
+ const langages = lister(`${SCRIPTS}/langages`)
87
+ .filter(e => e.isDirectory())
88
+ .map(e => `${SCRIPTS}/langages/${e.name}/migrations`);
89
+ return [`${SCRIPTS}/migrations`, ...langages]
90
+ .flatMap(d => lister(d).map(e => `${d}/${e.name}`))
91
+ .filter(f => f.endsWith('.mjs') && SANS_VERSION.test(lire(racine, f)))
92
+ .sort();
93
+ }
94
+
95
+ // Writes the release <version> of Grillhouse at <racine>, dated <date> (YYYY-MM-DD); returns the
96
+ // migrations it numbered.
74
97
  export function preparerSortie(racine, version, date) {
75
98
  const actuelle = versionDuCadre(racine);
76
99
  const neuve = rang(version);
@@ -97,6 +120,14 @@ export function preparerSortie(racine, version, date) {
97
120
  path.join(racine, CHANGELOG),
98
121
  `${journal.slice(0, debut + 1)}${OUVERTE}\n## [${version}] - ${date}\n${corps}`
99
122
  );
123
+ const migrations = migrationsASortir(racine);
124
+ for (const f of migrations) {
125
+ writeFileSync(
126
+ path.join(racine, f),
127
+ lire(racine, f).replace(SANS_VERSION, `export const version = '${version}';`)
128
+ );
129
+ }
130
+ return migrations;
100
131
  }
101
132
 
102
133
  // Creates the annotated tag of the release at <racine> on HEAD, and returns its name; <git> runs
@@ -136,7 +167,7 @@ export function suiteDeLaSortie(etiquette) {
136
167
  }
137
168
 
138
169
  const USAGE =
139
- 'Usage : npx grillhouse sortie <x.y.z> prépare la sortie (package.json du paquet, CHANGELOG.md)\n' +
170
+ 'Usage : npx grillhouse sortie <x.y.z> prépare la sortie (package.json du paquet, CHANGELOG.md, migrations sans version)\n' +
140
171
  " npx grillhouse sortie --etiqueter pose l'étiquette v<version> sur le commit de sortie\n" +
141
172
  " npx grillhouse sortie --verifier-etiquette <v> vérifie que l'étiquette <v> nomme la version du paquet\n" +
142
173
  ' npx grillhouse sortie --entree-du-marche écrit l’entrée du greffon dans la place de marché roomi-fields\n';
@@ -164,9 +195,9 @@ if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) {
164
195
  } else if (args.length === 2 && args[0] === '--verifier-etiquette') {
165
196
  verifierEtiquette(racine, args[1]);
166
197
  } else if (args.length === 1 && !args[0].startsWith('-')) {
167
- preparerSortie(racine, args[0], aujourdhui());
198
+ const migrations = preparerSortie(racine, args[0], aujourdhui());
168
199
  process.stdout.write(
169
- `Sortie ${args[0]} préparée : ${PAQUET}, ${CHANGELOG}. ` +
200
+ `Sortie ${args[0]} préparée : ${[PAQUET, CHANGELOG, ...migrations].join(', ')}. ` +
170
201
  `Le commit de sortie, puis : npx grillhouse sortie --etiqueter\n`
171
202
  );
172
203
  } else {
@@ -41,7 +41,6 @@ export const SOUS_COMMANDES = {
41
41
  bilan: 'bilan.mjs',
42
42
  binaires: 'binaires.mjs',
43
43
  circuit: '../dist/temporal/circuit/commande.js',
44
- commande: 'verrous/commande.mjs',
45
44
  'composants-affectes': 'composants-affectes.mjs',
46
45
  consommation: 'consommation.mjs',
47
46
  'dependances-internes': 'dependances-internes.mjs',
@@ -84,7 +83,6 @@ export const SOUS_COMMANDES = {
84
83
  ticket: 'ticket.mjs',
85
84
  'ticket-du-sous-agent': 'verrous/ticket-du-sous-agent.mjs',
86
85
  verifier: { langage: 'verifier' },
87
- verrou: 'verrous/verrou.mjs',
88
86
  'verrou-hors-enveloppe': 'verrous/ecriture-hors-enveloppe.mjs',
89
87
  };
90
88
 
@@ -32,7 +32,9 @@
32
32
  // it at each period and submits what it writes. It reads and writes nothing unless the session
33
33
  // that runs it holds the lock; a lock whose process is gone is taken over by the session that
34
34
  // reads. It writes the message (`texteDesQuestions`) when `relever` gives something, nothing
35
- // otherwise; exit 1 and the fault on the error stream when `grillhouse.rappel` is at fault.
35
+ // otherwise; exit 1 and the fault on the error stream when `grillhouse.rappel` of the project is
36
+ // at fault, or when the reading of another project of the group fails, the message of the others
37
+ // then written all the same.
36
38
  // - `superviseur --lue <dossier> <lueA> <envoyeesAvant>` marks read the questions sent up to
37
39
  // `envoyeesAvant`; `superviseur --chez-le-responsable <dossier> <ticket>` marks a question
38
40
  // carried to the owner: silent until the circuit answers.
@@ -162,16 +164,21 @@ export function horsAttente(tickets, maintenant) {
162
164
 
163
165
  // Of the tickets <ids> of the repository at <racine>, those whose question does not wait now
164
166
  // (`horsAttente`); null when bd does not read them (unknown, never « none »): a machine under
165
- // load can take seconds to answer.
167
+ // load can take seconds to answer. One listing reads them all, whatever their number: `bd show`
168
+ // costs more than a second per ticket and overruns the time given when many circuits stand.
166
169
  export function ticketsHorsAttente(racine, ids) {
167
- const r = spawnSync('bd', ['show', ...ids, '--json'], {
170
+ const r = spawnSync('bd', ['list', '--all', '--limit', '0', '--id', ids.join(','), '--json'], {
168
171
  cwd: racine,
169
172
  encoding: 'utf8',
170
173
  timeout: 30_000,
171
174
  maxBuffer: 256 * 1024 * 1024,
172
175
  });
173
176
  try {
174
- return horsAttente(JSON.parse(r.stdout), Date.now());
177
+ const demandes = new Set(ids);
178
+ return horsAttente(
179
+ JSON.parse(r.stdout).filter(t => demandes.has(t.id)),
180
+ Date.now()
181
+ );
175
182
  } catch {
176
183
  return null;
177
184
  }
@@ -602,7 +609,7 @@ export function texteDesQuestions(questions, o = {}) {
602
609
  * then those whose lot is already on main (`enFileSurMain`, main read by <surMainDe>,
603
610
  * `lotEstSurMain` by default), which it never starts again.
604
611
  * @param {string} racine the root of the repository
605
- * The circuits are read once, by <circuitsDe> (one call to the Temporal server,
612
+ * The circuits are read once, by <circuitsDe> (lists of the Temporal server that it filters,
606
613
  * scripts/circuits-du-serveur.mjs, by default); a server that does not answer is said, and no
607
614
  * question goes up.
608
615
  * @param {{ fermes?: (racine: string, ids: string[]) => Set<string> | null,
@@ -758,11 +765,14 @@ async function superviseur(racine, { env = process.env } = {}) {
758
765
  * each reading. The session reads too each other project of its group (`grillhouse.groupe`) that
759
766
  * no other live session of supervision holds (`voisinsSansSuperviseur`): its part follows, under
760
767
  * the name and the folder of that project, where its answers are played, with that project's own
761
- * interval and state.
768
+ * interval and state. A fault in the reading of one of these projects costs the others nothing: it
769
+ * is thrown once all are read, each project at fault named with its reason, the message of the
770
+ * others in the `texte` of the error.
762
771
  * @param {string} racine
763
772
  * @param {{ env?: Record<string, string | undefined>, circuitsDe?: (racine: string, options?: { integres?: boolean }) => Promise<import('./circuits-du-serveur.mjs').CircuitDuServeur[]> }} [options]
764
773
  * @returns {Promise<string>}
765
- * @throws {Error} `grillhouse.rappel` is at fault, named with its value
774
+ * @throws {Error} `grillhouse.rappel` of the project of the session is at fault, named with its
775
+ * value; or the reading of another project of the group failed (its `texte`: the others' message)
766
776
  */
767
777
  export async function releverPourLeGreffon(
768
778
  racine,
@@ -795,13 +805,19 @@ export async function releverPourLeGreffon(
795
805
  return '';
796
806
  }
797
807
  const parts = [await leReleveDe(racine, circuitsDe)];
808
+ const fautes = [];
798
809
  for (const p of voisinsSansSuperviseur(racine)) {
799
- const texte = await leReleveDe(p.chemin, circuitsDe, true);
800
- if (texte) {
801
- parts.push(texte);
810
+ try {
811
+ parts.push(await leReleveDe(p.chemin, circuitsDe, true));
812
+ } catch (e) {
813
+ fautes.push(`${path.basename(p.chemin)} : ${e.message}`);
802
814
  }
803
815
  }
804
- return parts.filter(Boolean).join('\n\n');
816
+ const texte = parts.filter(Boolean).join('\n\n');
817
+ if (fautes.length) {
818
+ throw Object.assign(new Error(fautes.join('\n')), { texte });
819
+ }
820
+ return texte;
805
821
  }
806
822
 
807
823
  // The package.json of the project at <racine>; empty when it does not read.
@@ -815,11 +831,12 @@ function paquetDe(racine) {
815
831
 
816
832
  // The message of one reading of the project at <racine>, under its own interval
817
833
  // (`grillhouse.rappel`) and its own state of the questions presented; empty when it gives nothing
818
- // or when its circuits do not read. A faulty interval throws, the project named.
834
+ // or when its circuits do not read. A faulty interval throws, the project of the session named
835
+ // (a neighbour is named by the caller, as for any fault of its reading).
819
836
  async function leReleveDe(racine, circuitsDe, voisin = false) {
820
837
  const { minutes, faute } = reglageDuRappel(paquetDe(racine));
821
838
  if (faute) {
822
- throw new Error(`${path.basename(racine)} : ${faute}`);
839
+ throw new Error(voisin ? faute : `${path.basename(racine)} : ${faute}`);
823
840
  }
824
841
  let circuits;
825
842
  try {
@@ -879,6 +896,9 @@ if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) {
879
896
  process.stdout.write(`${texte}\n`);
880
897
  }
881
898
  } catch (e) {
899
+ if (e.texte) {
900
+ process.stdout.write(`${e.texte}\n`);
901
+ }
882
902
  process.stderr.write(`${e.message}\n`);
883
903
  process.exitCode = 1;
884
904
  }
@@ -18,7 +18,7 @@
18
18
  // - AGENTS: the tree of the steps (scripts/etapes.mjs), one block per step and sub-step. A ticket
19
19
  // stands at a step only by its circuit or by an agent that runs on it; a ticket in the queue,
20
20
  // 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
21
+ // integrated is read from the Temporal server (scripts/circuits-du-serveur.mjs): it
22
22
  // stands at the step of its last state, else at the plan (1), also while the explorateur or the
23
23
  // questionneur works (`questionnement`). One that waits for the supervisor
24
24
  // (`attendLeSuperviseur`, the rule `questionsEnAttente` of scripts/superviseur.mjs reads too)
@@ -28,6 +28,8 @@
28
28
  // - Readings: a reading of the circuits or of the tickets that fails gives way to the last one
29
29
  // that succeeded (`lectureGardee`, `tableau-lu-<quoi>.json` in the common git directory), its
30
30
  // age in the alert that names the fault; a project beside the session's says its own faults.
31
+ // - A path of `grillhouse.groupe` that leads to no project of the frame is an alert of its project,
32
+ // its key on the first line, its value below (`signalementsDuGroupe`, scripts/groupe-cles.mjs).
31
33
  // - Bilans: the card of a ticket whose circuit kept its bilan (scripts/bilan.mjs,
32
34
  // `.claude/worktrees/<ticket>.bilan.json`) opens on its key figures.
33
35
  // - CHANTIER: a root epic with work in progress, its tree of mothers with their work tickets done
@@ -50,10 +52,12 @@
50
52
  // Past FIGEE without a sign: « figée <durée> · faits/prévus », signed ⛔.
51
53
  // - Parts (scripts/places-de-la-machine.mjs, read by `lireLaMesure`), as Slurm's `squeue` names
52
54
  // 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
55
+ // (waits) after the head, before the subject: « · <sorte> · 2 cœurs · 4 Go, limite 8 Go ·
56
+ // <durée> » (the memory reserved and where the group is cut, « sans limite » for a session), with
57
+ // « ⚠ » when it consumes beyond its part, « · <sorte> figée <durée> » past FIGEE, « · attend 2
58
+ // cœurs · 26 réservés sur 28 · 4 Go réservés, limite 8 Go · <durée> » for a wait. The block at
59
+ // the head of AGENTS (`lignesDesParts`) keeps the budget taken, « Parts · 2 passes · 6 sur 8
60
+ // cœurs · 11 sur 16 Go », which counts
57
61
  // every pass that holds a part, a ticket the board does not show included, then the passes with
58
62
  // no ticket (« 🔒 <sorte> · <projet> · 4 cœurs · 8 Go »), then each wait in the order of its
59
63
  // rank (« ⏳ <sorte> · <projet> · attend <raison> »). Such a line is marked `avancement`, which
@@ -130,6 +134,7 @@ import { duree as dureeDeLaFermeture } from './regles-des-places.mjs';
130
134
  import { prefixe as prefixeDeLaRacine } from './prefixe-des-tickets.mjs';
131
135
  import { sigleDuProjet } from './sigle-du-projet.mjs';
132
136
  import { versionDuPaquet } from './greffons.mjs';
137
+ import { signalementsDuGroupe } from './groupe-cles.mjs';
133
138
  import { estLeCircuitCourt, sorteDesFiches } from './resultats.mjs';
134
139
 
135
140
  // The version of the package whose code draws the panel, « v0.47.1 », read once, at the first
@@ -804,11 +809,13 @@ export function lecture(t, prefix) {
804
809
  /**
805
810
  * Who holds a part of the machine, or waits for one, as the board shows it (`lireLaMesure` of
806
811
  * 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;
812
+ * its working tree; `ici`, it is of the board's project; `coeurs` and `memoire` (bytes) its part,
813
+ * `limite` where its group is cut (null, a session);
808
814
  * `depasse`, what it consumes beyond it; `raison`, what a wait waits for).
809
815
  * @typedef {{ id?: string, depot?: string | null, copie?: string | null, ici?: boolean,
810
816
  * projet: string, ticket: string | null, sorte: string, depuis?: number | null, coeurs?: number,
811
- * memoire?: number, depasse?: string | null, raison?: string, rang?: number,
817
+ * memoire?: number, limite?: number | null, depasse?: string | null, raison?: string,
818
+ * rang?: number,
812
819
  * avancement?: { faits: number, prevus: number, debut?: number, dernier: number } | null }} DUnePart
813
820
  * @typedef {{ budget: { coeurs: number, memoire: number } | null, faute?: string | null,
814
821
  * prises: DUnePart[], attentes: DUnePart[] }} Machine
@@ -819,13 +826,23 @@ const chiffre = n => (Number.isInteger(n) ? String(n) : n.toFixed(1).replace('.'
819
826
  // Bytes as GB, to a tenth.
820
827
  const goDe = octets => chiffre(Math.round((octets / 1024 ** 3) * 10) / 10);
821
828
 
829
+ // The limit of the part of a pass, after its reservation: « , limite 7,5 Go », « , sans limite »
830
+ // for a session; nothing for a part that names none.
831
+ const limiteDite = p =>
832
+ p.limite === undefined ? '' : p.limite === null ? ', sans limite' : `, limite ${goDe(p.limite)} Go`;
833
+ // What a pass that waits asks of the memory, its reservation and its limit.
834
+ const demandeDite = p =>
835
+ p.limite === undefined ? '' : ` · ${goDe(p.memoire ?? 0)} Go réservés${limiteDite(p)}`;
836
+
822
837
  /**
823
838
  * The parts of the machine as the board says them, in lines: first the budget taken, « Parts · 2
824
839
  * passes · 6 sur 8 cœurs · 11 sur 16 Go » (the passes that hold a part, the cores and the memory
825
840
  * 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.
841
+ * part, « 🔒 <sorte> · <projet> · <qui> · 4 cœurs · 8 Go, limite 10 Go » (the memory reserved,
842
+ * then where its group is cut, « sans limite » for a session; with « ⚠ » and what it consumes
843
+ * beyond its part, when it does), then each pass that waits, in the order of its rank,
844
+ * « ⏳ <sorte> · <projet> · <qui> · attend <raison> · 2 Go réservés, limite 10 Go », what it waits
845
+ * for (cores, memory, load) with its figures, then what it asks of the memory.
829
846
  * <masquer> leaves out the lines of the passes it names (those of a ticket, shown on its line or
830
847
  * not shown at all: the count keeps them), <court> gives the ticket as the board names it.
831
848
  * @param {{ budget: { coeurs: number, memoire: number }, prises: DUnePart[], attentes: DUnePart[],
@@ -848,11 +865,13 @@ export function lignesDesParts({
848
865
  .filter(p => !masquer(p))
849
866
  .map(
850
867
  p =>
851
- `🔒 ${p.sorte} · ${p.projet} · ${qui(p)}${p.coeurs} cœurs · ${goDe(p.memoire ?? 0)} Go${p.depasse ? ` · ⚠ ${p.depasse}` : ''}`
868
+ `🔒 ${p.sorte} · ${p.projet} · ${qui(p)}${p.coeurs} cœurs · ${goDe(p.memoire ?? 0)} Go${limiteDite(p)}${p.depasse ? ` · ⚠ ${p.depasse}` : ''}`
852
869
  ),
853
870
  ...attentes
854
871
  .filter(p => !masquer(p))
855
- .map(p => `⏳ ${p.sorte} · ${p.projet} · ${qui(p)}attend ${p.raison ?? ''}`.trimEnd()),
872
+ .map(p =>
873
+ `⏳ ${p.sorte} · ${p.projet} · ${qui(p)}attend ${p.raison ?? ''}${demandeDite(p)}`.trimEnd()
874
+ ),
856
875
  ];
857
876
  }
858
877
 
@@ -1657,6 +1676,17 @@ const debutDe = (s, n) => {
1657
1676
  }
1658
1677
  return out;
1659
1678
  };
1679
+ // The end of <s> that holds in <n> columns, « … » at its head when cut.
1680
+ const finDe = (s, n) => {
1681
+ if (colonnes(s) <= n) {
1682
+ return s;
1683
+ }
1684
+ const c = [...s];
1685
+ while (c.length && colonnes(c.join('')) > n - 1) {
1686
+ c.shift();
1687
+ }
1688
+ return `…${c.join('')}`;
1689
+ };
1660
1690
  // A line of `largeur` columns: the left part cut to leave the right part whole.
1661
1691
  const couper = (gauche, droite, largeur) => {
1662
1692
  if (!droite) {
@@ -1763,7 +1793,7 @@ export function etatsDAgents(t) {
1763
1793
  icone: '🔒',
1764
1794
  texte: fige
1765
1795
  ? ` · ${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}` : ''}`,
1796
+ : ` · ${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
1797
  });
1768
1798
  }
1769
1799
  const reserves = (t.machine?.prises ?? []).reduce((n, x) => n + (x.coeurs ?? 0), 0);
@@ -1773,7 +1803,7 @@ export function etatsDAgents(t) {
1773
1803
  partDe.set(w.ticket, {
1774
1804
  fige: false,
1775
1805
  icone: '⏳',
1776
- texte: ` · attend ${w.coeurs} cœurs · ${reserves} réservés sur ${budget} · ${ilYa(maintenant - w.depuis)}`,
1806
+ texte: ` · attend ${w.coeurs} cœurs · ${reserves} réservés sur ${budget}${demandeDite(w)} · ${ilYa(maintenant - w.depuis)}`,
1777
1807
  });
1778
1808
  }
1779
1809
  }
@@ -1983,6 +2013,9 @@ export function lignes(t, nom, largeur = LARGEUR, groupes = {}) {
1983
2013
  : cadre(`${signeDe(a)} ${duProjet(a)}${a.texte}`, '', largeur),
1984
2014
  a.ton
1985
2015
  );
2016
+ if (a.detail) {
2017
+ L(` ${finDe(a.detail, largeur - 2)}`, a.ton);
2018
+ }
1986
2019
  }
1987
2020
  if (t.ciDeMain) {
1988
2021
  L(cadre(t.ciDeMain.texte, '', largeur), t.ciDeMain.ton);
@@ -3053,8 +3086,8 @@ export function nommerLesProjets(machine, noms, ici = null) {
3053
3086
  // The board of the repository at <racine>; with <projets>, the folders of other projects, the
3054
3087
  // board of them all (`ensemble`), named « <dépôt> + <projet> + … », with the folder of each
3055
3088
  // 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
3089
+ // session's project's alone. Each project's circuits are read by <circuitsDe> (lists of the
3090
+ // Temporal server that it filters, scripts/circuits-du-serveur.mjs, by default), and the night under way on the
3058
3091
  // machine by <nuitDe> (`nuitDuServeur` by default); a night that does not read shows none.
3059
3092
  /**
3060
3093
  * @param {string} racine
@@ -3152,6 +3185,18 @@ export async function tableau(
3152
3185
  ),
3153
3186
  ici.commun ? path.dirname(ici.commun) : null
3154
3187
  );
3188
+ // A path of a project's `grillhouse.groupe` that leads to no project of the frame, or any other
3189
+ // fault of the key (scripts/groupe-cles.mjs): the alert names the key, the line below its value.
3190
+ for (const l of lus) {
3191
+ for (const { cle, valeur, motif } of l.t ? signalementsDuGroupe(l.dossier) : []) {
3192
+ l.t.alertes.push({
3193
+ etat: 'panne',
3194
+ ton: TONS.panne,
3195
+ texte: `${cle} : ${motif === 'sans-projet' ? 'sans projet du cadre' : 'valeur refusée'}`,
3196
+ detail: valeur,
3197
+ });
3198
+ }
3199
+ }
3155
3200
  const etat = ligneEtat(ici.t, autres.map(l => l.t).filter(Boolean));
3156
3201
  const t = projets.length
3157
3202
  ? 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
  };