@roomi-fields/grillhouse 0.40.0 → 0.41.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.
- package/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +13 -1
- package/docs/ARCHITECTURE.md +3 -2
- package/docs/INTERFACE.md +4 -3
- package/hooks/register.tsx +13 -4
- package/package.json +1 -1
- package/scripts/activites.mjs +20 -4
- package/scripts/grillhouse-maj.mjs +27 -0
- package/scripts/langages/typescript/vitest-config/cibles.mjs +10 -5
- package/scripts/nuit.sh +3 -0
- package/scripts/prefixe-des-tickets.mjs +16 -2
- package/scripts/preparation.mjs +5 -8
- package/scripts/tableau.mjs +36 -1
- package/scripts/verdict-de-la-nuit.mjs +47 -0
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,18 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.41.0] - 2026-11-16
|
|
10
|
+
|
|
11
|
+
- **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.
|
|
12
|
+
|
|
13
|
+
- **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`.
|
|
14
|
+
|
|
15
|
+
- **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).
|
|
16
|
+
|
|
17
|
+
- **`/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.
|
|
18
|
+
|
|
19
|
+
- **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.
|
|
20
|
+
|
|
9
21
|
## [0.40.0] - 2026-11-15
|
|
10
22
|
|
|
11
23
|
- **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 +60,7 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and
|
|
|
48
60
|
|
|
49
61
|
- **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
62
|
|
|
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`
|
|
63
|
+
- **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
64
|
|
|
53
65
|
- **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
66
|
|
package/docs/ARCHITECTURE.md
CHANGED
|
@@ -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`
|
|
923
|
-
n'
|
|
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
|
|
package/docs/INTERFACE.md
CHANGED
|
@@ -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
|
|
387
|
-
clé vide remplacée, la clé absente ajoutée, la ligne écrite rendue, `null` pour une clé qui a sa
|
|
388
|
-
valeur
|
|
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
|
package/hooks/register.tsx
CHANGED
|
@@ -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
|
|
517
|
-
|
|
518
|
-
|
|
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
package/scripts/activites.mjs
CHANGED
|
@@ -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
|
-
|
|
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;
|
|
@@ -1603,11 +1607,23 @@ export function preuve(ctx, { mesure: derniere = null, fichiers: seuls = null }
|
|
|
1603
1607
|
}
|
|
1604
1608
|
}
|
|
1605
1609
|
}
|
|
1606
|
-
|
|
1610
|
+
// The files judged: those of the lot in the group, and, for a single integration binary that
|
|
1611
|
+
// plays its modules (Rust `tests/it/main.rs`), each module file the run reports — the group names
|
|
1612
|
+
// the binary, the results name the modules, so a module's reds are credited to the lot, and the
|
|
1613
|
+
// aggregator is no false casse. A package played whole (`entier`) keeps its own branch above.
|
|
1614
|
+
const fichiersDuGroupe = entier
|
|
1615
|
+
? groupe
|
|
1616
|
+
: [...new Set([...groupe, ...resultats.map(r => path.relative(ctx.copie, r.fichier))])];
|
|
1617
|
+
for (const f of fichiersDuGroupe) {
|
|
1607
1618
|
const res = resultats.find(t => t.fichier === path.join(ctx.copie, f));
|
|
1608
1619
|
const tests = res?.tests ?? [];
|
|
1609
1620
|
const deHead = vertsDuRegistre(registre, f);
|
|
1610
|
-
const casse = casseDeChargement({
|
|
1621
|
+
const casse = casseDeChargement({
|
|
1622
|
+
res,
|
|
1623
|
+
code,
|
|
1624
|
+
constructions,
|
|
1625
|
+
aDesResultats: resultats.length > 0,
|
|
1626
|
+
});
|
|
1611
1627
|
if (casse === 'non-joue') {
|
|
1612
1628
|
casses.push(
|
|
1613
1629
|
`${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>\`)`
|
|
@@ -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`);
|
|
@@ -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
|
|
44
|
-
// (`fileParallelism: false
|
|
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
|
|
307
|
-
* NUIT_TRANCHE, the tranche it carries of these
|
|
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
|
|
6
|
-
// (the
|
|
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
|
package/scripts/preparation.mjs
CHANGED
|
@@ -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
|
|
34
|
-
cwd:
|
|
35
|
-
|
|
36
|
-
|
|
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
|
}
|
package/scripts/tableau.mjs
CHANGED
|
@@ -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
|
-
|
|
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 =>
|
|
@@ -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
|
+
}
|