@roomi-fields/grillhouse 0.40.0 → 0.42.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.
@@ -5,5 +5,5 @@
5
5
  "author": {
6
6
  "name": "Romain Peyrichou"
7
7
  },
8
- "version": "0.40.0"
8
+ "version": "0.42.0"
9
9
  }
package/CHANGELOG.md CHANGED
@@ -6,6 +6,40 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.42.0] - 2026-11-16
10
+
11
+ - **The guard refuses a style script of the root that launches the packages again** (grillhouse-6dt): the root keeps its own files (grillhouse-44b.9), and the guard `turbo-des-paquets` refused a root `lint` or `format:check` that names a file a package holds, but read paths alone; a script that delegates to the packages (`npm run lint --workspaces --if-present`, `-w <paquet>`, `turbo run lint`) names none and passed, so the root task `//#lint` played the style of every package a second time, the packages out of the frame included — BPScript's update went red on « ⛔ //#lint (code 1) », no guard naming the script. The guard now refuses such a script by its name, with the gesture. **Action for projects**: a project whose root `lint` or `format:check` launches its packages removes it, or reduces it to the files of the root; Turborepo plays the script of each package.
12
+
13
+ - **The CI of the frame fetches the submodules of the project, private ones included** (grillhouse-c42): the workflows of the template (`ci.yml`, `nuit.yml`) checked the repository out without its submodules, though the frame reads them on the poste (`grillhouse.partage`); a project whose guards and tests read one went red on GitHub — BPScript, « le sous-module du moteur n'est pas là (vendor/bp3-engine) » — and could not edit a generated workflow. Each checkout now takes the submodules, recursively (`submodules: recursive`), with the repository's secret `SOUS_MODULES` as its token when it exists, the workflow's own token otherwise. **Action for projects**: `npx grillhouse maj`, which rewrites the frame's workflows; a project with a private submodule creates the secret `SOUS_MODULES` of its repository (a token that reads the submodule's repository), and a workflow of its own that calls the frame's passes it (`secrets: inherit`).
14
+
15
+ - **A red workflow of main already given does not come back after a reading of bd that fails** (grillhouse-d4n.21): the wait of the supervisor gives a ticket reopened for a red workflow of main once, and keeps the reds given that still stand; but a reading of bd that failed (its 5 s delay on a loaded machine) was read as « no red », the memory was written empty, and the next reading gave the same red as new — SyntHub SH-br0.6.3 came back every 5 min, `--rappel` governing only the questions of the circuits. A failed reading now gives null (`fluxRougesDe`), which the wait leaves aside: the reds given stay as they are, and the next reading judges them. **Action for projects**: none.
16
+
17
+ - **The context of `--depuis <role>` tells the other agent whom it was given to** (grillhouse-d4n.16): the text of `--contexte` heads the instruction of each agent of the run as « TA TÂCHE » ; given with `--depuis testwriter` (« écris les tests… »), the developpeur launched after the proof read it as his own, refused it — his role writes no test — and sent the lot back to the testwriter, twice: the stop « sans-livraison » (SyntHub SH-ae6.6.1). The run now keeps the role the context was given to (`destinataire`, in the memory of its acts); that agent still reads « TA TÂCHE », the other one reads « LA TÂCHE DU SUPERVISEUR, donnée au <rôle> … » and that his share is his own role's. **Action for projects**: none.
18
+
19
+ - **A plan the explorateur writes again keeps the packages the supervisor gave it** (grillhouse-d4n.17): `--etendre` wrote the gained package in the title alone; when the plan was written again (a description the responsable changed), the explorateur's packages replaced the title, the supervisor's extension gone, and the developpeur met the same file out of the plan — a second `--etendre .` on SyntHub SH-ae6.6.1. The extension is now kept among the sheets with the plan it extended (`etendus`), and a plan written again takes back each package it leaves out, in its order, said at the ticket (`avecLesEtendus`); `--recommencer`, which removes the sheets, starts the plan over without them. **Action for projects**: none.
20
+
21
+ - **`--etendre` answers a stopped circuit whose copy no longer loads** (grillhouse-mk7): the command read the order of the extended plan in the ticket's copy alone, and failed with the error of its tool when that tree did not load — `cargo metadata` (code 101) on a workspace whose member names a dependency its root does not declare, the very state `--etendre .` came to repair (OSC Bridge OB-20q.1). The order is now read in the copy, else in the main tree, else each gained package goes at the plan's end (`planEtendu`), and the line of the plan at the ticket says which when the copy did not load; the names the title writes are read the same way (`nomsDe`), a package keeping its path when no tree loads. **Action for projects**: none.
22
+
23
+ - **A session of the envelope finds uv, and plays `npm test` on a package of Python** (grillhouse-d4n.19): the home of an agent's envelope shows only what is declared, and the module `python` declared the Pythons uv installs (`~/.local/share/uv/python/`) but not uv itself, which its installer lays in `~/.local/bin/uv`. A testwriter or a developpeur whose plan holds a package of Python could not play its tests (« uv absent du PATH »), delivered without running them, and the checks, played out of the envelope, found the reds — the stop « sans-livraison » (SyntHub SH-br0.6.3). The module now declares `~/.local/bin/uv` among what its tools read, mounted read-only as cargo's home is. **Action for projects**: none.
24
+
25
+ - **A refused sheet names every fault of it in one refusal** (grillhouse-d4n.18): a session is taken up once on a refused sheet, but its faults were judged in layers, each hiding the next — what the sheet lacks, its pieces not found, those out of the ticket, then the session's own validation (the conformity of a review). A reviewer on a lot without a defect was refused for « RENDU sans constat bloquant », then for « conformite : sans ligne pour crates/service/Cargo.toml#service », a fault its first refusal did not name: the stop « sans-fiche » (SyntHub SH-ae6.6.1). A sheet that holds its schema is now judged whole: `lireFiche` names what it lacks, its pieces not found and those out of the ticket together, and gives the sheet read back beside them (`lue`), which `jusquALaFiche` gives to the session's validation, its faults joined to the same refusal. **Action for projects**: none.
26
+
27
+ - **The integration commits the lot the copy holds, even under a stale label `en-file`** (grillhouse-d4n.20): the integration read the label `en-file` alone as « the lot is already committed », and skipped its commit; a circuit whose branch waited in the queue and that went back to its plan, its tests or its code wrote a new lot in a new copy, which the integration then left uncommitted while it announced the tip of the branch — SyntHub SH-ae6.6.1 announced main's own commit, « la branche n'a rien en avance sur main », 13 files of the copy uncommitted. The label now skips the commit only when the copy holds no file of the lot (the integrator removes the copy of a lot it commits); a copy that holds one is committed, the branch set on it. **Action for projects**: none.
28
+
29
+ - **A circuit stopped on the supervisor's word leaves the queue of the tickets** (grillhouse-d4n.14, grillhouse-d4n.15): since the queue counts only the circuits alive (grillhouse-d0t, 0.39.0), a ticket stopped by `--arreter` stayed open and labelled `circuit`, its workflow ended, so the queue started it again at its next turn — SyntHub SH-ae6.6.1 stopped at 11:15 after its review, started again alone at 11:16, committed its lot and sent it to the CI. The act of the stop now takes the label `circuit` off the ticket (`sortirDeLaFile`), as the architecture already said, and the run that opens on the supervisor's answer (`--reprendre`, `--depuis`, `--etendre`) puts it back (`rentrerDansLaFile`); the effect `etiquettes` carries the labels taken off (`retirees`). **Action for projects**: none.
30
+
31
+ ## [0.41.0] - 2026-11-16
32
+
33
+ - **The « nuit rouge » alert of the board follows the verdict of the project's last night, not the presence of a `nuit` ticket** (grillhouse-o7g): the alert was built by looping over the open tickets labelled `nuit`, so it stayed after the night turned green (OSC Bridge: 6 h after a green night). The night pass (`scripts/nuit.sh`) now writes, at its end, a durable verdict per project in `<git common dir>/nuit/verdict` (`scripts/verdict-de-la-nuit.mjs`): green on exit 0, red on any other code but 75, and 75 (« à repasser ») writes nothing and leaves the previous verdict. The board reads it without a server: the alert stands while it is red (naming each open `nuit` ticket, or « Nuit rouge » alone when none is open), falls on green, and is not posed when no night is known or the file does not read; on a board of several projects each alert follows its own project's verdict. The `nuit` ticket keeps its cycle: the green does not close or change it. **Action for projects**: none; the alert appears after the next night's verdict.
34
+
35
+ - **The update writes `issue-prefix` when no active key exists** (grillhouse-4cx): `bd init` leaves the key commented out, and the reader of the prefix refuses a commit without it; the entry grillhouse-44b.10.8.8 said `npx grillhouse maj` wrote it, which was false for a project past 0.30.0. `mettreAJour` now writes `issue-prefix: "<value>"` by `ecrireLePrefixe` when `.beads/config.yaml` has no active key (absent, commented or empty), the value being the store's (`prefixeDuStore`, `bd config get issue_prefix`, shared with the preparation of a new project); an active key is left as it is. Without a value from the store it writes nothing and guesses nothing: the report says so on the error stream with the line to write, and the exit code is 1. **Action for projects**: `npx grillhouse maj`; if it asks for the line, write `issue-prefix: "<your prefix>"` in `.beads/config.yaml`.
36
+
37
+ - **The red-proof credits the reds of the modules of a single Rust integration binary** (commit 93b62f27): a crate with one integration binary (`tests/it/main.rs` aggregating its modules by `mod …;`) names only the aggregator in the lot (the modules have `joue=false`), but the verdict keys results per module and skips `main.rs`. When the ticket's wanted reds made the binary exit non-zero, the proof looked for a result named `main.rs` — absent — and classed it `non-joue` (« does not load »), so the reds never counted. `casseDeChargement` gains `aDesResultats`: a run that exits non-zero but whose modules produced results has played, it is no load failure, and each module's reds are credited to the lot. **Action for projects**: none; a Rust ticket on a single-binary crate now proves its red (OSC Bridge OB-62b.1 lineage).
38
+
39
+ - **`/grillhouse newday` resets the day marker of every project on the board** (commit 324cb9a6): the board shows the session's project and those added (`ajouter`), but `/grillhouse newday` posed the marker of the current project alone, the others keeping their « FAITS AUJOURD'HUI ». The handler now poses the marker of each shown project, each in its own copy, and reports how many were posed. **Action for projects**: none.
40
+
41
+ - **The overview of several projects shows the day's and cumulative time and tokens, summed over the projects** (commit dbeeede1): a single project's board carries the line `jour <time> · <tokens> · cumul <time> · <tokens>`, but the overview of several projects omitted it, summing only the discoveries. `ensemble()` now also sums each project's `global.jour` and `global.cumul` (time and tokens), and the overview shows the line, as a multi-root board adds its roots' figures. **Action for projects**: none.
42
+
9
43
  ## [0.40.0] - 2026-11-15
10
44
 
11
45
  - **The Temporal versioning markers of the drained paths are removed, their legacy paths with them** (grillhouse-54f.3): the versioning of the Temporal workflows (`patched` → `deprecatePatch` → removal) had accumulated thirteen `patched` markers with no `deprecatePatch` across the file, circuit, places and tickets queues, their transition paths made permanent (audit grillhouse-54f, foyer #2). Each marker is converged to its current path and removed, with the legacy branch it guarded and the acts only it kept (`ciDuCommitDUnPassage`, `lireLaCI`, `lireEtConclureLaCI`, `entreeDAvant`, `laFileDAvant`, `circuitsNonIntegres`); the recorded replay histories, no longer deterministic against the converged code, are removed and re-recorded by the next night. **Action for projects**: none of its own; the supervisor terminates the running queue, places and night workflows and restarts the workers on this version at a calm window (no circuit or integration in flight).
@@ -48,7 +82,7 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and
48
82
 
49
83
  - **The cache of Vite lives under `.cache-outils/vite`, mounted in writing in a copy** (grillhouse-44b.5.7.1): the module typescript declared `node_modules/.vite` a clean output, but a copy's `node_modules` is a link to the main tree, so the envelope left that output out and the cache of Vitest stayed read-only. The base configurations of the day and of the night now set `cacheDir` to `.cache-outils/vite`, a clean output that exists already; the clean outputs of the module are `.turbo` and `.cache-outils`, and `node_modules/.vite` is no longer one. **Action for projects**: none, they extend the base.
50
84
 
51
- - **Every reader of the tickets' prefix takes it from `.beads/config.yaml`, not from bd** (grillhouse-44b.10.8.8): `bd config get issue_prefix` fails in CI, where bd is absent. The hook un-commit-par-ticket, the board, the integration (direct call and the circuit's resumption), `ticket.sh` and `nuit.sh` now read the `issue-prefix` key through `prefixe` (scripts/prefixe-des-tickets.mjs, which `nuit.sh` calls by node). A missing file or key is refused by its name instead of giving an empty prefix: the hook and the integration refuse with the message of `prefixe`, `ticket.sh` stops before creating a ticket, `nuit.sh` writes the message in the night's journal, and the board's alert reads « Préfixe des tickets illisible : <message> ». The preparation of a project keeps reading the store's prefix by bd to write the key. **Action for projects**: none, as long as `.beads/config.yaml` holds `issue-prefix` (`npx grillhouse maj` writes it when it is missing).
85
+ - **Every reader of the tickets' prefix takes it from `.beads/config.yaml`, not from bd** (grillhouse-44b.10.8.8): `bd config get issue_prefix` fails in CI, where bd is absent. The hook un-commit-par-ticket, the board, the integration (direct call and the circuit's resumption), `ticket.sh` and `nuit.sh` now read the `issue-prefix` key through `prefixe` (scripts/prefixe-des-tickets.mjs, which `nuit.sh` calls by node). A missing file or key is refused by its name instead of giving an empty prefix: the hook and the integration refuse with the message of `prefixe`, `ticket.sh` stops before creating a ticket, `nuit.sh` writes the message in the night's journal, and the board's alert reads « Préfixe des tickets illisible : <message> ». The preparation of a project keeps reading the store's prefix by bd to write the key. **Action for projects**: none, as long as `.beads/config.yaml` holds `issue-prefix` (`npx grillhouse maj` wrote it only through the migration 0.30.0, so a project already past 0.30.0 kept its commented key until grillhouse-4cx).
52
86
 
