@roomi-fields/grillhouse 0.24.7 → 0.24.8

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.
@@ -5,5 +5,5 @@
5
5
  "author": {
6
6
  "name": "Romain Peyrichou"
7
7
  },
8
- "version": "0.24.7"
8
+ "version": "0.24.8"
9
9
  }
package/charte.md CHANGED
@@ -59,8 +59,8 @@ revient. Ainsi aucune séance ne juge ce qu'une règle tranche.
59
59
  **Un agent qui a la réponse l'applique** : une décision qu'il sait trancher et qu'il recommande
60
60
  (un nom, une signature, un paquet à retirer de son plan), il la prend et l'écrit dans sa fiche,
61
61
  sans s'arrêter ; seule monte une question qui revient au responsable (le langage, l'architecture,
62
- un écart à la référence) ou dont il n'a pas la réponse. Ainsi le circuit n'attend que les vraies
63
- décisions.
62
+ un écart à la référence) ou dont il n'a pas la réponse, et elle nomme lequel. Ainsi le circuit
63
+ n'attend que les vraies décisions.
64
64
 
65
65
  **Tous les agents jugent sur le plan** : une décision du responsable entre dans la description du
66
66
  ticket, comme une RFC amendée ; les commentaires restent l'historique. Ainsi chaque agent lit la
@@ -98,13 +98,18 @@ avoir relevé l'existant, qu'une revue la lit une fois, que l'auteur répond une
98
98
  reste ouvert va à qui décide, l'étape 1 du circuit (1 Plan) lance l'explorateur hors de
99
99
  l'enveloppe ; il relève les composants (`npx grillhouse composants-affectes <ticket>`) et finit sur
100
100
  sa fiche : les critères, les paquets à toucher, les composants du relevé qu'il écarte avec leur
