@roomi-fields/grillhouse 0.43.0 → 0.43.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.
@@ -5,5 +5,5 @@
5
5
  "author": {
6
6
  "name": "Romain Peyrichou"
7
7
  },
8
- "version": "0.43.0"
8
+ "version": "0.43.1"
9
9
  }
package/CHANGELOG.md CHANGED
@@ -6,6 +6,10 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.43.1] - 2026-11-17
10
+
11
+ - **A lot that removes a generated file with its command enters main** (grillhouse-1k7): the integration, the queue and the move of a copy onto main played the command of every generated file a lot touches, read in main's `package.json`, even when the lot removes that file, its script and its entry of `grillhouse.engendres`: the command, whose script the lot deletes, failed, and the lot was refused (SyntHub, SH-br0.3, « python3 scripts/build_device_index.py … can't open file »). An entry the tree where the lot is applied no longer declares (`encoreDeclares` of `scripts/engendres.mjs`) is not played, and its files follow the lot: a deletion is done whatever main wrote since, any other change is applied as a file of the lot (`poserLesRetires`, `prendreLesEngendres`). The command line stays main's: a lot removes one, it writes none. **Action for projects**: none; a circuit stopped on that refusal resumes (`--reprendre`).
12
+
9
13
  ## [0.43.0] - 2026-11-17
10
14
 
11
15
  - **The day of the board counts the tokens since the day's marker, as it counts the time** (grillhouse-38t): a session still open counted in the day the part of its turns since the marker, but all the tokens of its transcript — a supervisor's session opened days ago read « jour 6 min · 37,0 M » right after `/grillhouse newday` (OSC Bridge). A measure that holds its tokens by minute now counts in the day those of the minutes since the marker (`jetonsDuJour`); a register line without them counts whole in the day it ended, as before. And the time of the supervisor's own session counts neither in the day nor in the cumul, its tokens still do: open for weeks, each of its turns counted from the request to the end of the answer, its waits included — 2 025 h of « travail » for one session of OSC Bridge, where SyntHub's whole cumul read 135 h; the time of the two figures is now the work of the agents and of the circuits. **Action for projects**: none.
@@ -59,8 +59,9 @@ interface publiée…>. Le cadre et l'architecture montent toujours (charte comm
59
59
  chaque motif depuis la racine : un fichier qu'un lecteur ne peut pas construire, une page lue
60
60
  sur GitHub ou une somme de contrôle publiée ; l'intégration, la file et l'avance d'une copie
61
61
  sur main ne le fusionnent pas, elles prennent la version de main et rejouent sa commande sur le