53
87
  - **The status line and the pane show one measure, refreshed on events** (grillhouse-nglm): the status line read a file each measure of the board wrote, the pane measured on its own clocks (30 s, 5 s while a line of progress showed), so the two showed different states. `npx grillhouse tableau --suivre` (scripts/suiveur.mjs) is now the one producer, as watchman or `tsc --watch` keep one watch for many readers: one measure writes the status text with its time (`grillhouse-etat.txt`) and the pane's line (`grillhouse-tableau.ligne`). It measures on a change under `.beads/`, on a change of HEAD or the references, on the day's marker, on a change of the set of circuits (a light poll of Temporal), folded within 300 ms; without an event every 5 minutes, and every 10 s while a line of progress shows. One follower writes per repository (a lock of the common git directory, taken over from a dead process); another relays its lines. The status line shows nothing when the measure is older than 10 minutes, and `tableau` no longer writes the file. The pane starts the follower, reads its lines and restarts it after a growing wait; its 30 s period and its 5 s clock of progress are gone. **Action for projects**: none.
54
88
 
@@ -96,6 +96,10 @@ jobs:
96
96
  uses: actions/checkout@v5
97
97
  with:
98
98
  fetch-depth: 0
99
+ # The submodules of the project, a private one read by the repository's secret SOUS_MODULES
100
+ # (a token that reads it); without the secret, the workflow's own token.
101
+ submodules: recursive
102
+ token: ${{ secrets.SOUS_MODULES || github.token }}
99
103
 
100
104
  - name: Setup Node.js ${{ matrix.node-version }}
101
105
  uses: actions/setup-node@v5
@@ -139,6 +143,10 @@ jobs:
139
143
  uses: actions/checkout@v5
140
144
  with:
141
145
  fetch-depth: 0
146
+ # The submodules of the project, a private one read by the repository's secret SOUS_MODULES
147
+ # (a token that reads it); without the secret, the workflow's own token.
148
+ submodules: recursive
149
+ token: ${{ secrets.SOUS_MODULES || github.token }}
142
150
 
143
151
  - name: Setup Node.js ${{ matrix.node-version }}
144
152
  uses: actions/setup-node@v5
@@ -194,6 +202,11 @@ jobs:
194
202
  steps:
195
203
  - name: Checkout
196
204
  uses: actions/checkout@v5
205
+ with:
206
+ # The submodules of the project, a private one read by the repository's secret SOUS_MODULES
207
+ # (a token that reads it); without the secret, the workflow's own token.
208
+ submodules: recursive
209
+ token: ${{ secrets.SOUS_MODULES || github.token }}
197
210
 
198
211
  - name: Setup Node.js ${{ matrix.node-version }}
199
212
  uses: actions/setup-node@v5
@@ -39,6 +39,10 @@ jobs:
39
39
  uses: actions/checkout@v5
40
40
  with:
41
41
  fetch-depth: 0
42
+ # The submodules of the project, a private one read by the repository's secret SOUS_MODULES
43
+ # (a token that reads it); without the secret, the workflow's own token.
44
+ submodules: recursive
45
+ token: ${{ secrets.SOUS_MODULES || github.token }}
42
46
 
43
47
  - name: Setup Node.js ${{ matrix.node-version }}
44
48
  uses: actions/setup-node@v5
@@ -93,6 +97,11 @@ jobs:
93
97
  steps:
94
98
  - name: Checkout
95
99
  uses: actions/checkout@v5
100
+ with:
101
+ # The submodules of the project, a private one read by the repository's secret SOUS_MODULES
102
+ # (a token that reads it); without the secret, the workflow's own token.
103
+ submodules: recursive
104
+ token: ${{ secrets.SOUS_MODULES || github.token }}
96
105
 
97
106
  - name: Setup Node.js ${{ matrix.node-version }}
98
107
  uses: actions/setup-node@v5
@@ -779,7 +779,7 @@ chaque lot traité, sans tube ni veille à durée (grillhouse-d4n.9 : une attent
779
779
  derrière `| tail` n'a été lue par personne pendant 40 min). Une question toujours sans réponse
780
780
  (le circuit est arrêté sur la même clé) est re-présentée toutes les 5 min
781
781
  (`--rappel <minutes>`), comme SQS redonne un message non acquitté après son délai de visibilité,
782
- jusqu'à ce que le circuit quitte l'arrêt ; un ticket que la file a rouvert pour un flux de main rouge (étiquette `flux-rouge`, ouvert) se rend aussi comme un lot, une fois, avec l'adresse du passage, et plus une fois repris ou refermé ; une clé qui change est une question neuve, rendue
782
+ jusqu'à ce que le circuit quitte l'arrêt ; un ticket que la file a rouvert pour un flux de main rouge (étiquette `flux-rouge`, ouvert) se rend aussi comme un lot, une fois, avec l'adresse du passage, et plus une fois repris ou refermé (une lecture de bd en échec ne dit rien des rouges, et laisse tels quels ceux déjà rendus) ; une clé qui change est une question neuve, rendue
783
783
  aussitôt. `.claude/worktrees/questions-remontees.json` garde, par arrêt, `depuis` (sa première
784
784
  remontée) et `presentee` (sa dernière présentation), en ms ; un fichier à l'ancien format (liste de
785
785
  clés) se lit, ses arrêts prenant l'heure de la lecture. Le tableau les lit : une alerte par
@@ -919,8 +919,9 @@ renomme, son contenu gardé à moitié au moins (`renommesDuLot`), reprend la de
919
919
  (`ecrireLePrefixe` de `packages/grillhouse/scripts/prefixe-des-tickets.mjs`, qui la lit aussi),
920
920
  que la préparation d'un projet neuf (`npx grillhouse init`) appelle après `bd init`, avec le
921
921
  préfixe donné. La mise à jour qui apporte la garde (`npx grillhouse maj`) écrit la clé depuis
922
- `bd config get issue_prefix` (migration 0.30.0 `préfixe des tickets`, un projet sans `.beads/`
923
- n'écrivant rien), puis inscrit dans sa dette les titres d'un projet qui nomment déjà un ticket
922
+ `bd config get issue_prefix` quand aucune clé active n'existe (`mettreAJour`, pour tout projet ; un
923
+ projet sans `.beads/config.yaml` n'écrit rien, et sans valeur du store elle n'écrit rien et dit la
924
+ ligne à poser), puis inscrit dans sa dette les titres d'un projet qui nomment déjà un ticket
924
925
  (migration 0.30.0 `titres nommant un ticket`), sans qu'un test se réécrive.
925
926
  Ainsi le compte des titres qui nomment un ticket ne fait que baisser.
926
927
 
@@ -1117,7 +1118,8 @@ aussi les branches `agent/**` que pousse la file), et `nuit.yml`, les tests de n
1117
1118
  poste, tels que Grillhouse les joue chez lui. Chaque job tourne sur la variable `RUNNER` du dépôt
