@roomi-fields/grillhouse 0.34.1 → 0.34.2
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 +14 -0
- package/cadre/templates/projet/_gitignore +1 -0
- package/cadre/templates/projet/package.json +2 -2
- package/dist/temporal/circuit/appel.d.ts +2 -0
- package/dist/temporal/circuit/appel.js +12 -0
- package/dist/temporal/circuit/appel.js.map +1 -1
- package/dist/temporal/circuit/commande.js +10 -1
- package/dist/temporal/circuit/commande.js.map +1 -1
- package/package.json +1 -1
- package/scripts/adresse-du-registre.mjs +10 -0
- package/scripts/attente-a-l-arret.mjs +2 -2
- package/scripts/attente-au-tour.mjs +2 -2
- package/scripts/bilan.mjs +5 -4
- package/scripts/branche-de-nuit.mjs +15 -6
- package/scripts/etapes.mjs +1 -1
- package/scripts/langages/cargo/sccache.mjs +22 -16
- package/scripts/langages/typescript/index.mjs +8 -4
- package/scripts/langages/typescript/migrations/0.34.1-cache-des-outils.mjs +53 -0
- package/scripts/langages/typescript/vitest-config/base.mjs +10 -0
- package/scripts/langages/typescript/vitest-config/registre.setup.mjs +35 -0
- package/scripts/registre.mjs +3 -3
- package/scripts/reponses-du-circuit.mjs +1 -1
- package/scripts/superviseur.mjs +24 -11
- package/scripts/tableau.mjs +71 -9
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,16 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.34.2] - 2026-11-12
|
|
10
|
+
|
|
11
|
+
- **The pre-push hook sees a green CI as soon as its run is green** (grillhouse-do5e): on 2026-11-12, main could not advance on a commit whose ticket branch CI was green, the hook asking GitHub for the runs of the commit filtered by `success`, a filter that lags the runs by minutes. It now lists the runs of the commit and reads each one's conclusion (`jugeeDansLesRuns`, scripts/branche-de-nuit.mjs). **Action for projects**: none.
|
|
12
|
+
|
|
13
|
+
- **A pass of the module cargo never joins the sccache server of another** (grillhouse-67dz): on 2026-11-12, every tranche of SyntHub's CI stopped on « sccache: Failed to create temp dir … No such file or directory » under the temporary directory of an earlier verification. The server was named after the copy and the namespace of processes alone, and a server cargo starts keeps the temporary directory of its run, which goes at the pass's end, while the server outlives it. Its socket now follows the run's temporary directory too (`socketDuServeur`, scripts/langages/cargo/sccache.mjs): each pass has its own server, the disk cache stays common. **Action for projects**: none.
|
|
14
|
+
|
|
15
|
+
- **A question that can only be settled later is deferred to its hour** (grillhouse-68a): on 2026-11-12, the question of a circuit that waited for a night test, which the owner had decided to play in the evening, came back at each relaunch of the wait (« toujours sans réponse »), and the stop hook refused the end of each turn; the only way out was to stop the circuit and take its label off. As a review's snooze hides a request until its hour, the supervisor now answers `npx grillhouse circuit <ticket> --reporter <heure> [--contexte <motif>]`: the ticket is deferred (`bd update --defer`), its circuit left waiting on its question, its state and its freed place kept; the wait, the stop hook and the opening keep its question quiet until the hour (`horsAttente`, scripts/superviseur.mjs, a ticket deferred to a later time counted as a closed one), then it goes up again; any other answer lifts the deferral. **Action for projects**: none.
|
|
16
|
+
|
|
17
|
+
- **FAITS AUJOURD'HUI counts the supervisor's tokens on a direct ticket, and leaves out a ticket closed with no delivery** (grillhouse-lcm1): every direct ticket showed 0 token, the board counting the agents the register ties to a ticket and never the supervisor's session, which leads a direct ticket; and a ticket closed as a duplicate counted as a fact. As the owner asks, the reading of a transcript keeps its tokens by minute, the board reads the supervisor's sessions of the repository touched since the day's marker (`jetonsDuSuperviseur`), and a direct ticket takes, from its claim to its close, each minute's share of the supervisor's tokens, shared among the direct tickets he holds at that minute (an estimate). A ticket closed with a link `duplicates` or `supersedes` (`bd duplicate`, `bd supersede`), or labelled `sans-suite`, has no line among the facts. **Action for projects**: close a ticket with no delivery by `bd duplicate`, `bd supersede`, or the label `sans-suite`.
|
|
18
|
+
|
|
9
19
|
## [0.34.1] - 2026-11-12
|
|
10
20
|
|
|
11
21
|
- **Pruning the debt no longer empties the debt of the guard of the migrations of the guards** (grillhouse-7jk): `npm run grillhouse:dette:elaguer`, run in a copy whose frame's scripts were another tree's (its `node_modules` linked to the main tree), emptied the whole section `migrations-des-gardes` of `grillhouse-dette.json`: the guard measures nothing outside the frame's own scripts, and pruning read that nothing as every finding corrected; the guard then turned red at the CI. As a baseline (ESLint, Betterer) only moves on what it measured, the guard no longer judges nor prunes its debt where it does not measure. **Action for projects**: none.
|
|
@@ -22,12 +32,16 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and
|
|
|
22
32
|
|
|
23
33
|
- **The board shows under AGENTS only the tickets at work, and its head counts the queue of the circuit apart from the direct one** (grillhouse-d7y): a ticket labelled `direct` had its line « ✎ … · en direct » as soon as it was open, so three tickets waiting their turn looked worked at once, and « en attente » in the head counted only the circuit's ready tickets without saying so. As the owner asks, a direct ticket now has its line only once claimed (several at once, each its line), and an open one counts in a new state, « en direct — mené hors du circuit, pas encore pris » (`fileDirecte`). The head of one project reads « ▶ <n> en cours · <n> bloqués · <n> faits », then « ⏭ file : <n> en circuit · <n> en direct »; a project's line among several, and the status line, « ▶ <n> en cours · ⏭ <n> · ✎ <n> · <n> faits ». **Action for projects**: none.
|
|
24
34
|
|
|
35
|
+
- **A test never writes into the poste's real register** (grillhouse-44b.16): a night test wrote 44 lines of trial repositories (`grillhouse-essais-lancer-nuit-*`) into `~/.claude/grillhouse/registre.jsonl`, the user's own state, where the report, the board and the planned nights then read them. As git's tests isolate every state of the user (a `HOME` of the trash directory), the base configuration of the tests now sets `GRILLHOUSE_REGISTRE` to a file under the pass's temporary folder, one per test file and removed at its end, only when the launch names none (a register a test or a launch names stays that one). The address of the register is built once, `REGISTRE` of `scripts/adresse-du-registre.mjs`, which reads `GRILLHOUSE_REGISTRE` first: `registre.mjs`, `bilan.mjs` and `tableau.mjs` import it instead of each rebuilding `~/.claude/grillhouse/registre.jsonl`, so the envelope launcher's end-of-session line (`registre.mjs --copie`) goes to the trial register as well. **Action for projects**: none.
|
|
36
|
+
|
|
25
37
|
- **FAITS AUJOURD'HUI says the way of each ticket done, its duration and its tokens** (grillhouse-592): every line of the day's done tickets began with ✓ and showed its time and tokens only when its agents had some, so a ticket led directly looked like a circuit and stood bare. As the owner's maquette asks, the sign now says the way: ● a full circuit, ○ a short one (through 1.1 Geste mécanique, read from the launch of object `geste` in the circuit's kept results, `voiesDesCircuits`), ✎ a direct ticket (labelled `direct`, or closed with no circuit). Every line carries « <duration> · <tokens> »: a circuit's working time, a direct ticket's time from its claim to its close (« — » without a claim), and the tokens of the agents the register ties to the ticket, the supervisor's staying out. The day's total in the title is unchanged. **Action for projects**: none.
|
|
26
38
|
|
|
27
39
|
## [0.34.0] - 2026-11-12
|
|
28
40
|
|
|
29
41
|
- **The board shows the night under way, the tickets worked in direct, and the memory of the poste** (grillhouse-bf5.9): a night that ran loaded the machine without a line on the board, and a ticket claimed with no circuit stood as a circuit at step 1, « attend une place ». As a dashboard shows every job that holds a machine, AGENTS now shows, under the line of the places, the night under way, « 🌙 nuit · <project> · depuis <duration> », read by the query of the workflow of the nights (`nuitDuServeur`, `scripts/circuits-du-serveur.mjs`; the view `etatDesNuits` gains `depuis`, when the night under way started), a reading that fails showing none; and each ticket claimed with no circuit on the server that holds it, a mother of it or a ticket under it (one that runs or waits for an answer; a circuit the supervisor stopped holds none), and each ticket labelled `direct`, open or claimed, once, out of the steps, « ✎ <number> <subject> · en direct · <assignee> », from its claim to its close (none while the circuits do not read). The line of the places says the available memory of the total, « mémoire 15/30 Go » (`memoireTotaleGo` of `etatDesPlaces`; the trial measure `GRILLHOUSE_MESURE_D_ESSAI` gains `memoireTotale`). Without a marker file, the board's first reading sets the day's marker to midnight and keeps it, so that only `grillhouse newday` moves it; a ticket waiting for a place turns yellow, as the other waits. A ticket led out of the circuit carries the label `direct`: the queue of the tickets never starts it, even labelled `circuit` (a label `bd create --parent` copies from its epic), as the charter's three ways of a ticket say. **Action for projects**: label `direct` a ticket led by hand.
|
|
30
42
|
|
|
43
|
+
- **The lint and the format check play in a session's envelope** (grillhouse-44b.5.7): `npm run lint` failed with EROFS on `node_modules/.cache/eslint/.eslintcache`, the envelope mounting `/` read-only and the `node_modules` of a copy being a link out of it. As Bazel's sandbox opens for writing what an action declares as output, and a tool's cache is one, the scripts `lint` and `format:check` (of the root and of the project template) now keep the cache of ESLint and Prettier under `.cache-outils/`, which the module typescript declares among its clean outputs (an empty folder proper to each session, a whole reading as without a cache) and keeps out of git (`.gitignore`, `_gitignore`); outside the envelope the cache lasts from one pass to the next. The migration « cache des outils » (0.34.1) rewrites the former path in the two scripts of a project, one line per rewrite. **Action for projects**: none; `grillhouse maj` moves the cache.
|
|
44
|
+
|
|
31
45
|
- **A queue of the tickets started before the journal of states replays again** (grillhouse-jye.5): the journal of states (grillhouse-4nr.20) added the activity `tracerLaFile` to the workflow of the queue of the tickets without Temporal's patching, so a history recorded before it no longer replayed (« Nondeterminism error: Activity machine does not handle this event: TimerStarted », the night of 2026-11-12), and a project's queue still running from before would fail at its next replay. As Temporal's versioning asks of a changed workflow, each line of the journal of the queue (a circuit started, a circuit ended) is now written under `patched('trace-de-la-file')`: a run recorded before the change replays without them, a new run writes them. **Action for projects**: none.
|
|
32
46
|
|
|
33
47
|
- **The testwriter decomposes a behaviour along the pyramid and plays the size guard before handing back** (grillhouse-d4n.6): the testwriter wrote big tests (git repositories mounted, a hook launched as a process) where the pyramid of sizes asks for the logic to be proved small, so the guard `tailles-des-tests` refused the big day test and the circuit looped (grillhouse-d4n.2, `attente-au-tour.spec.ts`). As Google's pyramid and Bazel's sizes want each test at the smallest size that proves its criterion, the skill now teaches to prove the logic by the interface of a module called in its process, to isolate the real launch in a night test only when the plan prescribes it, to take the interface from the plan or the package's `INTERFACE.md` (ending on BESOIN when none publishes the behaviour), and to play `npx grillhouse tailles-des-tests` before handing back, decomposing a refused big day test itself; its rights gain that command, with no wildcard, and no other role gains it. **Action for projects**: none.
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
"test": "grillhouse tests",
|
|
20
20
|
"test:watch": "vitest",
|
|
21
21
|
"test:coverage": "vitest run --coverage",
|
|
22
|
-
"lint": "eslint src tests --cache --cache-location
|
|
22
|
+
"lint": "eslint src tests --cache --cache-location .cache-outils/eslint/.eslintcache --ext .ts,.js,.mjs",
|
|
23
23
|
"lint:fix": "eslint src tests --ext .ts,.js,.mjs --fix",
|
|
24
24
|
"format": "prettier --write \"src/**/*.{ts,js,mjs}\" \"tests/**/*.{ts,js,mjs}\"",
|
|
25
|
-
"format:check": "prettier --check --cache --cache-location
|
|
25
|
+
"format:check": "prettier --check --cache --cache-location .cache-outils/prettier/.prettiercache \"src/**/*.{ts,js,mjs}\" \"tests/**/*.{ts,js,mjs}\"",
|
|
26
26
|
"prepare": "grillhouse hooks && npm run build",
|
|
27
27
|
"prepublishOnly": "npm run lint && npm run typecheck && npm run verifier && npm run build",
|
|
28
28
|
"daemon:start": "pm2 start ecosystem.config.cjs",
|
|
@@ -10,6 +10,8 @@ export interface Appel {
|
|
|
10
10
|
depuis: (typeof ETAPES_DE_REPRISE)[number] | null;
|
|
11
11
|
etendre: string[] | null;
|
|
12
12
|
arreter: boolean;
|
|
13
|
+
/** The hour its question waits for (`bd update --defer`), the circuit left in its wait. */
|
|
14
|
+
reporter: string | null;
|
|
13
15
|
recommencer: boolean;
|
|
14
16
|
contexte: string | null;
|
|
15
17
|
}
|
|
@@ -4,6 +4,7 @@ import { ETAPES_DE_REPRISE } from './contrat.js';
|
|
|
4
4
|
export const USAGE = 'usage: npx grillhouse circuit <ticket> [--reprendre [--contexte <texte>] | ' +
|
|
5
5
|
'--depuis <testwriter|preuve|developpeur|controles|passe-finale> --contexte <texte> | ' +
|
|
6
6
|
'--etendre <paquet>[,<paquet>…] [--contexte <texte>] | --arreter [--contexte <motif>] | ' +
|
|
7
|
+
'--reporter <heure> [--contexte <motif>] | ' +
|
|
7
8
|
'--recommencer]\n';
|
|
8
9
|
/** A malformed call, by its reason. */
|
|
9
10
|
export class Usage extends Error {
|
|
@@ -20,6 +21,7 @@ export function lireLAppel(argv) {
|
|
|
20
21
|
depuis: null,
|
|
21
22
|
etendre: null,
|
|
22
23
|
arreter: false,
|
|
24
|
+
reporter: null,
|
|
23
25
|
recommencer: false,
|
|
24
26
|
contexte: null,
|
|
25
27
|
};
|
|
@@ -32,6 +34,13 @@ export function lireLAppel(argv) {
|
|
|
32
34
|
else if (a === '--arreter') {
|
|
33
35
|
o.arreter = true;
|
|
34
36
|
}
|
|
37
|
+
else if (a === '--reporter') {
|
|
38
|
+
if (suivant === undefined || suivant.startsWith('-')) {
|
|
39
|
+
throw new Usage('--reporter attend son heure (+6h, demain, 2026-11-13 08:00).');
|
|
40
|
+
}
|
|
41
|
+
o.reporter = suivant;
|
|
42
|
+
i++;
|
|
43
|
+
}
|
|
35
44
|
else if (a === '--recommencer') {
|
|
36
45
|
o.recommencer = true;
|
|
37
46
|
}
|
|
@@ -73,6 +82,9 @@ export function lireLAppel(argv) {
|
|
|
73
82
|
if (!ticket) {
|
|
74
83
|
throw new Usage('le ticket manque.');
|
|
75
84
|
}
|
|
85
|
+
if (o.reporter && (o.reprendre || o.depuis || o.etendre || o.arreter || o.recommencer)) {
|
|
86
|
+
throw new Usage('--reporter va seule, son motif en --contexte : le circuit reste en attente.');
|
|
87
|
+
}
|
|
76
88
|
if (o.recommencer && (o.reprendre || o.depuis || o.etendre || o.arreter)) {
|
|
77
89
|
throw new Usage('--recommencer va seule : le circuit repart à neuf, sans réponse ni contexte.');
|
|
78
90
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appel.js","sourceRoot":"","sources":["../../../src/temporal/circuit/appel.ts"],"names":[],"mappings":"AAAA,sGAAsG;AACtG,iFAAiF;AACjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEjD,MAAM,CAAC,MAAM,KAAK,GAChB,6EAA6E;IAC7E,uFAAuF;IACvF,yFAAyF;IAC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AAC;QACpC,MAAM,IAAI,KAAK,CAAC,mEAAmE,CAAC,CAAC;IACvF,CAAC;IACD,IAAI,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;QACxD,MAAM,IAAI,KAAK,CACb,kFAAkF,CACnF,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;QAC3C,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;IAClE,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC;AAC1B,CAAC"}
|
|
@@ -102,6 +102,13 @@ async function mettreEnFile(client, racine, ticket, recommence = false) {
|
|
|
102
102
|
// The answer <appel> to the circuit of its ticket in <racine>: its line.
|
|
103
103
|
async function repondre(client, racine, appel) {
|
|
104
104
|
const { ticket, contexte } = appel;
|
|
105
|
+
if (appel.reporter) {
|
|
106
|
+
// The ticket deferred, its circuit left waiting on its question: the wait, the stop and the
|
|
107
|
+
// opening keep it quiet until the hour (scripts/superviseur.mjs `horsAttente`).
|
|
108
|
+
bd(racine, 'update', ticket, '--defer', appel.reporter);
|
|
109
|
+
bd(racine, 'comments', 'add', ticket, `Question reportée au ${appel.reporter}${contexte ? ` : ${contexte}` : ''} ; le circuit reste en attente, sa question remonte à l'heure.`);
|
|
110
|
+
return `▶ Circuit de ${ticket} : sa question est reportée au ${appel.reporter} ; le circuit reste en attente, sa question remonte à l'heure.`;
|
|
111
|
+
}
|
|
105
112
|
if (appel.arreter) {
|
|
106
113
|
await arreterLeCircuit(client, racine, ticket, contexte);
|
|
107
114
|
return `▶ Circuit de ${ticket} : l'arrêt est demandé ; il s'arrête, sa séance avec lui.`;
|
|
@@ -112,6 +119,8 @@ async function repondre(client, racine, appel) {
|
|
|
112
119
|
const { resoudre } = aLaPorte(() => ticketAuLancement(racine, ticket, { arreter: true }));
|
|
113
120
|
aLaPorte(() => appel.etendre.forEach(resoudre));
|
|
114
121
|
}
|
|
122
|
+
// An answer lifts a deferral of the question.
|
|
123
|
+
bd(racine, 'update', ticket, '--defer', '');
|
|
115
124
|
const ou = { superviseur: seanceDuSuperviseur() };
|
|
116
125
|
const dit = appel.depuis
|
|
117
126
|
? await reprendreDepuis(client, racine, ticket, appel.depuis, contexte, ou)
|
|
@@ -140,7 +149,7 @@ async function principal(argv) {
|
|
|
140
149
|
const racine = arbrePrincipal();
|
|
141
150
|
const c = ouvrirLeClient();
|
|
142
151
|
try {
|
|
143
|
-
const repond = appel.reprendre || appel.depuis || appel.etendre || appel.arreter;
|
|
152
|
+
const repond = appel.reprendre || appel.depuis || appel.etendre || appel.arreter || appel.reporter;
|
|
144
153
|
let ligne;
|
|
145
154
|
if (appel.recommencer) {
|
|
146
155
|
const retiree = await recommencerLeCircuit(c.client, racine, appel.ticket, retirerLaCopieDuTicket);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commande.js","sourceRoot":"","sources":["../../../src/temporal/circuit/commande.ts"],"names":[],"mappings":";AACA,gGAAgG;AAChG,2CAA2C;AAC3C,EAAE;AACF,8FAA8F;AAC9F,iEAAiE;AACjE,qFAAqF;AACrF,oFAAoF;AACpF,+DAA+D;AAC/D,8CAA8C;AAC9C,EAAE;AACF,8FAA8F;AAC9F,qFAAqF;AACrF,kGAAkG;AAClG,+FAA+F;AAC/F,mGAAmG;AACnG,qGAAqG;AACrG,+FAA+F;AAC/F,kGAAkG;AAClG,gGAAgG;AAChG,iBAAiB;AACjB,iGAAiG;AACjG,iGAAiG;AACjG,iLAAiL;AACjL,mGAAmG;AACnG,mGAAmG;AACnG,oGAAoG;AACpG,gEAAgE;AAChE,8FAA8F;AAC9F,8FAA8F;AAC9F,2FAA2F;AAC3F,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AA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M,gBAAgB,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC;QACvC,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,KAAK,aAAa,CAAC,kBAAkB,CAAC,QAAQ,OAAO,8DAA8D,CACpH,CAAC;QACF,OAAO,CAAC,CAAC;IACX,CAAC;IACD,MAAM,MAAM,GAAG,cAAc,EAAE,CAAC;IAChC,MAAM,CAAC,GAAG,cAAc,EAAE,CAAC;IAC3B,IAAI,CAAC;QACH,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"commande.js","sourceRoot":"","sources":["../../../src/temporal/circuit/commande.ts"],"names":[],"mappings":";AACA,gGAAgG;AAChG,2CAA2C;AAC3C,EAAE;AACF,8FAA8F;AAC9F,iEAAiE;AACjE,qFAAqF;AACrF,oFAAoF;AACpF,+DAA+D;AAC/D,8CAA8C;AAC9C,EAAE;AACF,8FAA8F;AAC9F,qFAAqF;AACrF,kGAAkG;AAClG,+FAA+F;AAC/F,mGAAmG;AACnG,qGAAqG;AACrG,+FAA+F;AAC/F,kGAAkG;AAClG,gGAAgG;AAChG,iBAAiB;AACjB,iGAAiG;AACjG,iGAAiG;AACjG,iLAAiL;AACjL,mGAAmG;AACnG,mGAAmG;AACnG,oGAAoG;AACpG,gEAAgE;AAChE,8FAA8F;AAC9F,8FAA8F;AAC9F,2FAA2F;AAC3F,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AACxF,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,GACjB,MAAM,cAAc,CAAC;A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CAAC,GAAG,KAAK,IAAI,CAAC,CAAC;QACnC,OAAO,CAAC,CAAC;IACX,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,IAAI,CAAC,YAAY,cAAc,EAAE,CAAC;YAChC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC;YACzC,OAAO,CAAC,CAAC;QACX,CAAC;QACD,MAAM,CAAC,CAAC;IACV,CAAC;YAAS,CAAC;QACT,MAAM,CAAC,CAAC,MAAM,EAAE,CAAC;IACnB,CAAC;AACH,CAAC;AAED,wFAAwF;AACxF,MAAM,OAAO,GAAG,CAAC,CAAU,EAAU,EAAE,CACrC,CAAC,YAAY,KAAK;IAChB,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;IAC/E,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAEhB,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CACnC,IAAI,CAAC,EAAE;IACL,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;AAC1B,CAAC,EACD,CAAC,CAAU,EAAE,EAAE;IACb,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,0BAA0B,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAC/D,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACvB,CAAC,CACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// The one address of the register of finished agents: GRILLHOUSE_REGISTRE first, else the
|
|
2
|
+
// workstation's `~/.claude/grillhouse/registre.jsonl`. A module of its own, imported by every
|
|
3
|
+
// reader and writer of the register (scripts/registre.mjs re-exports it), so that bilan.mjs and
|
|
4
|
+
// tableau.mjs read it without a cycle through registre.mjs.
|
|
5
|
+
import os from 'node:os';
|
|
6
|
+
import path from 'node:path';
|
|
7
|
+
|
|
8
|
+
export const REGISTRE =
|
|
9
|
+
process.env.GRILLHOUSE_REGISTRE ??
|
|
10
|
+
path.join(os.homedir(), '.claude', 'grillhouse', 'registre.jsonl');
|
|
@@ -29,7 +29,7 @@ import path from 'node:path';
|
|
|
29
29
|
import { pathToFileURL } from 'node:url';
|
|
30
30
|
import { racineDeLaSupervision } from './attente-au-tour.mjs';
|
|
31
31
|
import { circuitsDuServeur } from './circuits-du-serveur.mjs';
|
|
32
|
-
import { questionsEnAttente,
|
|
32
|
+
import { questionsEnAttente, ticketsHorsAttente } from './superviseur.mjs';
|
|
33
33
|
import { attenteVivante } from './tableau.mjs';
|
|
34
34
|
|
|
35
35
|
// The note of what blocked the stop in the repository at <racine>.
|
|
@@ -62,7 +62,7 @@ export async function attenteALArret(
|
|
|
62
62
|
dossier,
|
|
63
63
|
{
|
|
64
64
|
env = process.env,
|
|
65
|
-
fermes =
|
|
65
|
+
fermes = ticketsHorsAttente,
|
|
66
66
|
circuitsDe = circuitsDuServeur,
|
|
67
67
|
attenteVit = attenteVivante,
|
|
68
68
|
} = {}
|
|
@@ -20,7 +20,7 @@ import path from 'node:path';
|
|
|
20
20
|
import { pathToFileURL } from 'node:url';
|
|
21
21
|
import { circuitsDuServeur } from './circuits-du-serveur.mjs';
|
|
22
22
|
import { vivant } from './mesure/base-de-passe.mjs';
|
|
23
|
-
import { questionsEnAttente,
|
|
23
|
+
import { questionsEnAttente, ticketsHorsAttente, verrouDeLAttente } from './superviseur.mjs';
|
|
24
24
|
|
|
25
25
|
// The process that the lock of the wait of the repository at <racine> names; null without a lock.
|
|
26
26
|
function tenant(racine) {
|
|
@@ -71,7 +71,7 @@ export function racineDeLaSupervision(dossier, env = process.env) {
|
|
|
71
71
|
*/
|
|
72
72
|
export async function attenteAuTour(
|
|
73
73
|
dossier,
|
|
74
|
-
{ env = process.env, fermes =
|
|
74
|
+
{ env = process.env, fermes = ticketsHorsAttente, circuitsDe = circuitsDuServeur } = {}
|
|
75
75
|
) {
|
|
76
76
|
const racine = racineDeLaSupervision(dossier, env);
|
|
77
77
|
if (!racine) {
|
package/scripts/bilan.mjs
CHANGED
|
@@ -96,6 +96,7 @@ import {
|
|
|
96
96
|
import os from 'node:os';
|
|
97
97
|
import path from 'node:path';
|
|
98
98
|
import { StringDecoder } from 'node:string_decoder';
|
|
99
|
+
import { REGISTRE } from './adresse-du-registre.mjs';
|
|
99
100
|
import { pathToFileURL } from 'node:url';
|
|
100
101
|
import {
|
|
101
102
|
AGENTS_DU_LOT,
|
|
@@ -706,10 +707,10 @@ function messagesDeLaSeance(seance) {
|
|
|
706
707
|
// circuit kept, where its circuit ended (<fin>, `{ etape, raison, code }`, null while it runs), and
|
|
707
708
|
// the owner's messages in the supervisor's sessions its stops name unless <responsable> is false.
|
|
708
709
|
function calculer(racine, ticket, fin, { responsable = true } = {}) {
|
|
709
|
-
const
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
710
|
+
const lignes = lignesDuProjet(
|
|
711
|
+
existsSync(REGISTRE) ? readFileSync(REGISTRE, 'utf8') : '',
|
|
712
|
+
racine
|
|
713
|
+
);
|
|
713
714
|
const fiches = path.join(dossier(racine), `${ticket}.fiches.jsonl`);
|
|
714
715
|
const entrees = (existsSync(fiches) ? readFileSync(fiches, 'utf8') : '')
|
|
715
716
|
.split('\n')
|
|
@@ -52,19 +52,28 @@ export function refusSurMain(remote, refs, { principale, ecoute, jugee }) {
|
|
|
52
52
|
);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
+
/**
|
|
56
|
+
* Whether one of the runs <runs> of a commit (`gh run list --json headBranch,conclusion`)
|
|
57
|
+
* concluded green on a ticket branch. The conclusion is read run by run: the status filter of
|
|
58
|
+
* GitHub's API lags its runs by minutes (grillhouse-do5e).
|
|
59
|
+
* @param {{ headBranch?: string, conclusion?: string }[]} runs
|
|
60
|
+
*/
|
|
61
|
+
export const jugeeDansLesRuns = runs =>
|
|
62
|
+
runs.some(x => x.conclusion === 'success' && String(x.headBranch).startsWith('agent/'));
|
|
63
|
+
|
|
55
64
|
// Whether a run of the CI concluded green on the commit <sha> on a ticket branch, read by gh in
|
|
56
65
|
// <racine>; true when gh does not answer (the server's ruleset judges then).
|
|
57
66
|
function jugeeParGh(racine, sha) {
|
|
58
|
-
const r = spawnSync(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
);
|
|
67
|
+
const r = spawnSync('gh', ['run', 'list', '--commit', sha, '--json', 'headBranch,conclusion'], {
|
|
68
|
+
cwd: racine,
|
|
69
|
+
encoding: 'utf8',
|
|
70
|
+
timeout: 30_000,
|
|
71
|
+
});
|
|
63
72
|
if (r.status !== 0) {
|
|
64
73
|
return true;
|
|
65
74
|
}
|
|
66
75
|
try {
|
|
67
|
-
return JSON.parse(r.stdout || '[]')
|
|
76
|
+
return jugeeDansLesRuns(JSON.parse(r.stdout || '[]'));
|
|
68
77
|
} catch {
|
|
69
78
|
return true;
|
|
70
79
|
}
|
package/scripts/etapes.mjs
CHANGED
|
@@ -254,7 +254,7 @@ export const RESPONSABLE = 'responsable';
|
|
|
254
254
|
// The commands by which the supervisor answers a question (scripts/circuit.mjs): resume, extend
|
|
255
255
|
// the plan, stop.
|
|
256
256
|
const REPONSES =
|
|
257
|
-
'Le superviseur répond par une commande du circuit : `--reprendre` (avec `--contexte`) ou `--depuis <testwriter|developpeur>` (avec `--contexte`), `--etendre <paquet>` (le plan gagne ce paquet, puis l’étape en cours reprend), ou `--arreter`.';
|
|
257
|
+
'Le superviseur répond par une commande du circuit : `--reprendre` (avec `--contexte`) ou `--depuis <testwriter|developpeur>` (avec `--contexte`), `--etendre <paquet>` (le plan gagne ce paquet, puis l’étape en cours reprend), `--reporter <heure>` (la question se tait jusqu’à l’heure, le circuit en attente), ou `--arreter`.';
|
|
258
258
|
|
|
259
259
|
// The question of each stop no gesture settles, as a CI calls a person only for what no rule
|
|
260
260
|
// settles (the approval of a review): every stop of ARRETS, « a-repasser » once the circuit has
|
|
@@ -23,16 +23,20 @@
|
|
|
23
23
|
// Every command of the module that compiles (tests, verification, typing, clippy) runs cargo
|
|
24
24
|
// under this environment, in a copy as in an agent's envelope.
|
|
25
25
|
//
|
|
26
|
-
// - One server per copy and per namespace of processes: by default the
|
|
27
|
-
// on 127.0.0.1:4226 (README of v0.19.0), one for the whole machine, and
|
|
28
|
-
// network, so that a server born in one agent's envelope would serve
|
|
29
|
-
// outside would compile for an agent out of his envelope. Each run
|
|
30
|
-
// (`SCCACHE_SERVER_UDS`), an abstract unix socket (the README's
|
|
31
|
-
// the copy
|
|
32
|
-
//
|
|
33
|
-
//
|
|
34
|
-
//
|
|
35
|
-
//
|
|
26
|
+
// - One server per copy, per temporary directory and per namespace of processes: by default the
|
|
27
|
+
// server of sccache listens on 127.0.0.1:4226 (README of v0.19.0), one for the whole machine, and
|
|
28
|
+
// the envelope shares the network, so that a server born in one agent's envelope would serve
|
|
29
|
+
// another copy, and one born outside would compile for an agent out of his envelope. Each run
|
|
30
|
+
// names its server's socket (`SCCACHE_SERVER_UDS`), an abstract unix socket (the README's
|
|
31
|
+
// `\x00<name>` form), named after the copy, the temporary directory of the run (TMPDIR) and the
|
|
32
|
+
// namespace of processes it runs in (`/proc/self/ns/pid`), which each envelope creates
|
|
33
|
+
// (`--unshare-pid`): the two sides of an envelope, and two envelopes of one copy, never share a
|
|
34
|
+
// server, whatever the environment says. An abstract socket writes no file, so that neither the
|
|
35
|
+
// read-only copy nor the 108 bytes of a socket's path bind it, and it goes with its server,
|
|
36
|
+
// leaving no stale file. A server cargo starts keeps the temporary directory of its run, where it
|
|
37
|
+
// writes as it compiles, and outlives it (its idle time): a pass, whose temporary directory goes
|
|
38
|
+
// at its end, never joins the server of another (SyntHub, grillhouse-67dz). The disk cache stays
|
|
39
|
+
// common.
|
|
36
40
|
// - The server starts before each run of cargo that compiles, under the machine's `/tmp`
|
|
37
41
|
// (`demarrerLeServeur`): sccache 0.19.0 starts its server by binding a socket of a path under
|
|
38
42
|
// TMPDIR (`<TMPDIR>/sccacheXXXXXX/sock`, src/commands.rs, `run_server_process`), which fails
|
|
@@ -51,7 +55,7 @@ import { spawnSync } from 'node:child_process';
|
|
|
51
55
|
import { createHash } from 'node:crypto';
|
|
52
56
|
import { readFileSync, readlinkSync, realpathSync } from 'node:fs';
|
|
53
57
|
import { createRequire } from 'node:module';
|
|
54
|
-
import { homedir } from 'node:os';
|
|
58
|
+
import { homedir, tmpdir } from 'node:os';
|
|
55
59
|
import path from 'node:path';
|
|
56
60
|
import {
|
|
57
61
|
cacheDeCompilation,
|
|
@@ -122,14 +126,16 @@ const reel = p => {
|
|
|
122
126
|
};
|
|
123
127
|
|
|
124
128
|
/**
|
|
125
|
-
* The socket of the server of sccache for the copy at <racine
|
|
126
|
-
* <espace>: an abstract unix socket, named after
|
|
129
|
+
* The socket of the server of sccache for the copy at <racine>, the temporary directory
|
|
130
|
+
* <temporaire> and the namespace of processes <espace>: an abstract unix socket, named after the
|
|
131
|
+
* three.
|
|
127
132
|
* @param {string} racine
|
|
133
|
+
* @param {string} temporaire the temporary directory of the run (its TMPDIR)
|
|
128
134
|
* @param {string} [espace] this process's namespace by default
|
|
129
135
|
*/
|
|
130
|
-
export function socketDuServeur(racine, espace = espaceDesProcessus()) {
|
|
136
|
+
export function socketDuServeur(racine, temporaire, espace = espaceDesProcessus()) {
|
|
131
137
|
const empreinte = createHash('sha256')
|
|
132
|
-
.update(`${reel(racine)}\0${espace}`)
|
|
138
|
+
.update(`${reel(racine)}\0${reel(temporaire)}\0${espace}`)
|
|
133
139
|
.digest('hex');
|
|
134
140
|
return `\\x00grillhouse-sccache-${empreinte.slice(0, 16)}`;
|
|
135
141
|
}
|
|
@@ -244,6 +250,6 @@ export function avecSccache(racine, env) {
|
|
|
244
250
|
...cible,
|
|
245
251
|
RUSTC_WRAPPER: 'sccache',
|
|
246
252
|
SCCACHE_DIR: cacheDeCompilation('sccache', env),
|
|
247
|
-
SCCACHE_SERVER_UDS: socketDuServeur(racine),
|
|
253
|
+
SCCACHE_SERVER_UDS: socketDuServeur(racine, env.TMPDIR || tmpdir()),
|
|
248
254
|
};
|
|
249
255
|
}
|
|
@@ -72,6 +72,7 @@ import * as prefixeDesTickets from './migrations/0.30.0-prefixe-des-tickets.mjs'
|
|
|
72
72
|
import * as titresNommantUnTicket from './migrations/0.30.0-titres-nommant-un-ticket.mjs';
|
|
73
73
|
import * as binaireDeJour from './migrations/0.33.0-binaire-de-jour.mjs';
|
|
74
74
|
import * as testsDuPoste from './migrations/0.33.0-tests-du-poste.mjs';
|
|
75
|
+
import * as cacheDesOutils from './migrations/0.34.1-cache-des-outils.mjs';
|
|
75
76
|
|
|
76
77
|
// The scripts of this module, beside this file.
|
|
77
78
|
const SCRIPTS = path.dirname(fileURLToPath(import.meta.url));
|
|
@@ -208,16 +209,18 @@ export default {
|
|
|
208
209
|
// No program the installer of Temporal looks for: Node is a tool of the account.
|
|
209
210
|
executables: [],
|
|
210
211
|
// What its tools write in a project: Turborepo's runs and cache, and Vitest's reports of the
|
|
211
|
-
// tranches of a pass (./tranches.mjs)
|
|
212
|
-
|
|
212
|
+
// tranches of a pass (./tranches.mjs), and the cache of the lint and of the format check of the
|
|
213
|
+
// project (`.cache-outils/`).
|
|
214
|
+
ignorer: ['.turbo', '.vitest-reports', '.cache-outils'],
|
|
213
215
|
// Where its tools write: the cache of Turborepo in the main tree, shared by every copy, written;
|
|
214
216
|
// the logs of Turborepo's tasks (`.turbo/turbo-<task>.log`, written on every run, a task replayed
|
|
215
217
|
// from its cache included, and which no option of Turborepo sends elsewhere) and the cache of
|
|
216
218
|
// Vite, where Vitest writes the results of a run (`node_modules/.vite/vitest/`) and whose failure
|
|
217
|
-
// fails it, proper to the session
|
|
219
|
+
// fails it, proper to the session; and the cache of ESLint and Prettier (`.cache-outils/`),
|
|
220
|
+
// proper to the session too, an empty one costing a whole reading, as without a cache.
|
|
218
221
|
sorties: {
|
|
219
222
|
ecrites: ['//.turbo/cache/'],
|
|
220
|
-
propres: ['.turbo', 'node_modules/.vite'],
|
|
223
|
+
propres: ['.turbo', 'node_modules/.vite', '.cache-outils'],
|
|
221
224
|
lues: [],
|
|
222
225
|
},
|
|
223
226
|
// The test tool run directly, Vitest or Turborepo that plays it: `npm test` and `npm run
|
|
@@ -350,6 +353,7 @@ export default {
|
|
|
350
353
|
titresNommantUnTicket,
|
|
351
354
|
binaireDeJour,
|
|
352
355
|
testsDuPoste,
|
|
356
|
+
cacheDesOutils,
|
|
353
357
|
],
|
|
354
358
|
miseAJour: miseAJour(joueDesTests),
|
|
355
359
|
squelette,
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// From 0.34.1 the cache of the lint and of the format check lives under `.cache-outils/`, a clean
|
|
2
|
+
// output of the module typescript, no longer under `node_modules/.cache/`: a session's envelope
|
|
3
|
+
// mounts `/` read-only and the `node_modules` of a copy is a link out of it, so ESLint and
|
|
4
|
+
// Prettier failed to write their cache there (EROFS). The migration moves it in a project.
|
|
5
|
+
//
|
|
6
|
+
// - In the `lint` and `format:check` scripts of `package.json`, the former path
|
|
7
|
+
// (`node_modules/.cache/`) is replaced by the new one (`.cache-outils/`), wherever it falls;
|
|
8
|
+
// every other byte of the file stays, and every other script is left.
|
|
9
|
+
// - One line per script rewritten; a project without `package.json`, or whose scripts lack the
|
|
10
|
+
// former path, is left, nothing said.
|
|
11
|
+
// - Replayable without effect: once moved, nothing.
|
|
12
|
+
import { existsSync, readFileSync, writeFileSync } from 'node:fs';
|
|
13
|
+
import path from 'node:path';
|
|
14
|
+
|
|
15
|
+
export const version = '0.34.1';
|
|
16
|
+
export const nom = 'cache des outils';
|
|
17
|
+
|
|
18
|
+
const ANCIEN = 'node_modules/.cache/';
|
|
19
|
+
const NOUVEAU = '.cache-outils/';
|
|
20
|
+
const SCRIPTS = ['lint', 'format:check'];
|
|
21
|
+
|
|
22
|
+
/** Moves the cache path of the `lint` and `format:check` scripts of <projet>; returns its lines. */
|
|
23
|
+
export function migrer(projet) {
|
|
24
|
+
const fichier = path.join(projet, 'package.json');
|
|
25
|
+
if (!existsSync(fichier)) {
|
|
26
|
+
return [];
|
|
27
|
+
}
|
|
28
|
+
let texte = readFileSync(fichier, 'utf8');
|
|
29
|
+
const debut = texte.indexOf('"scripts"');
|
|
30
|
+
if (debut === -1) {
|
|
31
|
+
return [];
|
|
32
|
+
}
|
|
33
|
+
const lignes = [];
|
|
34
|
+
for (const script of SCRIPTS) {
|
|
35
|
+
const motif = new RegExp(`("${script}"\\s*:\\s*")((?:[^"\\\\]|\\\\.)*)(")`);
|
|
36
|
+
const trouve = motif.exec(texte.slice(debut));
|
|
37
|
+
if (!trouve || !trouve[2].includes(ANCIEN)) {
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
const place = debut + trouve.index + trouve[1].length;
|
|
41
|
+
texte =
|
|
42
|
+
texte.slice(0, place) +
|
|
43
|
+
trouve[2].replaceAll(ANCIEN, NOUVEAU) +
|
|
44
|
+
texte.slice(place + trouve[2].length);
|
|
45
|
+
lignes.push(
|
|
46
|
+
`package.json : le cache du script ${script} passe de ${ANCIEN} à ${NOUVEAU}, une sortie propre de la séance`
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
if (lignes.length > 0) {
|
|
50
|
+
writeFileSync(fichier, texte);
|
|
51
|
+
}
|
|
52
|
+
return lignes;
|
|
53
|
+
}
|
|
@@ -65,6 +65,8 @@
|
|
|
65
65
|
// scripts/mesure/avancement.mjs), the reporter of progress writes there the files done and planned of its
|
|
66
66
|
// task at each test file done, which the board reads (scripts/avancement.mjs,
|
|
67
67
|
// scripts/tableau.mjs).
|
|
68
|
+
import { readdirSync, rmSync } from 'node:fs';
|
|
69
|
+
import path from 'node:path';
|
|
68
70
|
import { fileURLToPath } from 'node:url';
|
|
69
71
|
import {
|
|
70
72
|
ligneDesRestes,
|
|
@@ -120,6 +122,13 @@ function baseDeVitest() {
|
|
|
120
122
|
Object.assign(process.env, b.env);
|
|
121
123
|
retirerALInterruption(b.fermer);
|
|
122
124
|
process.on('exit', () => {
|
|
125
|
+
// The registers of the test files (registre.setup.mjs): a file whose tests are all skipped
|
|
126
|
+
// runs no `afterAll`, so its register directory goes with the base, not as a rest.
|
|
127
|
+
for (const n of readdirSync(b.dossier)) {
|
|
128
|
+
if (n.startsWith('grillhouse-registre-')) {
|
|
129
|
+
rmSync(path.join(b.dossier, n),{ recursive: true, force: true });
|
|
130
|
+
}
|
|
131
|
+
}
|
|
123
132
|
const ligne = ligneDesRestes([
|
|
124
133
|
...b.restes().filter(n => !CACHES_DES_OUTILS.has(n)),
|
|
125
134
|
...b.essais(),
|
|
@@ -154,6 +163,7 @@ export default {
|
|
|
154
163
|
ici('./mesure.setup.mjs'),
|
|
155
164
|
ici('./machine.setup.mjs'),
|
|
156
165
|
ici('./resultats.setup.mjs'),
|
|
166
|
+
ici('./registre.setup.mjs'),
|
|
157
167
|
],
|
|
158
168
|
watch: false,
|
|
159
169
|
...travailleurs(),
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// A setup file of the base configuration: a test file's register is its own, as git's tests give
|
|
2
|
+
// each test a HOME of its own. When the launch names no register (`GRILLHOUSE_REGISTRE`), the file
|
|
3
|
+
// names one under a directory of its own in the temporary directory, which every process the test
|
|
4
|
+
// starts inherits (scripts/registre.mjs reads the variable first); the directory is removed at the
|
|
5
|
+
// end of the test file, and at the exit of the process for one made inside a running test. A
|
|
6
|
+
// register the launch names stays.
|
|
7
|
+
import { mkdtempSync, rmSync } from 'node:fs';
|
|
8
|
+
import { tmpdir } from 'node:os';
|
|
9
|
+
import path from 'node:path';
|
|
10
|
+
import { afterAll, onTestFinished } from 'vitest';
|
|
11
|
+
|
|
12
|
+
const DOSSIERS = (globalThis.__grillhouseRegistresDEssai ??= new Set());
|
|
13
|
+
if (DOSSIERS.size === 0) {
|
|
14
|
+
process.on('exit', () => {
|
|
15
|
+
for (const d of DOSSIERS) {
|
|
16
|
+
rmSync(d, { recursive: true, force: true });
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (!process.env.GRILLHOUSE_REGISTRE) {
|
|
22
|
+
const dossier = mkdtempSync(path.join(tmpdir(), 'grillhouse-registre-'));
|
|
23
|
+
DOSSIERS.add(dossier);
|
|
24
|
+
process.env.GRILLHOUSE_REGISTRE = path.join(dossier, 'essai.jsonl');
|
|
25
|
+
const retirer = () => {
|
|
26
|
+
rmSync(dossier, { recursive: true, force: true });
|
|
27
|
+
DOSSIERS.delete(dossier);
|
|
28
|
+
};
|
|
29
|
+
try {
|
|
30
|
+
// Imported inside a running test (a test of this file's behavior): the end of that test.
|
|
31
|
+
onTestFinished(retirer);
|
|
32
|
+
} catch {
|
|
33
|
+
afterAll(retirer);
|
|
34
|
+
}
|
|
35
|
+
}
|
package/scripts/registre.mjs
CHANGED
|
@@ -47,9 +47,9 @@ import { roleDeLAgent } from './etapes.mjs';
|
|
|
47
47
|
import { lireFichier, ROLE_DE_LA_NUIT, ROLE_DU_CIRCUIT, roleDuMeta, tourne } from './tableau.mjs';
|
|
48
48
|
import { lacherVerrou, prendreVerrou } from './verrou-de-fichier.mjs';
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
import { REGISTRE } from './adresse-du-registre.mjs';
|
|
51
|
+
|
|
52
|
+
export { REGISTRE };
|
|
53
53
|
|
|
54
54
|
// The transcript and the role the hook's input names: a sub-agent's sits next to the session's.
|
|
55
55
|
export function source(input) {
|
|
@@ -23,6 +23,6 @@ export function lesReponses(ticket, statut, ecrit) {
|
|
|
23
23
|
}
|
|
24
24
|
const etendre = '--etendre <paquet>';
|
|
25
25
|
return statut === 'RUNNING'
|
|
26
|
-
? `${circuit} --reprendre\`, \`${depuis}\`, \`${etendre}
|
|
26
|
+
? `${circuit} --reprendre\`, \`${depuis}\`, \`${etendre}\`, \`--reporter <heure>\` ou \`--arreter`
|
|
27
27
|
: `${circuit} --reprendre\`, \`${depuis}\` ou \`${etendre}`;
|
|
28
28
|
}
|
package/scripts/superviseur.mjs
CHANGED
|
@@ -111,9 +111,26 @@ function seance(depart = process.ppid) {
|
|
|
111
111
|
return depart;
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
114
|
+
/**
|
|
115
|
+
* Of the tickets <tickets> (as `bd show --json` gives them), the ids of those whose question does
|
|
116
|
+
* not wait for the supervisor at <maintenant> (ms): closed, or deferred to a later time
|
|
117
|
+
* (`defer_until`, the answer `--reporter <heure>`), as a review's snooze hides a request until its
|
|
118
|
+
* hour, then shows it again.
|
|
119
|
+
* @param {{ id: string, status?: string, defer_until?: string }[]} tickets
|
|
120
|
+
* @param {number} maintenant
|
|
121
|
+
* @returns {Set<string>}
|
|
122
|
+
*/
|
|
123
|
+
export function horsAttente(tickets, maintenant) {
|
|
124
|
+
return new Set(
|
|
125
|
+
tickets
|
|
126
|
+
.filter(t => t.status === 'closed' || Date.parse(t.defer_until ?? '') > maintenant)
|
|
127
|
+
.map(t => t.id)
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// Of the tickets <ids> of the repository at <racine>, those whose question does not wait now
|
|
132
|
+
// (`horsAttente`); none when bd does not read them.
|
|
133
|
+
export function ticketsHorsAttente(racine, ids) {
|
|
117
134
|
const r = spawnSync('bd', ['show', ...ids, '--json'], {
|
|
118
135
|
cwd: racine,
|
|
119
136
|
encoding: 'utf8',
|
|
@@ -121,11 +138,7 @@ export function ticketsFermes(racine, ids) {
|
|
|
121
138
|
maxBuffer: 256 * 1024 * 1024,
|
|
122
139
|
});
|
|
123
140
|
try {
|
|
124
|
-
return
|
|
125
|
-
JSON.parse(r.stdout)
|
|
126
|
-
.filter(t => t.status === 'closed')
|
|
127
|
-
.map(t => t.id)
|
|
128
|
-
);
|
|
141
|
+
return horsAttente(JSON.parse(r.stdout), Date.now());
|
|
129
142
|
} catch {
|
|
130
143
|
return new Set();
|
|
131
144
|
}
|
|
@@ -374,7 +387,7 @@ function enAttente(lus, racine, fermes) {
|
|
|
374
387
|
export function questionsEnAttente(
|
|
375
388
|
racine,
|
|
376
389
|
circuits,
|
|
377
|
-
{ fermes =
|
|
390
|
+
{ fermes = ticketsHorsAttente, sauf = new Set() } = {}
|
|
378
391
|
) {
|
|
379
392
|
return enAttente(
|
|
380
393
|
circuits.filter(c => attendLeSuperviseur(c) && !sauf.has(cleDe(c))),
|
|
@@ -413,7 +426,7 @@ const aucunFerme = () => new Set();
|
|
|
413
426
|
*/
|
|
414
427
|
export async function attendreUneQuestion({
|
|
415
428
|
racine,
|
|
416
|
-
fermes =
|
|
429
|
+
fermes = ticketsHorsAttente,
|
|
417
430
|
pas = 5_000,
|
|
418
431
|
signal,
|
|
419
432
|
circuitsDe = circuitsDuServeur,
|
|
@@ -590,7 +603,7 @@ export function texteDesQuestions(questions) {
|
|
|
590
603
|
*/
|
|
591
604
|
export async function circuitsALOuverture(
|
|
592
605
|
racine,
|
|
593
|
-
{ fermes =
|
|
606
|
+
{ fermes = ticketsHorsAttente, circuitsDe = circuitsDuServeur, ticketsDe = lireLesTickets } = {}
|
|
594
607
|
) {
|
|
595
608
|
let circuits = null;
|
|
596
609
|
let panne = null;
|
package/scripts/tableau.mjs
CHANGED
|
@@ -121,6 +121,7 @@ import {
|
|
|
121
121
|
} from './etapes.mjs';
|
|
122
122
|
import { echecDeLOutil } from './aiguillage.mjs';
|
|
123
123
|
import { bilansGardes, enBref } from './bilan.mjs';
|
|
124
|
+
import { REGISTRE } from './adresse-du-registre.mjs';
|
|
124
125
|
import { lireLaMesure } from './avancement.mjs';
|
|
125
126
|
import {
|
|
126
127
|
SANS_REPONSE_EN,
|
|
@@ -261,6 +262,7 @@ const etatNeuf = () => ({
|
|
|
261
262
|
tours: [],
|
|
262
263
|
recu: false,
|
|
263
264
|
vus: [],
|
|
265
|
+
minutes: {},
|
|
264
266
|
});
|
|
265
267
|
|
|
266
268
|
// The union of intervals, ordered by date: no instant is in two of them.
|
|
@@ -350,8 +352,15 @@ function avancer(etat, texte) {
|
|
|
350
352
|
if (id) {
|
|
351
353
|
vus.add(id);
|
|
352
354
|
}
|
|
353
|
-
|
|
354
|
-
|
|
355
|
+
const n = (u.input_tokens ?? 0) + (u.output_tokens ?? 0) + (u.cache_creation_input_tokens ?? 0);
|
|
356
|
+
etat.jetons += n;
|
|
357
|
+
// The tokens by minute of their message, which share the supervisor's among the tickets he
|
|
358
|
+
// leads directly (`jetonsDuSuperviseur`); a state kept before them starts its own.
|
|
359
|
+
if (!Number.isNaN(t)) {
|
|
360
|
+
etat.minutes ??= {};
|
|
361
|
+
const minute = Math.floor(t / 60_000);
|
|
362
|
+
etat.minutes[minute] = (etat.minutes[minute] ?? 0) + n;
|
|
363
|
+
}
|
|
355
364
|
etat.cache += u.cache_read_input_tokens ?? 0;
|
|
356
365
|
// The usage of the message's model: a write of the cache by its duration, one without them
|
|
357
366
|
// of five minutes, the default of the API.
|
|
@@ -394,6 +403,7 @@ const mesurer = etat => ({
|
|
|
394
403
|
role: etat.role,
|
|
395
404
|
cout: etat.cout,
|
|
396
405
|
modeles: structuredClone(etat.modeles),
|
|
406
|
+
minutes: { ...(etat.minutes ?? {}) },
|
|
397
407
|
});
|
|
398
408
|
|
|
399
409
|
// The measures of the transcript text `texte` held in memory.
|
|
@@ -572,6 +582,25 @@ const metaDe = f => {
|
|
|
572
582
|
}
|
|
573
583
|
};
|
|
574
584
|
|
|
585
|
+
/**
|
|
586
|
+
* The tokens of the supervisor's sessions of the repository at <racine> by minute (`{ <minute>:
|
|
587
|
+
* <tokens> }`, the minute since the epoch): its main transcripts touched since the day's marker
|
|
588
|
+
* <jour>, read through <cache>; the sub-agents' are counted by their tickets.
|
|
589
|
+
*/
|
|
590
|
+
export function jetonsDuSuperviseur({ racine, home, jour, cache = {} }) {
|
|
591
|
+
const lire = lecteur(cache);
|
|
592
|
+
const out = {};
|
|
593
|
+
for (const f of fichiers(path.join(home, '.claude', 'projects', enTirets(racine)), '.jsonl')) {
|
|
594
|
+
if (statSync(f).mtimeMs < jour) {
|
|
595
|
+
continue;
|
|
596
|
+
}
|
|
597
|
+
for (const [minute, n] of Object.entries(lire(f)?.minutes ?? {})) {
|
|
598
|
+
out[minute] = (out[minute] ?? 0) + n;
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
return out;
|
|
602
|
+
}
|
|
603
|
+
|
|
575
604
|
// The agents running now, each with its measures so far. `ps` is the process list
|
|
576
605
|
// (`pid etimes args` per line); `cache` keeps the readings of unchanged transcripts. A role agent
|
|
577
606
|
// launched in a shell shows by the envelope lancer.sh starts for it,
|
|
@@ -805,6 +834,7 @@ export function assembler({
|
|
|
805
834
|
remontees = [],
|
|
806
835
|
attenteVivante: attenteQuiVit = true,
|
|
807
836
|
voies = {},
|
|
837
|
+
superviseur = {},
|
|
808
838
|
}) {
|
|
809
839
|
// A circuit's lines are its steps, no agent's passage.
|
|
810
840
|
const etapesFinies = lignesDuRegistre.filter(r => r.role === ROLE_DU_CIRCUIT);
|
|
@@ -1102,12 +1132,35 @@ export function assembler({
|
|
|
1102
1132
|
(t.labels ?? []).includes('direct')
|
|
1103
1133
|
? 'direct'
|
|
1104
1134
|
: (voies[t.id] ?? (parUnCircuit.has(t.id) ? 'complet' : 'direct'));
|
|
1135
|
+
// A ticket closed with no delivery: a duplicate, superseded (`bd duplicate`, `bd supersede`), or
|
|
1136
|
+
// labelled `sans-suite`.
|
|
1137
|
+
const sansLivraison = t =>
|
|
1138
|
+
(t.dependencies ?? []).some(d => d.type === 'duplicates' || d.type === 'supersedes') ||
|
|
1139
|
+
aLabel(t, 'sans-suite');
|
|
1140
|
+
// The supervisor leads a direct ticket from its claim to its close (now while it runs): each
|
|
1141
|
+
// minute of his tokens is shared among the direct tickets he holds at that minute.
|
|
1142
|
+
const tenusEnDirect = tous
|
|
1143
|
+
.filter(t => voieDe(t) === 'direct' && Number.isFinite(Date.parse(t.started_at ?? '')))
|
|
1144
|
+
.map(t => ({
|
|
1145
|
+
id: t.id,
|
|
1146
|
+
debut: Math.floor(Date.parse(t.started_at) / 60_000),
|
|
1147
|
+
fin: Math.floor((t.closed_at ? Date.parse(t.closed_at) : maintenant) / 60_000),
|
|
1148
|
+
}));
|
|
1149
|
+
const partDuSuperviseur = new Map();
|
|
1150
|
+
for (const [cle, n] of Object.entries(superviseur)) {
|
|
1151
|
+
const minute = Number(cle);
|
|
1152
|
+
const tenus = tenusEnDirect.filter(x => x.debut <= minute && minute <= x.fin);
|
|
1153
|
+
for (const x of tenus) {
|
|
1154
|
+
partDuSuperviseur.set(x.id, (partDuSuperviseur.get(x.id) ?? 0) + n / tenus.length);
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1105
1157
|
const faitsDuJour = tous
|
|
1106
1158
|
.filter(
|
|
1107
1159
|
t =>
|
|
1108
1160
|
travail(t) &&
|
|
1109
1161
|
!actifs.has(t.id) &&
|
|
1110
1162
|
!estDecouverte(t) &&
|
|
1163
|
+
!sansLivraison(t) &&
|
|
1111
1164
|
t.closed_at &&
|
|
1112
1165
|
Date.parse(t.closed_at) >= debutJour
|
|
1113
1166
|
)
|
|
@@ -1124,7 +1177,17 @@ export function assembler({
|
|
|
1124
1177
|
: Number.isFinite(pris)
|
|
1125
1178
|
? Date.parse(t.closed_at) - pris
|
|
1126
1179
|
: null;
|
|
1127
|
-
|
|
1180
|
+
const jetons =
|
|
1181
|
+
m.jetons + Math.round(voie === 'direct' ? (partDuSuperviseur.get(t.id) ?? 0) : 0);
|
|
1182
|
+
return {
|
|
1183
|
+
id: t.id,
|
|
1184
|
+
numero: numero(t.id),
|
|
1185
|
+
sujet: titre(t).sujet,
|
|
1186
|
+
voie,
|
|
1187
|
+
duree: dure,
|
|
1188
|
+
...m,
|
|
1189
|
+
jetons,
|
|
1190
|
+
};
|
|
1128
1191
|
});
|
|
1129
1192
|
|
|
1130
1193
|
// Alerts, each with its state (`etat`) and the tone of that state (TONS).
|
|
@@ -2270,11 +2333,7 @@ function lire(
|
|
|
2270
2333
|
} catch {
|
|
2271
2334
|
ps = '';
|
|
2272
2335
|
}
|
|
2273
|
-
const
|
|
2274
|
-
process.env.GRILLHOUSE_REGISTRE ?? path.join(home, '.claude', 'grillhouse', 'registre.jsonl');
|
|
2275
|
-
const registre = existsSync(fichierRegistre)
|
|
2276
|
-
? lireRegistre(readFileSync(fichierRegistre, 'utf8'), racine)
|
|
2277
|
-
: [];
|
|
2336
|
+
const registre = existsSync(REGISTRE) ? lireRegistre(readFileSync(REGISTRE, 'utf8'), racine) : [];
|
|
2278
2337
|
const tous = bdJson(racine, 'list', '--all', '--limit', '0');
|
|
2279
2338
|
const commun = dossierCommun(racine);
|
|
2280
2339
|
const fichierCache = commun && path.join(commun, 'tableau-cache.json');
|
|
@@ -2292,6 +2351,8 @@ function lire(
|
|
|
2292
2351
|
ps,
|
|
2293
2352
|
cache,
|
|
2294
2353
|
});
|
|
2354
|
+
const jourLu = lireLeRepere(commun, maintenant);
|
|
2355
|
+
const superviseur = jetonsDuSuperviseur({ racine, home, jour: jourLu, cache });
|
|
2295
2356
|
try {
|
|
2296
2357
|
if (fichierCache) {
|
|
2297
2358
|
writeFileSync(
|
|
@@ -2302,7 +2363,7 @@ function lire(
|
|
|
2302
2363
|
} catch {
|
|
2303
2364
|
// A read-only place keeps the board working, without its cache.
|
|
2304
2365
|
}
|
|
2305
|
-
const jour =
|
|
2366
|
+
const jour = jourLu;
|
|
2306
2367
|
// The kept results of the circuits of the tickets done since the day's marker, in the main tree.
|
|
2307
2368
|
const voies = voiesDesCircuits(
|
|
2308
2369
|
commun ? path.dirname(commun) : racine,
|
|
@@ -2326,6 +2387,7 @@ function lire(
|
|
|
2326
2387
|
outil: echecDeLOutil(racine),
|
|
2327
2388
|
remontees: lireLesRemontees(racine, maintenant),
|
|
2328
2389
|
attenteVivante: attenteVivante(racine),
|
|
2390
|
+
superviseur,
|
|
2329
2391
|
});
|
|
2330
2392
|
return { t, prefix, tous, vivants, commun };
|
|
2331
2393
|
}
|