@roomi-fields/grillhouse 0.33.1 → 0.34.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 +63 -0
- package/cadre/templates/projet/CLAUDE.md +9 -3
- package/charte.md +23 -6
- package/dist/temporal/circuit/activites.d.ts +3 -1
- package/dist/temporal/circuit/activites.js +25 -1
- package/dist/temporal/circuit/activites.js.map +1 -1
- package/dist/temporal/circuit/appel.d.ts +19 -0
- package/dist/temporal/circuit/appel.js +93 -0
- package/dist/temporal/circuit/appel.js.map +1 -0
- package/dist/temporal/circuit/client.d.ts +7 -0
- package/dist/temporal/circuit/client.js +20 -0
- package/dist/temporal/circuit/client.js.map +1 -1
- package/dist/temporal/circuit/commande.js +27 -87
- package/dist/temporal/circuit/commande.js.map +1 -1
- package/dist/temporal/circuit/contrat.d.ts +19 -0
- package/dist/temporal/circuit/contrat.js +2 -0
- package/dist/temporal/circuit/contrat.js.map +1 -1
- package/dist/temporal/circuit/deroule.js +86 -11
- package/dist/temporal/circuit/deroule.js.map +1 -1
- package/dist/temporal/file/activites.d.ts +3 -0
- package/dist/temporal/file/activites.js +9 -0
- package/dist/temporal/file/activites.js.map +1 -1
- package/dist/temporal/file/contrat.d.ts +58 -0
- package/dist/temporal/file/deroule.d.ts +8 -1
- package/dist/temporal/file/deroule.js +100 -2
- package/dist/temporal/file/deroule.js.map +1 -1
- package/dist/temporal/nuits/contrat.d.ts +2 -0
- package/dist/temporal/nuits/deroule.js +3 -0
- package/dist/temporal/nuits/deroule.js.map +1 -1
- package/dist/temporal/places/activites.d.ts +8 -0
- package/dist/temporal/places/activites.js +12 -1
- package/dist/temporal/places/activites.js.map +1 -1
- package/dist/temporal/places/client.d.ts +8 -1
- package/dist/temporal/places/client.js +25 -2
- package/dist/temporal/places/client.js.map +1 -1
- package/dist/temporal/places/contrat.d.ts +35 -3
- package/dist/temporal/places/contrat.js +5 -4
- package/dist/temporal/places/contrat.js.map +1 -1
- package/dist/temporal/places/deroule.js +55 -9
- package/dist/temporal/places/deroule.js.map +1 -1
- package/dist/temporal/tickets/activites.d.ts +3 -0
- package/dist/temporal/tickets/activites.js +73 -4
- package/dist/temporal/tickets/activites.js.map +1 -1
- package/dist/temporal/tickets/contrat.d.ts +31 -0
- package/dist/temporal/tickets/deroule.js +61 -10
- package/dist/temporal/tickets/deroule.js.map +1 -1
- package/docs/ARCHITECTURE.md +213 -57
- package/docs/CADRE.md +6 -1
- package/docs/INTERFACE.md +24 -8
- package/hooks/crochet.mjs +17 -2
- package/hooks/hooks.json +24 -0
- package/package.json +1 -1
- package/scripts/activites.mjs +77 -14
- package/scripts/aiguillage.mjs +2 -0
- package/scripts/attente-a-l-arret.mjs +141 -0
- package/scripts/attente-au-tour.mjs +32 -16
- package/scripts/avancement.mjs +5 -3
- package/scripts/branche-de-nuit.mjs +63 -3
- package/scripts/circuit.mjs +57 -4
- package/scripts/circuits-du-serveur.mjs +34 -1
- package/scripts/commandes-composees.mjs +11 -4
- package/scripts/copies-finies.mjs +43 -29
- package/scripts/crochets.mjs +1 -1
- package/scripts/dette.mjs +55 -4
- package/scripts/disque-des-copies.d.mts +28 -0
- package/scripts/disque-des-copies.mjs +155 -0
- package/scripts/droits.mjs +2 -0
- package/scripts/faits-du-circuit.mjs +24 -0
- package/scripts/file-des-tickets.d.mts +16 -0
- package/scripts/file-des-tickets.mjs +65 -7
- package/scripts/gardes-du-cadre.mjs +4 -2
- package/scripts/integration/file.mjs +302 -5
- package/scripts/jointure.d.ts +33 -1
- package/scripts/langages/cargo/commandes.mjs +71 -10
- package/scripts/langages/cargo/composants.mjs +12 -4
- package/scripts/langages/cargo/executables-de-tests.mjs +118 -0
- package/scripts/langages/cargo/exemples.mjs +17 -3
- package/scripts/langages/cargo/index.mjs +8 -3
- package/scripts/langages/cargo/migrations/0.28.4-tailles-des-tests.mjs +2 -2
- package/scripts/langages/cargo/migrations/0.34.0-executables-de-tests.mjs +35 -0
- package/scripts/langages/cargo/squelette.mjs +8 -3
- package/scripts/langages/cargo/tailles-des-tests.mjs +68 -6
- package/scripts/langages/cargo/tests-de-head.mjs +12 -9
- package/scripts/langages/cargo/verdict.mjs +40 -14
- package/scripts/langages/python/commandes.mjs +11 -2
- package/scripts/langages/python/index.mjs +12 -4
- package/scripts/langages/python/verdict.mjs +8 -1
- package/scripts/langages/typescript/index.mjs +9 -2
- package/scripts/langages/typescript/resume-du-lanceur.mjs +86 -0
- package/scripts/langages/typescript/tests.mjs +1 -1
- package/scripts/langages/typescript/verdict.mjs +4 -60
- package/scripts/langages/typescript/verifier.mjs +1 -1
- package/scripts/langages/typescript/vitest-config/changements.mjs +12 -7
- package/scripts/langages/typescript/vitest-config/lances.mjs +45 -0
- package/scripts/langages/typescript/vitest-config/machine.setup.mjs +1 -0
- package/scripts/messages-non-lus.mjs +166 -0
- package/scripts/mesure-de-la-machine.mjs +7 -4
- package/scripts/migrations-des-gardes.mjs +168 -0
- package/scripts/places-de-la-machine.mjs +44 -40
- package/scripts/places-du-serveur.mjs +82 -14
- package/scripts/plafond-de-la-machine.d.mts +18 -0
- package/scripts/plafond-de-la-machine.mjs +45 -0
- package/scripts/recommencer.d.mts +4 -0
- package/scripts/recommencer.mjs +29 -0
- package/scripts/regles-des-places.d.mts +35 -0
- package/scripts/regles-des-places.mjs +82 -1
- package/scripts/resultats.mjs +38 -4
- package/scripts/retirer-les-copies-finies.mjs +11 -7
- package/scripts/seances.mjs +1 -1
- package/scripts/services-du-noyau.mjs +1 -0
- package/scripts/sous-commandes.mjs +2 -0
- package/scripts/superviseur.mjs +235 -56
- package/scripts/tableau.mjs +385 -247
- package/scripts/taches-du-graphe.mjs +32 -5
- package/scripts/ticket-du-circuit.mjs +25 -0
- package/scripts/transitions.d.mts +27 -1
- package/scripts/transitions.mjs +96 -4
- package/scripts/verrou-de-machine.mjs +41 -17
- package/skills/explorateur/SKILL.md +8 -2
- package/skills/pitmaster/SKILL.md +18 -15
- package/skills/pitmaster/references/tour.md +3 -1
- package/skills/questionneur/SKILL.md +5 -1
- package/skills/testwriter/SKILL.md +32 -6
package/scripts/tableau.mjs
CHANGED
|
@@ -14,10 +14,9 @@
|
|
|
14
14
|
// - Global: the work tickets of the project (a ticket without children; a mother is a grouping)
|
|
15
15
|
// by state, the agents' working time and tokens of the day and in all, the alerts.
|
|
16
16
|
// - Agents: the tree of the steps of the process (scripts/etapes.mjs), one block per step and
|
|
17
|
-
// sub-step, with who works there, for the whole project. A ticket stands at
|
|
18
|
-
// agent that runs on it,
|
|
19
|
-
//
|
|
20
|
-
// start of a comment).
|
|
17
|
+
// sub-step, with who works there, for the whole project. A ticket stands at a step only by its
|
|
18
|
+
// circuit (below) or by an agent that runs on it, at that agent's step; a ticket in the queue,
|
|
19
|
+
// with neither, stands at no step.
|
|
21
20
|
// - Circuits: one entry per open ticket whose circuit (scripts/circuit.mjs) runs or stopped, read
|
|
22
21
|
// from the Temporal server in one call (scripts/circuits-du-serveur.mjs, the memo of its
|
|
23
22
|
// workflow): it runs while its workflow runs with no question awaited, and stands at the step of
|
|
@@ -28,8 +27,7 @@
|
|
|
28
27
|
// « arrete », or ended without its issue), it stands under the stopped
|
|
29
28
|
// step after a line « ⤷ Question · <qui> », who must answer it, the supervisor or the owner, the
|
|
30
29
|
// supervisor when it names no question; its card opens on that question, or on the stop
|
|
31
|
-
// (its name and code) and the first line of its reason.
|
|
32
|
-
// block.
|
|
30
|
+
// (its name and code) and the first line of its reason.
|
|
33
31
|
// - Bilans: the card of a ticket whose circuit kept its bilan (scripts/bilan.mjs,
|
|
34
32
|
// `.claude/worktrees/<ticket>.bilan.json`) opens on its key figures: wall time, share lost,
|
|
35
33
|
// sessions, cost.
|
|
@@ -68,22 +66,33 @@
|
|
|
68
66
|
// without a sign, « ⚠ figée <durée> · faits/prévus », the time since its last sign, in the
|
|
69
67
|
// tone of an alert.
|
|
70
68
|
// - The lock of the machine (scripts/verrou-de-machine.mjs, read by `lireLaMesure`), as lslocks
|
|
71
|
-
// names who holds a lock and cargo says what its wait waits for
|
|
72
|
-
//
|
|
73
|
-
//
|
|
74
|
-
//
|
|
75
|
-
//
|
|
76
|
-
//
|
|
77
|
-
//
|
|
78
|
-
//
|
|
69
|
+
// names who holds a lock and cargo says what its wait waits for. A holder or a wait of a circuit
|
|
70
|
+
// AGENTS shows stands on that circuit's line, one line per ticket, in place of the progress of
|
|
71
|
+
// its pass: « · 🔒 <sorte> faits/prévus · <durée> » since it took the lock, « · ⚠ <sorte> figée
|
|
72
|
+
// <durée> · faits/prévus » past FIGEE without a sign, « · ⏳ <sorte> · <durée> » for a wait, the
|
|
73
|
+
// kind in lower case. Any other stands at the head of AGENTS: its holder, whoever it is (a pass
|
|
74
|
+
// out of a ticket, the circuit of a ticket of any project of the machine), « 🔒 <sorte> ·
|
|
75
|
+
// <projet> · <qui> · faits/prévus · <durée> », « ⚠ <sorte> figée <durée> · <projet> · <qui> ·
|
|
76
|
+
// faits/prévus »; then each pass that waits for the lock or for room under /tmp, the oldest
|
|
77
|
+
// first, « ⏳ <sorte> · <projet> · <qui> · attend · <durée> ». <qui> is its ticket without its
|
|
78
|
+
// prefix (`courtDuTicket`), else the folder of its copy (`copie`, under .claude/worktrees/, or
|
|
79
|
+
// the main tree when the project is not named); <projet> is left out for the project of the
|
|
80
|
+
// board (`ici`). The width cuts the project first, then leaves out « attend », then cuts <qui>,
|
|
81
|
+
// never the kind, the figures nor the time. Such a line
|
|
82
|
+
// is marked `avancement`, which the pane measures again more often. A circuit that waits shows
|
|
83
|
+
// ⏳ on its ticket's line, ▶ while it waits for nothing.
|
|
79
84
|
// - Signs: each sign keeps one sense (the owner's decision of 2026-11-01): ▶ in progress, ⏸ a
|
|
80
85
|
// stopped circuit, 🔒 the holder of the lock, ⏳ a wait for it or for room, 💤 a ticket claimed
|
|
81
86
|
// with nothing running, 🌙 a red night, ⚠ the alerts without a kind of their own. A sign two
|
|
82
87
|
// columns wide stands as the others, a sign then a space; the width of a line counts its
|
|
83
88
|
// columns (`colonnes`), ⏳ two.
|
|
84
|
-
// - Alerts: one
|
|
85
|
-
//
|
|
86
|
-
// anything running for 30 minutes (💤).
|
|
89
|
+
// - Alerts: one alert per open night ticket (🌙, its subject, then its number), per circuit that
|
|
90
|
+
// waits for the supervisor (⏳, how long), a shell agent silent for 10 minutes, a ticket in
|
|
91
|
+
// progress without anything running for 30 minutes (💤), each with its state (`etat`).
|
|
92
|
+
// - Tones: each state the board shows has one tone, defined once (`TONS`), which every line and
|
|
93
|
+
// every alert takes, whatever its duration or the line that shows it: red for what asks for a
|
|
94
|
+
// correction (frozen, a fault, a question with no live wait, a ceiling refused), yellow for what
|
|
95
|
+
// waits for an answer or a look (the supervisor, the owner, the disk), cyan for what runs.
|
|
87
96
|
import { execFileSync } from 'node:child_process';
|
|
88
97
|
import {
|
|
89
98
|
closeSync,
|
|
@@ -105,7 +114,6 @@ import {
|
|
|
105
114
|
etapeDuCircuit,
|
|
106
115
|
etapeDuRole,
|
|
107
116
|
libelle,
|
|
108
|
-
QUESTIONNEUR,
|
|
109
117
|
quiDe,
|
|
110
118
|
roleDeLAgent,
|
|
111
119
|
SUITE,
|
|
@@ -113,9 +121,14 @@ import {
|
|
|
113
121
|
} from './etapes.mjs';
|
|
114
122
|
import { echecDeLOutil } from './aiguillage.mjs';
|
|
115
123
|
import { bilansGardes, enBref } from './bilan.mjs';
|
|
116
|
-
import { verdictDe } from './integration/verdict.mjs';
|
|
117
124
|
import { lireLaMesure } from './avancement.mjs';
|
|
118
|
-
import {
|
|
125
|
+
import {
|
|
126
|
+
SANS_REPONSE_EN,
|
|
127
|
+
ServeurMuet,
|
|
128
|
+
circuitsDuServeur,
|
|
129
|
+
nuitDuServeur,
|
|
130
|
+
} from './circuits-du-serveur.mjs';
|
|
131
|
+
import { enFileSansArchitecture } from './file-des-tickets.mjs';
|
|
119
132
|
import { etatDesPlaces } from './places-de-la-machine.mjs';
|
|
120
133
|
import { vivant } from './mesure/base-de-passe.mjs';
|
|
121
134
|
|
|
@@ -150,6 +163,46 @@ export const ETATS = [
|
|
|
150
163
|
{ cle: 'reportes', nom: 'reporté', sens: 'mis de côté' },
|
|
151
164
|
{ cle: 'fermes', nom: 'fait', sens: 'fermé' },
|
|
152
165
|
];
|
|
166
|
+
// The tone of each state the board shows, defined once: as a dashboard of states (GitHub Checks,
|
|
167
|
+
// Alertmanager), the severity belongs to the state, never to its duration nor to the line that
|
|
168
|
+
// shows it; the duration stays in the text. Every line and every alert takes its tone here:
|
|
169
|
+
// `alerte` (red), what asks for a correction; `attention` (yellow), what waits for an answer or a
|
|
170
|
+
// look; `actif` (cyan), what runs; `discret`, what is done, empty or a measure; `titre`, a
|
|
171
|
+
// heading; none, a ticket at rest. The pane turns each tone into its colour (mods/grillhouse
|
|
172
|
+
// `couleur`).
|
|
173
|
+
export const TONS = Object.freeze({
|
|
174
|
+
// A ticket's state (ETATS).
|
|
175
|
+
enCours: 'actif',
|
|
176
|
+
enAttente: undefined,
|
|
177
|
+
bloques: undefined,
|
|
178
|
+
sansGo: 'attention',
|
|
179
|
+
aValider: 'attention',
|
|
180
|
+
reportes: undefined,
|
|
181
|
+
fermes: 'discret',
|
|
182
|
+
// A circuit, a pass, a wait.
|
|
183
|
+
attendUnePlace: 'attention',
|
|
184
|
+
attendLeVerrou: 'actif',
|
|
185
|
+
enDirect: 'actif',
|
|
186
|
+
nuitEnCours: 'actif',
|
|
187
|
+
attendLeDisque: 'attention',
|
|
188
|
+
attendLeSuperviseur: 'attention',
|
|
189
|
+
attendLeResponsable: 'attention',
|
|
190
|
+
arrete: 'attention',
|
|
191
|
+
sansRienQuiTourne: 'attention',
|
|
192
|
+
silencieux: 'attention',
|
|
193
|
+
sansArchitecture: 'attention',
|
|
194
|
+
outilNonInstallable: 'attention',
|
|
195
|
+
machineChargee: 'attention',
|
|
196
|
+
fige: 'alerte',
|
|
197
|
+
panne: 'alerte',
|
|
198
|
+
nuitRouge: 'alerte',
|
|
199
|
+
sansAttente: 'alerte',
|
|
200
|
+
plafondRefuse: 'alerte',
|
|
201
|
+
// The layout.
|
|
202
|
+
titre: 'titre',
|
|
203
|
+
vide: 'discret',
|
|
204
|
+
mesure: 'discret',
|
|
205
|
+
});
|
|
153
206
|
const enTirets = p => p.replace(/[^A-Za-z0-9]/g, '-');
|
|
154
207
|
|
|
155
208
|
// The origins of an incoming message: the person, another agent, a notification, the supervisor
|
|
@@ -682,44 +735,6 @@ export function attenteVivante(racine) {
|
|
|
682
735
|
// The minutes between two presentations of a question not answered, by default.
|
|
683
736
|
export const RAPPEL_PAR_DEFAUT = 5;
|
|
684
737
|
|
|
685
|
-
// The reviewer's last verdict among a ticket's comments (verdictDe: a comment of the reviewer's
|
|
686
|
-
// author), or null.
|
|
687
|
-
export function verdict(commentaires) {
|
|
688
|
-
let v = null;
|
|
689
|
-
for (const c of [...commentaires].sort(
|
|
690
|
-
(a, b) => Date.parse(a.created_at) - Date.parse(b.created_at)
|
|
691
|
-
)) {
|
|
692
|
-
const lu = verdictDe(c);
|
|
693
|
-
if (lu) {
|
|
694
|
-
v = { verdict: lu, date: Date.parse(c.created_at) };
|
|
695
|
-
}
|
|
696
|
-
}
|
|
697
|
-
return v;
|
|
698
|
-
}
|
|
699
|
-
|
|
700
|
-
// The role a ticket waits for, from the roles of the flow that ran on it (finished, oldest first)
|
|
701
|
-
// and the reviewer's last verdict; null when it waits for none: an accepted lot waits for no
|
|
702
|
-
// agent, the circuit integrates it (scripts/circuit.mjs).
|
|
703
|
-
export function etape(passages, v) {
|
|
704
|
-
const faits = passages.filter(p => etapeDuRole(p.role) && p.role !== QUESTIONNEUR);
|
|
705
|
-
const dernier = faits[faits.length - 1];
|
|
706
|
-
if (!dernier) {
|
|
707
|
-
return 'testwriter';
|
|
708
|
-
}
|
|
709
|
-
const fin = Date.parse(dernier.fin);
|
|
710
|
-
const jugé = v && v.date >= fin ? v.verdict : null;
|
|
711
|
-
if (dernier.role === 'testwriter') {
|
|
712
|
-
return 'developpeur';
|
|
713
|
-
}
|
|
714
|
-
if (dernier.role === 'developpeur') {
|
|
715
|
-
return jugé === 'ACCEPTÉ' ? null : jugé === 'RENDU' ? 'developpeur' : 'relecteur';
|
|
716
|
-
}
|
|
717
|
-
if (dernier.role === 'relecteur') {
|
|
718
|
-
return v?.verdict === 'ACCEPTÉ' ? null : 'developpeur';
|
|
719
|
-
}
|
|
720
|
-
return null;
|
|
721
|
-
}
|
|
722
|
-
|
|
723
738
|
// A ticket's number, subject and component: its title « number — subject — component » when
|
|
724
739
|
// the number ends its id, else its id without the prefix and its whole title.
|
|
725
740
|
export function lecture(t, prefix) {
|
|
@@ -742,9 +757,10 @@ export function lecture(t, prefix) {
|
|
|
742
757
|
|
|
743
758
|
/**
|
|
744
759
|
* Who holds the lock of the machine, or waits for it, as the board shows it (`lireLaMesure` of
|
|
745
|
-
* scripts/avancement.mjs, its project named as the board names it, `nommerLesProjets`
|
|
746
|
-
*
|
|
747
|
-
*
|
|
760
|
+
* scripts/avancement.mjs, its project named as the board names it, `nommerLesProjets`; `copie`,
|
|
761
|
+
* its working tree; `ici`, it is of the board's project).
|
|
762
|
+
* @typedef {{ depot?: string | null, copie?: string | null, ici?: boolean, projet: string,
|
|
763
|
+
* ticket: string | null, sorte: string, depuis: number | null, quoi?: string,
|
|
748
764
|
* avancement?: { faits: number, prevus: number, debut?: number, dernier: number } | null }} DuVerrou
|
|
749
765
|
* @typedef {{ detenteur: DuVerrou | null, attentes: DuVerrou[] }} Machine
|
|
750
766
|
*/
|
|
@@ -753,15 +769,19 @@ export function lecture(t, prefix) {
|
|
|
753
769
|
* The board, from what was read. Pure: every source comes in, the time included; `machine`, the
|
|
754
770
|
* lock of the machine; `outil`, the failed installation of the published version that leads the
|
|
755
771
|
* repository (scripts/aiguillage.mjs `echecDeLOutil`); `places`, the places of the machine
|
|
756
|
-
* (scripts/places-de-la-machine.mjs `etatDesPlaces`), whose line heads AGENTS; `
|
|
772
|
+
* (scripts/places-de-la-machine.mjs `etatDesPlaces`), whose line heads AGENTS; `nuit`, the night
|
|
773
|
+
* under way on the machine (scripts/circuits-du-serveur.mjs `nuitDuServeur`), its line under the
|
|
774
|
+
* places'; `muet`, the Temporal
|
|
757
775
|
* server did not answer the reading of the circuits, which the first alert says; `faute`, any
|
|
758
776
|
* other fault of that reading, said in the first alert as it is; `echecPrefixe`, the cause of a
|
|
759
777
|
* ticket prefix that did not read, named in an alert.
|
|
760
778
|
* @param {{ tous: any[], prefix?: string, registre: any[], vivants: any[], circuits?: any[],
|
|
761
|
-
*
|
|
779
|
+
* maintenant: number, jour: number,
|
|
762
780
|
* machine?: Machine | null, outil?: { version: string, raison: string } | null,
|
|
763
|
-
* places?: { prises: number, plafond: number,
|
|
764
|
-
*
|
|
781
|
+
* places?: { prises: number, plafond: number, faute?: string | null, charge: number,
|
|
782
|
+
* coeurs: number, memoireGo: number, memoireTotaleGo: number, attentes: { ticket: string,
|
|
783
|
+
* depuis: number, disque?: string | null }[] } | null,
|
|
784
|
+
* nuit?: { racine: string, depuis: number | null } | null, muet?: boolean, faute?: string | null,
|
|
765
785
|
* echecPrefixe?: string | null }} lu
|
|
766
786
|
*/
|
|
767
787
|
export function assembler({
|
|
@@ -770,17 +790,16 @@ export function assembler({
|
|
|
770
790
|
registre: lignesDuRegistre,
|
|
771
791
|
vivants,
|
|
772
792
|
circuits = [],
|
|
773
|
-
verdicts = {},
|
|
774
793
|
maintenant,
|
|
775
794
|
jour,
|
|
776
795
|
machine = null,
|
|
777
796
|
outil = null,
|
|
778
797
|
places: placesDeLaMachine = null,
|
|
798
|
+
nuit: nuitEnCours = null,
|
|
779
799
|
muet = false,
|
|
780
800
|
faute = null,
|
|
781
801
|
echecPrefixe = null,
|
|
782
802
|
remontees = [],
|
|
783
|
-
rappel = RAPPEL_PAR_DEFAUT,
|
|
784
803
|
attenteVivante: attenteQuiVit = true,
|
|
785
804
|
}) {
|
|
786
805
|
// A circuit's lines are its steps, no agent's passage.
|
|
@@ -1035,12 +1054,6 @@ export function assembler({
|
|
|
1035
1054
|
const etats = etatsDe(duChantier);
|
|
1036
1055
|
|
|
1037
1056
|
// Agents.
|
|
1038
|
-
const passages = new Map();
|
|
1039
|
-
for (const r of [...registre].sort((a, b) => Date.parse(a.fin) - Date.parse(b.fin))) {
|
|
1040
|
-
if (r.ticket) {
|
|
1041
|
-
(passages.get(r.ticket) ?? passages.set(r.ticket, []).get(r.ticket)).push(r);
|
|
1042
|
-
}
|
|
1043
|
-
}
|
|
1044
1057
|
// One block per step and sub-step, in the order of the steps, with who works there.
|
|
1045
1058
|
const blocs = SUITE.map(e => ({
|
|
1046
1059
|
numero: e.numero,
|
|
@@ -1048,20 +1061,17 @@ export function assembler({
|
|
|
1048
1061
|
roles: e.qui.filter(r => r !== AUTO),
|
|
1049
1062
|
qui: quiDe(e),
|
|
1050
1063
|
enCours: [],
|
|
1051
|
-
attend: [],
|
|
1052
1064
|
}));
|
|
1053
1065
|
const bloc = role => {
|
|
1054
1066
|
const e = etapeDuRole(role);
|
|
1055
1067
|
return e ? blocs.find(b => b.numero === e.numero) : undefined;
|
|
1056
1068
|
};
|
|
1057
|
-
const places = new Set();
|
|
1058
1069
|
// One line per ticket: a ticket on which a role agent runs stands at its step.
|
|
1059
1070
|
for (const v of enCoursMesures) {
|
|
1060
1071
|
const t = v.ticket && parId.get(v.ticket);
|
|
1061
1072
|
if (!t || !bloc(v.role)) {
|
|
1062
1073
|
continue;
|
|
1063
1074
|
}
|
|
1064
|
-
places.add(t.id);
|
|
1065
1075
|
bloc(v.role).enCours.push({
|
|
1066
1076
|
id: t.id,
|
|
1067
1077
|
numero: numero(t.id),
|
|
@@ -1073,36 +1083,6 @@ export function assembler({
|
|
|
1073
1083
|
...mesure(new Set([t.id])),
|
|
1074
1084
|
});
|
|
1075
1085
|
}
|
|
1076
|
-
// A ticket waits in AGENTS only with the owner's go (`circuit`): ready, blocked, or claimed with
|
|
1077
|
-
// nothing running; a ticket without it stands in CHANTIER alone; a ticket with a circuit, running
|
|
1078
|
-
// or stopped, stands in its circuit's entry, never waiting. The flow's deduction places the
|
|
1079
|
-
// others, and a ticket no agent took yet waits for the testwriter, the circuit's first agent.
|
|
1080
|
-
for (const t of [...tous].sort(ordre)) {
|
|
1081
|
-
if (
|
|
1082
|
-
!travail(t) ||
|
|
1083
|
-
places.has(t.id) ||
|
|
1084
|
-
parCircuit.has(t.id) ||
|
|
1085
|
-
['fermes', 'reportes', 'aValider', 'sansGo'].includes(etat(t)) ||
|
|
1086
|
-
!circuit(t)
|
|
1087
|
-
) {
|
|
1088
|
-
continue;
|
|
1089
|
-
}
|
|
1090
|
-
const p = passages.get(t.id) ?? [];
|
|
1091
|
-
// Claimed without any passage, the ticket keeps its line in its chantier.
|
|
1092
|
-
if (p.length === 0 && t.status === 'in_progress') {
|
|
1093
|
-
continue;
|
|
1094
|
-
}
|
|
1095
|
-
const r = etape(p, verdicts[t.id] ?? null);
|
|
1096
|
-
if (r && bloc(r)) {
|
|
1097
|
-
bloc(r).attend.push({
|
|
1098
|
-
id: t.id,
|
|
1099
|
-
numero: numero(t.id),
|
|
1100
|
-
sujet: titre(t).sujet,
|
|
1101
|
-
bloquePar: bloquePar(t),
|
|
1102
|
-
...mesure(new Set([t.id])),
|
|
1103
|
-
});
|
|
1104
|
-
}
|
|
1105
|
-
}
|
|
1106
1086
|
const debutJour = jour;
|
|
1107
1087
|
const faitsDuJour = tous
|
|
1108
1088
|
.filter(
|
|
@@ -1121,18 +1101,19 @@ export function assembler({
|
|
|
1121
1101
|
...mesure(new Set([t.id])),
|
|
1122
1102
|
}));
|
|
1123
1103
|
|
|
1124
|
-
// Alerts.
|
|
1104
|
+
// Alerts, each with its state (`etat`) and the tone of that state (TONS).
|
|
1125
1105
|
const alertes = [];
|
|
1106
|
+
const alerter = (etat, champs) => alertes.push({ etat, ton: TONS[etat], ...champs });
|
|
1126
1107
|
// The Temporal server does not answer: the board shows the tickets without their circuits, and
|
|
1127
1108
|
// its first alert names the command that tells the state of the service.
|
|
1128
1109
|
if (muet) {
|
|
1129
|
-
|
|
1110
|
+
alerter('panne', { texte: `${SANS_REPONSE_EN} · temporal etat` });
|
|
1130
1111
|
} else if (faute) {
|
|
1131
|
-
|
|
1112
|
+
alerter('panne', { texte: `Circuits illisibles : ${faute}` });
|
|
1132
1113
|
}
|
|
1133
1114
|
// The ticket prefix did not read: the project keeps its folder's name, and the alert says why.
|
|
1134
1115
|
if (echecPrefixe) {
|
|
1135
|
-
|
|
1116
|
+
alerter('panne', { texte: `Préfixe des tickets illisible : ${echecPrefixe}` });
|
|
1136
1117
|
}
|
|
1137
1118
|
// A red night says the night it turned red, short enough to stand whole on its line: the local
|
|
1138
1119
|
// day and month its ticket was opened, the night's date (scripts/nuit.sh), whatever its title names, a
|
|
@@ -1144,8 +1125,7 @@ export function assembler({
|
|
|
1144
1125
|
/^La nuit est rouge\b/.test(titreLu) && !Number.isNaN(ouvert)
|
|
1145
1126
|
? `Nuit rouge depuis le ${jourEtMois(ouvert)}`
|
|
1146
1127
|
: titreLu;
|
|
1147
|
-
|
|
1148
|
-
niveau: 'rouge',
|
|
1128
|
+
alerter('nuitRouge', {
|
|
1149
1129
|
signe: '🌙',
|
|
1150
1130
|
texte: `${sujet} ${n}`,
|
|
1151
1131
|
sujet,
|
|
@@ -1156,16 +1136,15 @@ export function assembler({
|
|
|
1156
1136
|
// The published version that leads the repository cannot be installed: the orchestration runs on
|
|
1157
1137
|
// the code of the repository (scripts/aiguillage.mjs).
|
|
1158
1138
|
if (outil) {
|
|
1159
|
-
|
|
1160
|
-
niveau: 'orange',
|
|
1139
|
+
alerter('outilNonInstallable', {
|
|
1161
1140
|
signe: '🧰',
|
|
1162
1141
|
texte: `Outil ${outil.version} non installable : code du dépôt`,
|
|
1163
1142
|
});
|
|
1164
1143
|
}
|
|
1165
|
-
// A circuit stopped on a question to the supervisor:
|
|
1166
|
-
// `depuis` of its stop in the file of the stops gone up)
|
|
1167
|
-
//
|
|
1168
|
-
//
|
|
1144
|
+
// A circuit stopped on a question to the supervisor: the tone of that wait, whatever its length,
|
|
1145
|
+
// and how long it has waited (from the `depuis` of its stop in the file of the stops gone up);
|
|
1146
|
+
// it falls when the circuit leaves the stop. One alert « à corriger » when some wait and no wait
|
|
1147
|
+
// lives.
|
|
1169
1148
|
const depuisDe = new Map(remontees.map(r => [r.cle, r.depuis]));
|
|
1170
1149
|
const enAttenteDuSuperviseur = [...parCircuit.values()]
|
|
1171
1150
|
.filter(attendLeSuperviseur)
|
|
@@ -1176,25 +1155,30 @@ export function assembler({
|
|
|
1176
1155
|
continue;
|
|
1177
1156
|
}
|
|
1178
1157
|
const attendu = Math.max(0, maintenant - depuis);
|
|
1179
|
-
|
|
1180
|
-
niveau: attendu > 2 * rappel * MINUTE ? 'rouge' : 'orange',
|
|
1158
|
+
alerter('attendLeSuperviseur', {
|
|
1181
1159
|
signe: '⏳',
|
|
1182
1160
|
texte: `${numero(c.ticket)} attend le superviseur depuis ${Math.floor(attendu / MINUTE)} min`,
|
|
1183
1161
|
});
|
|
1184
1162
|
}
|
|
1185
1163
|
if (enAttenteDuSuperviseur.length && !attenteQuiVit) {
|
|
1186
|
-
|
|
1187
|
-
niveau: 'rouge',
|
|
1164
|
+
alerter('sansAttente', {
|
|
1188
1165
|
signe: '🔕',
|
|
1189
1166
|
texte:
|
|
1190
1167
|
'À corriger : une question au superviseur reste sans réponse, aucune attente ne tourne',
|
|
1191
1168
|
});
|
|
1192
1169
|
}
|
|
1170
|
+
// The tickets of the queue without their section « ## Architecture », which the queue never
|
|
1171
|
+
// starts (scripts/file-des-tickets.mjs): one line names them all, for the supervisor to write it.
|
|
1172
|
+
const sansArchitecture = enFileSansArchitecture(tous, { enCours: new Set(parCircuit.keys()) });
|
|
1173
|
+
if (sansArchitecture.length) {
|
|
1174
|
+
alerter('sansArchitecture', {
|
|
1175
|
+
texte: `En file sans architecture : ${sansArchitecture.map(t => numero(t.id)).join(', ')}`,
|
|
1176
|
+
});
|
|
1177
|
+
}
|
|
1193
1178
|
for (const b of blocs) {
|
|
1194
1179
|
for (const x of b.enCours) {
|
|
1195
1180
|
if (x.ligne && x.silence !== null && x.silence > SILENCE) {
|
|
1196
|
-
|
|
1197
|
-
niveau: 'orange',
|
|
1181
|
+
alerter('silencieux', {
|
|
1198
1182
|
texte: `${x.numero}, agent ${b.numero} silencieux depuis ${Math.round(x.silence / MINUTE)} min`,
|
|
1199
1183
|
});
|
|
1200
1184
|
}
|
|
@@ -1220,8 +1204,7 @@ export function assembler({
|
|
|
1220
1204
|
t.started_at &&
|
|
1221
1205
|
maintenant - Date.parse(t.started_at) > SANS_AGENT
|
|
1222
1206
|
) {
|
|
1223
|
-
|
|
1224
|
-
niveau: 'orange',
|
|
1207
|
+
alerter('sansRienQuiTourne', {
|
|
1225
1208
|
signe: '💤',
|
|
1226
1209
|
texte: `${numero(t.id)} en cours sans rien qui tourne`,
|
|
1227
1210
|
});
|
|
@@ -1231,8 +1214,48 @@ export function assembler({
|
|
|
1231
1214
|
const parTicket = Object.fromEntries(
|
|
1232
1215
|
[...new Set(mesures.map(m => m.ticket).filter(Boolean))].map(id => [id, mesure(new Set([id]))])
|
|
1233
1216
|
);
|
|
1234
|
-
// The
|
|
1217
|
+
// The tickets worked out of a circuit: claimed (`in_progress`), no circuit on the server that
|
|
1218
|
+
// holds them, a mother of theirs or a ticket under them (a circuit holds its ticket's mothers and
|
|
1219
|
+
// children): one that runs or waits for an answer (`attendLeSuperviseur`), never one the
|
|
1220
|
+
// supervisor stopped; or labelled `direct`, open or claimed (led out of the circuit); and no role
|
|
1221
|
+
// agent shown at a step. None while the circuits do not read (a
|
|
1222
|
+
// silent server, a fault), when no ticket can be told out of a circuit.
|
|
1223
|
+
const aUneEtape = new Set(blocs.flatMap(b => b.enCours.map(x => x.id)));
|
|
1224
|
+
const tenus = new Set(
|
|
1225
|
+
[...parCircuit.values()].filter(c => c.vivant || attendLeSuperviseur(c)).map(c => c.ticket)
|
|
1226
|
+
);
|
|
1227
|
+
const sousUnCircuit = t => tenus.has(t.id) || (enfants.get(t.id) ?? []).some(sousUnCircuit);
|
|
1228
|
+
const dansUnCircuit = t => {
|
|
1229
|
+
for (let m = parId.get(t.parent); m; m = parId.get(m.parent)) {
|
|
1230
|
+
if (tenus.has(m.id)) {
|
|
1231
|
+
return true;
|
|
1232
|
+
}
|
|
1233
|
+
}
|
|
1234
|
+
return sousUnCircuit(t);
|
|
1235
|
+
};
|
|
1236
|
+
const horsCircuit =
|
|
1237
|
+
muet || faute
|
|
1238
|
+
? []
|
|
1239
|
+
: tous
|
|
1240
|
+
.filter(
|
|
1241
|
+
t =>
|
|
1242
|
+
travail(t) &&
|
|
1243
|
+
!aUneEtape.has(t.id) &&
|
|
1244
|
+
((t.status === 'in_progress' && !dansUnCircuit(t)) ||
|
|
1245
|
+
((t.labels ?? []).includes('direct') &&
|
|
1246
|
+
(t.status === 'open' || t.status === 'in_progress')))
|
|
1247
|
+
)
|
|
1248
|
+
.sort(ordre)
|
|
1249
|
+
.map(t => ({
|
|
1250
|
+
id: t.id,
|
|
1251
|
+
numero: numero(t.id),
|
|
1252
|
+
sujet: titre(t).sujet,
|
|
1253
|
+
qui: t.assignee || null,
|
|
1254
|
+
}));
|
|
1255
|
+
// The circuits, in the tickets' order; a ticket worked in direct has its line alone.
|
|
1256
|
+
const enDirect = new Set(horsCircuit.map(x => x.id));
|
|
1235
1257
|
const lesCircuits = [...parCircuit.values()]
|
|
1258
|
+
.filter(c => !enDirect.has(c.ticket))
|
|
1236
1259
|
.sort((a, b) => ordre({ id: a.ticket }, { id: b.ticket }))
|
|
1237
1260
|
.map(c => ({
|
|
1238
1261
|
...c,
|
|
@@ -1244,12 +1267,14 @@ export function assembler({
|
|
|
1244
1267
|
global,
|
|
1245
1268
|
alertes,
|
|
1246
1269
|
circuits: lesCircuits,
|
|
1270
|
+
horsCircuit,
|
|
1247
1271
|
chantiers,
|
|
1248
1272
|
autres,
|
|
1249
1273
|
agents: blocs,
|
|
1250
1274
|
maintenant,
|
|
1251
1275
|
machine,
|
|
1252
1276
|
places: placesDeLaMachine,
|
|
1277
|
+
nuit: nuitEnCours,
|
|
1253
1278
|
faitsDuJour,
|
|
1254
1279
|
etats,
|
|
1255
1280
|
parTicket,
|
|
@@ -1376,12 +1401,12 @@ export function lignes(t, nom, largeur = LARGEUR, groupes = {}) {
|
|
|
1376
1401
|
// The labels' column of the head and of AGENTS, « [OB] », « [OSD] ».
|
|
1377
1402
|
const large = Math.max(0, ...(t.projets ?? []).map(p => p.etiquette.length + 3));
|
|
1378
1403
|
const colonneDe = etiquette => `[${etiquette}]`.padEnd(large);
|
|
1379
|
-
L(nom.toUpperCase(),
|
|
1404
|
+
L(nom.toUpperCase(), TONS.titre);
|
|
1380
1405
|
if (plusieurs) {
|
|
1381
1406
|
// One line per project: its counters, or the fault that keeps its board out.
|
|
1382
1407
|
for (const p of t.projets) {
|
|
1383
1408
|
if (p.erreur) {
|
|
1384
|
-
L(cadre(`${colonneDe(p.etiquette)}⚠ ${p.erreur}`, '', largeur),
|
|
1409
|
+
L(cadre(`${colonneDe(p.etiquette)}⚠ ${p.erreur}`, '', largeur), TONS.panne);
|
|
1385
1410
|
continue;
|
|
1386
1411
|
}
|
|
1387
1412
|
const c = p.compteurs;
|
|
@@ -1401,7 +1426,7 @@ export function lignes(t, nom, largeur = LARGEUR, groupes = {}) {
|
|
|
1401
1426
|
'',
|
|
1402
1427
|
largeur
|
|
1403
1428
|
),
|
|
1404
|
-
|
|
1429
|
+
TONS.mesure
|
|
1405
1430
|
);
|
|
1406
1431
|
} else {
|
|
1407
1432
|
const g = t.global;
|
|
@@ -1416,7 +1441,7 @@ export function lignes(t, nom, largeur = LARGEUR, groupes = {}) {
|
|
|
1416
1441
|
);
|
|
1417
1442
|
L(
|
|
1418
1443
|
cadre(`${c.sansGo} sans go · ${c.aValider} à valider · ${c.reportes} reportés`, '', largeur),
|
|
1419
|
-
c.sansGo
|
|
1444
|
+
c.sansGo ? TONS.sansGo : c.aValider ? TONS.aValider : TONS.reportes
|
|
1420
1445
|
);
|
|
1421
1446
|
// The discoveries of the day, one count per case (grillhouse-3uv.96): always shown, at 0 when
|
|
1422
1447
|
// nothing counts, like the other head lines.
|
|
@@ -1427,7 +1452,7 @@ export function lignes(t, nom, largeur = LARGEUR, groupes = {}) {
|
|
|
1427
1452
|
'',
|
|
1428
1453
|
largeur
|
|
1429
1454
|
),
|
|
1430
|
-
|
|
1455
|
+
TONS.mesure
|
|
1431
1456
|
);
|
|
1432
1457
|
L(
|
|
1433
1458
|
cadre(
|
|
@@ -1435,7 +1460,7 @@ export function lignes(t, nom, largeur = LARGEUR, groupes = {}) {
|
|
|
1435
1460
|
'',
|
|
1436
1461
|
largeur
|
|
1437
1462
|
),
|
|
1438
|
-
|
|
1463
|
+
TONS.mesure
|
|
1439
1464
|
);
|
|
1440
1465
|
}
|
|
1441
1466
|
// An alert of several projects' board names its ticket by its whole id.
|
|
@@ -1445,75 +1470,136 @@ export function lignes(t, nom, largeur = LARGEUR, groupes = {}) {
|
|
|
1445
1470
|
droite
|
|
1446
1471
|
? cadre(`${signeDe(a)} ${duProjet(a)}${a.sujet}`, droite, largeur)
|
|
1447
1472
|
: cadre(`${signeDe(a)} ${duProjet(a)}${a.texte}`, '', largeur),
|
|
1448
|
-
a.
|
|
1473
|
+
a.ton
|
|
1449
1474
|
);
|
|
1450
1475
|
}
|
|
1451
1476
|
|
|
1452
1477
|
L('', undefined);
|
|
1453
|
-
L('AGENTS ▶ en cours · en attente',
|
|
1454
|
-
// The lock of the machine (scripts/avancement.mjs `lireLaMesure`)
|
|
1455
|
-
//
|
|
1456
|
-
//
|
|
1457
|
-
//
|
|
1458
|
-
//
|
|
1459
|
-
//
|
|
1478
|
+
L('AGENTS ▶ en cours · en attente', TONS.titre);
|
|
1479
|
+
// The lock of the machine (scripts/avancement.mjs `lireLaMesure`): a holder or a wait of a
|
|
1480
|
+
// circuit shown stands on its line (`verrouDe`); any other at the head: its holder, whoever it
|
|
1481
|
+
// is, « 🔒 <sorte> · <projet> · <qui> · faits/prévus · <durée> », the time since it took the
|
|
1482
|
+
// lock, the figures when it has them; past FIGEE without a sign of its progress « ⚠ <sorte>
|
|
1483
|
+
// figée <durée> · <projet> · <qui> · faits/prévus », in the tone of an alert. Then each wait,
|
|
1484
|
+
// the oldest first, « ⏳ <sorte> · <projet> · <qui> · attend · <durée> ».
|
|
1460
1485
|
const maintenant = t.maintenant ?? Date.now();
|
|
1461
1486
|
// The places of the machine (scripts/places-de-la-machine.mjs), the first line of AGENTS:
|
|
1462
|
-
// « Places 3/3 · charge 11,2/12 · mémoire 9 Go », the places taken of the ceiling, the load
|
|
1463
|
-
// one minute of the cores, the free memory
|
|
1487
|
+
// « Places 3/3 · charge 11,2/12 · mémoire 9/30 Go », the places taken of the ceiling, the load
|
|
1488
|
+
// over one minute of the cores, the free memory of the total; a value of the ceiling the poste names and the
|
|
1489
|
+
// server refused, in place of the load and the memory, by its name.
|
|
1464
1490
|
const p = t.places;
|
|
1465
1491
|
if (p) {
|
|
1466
1492
|
const nb = n => (Number.isInteger(n) ? String(n) : n.toFixed(1).replace('.', ','));
|
|
1467
1493
|
poser({
|
|
1468
1494
|
texte: cadre(
|
|
1469
|
-
`Places ${p.prises}/${p.plafond} · charge ${nb(p.charge)}/${p.coeurs} · mémoire ${p.memoireGo} Go`,
|
|
1495
|
+
`Places ${p.prises}/${p.plafond} · ${p.faute ? `plafond refusé : ${p.faute}` : `charge ${nb(p.charge)}/${p.coeurs} · mémoire ${p.memoireGo}/${p.memoireTotaleGo} Go`}`,
|
|
1470
1496
|
'',
|
|
1471
1497
|
largeur
|
|
1472
1498
|
),
|
|
1473
|
-
ton: p.charge >= p.coeurs ?
|
|
1499
|
+
ton: p.faute ? TONS.plafondRefuse : p.charge >= p.coeurs ? TONS.machineChargee : TONS.mesure,
|
|
1500
|
+
});
|
|
1501
|
+
// A ticket that waits for the disk of its project's copies: what holds it, the ticket named.
|
|
1502
|
+
for (const w of (p.attentes ?? []).filter(x => x.disque)) {
|
|
1503
|
+
poser({
|
|
1504
|
+
texte: cadre(`⏳ ${courtDuTicket(w.ticket)} · ${w.disque}`, '', largeur),
|
|
1505
|
+
ton: TONS.attendLeDisque,
|
|
1506
|
+
ticket: w.ticket,
|
|
1507
|
+
});
|
|
1508
|
+
}
|
|
1509
|
+
}
|
|
1510
|
+
// The night under way on the machine, under the places: « 🌙 nuit · <projet> · depuis <durée> »,
|
|
1511
|
+
// its project by its folder's name, the time since it started when the server gives it.
|
|
1512
|
+
if (t.nuit) {
|
|
1513
|
+
const depuis =
|
|
1514
|
+
typeof t.nuit.depuis === 'number' ? ` · depuis ${duree(maintenant - t.nuit.depuis)}` : '';
|
|
1515
|
+
poser({
|
|
1516
|
+
texte: couperAvant(`🌙 nuit · ${path.basename(t.nuit.racine)}`, depuis, '', largeur),
|
|
1517
|
+
ton: TONS.nuitEnCours,
|
|
1474
1518
|
});
|
|
1475
1519
|
}
|
|
1476
|
-
const
|
|
1520
|
+
const enCircuit = new Set((t.circuits ?? []).map(c => c.id));
|
|
1521
|
+
const duCircuit = x => Boolean(x.ticket && enCircuit.has(x.ticket));
|
|
1522
|
+
// The project of a holder or a wait, none for the board's project on one project's board.
|
|
1523
|
+
const projetDe = x => (x.ici && !plusieurs ? null : x.projet);
|
|
1524
|
+
// What names a holder or a wait: its ticket, else the folder of its copy, the main tree's only
|
|
1525
|
+
// when the project is not named (it would say the project twice).
|
|
1526
|
+
const quiDuVerrou = x =>
|
|
1527
|
+
x.ticket
|
|
1528
|
+
? courtDuTicket(x.ticket)
|
|
1529
|
+
: x.copie && (x.copie !== x.depot || !projetDe(x))
|
|
1530
|
+
? path.basename(x.copie)
|
|
1531
|
+
: null;
|
|
1532
|
+
// A line of the lock « <tete> · <projet> · <qui><fin> », <fin> the first of <fins> that holds
|
|
1533
|
+
// (« · attend · <durée> », else « · <durée> »: ⏳ already says the wait); the project is cut
|
|
1534
|
+
// first, then left out, then <qui> is cut, never <tete> nor <fin>.
|
|
1535
|
+
const ligneDuVerrou = (tete, x, ...fins) => {
|
|
1536
|
+
const qui = quiDuVerrou(x);
|
|
1537
|
+
const avecQui = `${tete}${qui ? ` · ${qui}` : ''}`;
|
|
1538
|
+
const fin = fins.find(f => colonnes(`${avecQui}${f}`) <= largeur) ?? fins[fins.length - 1];
|
|
1539
|
+
const projet = projetDe(x);
|
|
1540
|
+
const place = largeur - colonnes(`${avecQui}${fin}`) - 3;
|
|
1541
|
+
if (projet && place >= 2) {
|
|
1542
|
+
const p = colonnes(projet) > place ? `${debutDe(projet, place - 1)}…` : projet;
|
|
1543
|
+
return `${tete} · ${p}${qui ? ` · ${qui}` : ''}${fin}`;
|
|
1544
|
+
}
|
|
1545
|
+
return couperAvant(avecQui, fin, '', largeur);
|
|
1546
|
+
};
|
|
1547
|
+
// The lock on the line of each circuit shown that holds it or waits for it, by its ticket.
|
|
1548
|
+
const verrouDe = new Map();
|
|
1477
1549
|
const tenu = t.machine?.detenteur;
|
|
1478
1550
|
if (tenu) {
|
|
1479
1551
|
const a = tenu.avancement;
|
|
1480
1552
|
const age = a ? maintenant - a.dernier : 0;
|
|
1481
1553
|
const compte = a && (a.faits || a.prevus) ? `${a.faits}/${a.prevus}` : '';
|
|
1482
1554
|
const fige = age > FIGEE;
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
),
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1555
|
+
const depuis = ilYa(maintenant - (tenu.depuis ?? maintenant));
|
|
1556
|
+
if (duCircuit(tenu)) {
|
|
1557
|
+
const sorte = tenu.sorte.toLocaleLowerCase('fr');
|
|
1558
|
+
verrouDe.set(tenu.ticket, {
|
|
1559
|
+
fige,
|
|
1560
|
+
texte: fige
|
|
1561
|
+
? ` · ⚠ ${sorte} figée ${ilYa(age)}${compte ? ` · ${compte}` : ''}`
|
|
1562
|
+
: ` · 🔒 ${sorte}${compte ? ` ${compte}` : ''} · ${depuis}`,
|
|
1563
|
+
});
|
|
1564
|
+
} else {
|
|
1565
|
+
poser({
|
|
1566
|
+
texte: fige
|
|
1567
|
+
? ligneDuVerrou(`⚠ ${tenu.sorte} figée ${ilYa(age)}`, tenu, compte ? ` · ${compte}` : '')
|
|
1568
|
+
: ligneDuVerrou(`🔒 ${tenu.sorte}`, tenu, ` · ${compte ? `${compte} · ` : ''}${depuis}`),
|
|
1569
|
+
ton: fige ? TONS.fige : TONS.enCours,
|
|
1570
|
+
avancement: true,
|
|
1571
|
+
});
|
|
1572
|
+
}
|
|
1500
1573
|
}
|
|
1501
1574
|
for (const w of [...(t.machine?.attentes ?? [])].sort((x, y) => x.depuis - y.depuis)) {
|
|
1575
|
+
if (duCircuit(w)) {
|
|
1576
|
+
if (!verrouDe.has(w.ticket)) {
|
|
1577
|
+
verrouDe.set(w.ticket, {
|
|
1578
|
+
fige: false,
|
|
1579
|
+
texte: ` · ⏳ ${w.sorte.toLocaleLowerCase('fr')} · ${ilYa(maintenant - w.depuis)}`,
|
|
1580
|
+
});
|
|
1581
|
+
}
|
|
1582
|
+
continue;
|
|
1583
|
+
}
|
|
1502
1584
|
poser({
|
|
1503
|
-
texte:
|
|
1504
|
-
`⏳ ${
|
|
1585
|
+
texte: ligneDuVerrou(
|
|
1586
|
+
`⏳ ${w.sorte}`,
|
|
1587
|
+
w,
|
|
1505
1588
|
` · attend · ${ilYa(maintenant - w.depuis)}`,
|
|
1506
|
-
|
|
1507
|
-
largeur
|
|
1589
|
+
` · ${ilYa(maintenant - w.depuis)}`
|
|
1508
1590
|
),
|
|
1509
|
-
ton:
|
|
1591
|
+
ton: TONS.attendLeVerrou,
|
|
1510
1592
|
avancement: true,
|
|
1511
1593
|
});
|
|
1512
1594
|
}
|
|
1513
1595
|
// The tickets whose circuit waits for the lock or for room.
|
|
1514
|
-
const
|
|
1515
|
-
|
|
1596
|
+
const attendLeVerrou = new Set((t.machine?.attentes ?? []).map(w => w.ticket).filter(Boolean));
|
|
1597
|
+
const enAttente = new Set(attendLeVerrou);
|
|
1598
|
+
// The tickets whose circuit waits for a place of the machine, and those that wait for a place of
|
|
1599
|
+
// a circuit, not started, whose line in their chantier says « attend une place ».
|
|
1516
1600
|
const attendUnePlace = new Set((p?.attentes ?? []).map(w => w.ticket).filter(Boolean));
|
|
1601
|
+
// The tickets that wait for the disk of their project's copies.
|
|
1602
|
+
const attendLeDisque = new Set((p?.attentes ?? []).filter(w => w.disque).map(w => w.ticket));
|
|
1517
1603
|
for (const id of attendUnePlace) {
|
|
1518
1604
|
enAttente.add(id);
|
|
1519
1605
|
}
|
|
@@ -1531,7 +1617,6 @@ export function lignes(t, nom, largeur = LARGEUR, groupes = {}) {
|
|
|
1531
1617
|
// from their second pass (`boucles` of the step, scripts/etapes.mjs, their counts in the state's
|
|
1532
1618
|
// `boucles`), whole; then its ticket's working time and tokens. Its card opens on
|
|
1533
1619
|
// its question, or says where it stopped and why. The tickets' numbers line up in one column.
|
|
1534
|
-
const enCircuit = new Set((t.circuits ?? []).map(c => c.id));
|
|
1535
1620
|
// The block of the step <e>, an empty one when the board holds none.
|
|
1536
1621
|
const vides = new Map();
|
|
1537
1622
|
const blocDe = e =>
|
|
@@ -1543,11 +1628,10 @@ export function lignes(t, nom, largeur = LARGEUR, groupes = {}) {
|
|
|
1543
1628
|
titre: e.titre,
|
|
1544
1629
|
qui: quiDe(e),
|
|
1545
1630
|
enCours: [],
|
|
1546
|
-
attend: [],
|
|
1547
1631
|
})
|
|
1548
1632
|
.get(e.numero);
|
|
1549
1633
|
// The block of the circuits at no step of the list, after the steps.
|
|
1550
|
-
const ailleurs = { numero: null, titre: '', qui: '', enCours: []
|
|
1634
|
+
const ailleurs = { numero: null, titre: '', qui: '', enCours: [] };
|
|
1551
1635
|
const etapeDe = c => etapeDuCircuit({ ...c, raison: c.arret });
|
|
1552
1636
|
// A circuit that waits for the supervisor (`attendLeSuperviseur`, the one rule): who must answer
|
|
1553
1637
|
// its question, the supervisor when its stop names no one.
|
|
@@ -1556,12 +1640,13 @@ export function lignes(t, nom, largeur = LARGEUR, groupes = {}) {
|
|
|
1556
1640
|
const e = etapeDe(c);
|
|
1557
1641
|
return e ? blocDe(e) : !c.vivant ? ailleurs : undefined;
|
|
1558
1642
|
};
|
|
1559
|
-
const montres = t.agents.flatMap(b =>
|
|
1560
|
-
[...b.enCours, ...b.attend].filter(x => !enCircuit.has(x.id))
|
|
1561
|
-
);
|
|
1643
|
+
const montres = t.agents.flatMap(b => b.enCours.filter(x => !enCircuit.has(x.id)));
|
|
1562
1644
|
// A ticket's number, or on several projects' board its whole id, in one column.
|
|
1563
1645
|
const nomme = x => String(plusieurs ? x.id : x.numero);
|
|
1564
|
-
const colonne = Math.max(
|
|
1646
|
+
const colonne = Math.max(
|
|
1647
|
+
0,
|
|
1648
|
+
...[...(t.circuits ?? []), ...(t.horsCircuit ?? []), ...montres].map(x => nomme(x).length)
|
|
1649
|
+
);
|
|
1565
1650
|
// A ticket's line in AGENTS: « <signe> <numéro> <sujet> … <droite> »; on several projects'
|
|
1566
1651
|
// board « <[projet]> <id> <sujet> … <signe> <droite> », the owner's maquette (grillhouse-erp.1).
|
|
1567
1652
|
const teteDe = (signe, x) =>
|
|
@@ -1570,6 +1655,24 @@ export function lignes(t, nom, largeur = LARGEUR, groupes = {}) {
|
|
|
1570
1655
|
: `${signe} ${nomme(x).padEnd(colonne)} `;
|
|
1571
1656
|
const droiteDe = (signe, droite) =>
|
|
1572
1657
|
plusieurs ? `${signe}${droite ? ` ${droite}` : ''}` : droite;
|
|
1658
|
+
// The state of a circuit's line, whose tone TONS gives: frozen, its question (to the supervisor
|
|
1659
|
+
// or to another), stopped, its wait for the disk, a place or the lock, else it runs.
|
|
1660
|
+
const etatDuCircuit = (c, temoin) =>
|
|
1661
|
+
temoin?.fige
|
|
1662
|
+
? 'fige'
|
|
1663
|
+
: !c.vivant
|
|
1664
|
+
? enQuestion(c) === SUPERVISEUR
|
|
1665
|
+
? 'attendLeSuperviseur'
|
|
1666
|
+
: enQuestion(c)
|
|
1667
|
+
? 'attendLeResponsable'
|
|
1668
|
+
: 'arrete'
|
|
1669
|
+
: attendLeDisque.has(c.id)
|
|
1670
|
+
? 'attendLeDisque'
|
|
1671
|
+
: attendUnePlace.has(c.id)
|
|
1672
|
+
? 'attendUnePlace'
|
|
1673
|
+
: attendLeVerrou.has(c.id)
|
|
1674
|
+
? 'attendLeVerrou'
|
|
1675
|
+
: 'enCours';
|
|
1573
1676
|
const ligneDuCircuit = c => {
|
|
1574
1677
|
const signe = !c.vivant ? '⏸' : enAttente.has(c.id) ? '⏳' : '▶';
|
|
1575
1678
|
const droite = droiteDe(
|
|
@@ -1582,7 +1685,10 @@ export function lignes(t, nom, largeur = LARGEUR, groupes = {}) {
|
|
|
1582
1685
|
.map(b => ` · ${b.libelle} ${c.boucles[b.cle]}/${b.max}`)
|
|
1583
1686
|
.join('');
|
|
1584
1687
|
const tete = teteDe(signe, c);
|
|
1585
|
-
|
|
1688
|
+
// The lock it holds or waits for, else the progress of its pass.
|
|
1689
|
+
const temoin =
|
|
1690
|
+
verrouDe.get(c.id) ??
|
|
1691
|
+
(c.vivant && etape?.qui.includes(AUTO) ? temoinDe(c, maintenant) : null);
|
|
1586
1692
|
// The progress after the counters of the loops while the subject keeps its room beside them,
|
|
1587
1693
|
// in their place otherwise.
|
|
1588
1694
|
const reste = avec =>
|
|
@@ -1598,7 +1704,7 @@ export function lignes(t, nom, largeur = LARGEUR, groupes = {}) {
|
|
|
1598
1704
|
}${place}`;
|
|
1599
1705
|
poser({
|
|
1600
1706
|
texte: couperAvant(`${tete}${c.sujet}`, suite, droite, largeur),
|
|
1601
|
-
ton:
|
|
1707
|
+
ton: TONS[etatDuCircuit(c, temoin)],
|
|
1602
1708
|
ticket: c.id,
|
|
1603
1709
|
...(temoin ? { avancement: true } : {}),
|
|
1604
1710
|
});
|
|
@@ -1612,46 +1718,31 @@ export function lignes(t, nom, largeur = LARGEUR, groupes = {}) {
|
|
|
1612
1718
|
.map(qui => [qui, tous.filter(c => enQuestion(c) === qui)])
|
|
1613
1719
|
.filter(([, l]) => l.length);
|
|
1614
1720
|
const enCours = b.enCours.filter(x => !enCircuit.has(x.id));
|
|
1615
|
-
const attend = b.attend.filter(x => !enCircuit.has(x.id));
|
|
1616
1721
|
return {
|
|
1617
1722
|
circuits,
|
|
1618
1723
|
enQuestions,
|
|
1619
1724
|
enCours,
|
|
1620
|
-
|
|
1621
|
-
vide: !tous.length && !enCours.length && !attend.length,
|
|
1725
|
+
vide: !tous.length && !enCours.length,
|
|
1622
1726
|
};
|
|
1623
1727
|
};
|
|
1624
1728
|
const contenus = new Map([...SUITE.map(blocDe), ailleurs].map(b => [b, contenu(b)]));
|
|
1625
|
-
// The tickets of the block <b>: its circuits without a question, its agents,
|
|
1729
|
+
// The tickets of the block <b>: its circuits without a question, its agents, then
|
|
1626
1730
|
// for each one who must answer, the line « ⤷ Question · <qui> », indented by <retrait>, and its
|
|
1627
1731
|
// circuits.
|
|
1628
1732
|
const tickets = (b, retrait) => {
|
|
1629
|
-
const { circuits, enQuestions, enCours
|
|
1733
|
+
const { circuits, enQuestions, enCours } = contenus.get(b);
|
|
1630
1734
|
for (const c of circuits) {
|
|
1631
1735
|
ligneDuCircuit(c);
|
|
1632
1736
|
}
|
|
1633
1737
|
for (const x of enCours) {
|
|
1634
1738
|
L(
|
|
1635
1739
|
cadre(`${teteDe('▶', x)}${x.sujet}`, droiteDe('▶', conso(x.travail, x.jetons)), largeur),
|
|
1636
|
-
|
|
1740
|
+
TONS.enCours,
|
|
1637
1741
|
x.id
|
|
1638
1742
|
);
|
|
1639
1743
|
}
|
|
1640
|
-
const attente = x => ({
|
|
1641
|
-
texte: cadre(
|
|
1642
|
-
`${teteDe('·', x)}${x.sujet}`,
|
|
1643
|
-
droiteDe(
|
|
1644
|
-
'·',
|
|
1645
|
-
x.bloquePar?.length ? `attend ${x.bloquePar.join(', ')}` : conso(x.travail, x.jetons)
|
|
1646
|
-
),
|
|
1647
|
-
largeur
|
|
1648
|
-
),
|
|
1649
|
-
ton: 'discret',
|
|
1650
|
-
ticket: x.id,
|
|
1651
|
-
});
|
|
1652
|
-
poser(...attend.map(attente));
|
|
1653
1744
|
for (const [qui, l] of enQuestions) {
|
|
1654
|
-
L(cadre(`${retrait}⤷ Question · ${qui}`, '', largeur),
|
|
1745
|
+
L(cadre(`${retrait}⤷ Question · ${qui}`, '', largeur), TONS.titre);
|
|
1655
1746
|
for (const c of l) {
|
|
1656
1747
|
ligneDuCircuit(c);
|
|
1657
1748
|
}
|
|
@@ -1660,8 +1751,22 @@ export function lignes(t, nom, largeur = LARGEUR, groupes = {}) {
|
|
|
1660
1751
|
const ligneDEtape = (b, retrait, plein = !contenus.get(b).vide) =>
|
|
1661
1752
|
L(
|
|
1662
1753
|
cadre(`${retrait}${b.numero} · ${b.titre}${b.qui ? ` · ${b.qui}` : ''}`, '', largeur),
|
|
1663
|
-
plein ?
|
|
1754
|
+
plein ? TONS.titre : TONS.vide
|
|
1664
1755
|
);
|
|
1756
|
+
// The tickets worked out of a circuit, once each, before the steps, from their claim to their
|
|
1757
|
+
// close: « ✎ <numéro> <sujet> · en direct · <assignee> ».
|
|
1758
|
+
for (const x of t.horsCircuit ?? []) {
|
|
1759
|
+
poser({
|
|
1760
|
+
texte: couperAvant(
|
|
1761
|
+
`${teteDe('✎', x)}${x.sujet}`,
|
|
1762
|
+
` · en direct${x.qui ? ` · ${x.qui}` : ''}`,
|
|
1763
|
+
droiteDe('✎', ''),
|
|
1764
|
+
largeur
|
|
1765
|
+
),
|
|
1766
|
+
ton: TONS.enDirect,
|
|
1767
|
+
ticket: x.id,
|
|
1768
|
+
});
|
|
1769
|
+
}
|
|
1665
1770
|
for (const e of ETAPES) {
|
|
1666
1771
|
const b = blocDe(e);
|
|
1667
1772
|
const lesSous = e.sous ?? [];
|
|
@@ -1692,13 +1797,14 @@ export function lignes(t, nom, largeur = LARGEUR, groupes = {}) {
|
|
|
1692
1797
|
// The tickets the agents' blocks show: the chantier's tree does not show them a second time.
|
|
1693
1798
|
const dansAgents = new Set([
|
|
1694
1799
|
...(t.circuits ?? []).map(c => c.id),
|
|
1695
|
-
...t.
|
|
1800
|
+
...(t.horsCircuit ?? []).map(x => x.id),
|
|
1801
|
+
...t.agents.flatMap(b => b.enCours.map(x => x.id)),
|
|
1696
1802
|
]);
|
|
1697
1803
|
for (const ch of t.chantiers) {
|
|
1698
1804
|
L('', undefined);
|
|
1699
1805
|
poser({
|
|
1700
1806
|
texte: cadre(`CHANTIER ${duProjet(ch)}${ch.numero} — ${ch.sujet}`, '', largeur),
|
|
1701
|
-
ton:
|
|
1807
|
+
ton: TONS.titre,
|
|
1702
1808
|
ticket: ch.id,
|
|
1703
1809
|
chantier: true,
|
|
1704
1810
|
});
|
|
@@ -1708,7 +1814,7 @@ export function lignes(t, nom, largeur = LARGEUR, groupes = {}) {
|
|
|
1708
1814
|
'',
|
|
1709
1815
|
largeur
|
|
1710
1816
|
),
|
|
1711
|
-
|
|
1817
|
+
TONS.mesure
|
|
1712
1818
|
);
|
|
1713
1819
|
const arbre = [];
|
|
1714
1820
|
const marque = n =>
|
|
@@ -1730,18 +1836,31 @@ export function lignes(t, nom, largeur = LARGEUR, groupes = {}) {
|
|
|
1730
1836
|
// Every open ticket of the chantier has its line under the title of its state, the states in
|
|
1731
1837
|
// their order, the tickets in their numbers' order. A ticket an agent block shows stands there
|
|
1732
1838
|
// alone; its children keep their lines.
|
|
1839
|
+
// The state of a ticket's line, whose tone TONS gives: a ticket in the queue that waits for the
|
|
1840
|
+
// disk or a place, else its state.
|
|
1841
|
+
const etatDuNoeud = n =>
|
|
1842
|
+
!n.mere && n.etat === 'enAttente' && attendLeDisque.has(n.id)
|
|
1843
|
+
? 'attendLeDisque'
|
|
1844
|
+
: !n.mere && n.etat === 'enAttente' && attendUnePlace.has(n.id)
|
|
1845
|
+
? 'attendUnePlace'
|
|
1846
|
+
: n.etat;
|
|
1733
1847
|
const ligneDe = n => {
|
|
1734
1848
|
const conso = n.jetons ? ` · ${k(n.jetons)}` : '';
|
|
1849
|
+
const etat = etatDuNoeud(n);
|
|
1735
1850
|
const droite = n.mere
|
|
1736
1851
|
? `${n.faits}/${n.total}${conso}${n.etat === 'bloques' ? ` ${marque(n)}` : ''}`
|
|
1737
1852
|
: n.etat === 'enCours'
|
|
1738
1853
|
? `${duree(n.travail)}${conso}`
|
|
1739
1854
|
: n.etat === 'bloques'
|
|
1740
1855
|
? marque(n)
|
|
1741
|
-
: ''
|
|
1856
|
+
: etat === 'attendLeDisque'
|
|
1857
|
+
? 'attend le disque'
|
|
1858
|
+
: etat === 'attendUnePlace'
|
|
1859
|
+
? 'attend une place'
|
|
1860
|
+
: '';
|
|
1742
1861
|
return {
|
|
1743
1862
|
texte: cadre(` ${duProjet(n)}${n.numero} ${n.sujet}`, droite, largeur),
|
|
1744
|
-
ton:
|
|
1863
|
+
ton: TONS[etat],
|
|
1745
1864
|
ticket: n.id,
|
|
1746
1865
|
};
|
|
1747
1866
|
};
|
|
@@ -1762,7 +1881,7 @@ export function lignes(t, nom, largeur = LARGEUR, groupes = {}) {
|
|
|
1762
1881
|
}
|
|
1763
1882
|
const titreDuGroupe = {
|
|
1764
1883
|
texte: cadre(` ${e.nom}`, `${liste.length}`, largeur),
|
|
1765
|
-
ton:
|
|
1884
|
+
ton: TONS.titre,
|
|
1766
1885
|
};
|
|
1767
1886
|
const replie =
|
|
1768
1887
|
e.cle === 'sansGo' ||
|
|
@@ -1773,7 +1892,7 @@ export function lignes(t, nom, largeur = LARGEUR, groupes = {}) {
|
|
|
1773
1892
|
groupes[cle] = [titreDuGroupe, ...liste.map(ligneDe)].map(marquer);
|
|
1774
1893
|
arbre.push({
|
|
1775
1894
|
texte: cadre(` ${e.nom} ›`, `${liste.length}`, largeur),
|
|
1776
|
-
ton:
|
|
1895
|
+
ton: TONS.titre,
|
|
1777
1896
|
groupe: cle,
|
|
1778
1897
|
});
|
|
1779
1898
|
continue;
|
|
@@ -1795,16 +1914,16 @@ export function lignes(t, nom, largeur = LARGEUR, groupes = {}) {
|
|
|
1795
1914
|
}));
|
|
1796
1915
|
if (t.chantiers.length) {
|
|
1797
1916
|
groupes.autres = [
|
|
1798
|
-
{ texte: cadre('AUTRES CHANTIERS', `${t.autres.length}`, largeur), ton:
|
|
1917
|
+
{ texte: cadre('AUTRES CHANTIERS', `${t.autres.length}`, largeur), ton: TONS.titre },
|
|
1799
1918
|
...autres,
|
|
1800
1919
|
].map(marquer);
|
|
1801
1920
|
poser({
|
|
1802
1921
|
texte: cadre('AUTRES CHANTIERS ›', `${t.autres.length}`, largeur),
|
|
1803
|
-
ton:
|
|
1922
|
+
ton: TONS.titre,
|
|
1804
1923
|
groupe: 'autres',
|
|
1805
1924
|
});
|
|
1806
1925
|
} else {
|
|
1807
|
-
L(cadre('CHANTIERS', `${t.autres.length}`, largeur),
|
|
1926
|
+
L(cadre('CHANTIERS', `${t.autres.length}`, largeur), TONS.titre);
|
|
1808
1927
|
poser(...autres);
|
|
1809
1928
|
}
|
|
1810
1929
|
}
|
|
@@ -1822,11 +1941,11 @@ export function lignes(t, nom, largeur = LARGEUR, groupes = {}) {
|
|
|
1822
1941
|
`${n} ticket${n > 1 ? 's' : ''} · ${duree(temps)} · ${k(jetons)}`,
|
|
1823
1942
|
largeur
|
|
1824
1943
|
),
|
|
1825
|
-
|
|
1944
|
+
TONS.titre
|
|
1826
1945
|
);
|
|
1827
1946
|
const fait = x => ({
|
|
1828
1947
|
texte: cadre(`✓ ${duProjet(x)}${x.numero} ${x.sujet}`, conso(x.travail, x.jetons), largeur),
|
|
1829
|
-
ton:
|
|
1948
|
+
ton: TONS.fermes,
|
|
1830
1949
|
ticket: x.id,
|
|
1831
1950
|
});
|
|
1832
1951
|
poser(...t.faitsDuJour.map(fait));
|
|
@@ -1845,11 +1964,11 @@ export function lignesEtats(t, largeur = LARGEUR) {
|
|
|
1845
1964
|
}
|
|
1846
1965
|
out.push({
|
|
1847
1966
|
texte: couper(`${e.nom.toUpperCase()} — ${e.sens}`, `${e.tickets.length}`, largeur),
|
|
1848
|
-
ton:
|
|
1967
|
+
ton: TONS.titre,
|
|
1849
1968
|
section: 'etats',
|
|
1850
1969
|
});
|
|
1851
1970
|
if (!e.tickets.length) {
|
|
1852
|
-
out.push({ texte: ' —', ton:
|
|
1971
|
+
out.push({ texte: ' —', ton: TONS.vide, section: 'etats' });
|
|
1853
1972
|
}
|
|
1854
1973
|
for (const x of e.tickets) {
|
|
1855
1974
|
out.push({
|
|
@@ -1860,7 +1979,7 @@ export function lignesEtats(t, largeur = LARGEUR) {
|
|
|
1860
1979
|
: conso(t.parTicket[x.id]?.travail ?? 0, t.parTicket[x.id]?.jetons ?? 0),
|
|
1861
1980
|
largeur
|
|
1862
1981
|
),
|
|
1863
|
-
ton: e.cle
|
|
1982
|
+
ton: TONS[e.cle],
|
|
1864
1983
|
ticket: x.id,
|
|
1865
1984
|
section: 'etats',
|
|
1866
1985
|
});
|
|
@@ -2018,17 +2137,28 @@ export function dossierCommun(racine) {
|
|
|
2018
2137
|
// dir. Unversioned, out of the worktree: the board does not reset at midnight.
|
|
2019
2138
|
const fichierDuRepere = commun => commun && path.join(commun, 'tableau-repere.json');
|
|
2020
2139
|
|
|
2021
|
-
// The day's marker of the project whose common dir is <commun>: the number its file holds
|
|
2022
|
-
//
|
|
2140
|
+
// The day's marker of the project whose common dir is <commun>: the number its file holds. Without
|
|
2141
|
+
// one (no file, or no number), the first reading sets it to midnight of <maintenant> and keeps it,
|
|
2142
|
+
// so that only `grillhouse newday` moves it; a place that cannot be written gives midnight still.
|
|
2023
2143
|
export function lireLeRepere(commun, maintenant) {
|
|
2144
|
+
try {
|
|
2145
|
+
const { repere } = JSON.parse(readFileSync(fichierDuRepere(commun), 'utf8'));
|
|
2146
|
+
if (typeof repere === 'number') {
|
|
2147
|
+
return repere;
|
|
2148
|
+
}
|
|
2149
|
+
} catch {
|
|
2150
|
+
// No marker yet: set below.
|
|
2151
|
+
}
|
|
2024
2152
|
const minuit = new Date(maintenant);
|
|
2025
2153
|
minuit.setHours(0, 0, 0, 0);
|
|
2026
2154
|
try {
|
|
2027
|
-
|
|
2028
|
-
|
|
2155
|
+
if (commun) {
|
|
2156
|
+
writeFileSync(fichierDuRepere(commun), `${JSON.stringify({ repere: minuit.getTime() })}\n`);
|
|
2157
|
+
}
|
|
2029
2158
|
} catch {
|
|
2030
|
-
|
|
2159
|
+
// A read-only place keeps the board working: midnight, unkept.
|
|
2031
2160
|
}
|
|
2161
|
+
return minuit.getTime();
|
|
2032
2162
|
}
|
|
2033
2163
|
|
|
2034
2164
|
// Sets the day's marker of the project at <racine> to <quand> (now by default), purging FAITS
|
|
@@ -2047,7 +2177,16 @@ export function poserLeRepere(racine, quand = Date.now()) {
|
|
|
2047
2177
|
// shared files in (`commun`).
|
|
2048
2178
|
function lire(
|
|
2049
2179
|
racine,
|
|
2050
|
-
{
|
|
2180
|
+
{
|
|
2181
|
+
home,
|
|
2182
|
+
maintenant,
|
|
2183
|
+
circuits,
|
|
2184
|
+
muet = false,
|
|
2185
|
+
faute = null,
|
|
2186
|
+
machine = null,
|
|
2187
|
+
places = null,
|
|
2188
|
+
nuit = null,
|
|
2189
|
+
}
|
|
2051
2190
|
) {
|
|
2052
2191
|
// The prefix is read once, with no delay of its own; a read that fails leaves it empty (the
|
|
2053
2192
|
// project is labelled by its folder) and its cause is named in an alert (`echecPrefixe`).
|
|
@@ -2081,23 +2220,6 @@ function lire(
|
|
|
2081
2220
|
? lireRegistre(readFileSync(fichierRegistre, 'utf8'), racine)
|
|
2082
2221
|
: [];
|
|
2083
2222
|
const tous = bdJson(racine, 'list', '--all', '--limit', '0');
|
|
2084
|
-
// The reviewer's verdict matters once a developer or a reviewer ran: only those tickets are read.
|
|
2085
|
-
const dernier = {};
|
|
2086
|
-
for (const r of [...registre].sort((x, y) => Date.parse(x.fin) - Date.parse(y.fin))) {
|
|
2087
|
-
if (r.ticket && r.role !== QUESTIONNEUR && r.role !== ROLE_DU_CIRCUIT) {
|
|
2088
|
-
dernier[r.ticket] = r.role;
|
|
2089
|
-
}
|
|
2090
|
-
}
|
|
2091
|
-
const verdicts = {};
|
|
2092
|
-
for (const t of tous) {
|
|
2093
|
-
if (t.status === 'closed' || !['developpeur', 'relecteur'].includes(dernier[t.id])) {
|
|
2094
|
-
continue;
|
|
2095
|
-
}
|
|
2096
|
-
const v = verdict(bdJson(racine, 'comments', t.id));
|
|
2097
|
-
if (v) {
|
|
2098
|
-
verdicts[t.id] = v;
|
|
2099
|
-
}
|
|
2100
|
-
}
|
|
2101
2223
|
const commun = dossierCommun(racine);
|
|
2102
2224
|
const fichierCache = commun && path.join(commun, 'tableau-cache.json');
|
|
2103
2225
|
let cache = {};
|
|
@@ -2130,11 +2252,11 @@ function lire(
|
|
|
2130
2252
|
registre,
|
|
2131
2253
|
vivants,
|
|
2132
2254
|
circuits,
|
|
2133
|
-
verdicts,
|
|
2134
2255
|
maintenant,
|
|
2135
2256
|
jour: lireLeRepere(commun, maintenant),
|
|
2136
2257
|
machine,
|
|
2137
2258
|
places,
|
|
2259
|
+
nuit,
|
|
2138
2260
|
muet,
|
|
2139
2261
|
faute,
|
|
2140
2262
|
echecPrefixe,
|
|
@@ -2176,6 +2298,7 @@ export function ensemble(lus) {
|
|
|
2176
2298
|
),
|
|
2177
2299
|
alertes: tous('alertes'),
|
|
2178
2300
|
circuits: tous('circuits'),
|
|
2301
|
+
horsCircuit: tous('horsCircuit'),
|
|
2179
2302
|
chantiers: lisibles.flatMap(l => l.t.chantiers.map(noeud(l.etiquette))),
|
|
2180
2303
|
autres: tous('autres'),
|
|
2181
2304
|
agents: premier.t.agents.map(b => {
|
|
@@ -2183,11 +2306,12 @@ export function ensemble(lus) {
|
|
|
2183
2306
|
lisibles.flatMap(l =>
|
|
2184
2307
|
(l.t.agents.find(x => x.numero === b.numero)?.[cle] ?? []).map(marquer(l.etiquette))
|
|
2185
2308
|
);
|
|
2186
|
-
return { ...b, enCours: de('enCours')
|
|
2309
|
+
return { ...b, enCours: de('enCours') };
|
|
2187
2310
|
}),
|
|
2188
2311
|
maintenant: premier.t.maintenant,
|
|
2189
2312
|
machine: premier.t.machine,
|
|
2190
2313
|
places: premier.t.places,
|
|
2314
|
+
nuit: premier.t.nuit,
|
|
2191
2315
|
faitsDuJour: tous('faitsDuJour'),
|
|
2192
2316
|
decouvertes: lisibles.reduce(
|
|
2193
2317
|
(s, l) => {
|
|
@@ -2242,16 +2366,22 @@ async function lesCircuits(circuitsDe, racine) {
|
|
|
2242
2366
|
/**
|
|
2243
2367
|
* The lock of the machine <machine> with each project named as the board names it: <noms> gives
|
|
2244
2368
|
* the name of each project of the board by the root of its main tree (`depot`); a project out of
|
|
2245
|
-
* the board keeps its folder's name.
|
|
2369
|
+
* the board keeps its folder's name. A holder or a wait of the repository whose main tree is <ici>
|
|
2370
|
+
* is marked `ici`, the board's project.
|
|
2246
2371
|
* @param {Machine | null} machine
|
|
2247
2372
|
* @param {Map<string, string>} noms
|
|
2373
|
+
* @param {string | null} [ici]
|
|
2248
2374
|
* @returns {Machine | null}
|
|
2249
2375
|
*/
|
|
2250
|
-
export function nommerLesProjets(machine, noms) {
|
|
2376
|
+
export function nommerLesProjets(machine, noms, ici = null) {
|
|
2251
2377
|
if (!machine) {
|
|
2252
2378
|
return machine;
|
|
2253
2379
|
}
|
|
2254
|
-
const nommer = x => ({
|
|
2380
|
+
const nommer = x => ({
|
|
2381
|
+
...x,
|
|
2382
|
+
projet: (x.depot && noms.get(x.depot)) || x.projet,
|
|
2383
|
+
ici: Boolean(ici && x.depot === ici),
|
|
2384
|
+
});
|
|
2255
2385
|
return {
|
|
2256
2386
|
detenteur: machine.detenteur && nommer(machine.detenteur),
|
|
2257
2387
|
attentes: machine.attentes.map(nommer),
|
|
@@ -2262,11 +2392,13 @@ export function nommerLesProjets(machine, noms) {
|
|
|
2262
2392
|
// board of them all (`ensemble`), named « <dépôt> + <projet> + … », with the folder of each
|
|
2263
2393
|
// ticket's project (`dossiers`), where the pane runs Beads for it. The status line is the
|
|
2264
2394
|
// session's project's alone. Each project's circuits are read by <circuitsDe> (one call to the
|
|
2265
|
-
// Temporal server, scripts/circuits-du-serveur.mjs, by default)
|
|
2395
|
+
// Temporal server, scripts/circuits-du-serveur.mjs, by default), and the night under way on the
|
|
2396
|
+
// machine by <nuitDe> (`nuitDuServeur` by default); a night that does not read shows none.
|
|
2266
2397
|
/**
|
|
2267
2398
|
* @param {string} racine
|
|
2268
2399
|
* @param {{ home?: string, maintenant?: number, projets?: string[],
|
|
2269
|
-
* circuitsDe?: (racine: string) => Promise<object[]
|
|
2400
|
+
* circuitsDe?: (racine: string) => Promise<object[]>,
|
|
2401
|
+
* nuitDe?: () => Promise<{ racine: string, depuis: number | null } | null> }} [o]
|
|
2270
2402
|
*/
|
|
2271
2403
|
export async function tableau(
|
|
2272
2404
|
racine,
|
|
@@ -2275,9 +2407,13 @@ export async function tableau(
|
|
|
2275
2407
|
maintenant = Date.now(),
|
|
2276
2408
|
projets = [],
|
|
2277
2409
|
circuitsDe = circuitsDuServeur,
|
|
2410
|
+
nuitDe = () => nuitDuServeur(),
|
|
2278
2411
|
} = {}
|
|
2279
2412
|
) {
|
|
2280
|
-
const [{ circuits, muet, faute }, ...autres] = await Promise.all([
|
|
2413
|
+
const [nuit, { circuits, muet, faute }, ...autres] = await Promise.all([
|
|
2414
|
+
Promise.resolve()
|
|
2415
|
+
.then(nuitDe)
|
|
2416
|
+
.catch(() => null),
|
|
2281
2417
|
lesCircuits(circuitsDe, racine),
|
|
2282
2418
|
...projets.map(d => lireUnAutre(d, { home, maintenant, circuitsDe })),
|
|
2283
2419
|
]);
|
|
@@ -2291,6 +2427,7 @@ export async function tableau(
|
|
|
2291
2427
|
faute,
|
|
2292
2428
|
machine: lireLaMesure(process.env),
|
|
2293
2429
|
places: lireLesPlaces(),
|
|
2430
|
+
nuit,
|
|
2294
2431
|
}),
|
|
2295
2432
|
};
|
|
2296
2433
|
const lus = [ici, ...autres];
|
|
@@ -2303,7 +2440,8 @@ export async function tableau(
|
|
|
2303
2440
|
lus
|
|
2304
2441
|
.filter(l => l.commun)
|
|
2305
2442
|
.map(l => [path.dirname(l.commun), l === ici ? path.basename(racine) : etiquette(l)])
|
|
2306
|
-
)
|
|
2443
|
+
),
|
|
2444
|
+
ici.commun ? path.dirname(ici.commun) : null
|
|
2307
2445
|
);
|
|
2308
2446
|
const etat = ligneEtat(ici.t);
|
|
2309
2447
|
try {
|