1118
1119
  (`fromJSON(vars.RUNNER || '"ubuntu-latest"')`, une étiquette ou une liste d'étiquettes en JSON,
1119
1120
  la convention de SyntHub), qui vit dans les réglages du dépôt sur GitHub et qu'aucun fichier
1120
- n'écrit. Les tranches couvrent chaque langage, chaque test joué une fois dans leur union :
1121
+ n'écrit. Chaque récupération du dépôt prend ses sous-modules (`submodules: recursive`), un
1122
+ sous-module privé par le secret `SOUS_MODULES` du dépôt, sinon par le jeton du flux. Les tranches couvrent chaque langage, chaque test joué une fois dans leur union :
1121
1123
  Vitest par son découpage (`--shard`), cargo par celui de nextest (`--partition hash:i/n`, ses
1122
1124
  doctests dans la première tranche), Python, que pytest ne découpe pas, dans la première tranche
1123
1125
  seule ; la fusion ne relit que les rapports de Vitest, et un rouge de cargo ou de Python est le
@@ -1577,7 +1579,8 @@ enregistrer-la-base-de-reference.mjs`, avec la version épinglée d'alors) quand
1577
1579
  reste comptée par le disque libre réel. Repris, il redemande lui-même sa place
1578
1580
  (`reserverDesCircuits`, son rang d'arrivée gardé) et attend, à l'étape `attend-une-place`, avant
1579
1581
  de rouvrir. À 1, le suivant part quand le précédent finit ou se met en pause. Un déroulé ne se ferme qu'intégré (son ticket fermé dans Beads) ou arrêté sur le
1580
- mot du superviseur (`--arreter`, l'étiquette `circuit` retirée) : Beads, le registre durable,
1582
+ mot du superviseur (`--arreter`, l'étiquette `circuit` retirée par l'acte de l'arrêt, `sortirDeLaFile` de
1583
+ `scripts/circuit.mjs`, et remise par le run qui s'ouvre sur sa réponse, `rentrerDansLaFile`) : Beads, le registre durable,
1581
1584
  le garde de repartir. Un circuit vivant dont le ticket est fermé hors de son circuit (livré en
1582
1585
  direct), avant son intégration, ne compte plus : la file l'arrête (`ARRETER`) à son réveil
1583
1586
  suivant et écrit sa ligne « termine » au journal des états (`fermesHorsCircuit` de
package/docs/INTERFACE.md CHANGED
@@ -200,8 +200,8 @@ noyau, et chaque réponse décrit sans agir, sauf `verifier` d'un fichier engend
200
200
  écrits ; `~/.cargo/` (son `env`, que les shells sourcent, sa configuration, ses binaires) et
201
201
  `~/.rustup/` lus ; `python` : `.venv/` et `.pytest_cache/`, où ses commandes font écrire uv et pytest pour chaque
202
202
  paquet, et `~/.cache/grillhouse/uv/` écrits,
203
- `__pycache__` propre (le code-octet de Python, sous un seul arbre à la racine), les Python de uv,
204
- `~/.local/share/uv/python/`, lus.
203
+ `__pycache__` propre (le code-octet de Python, sous un seul arbre à la racine), uv lui-même, là où son
204
+ installeur le pose (`~/.local/bin/uv`), et les Python de uv, `~/.local/share/uv/python/`, lus.
205
205
  - `droits` : les règles de Claude Code qui refusent à un rôle qui écrit l'outil de test lancé
206
206
  directement ; `typescript`, Vitest et Turborepo ; `cargo`, `cargo test` et `cargo nextest` ;
207
207
  `python`, pytest, seul, par Python ou par `uv run`.
@@ -383,9 +383,10 @@ doublon), l'état du dépôt et la place de ses fichiers par branche (`etat-du-d
383
383
  que le dernier vert et le registre partagent), les arbitrages d'un ticket, le préfixe des tickets (`CONFIG_BEADS`, le fichier commité de Beads,
384
384
  `.beads/config.yaml` ; `prefixe(racine)`, la clé `issue-prefix` lue là, jamais par `bd`, et une
385
385
  erreur qui nomme le fichier ou la clé manquants ; `ecrireLePrefixe(racine, valeur)`, son seul
386
- écrivain, que la préparation d'un projet neuf et la migration de `grillhouse maj` appellent : la
387
- clé vide remplacée, la clé absente ajoutée, la ligne écrite rendue, `null` pour une clé qui a sa
388
- valeur), les fichiers sources d'un projet, les variables d'un fichier du poste (`avecLeFichierDuPoste(env, { fichier, ajouts })` : celles de
386
+ écrivain, que la préparation d'un projet neuf et la mise à jour de tout projet (`mettreAJour`) appellent :
387
+ la clé vide remplacée, la clé absente ajoutée, la ligne écrite rendue, `null` pour une clé qui a sa
388
+ valeur ; `prefixeDuStore(racine, bd)`, la valeur que le store de Beads donne, la chaîne vide sans
389
+ valeur, en échec ou pour un espace réservé), les fichiers sources d'un projet, les variables d'un fichier du poste (`avecLeFichierDuPoste(env, { fichier, ajouts })` : celles de
389
390
  `$XDG_CONFIG_HOME/grillhouse/<fichier>`, `~/.config/grillhouse/<fichier>` sans lui, puis
390
391
  `ajouts`, `env` tel quel quand il nomme déjà l'une d'elles ou sans le fichier), la recherche d'une commande dans le PATH (`trouverDansLePath(nom, env?)` : le chemin du premier exécutable de ce nom, ou `null`, comme `command -v`), les paquets d'un langage sans