62
- lot appliqué ; lue dans l'arbre principal ; une clé sans commande, sans fichiers ou avec un
63
- motif hors du dépôt est refusée par son nom avant tout travail).
62
+ lot appliqué ; lue dans l'arbre principal ; une entrée que le lot retire de la clé n'est plus
63
+ rejouée, et ses fichiers suivent le lot, leur suppression comprise ; une clé sans commande, sans
64
+ fichiers ou avec un motif hors du dépôt est refusée par son nom avant tout travail).
64
65
  - Le nombre de circuits à la fois : la clé `grillhouse.circuits` du `package.json` (un entier
65
66
  ≥ 1, **1** quand elle est absente : les circuits actifs du projet à la fois, que la file des
66
67
  tickets tient ; un circuit arrêté sur une question rend sa place, et repris, la redemande avant
@@ -298,7 +298,8 @@ L'intégration, la file qui replace une branche sur main et l'avance d'une copie
298
298
  (`travail-de-la-copie.mjs`, comme le report d'une branche renvoyée) ne fusionnent pas ces
299
299
  fichiers : un lot qui touche l'un d'eux ou ce qu'il lit prend la version de main, puis la commande
300
300
  rejoue hors de l'enveloppe, avec les outils du projet, sur le lot appliqué, et ce qu'elle écrit
301
- entre dans le lot ; la passe finale (4.2) ne les régénère que si un rouge d'une passe tombe
301
+ entre dans le lot ; une entrée que le lot retire de la clé ne se rejoue pas, et ses fichiers
302
+ suivent le lot, leur suppression comprise, comme un genrule de Bazel retiré avec sa sortie ; la passe finale (4.2) ne les régénère que si un rouge d'une passe tombe
302
303
  dans leurs fichiers. L'intégration régénère aussi une référence du cadre dès que le lot touche ce
303
304
  qu'elle lit : l'index des interfaces se refait quand un `INTERFACE.md` change. Un conflit sur tout autre fichier
304
305
  refuse le lot ; une commande en échec, sa commande et sa sortie nommées, ou un fichier changé
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@roomi-fields/grillhouse",
3
- "version": "0.43.0",
3
+ "version": "0.43.1",
4
4
  "description": "Roomi's Grillhouse: the frame's scripts, called by one command, grillhouse <sous-commande>",
5
5
  "keywords": [
6
6
  "claude-code",
@@ -22,6 +22,10 @@
22
22
  // (scripts/integration/file.mjs) and the move of a copy onto main
23
23
  // (scripts/enveloppe/travail-de-la-copie.mjs) call it on the tree where they applied the lot,
24
24
  // main's version of each file taken.
25
+ // - `encoreDeclares` keeps the generated files the tree where the lot is applied still declares, by
26
+ // their names: as a genrule of Bazel removed with its output in one change plays no more, the
27
+ // one a lot removes from the key is not played, and its files follow the lot, their deletion
28
+ // too. The command line stays main's: a lot removes one, it writes none.
25
29
  import { existsSync, readFileSync } from 'node:fs';
26
30
  import path from 'node:path';
27
31
  import { arbrePrincipal } from './outils-cles.mjs';
@@ -124,6 +128,134 @@ export function engendresDe(dir) {
124
128
  return engendres;
125
129
  }
126
130
 
131
+ // The names the text <texte> of a package.json declares under `grillhouse.engendres`, or null when
132
+ // it does not read.
133
+ function nomsDeclares(texte) {
134
+ try {
135
+ const declares = JSON.parse(texte)?.grillhouse?.engendres;
136
+ return new Set(
137
+ declares && typeof declares === 'object' && !Array.isArray(declares)
138
+ ? Object.keys(declares)
139
+ : []
140
+ );
141
+ } catch {
142
+ return null;
143
+ }
144
+ }
145
+
146
+ /**
147
+ * The generated files of <engendres> that the package.json of the tree <arbre>, where a lot is
148
+ * applied, still declares under their names. When it does not read (absent, or in conflict), the
149
+ * two versions of the conflict decide (<etages>, `{ base, lot }`, the text of the package.json
150
+ * before the lot and with it): the lot removes the ones its base declares and it does not. All of
151
+ * them when nothing reads.
152
+ * @template {{ nom: string }} E
153
+ * @param {E[]} engendres
154
+ * @param {string} arbre
155
+ * @param {(() => { base: string, lot: string }) | null} [etages]
156
+ * @returns {E[]}
157
+ */
158
+ export function encoreDeclares(engendres, arbre, etages = null) {
159
+ let texte = null;
160
+ try {
161
+ texte = readFileSync(path.join(arbre, 'package.json'), 'utf8');
162
+ } catch {
163
+ return engendres;
164
+ }
165
+ const noms = nomsDeclares(texte);
166
+ if (noms) {
167
+ return engendres.filter(e => noms.has(e.nom));
168
+ }
169
+ const { base, lot } = etages?.() ?? { base: '', lot: '' };
170
+ const avant = nomsDeclares(base);
171
+ const avec = nomsDeclares(lot);
172
+ return avant && avec ? engendres.filter(e => !avant.has(e.nom) || avec.has(e.nom)) : engendres;
173
+ }
174
+
175
+ /**
176
+ * What the lots applied in the tree <arbre> ask of the references <references> (`{ nom, entiers }`,
177
+ * those of the project, <duProjet>, among them): `suivis`, the files of <entiers> (the files of
178
+ * the lots a reference writes in full, left out of their application) that follow the lots, the
179
+ * ones no reference still declared writes; `rejouees`, the references of <touchees> (those the
180
+ * lots touch) still declared, whose commands play. A reference of the frame is always declared.
181
+ * @template {{ nom: string, entiers: string[] }} R
182
+ * @param {{ references: R[], duProjet: R[], entiers: string[], touchees: R[], arbre: string }} o
183
+ * @returns {{ suivis: string[], rejouees: R[] }}
184
+ */
185
+ export function partDesLots({ references, duProjet, entiers, touchees, arbre }) {
186
+ const declares = encoreDeclares(duProjet, arbre);
187
+ const retire = r => duProjet.includes(r) && !declares.includes(r);
188
+ return {
189
+ suivis: entiers.filter(f => !references.some(r => !retire(r) && couvertPar(r.entiers, f))),
190
+ rejouees: touchees.filter(r => !retire(r)),
191
+ };
192
+ }
193
+
194
+ /**
195
+ * The generated files of <engendres> still declared in the tree <arbre> that the lot of
196
+ * <fichiers> touches: those whose commands play once the lot is applied there.
197
+ * @template {{ nom: string, entiers: string[], lit: string[] }} E
198
+ * @param {E[]} engendres
199
+ * @param {string} arbre
200
+ * @param {string[]} fichiers
201
+ * @returns {E[]}
202
+ */
203
+ export const aRejouer = (engendres, arbre, fichiers) =>
204
+ touchesPar(encoreDeclares(engendres, arbre), fichiers);
205
+
206
+ /**
207
+ * Applies to the tree of <dansCopie> (git in the tree) the files <fichiers> of the lots <lots>
208
+ * (patch files) that an earlier application left out, those of a generated file the lots remove
209
+ * from the key: a deletion is done whatever main's version is, any other change is applied three
210
+ * ways, to the index too. Null, or the refusal.
211
+ * @param {{ lots: string[], fichiers: string[], dansCopie: (...args: string[]) => import('node:child_process').SpawnSyncReturns<string> }} o
212
+ * @returns {string | null}
213
+ */
214
+ export function poserLesRetires({ lots, fichiers, dansCopie }) {
215
+ if (!fichiers.length) {
216
+ return null;
217
+ }
218
+ const seuls = fichiers.map(f => `--include=${f}`);
219
+ for (const p of lots) {
220
+ const supprimes = dansCopie('apply', '--summary', ...seuls, p)
221
+ .stdout.split('\n')
222
+ .map(l => /^ delete mode \d+ (.+)$/.exec(l)?.[1])
223
+ .filter(f => f !== undefined && fichiers.includes(f));
224
+ if (
225
+ supprimes.length &&
226
+ dansCopie('rm', '-q', '-f', '--ignore-unmatch', '--', ...supprimes).status !== 0
227
+ ) {
228
+ return `Les fichiers que le lot ${p} supprime ne se retirent pas :\n${supprimes.map(f => ` ${f}`).join('\n')}`;
229
+ }
230
+ const restent = fichiers.filter(f => !supprimes.includes(f)).map(f => `--include=${f}`);
231
+ if (restent.length) {
232
+ const r = dansCopie('apply', '--3way', '--index', '--allow-empty', ...restent, p);
233
+ if (r.status !== 0) {
234
+ return `Le lot ${p} ne s'applique pas :\n${r.stdout}${r.stderr}`;
235
+ }
236
+ }
237
+ }
238
+ return null;
239
+ }
240
+
241
+ /**
242
+ * Resolves the conflicts <conflits> of a rebase stopped in the tree of <dansCopie>, each on a file
243
+ * a generated file writes in full: main's version (`--ours`, the base of the rebase) for one of
244
+ * <vivants>, the generated files the tree still declares; the branch's version, its deletion too,
245
+ * for the others. Whether every conflict is resolved.
246
+ * @param {{ conflits: string[], vivants: { entiers: string[] }[], dansCopie: (...args: string[]) => import('node:child_process').SpawnSyncReturns<string> }} o
247
+ */
248
+ export function prendreLesEngendres({ conflits, vivants, dansCopie }) {
249
+ const prendre = (cote, f) =>
250
+ dansCopie('checkout', cote, '--', f).status === 0 && dansCopie('add', '--', f).status === 0;
251
+ return conflits.every(f =>
252
+ vivants.some(e => couvertPar(e.entiers, f))
253
+ ? prendre('--ours', f)
254
+ : prendre('--theirs', f) ||
255
+ dansCopie('rm', '-q', '-f', '--ignore-unmatch', '--', f).status === 0
256
+ );
257
+ }
258
+
127
259
  /**
128
260
  * The generated files of <engendres> the lot of <fichiers> touches: one of the files it writes in
129
261
  * full, or one it reads.
@@ -70,7 +70,7 @@ import { spawnSync } from 'node:child_process';
70
70
  import { existsSync, readFileSync, rmSync, statSync, writeFileSync, writeSync } from 'node:fs';
71
71
  import path from 'node:path';
72
72
  import { pathToFileURL } from 'node:url';
73
- import { couvertPar, engendresDe, regenerer, touchesPar } from '../engendres.mjs';
73
+ import { couvertPar, encoreDeclares, engendresDe, regenerer, touchesPar } from '../engendres.mjs';
74
74
  import { avecLesDonnees, donneesDe } from '../donnees-cles.mjs';
75
75
  import { avecLesOutils, outilsDe } from '../outils-cles.mjs';
76
76
 
@@ -121,7 +121,9 @@ function lesCles(copie) {
121
121
  * deletion of a file main changed), whose patches are `restant`. With <cles> (`lesCles`), the
122
122
  * generated files the lot (or one of <autres>, the copy's untracked files) touches are left out,
123
123
  * then written again by their command once the lot applies without conflict; `refus`, a command
124
- * that fails.
124
+ * that fails. A generated file the lot removes from the key (`encoreDeclares`) follows the lot
125
+ * instead: its deletion is done, any other change applied as a file of the lot, its command not
126
+ * played.
125
127
  * @param {string} copie
126
128
  * @param {Buffer} lot
127
129
  * @param {{ engendres: any[], env: NodeJS.ProcessEnv } | null} [cles]
@@ -136,14 +138,11 @@ function appliquer(copie, lot, cles = null, autres = []) {
136
138
  const conflits = [];
137
139
  const enAttente = [];
138
140
  const gardes = [];
139
- for (const morceau of morceauxDuLot(lot)) {
140
- const noms = fichiersDuLot(copie, morceau);
141
- if (noms.length && noms.every(f => exclus.includes(f))) {
142
- continue;
143
- }
141
+ const laisses = [];
142
+ const poser = (morceau, noms) => {
144
143
  const r = git(copie, ['apply', '--3way', '--allow-empty', '-'], morceau);
145
144
  if (r.status === 0) {
146
- continue;
145
+ return;
147
146
  }
148
147
  const marques = enConflit(copie).filter(f => noms.includes(f));
149
148
  if (marques.length) {
@@ -152,13 +151,38 @@ function appliquer(copie, lot, cles = null, autres = []) {
152
151
  enAttente.push(...noms.slice(-1));
153
152
  gardes.push(morceau);
154
153
  }
154
+ };
155
+ for (const morceau of morceauxDuLot(lot)) {
156
+ const noms = fichiersDuLot(copie, morceau);
157
+ if (noms.length && noms.every(f => exclus.includes(f))) {
158
+ laisses.push({ morceau, noms });
159
+ continue;
160
+ }
161
+ poser(morceau, noms);
162
+ }
163
+ // The generated files the lot removes from the key follow the lot: main's version is not kept.
164
+ // A package.json left in conflict is read at the two versions of its conflict in the index.
165
+ const etage = n => String(git(copie, ['show', `:${n}:package.json`]).stdout);
166
+ const vivants = encoreDeclares(touches, copie, () => ({ base: etage(1), lot: etage(3) }));
167
+ for (const { morceau, noms } of laisses) {
168
+ if (noms.every(f => vivants.some(e => couvertPar(e.entiers, f)))) {
169
+ continue;
170
+ }
171
+ if (/^deleted file mode /m.test(morceau.toString('latin1'))) {
172
+ if (git(copie, ['rm', '-q', '-f', '--ignore-unmatch', '--', ...noms]).status !== 0) {
173
+ enAttente.push(...noms.slice(-1));
174
+ gardes.push(morceau);
175
+ }
176
+ } else {
177
+ poser(morceau, noms);
178
+ }
155
179
  }
156
180
  const restant = Buffer.concat(gardes);
157
- if (conflits.length || enAttente.length || !touches.length || !cles) {
181
+ if (conflits.length || enAttente.length || !vivants.length || !cles) {
158
182
  return { conflits, enAttente, restant };
159
183
  }
160
184
  const refus = regenerer({
161
- refs: touches.map(e => ({ ...e, cadre: false })),
185
+ refs: vivants.map(e => ({ ...e, cadre: false })),
162
186
  lancer: commande =>
163
187
  spawnSync('bash', ['-c', commande], {
164
188
  cwd: copie,
@@ -74,7 +74,14 @@ import { spawnSync } from 'node:child_process';
74
74
  import { existsSync, mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from 'node:fs';
75
75
  import { createRequire } from 'node:module';
76
76
  import path from 'node:path';
77
- import { couvertPar, engendresDe, regenerer, touchesPar } from '../engendres.mjs';
77
+ import {
78
+ aRejouer,
79
+ couvertPar,
80
+ encoreDeclares,
81
+ engendresDe,
82
+ prendreLesEngendres,
83
+ regenerer,
84
+ } from '../engendres.mjs';
78
85
  import { avecLesDonnees, donneesDe } from '../donnees-cles.mjs';
79
86
  import { avecLesOutils, outilsDe } from '../outils-cles.mjs';
80
87
  import { lireCommit } from '../poussee-cles.mjs';
@@ -672,7 +679,9 @@ function remplacer(o, tip, tete) {
672
679
  return { garde: `la copie ne prend pas ${tip.slice(0, 7)}` };
673
680
  }
674
681
  // A conflict on generated files the project declares only is no conflict: main's version is
675
- // taken, and their command writes them again once the branch is replaced (below).
682
+ // taken, and their command writes them again once the branch is replaced (below). One the branch
683
+ // removes from the key (`encoreDeclares`, read in the copy) takes the branch's version, its
684
+ // deletion too, and its command is not played.
676
685
  let rebase = dansCopie('rebase', tete);
677
686
  let tours = Number(dansCopie('rev-list', '--count', `${tete}..${tip}`).stdout.trim()) || 1;
678
687
  while (rebase.status !== 0) {
@@ -683,8 +692,7 @@ function remplacer(o, tip, tete) {
683
692
  tours-- > 0 &&
684
693
  conflits.length > 0 &&
685
694
  conflits.every(f => engendres.some(e => couvertPar(e.entiers, f))) &&
686
- dansCopie('checkout', '--ours', '--', ...conflits).status === 0 &&
687
- dansCopie('add', '--', ...conflits).status === 0;
695
+ prendreLesEngendres({ conflits, vivants: encoreDeclares(engendres, copie), dansCopie });
688
696
  if (!engendresSeuls) {
689
697
  dansCopie('rebase', '--abort');
690
698
  return {
@@ -702,8 +710,9 @@ function remplacer(o, tip, tete) {
702
710
  if (installation) {
703
711
  return { sortie: [installation, "Le verrou de la branche replacée ne s'installe pas."] };
704
712
  }
705
- const touches = touchesPar(
713
+ const touches = aRejouer(
706
714
  engendres,
715
+ copie,
707
716
  dansCopie('diff', '--name-only', '--no-renames', '-z', tete, 'HEAD')
708
717
  .stdout.split('\0')
709
718
  .filter(Boolean)
@@ -64,7 +64,9 @@
64
64
  // of synthhub and open-synth-descriptors). A command of the project at another code than 0, one of
65
65
  // the frame on a real failure (126, 127, a signal), or a file it changes that its `fichiers` do not
66
66
  // cover, refuses the lot, the command, its code and its output named. A conflict on any other file
67
- // refuses it, as the three-way application says.
67
+ // refuses it, as the three-way application says. A generated file of the project the lot removes
68
+ // from the key (`encoreDeclares` of scripts/engendres.mjs, read in the copy once the lots are
69
+ // applied) follows the lot: its deletion is done, any other change applied, its command not played.
68
70
  //
69
71
  // What steps 2, 3 and 5 read of a lot is its files: each file added, modified or deleted, a
70
72
  // rename counting its source and its destination (named as the file is, not as git quotes it in
@@ -84,7 +86,14 @@ import { existsSync, readFileSync } from 'node:fs';
84
86
  import path from 'node:path';
85
87
  import { pathToFileURL } from 'node:url';
86
88
  import { arbitrageTranche, estArbitrage } from '../arbitrages.mjs';
87
- import { couvertPar, engendresDe, regenerer, touchesPar } from '../engendres.mjs';
89
+ import {
90
+ couvertPar,
91
+ engendresDe,
92
+ partDesLots,
93
+ poserLesRetires,
94
+ regenerer,
95
+ touchesPar,
96
+ } from '../engendres.mjs';
88
97
  import { langageDe } from '../langages.mjs';
89
98
  import { prefixe } from '../prefixe-des-tickets.mjs';
90
99
  import { commitsDelivering, gitLog } from '../un-commit-par-ticket.mjs';
@@ -427,10 +436,8 @@ function main(argv) {
427
436
  return refuser(`Les références ${o.references} ne se lisent pas : ${e.message}`);
428
437
  }
429
438
  }
430
- const references = [
431
- ...engendres.map(e => ({ ...e, cadre: false })),
432
- ...duCircuit.map(r => ({ ...r, lit: r.lit ?? [] })),
433
- ];
439
+ const duProjet = engendres.map(e => ({ ...e, cadre: false }));
440
+ const references = [...duProjet, ...duCircuit.map(r => ({ ...r, lit: r.lit ?? [] }))];
434
441
  // The files of the lot a reference writes in full, and the references the lot touches.
435
442
  const entiers = fichiers.filter(f => references.some(r => couvertPar(r.entiers, f)));
436
443
  const aRegenerer = touchesPar(references, fichiers);
@@ -482,6 +489,18 @@ function main(argv) {
482
489
  return refuser(`Le lot ${p} ne s'applique pas :\n${r.stdout}${r.stderr}`);
483
490
  }
484
491
  }
492
+ // The generated files the lots remove from the key follow the lots: main's version is not kept.
493
+ const part = partDesLots({
494
+ references,
495
+ duProjet,
496
+ entiers,
497
+ touchees: aRegenerer,
498
+ arbre: copie,
499
+ });
500
+ const suivis = poserLesRetires({ lots, fichiers: part.suivis, dansCopie });
501
+ if (suivis) {
502
+ return refuser(suivis);
503
+ }
485
504
  const divergents = avecCopie ? differents(copieTicket, lots, fichiers, tmp) : [];
486
505
  if (divergents.length) {
487
506
  return refuser(
@@ -493,10 +512,11 @@ function main(argv) {
493
512
  if (installation) {
494
513
  return refuser(installation);
495
514
  }
496
- if (aRegenerer.length) {
515
+ const aRejouer = part.rejouees;
516
+ if (aRejouer.length) {
497
517
  const env = avecLesDonnees(donnees, avecLesOutils(outils, process.env));
498
518
  const refus = regenerer({
499
- refs: aRegenerer,
519
+ refs: aRejouer,
500
520
  dansCopie,
501
521
  lancer: commande =>
502
522
  spawnSync('bash', monter('sh', '-c', commande), {
@@ -509,7 +529,7 @@ function main(argv) {
509
529
  if (refus) {
510
530
  return refuser(refus);
511
531
  }
512
- dire(`✓ références régénérées sur main à jour : ${aRegenerer.map(r => r.nom).join(', ')}`);
532
+ dire(`✓ références régénérées sur main à jour : ${aRejouer.map(r => r.nom).join(', ')}`);
513
533
  }
514
534
 
515
535
  // 6. The commit, in the copy: the commit committed is the commit the CI of the branch judges.