101
- raison, ses questions ouvertes avec leur pièce. Le circuit rejoue le relevé sur le plan, sans
101
+ raison, ses questions ouvertes avec leur pièce et leur motif, pourquoi chacune monte (le langage,
102
+ l'architecture, un écart à la référence, ou « sans réponse ») : une question sans motif rend la
103
+ fiche non conforme, redemandée une fois à la même séance (BP 328 : une question que le ticket
104
+ tranchait arrêtait le plan). Le circuit rejoue le relevé sur le plan, sans
102
105
  séance, comme il contrôle les paquets : un composant du relevé ni touché ni écarté rend la fiche
103
106
  non conforme, comme la section des composants touchés d'un document de conception dit pour
104
107
  chacun s'il change, ou pourquoi il reste. Le circuit
105
108
  écrit le plan au ticket : les paquets finissent son titre, la seule liste que lit l'enveloppe de
106
109
  chaque séance d'après. Le questionneur le lit une fois ; l'explorateur, sa séance
107
- reprise, répond une fois, CHANGE ou GARDE par question ; ce qui reste ouvert monte au superviseur
110
+ reprise, répond une fois, CHANGE ou GARDE par question, une ligne par question posée : une fiche
111
+ sans elle lui est redemandée une fois avec les numéros qui manquent, comme le relecteur donne une
112
+ ligne à chaque élément du lot ; ce qui reste ouvert monte au superviseur
108
113
  (« questionnement »), sinon le circuit passe aux tests. Un plan passé ne se rejoue que si son
109
114
  titre ou ses critères changent. Ainsi les questions utiles se posent avant
110
115
  le plan, et le plan ne tourne pas en rond (BP 320.9 : 132 tours de questions, 29 critères dont 2
@@ -120,8 +125,11 @@ change, le diff des rapports d'API (`docs/INTERFACE.api.md`) les exports qui cha
120
125
  rend une ligne par élément (`conformite`), conforme ou non, la règle citée (`document` CADRE,
121
126
  INTERFACE ou ARCHITECTURE, et sa `reference`) ; un export neuf cite son entrée dans l'INTERFACE.
122
127
  Le schéma de la fiche refuse une ligne sans document ni référence (`resultats.mjs`), et le
123
- circuit une fiche à laquelle il manque un élément (`conformiteDuLot`) ; un « non » rend le lot à
124
- son destinataire. En relecture bornée, comme une revue ne décoche « vu » que sur les fichiers
128
+ circuit une fiche à laquelle il manque un élément, ou dont une ligne nomme un élément hors de la
129
+ liste (`conformiteDuLot`) ; un « non » rend le lot à son destinataire. Un fichier que le service de
130
+ langage ne lit pas, la liste le nomme : le relecteur en relève lui-même les éléments, une ligne
131
+ chacun, `<fichier>#<nom>`, ou le fichier seul, comme une revue accepte un commentaire sur toute
132
+ ligne du diff. En relecture bornée, comme une revue ne décoche « vu » que sur les fichiers
125
133
  changés depuis, la consigne marque chaque élément : à rejuger quand la différence le touche,
126
134
  repris sinon avec sa ligne d'avant, que la fiche porte encore. Ainsi rien de neuf n'entre sans
127
135
  avoir été jugé contre l'architecture (Romain, 2026-10-23 : « il faut que le relecteur valide
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@roomi-fields/grillhouse",
3
- "version": "0.24.7",
3
+ "version": "0.24.8",
4
4
  "description": "Roomi's Grillhouse: the frame's scripts, called by one command, grillhouse <sous-commande>",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -52,7 +52,8 @@
52
52
  // answers once, and what stays open goes to who decides. One session of the explorateur out of
53
53
  // the envelope, on Sonnet, its instruction from the sixth template (the ticket, its title,
54
54
  // description and notes, the context), writes the plan in its sheet: its criteria, the packages
55
- // to touch, and its open questions, each with its piece; it surveys the components the ticket
55
+ // to touch, and its open questions, each with why it goes up (its motif: the language, the
56
+ // architecture, a gap to the reference, or no answer) and its piece; it surveys the components the ticket
56
57
  // reaches by `npx grillhouse composants-affectes <ticket>` (scripts/composants-affectes.mjs),
57
58
  // which the circuit plays no more as a step. A package the repository does not hold, one named
58
59
  // twice, or a component of the survey of the plan (`releve`, which the circuit plays with no
@@ -72,7 +73,10 @@
72
73
  // at), AUCUNE or DÉSACCORD. On its questions, its disagreement as one, the explorateur's session
73
74
  // is resumed once, its instruction from the seventh template (the numbered questions): its sheet
74
75
  // answers each question, CHANGE (what the plan becomes) or GARDE (why it stays), and carries the
75
- // plan as it becomes, which the circuit writes at the ticket again. The exchange is written at
76
+ // plan as it becomes, which the circuit writes at the ticket again. A sheet without a line of
77
+ // `reponses` by question put (`reponsesAuxQuestions` of scripts/resultats.mjs) is refused and
78
+ // asked again once of the same session, the numbers that lack named; only after that resumption
79
+ // does a question without its line stay open. The exchange is written at
76
80
  // the ticket (`Circuit · plan : …`, `Circuit · questionnement : …`) and its end kept with the
77
81
  // circuit's results (`questionnement`: objet, the questions asked, `questions`, change, issue,
78
82
  // ouvertes, the plan's fingerprint). What stays open (the plan's own questions, and each
@@ -514,6 +518,7 @@ import {
514
518
  lireResumes,
515
519
  lireSarif,
516
520
  regleDeLaLigne,
521
+ reponsesAuxQuestions,
517
522
  RESULTATS,
518
523
  schemaDeFiche,
519
524
  } from './resultats.mjs';
@@ -1307,8 +1312,9 @@ function seanceLancee(ctx, role, r) {
1307
1312
  // id for that author (`ctx.reprise`); with <repli> (a resumption), a session that ends in error
1308
1313
  // returns null, for a fresh session in its place. Throws an Arret for a launch that stops before its session,
1309
1314
  // a motionless session, or twice no sheet that conforms (« sans-fiche »). <avec> joins its fields
1310
- // to the sheet's entry (the lot a review read); <valider> names what makes a sheet out of
1311
- // conformity beyond its schema (an unknown package of a plan), or null.
1315
+ // to the sheet's entry (the lot a review read); <valider>(sheet, attempt) names what makes a sheet
1316
+ // out of conformity beyond its schema at that attempt (an unknown package of a plan, an answer
1317
+ // without a line for a question put), or null.
1312
1318
  async function jusquALaFiche(ctx, role, texte, options = {}) {
1313
1319
  const {
1314
1320
  neuve,
@@ -1337,7 +1343,7 @@ async function jusquALaFiche(ctx, role, texte, options = {}) {
1337
1343
  r.seance === 0
1338
1344
  ? lireSaFiche(ctx, role, r.sortie)
1339
1345
  : { erreur: `la séance finit en erreur (code ${r.seance})` };
1340
- const faute = lu.fiche ? valider(lu.fiche) : null;
1346
+ const faute = lu.fiche ? valider(lu.fiche, essai) : null;
1341
1347
  if (faute) lu = { erreur: `fiche non conforme : ${faute}` };
1342
1348
  if (lu.fiche) return garder(ctx, role, lu.fiche, avec);
1343
1349
  if (essai === 1) {
@@ -1542,7 +1548,7 @@ async function relire(ctx) {
1542
1548
  horsEnveloppe: true,
1543
1549
  droits: horsDeLEnveloppe(ctx, 'relecteur', 'opus'),
1544
1550
  avec: lot ? { lot: { ...lot, fichiers: [...tests, ...code] } } : {},
1545
- valider: f => conformiteDuLot(f, liste.elements),
1551
+ valider: f => conformiteDuLot(f, liste),
1546
1552
  });
1547
1553
  const texte = texteDuVerdict(fiche);
1548
1554
  const r = ctx.bdSous(AUTEUR_DU_VERDICT, 'comments', 'add', ctx.ticket, texte);
@@ -1555,7 +1561,7 @@ async function relire(ctx) {
1555
1561
  // in a bounded review (<bornee>: `{ touches, lignes }`, the ids the difference touches, null for
1556
1562
  // every one, and the lines of the review before by element), each marked to judge again, or to
1557
1563
  // take up with its line before; then the changed sources the language service does not read,
1558
- // whose elements he surveys himself, and why.
1564
+ // whose elements he surveys himself, one line of conformity each as `<fichier>#<nom>`, and why.
1559
1565
  function texteDesElements(liste, bornee = null) {
1560
1566
  if (liste.etat !== 'fait') {
1561
1567
  return `aucun : la liste n'a pas pu être calculée (${liste.raison}) ; tu relèves toi-même chaque élément du lot.`;
@@ -1577,7 +1583,7 @@ function texteDesElements(liste, bornee = null) {
1577
1583
  ? `le service de langage n'a pas pu tourner : ${liste.service}`
1578
1584
  : 'aucun tsconfig.json ne les lit';
1579
1585
  lignes.push(
1580
- `- Hors du service de langage (${pourquoi}), tu relèves toi-même leurs éléments : ${liste.horsDuService.join(', ')}.`
1586
+ `- Hors du service de langage (${pourquoi}), tu relèves toi-même leurs éléments, une ligne de conformité chacun, son élément \`<fichier>#<nom>\` : ${liste.horsDuService.join(', ')}.`
1581
1587
  );
1582
1588
  }
1583
1589
  return lignes.join('\n') || 'aucun : le lot ne change aucun élément du code.';
@@ -3353,10 +3359,12 @@ function aLaFin(ctx, code) {
3353
3359
  const lignesDesQuestions = questions =>
3354
3360
  (questions ?? []).map((q, i) => `${i + 1}. (${q.vise}) ${q.question}`).join('\n');
3355
3361
 
3356
- // The open questions <questions> of a plan (`{ question, piece }`), one per line, each with its
3357
- // piece.
3362
+ // The open questions <questions> of a plan (`{ question, motif, piece }`), one per line, each with
3363
+ // why it goes up, when the explorateur wrote it, and its piece.
3358
3364
  const lignesOuvertes = questions =>
3359
- questions.map((q, i) => `${i + 1}. ${q.question} (${q.piece})`).join('\n');
3365
+ questions
3366
+ .map((q, i) => `${i + 1}. ${q.motif ? `(${q.motif}) ` : ''}${q.question} (${q.piece})`)
3367
+ .join('\n');
3360
3368
 
3361
3369
  // The rubric « ## <titre> » of the project's charter (CLAUDE.md of the main tree), up to the next
3362
3370
  // `##` heading, or what stands in its place.
@@ -3524,8 +3532,9 @@ const ecartsDe = fiche =>
3524
3532
  // explorateur, out of the envelope, writes the plan in its sheet (its criteria, the packages to
3525
3533
  // touch, its open questions), which the circuit writes at the ticket (`ecrireLePlan`); one session
3526
3534
  // of the questionneur reads it once; on its questions (its disagreement as one), the explorateur's
3527
- // session, resumed, answers once, CHANGE or GARDE by question, its sheet the plan as it becomes. A
3528
- // question it leaves without an answer stays open with its own. Each session's work is named in
3535
+ // session, resumed, answers once, CHANGE or GARDE by question, its sheet the plan as it becomes; a
3536
+ // sheet without a line by question put is asked again once of that session, and a question it
3537
+ // still leaves without an answer stays open with its own. Each session's work is named in
3529
3538
  // the state while it runs (`questionnement`); the exchange is written at the ticket and its end
3530
3539
  // kept with the circuit's results (`questionnement`, which the bilan counts). A plan that has
3531
3540
  // passed, its title and criteria unchanged since (`empreinteDuPlan`), passes. Null when nothing
@@ -3632,7 +3641,14 @@ async function lePlan(ctx) {
3632
3641
  },
3633
3642
  6
3634
3643
  ),
3635
- { ...explorateur, premiere: 'reprend' }
3644
+ {
3645
+ ...explorateur,
3646
+ premiere: 'reprend',
3647
+ // A line of `reponses` by question put, asked again once; after it, a question without
3648
+ // its line stays open.
3649
+ valider: (f, essai) =>
3650
+ explorateur.valider(f) ?? (essai === 1 ? reponsesAuxQuestions(f, posees.length) : null),
3651
+ }
3636
3652
  );
3637
3653
  reponses = plan.reponses ?? [];
3638
3654
  const lignes = reponses.map(r => `${r.numero}. ${r.reponse} — ${r.texte}`).join('\n');
@@ -15,7 +15,9 @@
15
15
  // settings and charter, and the frame's plugin it enables (agents, skills, common charter,
16
16
  // hooks), stay in.
17
17
  // - `--settings <json>` (the settings of the role, on the command line: no file the session could
18
- // change): its permissions (`allow`, the commands its skill names; `deny`, the change of its
18
+ // change): its permissions (`allow`, the commands its skill names, and the reading of its
19
+ // skill's files, references included, and of the METACADRE.md its skill names, in the frame's
20
+ // plugin as installed for the copy, else for the project, by `Read` and `ls` and with no writing; `deny`, the change of its
19
21
  // author at the ticket, AUTEUR_FIXE, for a role that writes the editing by script, the test
20
22
  // tool run directly and the reading again of the ticket its instruction carries, and for a role
21
23
  // that writes nothing at the ticket, the explorateur and the questionneur, every write of bd,
@@ -129,12 +131,14 @@ const LIRE = ['Bash', 'Read', 'Skill'];
129
131
  const ECRIRE = ['Edit', 'Write'];
130
132
 
131
133
  // Each role the circuit launches: whether it writes (files, `ecrit`; the ticket, unless
132
- // `ecritAuTicket` is false), whether it uses the index, and the commands its skill names (the
133
- // frame's plugin, `mods/grillhouse/skills/<rôle>/`), as permission rules.
134
+ // `ecritAuTicket` is false), whether it uses the index, whether its skill names the frame's
135
+ // METACADRE.md (`metacadre`, read at the root of the plugin installed), and the commands its skill
136
+ // names (the frame's plugin, `mods/grillhouse/skills/<rôle>/`), as permission rules.
134
137
  export const ROLES = {
135
138
  // It writes no file and nothing at the ticket: it surveys the components and reads the code by
136
139
  // the index, and ends on the plan in its sheet, which the circuit writes at the ticket.
137
140
  explorateur: {
141
+ metacadre: true,
138
142
  index: true,
139
143
  ecritAuTicket: false,
140
144
  commandes: [
@@ -149,6 +153,7 @@ export const ROLES = {
149
153
  // It writes the tests of the whole ticket, in the envelope of its plan, and reads the whole copy
150
154
  // by the index (charter, « L'index d'abord »).
151
155
  testwriter: {
156
+ metacadre: true,
152
157
  ecrit: true,
153
158
  index: true,
154
159
  commandes: [
@@ -163,6 +168,7 @@ export const ROLES = {
163
168
  // It writes the code of the whole ticket, in the envelope of its plan, and reads the whole copy
164
169
  // by the index.
165
170
  developpeur: {
171
+ metacadre: true,
166
172
  ecrit: true,
167
173
  index: true,
168
174
  commandes: [
@@ -177,6 +183,7 @@ export const ROLES = {
177
183
  ],
178
184
  },
179
185
  relecteur: {
186
+ metacadre: true,
180
187
  index: true,
181
188
  commandes: [
182
189
  ...LIRE_GIT,
@@ -219,23 +226,43 @@ function greffonsDuProjet(racine) {
219
226
  return [...actifs].sort();
220
227
  }
221
228
 
222
- // The installed path of the plugin <nom> for the project <racine>: its entry for the project
223
- // first, else the user's.
224
- function cheminDuGreffon(nom, racine, home) {
229
+ // The installed path of the plugin <nom> for the projects <projets>: the entry of the first that
230
+ // has one, else the user's.
231
+ function cheminDuGreffon(nom, projets, home) {
225
232
  const entrees =
226
233
  lireJson(path.join(home, '.claude', 'plugins', 'installed_plugins.json'))?.plugins?.[nom] ?? [];
227
234
  const e =
228
- entrees.find(x => x.projectPath === racine) ?? entrees.find(x => x.scope === 'user') ?? null;
235
+ projets.map(p => entrees.find(x => x.projectPath === p)).find(Boolean) ??
236
+ entrees.find(x => x.scope === 'user') ??
237
+ null;
229
238
  return e?.installPath ?? null;
230
239
  }
231
240
 
241
+ // The reading of the skill of <role> (SKILL.md and its references/) in the frame's plugin, as
242
+ // installed for the copy where the session runs, else for the project, and of the plugin's
243
+ // METACADRE.md alone for a role whose skill names it: rules `Read(//…)`, which let through the
244
+ // tool Read and `ls` of those folders, and write nothing (measured on Claude Code in `dontAsk`).
245
+ // Narrower than a folder of work (`--add-dir`), which would open the whole plugin; none when the
246
+ // plugin is not installed.
247
+ function lireSaCompetence(role, { racine, copie, home }) {
248
+ const cadre = greffonsDuProjet(racine).find(g => g.startsWith(GREFFON_DU_CADRE));
249
+ const dossier = cadre && cheminDuGreffon(cadre, [copie, racine], home);
250
+ if (!dossier) {
251
+ return [];
252
+ }
253
+ return [
254
+ `Read(/${path.join(dossier, 'skills', role)}/**)`,
255
+ ...(ROLES[role].metacadre ? [`Read(/${path.join(dossier, 'METACADRE.md')})`] : []),
256
+ ];
257
+ }
258
+
232
259
  // The servers of the index: the project's `.mcp.json`, then the manifests of the plugins it enables.
233
260
  function serveursDeLIndex(racine, home) {
234
261
  const out = {};
235
262
  const projet = lireJson(path.join(racine, '.mcp.json'))?.mcpServers ?? {};
236
263
  for (const n of INDEX) if (projet[n]) out[n] = projet[n];
237
264
  for (const greffon of greffonsDuProjet(racine)) {
238
- const dossier = cheminDuGreffon(greffon, racine, home);
265
+ const dossier = cheminDuGreffon(greffon, [racine], home);
239
266
  if (!dossier) continue;
240
267
  const serveurs =
241
268
  lireJson(path.join(dossier, '.claude-plugin', 'plugin.json'))?.mcpServers ??
@@ -250,8 +277,8 @@ function serveursDeLIndex(racine, home) {
250
277
  }
251
278
 
252
279
  // The settings of the session of <role>, for the ticket <ticket>, its copy <copie> (where the
253
- // project's own skills are read) and the main tree <racine>.
254
- function reglagesDuRole(role, { racine, copie = racine, ticket }) {
280
+ // project's own skills are read) and the main tree <racine>; <home> holds the plugins installed.
281
+ function reglagesDuRole(role, { racine, copie = racine, ticket, home }) {
255
282
  const r = ROLES[role];
256
283
  if (!r) throw new Error(`rôle sans droits : ${role}`);
257
284
  const deny = [...AUTEUR_FIXE, ...(r.ecritAuTicket === false ? ECRIRE_AU_TICKET : [])];
@@ -272,7 +299,10 @@ function reglagesDuRole(role, { racine, copie = racine, ticket }) {
272
299
  : []),
273
300
  ];
274
301
  const reglages = {
275
- permissions: { allow: [...r.commandes], deny },
302
+ permissions: {
303
+ allow: [...r.commandes, ...lireSaCompetence(role, { racine, copie, home })],
304
+ deny,
305
+ },
276
306
  autoMemoryEnabled: false,
277
307
  disableBundledSkills: true,
278
308
  skillOverrides: Object.fromEntries(autres.map(s => [s, 'off'])),
@@ -321,7 +351,7 @@ export function optionsDuRole(role, contexte) {
321
351
  '--setting-sources',
322
352
  'project,local',
323
353
  '--settings',
324
- JSON.stringify(reglagesDuRole(role, contexte)),
354
+ JSON.stringify(reglagesDuRole(role, { ...contexte, home })),
325
355
  '--tools',
326
356
  outils.join(','),
327
357
  '--strict-mcp-config',
@@ -21,7 +21,7 @@
21
21
  // that no element of its package's sources already names (a type that changed through another),
22
22
  // is an element of the report itself, exported.
23
23
  // - A changed source that the service does not read (a package without `tsconfig.json`) is named
24
- // in `horsDuService`: the reviewer surveys its elements himself.
24
+ // in `horsDuService`: the reviewer surveys its elements himself, each named `<fichier>#<nom>`.
25
25
  import { spawnSync } from 'node:child_process';
26
26
  import { existsSync } from 'node:fs';
27
27
  import { createRequire } from 'node:module';
@@ -54,14 +54,19 @@
54
54
  # agent finds the builds of the packages out of its plan. As Bazel builds the dependencies of a
55
55
  # target before the target: for a plan whose every path is a package of the frame (the circuit's
56
56
  # session over the whole ticket, `.` as its component and the plan as `--paquets`, or a component
57
- # alone), their providers are built first (the packages whose build their builds wait for, read
58
- # in Turborepo's graph, `turbo run build --filter=<paquet>… --dry=json`, which node reads on its
59
- # standard input, whatever its size), and a failure stops the launch, CODE_COPIE;
57
+ # alone), their providers are built first (the builds their builds wait for, read in Turborepo's
58
+ # graph, `turbo run build --filter=<paquet>… --dry=json`, which node reads on its standard input,
59
+ # whatever its size), and a failure stops the launch, CODE_COPIE;
60
60
  # then the traces of other packages their tests wait for (`grillhouse.traces`, read in Turborepo's
61
61
  # plan of their tests, `turbo run test:vitest --filter=<paquet>… --dry=json`), which the envelope
62
- # shows read-only, and a failure stops the launch, CODE_COPIE; then the packages, their own
63
- # traces and what their tests read (`turbo run build <their traces> --filter=<paquet>...…
64
- # --continue=dependencies-successful`), whose failure does not stop it: each task whose
62
+ # shows read-only, and a failure stops the launch, CODE_COPIE. A task of either step that waits,
63
+ # directly or not, for a task of a package of the plan (`attendentLePlan` of
64
+ # turbo-des-paquets.mjs) is not played there: as with Bazel's --keep_going, a package of the plan
65
+ # stays a target of the plan even as another's provider (BPScript's 990-corpus, the shared test
66
+ # material, which the trace of 060-encoder waits for), and goes with the plan. Then the packages,
67
+ # the traces of the plan or that wait for it, and what their tests read (`turbo run build <those
68
+ # traces> --filter=<paquet>...… --continue=dependencies-successful`), whose failure does not
69
+ # stop it: each task whose
65
70
  # dependencies succeed goes to its end, so what their tests read without depending on them is
66
71
  # built whole; the session opens, its instruction ending with a section « La construction de ton
67
72
  # paquet échoue » with the end of that output, since repairing it is the session's work (a
@@ -243,30 +248,32 @@ echec=$(mktemp)
243
248
  mapfile -t lesNoms <<<"$noms"
244
249
  cibles=() lecteurs=()
245
250
  for n in "${lesNoms[@]}"; do cibles+=("--filter=$n"); lecteurs+=("--filter=$n..."); done
246
- # Their providers: the packages whose build their own builds wait for, as Turborepo reads them.
251
+ # Their providers: the builds their own builds wait for, as Turborepo reads them, save those
252
+ # that wait for a package of the plan, which go with the plan below. The graph comes on the
253
+ # standard input: as an argument, it may pass the size Linux allows one.
247
254
  graphe=$(cd "$copie" && monter npx --no-install turbo run build "${cibles[@]}" --dry=json) || exit 1
248
- # The graph comes on the standard input: as an argument, it may pass the size Linux allows one.
249
- fournisseurs=$(node -e 'const plan = process.argv.slice(1); const t = JSON.parse(require("node:fs").readFileSync(0, "utf8")).tasks.filter(t => !plan.includes(t.package)); console.log([...new Set(t.map(t => `--filter=${t.package}`))].join("\n"));' "${lesNoms[@]}" <<<"$graphe") || exit 1
255
+ fournisseurs=$(node --input-type=module -e "import { readFileSync } from 'node:fs'; import { attendentLePlan } from '$ici/../turbo-des-paquets.mjs'; const g = JSON.parse(readFileSync(0, 'utf8')); const avec = attendentLePlan(g, process.argv.slice(1)); console.log(g.tasks.map(t => t.taskId).filter(id => !avec.has(id)).sort().join('\n'));" "${lesNoms[@]}" <<<"$graphe") || exit 1
250
256
  if [ -n "$fournisseurs" ]; then
251
- mapfile -t filtres <<<"$fournisseurs"
252
- (cd "$copie" && monter npx --no-install turbo run build "${filtres[@]}") || exit 1
257
+ mapfile -t ids <<<"$fournisseurs"
258
+ (cd "$copie" && monter npx --no-install turbo run "${ids[@]}") || exit 1
253
259
  fi
254
260
  # The traces their tests wait for, as Turborepo's plan of their tests reads them. Another
255
- # package's trace is produced here, and a failure stops the launch, as a provider's; a trace
256
- # of the plan waits for its build, and is produced with it below.
261
+ # package's trace that waits for no package of the plan is produced here, and a failure
262
+ # stops the launch, as a provider's; a trace of the plan, or one that waits for a package of
263
+ # the plan, is produced with the plan below.
257
264
  plan=$(cd "$copie" && monter npx --no-install turbo run test:vitest "${cibles[@]}" --dry=json) || exit 1
258
- traces() { node --input-type=module -e "import { readFileSync } from 'node:fs'; import { tracesDuPlan } from '$ici/../turbo-des-paquets.mjs'; const [propres, ...plan] = process.argv.slice(1); console.log(tracesDuPlan(JSON.parse(readFileSync(0, 'utf8')), t => plan.includes(t.package) === (propres === 'oui')).join('\n'));" "$1" "${lesNoms[@]}" <<<"$plan"; }
265
+ traces() { node --input-type=module -e "import { readFileSync } from 'node:fs'; import { attendentLePlan, tracesDuPlan } from '$ici/../turbo-des-paquets.mjs'; const [avec, ...noms] = process.argv.slice(1); const p = JSON.parse(readFileSync(0, 'utf8')); const attend = attendentLePlan(p, noms); console.log(tracesDuPlan(p, t => attend.has(t.taskId) === (avec === 'oui')).join('\n'));" "$1" "${lesNoms[@]}" <<<"$plan"; }
259
266
  autres=$(traces non) || exit 1
260
267
  if [ -n "$autres" ]; then
261
268
  mapfile -t ids <<<"$autres"
262
269
  (cd "$copie" && monter npx --no-install turbo run "${ids[@]}") || exit 1
263
270
  fi
264
- propres=$(traces oui) || exit 1
271
+ avec=$(traces oui) || exit 1
265
272
  ids=()
266
- [ -z "$propres" ] || mapfile -t ids <<<"$propres"
267
- # The packages of the plan, their own traces, and what their tests read (the shared test
268
- # material), built after their providers: a failure does not stop the launch, it goes into
269
- # the instruction. Each task whose dependencies succeed goes to its end
273
+ [ -z "$avec" ] || mapfile -t ids <<<"$avec"
274
+ # The packages of the plan, the traces that go with them, and what their tests read (the
275
+ # shared test material), built after their providers: a failure does not stop the launch, it
276
+ # goes into the instruction. Each task whose dependencies succeed goes to its end
270
277
  # (--continue=dependencies-successful): one package's failure does not cancel the build of
271
278
  # what the tests read without depending on it, which the envelope shows read-only.
272
279
  if ! (cd "$copie" && monter npx --no-install turbo run build ${ids[@]+"${ids[@]}"} "${lecteurs[@]}" --continue=dependencies-successful) > "$echec" 2>&1; then
@@ -33,19 +33,22 @@
33
33
  // one line per element of the lot (scripts/elements-du-lot.mjs), its rule cited from a
34
34
  // document of its package, a new export's the entry of the INTERFACE that names it; a line
35
35
  // without its reference is refused; a « non » is a blocking finding (`bloquantsDeLaFiche`),
36
- // and the circuit refuses a sheet without a line for each element (`conformiteDuLot`)
37
- // (reviewer);
36
+ // and the circuit refuses a sheet without a line for each element, or with a line on an
37
+ // element out of the list, a file out of the language service named alone or as
38
+ // `<fichier>#<nom>` (`conformiteDuLot`) (reviewer);
38
39
  // - `suivi` (`titre`, `etat` levé or non levé, `preuve`): after a review sent back, each finding
39
40
  // before it judged on the difference of the lot, which the circuit writes at the ticket with
40
41
  // the verdict, for the human (reviewer);
41
42
  // - `question`, with its `piece` (reviewer): what goes up to the owner, a real word of the
42
43
  // language written in the code; the circuit stops at « besoin » before it commits or
43
44
  // relaunches anyone;
44
- // - `criteres`, `paquets`, `questions` (each with its `piece`): the plan, which the circuit
45
+ // - `criteres`, `paquets`, `questions` (each with its `motif` and its `piece`): the plan, which the circuit
45
46
  // writes at the ticket: the criteria it adds after those the ticket holds, which the circuit
46
47
  // keeps as they are; the packages in the title as it names its components (a package name or a
47
48
  // path), the list the envelope of every later session writes; the open questions, a change or
48
- // a removal of a criterion written among them, go up to the supervisor (explorateur);
49
+ // a removal of a criterion written among them, go up to the supervisor, each naming why: the
50
+ // language, the architecture, a gap to the reference, or no answer (BP 328: a question the
51
+ // ticket settled stopped the plan) (explorateur);
49
52
  // - `ecartes` (`composant`, `raison`): the components of the survey the plan does not touch,
50
53
  // which the circuit writes at the ticket; each other component of the survey the circuit
51
54
  // plays is in the packages (explorateur);
@@ -159,6 +162,10 @@ const ECARTS = {
159
162
  // The documents a line of a reviewer's conformity cites its rule from.
160
163
  const DOCUMENTS = ['CADRE', 'INTERFACE', 'ARCHITECTURE'];
161
164
 
165
+ // Why an open question of a plan goes up: what is the owner's (the language, the architecture, a
166
+ // gap to the mature reference), or no answer the explorateur holds.
167
+ const MOTIFS = ['langage', 'architecture', 'écart à la référence', 'sans réponse'];
168
+
162
169
  // The schema of the sheet of each role the circuit leads.
163
170
  const FICHES = {
164
171
  explorateur: objet(
@@ -185,11 +192,17 @@ const FICHES = {
185
192
  objet(
186
193
  {
187
194
  question: texte('La question qui reste ouverte, ses options et ta recommandation.'),
195
+ motif: {
196
+ type: 'string',
197
+ enum: MOTIFS,
198
+ description:
199
+ 'Pourquoi elle monte : ce qui revient au responsable (le langage, l’architecture, un écart à la référence), ou « sans réponse », tu n’as pas la réponse.',
200
+ },
188
201
  piece: piece('Sa pièce'),
189
202
  },
190
- ['question', 'piece']
203
+ ['question', 'motif', 'piece']
191
204
  ),
192
- 'Les questions ouvertes du plan, que tu ne tranches pas ; elles montent au superviseur.'
205
+ 'Les questions ouvertes du plan, que tu ne tranches pas ; elles montent au superviseur. Une question que tu sais trancher, tu la tranches dans le plan.'
193
206
  ),
194
207
  reponses: liste(
195
208
  objet(
@@ -384,19 +397,27 @@ export const bloquantsDeLaFiche = fiche => [
384
397
  })),
385
398
  ];
386
399
 
387
- // What makes the reviewer's sheet <fiche> out of conformity with the elements of its lot
388
- // <elements> (scripts/elements-du-lot.mjs: `{ id, nom, statut, exporte }`), as a review asks a
400
+ // What makes the reviewer's sheet <fiche> out of conformity with the list of its lot
401
+ // (scripts/elements-du-lot.mjs: <elements>, each `{ id, nom, statut, exporte }`, and
402
+ // <horsDuService>, the changed sources the language service does not read), as a review asks a
389
403
  // word on every changed file: an element without its line, a line on an element out of the list,
390
- // a new export whose rule does not name its entry in the INTERFACE of its package. The fault, or
391
- // null.
392
- export function conformiteDuLot(fiche, elements) {
404
+ // a new export whose rule does not name its entry in the INTERFACE of its package. A line on a
405
+ // file out of the service names it alone or one of its elements, `<fichier>#<nom>`, as a review
406
+ // accepts a comment on any line of the diff. The fault, or null.
407
+ export function conformiteDuLot(fiche, { elements, horsDuService }) {
393
408
  const lignes = fiche.conformite ?? [];
394
409
  const ids = new Set(elements.map(e => e.id));
410
+ const hors = new Set(horsDuService);
411
+ const duLot = element => {
412
+ if (ids.has(element) || hors.has(element)) return true;
413
+ const diese = element.lastIndexOf('#');
414
+ return diese > 0 && diese < element.length - 1 && hors.has(element.slice(0, diese));
415
+ };
395
416
  const fautes = [];
396
417
  const sans = elements.filter(e => !lignes.some(l => l.element === e.id)).map(e => e.id);
397
418
  if (sans.length) fautes.push(`conformite : sans ligne pour ${sans.join(', ')}`);
398
419
  for (const [i, l] of lignes.entries()) {
399
- if (!ids.has(l.element)) {
420
+ if (!duLot(l.element)) {
400
421
  fautes.push(`conformite[${i}].element : ${l.element} n'est pas un élément du lot`);
401
422
  }
402
423
  }
@@ -412,6 +433,15 @@ export function conformiteDuLot(fiche, elements) {
412
433
  return fautes.length ? fautes.join(' ; ') : null;
413
434
  }
414
435
 
436
+ // What makes the explorateur's answer <fiche> out of conformity with the <posees> questions put to
437
+ // it, as a reviewer gives a line to each element of its lot: each question without its line of
438
+ // `reponses`, by its number. The fault, or null.
439
+ export function reponsesAuxQuestions(fiche, posees) {
440
+ const numeros = new Set((fiche.reponses ?? []).map(r => Number(r.numero)));
441
+ const sans = Array.from({ length: posees }, (_, i) => i + 1).filter(n => !numeros.has(n));
442
+ return sans.length ? `reponses : sans ligne pour les questions ${sans.join(', ')}` : null;
443
+ }
444
+
415
445
  // The piece of a fact <texte>: `{ fichier, ligne }` for « <fichier>:<ligne> », `{ fichier, ligne,
416
446
  // fin }` for « <fichier>:<ligne>-<fin> » (as SARIF's region has a start line and an optional end
417
447
  // line), then what it shows after a space, the place in backquotes or followed by punctuation
@@ -234,6 +234,26 @@ export const tracesDuPlan = (plan, garder = () => true) =>
234
234
  .map(t => t.taskId)
235
235
  .sort();
236
236
 
237
+ // The tasks of a plan of Turborepo (`turbo run … --dry=json`, parsed) that wait, directly or not,
238
+ // for a task of one of the packages <paquets>, those tasks included: their task ids. As Bazel
239
+ // under --keep_going, a task that waits for a target of the plan goes with the plan, whose failure
240
+ // is the session's work; the others are the plan's providers.
241
+ export function attendentLePlan(plan, paquets) {
242
+ const parId = new Map(plan.tasks.map(t => [t.taskId, t]));
243
+ const verdicts = new Map();
244
+ const attend = id => {
245
+ if (verdicts.has(id)) return verdicts.get(id);
246
+ // A cycle of tasks is no wait on the plan by itself; Turborepo refuses it anyway.
247
+ verdicts.set(id, false);
248
+ const t = parId.get(id);
249
+ const v =
250
+ t !== undefined && (paquets.includes(t.package) || (t.dependencies ?? []).some(attend));
251
+ verdicts.set(id, v);
252
+ return v;
253
+ };
254
+ return new Set(plan.tasks.map(t => t.taskId).filter(attend));
255
+ }
256
+
237
257
  // A path from the root, without its trailing slashes.
238
258
  const net = d => String(d ?? '').replace(/\/+$/, '');
239
259
  // The fixed part of the pattern <motif>, its segments before the first holding a glob character,
@@ -69,7 +69,10 @@ change, et ceux qu'il peut casser.
69
69
  que je sais trancher et recommande, je l'applique au plan (écarter un paquet qui n'a rien à
70
70
  changer, par exemple) et je le dis dans ma fiche. Chaque question : chacune avec ses options, ma recommandation et sa
71
71
  `piece` (fichier:ligne depuis la racine de la copie, ou « $ commande » et sa sortie), que le
72
- circuit cherche dans la copie ; elles montent au superviseur. Un fait que je reprends d'un
72
+ circuit cherche dans la copie ; elles montent au superviseur. Chacune dit pourquoi elle monte,
73
+ son `motif` : `langage`, `architecture` ou `écart à la référence`, ce qui revient au
74
+ responsable, ou `sans réponse`, je n'ai pas la réponse. Une question sans motif, ou au motif
75
+ hors de ces valeurs, rend ma fiche non conforme : le circuit me la redemande une fois. Un fait que je reprends d'un
73
76
  autre agent (le ticket, une passation) se relit à sa pièce avant que je m'appuie dessus.
74
77
  Une décision que la référence mature, l'existant ou une règle du cadre tranche, je la tranche
75
78
  dans le plan, sa raison au critère. _Fini quand_ chaque critère se mesure et chaque composant du
@@ -77,8 +80,10 @@ change, et ceux qu'il peut casser.
77
80
  3. **La réponse.** Le circuit reprend ma séance avec les questions du questionneur, numérotées. Je
78
81
  réponds une seule fois, à chacune : CHANGE, et ce que le plan devient, ou GARDE, et pourquoi il
79
82
  reste tel quel. Ma fiche porte aussi le plan tel qu'il devient, ses `questions` ouvertes
80
- comprises. Une question sans réponse reste ouverte. _Fini quand_ chaque question a sa réponse,
81
- ou reste ouverte dans le plan.
83
+ comprises. Chaque question posée a sa ligne dans mes `reponses`, même quand je réponds par des
84
+ critères ajoutés : une fiche sans elle est refusée, et le circuit me la redemande une fois avec
85
+ les numéros qui manquent ; après, une question sans ligne reste ouverte. _Fini quand_ chaque
86
+ question a sa ligne.
82
87
 
83
88
  Je n'écris ni fichier ni plan au ticket : le circuit l'écrit depuis ma fiche. Ainsi le plan a une
84
89
  seule source, et les paquets un seul format.
@@ -211,7 +211,7 @@ Une séance de supervision charge le superviseur (`pitmaster`) ; un projet a un
211
211
  comme Zuul a un seul ordonnanceur : l'ouverture de séance prend le verrou du dépôt, et une seconde
212
212
  séance le dit au responsable et ne lance aucun circuit. Les rôles sont des agents du greffon du
213
213
  cadre (ses `agents/`, leurs compétences dans ses `skills/`), chacun sous ses verrous et les droits que nomment les commandes de sa
214
- compétence, sans la configuration propre de l'utilisateur (`packages/grillhouse/scripts/droits.mjs`). Un ticket
214
+ compétence, avec la lecture des fichiers de sa compétence et du métacadre dans le greffon installé, sans la configuration propre de l'utilisateur (`packages/grillhouse/scripts/droits.mjs`). Un ticket
215
215
  parcourt l'arbre de son circuit, les étapes « auto » comprises (`packages/grillhouse/scripts/etapes.mjs`, la seule
216
216
  liste), comme un pipeline de GitLab CI ses étapes et leurs travaux : 1 Plan : l'`explorateur` écrit le plan
217
217
  (ses critères, les paquets à toucher, ses questions ouvertes, que le circuit écrit au ticket), le
@@ -103,7 +103,7 @@ LES ÉLÉMENTS DU LOT, chaque fonction, classe, type, interface, constante de t
103
103
 
104
104
  {{elements}}
105
105
 
106
- Ta fiche rend une ligne de `conformite` par élément, son `element` tel que cette liste l'écrit : `conforme` oui ou non, la règle citée (`document` : le CADRE, l'INTERFACE ou l'ARCHITECTURE de son paquet ; `reference` : la règle dans ce document ; un export neuf, son entrée dans l'INTERFACE de son paquet), sa `piece` ; un « non » nomme son agent (`role`) et rend le lot. En relecture bornée, tu rejuges un élément marqué « à rejuger » et tu reprends la ligne d'un élément marqué « reprise » ; chacun garde sa ligne. Le circuit refuse une fiche à laquelle il manque un élément. Ainsi chaque élément nouveau ou changé est jugé contre l'architecture.
106
+ Ta fiche rend une ligne de `conformite` par élément, son `element` tel que cette liste l'écrit : `conforme` oui ou non, la règle citée (`document` : le CADRE, l'INTERFACE ou l'ARCHITECTURE de son paquet ; `reference` : la règle dans ce document ; un export neuf, son entrée dans l'INTERFACE de son paquet), sa `piece` ; un « non » nomme son agent (`role`) et rend le lot. Un fichier hors du service de langage : une ligne par élément que tu y relèves, son `element` écrit `<fichier>#<nom>`. En relecture bornée, tu rejuges un élément marqué « à rejuger » et tu reprends la ligne d'un élément marqué « reprise » ; chacun garde sa ligne. Le circuit refuse une fiche à laquelle il manque un élément. Ainsi chaque élément nouveau ou changé est jugé contre l'architecture.
107
107
 
108
108
  LES RAPPORTS DU CIRCUIT depuis le dernier verdict (preuves du rouge, contrôles, passe finale) :
109
109
 
@@ -201,7 +201,7 @@ LES NOTES DU TICKET :
201
201
 
202
202
  {{notes}}
203
203
 
204
- Tu relèves les composants que le ticket touche (`npx grillhouse composants-affectes {{ticket}}`) et le code qu'il change, par l'index. Ta fiche, que le circuit lit seule, finit ta séance : le plan, ses `criteres`, ceux que tu ajoutes (chacun un comportement que ses tests mesurent, sans son numéro ; le circuit garde tels quels les critères écrits au ticket, la décision du responsable, et écrit les tiens après eux ; changer ou retirer un critère écrit est une question ouverte), ses `paquets` à toucher (le fournisseur d'abord, chacun comme le titre le nomme : le nom de son paquet, ou son chemin), ses `ecartes` (chaque composant du relevé que le plan ne touche pas, avec sa raison ; le circuit rejoue le relevé, et un composant ni dans tes `paquets` ni dans tes `ecartes` rend ta fiche non conforme) et ses `questions` ouvertes (ce que tu ne tranches pas, chacune avec sa `piece`). Chaque séance du ticket n'écrit que les paquets du plan.
204
+ Tu relèves les composants que le ticket touche (`npx grillhouse composants-affectes {{ticket}}`) et le code qu'il change, par l'index. Ta fiche, que le circuit lit seule, finit ta séance : le plan, ses `criteres`, ceux que tu ajoutes (chacun un comportement que ses tests mesurent, sans son numéro ; le circuit garde tels quels les critères écrits au ticket, la décision du responsable, et écrit les tiens après eux ; changer ou retirer un critère écrit est une question ouverte), ses `paquets` à toucher (le fournisseur d'abord, chacun comme le titre le nomme : le nom de son paquet, ou son chemin), ses `ecartes` (chaque composant du relevé que le plan ne touche pas, avec sa raison ; le circuit rejoue le relevé, et un composant ni dans tes `paquets` ni dans tes `ecartes` rend ta fiche non conforme) et ses `questions` ouvertes (ce que tu ne tranches pas, chacune avec son `motif`, pourquoi elle monte : `langage`, `architecture` ou `écart à la référence`, ce qui revient au responsable, ou `sans réponse`, tu n'as pas la réponse ; et sa `piece`). Une question que tu sais trancher, tu la tranches dans le plan. Chaque séance du ticket n'écrit que les paquets du plan.
205
205
 
206
206
  Tu n'écris rien : ni fichier, ni ticket. Le circuit écrit le plan au ticket : les paquets au titre, les critères et les questions ouvertes dans la description. Puis le questionneur le lit une seule fois.
207
207
  ```
@@ -217,5 +217,5 @@ SES QUESTIONS, numérotées :
217
217
 
218
218
  {{questions}}
219
219
 
220
- Tu réponds une seule fois, à chaque question : dans tes `reponses`, son `numero`, CHANGE avec ce que le plan devient, ou GARDE avec pourquoi il reste tel quel. Ta fiche porte aussi le plan tel qu'il devient : ses `criteres`, ceux que tu ajoutes aux critères écrits au ticket, ses `paquets`, ses `ecartes` et ses `questions` ouvertes, celles que tu ne tranches pas. Une question sans réponse reste ouverte. Ce qui reste ouvert monte au superviseur ; le reste, le circuit l'écrit au ticket, et passe aux tests.
220
+ Tu réponds une seule fois, à chaque question : dans tes `reponses`, son `numero`, CHANGE avec ce que le plan devient, ou GARDE avec pourquoi il reste tel quel. Ta fiche porte aussi le plan tel qu'il devient : ses `criteres`, ceux que tu ajoutes aux critères écrits au ticket, ses `paquets`, ses `ecartes` et ses `questions` ouvertes, celles que tu ne tranches pas. Chaque question posée a sa ligne dans tes `reponses`, même quand tu y réponds par des critères ajoutés : une fiche sans elle est refusée et te revient une fois, avec les numéros qui manquent ; après, une question sans ligne reste ouverte. Ce qui reste ouvert monte au superviseur ; le reste, le circuit l'écrit au ticket, et passe aux tests.
221
221
  ```
@@ -34,8 +34,10 @@ des rapports d'API).
34
34
  3. Un `non` rend le lot : il nomme son agent (`role`), comme un constat
35
35
  bloquant. Le circuit refuse une fiche à laquelle il manque un élément, ou dont une ligne n'a
36
36
  pas sa référence.
37
- 4. Un fichier que la liste dit hors du service de langage se relit de même : ses éléments neufs
38
- ou changés se jugent dans cette passe, leurs constats dans `constats`.
37
+ 4. Un fichier que la liste dit hors du service de langage se relit de même : tu relèves ses
38
+ éléments neufs, changés ou supprimés, et chacun a sa ligne de `conformite`, son `element`
39
+ écrit `<fichier>#<nom>` (le fichier seul pour une ligne sur tout le fichier). Le circuit
40
+ refuse une ligne sur un élément hors de la liste et hors de ces fichiers.
39
41
 
40
42
  En relecture bornée, la liste porte encore tout le lot, chaque élément marqué, comme une revue ne
41
43
  décoche « vu » que sur les fichiers changés depuis : « à rejuger » quand la différence le touche