@roomi-fields/grillhouse 0.51.0 → 0.53.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 +68 -0
- package/agents/direct.md +1 -1
- package/cadre/templates/projet/vitest.config.cjs +45 -0
- package/charte/plan.md +47 -0
- package/charte/preuve.md +39 -0
- package/charte/superviseur.md +60 -0
- package/charte/tests.md +38 -0
- package/charte.md +23 -178
- package/dist/temporal/circuit/appel.d.ts +2 -0
- package/dist/temporal/circuit/appel.js +24 -2
- package/dist/temporal/circuit/appel.js.map +1 -1
- package/dist/temporal/circuit/client.d.ts +15 -7
- package/dist/temporal/circuit/client.js +42 -11
- package/dist/temporal/circuit/client.js.map +1 -1
- package/dist/temporal/circuit/commande.js +17 -6
- package/dist/temporal/circuit/commande.js.map +1 -1
- package/dist/temporal/circuit/contrat.d.ts +9 -0
- package/dist/temporal/circuit/contrat.js +6 -0
- package/dist/temporal/circuit/contrat.js.map +1 -1
- package/dist/temporal/circuit/deroule.js +25 -4
- package/dist/temporal/circuit/deroule.js.map +1 -1
- package/dist/temporal/client.d.ts +35 -1
- package/dist/temporal/client.js +144 -1
- package/dist/temporal/client.js.map +1 -1
- package/dist/temporal/commande.js +31 -13
- package/dist/temporal/commande.js.map +1 -1
- package/dist/temporal/etat.d.ts +3 -1
- package/dist/temporal/etat.js +31 -17
- package/dist/temporal/etat.js.map +1 -1
- package/dist/temporal/file/activites.js +1 -1
- package/dist/temporal/file/activites.js.map +1 -1
- package/dist/temporal/file/contrat.d.ts +4 -5
- package/dist/temporal/file/contrat.js +2 -2
- package/dist/temporal/file/contrat.js.map +1 -1
- package/dist/temporal/file/deroule.js +7 -5
- package/dist/temporal/file/deroule.js.map +1 -1
- package/dist/temporal/installation.d.ts +103 -53
- package/dist/temporal/installation.js +842 -237
- package/dist/temporal/installation.js.map +1 -1
- package/dist/temporal/nuits/deroule.js +3 -1
- package/dist/temporal/nuits/deroule.js.map +1 -1
- package/dist/temporal/places/deroule.js +2 -1
- package/dist/temporal/places/deroule.js.map +1 -1
- package/dist/temporal/sonde/deroule.js +2 -1
- package/dist/temporal/sonde/deroule.js.map +1 -1
- package/dist/temporal/tickets/deroule.js +4 -3
- package/dist/temporal/tickets/deroule.js.map +1 -1
- package/dist/temporal/travailleur.d.ts +7 -1
- package/dist/temporal/travailleur.js +49 -25
- package/dist/temporal/travailleur.js.map +1 -1
- package/docs/INTERFACE.md +20 -14
- package/docs/architecture/circuit.md +19 -16
- package/docs/architecture/entree.md +8 -9
- package/docs/architecture/greffon.md +54 -20
- package/docs/architecture/installation.md +99 -60
- package/docs/architecture/machine.md +31 -4
- package/docs/architecture/tests.md +22 -8
- package/docs/lexique.md +12 -3
- package/hooks/hooks.json +10 -10
- package/hooks/register.tsx +84 -2
- package/package.json +4 -2
- package/scripts/activites.mjs +25 -9
- package/scripts/aiguillage.mjs +1 -1
- package/scripts/attente-au-tour.mjs +2 -3
- package/scripts/bilan.mjs +116 -56
- package/scripts/bilans-gardes.mjs +37 -0
- package/scripts/circuit.mjs +256 -42
- package/scripts/circuits-du-serveur.mjs +3 -2
- package/scripts/circuits-tenus.d.mts +7 -0
- package/scripts/circuits-tenus.mjs +17 -0
- package/scripts/copie-de-montee.mjs +354 -0
- package/scripts/copies-du-depot.d.mts +13 -0
- package/scripts/copies-du-depot.mjs +66 -0
- package/scripts/copies-finies.mjs +6 -40
- package/scripts/crochets.mjs +16 -2
- package/scripts/direct.mjs +2 -2
- package/scripts/droits.mjs +117 -38
- package/scripts/engendres.mjs +5 -3
- package/scripts/entree-de-seance.mjs +35 -0
- package/scripts/enveloppe/enveloppe.mjs +23 -16
- package/scripts/enveloppe/lancer.sh +32 -22
- package/scripts/enveloppe/travail-de-la-copie.mjs +154 -0
- package/scripts/etapes.mjs +11 -3
- package/scripts/faits-du-circuit.mjs +12 -5
- package/scripts/file-des-tickets.d.mts +13 -2
- package/scripts/file-des-tickets.mjs +44 -12
- package/scripts/greffons.mjs +42 -27
- package/scripts/grillhouse-maj.mjs +105 -85
- package/scripts/init.mjs +1 -1
- package/scripts/integration/file.mjs +5 -2
- package/scripts/integration/integrer.mjs +14 -4
- package/scripts/jointure.d.ts +18 -1
- package/scripts/langages/c/commandes.mjs +17 -7
- package/scripts/langages/cargo/commandes.mjs +87 -34
- package/scripts/langages/cargo/index.mjs +6 -3
- package/scripts/langages/cargo/sccache.mjs +15 -12
- package/scripts/langages/python/commandes.mjs +68 -15
- package/scripts/langages/python/squelette.mjs +4 -3
- package/scripts/langages/typescript/configurations-de-vitest.mjs +118 -0
- package/scripts/langages/typescript/index.mjs +14 -12
- package/scripts/langages/typescript/migrations/configurations-en-commonjs.mjs +299 -0
- package/scripts/langages/typescript/squelette.mjs +20 -17
- package/scripts/langages/typescript/tests-de-nuit.mjs +3 -3
- package/scripts/langages/typescript/turbo-des-paquets.mjs +76 -39
- package/scripts/langages/typescript/verifier.mjs +27 -2
- package/scripts/langages/typescript/vitest-config/base.mjs +1 -1
- package/scripts/langages/typescript/vitest-config/bornes.mjs +1 -1
- package/scripts/langages/typescript/vitest-config/cibles.mjs +2 -2
- package/scripts/langages/typescript/{vitest.nuit.config.mjs → vitest.nuit.config.cjs} +61 -50
- package/scripts/mesure/pression.mjs +5 -3
- package/scripts/migrations/serveurs-de-l-index.mjs +1 -1
- package/scripts/migrations/suivi-du-superviseur-retire.mjs +56 -0
- package/scripts/migrations.mjs +2 -0
- package/scripts/montee.mjs +524 -0
- package/scripts/nuit.sh +3 -2
- package/scripts/outil.mjs +5 -3
- package/scripts/paquet-npm.mjs +22 -0
- package/scripts/paquet.mjs +5 -5
- package/scripts/pre-compact.mjs +25 -0
- package/scripts/reponses-du-circuit.d.mts +17 -2
- package/scripts/reponses-du-circuit.mjs +78 -20
- package/scripts/resultats.mjs +42 -14
- package/scripts/retirer-les-copies-finies.mjs +4 -7
- package/scripts/seances.mjs +81 -29
- package/scripts/services-du-noyau.mjs +7 -2
- package/scripts/session-start.sh +19 -10
- package/scripts/sortie-de-seance.mjs +70 -0
- package/scripts/sortie.mjs +4 -7
- package/scripts/sous-commandes.mjs +1 -1
- package/scripts/superviseur.mjs +417 -159
- package/scripts/tableau.mjs +249 -152
- package/scripts/ticket-du-circuit.mjs +22 -0
- package/scripts/transitions.d.mts +6 -9
- package/scripts/transitions.mjs +123 -36
- package/scripts/verrou-de-fichier.d.mts +11 -0
- package/skills/direct/SKILL.md +21 -11
- package/skills/explorateur/SKILL.md +8 -3
- package/skills/grill/SKILL.md +11 -8
- package/skills/grill/references/paquets.md +4 -4
- package/skills/pitmaster/SKILL.md +99 -53
- package/skills/pitmaster/references/cadre.md +1 -1
- package/skills/pitmaster/references/consigne-agent.md +1 -1
- package/skills/pitmaster/references/tour.md +6 -5
- package/skills/relecteur/SKILL.md +9 -2
- package/skills/testwriter/SKILL.md +3 -3
- package/cadre/templates/projet/pitmaster/SUIVI.md +0 -22
- package/cadre/templates/projet/vitest.config.ts +0 -44
- package/scripts/attente-a-l-arret.mjs +0 -114
package/scripts/tableau.mjs
CHANGED
|
@@ -11,10 +11,12 @@
|
|
|
11
11
|
//
|
|
12
12
|
// Lines: the head, AGENTS, CHANTIER, then FAITS AUJOURD'HUI, every line of each list shown; a
|
|
13
13
|
// line folds only lines of another state (« + 2 prêts ») or chantiers not in progress.
|
|
14
|
-
// - Head: the work tickets (a ticket without children; a mother is a
|
|
15
|
-
//
|
|
16
|
-
//
|
|
17
|
-
//
|
|
14
|
+
// - Head: the project's name, then the work tickets (a ticket without children; a mother is a
|
|
15
|
+
// grouping) by state, in lines by who acts: « toi » (sans go, à valider, N question: the
|
|
16
|
+
// questions that wait for the owner), one « ❓ » line per such question, « file » (the queues),
|
|
17
|
+
// « en cours » (in progress, done, deferred; a circuit launched and not integrated is in
|
|
18
|
+
// progress, not done); these lines once per project on a board of several. Then the day's
|
|
19
|
+
// discoveries, and the day's and cumulative time and tokens.
|
|
18
20
|
// - AGENTS: the tree of the steps (scripts/etapes.mjs), one block per step and sub-step. A ticket
|
|
19
21
|
// stands at a step only by its circuit or by an agent that runs on it; a ticket in the queue,
|
|
20
22
|
// its circuit not launched, stands at no step. A circuit (scripts/circuit.mjs) launched and not
|
|
@@ -25,6 +27,10 @@
|
|
|
25
27
|
// shows « ⤷ Question · <qui> » under its step;
|
|
26
28
|
// its card opens on that question, or on the stop (name, code) and the first line of its
|
|
27
29
|
// reason.
|
|
30
|
+
// - The direct circuit and the rescue command: an open circuit (it runs, or waits for an answer,
|
|
31
|
+
// never ended without its issue) keeps its ticket's line, and its agent `direct` stands at 3
|
|
32
|
+
// Code; on a ticket labelled `direct` without an open circuit, a role agent that works shows
|
|
33
|
+
// alone (`direct` under the block « Direct »), without the circuit's line.
|
|
28
34
|
// - Readings: a reading of the circuits or of the tickets that fails gives way to the last one
|
|
29
35
|
// that succeeded (`lectureGardee`, `tableau-lu-<quoi>.json` in the common git directory), its
|
|
30
36
|
// age in the alert that names the fault; a project beside the session's says its own faults.
|
|
@@ -63,13 +69,14 @@
|
|
|
63
69
|
// rank (« ⏳ <sorte> · <projet> · attend <raison> »). Such a line is marked `avancement`, which
|
|
64
70
|
// the pane measures again more often.
|
|
65
71
|
// - Signs: a ticket's line in AGENTS takes one of three, by the tone of its state: ▶ its step
|
|
66
|
-
// works (cyan; ▷ in a short circuit, a
|
|
67
|
-
// its right (« attend une place », « verrou », « disque », « démarre » in grey,
|
|
68
|
-
// machine; « question au superviseur », « question au responsable », « arrêté »
|
|
69
|
-
// waiting for someone); ⛔ it stopped on a fault or its pass is frozen (red). At
|
|
70
|
-
// AGENTS, 🔒 and ⏳ for a pass with no ticket, 🌙 the night under way. Alerts:
|
|
71
|
-
// claimed with nothing running, 🌙 a red night, ⚠ the others.
|
|
72
|
-
// width of a line counts its columns (`colonnes`), ⏳ and ⛔
|
|
72
|
+
// works (cyan; ▷ in a short circuit, ✎ in a direct one, by its view, `circuit`); ⏸ it waits,
|
|
73
|
+
// the reason on its right (« attend une place », « verrou », « disque », « démarre » in grey,
|
|
74
|
+
// waiting for the machine; « question au superviseur », « question au responsable », « arrêté »
|
|
75
|
+
// in yellow, waiting for someone); ⛔ it stopped on a fault or its pass is frozen (red). At
|
|
76
|
+
// the head of AGENTS, 🔒 and ⏳ for a pass with no ticket, 🌙 the night under way. Alerts:
|
|
77
|
+
// 💤 a ticket claimed with nothing running, 🌙 a red night, ⚠ the others.
|
|
78
|
+
// A sign is followed by a space; the width of a line counts its columns (`colonnes`), ⏳ and ⛔
|
|
79
|
+
// two.
|
|
73
80
|
// - Alerts: one per open night ticket (🌙), per circuit that waits for the supervisor (⏳, how
|
|
74
81
|
// long), a shell agent silent for 10 minutes, a ticket in progress with nothing running for 30
|
|
75
82
|
// minutes (💤), each with its state (`etat`).
|
|
@@ -100,12 +107,13 @@ import {
|
|
|
100
107
|
libelle,
|
|
101
108
|
quiDe,
|
|
102
109
|
roleDeLAgent,
|
|
110
|
+
RESPONSABLE,
|
|
103
111
|
SUITE,
|
|
104
112
|
SUPERVISEUR,
|
|
105
113
|
} from './etapes.mjs';
|
|
106
114
|
import { echecDeLOutil } from './aiguillage.mjs';
|
|
107
115
|
import { maxDuProjet } from './circuits-cles.mjs';
|
|
108
|
-
import { bilansGardes, enBref } from './
|
|
116
|
+
import { bilansGardes, enBref } from './bilans-gardes.mjs';
|
|
109
117
|
import { REGISTRE } from './adresse-du-registre.mjs';
|
|
110
118
|
import { lireLaMesure } from './avancement.mjs';
|
|
111
119
|
import {
|
|
@@ -126,8 +134,10 @@ import {
|
|
|
126
134
|
attendDeLAutreProjet,
|
|
127
135
|
enFileSansArchitecture,
|
|
128
136
|
enFileSurMain,
|
|
137
|
+
leReportRendLaPlace,
|
|
129
138
|
lireLesExternes,
|
|
130
139
|
lotEstSurMain,
|
|
140
|
+
reporteJusqua,
|
|
131
141
|
} from './file-des-tickets.mjs';
|
|
132
142
|
import { etatDesPlaces } from './places-de-la-machine.mjs';
|
|
133
143
|
import { duree as dureeDeLaFermeture } from './regles-des-places.mjs';
|
|
@@ -166,8 +176,8 @@ export const ROLE_DU_CIRCUIT = 'circuit';
|
|
|
166
176
|
// The role of a register line that the workflow of the nights writes for a night it skips
|
|
167
177
|
// (src/temporal/nuits/): no agent, no ticket, no turn; the board counts it nowhere.
|
|
168
178
|
export const ROLE_DE_LA_NUIT = 'nuit';
|
|
169
|
-
// The agent
|
|
170
|
-
//
|
|
179
|
+
// The agent who writes tests and code together, of a direct circuit or of the rescue command
|
|
180
|
+
// (scripts/direct.mjs), and the block of the board that lists those of the rescue command.
|
|
171
181
|
const ROLE_DIRECT = 'direct';
|
|
172
182
|
// A sub-agent's role from its meta file: the type it was spawned as; a named agent's `agentType`
|
|
173
183
|
// is its name.
|
|
@@ -176,13 +186,12 @@ export const roleDuMeta = m =>
|
|
|
176
186
|
// The states of a ticket, in the order the states' view lists them, with their meaning.
|
|
177
187
|
export const ETATS = [
|
|
178
188
|
{ cle: 'enCours', nom: 'en cours', sens: 'un agent y travaille' },
|
|
179
|
-
{ cle: 'enAttente', nom: 'en
|
|
189
|
+
{ cle: 'enAttente', nom: 'en file', sens: 'ton go, prêt à partir' },
|
|
180
190
|
{
|
|
181
191
|
cle: 'attendArchi',
|
|
182
192
|
nom: 'attend archi',
|
|
183
193
|
sens: 'ton go, sa section Architecture reste à écrire',
|
|
184
194
|
},
|
|
185
|
-
{ cle: 'fileDirecte', nom: 'en direct', sens: 'mené hors du circuit, pas encore pris' },
|
|
186
195
|
{ cle: 'bloques', nom: 'bloqué', sens: 'ton go, il attend un autre ticket' },
|
|
187
196
|
{ cle: 'sansGo', nom: 'sans go', sens: 'validé, il attend ton go' },
|
|
188
197
|
{ cle: 'aValider', nom: 'à valider', sens: 'une trouvaille attend ton accord' },
|
|
@@ -201,7 +210,6 @@ export const TONS = Object.freeze({
|
|
|
201
210
|
enCours: 'actif',
|
|
202
211
|
enAttente: 'discret',
|
|
203
212
|
attendArchi: 'discret',
|
|
204
|
-
fileDirecte: 'discret',
|
|
205
213
|
bloques: 'discret',
|
|
206
214
|
sansGo: 'attention',
|
|
207
215
|
aValider: 'attention',
|
|
@@ -210,6 +218,7 @@ export const TONS = Object.freeze({
|
|
|
210
218
|
// A circuit, a pass, a wait.
|
|
211
219
|
attendUnePlace: 'discret',
|
|
212
220
|
reporteLimite: 'discret',
|
|
221
|
+
reporteQuestion: 'discret',
|
|
213
222
|
attendUnePart: 'discret',
|
|
214
223
|
attendLeDisque: 'discret',
|
|
215
224
|
sansEtape: 'discret',
|
|
@@ -313,6 +322,17 @@ function reunir(intervalles) {
|
|
|
313
322
|
// transcript, a turn starts at its incoming message.
|
|
314
323
|
const horsDuTour = e => e.type === 'queue-operation' || e.message?.model === '<synthetic>';
|
|
315
324
|
|
|
325
|
+
// The usage of a session's first request, from its response's `u`: `{ entree, cacheEcrit, cacheLu
|
|
326
|
+
// }`, or null when one of the three is not a number.
|
|
327
|
+
function tourDeLUsage(u) {
|
|
328
|
+
const tour = {
|
|
329
|
+
entree: u?.input_tokens,
|
|
330
|
+
cacheEcrit: u?.cache_creation_input_tokens,
|
|
331
|
+
cacheLu: u?.cache_read_input_tokens,
|
|
332
|
+
};
|
|
333
|
+
return Object.values(tour).every(n => Number.isFinite(n)) ? tour : null;
|
|
334
|
+
}
|
|
335
|
+
|
|
316
336
|
// Adds the lines of `texte` to the state `etat`, which it returns.
|
|
317
337
|
function avancer(etat, texte) {
|
|
318
338
|
const vus = new Set(etat.vus);
|
|
@@ -372,6 +392,15 @@ function avancer(etat, texte) {
|
|
|
372
392
|
const m = /TON TICKET : ([A-Za-z0-9_-]+-[A-Za-z0-9]+(?:\.[0-9]+)*)/.exec(texteUser);
|
|
373
393
|
etat.ticket = m ? m[1] : '';
|
|
374
394
|
}
|
|
395
|
+
// The first response of a model, absent from the state until it is read.
|
|
396
|
+
if (
|
|
397
|
+
etat.premierTour === undefined &&
|
|
398
|
+
e.type === 'assistant' &&
|
|
399
|
+
e.message &&
|
|
400
|
+
e.message.model !== '<synthetic>'
|
|
401
|
+
) {
|
|
402
|
+
etat.premierTour = tourDeLUsage(e.message.usage);
|
|
403
|
+
}
|
|
375
404
|
const u = e.message?.usage;
|
|
376
405
|
const id = e.message?.id ?? e.requestId;
|
|
377
406
|
if (!u || (id && vus.has(id))) {
|
|
@@ -382,8 +411,8 @@ function avancer(etat, texte) {
|
|
|
382
411
|
}
|
|
383
412
|
const n = (u.input_tokens ?? 0) + (u.output_tokens ?? 0) + (u.cache_creation_input_tokens ?? 0);
|
|
384
413
|
etat.jetons += n;
|
|
385
|
-
// The tokens by minute of their message, which
|
|
386
|
-
//
|
|
414
|
+
// The tokens by minute of their message, of which the board counts in the day those since its
|
|
415
|
+
// marker; a state kept before them starts its own.
|
|
387
416
|
if (!Number.isNaN(t)) {
|
|
388
417
|
etat.minutes ??= {};
|
|
389
418
|
const minute = Math.floor(t / 60_000);
|
|
@@ -414,8 +443,9 @@ function avancer(etat, texte) {
|
|
|
414
443
|
|
|
415
444
|
// The measures of a state: the tokens, the turns and their working time (the union of the turns,
|
|
416
445
|
// the waits left out), the start (the oldest date) and the end (the latest), the ticket, the role
|
|
417
|
-
// (a session launched with `--agent`), the cost (the total a session writes)
|
|
418
|
-
// model
|
|
446
|
+
// (a session launched with `--agent`), the cost (the total a session writes), the usage by
|
|
447
|
+
// model and the one of the first response of a model (`premierTour`, null without a readable
|
|
448
|
+
// one). `entre` is the
|
|
419
449
|
// time of the latest incoming message, or null; `attend` tells whether the last tool call still
|
|
420
450
|
// awaits its answer, the call and its answer paired by their identifier.
|
|
421
451
|
const mesurer = etat => ({
|
|
@@ -432,6 +462,7 @@ const mesurer = etat => ({
|
|
|
432
462
|
cout: etat.cout,
|
|
433
463
|
modeles: structuredClone(etat.modeles),
|
|
434
464
|
minutes: { ...(etat.minutes ?? {}) },
|
|
465
|
+
premierTour: etat.premierTour ? { ...etat.premierTour } : null,
|
|
435
466
|
});
|
|
436
467
|
|
|
437
468
|
// The measures of the transcript text `texte` held in memory.
|
|
@@ -610,25 +641,6 @@ const metaDe = f => {
|
|
|
610
641
|
}
|
|
611
642
|
};
|
|
612
643
|
|
|
613
|
-
/**
|
|
614
|
-
* The tokens of the supervisor's sessions of the repository at <racine> by minute (`{ <minute>:
|
|
615
|
-
* <tokens> }`, the minute since the epoch): its main transcripts touched since the day's marker
|
|
616
|
-
* <jour>, read through <cache>; the sub-agents' are counted by their tickets.
|
|
617
|
-
*/
|
|
618
|
-
export function jetonsDuSuperviseur({ racine, home, jour, cache = {} }) {
|
|
619
|
-
const lire = lecteur(cache);
|
|
620
|
-
const out = {};
|
|
621
|
-
for (const f of fichiers(path.join(home, '.claude', 'projects', enTirets(racine)), '.jsonl')) {
|
|
622
|
-
if (statSync(f).mtimeMs < jour) {
|
|
623
|
-
continue;
|
|
624
|
-
}
|
|
625
|
-
for (const [minute, n] of Object.entries(lire(f)?.minutes ?? {})) {
|
|
626
|
-
out[minute] = (out[minute] ?? 0) + n;
|
|
627
|
-
}
|
|
628
|
-
}
|
|
629
|
-
return out;
|
|
630
|
-
}
|
|
631
|
-
|
|
632
644
|
// The agents running now, each with its measures so far. `ps` is the process list
|
|
633
645
|
// (`pid etimes args` per line); `cache` keeps the readings of unchanged transcripts. A role agent
|
|
634
646
|
// launched in a shell shows by the envelope lancer.sh starts for it,
|
|
@@ -740,6 +752,9 @@ export const attendLeSuperviseur = c =>
|
|
|
740
752
|
* @returns {string}
|
|
741
753
|
*/
|
|
742
754
|
export const cleDe = c => [c.ticket, c.run, c.numero, c.arret ?? 'interrompu'].join(':');
|
|
755
|
+
// The key of the stop of a circuit as the board holds it (`cle`, kept since its `numero` there is
|
|
756
|
+
// its ticket's number), else `cleDe`.
|
|
757
|
+
const cleDuStop = c => c.cle ?? cleDe(c);
|
|
743
758
|
|
|
744
759
|
/** The file of the stops gone up to the supervisor of the repository at <racine>. */
|
|
745
760
|
export const remonteesDe = racine =>
|
|
@@ -888,7 +903,8 @@ export function lignesDesParts({
|
|
|
888
903
|
* the alert says; `fauteTickets`, the fault of the reading of the tickets, said in an alert, and
|
|
889
904
|
* `ticketsLusA`, the time of the last one that succeeded, whose tickets `tous` holds;
|
|
890
905
|
* `echecPrefixe`, the cause of a ticket prefix that did not read, named in an alert; `voies`, the
|
|
891
|
-
* way of each circuit done (`voiesDesCircuits`), whose sign FAITS AUJOURD'HUI shows
|
|
906
|
+
* way of each circuit done (`voiesDesCircuits`), whose sign FAITS AUJOURD'HUI shows; `bilans`,
|
|
907
|
+
* the kept bilan of each ticket (`bilansGardes`), whose status says whether the engine led it.
|
|
892
908
|
* @param {{ tous: any[], prefix?: string, racine?: string | null, registre: any[], vivants: any[],
|
|
893
909
|
* circuits?: any[],
|
|
894
910
|
* circuitsLusA?: number | null, fauteTickets?: string | null, ticketsLusA?: number | null,
|
|
@@ -900,7 +916,8 @@ export function lignesDesParts({
|
|
|
900
916
|
* depuis: number, disque?: string | null }[],
|
|
901
917
|
* fermeture?: { auteur: 'superviseur', depuis: number, phase: string } | null } | null,
|
|
902
918
|
* nuit?: { racine: string, depuis: number | null } | null, muet?: boolean, faute?: string | null,
|
|
903
|
-
* echecPrefixe?: string | null, voies?: Record<string, 'complet' | 'court'
|
|
919
|
+
* echecPrefixe?: string | null, voies?: Record<string, 'complet' | 'court'>,
|
|
920
|
+
* bilans?: Record<string, { statut?: string }> }} lu
|
|
904
921
|
*/
|
|
905
922
|
export function assembler({
|
|
906
923
|
tous,
|
|
@@ -924,7 +941,7 @@ export function assembler({
|
|
|
924
941
|
echecPrefixe = null,
|
|
925
942
|
remontees = [],
|
|
926
943
|
voies = {},
|
|
927
|
-
|
|
944
|
+
bilans = {},
|
|
928
945
|
externes,
|
|
929
946
|
limite = null,
|
|
930
947
|
lotSurMain = () => false,
|
|
@@ -988,7 +1005,12 @@ export function assembler({
|
|
|
988
1005
|
!c.integre &&
|
|
989
1006
|
(parId.get(c.ticket).status !== 'closed' || c.vivant || attendLeSuperviseur(c))
|
|
990
1007
|
)
|
|
991
|
-
|
|
1008
|
+
// `reporteA`: the hour its ticket is deferred to, still to come; none for a ticket closed.
|
|
1009
|
+
.map(c => {
|
|
1010
|
+
const t = parId.get(c.ticket);
|
|
1011
|
+
const reporteA = t.status === 'closed' ? null : reporteJusqua(t, maintenant);
|
|
1012
|
+
return [c.ticket, { ...c, reporteA }];
|
|
1013
|
+
})
|
|
992
1014
|
);
|
|
993
1015
|
const actifs = new Set([
|
|
994
1016
|
...enCoursMesures.map(v => v.ticket).filter(Boolean),
|
|
@@ -1003,8 +1025,8 @@ export function assembler({
|
|
|
1003
1025
|
const pret = new Set(prets.map(t => t.id));
|
|
1004
1026
|
const avalider = new Set(aValider.map(t => t.id));
|
|
1005
1027
|
const bloquePar = t => [...blocages(t).map(d => numero(d.depends_on_id)), ...attentesExternes(t)];
|
|
1006
|
-
// The owner's go: the label `circuit`, set on his word
|
|
1007
|
-
const circuit = t => (t.labels ?? []).
|
|
1028
|
+
// The owner's go: the label `circuit`, set on his word, or `direct`.
|
|
1029
|
+
const circuit = t => (t.labels ?? []).some(l => l === 'circuit' || l === 'direct');
|
|
1008
1030
|
// A ticket's state: in progress (claimed, or its circuit launched and not integrated, its
|
|
1009
1031
|
// question deferred or its ticket closed before its integration included: AGENTS shows it, and it
|
|
1010
1032
|
// is done only once integrated), done, deferred,
|
|
@@ -1023,10 +1045,6 @@ export function assembler({
|
|
|
1023
1045
|
if (avalider.has(t.id)) {
|
|
1024
1046
|
return 'aValider';
|
|
1025
1047
|
}
|
|
1026
|
-
// A ticket led out of the circuit, not yet claimed: the direct queue.
|
|
1027
|
-
if ((t.labels ?? []).includes('direct')) {
|
|
1028
|
-
return 'fileDirecte';
|
|
1029
|
-
}
|
|
1030
1048
|
if (!circuit(t)) {
|
|
1031
1049
|
return 'sansGo';
|
|
1032
1050
|
}
|
|
@@ -1041,7 +1059,6 @@ export function assembler({
|
|
|
1041
1059
|
enCours: 0,
|
|
1042
1060
|
enAttente: 0,
|
|
1043
1061
|
attendArchi: 0,
|
|
1044
|
-
fileDirecte: 0,
|
|
1045
1062
|
bloques: 0,
|
|
1046
1063
|
fermes: 0,
|
|
1047
1064
|
sansGo: 0,
|
|
@@ -1197,6 +1214,7 @@ export function assembler({
|
|
|
1197
1214
|
...titre(t),
|
|
1198
1215
|
mere: !travail(t),
|
|
1199
1216
|
etat: e,
|
|
1217
|
+
voie: aLabel(t, 'direct') ? 'direct' : 'complet',
|
|
1200
1218
|
faits,
|
|
1201
1219
|
total: liste.length,
|
|
1202
1220
|
bloquePar: bloquePar(t),
|
|
@@ -1242,14 +1260,21 @@ export function assembler({
|
|
|
1242
1260
|
const e = etapeDuRole(role);
|
|
1243
1261
|
return e ? blocs.find(b => b.numero === e.numero) : undefined;
|
|
1244
1262
|
};
|
|
1245
|
-
//
|
|
1246
|
-
|
|
1263
|
+
// A circuit open: it runs, or waits for an answer; never ended without its issue.
|
|
1264
|
+
const ouvertSur = c => Boolean(c) && !c.sansIssue && (c.vivant || attendLeSuperviseur(c));
|
|
1265
|
+
// The block « Direct » heads them: the agents of the rescue command (`npx grillhouse direct`),
|
|
1266
|
+
// on a ticket with no open circuit, at no step.
|
|
1247
1267
|
const directs = [];
|
|
1248
|
-
// One line per ticket: a ticket on which a role agent runs stands at its step, the agent
|
|
1249
|
-
// direct under the block « Direct ».
|
|
1268
|
+
// One line per ticket: a ticket on which a role agent runs stands at its step, the agent
|
|
1269
|
+
// `direct` of an open circuit at the step of the code, else under the block « Direct ».
|
|
1250
1270
|
for (const v of enCoursMesures) {
|
|
1251
1271
|
const t = v.ticket && parId.get(v.ticket);
|
|
1252
|
-
const cible =
|
|
1272
|
+
const cible =
|
|
1273
|
+
v.role !== ROLE_DIRECT
|
|
1274
|
+
? bloc(v.role)
|
|
1275
|
+
: ouvertSur(parCircuit.get(v.ticket))
|
|
1276
|
+
? bloc('developpeur')
|
|
1277
|
+
: { enCours: directs };
|
|
1253
1278
|
if (!t || !cible) {
|
|
1254
1279
|
continue;
|
|
1255
1280
|
}
|
|
@@ -1265,37 +1290,26 @@ export function assembler({
|
|
|
1265
1290
|
});
|
|
1266
1291
|
}
|
|
1267
1292
|
const debutJour = jour;
|
|
1268
|
-
// The way of a ticket done:
|
|
1269
|
-
//
|
|
1293
|
+
// The way of a ticket done: the one of its circuit's integrated view; a circuit that runs or
|
|
1294
|
+
// waits keeps its ticket out of the facts, and one stopped gives no way, the lot having entered
|
|
1295
|
+
// another way. Without such a view: `direct` when labelled so; else the way its kept results
|
|
1296
|
+
// give (`voies`, `voiesDesCircuits`: `court` for the short circuit, else `complet`); else
|
|
1270
1297
|
// `complet` when a circuit led a step of it (the register) or is read for it; else `direct`,
|
|
1271
1298
|
// closed with no circuit.
|
|
1299
|
+
const integres = new Map(circuits.filter(c => c.integre).map(c => [c.ticket, c.circuit]));
|
|
1272
1300
|
const parUnCircuit = new Set([...etapesFinies.map(r => r.ticket), ...parCircuit.keys()]);
|
|
1273
1301
|
const voieDe = t =>
|
|
1274
|
-
(t.
|
|
1302
|
+
VOIE_DE_LA_VUE[integres.get(t.id)] ??
|
|
1303
|
+
((t.labels ?? []).includes('direct')
|
|
1275
1304
|
? 'direct'
|
|
1276
|
-
: (voies[t.id] ?? (parUnCircuit.has(t.id) ? 'complet' : 'direct'));
|
|
1305
|
+
: (voies[t.id] ?? (parUnCircuit.has(t.id) ? 'complet' : 'direct')));
|
|
1306
|
+
// The engine led a ticket's lot when its circuit's view is integrated, or its kept bilan says so.
|
|
1307
|
+
const meneParLeMoteur = t => integres.has(t.id) || bilans[t.id]?.statut === 'intégré';
|
|
1277
1308
|
// A ticket closed with no delivery: a duplicate, superseded (`bd duplicate`, `bd supersede`), or
|
|
1278
1309
|
// labelled `sans-suite`.
|
|
1279
1310
|
const sansLivraison = t =>
|
|
1280
1311
|
(t.dependencies ?? []).some(d => d.type === 'duplicates' || d.type === 'supersedes') ||
|
|
1281
1312
|
aLabel(t, 'sans-suite');
|
|
1282
|
-
// The supervisor leads a direct ticket from its claim to its close (now while it runs): each
|
|
1283
|
-
// minute of his tokens is shared among the direct tickets he holds at that minute.
|
|
1284
|
-
const tenusEnDirect = tous
|
|
1285
|
-
.filter(t => voieDe(t) === 'direct' && Number.isFinite(Date.parse(t.started_at ?? '')))
|
|
1286
|
-
.map(t => ({
|
|
1287
|
-
id: t.id,
|
|
1288
|
-
debut: Math.floor(Date.parse(t.started_at) / 60_000),
|
|
1289
|
-
fin: Math.floor((t.closed_at ? Date.parse(t.closed_at) : maintenant) / 60_000),
|
|
1290
|
-
}));
|
|
1291
|
-
const partDuSuperviseur = new Map();
|
|
1292
|
-
for (const [cle, n] of Object.entries(superviseur)) {
|
|
1293
|
-
const minute = Number(cle);
|
|
1294
|
-
const tenus = tenusEnDirect.filter(x => x.debut <= minute && minute <= x.fin);
|
|
1295
|
-
for (const x of tenus) {
|
|
1296
|
-
partDuSuperviseur.set(x.id, (partDuSuperviseur.get(x.id) ?? 0) + n / tenus.length);
|
|
1297
|
-
}
|
|
1298
|
-
}
|
|
1299
1313
|
// A finding is done only once led to its end: validated and carried by the circuit, or led
|
|
1300
1314
|
// direct; a finding just recorded, or rejected at its sorting, is no work done.
|
|
1301
1315
|
const menee = t => aLabel(t, 'circuit') || aLabel(t, 'direct');
|
|
@@ -1314,17 +1328,15 @@ export function assembler({
|
|
|
1314
1328
|
.map(t => {
|
|
1315
1329
|
const m = mesure(new Set([t.id]));
|
|
1316
1330
|
const voie = voieDe(t);
|
|
1317
|
-
// A circuit's time is its agents' and steps' working time; a direct ticket
|
|
1318
|
-
// claim to its close, null without a claim.
|
|
1331
|
+
// A circuit's time is its agents' and steps' working time; the time of a direct ticket no
|
|
1332
|
+
// circuit led runs from its claim to its close, null without a claim.
|
|
1319
1333
|
const pris = Date.parse(t.started_at ?? '');
|
|
1320
1334
|
const dure =
|
|
1321
|
-
voie !== 'direct'
|
|
1335
|
+
voie !== 'direct' || meneParLeMoteur(t)
|
|
1322
1336
|
? m.travail
|
|
1323
1337
|
: Number.isFinite(pris)
|
|
1324
1338
|
? Date.parse(t.closed_at) - pris
|
|
1325
1339
|
: null;
|
|
1326
|
-
const jetons =
|
|
1327
|
-
m.jetons + Math.round(voie === 'direct' ? (partDuSuperviseur.get(t.id) ?? 0) : 0);
|
|
1328
1340
|
return {
|
|
1329
1341
|
id: t.id,
|
|
1330
1342
|
numero: numero(t.id),
|
|
@@ -1332,7 +1344,6 @@ export function assembler({
|
|
|
1332
1344
|
voie,
|
|
1333
1345
|
duree: dure,
|
|
1334
1346
|
...m,
|
|
1335
|
-
jetons,
|
|
1336
1347
|
};
|
|
1337
1348
|
});
|
|
1338
1349
|
|
|
@@ -1400,7 +1411,9 @@ export function assembler({
|
|
|
1400
1411
|
remontees.filter(r => !estLue(r) && !Number.isFinite(r.chez)).map(r => [r.cle, r.depuis])
|
|
1401
1412
|
);
|
|
1402
1413
|
const enAttenteDuSuperviseur = [...parCircuit.values()]
|
|
1403
|
-
|
|
1414
|
+
// A deferred question asks nothing of the supervisor until its hour, whoever must answer it:
|
|
1415
|
+
// no alert. The owner's keeps its line ❓ and its count (`auResponsable`).
|
|
1416
|
+
.filter(c => attendLeSuperviseur(c) && !c.reporteA)
|
|
1404
1417
|
.sort((a, b) => ordre({ id: a.ticket }, { id: b.ticket }));
|
|
1405
1418
|
for (const c of enAttenteDuSuperviseur) {
|
|
1406
1419
|
const depuis = depuisDe.get(cleDe(c));
|
|
@@ -1475,9 +1488,9 @@ export function assembler({
|
|
|
1475
1488
|
// The tickets worked out of a circuit: claimed (`in_progress`), no circuit on the server that
|
|
1476
1489
|
// holds them, a mother of theirs or a ticket under them (a circuit holds its ticket's mothers and
|
|
1477
1490
|
// children): one that runs or waits for an answer (`attendLeSuperviseur`), never one the
|
|
1478
|
-
// supervisor stopped; or labelled `direct` and claimed
|
|
1479
|
-
// agent shown at a step. None while the circuits do not read (a silent server, a fault)
|
|
1480
|
-
// earlier reading is kept, when no ticket can be told out of a circuit.
|
|
1491
|
+
// supervisor stopped; or labelled `direct` and claimed, with no such circuit of their own; and
|
|
1492
|
+
// no role agent shown at a step. None while the circuits do not read (a silent server, a fault)
|
|
1493
|
+
// and no earlier reading is kept, when no ticket can be told out of a circuit.
|
|
1481
1494
|
const aUneEtape = new Set([...blocs.flatMap(b => b.enCours), ...directs].map(x => x.id));
|
|
1482
1495
|
const tenus = new Set(
|
|
1483
1496
|
[...parCircuit.values()].filter(c => c.vivant || attendLeSuperviseur(c)).map(c => c.ticket)
|
|
@@ -1500,7 +1513,7 @@ export function assembler({
|
|
|
1500
1513
|
travail(t) &&
|
|
1501
1514
|
!aUneEtape.has(t.id) &&
|
|
1502
1515
|
t.status === 'in_progress' &&
|
|
1503
|
-
(!dansUnCircuit(t) || (t
|
|
1516
|
+
(!dansUnCircuit(t) || (aLabel(t, 'direct') && !tenus.has(t.id)))
|
|
1504
1517
|
)
|
|
1505
1518
|
.sort(ordre)
|
|
1506
1519
|
.map(t => ({
|
|
@@ -1508,26 +1521,51 @@ export function assembler({
|
|
|
1508
1521
|
numero: numero(t.id),
|
|
1509
1522
|
sujet: titre(t).sujet,
|
|
1510
1523
|
}));
|
|
1511
|
-
// The circuits, in the tickets' order; a ticket worked in direct has its line alone
|
|
1524
|
+
// The circuits, in the tickets' order; a ticket worked in direct has its line alone, as has one
|
|
1525
|
+
// labelled `direct` whose circuit is not open while a role agent works on it.
|
|
1512
1526
|
const enDirect = new Set(horsCircuit.map(x => x.id));
|
|
1513
1527
|
const lesCircuits = [...parCircuit.values()]
|
|
1514
|
-
.filter(
|
|
1528
|
+
.filter(
|
|
1529
|
+
c =>
|
|
1530
|
+
!enDirect.has(c.ticket) &&
|
|
1531
|
+
!(aLabel(parId.get(c.ticket), 'direct') && !ouvertSur(c) && aUneEtape.has(c.ticket))
|
|
1532
|
+
)
|
|
1515
1533
|
.sort((a, b) => ordre({ id: a.ticket }, { id: b.ticket }))
|
|
1516
1534
|
.map(c => ({
|
|
1517
1535
|
...c,
|
|
1518
1536
|
id: c.ticket,
|
|
1537
|
+
// The key of its stop, read before `numero` turns into its ticket's number.
|
|
1538
|
+
cle: cleDe(c),
|
|
1519
1539
|
// Its way so far, read from its kept results (`voiesDesCircuits`).
|
|
1520
1540
|
court: voies[c.ticket] === 'court',
|
|
1521
1541
|
numero: numero(c.ticket),
|
|
1522
1542
|
sujet: titre(parId.get(c.ticket)).sujet,
|
|
1523
1543
|
}));
|
|
1544
|
+
// The questions that wait for the owner (`enQuestion`), in the tickets' order, whatever AGENTS
|
|
1545
|
+
// shows of their ticket (in direct, deferred): each with the time it was carried to him, else of
|
|
1546
|
+
// its first going up (`depuis`, from the file of the stops gone up), null for a stop that file
|
|
1547
|
+
// does not hold. The head shows one line each.
|
|
1548
|
+
const chez = chezLui({ remontees });
|
|
1549
|
+
const auResponsable = [...parCircuit.values()]
|
|
1550
|
+
.filter(c => enQuestion(c, chez) === RESPONSABLE)
|
|
1551
|
+
.sort((a, b) => ordre({ id: a.ticket }, { id: b.ticket }))
|
|
1552
|
+
.map(c => {
|
|
1553
|
+
const r = remontees.find(x => x.cle === cleDe(c));
|
|
1554
|
+
return {
|
|
1555
|
+
id: c.ticket,
|
|
1556
|
+
numero: numero(c.ticket),
|
|
1557
|
+
sujet: titre(parId.get(c.ticket)).sujet,
|
|
1558
|
+
depuis: r?.chez ?? r?.depuis ?? null,
|
|
1559
|
+
};
|
|
1560
|
+
});
|
|
1524
1561
|
// The limit of circuits of the project (`limite`, its `grillhouse.circuits`): when it is held,
|
|
1525
1562
|
// the circuits that hold it waiting for the supervisor (a question to no one, or to the
|
|
1526
|
-
// supervisor; the owner's releases the place, as does a ticket deferred
|
|
1563
|
+
// supervisor; the owner's releases the place, as does a ticket deferred,
|
|
1564
|
+
// `leReportRendLaPlace`), by id.
|
|
1527
1565
|
const tenantsDeLaLimite = [...parCircuit.values()].filter(
|
|
1528
1566
|
c =>
|
|
1529
|
-
parId.get(c.ticket)
|
|
1530
|
-
(c.vivant || (attendLeSuperviseur(c) && (c.qui ?? SUPERVISEUR) !==
|
|
1567
|
+
!leReportRendLaPlace(parId.get(c.ticket), maintenant) &&
|
|
1568
|
+
(c.vivant || (attendLeSuperviseur(c) && (c.qui ?? SUPERVISEUR) !== RESPONSABLE))
|
|
1531
1569
|
);
|
|
1532
1570
|
const tenueLaLimite = limite !== null && tenantsDeLaLimite.length >= limite;
|
|
1533
1571
|
const limiteTenue = tenueLaLimite
|
|
@@ -1547,6 +1585,7 @@ export function assembler({
|
|
|
1547
1585
|
limite: limiteTenue,
|
|
1548
1586
|
circuits: lesCircuits,
|
|
1549
1587
|
remontees,
|
|
1588
|
+
auResponsable,
|
|
1550
1589
|
horsCircuit,
|
|
1551
1590
|
chantiers,
|
|
1552
1591
|
autres,
|
|
@@ -1582,6 +1621,14 @@ export const duree = ms => {
|
|
|
1582
1621
|
return min < 60 ? `${min} min` : `${Math.floor(min / 60)}h${String(min % 60).padStart(2, '0')}`;
|
|
1583
1622
|
};
|
|
1584
1623
|
|
|
1624
|
+
// The local hour of the instant <t>, « 12:44 ».
|
|
1625
|
+
const heureEtMinute = t =>
|
|
1626
|
+
new Date(t).toLocaleTimeString('fr-FR', {
|
|
1627
|
+
hour: '2-digit',
|
|
1628
|
+
minute: '2-digit',
|
|
1629
|
+
hourCycle: 'h23',
|
|
1630
|
+
});
|
|
1631
|
+
|
|
1585
1632
|
// The local day and month of the instant <t>, « 16/10 ».
|
|
1586
1633
|
const jourEtMois = t => {
|
|
1587
1634
|
const d = new Date(t);
|
|
@@ -1624,6 +1671,8 @@ function temoinDe(c, maintenant) {
|
|
|
1624
1671
|
// The sign of a ticket done by its way: a full circuit, a short one (its gesture
|
|
1625
1672
|
// played by a command, 1.1, or written by hand), a ticket led directly.
|
|
1626
1673
|
export const SIGNE_DE_LA_VOIE = Object.freeze({ complet: '●', court: '○', direct: '✎' });
|
|
1674
|
+
// The way each circuit of a view (`circuit`) gives its ticket.
|
|
1675
|
+
const VOIE_DE_LA_VUE = Object.freeze({ long: 'complet', court: 'court', direct: 'direct' });
|
|
1627
1676
|
|
|
1628
1677
|
/**
|
|
1629
1678
|
* The way of the circuit each ticket of <tickets> went, read from its kept results in the main tree
|
|
@@ -1662,9 +1711,9 @@ export function voiesDesCircuits(racine, tickets) {
|
|
|
1662
1711
|
const conso = (ms, jetons) =>
|
|
1663
1712
|
Math.round(ms / MINUTE) === 0 && !jetons ? '' : `${duree(ms)} · ${k(jetons)}`;
|
|
1664
1713
|
|
|
1665
|
-
// The columns <s> takes in a terminal: a character one,
|
|
1714
|
+
// The columns <s> takes in a terminal: a character one, ⏳, ⛔ and ❓ two, as the signs out of the
|
|
1666
1715
|
// basic plane (🔒 💤 🌙), which count two code units, take two.
|
|
1667
|
-
const colonnes = s => s.length + (s.match(/[
|
|
1716
|
+
const colonnes = s => s.length + (s.match(/[⏳⛔❓]/g)?.length ?? 0);
|
|
1668
1717
|
// The start of <s> that holds in <n> columns, a sign out of the basic plane never split.
|
|
1669
1718
|
const debutDe = (s, n) => {
|
|
1670
1719
|
let out = '';
|
|
@@ -1719,25 +1768,32 @@ const courtDuTicket = id => id.slice(id.lastIndexOf('-') + 1);
|
|
|
1719
1768
|
|
|
1720
1769
|
// The sign of a ticket's line in AGENTS, by the tone of its state: ▶ what runs, ⛔ what asks for a
|
|
1721
1770
|
// correction, ⏸ a wait, for the machine (grey) or for someone (yellow).
|
|
1722
|
-
// A circuit that runs bears the
|
|
1723
|
-
//
|
|
1724
|
-
|
|
1725
|
-
|
|
1771
|
+
// A circuit <c> that runs bears the sign of the direct way when its view says it
|
|
1772
|
+
// (`SIGNE_DE_LA_VOIE`), else the full triangle, the hollow one in a short circuit (`court`), as
|
|
1773
|
+
// its line of FAITS AUJOURD'HUI bears the full or the hollow round.
|
|
1774
|
+
const signeEnCours = c => (c.circuit === 'direct' ? SIGNE_DE_LA_VOIE.direct : c.court ? '▷' : '▶');
|
|
1775
|
+
const signeDuTon = (ton, c) =>
|
|
1776
|
+
ton === TONS.enCours ? signeEnCours(c) : ton === 'alerte' ? '⛔' : '⏸';
|
|
1726
1777
|
// The step of the circuit <c>, by its state or its stop.
|
|
1727
1778
|
const etapeDuCircuitLu = c => etapeDuCircuit({ ...c, raison: c.arret });
|
|
1728
1779
|
// A circuit that waits for the supervisor (`attendLeSuperviseur`, the one rule): who must answer
|
|
1729
1780
|
// its question, the supervisor when its stop names no one.
|
|
1730
1781
|
// A question the supervisor carried to the owner (`chez` in the file of the stops gone up) is the
|
|
1731
1782
|
// owner's.
|
|
1732
|
-
const
|
|
1733
|
-
attendLeSuperviseur(c) ? (chez.has(
|
|
1783
|
+
const destinataire = (c, chez) =>
|
|
1784
|
+
attendLeSuperviseur(c) ? (chez.has(cleDuStop(c)) ? RESPONSABLE : (c.qui ?? SUPERVISEUR)) : null;
|
|
1785
|
+
// Whether the wait of <c> on the supervisor (its question, or its end without its issue) is deferred
|
|
1786
|
+
// to a later hour (`reporteA`): the board shows it paused until then. The owner's never is.
|
|
1787
|
+
const misEnPause = (c, chez) => Boolean(c.reporteA) && destinataire(c, chez) === SUPERVISEUR;
|
|
1788
|
+
// Who the board shows <c> on a question to: no one while paused.
|
|
1789
|
+
const enQuestion = (c, chez = new Set()) => (misEnPause(c, chez) ? null : destinataire(c, chez));
|
|
1734
1790
|
const chezLui = t =>
|
|
1735
1791
|
new Set((t.remontees ?? []).filter(r => Number.isFinite(r.chez)).map(r => r.cle));
|
|
1736
1792
|
// The state at the right of the line « ⤷ Question » of the circuit <c>: « chez lui · N min » (N from
|
|
1737
1793
|
// the mark), « lue il y a N min » (from the reading), « envoyée » (in the queue of the session);
|
|
1738
1794
|
// empty when the greffon has not sent it.
|
|
1739
1795
|
const etatDeLaQuestion = (c, t) => {
|
|
1740
|
-
const r = (t.remontees ?? []).find(x => x.cle ===
|
|
1796
|
+
const r = (t.remontees ?? []).find(x => x.cle === cleDuStop(c));
|
|
1741
1797
|
const min = depuis =>
|
|
1742
1798
|
`${Math.max(0, Math.floor(((t.maintenant ?? Date.now()) - depuis) / MINUTE))} min`;
|
|
1743
1799
|
return !r
|
|
@@ -1751,15 +1807,15 @@ const etatDeLaQuestion = (c, t) => {
|
|
|
1751
1807
|
|
|
1752
1808
|
/**
|
|
1753
1809
|
* The state of each ticket's line of AGENTS on the board <t>, the one source of its signs, which
|
|
1754
|
-
* AGENTS draws and the
|
|
1810
|
+
* AGENTS draws and the status line counts. Each circuit (`circuits`, by its ticket):
|
|
1755
1811
|
* its state (`etat`, whose tone TONS gives), the reason of its wait (`raison`), its tone, its sign
|
|
1756
1812
|
* and its witness (`temoin`: the part it holds or waits for, « · <sorte> faits/prévus · <durée> »,
|
|
1757
1813
|
* « · part <sorte> · <durée> », else the progress of its automatic pass, `temoinDe`), in this
|
|
1758
|
-
* order: frozen; ended without its issue; its question (to the supervisor or to another); stopped;
|
|
1814
|
+
* order: frozen; its wait on the supervisor deferred to a later hour; ended without its issue; its question (to the supervisor or to another); stopped;
|
|
1759
1815
|
* its wait for the disk, a place, a part or its first
|
|
1760
1816
|
* state; else it runs. `lignes`: one entry per
|
|
1761
|
-
* ticket's line of AGENTS, its id
|
|
1762
|
-
* each
|
|
1817
|
+
* ticket's line of AGENTS, its id and its sign: each circuit, each ticket led in direct (▶) and
|
|
1818
|
+
* each agent shown out of a circuit (▶). `parts`: by ticket, the
|
|
1763
1819
|
* pass of each ticket AGENTS shows (circuit, direct, out of a circuit, agent), its icon (`icone`,
|
|
1764
1820
|
* 🔒 it holds a part, ⏳ it waits for one) and its text (`texte`), which the ticket's line bears.
|
|
1765
1821
|
*/
|
|
@@ -1817,12 +1873,15 @@ export function etatsDAgents(t) {
|
|
|
1817
1873
|
// A circuit that waits for the usage limit to lift (its kept report): its reason and the hour
|
|
1818
1874
|
// the usage returns, local time, apart from a ticket a person deferred.
|
|
1819
1875
|
if (c.report?.raison === 'limite-d-usage') {
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
return [
|
|
1876
|
+
return ['reporteLimite', `limite d'usage · reprise ${heureEtMinute(c.report.reprise)}`];
|
|
1877
|
+
}
|
|
1878
|
+
if (misEnPause(c, chezLui(t))) {
|
|
1879
|
+
const jour = jourEtMois(c.reporteA);
|
|
1880
|
+
const heure = heureEtMinute(c.reporteA);
|
|
1881
|
+
return [
|
|
1882
|
+
'reporteQuestion',
|
|
1883
|
+
`reporté ${jour === jourEtMois(maintenant) ? heure : `${jour} ${heure}`}`,
|
|
1884
|
+
];
|
|
1826
1885
|
}
|
|
1827
1886
|
if (!c.vivant) {
|
|
1828
1887
|
const qui = enQuestion(c, chezLui(t));
|
|
@@ -1857,13 +1916,13 @@ export function etatsDAgents(t) {
|
|
|
1857
1916
|
ton: TONS[etat],
|
|
1858
1917
|
// A question carried to the owner is his to answer: ⛔, which « toi : … question » counts.
|
|
1859
1918
|
signe:
|
|
1860
|
-
etat === 'attendLeResponsable' && chezLui(t).has(
|
|
1919
|
+
etat === 'attendLeResponsable' && chezLui(t).has(cleDuStop(c))
|
|
1861
1920
|
? '⛔'
|
|
1862
|
-
: signeDuTon(TONS[etat], c
|
|
1921
|
+
: signeDuTon(TONS[etat], c),
|
|
1863
1922
|
temoin,
|
|
1864
1923
|
});
|
|
1865
1924
|
}
|
|
1866
|
-
const ligne = (x, signe) => ({ id: x.id,
|
|
1925
|
+
const ligne = (x, signe) => ({ id: x.id, signe });
|
|
1867
1926
|
return {
|
|
1868
1927
|
circuits,
|
|
1869
1928
|
parts: partDe,
|
|
@@ -1878,15 +1937,18 @@ export function etatsDAgents(t) {
|
|
|
1878
1937
|
}
|
|
1879
1938
|
|
|
1880
1939
|
/**
|
|
1881
|
-
* The counts of the signs of AGENTS on the board <t> (`etatsDAgents`)
|
|
1882
|
-
*
|
|
1940
|
+
* The counts of the signs of AGENTS on the board <t> (`etatsDAgents`): `enCours` ▶, ▷ and ✎,
|
|
1941
|
+
* `enAttente` ⏸, `arretes` ⛔.
|
|
1883
1942
|
* @param {any} t
|
|
1884
|
-
* @param {string} [projet]
|
|
1885
1943
|
*/
|
|
1886
|
-
export function comptesDAgents(t
|
|
1887
|
-
const l = etatsDAgents(t).lignes
|
|
1944
|
+
export function comptesDAgents(t) {
|
|
1945
|
+
const l = etatsDAgents(t).lignes;
|
|
1888
1946
|
const n = s => l.filter(x => x.signe === s).length;
|
|
1889
|
-
return {
|
|
1947
|
+
return {
|
|
1948
|
+
enCours: n('▶') + n('▷') + n(SIGNE_DE_LA_VOIE.direct),
|
|
1949
|
+
enAttente: n('⏸'),
|
|
1950
|
+
arretes: n('⛔'),
|
|
1951
|
+
};
|
|
1890
1952
|
}
|
|
1891
1953
|
|
|
1892
1954
|
// The board's lines, `largeur` columns wide, each with its tone (titre, alerte, attention, actif,
|
|
@@ -1917,43 +1979,75 @@ export function lignes(t, nom, largeur = LARGEUR, groupes = {}) {
|
|
|
1917
1979
|
// The first line: the project's name, the frame's version at its right edge.
|
|
1918
1980
|
const version = versionDuPanneau();
|
|
1919
1981
|
L(version ? couper(nom.toUpperCase(), version, largeur) : nom.toUpperCase(), TONS.titre);
|
|
1920
|
-
// The state of each ticket's line of AGENTS
|
|
1982
|
+
// The state of each ticket's line of AGENTS.
|
|
1921
1983
|
const etats = etatsDAgents(t);
|
|
1922
|
-
// The
|
|
1923
|
-
// counter reads 0. « toi »: what the owner decides or validates (sans go, à valider, question:
|
|
1924
|
-
//
|
|
1925
|
-
//
|
|
1926
|
-
//
|
|
1927
|
-
|
|
1984
|
+
// The lines of the head, grouped by who acts, each with its tone from TONS; an absent
|
|
1985
|
+
// counter reads 0. « toi »: what the owner decides or validates (sans go, à valider, question:
|
|
1986
|
+
// the questions that wait for him, `auResponsable`), then one line per such question,
|
|
1987
|
+
// « ❓ <number> <subject> · depuis <HH:MM> » (« jj/mm » for another day), the subject alone cut;
|
|
1988
|
+
// « file »: the queues (● ready, ⧗ attend archi, ⊘ blocked); « en cours »: where
|
|
1989
|
+
// nobody acts (▶ in progress, ✓ done, ⏸ deferred). On a board of several projects, <projet>
|
|
1990
|
+
// names the one whose lines these are, and each line is laid under its label.
|
|
1991
|
+
const lignesDActeurs = (c, projet) => {
|
|
1928
1992
|
const n = k => c[k] ?? 0;
|
|
1993
|
+
const questions = (t.auResponsable ?? []).filter(x => x.projet === projet);
|
|
1994
|
+
const maintenant = t.maintenant ?? Date.now();
|
|
1995
|
+
const depuis = d =>
|
|
1996
|
+
d === null
|
|
1997
|
+
? ''
|
|
1998
|
+
: ` · depuis ${jourEtMois(d) === jourEtMois(maintenant) ? heureEtMinute(d) : jourEtMois(d)}`;
|
|
1999
|
+
const sousLeProjet = (texte, tete) =>
|
|
2000
|
+
cadre(projet === undefined ? texte : `${tete}${texte}`, '', largeur);
|
|
2001
|
+
const retrait = ' '.repeat(large);
|
|
1929
2002
|
return [
|
|
1930
2003
|
{
|
|
1931
|
-
texte:
|
|
1932
|
-
|
|
2004
|
+
texte: sousLeProjet(
|
|
2005
|
+
`toi : ${n('sansGo')} sans go · ${n('aValider')} à valider · ${questions.length} question`,
|
|
2006
|
+
projet === undefined ? '' : colonneDe(projet)
|
|
2007
|
+
),
|
|
2008
|
+
ton: n('sansGo')
|
|
2009
|
+
? TONS.sansGo
|
|
2010
|
+
: n('aValider') || questions.length
|
|
2011
|
+
? TONS.aValider
|
|
2012
|
+
: TONS.fermes,
|
|
1933
2013
|
},
|
|
2014
|
+
...questions.map(x => ({
|
|
2015
|
+
texte: couperAvant(
|
|
2016
|
+
`❓ ${duProjet(x)}${x.numero} ${x.sujet}`,
|
|
2017
|
+
depuis(x.depuis),
|
|
2018
|
+
'',
|
|
2019
|
+
largeur
|
|
2020
|
+
),
|
|
2021
|
+
ton: TONS.attendLeResponsable,
|
|
2022
|
+
})),
|
|
1934
2023
|
{
|
|
1935
|
-
texte:
|
|
2024
|
+
texte: sousLeProjet(
|
|
2025
|
+
`file : ● ${n('enAttente')} · ⧗ ${n('attendArchi')} · ⊘ ${n('bloques')}`,
|
|
2026
|
+
retrait
|
|
2027
|
+
),
|
|
1936
2028
|
ton: TONS.enAttente,
|
|
1937
2029
|
},
|
|
1938
2030
|
{
|
|
1939
|
-
texte:
|
|
2031
|
+
texte: sousLeProjet(
|
|
2032
|
+
`en cours : ▶ ${n('enCours')} · ✓ ${n('fermes')} · ⏸ ${n('reportes')}`,
|
|
2033
|
+
retrait
|
|
2034
|
+
),
|
|
1940
2035
|
ton: n('enCours') ? TONS.enCours : TONS.fermes,
|
|
1941
2036
|
},
|
|
1942
2037
|
];
|
|
1943
2038
|
};
|
|
1944
2039
|
if (plusieurs) {
|
|
1945
|
-
// The
|
|
1946
|
-
// label,
|
|
1947
|
-
|
|
2040
|
+
// The lines of each project, as one project's board says them: « toi » under its label, its
|
|
2041
|
+
// questions with the label on each, « file » and « en cours » aligned below; or the fault that
|
|
2042
|
+
// keeps its board out.
|
|
1948
2043
|
for (const p of t.projets) {
|
|
1949
2044
|
if (p.erreur) {
|
|
1950
2045
|
L(cadre(`${colonneDe(p.etiquette)}⚠ ${p.erreur}`, '', largeur), TONS.panne);
|
|
1951
2046
|
continue;
|
|
1952
2047
|
}
|
|
1953
|
-
const
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
);
|
|
2048
|
+
for (const x of lignesDActeurs(p.compteurs, p.etiquette)) {
|
|
2049
|
+
L(x.texte, x.ton);
|
|
2050
|
+
}
|
|
1957
2051
|
}
|
|
1958
2052
|
// The discoveries of the day, summed across the projects.
|
|
1959
2053
|
const d96 = t.decouvertes ?? { new: 0, check: 0, rejetes: 0, valides: 0 };
|
|
@@ -1980,9 +2074,9 @@ export function lignes(t, nom, largeur = LARGEUR, groupes = {}) {
|
|
|
1980
2074
|
} else {
|
|
1981
2075
|
const g = t.global;
|
|
1982
2076
|
const c = g.compteurs;
|
|
1983
|
-
//
|
|
1984
|
-
for (const x of lignesDActeurs(c
|
|
1985
|
-
L(
|
|
2077
|
+
// The lines of states, grouped by who acts.
|
|
2078
|
+
for (const x of lignesDActeurs(c)) {
|
|
2079
|
+
L(x.texte, x.ton);
|
|
1986
2080
|
}
|
|
1987
2081
|
// The discoveries of the day, one count per case: always shown, at 0 when
|
|
1988
2082
|
// nothing counts, like the other head lines.
|
|
@@ -2213,7 +2307,7 @@ export function lignes(t, nom, largeur = LARGEUR, groupes = {}) {
|
|
|
2213
2307
|
};
|
|
2214
2308
|
const ligneDuCircuit = c => {
|
|
2215
2309
|
const etape = etapeDe(c);
|
|
2216
|
-
// Its state, its sign, its reason and its witness
|
|
2310
|
+
// Its state, its sign, its reason and its witness.
|
|
2217
2311
|
const { ton, signe, raison, temoin } = etats.circuits.get(c.id);
|
|
2218
2312
|
const droite = droiteDe(
|
|
2219
2313
|
signe,
|
|
@@ -2397,7 +2491,7 @@ export function lignes(t, nom, largeur = LARGEUR, groupes = {}) {
|
|
|
2397
2491
|
: n.etat === 'attendArchi'
|
|
2398
2492
|
? 'attend archi'
|
|
2399
2493
|
: n.etat === 'enAttente'
|
|
2400
|
-
? 'en
|
|
2494
|
+
? 'en file'
|
|
2401
2495
|
: n.etat === 'reportes'
|
|
2402
2496
|
? 'reporté'
|
|
2403
2497
|
: n.etat === 'fermes'
|
|
@@ -2428,8 +2522,10 @@ export function lignes(t, nom, largeur = LARGEUR, groupes = {}) {
|
|
|
2428
2522
|
: etat === 'attendUnePlace'
|
|
2429
2523
|
? 'attend une place'
|
|
2430
2524
|
: '';
|
|
2525
|
+
// A line of the group « en file » bears the sign of its way before its number.
|
|
2526
|
+
const marge = n.etat === 'enAttente' ? ` ${SIGNE_DE_LA_VOIE[n.voie]} ` : ' ';
|
|
2431
2527
|
return {
|
|
2432
|
-
texte: cadre(
|
|
2528
|
+
texte: cadre(`${marge}${duProjet(n)}${n.numero} ${n.sujet}`, droite, largeur),
|
|
2433
2529
|
ton: TONS[etat],
|
|
2434
2530
|
ticket: n.id,
|
|
2435
2531
|
};
|
|
@@ -2521,7 +2617,7 @@ export function lignes(t, nom, largeur = LARGEUR, groupes = {}) {
|
|
|
2521
2617
|
TONS.titre
|
|
2522
2618
|
);
|
|
2523
2619
|
// Each line: the sign of its way, then « <durée> · <jetons> », « — » for a direct ticket never
|
|
2524
|
-
// claimed.
|
|
2620
|
+
// claimed that no circuit led.
|
|
2525
2621
|
const fait = x => ({
|
|
2526
2622
|
texte: cadre(
|
|
2527
2623
|
`${SIGNE_DE_LA_VOIE[x.voie] ?? SIGNE_DE_LA_VOIE.direct} ${duProjet(x)}${x.numero} ${x.sujet}`,
|
|
@@ -2667,7 +2763,7 @@ export function dernierBouge(tous, lignesDuTableau, vivants = [], maintenant = D
|
|
|
2667
2763
|
|
|
2668
2764
|
// The status line: the chantier in progress; first the alerts, counted by their signs as the board
|
|
2669
2765
|
// shows them (🌙, 💤, ⚠), then the passes that hold a part of the machine, « 🔒 <n> », and the
|
|
2670
|
-
// count of those that wait for one, « ⏳ <n> »; then the signs of AGENTS counted
|
|
2766
|
+
// count of those that wait for one, « ⏳ <n> »; then the signs of AGENTS counted
|
|
2671
2767
|
// (`comptesDAgents`), « ▶ N · ⏸ N · ⛔ N ». The alerts of the other projects of a board of several
|
|
2672
2768
|
// (<voisins>, their boards) count beside the session's, as a multi-root status bar counts the problems
|
|
2673
2769
|
// of every root; the counters and the chantier stay the session's.
|
|
@@ -2687,7 +2783,7 @@ export function ligneEtat(t, voisins = []) {
|
|
|
2687
2783
|
const a = comptesDAgents(t);
|
|
2688
2784
|
const dAgents = `▶ ${a.enCours} · ⏸ ${a.enAttente} · ⛔ ${a.arretes}`;
|
|
2689
2785
|
if (!ch) {
|
|
2690
|
-
return `${alerte}Grillhouse : ${dAgents} · ⏭ ● ${c.enAttente} ·
|
|
2786
|
+
return `${alerte}Grillhouse : ${dAgents} · ⏭ ● ${c.enAttente} · ✓ ${c.fermes}`;
|
|
2691
2787
|
}
|
|
2692
2788
|
return `${alerte}${ch.numero} ${ch.faits}/${ch.total} · ${dAgents} · ${k(t.global.jour.jetons)} aujourd'hui`;
|
|
2693
2789
|
}
|
|
@@ -2888,7 +2984,6 @@ function lire(
|
|
|
2888
2984
|
cache,
|
|
2889
2985
|
});
|
|
2890
2986
|
const jourLu = lireLeRepere(commun, maintenant);
|
|
2891
|
-
const superviseur = jetonsDuSuperviseur({ racine, home, jour: jourLu, cache });
|
|
2892
2987
|
try {
|
|
2893
2988
|
if (fichierCache) {
|
|
2894
2989
|
writeFileSync(
|
|
@@ -2906,6 +3001,7 @@ function lire(
|
|
|
2906
3001
|
...tous.filter(x => x.closed_at && Date.parse(x.closed_at) >= jour).map(x => x.id),
|
|
2907
3002
|
...lesCircuitsLus.liste.map(c => c.ticket),
|
|
2908
3003
|
]);
|
|
3004
|
+
const bilans = bilansGardes(commun ? path.dirname(commun) : racine);
|
|
2909
3005
|
const t = assembler({
|
|
2910
3006
|
tous,
|
|
2911
3007
|
prefix,
|
|
@@ -2928,12 +3024,12 @@ function lire(
|
|
|
2928
3024
|
echecPrefixe,
|
|
2929
3025
|
outil: echecDeLOutil(racine),
|
|
2930
3026
|
remontees: lireLesRemontees(racine, maintenant),
|
|
2931
|
-
|
|
3027
|
+
bilans,
|
|
2932
3028
|
externes: lireLesExternes(racine, tous),
|
|
2933
3029
|
limite: maxDuProjet(commun ? path.dirname(commun) : racine) ?? null,
|
|
2934
3030
|
lotSurMain: lotEstSurMain(commun ? path.dirname(commun) : racine),
|
|
2935
3031
|
});
|
|
2936
|
-
return { t, prefix, tous, vivants, commun };
|
|
3032
|
+
return { t, prefix, tous, vivants, commun, bilans };
|
|
2937
3033
|
}
|
|
2938
3034
|
|
|
2939
3035
|
// The places of the machine as the board shows them (`etatDesPlaces`), null when they do not read
|
|
@@ -2979,6 +3075,7 @@ export function ensemble(lus) {
|
|
|
2979
3075
|
alertes: tous('alertes'),
|
|
2980
3076
|
ciDeMain: premier.t.ciDeMain,
|
|
2981
3077
|
circuits: tous('circuits'),
|
|
3078
|
+
auResponsable: tous('auResponsable'),
|
|
2982
3079
|
horsCircuit: tous('horsCircuit'),
|
|
2983
3080
|
directs: tous('directs'),
|
|
2984
3081
|
chantiers: lisibles.flatMap(l => l.t.chantiers.map(noeud(l.etiquette))),
|
|
@@ -3218,7 +3315,7 @@ export async function tableau(
|
|
|
3218
3315
|
const lisibles = lus.filter(x => x.t);
|
|
3219
3316
|
const parProjet = lisibles.map(x => ({
|
|
3220
3317
|
dossier: x.dossier,
|
|
3221
|
-
fiches: fiches(x.tous, toutes, x.prefix, x.t.parTicket, x.t.circuits,
|
|
3318
|
+
fiches: fiches(x.tous, toutes, x.prefix, x.t.parTicket, x.t.circuits, x.bilans),
|
|
3222
3319
|
}));
|
|
3223
3320
|
return {
|
|
3224
3321
|
...t,
|