391
392
  `package.json` à lui (`paquetsSansPackageJson(racine)` : les crates et les projets Python que le
@@ -511,11 +511,20 @@ export const register: Register = on => {
511
511
  const [geste = '', ...reste] = (e.args ?? '').trim().split(/\s+/)
512
512
  if (geste === 'ajouter' || geste === 'retirer') return { text: await changerLaListe($, geste, reste.join(' ')) }
513
513
  // newday sets the day's marker to now: FAITS AUJOURD'HUI and the « rejetés »/« validés » cases
514
- // of the board restart from zero (grillhouse-3uv.96).
514
+ // of the board restart from zero (grillhouse-3uv.96). The board shows this project and those
515
+ // added (`ajouter`), so newday moves the marker of every one, each in its own copy.
515
516
  if (geste === 'newday') {
516
- const r = await $.process.run([GRILLHOUSE, 'newday'], { cwd, timeoutMs: 20_000 })
517
- // The follower watches the marker's file and measures again.
518
- return { text: `${r.stdout || ''}${r.stderr || ''}`.trim() || 'Repère de journée posé.' }
517
+ const { projets } = await read($, etat)
518
+ const dossiers = [cwd, ...projets]
519
+ const echecs: string[] = []
520
+ for (const d of dossiers) {
521
+ const r = await $.process.run([GRILLHOUSE, 'newday'], { cwd: d, timeoutMs: 20_000 })
522
+ if (r.exitCode !== 0) echecs.push(`${d} : ${(r.stderr || '').trim() || `code ${r.exitCode}`}`)
523
+ }
524
+ // The follower watches each marker's file and measures again.
525
+ const poses = dossiers.length - echecs.length
526
+ const tete = `Repère de journée posé pour ${poses}/${dossiers.length} projet(s) : FAITS AUJOURD’HUI et les cases « rejetés »/« validés » repartent de zéro.`
527
+ return { text: [tete, ...echecs.map(x => `⛔ ${x}`)].join('\n') }
519
528
  }
520
529
  if (geste) return { text: 'Usage : /grillhouse, /grillhouse newday, /grillhouse ajouter <chemin>, /grillhouse retirer <chemin>.' }
521
530
  // A narrow column docked beside the transcript; a short block when seated above the prompt.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@roomi-fields/grillhouse",
3
- "version": "0.40.0",
3
+ "version": "0.42.0",
4
4
  "description": "Roomi's Grillhouse: the frame's scripts, called by one command, grillhouse <sous-commande>",
5
5
  "keywords": [
6
6
  "claude-code",
@@ -937,13 +937,17 @@ export function preuveReussie(
937
937
  // of its own — an aggregator harness (tests/it/main.rs, `mod …;`) or shared test matter; not a
938
938
  // casse. With a result but no test (<res> present, 0 tests), it is a casse only when that result
939
939
  // itself failed. Returns the kind of casse (`non-joue`, `ne-charge-pas`) or null when there is none.
940
- export function casseDeChargement({ res, code, constructions }) {
940
+ export function casseDeChargement({ res, code, constructions, aDesResultats = false }) {
941
941
  const tests = res?.tests ?? [];
942
942
  if (constructions.length && (!res || tests.length === 0)) {
943
943
  return null;
944
944
  }
945
945
  if (!res) {
946
- return code === 0 ? null : 'non-joue';
946
+ // No result at this file's name: an aggregator harness (tests/it/main.rs, `mod …;`) with no test
947
+ // of its own. A casse only when the binary did not run — code ≠ 0 and the run produced no result
948
+ // at all. When the run produced results (its modules played, some may have failed, so the single
949
+ // binary exits non-zero), the harness ran: not a casse, its modules' reds carry the proof.
950
+ return code === 0 || aDesResultats ? null : 'non-joue';
947
951
  }
948
952
  if (tests.length === 0) {
949
953
  return res.etat === 'failed' ? 'ne-charge-pas' : null;
@@ -1020,7 +1024,8 @@ export function integrer(ctx) {
1020
1024
  // when the ticket is labelled `en-file` (the queue takes it off) or the copy holds no file of the
1021
1025
  // lot (a copy that holds one still has a lot to commit — a second commit of a reopened ticket, for
1022
1026
  // example).
1023
- if (enFile || !(tests.length || code.length)) {
1027
+ const sansLot = !(tests.length || code.length);
1028
+ if (enFile || sansLot) {
1024
1029
  // A lot already on main (`lotSurMain`, the one rule the integrator publishes): the ticket
1025
1030
  // finishes at integre, and its copy goes with its working directory, as the integrator removes
1026
1031
  // the copy after a commit (here the ticket is done, so `.travail` goes too — no `--garder-travail`).
@@ -1055,7 +1060,7 @@ export function integrer(ctx) {
1055
1060
  // A lot already committed but not yet on main: its ticket is labelled `en-file`
1056
1061
  // (scripts/integration/integrer.mjs) until the queue takes it off, as a job of a CI keyed by its
1057
1062
  // commit is not run twice. The integration plays again without a second commit, then the queue.
1058
- if (enFile) {
1063
+ if (enFile && sansLot) {
1059
1064
  return finir(
1060
1065
  `la branche ${branche} est déjà en file : le lot est déjà commité, aucun second commit.\n`,
1061
1066
  { code: 0, deja: true, enFile: true }
@@ -1063,7 +1068,14 @@ export function integrer(ctx) {
1063
1068
  }
1064
1069
  // No lot to apply and no commit on main: refused by its name, as the integrator refuses a direct
1065
1070
  // call in the same case (the one rule `lotSurMain` deciding).
1066
- return finir(`${refusLotAbsent(ctx.ticket)}\n`, { code: 1, nom: 'lot-absent' });
1071
+ if (sansLot) {
1072
+ return finir(`${refusLotAbsent(ctx.ticket)}\n`, { code: 1, nom: 'lot-absent' });
1073
+ }
1074
+ // Labelled `en-file`, not on main, and the copy holds a lot: the lot was written after the
1075
+ // commit the label names (the circuit went back to its plan, its tests or its code while the
1076
+ // branch waited for its CI), and the integrator removes the copy of a lot it commits. The label
1077
+ // is stale: the lot of the copy is committed below, the branch set on it, as a new push to a
1078
+ // pull request replaces the commit its merge queue holds.
1067
1079
  }
1068
1080
  const dansCopie = (...a) =>
1069
1081
  spawnSync('git', ['-C', ctx.copie, ...a], { encoding: 'utf8', maxBuffer: 256 * 1024 * 1024 });
@@ -1603,11 +1615,23 @@ export function preuve(ctx, { mesure: derniere = null, fichiers: seuls = null }
1603
1615
  }
1604
1616
  }
1605
1617
  }
1606
- for (const f of groupe) {
1618
+ // The files judged: those of the lot in the group, and, for a single integration binary that
1619
+ // plays its modules (Rust `tests/it/main.rs`), each module file the run reports — the group names
1620
+ // the binary, the results name the modules, so a module's reds are credited to the lot, and the
1621
+ // aggregator is no false casse. A package played whole (`entier`) keeps its own branch above.
1622
+ const fichiersDuGroupe = entier
1623
+ ? groupe
1624
+ : [...new Set([...groupe, ...resultats.map(r => path.relative(ctx.copie, r.fichier))])];
1625
+ for (const f of fichiersDuGroupe) {
1607
1626
  const res = resultats.find(t => t.fichier === path.join(ctx.copie, f));
1608
1627
  const tests = res?.tests ?? [];
1609
1628
  const deHead = vertsDuRegistre(registre, f);
1610
- const casse = casseDeChargement({ res, code, constructions });
1629
+ const casse = casseDeChargement({
1630
+ res,
1631
+ code,
1632
+ constructions,
1633
+ aDesResultats: resultats.length > 0,
1634
+ });
1611
1635
  if (casse === 'non-joue') {
1612
1636
  casses.push(
1613
1637
  `${f} — ne se charge pas : non joué (code ${code}) ; le journal du ticket : ${ctx.journal} (il se cite en pièce, \`${ctx.ticket}.log:<ligne>\`)`
@@ -529,7 +529,9 @@
529
529
  // change since its last green is read back (scripts/transitions.mjs). With the developpeur's
530
530
  // or the testwriter's step, it has the lot corrected: the whole ticket from
531
531
  // that step, the text of `--contexte` the task at the head of each agent's instruction in the
532
- // run, the reviewer's line CONTEXTE (after a stop
532
+ // run (the agent whose step `--depuis` names reads it as his task; the other one reads whom it
533
+ // was given to, and does his own role's share: `constatsDeLaSeance` of scripts/seances.mjs),
534
+ // the reviewer's line CONTEXTE (after a stop
533
535
  // « integration », from the developpeur, the refusal as his report, the red to lift, as a merge
534
536
  // queue sends the lot back to its author with the log of its check; from the testwriter, the
535
537
  // refusal dropped), as a retry
@@ -553,7 +555,9 @@
553
555
  // cancels the act under way, its session with it, then the state keeps its step, its stop
554
556
  // « arrete », its question lifted, its motive (`--contexte`) as its report, said at the ticket
555
557
  // (`Circuit · arret : le superviseur arrête le circuit : <motif>`), and the workflow ends, giving
556
- // that state back, which an answer reopens from.
558
+ // that state back, which an answer reopens from. The ticket leaves the queue of the tickets, its
559
+ // label `circuit` taken off (`sortirDeLaFile`): the queue does not start it again, and the run
560
+ // that opens on the supervisor's answer puts the label back (`rentrerDansLaFile`).
557
561
  // - On a stop other than 0, the circuit applies its gesture when one settles it (`a-repasser`:
558
562
  // it ends at 75), the gesture written at the ticket and in the log; every other stop goes up to
559
563
  // the supervisor (`monter`): its question (MONTEES of scripts/etapes.mjs, or the agent's own
@@ -1906,6 +1910,31 @@ function ecrireLePlan(ctx, plan, description = null) {
1906
1910
  return titre;
1907
1911
  }
1908
1912
 
1913
+ /**
1914
+ * The plan <paquets> the explorateur writes for <ctx>, with each package the supervisor gave the
1915
+ * plan (`--etendre`, kept among the sheets, `etendus`) that it leaves out, in its order
1916
+ * (`planEtendu`), said at the ticket: the supervisor's word on the plan stands until he changes
1917
+ * it, as a reviewer's requested change stays on a pull request its author pushes again, and a plan
1918
+ * written again (a description the responsable changed) does not send the developpeur back to the
1919
+ * stop « hors-plan » the extension had lifted. `--recommencer`, which removes the sheets, starts
1920
+ * the plan over without them.
1921
+ */
1922
+ export function avecLesEtendus(ctx, paquets) {
1923
+ const donnes = lesFiches(ctx).flatMap(e =>
1924
+ e.role === AUTEUR_DU_CIRCUIT ? (e.plan?.etendus ?? []) : []
1925
+ );
1926
+ const gardes = [...new Set(donnes)].filter(c => !paquets.includes(c));
1927
+ if (!gardes.length) {
1928
+ return paquets;
1929
+ }
1930
+ commenter(
1931
+ ctx,
1932
+ 'plan',
1933
+ `le plan garde ${nomsDe(ctx, gardes).join(', ')}, que le superviseur lui a donné (\`--etendre\`).`
1934
+ );
1935
+ return planEtendu(ctx, paquets, gardes).plan;
1936
+ }
1937
+
1909
1938
  // What makes the packages of the sheet <fiche> of the explorateur out of conformity, or null: a
1910
1939
  // package that names neither a package nor a path of the repository, one package named twice
1911
1940
  // (by its name and by its path), or a component of the survey of the plan's description
@@ -2069,7 +2098,7 @@ const PAS_DU_PLAN = {
2069
2098
  );
2070
2099
  ecrireLePlan(
2071
2100
  ctx,
2072
- plan.paquets.map(ctx.resoudre),
2101
+ avecLesEtendus(ctx, plan.paquets.map(ctx.resoudre)),
2073
2102
  decrireLePlan(e.avant, plan.criteres, plan.questions, sorteEcrite(plan), plan.noms_publies)
2074
2103
  );
2075
2104
  const ouvertes = plan.questions.length ? `\n${lignesOuvertes(plan.questions)}` : 'aucune';
@@ -2168,7 +2197,7 @@ const PAS_DU_PLAN = {
2168
2197
  const plans = [{ fiche: premier }, { fiche: plan, reponse: true }];
2169
2198
  ecrireLePlan(
2170
2199
  ctx,
2171
- plan.paquets.map(ctx.resoudre),
2200
+ avecLesEtendus(ctx, plan.paquets.map(ctx.resoudre)),
2172
2201
  decrireLePlan(
2173
2202
  e.avant,
2174
2203
  plan.criteres,
@@ -2241,9 +2270,26 @@ export async function arreter(ctx, e) {
2241
2270
  });
2242
2271
  const pourquoi = ctx.contexte ? ` : ${ctx.contexte}` : '.';
2243
2272
  commenter(ctx, 'arret', `le superviseur arrête le circuit${pourquoi}`);
2273
+ sortirDeLaFile(ctx);
2244
2274
  return 0;
2245
2275
  }
2246
2276
 
2277
+ // The label `circuit` is the ticket's place in the queue of the tickets of its project
2278
+ // (scripts/file-des-tickets.mjs `enFile`), which starts every open ticket that holds it and whose
2279
+ // circuit does not run. A circuit stopped on the supervisor's word leaves that queue, its label
2280
+ // taken off, as a change whose approval is withdrawn leaves a merge queue (bors `r-`, Zuul's
2281
+ // dequeue): Beads keeps the ticket from starting again until his word reopens it.
2282
+ export const sortirDeLaFile = ctx =>
2283
+ emettre(ctx, { genre: 'etiquettes', ticket: ctx.ticket, etiquettes: [], retirees: ['circuit'] });
2284
+
2285
+ // The run of <ctx> that opens on the supervisor's answer to that stop (the state <e> it resumes
2286
+ // from, its stop « arrete ») is in the circuit again: its label put back.
2287
+ export function rentrerDansLaFile(ctx, e) {
2288
+ if (e?.raison === 'arrete') {
2289
+ emettre(ctx, { genre: 'etiquettes', ticket: ctx.ticket, etiquettes: ['circuit'] });
2290
+ }
2291
+ }
2292
+
2247
2293
  // The plan <paquets> of the repository at <base>, each a directory relative to it, extended by
2248
2294
  // <gagnes>: each one enters before the first package of the plan that reads it, as the module of
2249
2295
  // the language reads its components (`lecteurs` of the join, its `lit` and its `parLesTests`: the
@@ -2273,6 +2319,39 @@ export function ordonnerLePlan(base, paquets, gagnes) {
2273
2319
  return plan;
2274
2320
  }
2275
2321
 
2322
+ /**
2323
+ * The plan <paquets> of <ctx> extended by <gagnes>, in the order `ordonnerLePlan` reads: in the
2324
+ * ticket's copy; when the copy does not load (a manifest a session left broken: `cargo metadata`
2325
+ * refuses a workspace whose member names a dependency its root does not declare), in the main
2326
+ * tree; when neither loads, each gained package at the plan's end. The supervisor's answer to a
2327
+ * stopped circuit never fails on the tree it comes to repair, as a command that answers a workflow
2328
+ * does not need its working tree to build. `{ plan, lu }`: where the order was read, `copie`,
2329
+ * `principal`, or `aucun`.
2330
+ */
2331
+ export function planEtendu(ctx, paquets, gagnes) {
2332
+ const bases = [
2333
+ ...(existsSync(ctx.copie) ? [['copie', ctx.copie]] : []),
2334
+ ['principal', ctx.racine],
2335
+ ];
2336
+ for (const [lu, base] of bases) {
2337
+ try {
2338
+ return { plan: ordonnerLePlan(base, paquets, gagnes), lu };
2339
+ } catch {
2340
+ // This tree does not load: the next one is read.
2341
+ }
2342
+ }
2343
+ return { plan: [...paquets, ...gagnes], lu: 'aucun' };
2344
+ }
2345
+
2346
+ // What the line of the plan at the ticket says of the tree its order was read in, when the copy of
2347
+ // the ticket exists and does not load.
2348
+ const ORDRE_LU = {
2349
+ copie: '',
2350
+ principal: " (l'ordre du plan est lu dans l'arbre principal : la copie ne se charge pas)",
2351
+ aucun:
2352
+ " (le paquet gagné va en fin de plan : ni la copie ni l'arbre principal ne se chargent pour l'ordonner)",
2353
+ };
2354
+
2276
2355
  // The plan extended by the supervisor to the packages of `--etendre` (each a path or a package
2277
2356
  // name of the repository, else a Usage): each one enters the title in the order of
2278
2357
  // `ordonnerLePlan`, written by bd and said at the ticket. With the state <e>, the run then resumes
@@ -2283,15 +2362,22 @@ export function ordonnerLePlan(base, paquets, gagnes) {
2283
2362
  // the plan extended. The state the run resumes from.
2284
2363
  function etendre(ctx, e) {
2285
2364
  const gagnes = [...new Set(ctx.etendre.map(ctx.resoudre))].filter(c => !ctx.paquets.includes(c));
2286
- const base = existsSync(ctx.copie) ? ctx.copie : ctx.racine;
2287
- const plan = ordonnerLePlan(base, ctx.paquets, gagnes);
2365
+ const { plan, lu } = planEtendu(ctx, ctx.paquets, gagnes);
2288
2366
  const titre = ecrireLePlan(ctx, plan);
2289
- // The plan the supervisor extends has passed: it is written, questioned no more.
2290
- inscrire(ctx, { role: AUTEUR_DU_CIRCUIT, plan: { empreinte: empreinteDuPlan(leTicket(ctx)) } });
2367
+ // The plan the supervisor extends has passed: it is written, questioned no more. The packages
2368
+ // he gives it are kept with it (`etendus`): a plan the explorateur writes again keeps them
2369
+ // (`avecLesEtendus`).
2370
+ inscrire(ctx, {
2371
+ role: AUTEUR_DU_CIRCUIT,
2372
+ plan: {
2373
+ empreinte: empreinteDuPlan(leTicket(ctx)),
2374
+ etendus: [...new Set(ctx.etendre.map(ctx.resoudre))],
2375
+ },
2376
+ });
2291
2377
  commenter(
2292
2378
  ctx,
2293
2379
  'plan',
2294
- `le superviseur étend le plan à ${ctx.etendre.join(', ')} : ${titre.split(' — ').at(-1)}.`
2380
+ `le superviseur étend le plan à ${ctx.etendre.join(', ')} : ${titre.split(' — ').at(-1)}${ORDRE_LU[lu]}.`
2295
2381
  );
2296
2382
  if (!e) {
2297
2383
  return e;
@@ -2310,6 +2396,7 @@ function etendre(ctx, e) {
2310
2396
 
2311
2397
  // The opening of <ctx> on <e> before its plan: `{ debut }`, or `{ code }`, a stop gone up.
2312
2398
  async function avantLePlan(ctx, e) {
2399
+ rentrerDansLaFile(ctx, e);
2313
2400
  if (ctx.etendre) {
2314
2401
  if (e?.etape === 'integre') {
2315
2402
  throw new Usage(`--etendre : le lot de ${ctx.ticket} est intégré.`);
@@ -27,7 +27,8 @@
27
27
  // - `resume-du-tri` `{ ticket, debut, ecritures }`: the line of the tri at the ticket, which reads
28
28
  // each discovery's writings when it is written (`{ decouverte, verdict, etiquettes, rouvre }`:
29
29
  // its comment, its labels, its reopening), its key in the comment;
30
- // - `etiquettes` `{ ticket, etiquettes }`: labels added to a ticket;
30
+ // - `etiquettes` `{ ticket, etiquettes, retirees }`: labels added to a ticket, and those taken off
31
+ // it (`retirees`, none when absent);
31
32
  // - `reouverture` `{ ticket }`: a ticket reopened.
32
33
  //
33
34
  // An effect that does not replay without harm carries the key it is played under (`AVEC_CLE`),
@@ -286,8 +287,13 @@ const JOUEURS = {
286
287
  const texte = `${debut} ; ${rouvertes.length ? `rouvertes sous a-valider : ${rouvertes.join(', ')}` : 'aucune rouverte'}${rates.length ? ` ; écritures en échec : ${rates.join(' ; ')}` : ''}.`;
287
288
  return commenterUneFois(ctx, { ticket, texte, auteur: AUTEUR_DU_CIRCUIT }, cle);
288
289
  },
289
- etiquettes(ctx, { ticket, etiquettes }) {
290
- return ctx.bd('update', ticket, ...etiquettes.flatMap(e => ['--add-label', e]));
290
+ etiquettes(ctx, { ticket, etiquettes, retirees = [] }) {
291
+ return ctx.bd(
292
+ 'update',
293
+ ticket,
294
+ ...etiquettes.flatMap(e => ['--add-label', e]),
295
+ ...retirees.flatMap(e => ['--remove-label', e])
296
+ );
291
297
  },
292
298
  reouverture(ctx, { ticket }) {
293
299
  const r = ctx.bd('show', ticket, '--json');
@@ -103,8 +103,9 @@ import { Arret, geste } from './ticket-du-circuit.mjs';
103
103
  // resumes, the rank of arrival, the sort of the ticket, what the opening reads of the project's
104
104
  // package.json (its tools, its data, its generated files), which every pass of a later act plays
105
105
  // with, each act in a process of its own, and the supervisor's context of the
106
- // run (`contexte`), which each session of the run reads at the head of its instruction; a context
107
- // the act is given (an answer's, a motive) is kept over it.
106
+ // run (`contexte`), which each session of the run reads at the head of its instruction, with the
107
+ // role it was given to (`destinataire`, the role `--depuis` names); a context the act is given
108
+ // (an answer's, a motive) is kept over it.
108
109
  const GARDEE = [
109
110
  ...MEMOIRE,
110
111
  'seanceReprise',
@@ -114,6 +115,7 @@ const GARDEE = [
114
115
  'donnees',
115
116
  'engendres',
116
117
  'contexte',
118
+ 'destinataire',
117
119
  ];
118
120
 
119
121
  // The bases of the passes of the contexts this act opened, which its end removes, its death
@@ -183,13 +185,19 @@ const optionsDe = reponse => {
183
185
  return {};
184
186
  }
185
187
  const contexteDuSuperviseur = reponse.contexte ?? null;
188
+ // The role the supervisor's context is given to: the agent whose step `--depuis` names; every
189
+ // other answer gives it to the step under way, no role named.
186
190
  if (reponse.genre === 'reprendre') {
187
- return { reprendre: true, contexte: contexteDuSuperviseur };
191
+ return { reprendre: true, contexte: contexteDuSuperviseur, destinataire: null };
188
192
  }
189
193
  if (reponse.genre === 'depuis') {
190
- return { depuis: reponse.role, contexte: contexteDuSuperviseur };
194
+ return {
195
+ depuis: reponse.role,
196
+ contexte: contexteDuSuperviseur,
197
+ destinataire: ['testwriter', 'developpeur'].includes(reponse.role) ? reponse.role : null,
198
+ };
191
199
  }
192
- return { etendre: reponse.paquets, contexte: contexteDuSuperviseur };
200
+ return { etendre: reponse.paquets, contexte: contexteDuSuperviseur, destinataire: null };
193
201
  };
194
202
 
195
203
  // The act <f> on the context <ctx>: its outcome and the effects it emitted (`effets`), its bases
@@ -164,6 +164,7 @@ import { lireGroupe, projetsExternes } from './groupe-cles.mjs';
164
164
  import { migrer, restesAuProjet } from './migrations.mjs';
165
165
  import { langageDe, langagesDe } from './langages.mjs';
166
166
  import * as langagesDansLArchitecture from './migrations/0.27.0-langages-dans-l-architecture.mjs';
167
+ import { CONFIG_BEADS, ecrireLePrefixe, prefixe, prefixeDuStore } from './prefixe-des-tickets.mjs';
167
168
  import { poserLesWorkflows } from './workflows-du-cadre.mjs';
168
169
 
169
170
  const SCRIPTS = {
@@ -372,6 +373,16 @@ function poserLesProjetsExternes(projet, groupe, bd) {
372
373
  return poses;
373
374
  }
374
375
 
376
+ // Whether the `.beads/config.yaml` of <projet> holds an active key `issue-prefix`.
377
+ function cleActive(projet) {
378
+ try {
379
+ prefixe(projet);
380
+ return true;
381
+ } catch {
382
+ return false;
383
+ }
384
+ }
385
+
375
386
  /**
376
387
  * Brings the project at `projet` to the frame's files at `source` (CADRE, scripts/cadre.mjs; a
377
388
  * trial's own in the tests); <inscrite> is the version it records (the package's; null records
@@ -505,6 +516,11 @@ export function mettreAJour(projet, source, { inscrite = VERSION, bd = jouerBd }
505
516
  attribuer(projet);
506
517
  bilan.workflows = poserLesWorkflows(projet, source);
507
518
  bilan.projetsExternes = poserLesProjetsExternes(projet, groupe, bd);
519
+ // The key `issue-prefix`, when no active one exists: the store's value, never a guess.
520
+ if (existsSync(path.join(projet, CONFIG_BEADS)) && !cleActive(projet)) {
521
+ const valeur = prefixeDuStore(projet, bd);
522
+ bilan.prefixe = valeur === '' ? { manque: true } : { pose: ecrireLePrefixe(projet, valeur) };
523
+ }
508
524
  return bilan;
509
525
  }
510
526
 
@@ -564,6 +580,11 @@ export function rapport(b) {
564
580
  `Projets externes de Beads : ${b.projetsExternes.join(', ')} posé(s) depuis grillhouse.groupe.`
565
581
  );
566
582
  }
583
+ if (b.prefixe?.pose) {
584
+ lignes.push(
585
+ `Préfixe des tickets : ${CONFIG_BEADS} pose \`${b.prefixe.pose}\`, la valeur du store de Beads.`
586
+ );
587
+ }
567
588
  if (b.workflows?.length > 0) {
568
589
  lignes.push(
569
590
  `Workflows du cadre : ${b.workflows.join(', ')} écrit(s) depuis le gabarit ; leur machine est la variable RUNNER du dépôt sur GitHub (ubuntu-latest sans elle), que la mise à jour ne touche pas.`
@@ -703,6 +724,12 @@ function mettreAJourLeProjet(projet, premiere) {
703
724
  process.stderr.write(`${l}\n`);
704
725
  process.exitCode = 1;
705
726
  }
727
+ if (b.prefixe?.manque) {
728
+ process.stderr.write(
729
+ `Préfixe des tickets : le store de Beads n'en donne aucun ; pose \`issue-prefix: "<préfixe des tickets du projet>"\` dans ${CONFIG_BEADS}, le préfixe étant celui que le projet choisit.\n`
730
+ );
731
+ process.exitCode = 1;
732
+ }
706
733
  const binaires = installerBinaires(projet);
707
734
  if (binaires.installes.length > 0) {
708
735
  process.stdout.write(`Binaires installés : ${binaires.installes.join(', ')}.\n`);
@@ -14,7 +14,9 @@
14
14
  // (./commandes.mjs), and uv's cache, `~/.cache/grillhouse/uv` (UV_CACHE_DIR, ./commandes.mjs: the
15
15
  // frame's caches of compilation, never in the temporary directory); proper to the session, the
16
16
  // tree of the bytecode at the root, `__pycache__` (PYTHONPYCACHEPREFIX, ./commandes.mjs); read,
17
- // the Pythons uv installs, `~/.local/share/uv/python`. The version of Python is uv's choice, from
17
+ // uv itself where its installer lays it, `~/.local/bin/uv` (./binaires.mjs: without it a session
18
+ // of the envelope, whose home shows only what is declared, cannot play `npm test` on a package of
19
+ // Python), and the Pythons uv installs, `~/.local/share/uv/python`. The version of Python is uv's choice, from
18
20
  // `requires-python` and `.python-version`. The rules that refuse a role that writes pytest run
19
21
  // directly (`droits`).
20
22
  // - The packages, a file's, the test files, what the testwriter writes, of the manifests too, the
@@ -79,7 +81,7 @@ export default {
79
81
  sorties: {
80
82
  ecrites: ['.venv/', '.pytest_cache/', '~/.cache/grillhouse/uv/'],
81
83
  propres: [PYCACHE],
82
- lues: ['~/.local/share/uv/python/'],
84
+ lues: ['~/.local/bin/uv', '~/.local/share/uv/python/'],
83
85
  },
84
86
  // pytest run directly, by itself, by Python or by uv: `npm test` and `npm run verifier` play it.
85
87
  droits: [
@@ -251,8 +251,15 @@ function cheminsDuScript(script) {
251
251
  return chemins.map(m => m.replace(/^\.\//, ''));
252
252
  }
253
253
 
254
- // The refusals of the root's format and lint scripts at <racine> that name a file a package holds:
255
- // the root keeps its own files (grillhouse-44b.9), a package plays its own.
254
+ // Whether a root script launches the packages' own scripts again: npm's workspaces (`--workspaces`,
255
+ // `-ws`, `--workspace`, `-w`) or a run of Turborepo, which already plays each package's task.
256
+ const relanceLesPaquets = script =>
257
+ /(^|\s)(--workspaces?|-ws|-w)(=|\s|$)/.test(String(script)) ||
258
+ /(^|[\s;&|])(npx\s+)?turbo\s+run(\s|$)/.test(String(script));
259
+
260
+ // The refusals of the root's format and lint scripts at <racine> that name a file a package holds,
261
+ // or launch the packages' scripts again: the root keeps its own files (grillhouse-44b.9), a package
262
+ // plays its own.
256
263
  function controlesDeRacineRefuses(racine) {
257
264
  const dossiers = paquets(racine)
258
265
  .filter(p => !p.hors)
@@ -269,6 +276,12 @@ function controlesDeRacineRefuses(racine) {
269
276
  return refus;
270
277
  }
271
278
  for (const c of CONTROLES) {
279
+ if (relanceLesPaquets(scripts?.[c] ?? '')) {
280
+ refus.push(
281
+ `⛔ package.json : le script \`${c}\` de la racine (tâche \`//#${c}\`) relance les paquets (\`${scripts[c]}\`) ; Turborepo joue déjà le script \`${c}\` de chaque paquet du cadre : retire ce script, ou réduis-le aux fichiers de la racine.`
282
+ );
283
+ continue;
284
+ }
272
285
  for (const chemin of cheminsDuScript(scripts?.[c] ?? '')) {
273
286
  const { fixe, glob } = partieFixe(chemin);
274
287
  // A glob at the root's top (`*.mjs`) names the root's files; `**` reaches the packages.
@@ -40,8 +40,9 @@
40
40
  // day leaves out, through the plugin `nuit`: the night tests, the benches and the witnesses; the
41
41
  // variable `GRILLHOUSE_TESTS_DE_NUIT` (NUIT_VARIABLE) chooses `nuit`, the night tests alone,
42
42
  // `hors-poste`, the night tests but those that bear the tag `@poste` at their head (the night of
43
- // a shared machine), or `mesures`, the benches and the witnesses alone, one file at a time
44
- // (`fileParallelism: false`), as scripts/langages/typescript/tests-de-nuit.mjs plays them; the
43
+ // a shared machine), or `mesures`, the benches and the witnesses alone; every choice plays one
44
+ // file at a time (`fileParallelism: false`, the night at rest: a night test mounts a trial, a
45
+ // measure is taken under no load), as scripts/langages/typescript/tests-de-nuit.mjs plays them; the
45
46
  // variable `GRILLHOUSE_TRANCHE_DE_NUIT` (NUIT_TRANCHE) gives the run its tranche, as a tranche of
46
47
  // the day (`trancher`, ../tranches.mjs).
47
48
  // - A tranche of a pass (`tranche`, `i/n`, and `rapports` in the value, `npm run verifier --
@@ -303,8 +304,9 @@ export function testsDuPoste(dir) {
303
304
  * The plugin of the night's configuration: the night tests, the benches and the time witnesses
304
305
  * under its directory, or, as <env> chooses in NUIT_VARIABLE, the night tests alone (`nuit`), the
305
306
  * night tests but those tagged `@poste` (`hors-poste`, the night of a shared machine: a CI), or the
306
- * measures alone, one file at a time (`mesures`), the benches and the witnesses; with
307
- * NUIT_TRANCHE, the tranche it carries of these files.
307
+ * measures alone (`mesures`), the benches and the witnesses; every choice plays one file at a time
308
+ * (`fileParallelism: false`), the night at rest; with NUIT_TRANCHE, the tranche it carries of these
309
+ * files.
308
310
  * @param {NodeJS.ProcessEnv} [env] the environment that holds the choice
309
311
  */
310
312
  export const nuit = (env = process.env) => ({
@@ -316,6 +318,10 @@ export const nuit = (env = process.env) => ({
316
318
  delete env[NUIT_TRANCHE];
317
319
  const test = (config.test ??= {});
318
320
  const temoins = temoinsDe(config, { ...test, include: INCLUDE });
321
+ // The night plays one file at a time, at rest, without the files competing: a night test mounts
322
+ // a trial (a Temporal server, a copy) and a measure is taken under no load, so neither saturates
323
+ // the machine against the other.
324
+ test.fileParallelism = false;
319
325
  if (choix === 'nuit') {
320
326
  test.include = [NUIT];
321
327
  } else if (choix === 'hors-poste') {
@@ -329,7 +335,6 @@ export const nuit = (env = process.env) => ({
329
335
  }
330
336
  } else if (choix === 'mesures') {
331
337
  test.include = [BUDGET, ...temoins];
332
- test.fileParallelism = false;
333
338
  } else {
334
339
  test.include = [...HORS_DU_JOUR, ...temoins];
335
340
  }
package/scripts/nuit.sh CHANGED
@@ -352,6 +352,9 @@ verdict=$?
352
352
  # The copies whose content is on main go once the steps are played, the night's own kept and
353
353
  # pruned of its tools' outputs; their removal never changes the verdict.
354
354
  (cd "$racine" && node "$ici/retirer-les-copies-finies.mjs" "$copie") >> "$journal" 2>&1 || true
355
+ # The project's durable verdict, read by the board: green on 0, red on any other code but 75, which
356
+ # writes nothing (the previous verdict stays).
357
+ node "$ici/verdict-de-la-nuit.mjs" "$commun" "$verdict" >> "$journal" 2>&1 || true
355
358
 
356
359
  if [ "$verdict" -eq 75 ]; then
357
360
  echo "⏱ à repasser : ${tete:0:7} n'est ni vert ni rouge, la machine est restée chargée ; le dernier vert reste, aucun ticket, la nuit suivante rejoue." >> "$journal"
@@ -2,8 +2,8 @@
2
2
  // `.beads/config.yaml`, the one place a CI reads it (it has no `bd`): the guard of the titles of the
3
3
  // tests reads it there (scripts/langages/typescript/titres-de-tests.mjs). `bd init` writes the key
4
4
  // commented out and keeps the prefix in its database, so the frame writes the key itself, by one
5
- // function: the preparation of a new project (./preparation.mjs) and the update of a project
6
- // (the migration 0.30.0 « préfixe des tickets »).
5
+ // function: the preparation of a new project (./preparation.mjs) and the update of any project
6
+ // (`mettreAJour`, which writes the key when no active one exists, the value being the store's).
7
7
  import { readFileSync, writeFileSync } from 'node:fs';
8
8
  import path from 'node:path';
9
9
  import { pathToFileURL } from 'node:url';
@@ -44,6 +44,20 @@ export function prefixe(racine) {
44
44
  return valeur;
45
45
  }
46
46
 
47
+ /**
48
+ * The prefix the store of Beads holds (`bd config get issue_prefix`, run in <racine> by <bd>, as
49
+ * `bd(args, cwd)` gives `{ status, stdout, stderr }`): '' without a value, on a failure, or when the
50
+ * output is a placeholder (it holds `(`).
51
+ * @param {string} racine
52
+ * @param {(args: string[], cwd: string) => { status: number | null, stdout?: string }} bd
53
+ * @returns {string}
54
+ */
55
+ export function prefixeDuStore(racine, bd) {
56
+ const r = bd(['config', 'get', 'issue_prefix'], racine);
57
+ const valeur = (r.stdout ?? '').trim();
58
+ return r.status === 0 && valeur !== '' && !valeur.includes('(') ? valeur : '';
59
+ }
60
+
47
61
  /**
48
62
  * Writes the key `issue-prefix: "<valeur>"` in the `.beads/config.yaml` of the repository at
49
63
  * <racine>, which exists: a key written empty is replaced, an absent one added at the end; a key
@@ -22,7 +22,7 @@ import { existsSync } from 'node:fs';
22
22
  import path from 'node:path';
23
23
  import { trouverDansLePath } from './commandes-du-path.mjs';
24
24
  import { installerGreffons } from './greffons.mjs';
25
- import { ecrireLePrefixe } from './prefixe-des-tickets.mjs';
25
+ import { ecrireLePrefixe, prefixeDuStore } from './prefixe-des-tickets.mjs';
26
26
 
27
27
  // The prefix of the tickets: the one given, else the store's own, else the directory's name.
28
28
  function prefixeDe(projet, donne) {
@@ -30,13 +30,10 @@ function prefixeDe(projet, donne) {
30
30
  return donne;
31
31
  }
32
32
  if (existsSync(path.join(projet, '.beads'))) {
33
- const r = spawnSync('bd', ['config', 'get', 'issue_prefix'], {
34
- cwd: projet,
35
- encoding: 'utf8',
36
- maxBuffer: 256 * 1024 * 1024,
37
- });
38
- const existant = (r.stdout ?? '').trim();
39
- if (r.status === 0 && existant !== '' && !existant.includes('(')) {
33
+ const existant = prefixeDuStore(projet, (args, cwd) =>
34
+ spawnSync('bd', args, { cwd, encoding: 'utf8', maxBuffer: 256 * 1024 * 1024 })
35
+ );
36
+ if (existant !== '') {
40
37
  return existant;
41
38
  }
42
39
  }
@@ -946,6 +946,10 @@ function manques(role, f) {
946
946
  // seance }`, or `{ erreur }` naming what lacks or does not conform; with <copie>, the directory
947
947
  // of the copy, each file piece of the sheet stands in it, its file and its line; with <ticket>,
948
948
  // the description of the ticket, each piece of the ticket names a criterion or a section of it.
949
+ // A sheet that holds its schema is judged whole: what it lacks, its pieces not found and those out
950
+ // of the ticket are named together, and the sheet read comes back beside its faults (`lue`), so
951
+ // that its session's own validation names its faults in the same refusal — a session is taken up
952
+ // once on a refused sheet, as a linter reports every finding of a file in one run.
949
953
  export function lireFiche(role, sortie, { copie, ticket } = {}) {
950
954
  const schema = schemaDeFiche(role);
951
955
  if (!schema) {
@@ -962,17 +966,18 @@ export function lireFiche(role, sortie, { copie, ticket } = {}) {
962
966
  }
963
967
  const fiche = resultat.structured_output;
964
968
  const fautes = erreurs(schema, fiche, '');
965
- if (!fautes.length) {
966
- fautes.push(...manques(role, fiche));
969
+ if (fautes.length) {
970
+ return { erreur: `fiche non conforme : ${fautes.join(' ; ')}` };
967
971
  }
968
- if (!fautes.length && copie) {
972
+ fautes.push(...manques(role, fiche));
973
+ if (copie) {
969
974
  fautes.push(...introuvables(fiche, copie));
970
975
  }
971
- if (!fautes.length && typeof ticket === 'string') {
976
+ if (typeof ticket === 'string') {
972
977
  fautes.push(...horsDuTicket(fiche, ticket));
973
978
  }
974
979
  if (fautes.length) {
975
- return { erreur: `fiche non conforme : ${fautes.join(' ; ')}` };
980
+ return { erreur: `fiche non conforme : ${fautes.join(' ; ')}`, lue: fiche };
976
981
  }
977
982
  return { fiche, seance: resultat.session_id ?? null };
978
983
  }
@@ -592,7 +592,8 @@ export async function seance(
592
592
  const { tache, ouverts, constats, valider, repondre } = constatsDeLaSeance(
593
593
  ctx.contexte,
594
594
  gardes,
595
- role
595
+ role,
596
+ ctx.destinataire ?? null
596
597
  );
597
598
  // The last sign of life of a launch of this session, which a fresh session after a failed
598
599
  // resumption waits for while its group runs.
@@ -701,7 +702,12 @@ export async function seance(
701
702
  // task, and his sheet FAIT answers each by its title, refused without one (`valider`,
702
703
  // `reponsesAuxConstats`). Either way, each answer a developpeur's sheet gives is kept with its
703
704
  // finding (`repondre`, `avecLesReponses`).
704
- export function constatsDeLaSeance(contexte, constats, role) {
705
+ // A context the supervisor gave to another role (<destinataire>, the role `--depuis` names: the
706
+ // run plays that role's step, then the ones after it) heads the instruction under that role's
707
+ // name: what it asks of him is his session's work, and this session does its own role's share, as
708
+ // a job of a pipeline replayed with the variables of the retry reads those meant for another job
709
+ // without taking them for its own.
710
+ export function constatsDeLaSeance(contexte, constats, role, destinataire = null) {
705
711
  const siens = (constats ?? []).filter(c => c.role === role);
706
712
  const anciens = siens.filter(c => c.enContexte);
707
713
  const neufs = siens.filter(c => !c.enContexte);
@@ -714,9 +720,13 @@ export function constatsDeLaSeance(contexte, constats, role) {
714
720
  anciens.length && neufs.length
715
721
  ? `${texteDesOuverts(neufs)}\n\nPUIS ${enContexte} :\n\n${texteDesOuverts(anciens, neufs.length)}`
716
722
  : texteDesOuverts(siens);
723
+ const avant = `elle passe avant le ticket, le rapport${anciens.length ? ' et les constats donnés en contexte' : ''} ci-dessous`;
724
+ const autre = destinataire && destinataire !== role ? destinataire : null;
717
725
  return {
718
726
  tache: contexte
719
- ? `TA TÂCHE, que le superviseur te donne ; elle passe avant le ticket, le rapport${anciens.length ? ' et les constats donnés en contexte' : ''} ci-dessous :\n\n${contexte}\n\n`
727
+ ? autre
728
+ ? `LA TÂCHE DU SUPERVISEUR, donnée au ${nomDuRole(autre)} en relançant le circuit depuis son étape (\`--depuis ${autre}\`) ; ${avant}. Elle s'adresse à lui : ce qu'elle lui demande est le travail de sa séance, déjà jouée ; ta part est celle de ton rôle sur ce qu'elle vise, et tu ne lui renvoies pas ce qu'elle lui demandait :\n\n${contexte}\n\n`
729
+ : `TA TÂCHE, que le superviseur te donne ; ${avant} :\n\n${contexte}\n\n`
720
730
  : '',
721
731
  ouverts: titre,
722
732
  constats: texte,
@@ -893,9 +903,12 @@ export async function jusquALaFiche(ctx, role, texte, options = {}) {
893
903
  r.seance === 0
894
904
  ? lireSaFiche(ctx, reste.fiche ?? role, r.sortie)
895
905
  : { erreur: `la séance finit en erreur (code ${r.seance})` };
896
- const faute = lu.fiche ? valider(lu.fiche, essai) : null;
906
+ // The session's own validation judges a sheet that holds its schema, refused or not for what
907
+ // it lacks: every fault goes to the one resumption (scripts/resultats.mjs `lireFiche`).
908
+ const lue = lu.fiche ?? lu.lue ?? null;
909
+ const faute = lue ? valider(lue, essai) : null;
897
910
  if (faute) {
898
- lu = { erreur: `fiche non conforme : ${faute}` };
911
+ lu = { erreur: lu.erreur ? `${lu.erreur} ; ${faute}` : `fiche non conforme : ${faute}` };
899
912
  }
900
913
  if (lu.fiche) {
901
914
  // The session that gave it, which a resumption of it names (the plan's answer).
@@ -179,7 +179,7 @@ function lireLesIntegrations(racine, maintenant) {
179
179
  }
180
180
  // The tickets the queue reopened for a red workflow of main (label `flux-rouge`) that wait open, with
181
181
  // the address of the run, which the title of the queue's comment (scripts/integration/file.mjs)
182
- // gives in its second paragraph; none when bd does not read them.
182
+ // gives in its second paragraph; null when bd does not read them, which says nothing of the reds.
183
183
  export async function fluxRougesDe(racine) {
184
184
  // A repository without its base of tickets has no ticket to give, and bd is never launched.
185
185
  if (!existsSync(path.join(racine, '.beads'))) {
@@ -205,7 +205,8 @@ export async function fluxRougesDe(racine) {
205
205
  );
206
206
  return lots.flat();
207
207
  } catch {
208
- return [];
208
+ // A reading that fails says nothing of the reds: null, never « none ».
209
+ return null;
209
210
  }
210
211
  }
211
212
 
@@ -438,7 +439,7 @@ const aucunFerme = () => new Set();
438
439
  * <fluxRouges>: bd by default) is given as a batch of its own, once per run (`adresse`: the
439
440
  * workflow, the URL of the run, the commit), and again at another run; taken up or closed, it is
440
441
  * no longer given.
441
- * @param {{ racine: string, fermes?: (racine: string, ids: string[]) => Set<string> | null, pas?: number, signal?: AbortSignal, circuitsDe?: (racine: string, options?: { integres?: boolean }) => Promise<import('./circuits-du-serveur.mjs').CircuitDuServeur[]>, fluxRouges?: (racine: string) => { ticket: string, adresse: string }[] | Promise<{ ticket: string, adresse: string }[]>, maintenant?: () => number, rappel?: number }} options
442
+ * @param {{ racine: string, fermes?: (racine: string, ids: string[]) => Set<string> | null, pas?: number, signal?: AbortSignal, circuitsDe?: (racine: string, options?: { integres?: boolean }) => Promise<import('./circuits-du-serveur.mjs').CircuitDuServeur[]>, fluxRouges?: (racine: string) => { ticket: string, adresse: string }[] | null | Promise<{ ticket: string, adresse: string }[] | null>, maintenant?: () => number, rappel?: number }} options
442
443
  * @returns {Promise<{ ticket: string, etape: string, question: string, qui: string, commande: string, cle: string, representee?: boolean, integre?: boolean }[]>}
443
444
  * @throws {Error} another wait runs
444
445
  */
@@ -469,7 +470,8 @@ export async function attendreUneQuestion({
469
470
  const { depuis: debut, rendues } = lireLesIntegrations(racine, maintenant());
470
471
  let lue = debut;
471
472
  let lectureDesRouges = null;
472
- let rougesLus = null;
473
+ // The reds read: undefined while the reading runs, null when it failed.
474
+ let rougesLus;
473
475
  try {
474
476
  while (!signal?.aborted) {
475
477
  const avant = maintenant();
@@ -479,8 +481,8 @@ export async function attendreUneQuestion({
479
481
  lectureDesRouges ??= Promise.resolve()
480
482
  .then(() => fluxRouges(racine))
481
483
  .then(
482
- r => (rougesLus = Array.isArray(r) ? r : []),
483
- () => (rougesLus = [])
484
+ r => (rougesLus = Array.isArray(r) ? r : null),
485
+ () => (rougesLus = null)
484
486
  );
485
487
  try {
486
488
  circuits = await circuitsDe(racine, { integres: true });
@@ -489,9 +491,12 @@ export async function attendreUneQuestion({
489
491
  }
490
492
  await new Promise(resolve => setImmediate(resolve));
491
493
  let rouges = [];
492
- if (rougesLus) {
493
- rouges = releverLesFluxRouges(racine, rougesLus);
494
- rougesLus = null;
494
+ if (rougesLus !== undefined) {
495
+ // A failed reading leaves the reds given as they are: the next one judges them.
496
+ if (rougesLus) {
497
+ rouges = releverLesFluxRouges(racine, rougesLus);
498
+ }
499
+ rougesLus = undefined;
495
500
  lectureDesRouges = null;
496
501
  }
497
502
  if (signal?.aborted) {
@@ -148,6 +148,7 @@ import {
148
148
  circuitsDuServeur,
149
149
  nuitDuServeur,
150
150
  } from './circuits-du-serveur.mjs';
151
+ import { lireLeVerdict } from './verdict-de-la-nuit.mjs';
151
152
  import {
152
153
  aSonArchitecture,
153
154
  attendDeLAutreProjet,
@@ -870,6 +871,7 @@ export function assembler({
870
871
  outil = null,
871
872
  places: placesDeLaMachine = null,
872
873
  nuit: nuitEnCours = null,
874
+ verdictDeLaNuit = null,
873
875
  muet = false,
874
876
  faute = null,
875
877
  circuitsLusA = null,
@@ -1290,7 +1292,13 @@ export function assembler({
1290
1292
  // A red night says the night it turned red, short enough to stand whole on its line: the local
1291
1293
  // day and month its ticket was opened, the night's date (scripts/nuit.sh), whatever its title names, a
1292
1294
  // commit in older ones.
1293
- for (const t of nuit) {
1295
+ // The alert follows the verdict of the project's last night (`verdictDeLaNuit`), not the presence
1296
+ // of a night ticket: it stands while the verdict is red and falls on green or without a known night.
1297
+ // It names each open night ticket, or says « Nuit rouge » alone when none is open.
1298
+ if (verdictDeLaNuit === 'rouge' && nuit.length === 0) {
1299
+ alerter('nuitRouge', { signe: '🌙', texte: 'Nuit rouge' });
1300
+ }
1301
+ for (const t of verdictDeLaNuit === 'rouge' ? nuit : []) {
1294
1302
  const { sujet: titreLu, numero: n } = titre(t);
1295
1303
  const ouvert = Date.parse(t.created_at ?? '');
1296
1304
  const sujet =
@@ -1795,6 +1803,18 @@ export function lignes(t, nom, largeur = LARGEUR, groupes = {}) {
1795
1803
  ),
1796
1804
  TONS.mesure
1797
1805
  );
1806
+ // The day's and the cumulative work time and tokens, summed across the projects, as one
1807
+ // project's board shows its own: a multi-root board sums the figures of its roots.
1808
+ const m = t.jour ?? { travail: 0, jetons: 0 };
1809
+ const mc = t.cumul ?? { travail: 0, jetons: 0 };
1810
+ L(
1811
+ cadre(
1812
+ `jour ${duree(m.travail)} · ${k(m.jetons)} · cumul ${duree(mc.travail)} · ${k(mc.jetons)}`,
1813
+ '',
1814
+ largeur
1815
+ ),
1816
+ TONS.mesure
1817
+ );
1798
1818
  } else {
1799
1819
  const g = t.global;
1800
1820
  const c = g.compteurs;
@@ -2675,6 +2695,7 @@ function lire(
2675
2695
  machine,
2676
2696
  places,
2677
2697
  nuit,
2698
+ verdictDeLaNuit: lireLeVerdict(commun),
2678
2699
  muet,
2679
2700
  faute,
2680
2701
  circuitsLusA: lesCircuitsLus.lu,
@@ -2713,6 +2734,16 @@ export function ensemble(lus) {
2713
2734
  const marquer = projet => x => ({ ...x, projet });
2714
2735
  const noeud = projet => n => ({ ...n, projet, enfants: n.enfants.map(noeud(projet)) });
2715
2736
  const tous = cle => lisibles.flatMap(l => (l.t[cle] ?? []).map(marquer(l.etiquette)));
2737
+ // The sum, across the projects, of a measure of `global` (`jour` or `cumul`): its work time and
2738
+ // its tokens added.
2739
+ const sommeDesMesures = cle =>
2740
+ lisibles.reduce(
2741
+ (s, l) => ({
2742
+ travail: s.travail + (l.t.global[cle]?.travail ?? 0),
2743
+ jetons: s.jetons + (l.t.global[cle]?.jetons ?? 0),
2744
+ }),
2745
+ { travail: 0, jetons: 0 }
2746
+ );
2716
2747
  return {
2717
2748
  projets: lus.map(l =>
2718
2749
  l.t
@@ -2748,6 +2779,10 @@ export function ensemble(lus) {
2748
2779
  },
2749
2780
  { new: 0, check: 0, rejetes: 0, valides: 0 }
2750
2781
  ),
2782
+ // The day's and the cumulative work time and tokens, summed across the projects (each project's
2783
+ // own `global.jour`/`global.cumul`), for the board's time-and-token line of several projects.
2784
+ jour: sommeDesMesures('jour'),
2785
+ cumul: sommeDesMesures('cumul'),
2751
2786
  etats: premier.t.etats.map(e => ({
2752
2787
  ...e,
2753
2788
  tickets: lisibles.flatMap(l =>
@@ -244,8 +244,19 @@ export const entete = (ctx, etape) =>
244
244
  appendFileSync(ctx.journal, `=== ${heureLocale()} · circuit · ${etape} ===\n`);
245
245
 
246
246
  // The name of each package of <dossiers> as a title writes it: its component's name, or its path.
247
+ // The components are read in the ticket's copy; when the copy does not load (a manifest a session
248
+ // left broken), in the main tree; when neither loads, each package keeps its path — a title is
249
+ // written whatever the state of the tree (scripts/circuit.mjs `planEtendu`).
247
250
  export function nomsDe(ctx, dossiers) {
248
- const liste = composantsDe(existsSync(ctx.copie) ? ctx.copie : ctx.racine);
251
+ let liste = [];
252
+ for (const base of [...(existsSync(ctx.copie) ? [ctx.copie] : []), ctx.racine]) {
253
+ try {
254
+ liste = composantsDe(base);
255
+ break;
256
+ } catch {
257
+ // This tree does not load: the next one is read.
258
+ }
259
+ }
249
260
  return dossiers.map(d => liste.find(p => p.dossier === d)?.pkg.name ?? d);
250
261
  }
251
262
 
@@ -0,0 +1,47 @@
1
+ // The durable verdict of a project's night: the night pass (scripts/nuit.sh) notes it at its end in
2
+ // `<git common dir>/nuit/verdict`, and the board reads it without a server. `vert` when the pass
3
+ // exits 0, `rouge` for any other code but 75 (a missing code included); 75 (« à repasser ») writes
4
+ // nothing and leaves the previous verdict. A read that fails gives no verdict.
5
+ import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
6
+ import path from 'node:path';
7
+ import { fileURLToPath } from 'node:url';
8
+
9
+ const CODE_A_REPASSER = 75;
10
+ const fichierDuVerdict = commun => path.join(commun, 'nuit', 'verdict');
11
+
12
+ /**
13
+ * @param {string} commun the git common dir of the project
14
+ * @param {number} code the exit code of the night pass
15
+ * @returns {'vert' | 'rouge' | null} the verdict written, null when the night is to be replayed
16
+ */
17
+ export function noterLeVerdict(commun, code) {
18
+ if (code === CODE_A_REPASSER) {
19
+ return null;
20
+ }
21
+ const verdict = code === 0 ? 'vert' : 'rouge';
22
+ mkdirSync(path.join(commun, 'nuit'), { recursive: true });
23
+ writeFileSync(fichierDuVerdict(commun), `${verdict}\n`);
24
+ return verdict;
25
+ }
26
+
27
+ /**
28
+ * @param {string | null} commun the git common dir of the project
29
+ * @returns {'vert' | 'rouge' | null} the last night's verdict, null when none is known or it does not read
30
+ */
31
+ export function lireLeVerdict(commun) {
32
+ if (!commun) {
33
+ return null;
34
+ }
35
+ try {
36
+ const v = readFileSync(fichierDuVerdict(commun), 'utf8').trim();
37
+ return v === 'vert' || v === 'rouge' ? v : null;
38
+ } catch {
39
+ return null;
40
+ }
41
+ }
42
+
43
+ // `node verdict-de-la-nuit.mjs <commun> <code>`: what nuit.sh calls at the end of the night.
44
+ if (process.argv[1] && fileURLToPath(import.meta.url) === path.resolve(process.argv[1])) {
45
+ const [commun, code] = process.argv.slice(2);
46
+ noterLeVerdict(commun, code === undefined || code === '' ? NaN : Number(code));
47
+ }
@@ -5,7 +5,7 @@ de lui : le premier pour chaque séance neuve du testwriter et du développeur,
5
5
  tout le ticket, dans l'enveloppe du plan du ticket, le lanceur ajoutant ses sections, chaque
6
6
  consigne portant les constats du relecteur qui restent ouverts pour son rôle, et, quand le
7
7
  superviseur relance le circuit avec `--contexte`, ce contexte en tête, comme sa tâche
8
- (`{{tache}}`), les constats ouverts au lancement de la passe devenant son contexte, après
8
+ (`{{tache}}` ; donné à un autre rôle par `--depuis <rôle>`, il se lit sous le nom de ce rôle, « LA TÂCHE DU SUPERVISEUR, donnée au … », et la séance en fait la part de son propre rôle), les constats ouverts au lancement de la passe devenant son contexte, après
9
9
  ceux qu'un `RENDU` pose dans la passe (`{{ouverts}}`, leur titre, et `{{constats}}`) ; le second pour chaque séance du relecteur, hors
10
10
  enveloppe, après la passe finale verte, qui porte la liste des éléments du lot, et après un `RENDU` la relecture d'avant (la
11
11
  commande de la différence entre le lot qu'elle a lu et celui d'aujourd'hui, ses fichiers, les