@roomi-fields/grillhouse 0.50.3 → 0.51.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 +48 -0
- package/agents/developpeur.md +1 -1
- package/agents/direct.md +1 -1
- package/agents/explorateur.md +1 -1
- package/agents/questionneur.md +1 -1
- package/agents/relecteur.md +1 -1
- package/agents/testwriter.md +1 -1
- package/cadre/templates/c/package.json +1 -0
- package/cadre/templates/cargo/package.json +1 -0
- package/cadre/templates/python/package.json +1 -0
- package/charte.md +17 -12
- package/dist/machine/part-par-sorte.d.ts +16 -0
- package/dist/machine/part-par-sorte.js +36 -0
- package/dist/machine/part-par-sorte.js.map +1 -0
- package/dist/temporal/circuit/appel.js +1 -1
- package/dist/temporal/circuit/appel.js.map +1 -1
- package/dist/temporal/circuit/client.d.ts +5 -4
- package/dist/temporal/circuit/client.js +39 -16
- package/dist/temporal/circuit/client.js.map +1 -1
- package/dist/temporal/circuit/contrat.d.ts +11 -7
- package/dist/temporal/circuit/contrat.js +5 -9
- package/dist/temporal/circuit/contrat.js.map +1 -1
- package/dist/temporal/circuit/deroule.js +18 -6
- package/dist/temporal/circuit/deroule.js.map +1 -1
- package/dist/temporal/commande.js +12 -3
- package/dist/temporal/commande.js.map +1 -1
- package/dist/temporal/installation.d.ts +54 -3
- package/dist/temporal/installation.js +187 -17
- package/dist/temporal/installation.js.map +1 -1
- package/dist/temporal/places/client.d.ts +5 -1
- package/dist/temporal/places/client.js +23 -11
- package/dist/temporal/places/client.js.map +1 -1
- package/docs/ARCHITECTURE.md +23 -2700
- package/docs/INTERFACE.md +23 -8
- package/docs/architecture/circuit.md +59 -12
- package/docs/architecture/entree.md +20 -7
- package/docs/architecture/greffon.md +6 -2
- package/docs/architecture/installation.md +30 -11
- package/docs/architecture/machine.md +50 -37
- package/docs/architecture/tests.md +52 -14
- package/docs/lexique.md +154 -0
- package/hooks/register.tsx +1 -1
- package/package.json +1 -1
- package/scripts/activites.mjs +85 -60
- package/scripts/aiguillage.mjs +15 -7
- package/scripts/attente-de-la-machine.mjs +4 -8
- package/scripts/avancement.mjs +12 -8
- package/scripts/bilan.mjs +10 -7
- package/scripts/branche-de-nuit.mjs +2 -2
- package/scripts/ci-de-main.mjs +18 -21
- package/scripts/circuit.mjs +86 -43
- package/scripts/circuits-du-serveur.mjs +5 -5
- package/scripts/composants-affectes.mjs +30 -12
- package/scripts/composition-des-langages.mjs +5 -3
- package/scripts/conformite.mjs +1 -1
- package/scripts/consommation-des-passes.mjs +8 -6
- package/scripts/copies-finies.mjs +3 -14
- package/scripts/depart-du-ticket.d.mts +8 -2
- package/scripts/depart-du-ticket.mjs +26 -8
- package/scripts/direct.mjs +158 -72
- package/scripts/droits.mjs +63 -185
- package/scripts/engendres.mjs +3 -14
- package/scripts/enveloppe/enveloppe.mjs +75 -30
- package/scripts/enveloppe/lancer.sh +59 -45
- package/scripts/enveloppe/paquets-du-plan.mjs +38 -11
- package/scripts/enveloppe/travail-de-la-copie.mjs +115 -3
- package/scripts/etapes.mjs +84 -22
- package/scripts/faits-du-circuit.mjs +8 -2
- package/scripts/grillhouse-maj.mjs +43 -18
- package/scripts/groupe-cles.d.mts +15 -0
- package/scripts/groupe-cles.mjs +77 -2
- package/scripts/init.mjs +9 -2
- package/scripts/integration/rejeu.mjs +8 -1
- package/scripts/jointure.d.ts +22 -3
- package/scripts/langages/c/index.mjs +5 -2
- package/scripts/langages/cargo/commandes.mjs +35 -15
- package/scripts/langages/cargo/composants.mjs +45 -3
- package/scripts/langages/cargo/index.mjs +6 -3
- package/scripts/langages/python/index.mjs +5 -2
- package/scripts/langages/typescript/chemins-des-tests.mjs +1 -1
- package/scripts/langages/typescript/index.mjs +4 -2
- package/scripts/langages/typescript/mise-a-jour.mjs +1 -1
- package/scripts/langages/typescript/rapports-aux-lignes.mjs +74 -0
- package/scripts/langages/typescript/turbo-des-paquets.mjs +99 -36
- package/scripts/langages/typescript/verdict.mjs +29 -3
- package/scripts/langages/typescript/verifier.mjs +1 -1
- package/scripts/langages/typescript/vitest-config/changements.mjs +8 -6
- package/scripts/langages/typescript/vitest-config/lances.mjs +15 -32
- package/scripts/langages.mjs +54 -4
- package/scripts/matieres-lues.mjs +1 -1
- package/scripts/mesure/base-de-passe.mjs +32 -90
- package/scripts/migrations/serveurs-de-l-index.mjs +79 -0
- package/scripts/migrations.mjs +21 -7
- package/scripts/paquets.d.ts +3 -0
- package/scripts/paquets.mjs +88 -1
- package/scripts/passe-de-la-machine.mjs +109 -36
- package/scripts/places-de-la-machine.mjs +81 -29
- package/scripts/plafond-de-la-machine.d.mts +2 -5
- package/scripts/plafond-de-la-machine.mjs +9 -9
- package/scripts/reprise.mjs +42 -13
- package/scripts/resultats.mjs +76 -54
- package/scripts/retirer-les-copies-finies.mjs +1 -1
- package/scripts/seances.mjs +426 -115
- package/scripts/services-du-noyau.mjs +9 -1
- package/scripts/session-start.sh +14 -1
- package/scripts/sortie.mjs +37 -6
- package/scripts/sous-commandes.mjs +0 -2
- package/scripts/superviseur.mjs +33 -13
- package/scripts/tableau.mjs +61 -16
- package/scripts/transitions.d.mts +25 -2
- package/scripts/transitions.mjs +137 -29
- package/scripts/verrous/ecriture-hors-enveloppe.mjs +31 -9
- package/skills/codebase-design/DESIGN-IT-TWICE.md +1 -1
- package/skills/developpeur/SKILL.md +38 -15
- package/skills/direct/SKILL.md +29 -9
- package/skills/domain-modeling/GLOSSARY-FORMAT.md +9 -9
- package/skills/domain-modeling/SKILL.md +14 -12
- package/skills/explorateur/SKILL.md +30 -6
- package/skills/pitmaster/SKILL.md +12 -16
- package/skills/pitmaster/references/consigne-agent.md +12 -11
- package/skills/relecteur/SKILL.md +12 -5
- package/skills/systematic-debugging/SKILL.md +281 -0
- package/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
- package/skills/systematic-debugging/condition-based-waiting.md +115 -0
- package/skills/systematic-debugging/defense-in-depth.md +122 -0
- package/skills/systematic-debugging/find-polluter.sh +72 -0
- package/skills/systematic-debugging/root-cause-tracing.md +169 -0
- package/skills/testwriter/SKILL.md +35 -29
- package/scripts/verrous/commande.mjs +0 -214
- package/scripts/verrous/verrou.mjs +0 -311
package/scripts/ci-de-main.mjs
CHANGED
|
@@ -7,12 +7,10 @@
|
|
|
7
7
|
//
|
|
8
8
|
// - `declencherLaCiDeMain`: the start (`gh workflow run`), its delay and its fault kept in a file of
|
|
9
9
|
// the project; `alerteDeDeclenchement` tells the supervisor of a start GitHub refused.
|
|
10
|
-
// - `lireLaCiDeMain`: the latest finished pass of
|
|
11
|
-
//
|
|
12
|
-
//
|
|
13
|
-
//
|
|
14
|
-
// itself on a green), and not
|
|
15
|
-
// read, never silence, when gh fails, does not start, answers garbage or no pass at all.
|
|
10
|
+
// - `lireLaCiDeMain`: the latest finished pass of the flow CI (ci.yml) on the branch
|
|
11
|
+
// (`gh run list`), the other flows judging nothing: green when it succeeded, red on any other
|
|
12
|
+
// conclusion (a cancelled or skipped pass judged nothing, the one before it decides), and not
|
|
13
|
+
// read, never silence, when gh fails, does not start, answers garbage or no finished pass.
|
|
16
14
|
// - `lotsDepuisLeVert`: the lots of the circuit between the last green and the tip, by git alone
|
|
17
15
|
// (the commits whose subject ends with « (<ticket>) »), no state kept.
|
|
18
16
|
// - `alerteDeLaCiDeMain` and `ligneDeLaCiDeMain`: what is told to the supervisor and shown on the
|
|
@@ -30,11 +28,13 @@ const COURT = 7;
|
|
|
30
28
|
const court = sha => String(sha).slice(0, COURT);
|
|
31
29
|
const uneLigne = t => String(t).replace(/\s+/g, ' ').trim();
|
|
32
30
|
|
|
31
|
+
const FLUX_DE_LA_CI = 'ci.yml';
|
|
32
|
+
|
|
33
33
|
/**
|
|
34
34
|
* The CI of the branch <branche> (main by default) read with <o.gh> in <o.racine>: `{ etat: 'verte',
|
|
35
|
-
* commit, passage }`, `{ etat: 'rouge', flux, passage, commit, vert }` (the
|
|
36
|
-
* the commit of that pass and the commit of
|
|
37
|
-
*
|
|
35
|
+
* commit, passage }`, `{ etat: 'rouge', flux, passage, commit, vert }` (the name of the flow, its
|
|
36
|
+
* red pass, the commit of that pass and the commit of its last green pass, null when none is read)
|
|
37
|
+
* or `{ etat: 'non-lue', raison }`.
|
|
38
38
|
*/
|
|
39
39
|
export function lireLaCiDeMain(o, { branche = 'main' } = {}) {
|
|
40
40
|
const r = o.gh([
|
|
@@ -42,6 +42,8 @@ export function lireLaCiDeMain(o, { branche = 'main' } = {}) {
|
|
|
42
42
|
'list',
|
|
43
43
|
'--branch',
|
|
44
44
|
branche,
|
|
45
|
+
'--workflow',
|
|
46
|
+
FLUX_DE_LA_CI,
|
|
45
47
|
'--limit',
|
|
46
48
|
'100',
|
|
47
49
|
'--json',
|
|
@@ -75,26 +77,21 @@ export function lireLaCiDeMain(o, { branche = 'main' } = {}) {
|
|
|
75
77
|
if (finis.length === 0) {
|
|
76
78
|
return { etat: 'non-lue', raison: `aucun passage fini de la CI sur ${branche}.` };
|
|
77
79
|
}
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
const rouge = derniers.find(p => p.conclusion !== 'success');
|
|
82
|
-
if (rouge) {
|
|
83
|
-
const vert = finis.find(p => p.workflowName === rouge.workflowName && p.conclusion === 'success');
|
|
80
|
+
const [dernier] = finis;
|
|
81
|
+
if (dernier.conclusion !== 'success') {
|
|
82
|
+
const vert = finis.find(p => p.conclusion === 'success');
|
|
84
83
|
return {
|
|
85
84
|
etat: 'rouge',
|
|
86
|
-
flux:
|
|
87
|
-
passage: String(
|
|
88
|
-
commit:
|
|
85
|
+
flux: dernier.workflowName,
|
|
86
|
+
passage: String(dernier.databaseId),
|
|
87
|
+
commit: dernier.headSha,
|
|
89
88
|
vert: vert?.headSha ?? null,
|
|
90
89
|
};
|
|
91
90
|
}
|
|
92
|
-
|
|
93
|
-
return { etat: 'verte', commit: tete.headSha, passage: String(tete.databaseId) };
|
|
91
|
+
return { etat: 'verte', commit: dernier.headSha, passage: String(dernier.databaseId) };
|
|
94
92
|
}
|
|
95
93
|
|
|
96
94
|
const HEURE = 3_600_000;
|
|
97
|
-
const FLUX_DE_LA_CI = 'ci.yml';
|
|
98
95
|
const EN_ATTENTE = state => state !== 'completed';
|
|
99
96
|
|
|
100
97
|
const etatDuDeclenchement = racine =>
|
package/scripts/circuit.mjs
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
// (the opening, a step of the plan, the preparation of a pass, a fact, a stop, the end). The command
|
|
7
7
|
// `npx grillhouse circuit` is the client of that workflow (src/temporal/circuit/commande.ts): it
|
|
8
8
|
// queues a ticket, answers a stop (`--reprendre` with `--contexte`, `--depuis <testwriter|preuve|
|
|
9
|
-
// developpeur|controles|passe-finale>`, `--etendre <paquet>[,<paquet>…]`) or stops it (`--arreter`).
|
|
9
|
+
// developpeur|direct|controles|passe-finale>`, `--etendre <paquet>[,<paquet>…]`) or stops it (`--arreter`).
|
|
10
10
|
// `--depuis` goes with no `--reprendre` and names no component (a second name is a second ticket,
|
|
11
11
|
// exit 2); `--etendre` refuses a package the repository does not hold (exit 2).
|
|
12
12
|
//
|
|
@@ -42,8 +42,10 @@
|
|
|
42
42
|
// machine's budget (scripts/passe-de-la-machine.mjs); a wait that reaches its bound is the 75.
|
|
43
43
|
// `npm test` in a package named whole carries `GRILLHOUSE_DEPUIS_LE_VERT`
|
|
44
44
|
// (scripts/dernier-vert.mjs).
|
|
45
|
-
// - The proof plays `npm test -- --force <files of the lot>` per package
|
|
46
|
-
//
|
|
45
|
+
// - The proof plays `npm test -- --force <files of the lot>` per package, a module of a test
|
|
46
|
+
// executable by the file that plays it (the whole package when the lot holds no test file); the
|
|
47
|
+
// failure of a test it holds as main's is a red written
|
|
48
|
+
// `rouge existant : <file> › <name> — <message>`; its
|
|
47
49
|
// report goes to `.claude/worktrees/<ticket>.preuve-<n>.md`; the tests that carry the work are
|
|
48
50
|
// those the testwriter's sheet names in `portent_le_travail`. A failed proof relaunches the
|
|
49
51
|
// testwriter twice at most.
|
|
@@ -83,7 +85,10 @@
|
|
|
83
85
|
// (scripts/bilan.mjs, written at each end).
|
|
84
86
|
// - The state (the effect `etat`, scripts/effets.mjs) is `{ etape, tentative, code, raison,
|
|
85
87
|
// rapport, finale, relanceSurLeRefus, boucles, question, questionnement, paquets, constats,
|
|
86
|
-
// verifie, mene, reprise, refus, aRegenerer, controlesRouges, rang, journal }`.
|
|
88
|
+
// verifie, mene, reprise, refus, aRegenerer, controlesRouges, rang, circuit, journal }`.
|
|
89
|
+
// - The circuit (`long`, `court` or `direct`) is fixed at the first opening, `direct` on the label
|
|
90
|
+
// of the ticket, with no plan; a resumption keeps that of the stopped state, and the sort turns
|
|
91
|
+
// `long` and `court` (`circuitSuivant` of scripts/transitions.mjs).
|
|
87
92
|
// - The plan writes `## Noms publiés` (`noms_publies` of the explorateur's last sheet; an empty list
|
|
88
93
|
// erases the section, a sheet without the field keeps it) and `## Sorte` (`sorteDuPlan`,
|
|
89
94
|
// scripts/resultats.mjs; absent or unreadable, comportement) in the description; a mechanical
|
|
@@ -94,7 +99,7 @@
|
|
|
94
99
|
// Codes of the stops (ARRETS), 0 at « integre »; the cause of each is in circuit.md §5.4:
|
|
95
100
|
// 10 lancement, 11 bloqué, 12 sans-fiche, 13 preuve, 14 controles, 15 sans-livraison,
|
|
96
101
|
// 16 relecture-arret, 17 integration (also lot-absent, copie-gardee), 19 hors-portee, 20 besoin,
|
|
97
|
-
// 22 questionnement, 23 references,
|
|
102
|
+
// 22 questionnement, 23 references, 25 inattendu (`arretInattendu`),
|
|
98
103
|
// 26 limite-d-usage (no question: the circuit reports itself to the hour the usage returns),
|
|
99
104
|
// 75 a-repasser (the gesture `a-repasser`).
|
|
100
105
|
// Every stop but 75 and 26 is a question for the supervisor.
|
|
@@ -120,6 +125,10 @@ import { matieresDeclareesDe } from './matieres-cles.mjs';
|
|
|
120
125
|
import { fluxDe } from './flux-des-paquets.mjs';
|
|
121
126
|
import {
|
|
122
127
|
AGENTS_DU_LOT,
|
|
128
|
+
AUTEURS_DE_LOT,
|
|
129
|
+
agentsDuLot,
|
|
130
|
+
auteurDuCode,
|
|
131
|
+
leRole,
|
|
123
132
|
ARRETS,
|
|
124
133
|
AUTO,
|
|
125
134
|
bouclesDe,
|
|
@@ -133,6 +142,8 @@ import {
|
|
|
133
142
|
import {
|
|
134
143
|
CONTROLES,
|
|
135
144
|
PREUVE,
|
|
145
|
+
circuitDeLaSorte,
|
|
146
|
+
circuitSuivant,
|
|
136
147
|
correctionsDuPlan,
|
|
137
148
|
ouvertesDuPlan,
|
|
138
149
|
pasDuPlan,
|
|
@@ -343,9 +354,9 @@ export function contexte(o) {
|
|
|
343
354
|
tmp,
|
|
344
355
|
ports: null,
|
|
345
356
|
};
|
|
346
|
-
// The extension of the plan a
|
|
357
|
+
// The extension of the plan a BESOIN sheet naming a file the ticket names asks for.
|
|
347
358
|
ctx.etendreEnVol = e => etendreEnVol(ctx, e);
|
|
348
|
-
// The same for a
|
|
359
|
+
// The same for a test file of a reader package out of the plan the testwriter's sheet names.
|
|
349
360
|
ctx.etendreTestsEnVol = e => etendreTestsEnVol(ctx, e);
|
|
350
361
|
// The reader packages the plan extended to their tests (kept among the circuit's sheets).
|
|
351
362
|
ctx.testsEtendus = testsEtendusDuPlan(ctx, ctx.paquets);
|
|
@@ -425,7 +436,7 @@ const fichiersRougesDe = (rouges, dossier) => [
|
|
|
425
436
|
// The plan of <ctx> extended, without a stop, to the tests alone of the reader packages
|
|
426
437
|
// <composants> (directories) whose reds all lie in test files (`testsLecteurs` of the checks): the
|
|
427
438
|
// title of the plan does not change, the package does not enter the plan, and the testwriter alone
|
|
428
|
-
// writes those test files (the
|
|
439
|
+
// writes those test files (the judgment of his lot and the envelope read `ctx.testsEtendus`). Said at the ticket
|
|
429
440
|
// with its piece, the package, its red test files and, for one the plan set apart, the reason that
|
|
430
441
|
// the red belies; kept among the circuit's sheets (`testsEtendus`) as `etendus` is. A package
|
|
431
442
|
// already extended to its tests, or that the plan holds, is not extended again.
|
|
@@ -470,8 +481,8 @@ function etendreAuxTests(ctx, { composants, rouges = [] }) {
|
|
|
470
481
|
ctx.testsEtendus = [...(ctx.testsEtendus ?? []), ...gagnes];
|
|
471
482
|
}
|
|
472
483
|
|
|
473
|
-
// The same extension for the package <paquet> of a test file <chemin>
|
|
474
|
-
//
|
|
484
|
+
// The same extension for the package <paquet> of a test file <chemin> the testwriter's BESOIN
|
|
485
|
+
// sheet names, <piece> saying why: the session resumes.
|
|
475
486
|
function etendreTestsEnVol(ctx, { paquet, chemin, piece }) {
|
|
476
487
|
if ((ctx.testsEtendus ?? []).includes(paquet)) {
|
|
477
488
|
return;
|
|
@@ -530,9 +541,21 @@ function ecrireRapport(ctx, etape, texte, resultat, rapport = texte) {
|
|
|
530
541
|
});
|
|
531
542
|
}
|
|
532
543
|
|
|
544
|
+
/**
|
|
545
|
+
* The circuit of a run of <ctx> whose state and memory say none: that of the label `direct` for a
|
|
546
|
+
* ticket no session has worked (an opening that failed before its state), else that of its sort
|
|
547
|
+
* (a run in flight, opened without the field).
|
|
548
|
+
*/
|
|
549
|
+
export function circuitSansTrace(ctx) {
|
|
550
|
+
const mene = lesFiches(ctx).some(e => estUnPlan(e) || AUTEURS_DE_LOT.includes(e.role));
|
|
551
|
+
return !mene && leTicket(ctx).labels.includes('direct')
|
|
552
|
+
? 'direct'
|
|
553
|
+
: circuitDeLaSorte(ctx.sorte ?? sorteDuTicket(ctx));
|
|
554
|
+
}
|
|
555
|
+
|
|
533
556
|
// The state of the run, written whole (`raison`, `boucles` and `question` null, `finale` and
|
|
534
557
|
// `relanceSurLeRefus` false unless <etat> sets them, `paquets`, `constats`, `verifie`, `reprise`,
|
|
535
|
-
// `aRegenerer`, `refus`, `controlesRouges` and `
|
|
558
|
+
// `aRegenerer`, `refus`, `controlesRouges`, `rang` and `circuit` the run's), kept as the run's current
|
|
536
559
|
// state and emitted (the effect `etat`), which the workflow of the ticket holds
|
|
537
560
|
// (src/temporal/circuit/deroule.ts).
|
|
538
561
|
export function ecrireEtat(ctx, etat) {
|
|
@@ -545,6 +568,7 @@ export function ecrireEtat(ctx, etat) {
|
|
|
545
568
|
questionnement: null,
|
|
546
569
|
mene: null,
|
|
547
570
|
...etat,
|
|
571
|
+
circuit: ctx.circuit ?? circuitDeLaSorte(ctx.sorte),
|
|
548
572
|
paquets: ctx.paquets,
|
|
549
573
|
constats: ctx.constats ?? [],
|
|
550
574
|
verifie: ctx.verifie ?? null,
|
|
@@ -665,23 +689,25 @@ export function avantLaPasse(
|
|
|
665
689
|
const fichiers = [...(r.conflits ?? []), ...(r.enAttente ?? [])];
|
|
666
690
|
if (fichiers.length) {
|
|
667
691
|
// The files in conflict, or kept in the lot, go to the role that writes them, the testwriter
|
|
668
|
-
// first
|
|
669
|
-
//
|
|
670
|
-
|
|
692
|
+
// first, all of them to the agent direct in a direct circuit, who writes tests and code; a
|
|
693
|
+
// role already relaunched for them that left one of its files is not relaunched: the stop
|
|
694
|
+
// goes up.
|
|
695
|
+
const direct = ctx.circuit === 'direct';
|
|
696
|
+
const parRole = direct ? { direct: fichiers } : rolesDuConflit(fichiers, estUnTest);
|
|
697
|
+
const roles = direct ? ['direct'] : parRole.roles;
|
|
671
698
|
const relances = ctx.conflitsRelances ?? [];
|
|
672
699
|
const restants = roles.filter(role => !relances.includes(role));
|
|
673
700
|
if (restants.length && restants.length === roles.length) {
|
|
674
|
-
const deRestants = restants.flatMap(role =>
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
const siens = restants[0] === 'testwriter' ? testwriter : developpeur;
|
|
701
|
+
const deRestants = restants.flatMap(role => parRole[role]);
|
|
702
|
+
const siens = parRole[restants[0]];
|
|
703
|
+
const autres = direct ? '' : " Les fichiers de l'autre rôle restent à sa séance.";
|
|
678
704
|
return {
|
|
679
705
|
avancee: false,
|
|
680
706
|
regeneration,
|
|
681
707
|
conflit: {
|
|
682
708
|
fichiers: deRestants,
|
|
683
709
|
roles: restants,
|
|
684
|
-
rapport: `${r.message}\n\nL'avance de la copie sur la pointe de main a laissé ces fichiers à ton rôle : ${siens.join(', ')}.\nLes marques de conflit sont dans la copie (\`<<<<<<<\`, \`=======\`, \`>>>>>>>\`) : tu résous chaque fichier, marques retirées ; un fichier du lot gardé (\`grillhouse-travail.patch\`, dans le dossier git de la copie) se reprend à la main dans la copie, un fichier supprimé par le lot se supprime
|
|
710
|
+
rapport: `${r.message}\n\nL'avance de la copie sur la pointe de main a laissé ces fichiers à ton rôle : ${siens.join(', ')}.\nLes marques de conflit sont dans la copie (\`<<<<<<<\`, \`=======\`, \`>>>>>>>\`) : tu résous chaque fichier, marques retirées ; un fichier du lot gardé (\`grillhouse-travail.patch\`, dans le dossier git de la copie) se reprend à la main dans la copie, un fichier supprimé par le lot se supprime.${autres}`,
|
|
685
711
|
},
|
|
686
712
|
};
|
|
687
713
|
}
|
|
@@ -832,15 +858,17 @@ export function fluxAuLancement(racine) {
|
|
|
832
858
|
// question, the answers `--etendre <paquet>` or the criterion amended and `--reprendre`; their
|
|
833
859
|
// pieces as its piece, the handover after them.
|
|
834
860
|
function arretHorsDuPlan(ctx, tentative, fiche) {
|
|
861
|
+
const role = auteurDuCode(ctx.circuit);
|
|
862
|
+
const qui = leRole(role);
|
|
835
863
|
const criteres = fiche.hors_plan.map(h => `critère ${h.critere} (${h.paquet})`).join(', ');
|
|
836
864
|
const paquets = [...new Set(fiche.hors_plan.map(h => h.paquet))].join(',');
|
|
837
|
-
const passation = derniereDe(ctx,
|
|
865
|
+
const passation = derniereDe(ctx, role)?.text ?? 'aucune';
|
|
838
866
|
return new Arret(
|
|
839
867
|
'hors-portee',
|
|
840
|
-
|
|
868
|
+
`${qui} dit FAIT sans tenir, hors du plan, ${criteres} (séance ${tentative}).\n\nSa passation :\n\n${passation}`,
|
|
841
869
|
{
|
|
842
870
|
piece: fiche.hors_plan.map(h => h.piece).join('\n'),
|
|
843
|
-
question:
|
|
871
|
+
question: `${qui} ne tient pas, hors du plan, ${criteres} : le plan s'étend (\`--etendre ${paquets}\`), ou le critère s'amende au ticket, puis \`--reprendre\`.`,
|
|
844
872
|
}
|
|
845
873
|
);
|
|
846
874
|
}
|
|
@@ -861,9 +889,9 @@ const renvoiDuTestwriter = (ctx, fiche) =>
|
|
|
861
889
|
// remark reaches the ticket, no agent; the sheet's schema gives a RENDU at least one), after each
|
|
862
890
|
// finding open before it that the sheet neither marks lifted (`suivi`, by its title) nor states
|
|
863
891
|
// again, which keeps its mark `enContexte` (`auLancement`), a finding the sheet states coming
|
|
864
|
-
// without it. Each one `{ titre, regle, role, corps, piece }`, its recipient the agent it names,
|
|
865
|
-
//
|
|
866
|
-
// answers it again. Throws an Arret `relecture-arret` for a finding without a valid recipient or one
|
|
892
|
+
// without it. Each one `{ titre, regle, role, corps, piece }`, its recipient the agent it names, one
|
|
893
|
+
// of those who write the lot of its circuit (`agentsDuLot`), without the developpeur's answer to the
|
|
894
|
+
// review before (`reponse`): his next sheet answers it again. Throws an Arret `relecture-arret` for a finding without a valid recipient or one
|
|
867
895
|
// that puts a criterion in question.
|
|
868
896
|
export function constatsOuverts(ctx, fiche, texte) {
|
|
869
897
|
const arret = raison =>
|
|
@@ -872,9 +900,10 @@ export function constatsOuverts(ctx, fiche, texte) {
|
|
|
872
900
|
if (c.critere_en_cause) {
|
|
873
901
|
throw arret(`Le constat « ${c.titre} » met en cause un critère du ticket.`);
|
|
874
902
|
}
|
|
875
|
-
|
|
903
|
+
const agents = agentsDuLot(ctx.circuit);
|
|
904
|
+
if (!agents.includes(c.role)) {
|
|
876
905
|
throw arret(
|
|
877
|
-
`Le constat « ${c.titre} » n'a pas de destinataire valide : il nomme ${c.role ? `« ${c.role} »` : 'personne'}, quand le rôle est ${
|
|
906
|
+
`Le constat « ${c.titre} » n'a pas de destinataire valide : il nomme ${c.role ? `« ${c.role} »` : 'personne'}, quand le rôle est ${agents.join(' ou ')}.`
|
|
878
907
|
);
|
|
879
908
|
}
|
|
880
909
|
return { titre: c.titre, regle: c.regle, role: c.role, corps: c.corps, piece: c.piece };
|
|
@@ -923,7 +952,7 @@ function boucles(ctx, etape, tentative, finale) {
|
|
|
923
952
|
relecture: () => rendusDepuisAccepte(ctx) + 1,
|
|
924
953
|
};
|
|
925
954
|
const e = etapeDuCircuit({ etape, finale });
|
|
926
|
-
const l = e ? bouclesDe(e).filter(b => compte[b.cle]) : [];
|
|
955
|
+
const l = e ? bouclesDe(e, ctx.circuit).filter(b => compte[b.cle]) : [];
|
|
927
956
|
return l.length ? Object.fromEntries(l.map(b => [b.cle, compte[b.cle]()])) : null;
|
|
928
957
|
}
|
|
929
958
|
|
|
@@ -1195,8 +1224,7 @@ export function arretDe(ctx, a) {
|
|
|
1195
1224
|
// rule settles: its question (`{ arret, fait, piece, question, qui }`: the fact, the first line of
|
|
1196
1225
|
// its motive or its report; its piece, the one it carries, else its reds with their file and line,
|
|
1197
1226
|
// else the end of the log; the question of its kind, scripts/etapes.mjs MONTEES, after the agent's
|
|
1198
|
-
// own
|
|
1199
|
-
// none; who must answer it) kept in the state, written at the ticket and on the error output. Its
|
|
1227
|
+
// own; who must answer it) kept in the state, written at the ticket and on the error output. Its
|
|
1200
1228
|
// exit code.
|
|
1201
1229
|
export function monter(ctx, a) {
|
|
1202
1230
|
const m = monteeDe(a.nom);
|
|
@@ -1208,14 +1236,7 @@ export function monter(ctx, a) {
|
|
|
1208
1236
|
String(a.piece ?? '').trim() ||
|
|
1209
1237
|
rouges ||
|
|
1210
1238
|
`Le journal du ticket, ${ctx.journal} (il se cite en pièce, \`${ctx.ticket}.log:<ligne>\`) :\n${fin(lire(ctx.journal), 20)}`;
|
|
1211
|
-
|
|
1212
|
-
// alone for the repository root): the generic one would offer `--etendre` for any path.
|
|
1213
|
-
const question =
|
|
1214
|
-
a.question && a.nom === 'hors-plan'
|
|
1215
|
-
? a.question
|
|
1216
|
-
: a.question
|
|
1217
|
-
? `${a.question}\n\n${m.question}`
|
|
1218
|
-
: m.question;
|
|
1239
|
+
const question = a.question ? `${a.question}\n\n${m.question}` : m.question;
|
|
1219
1240
|
const qui = a.qui ?? m.qui;
|
|
1220
1241
|
ecrireEtat(ctx, {
|
|
1221
1242
|
...a.etat,
|
|
@@ -1245,6 +1266,7 @@ function departDuCircuit(ctx, e) {
|
|
|
1245
1266
|
etat: e,
|
|
1246
1267
|
refus: ctx.refus,
|
|
1247
1268
|
ticket: ctx.ticket,
|
|
1269
|
+
circuit: ctx.circuit ?? null,
|
|
1248
1270
|
});
|
|
1249
1271
|
if (d.usage) {
|
|
1250
1272
|
throw new Usage(d.usage);
|
|
@@ -1544,6 +1566,7 @@ function ecrireLePlan(ctx, plan, description = null) {
|
|
|
1544
1566
|
// plan), written in the description (« ## Sorte ») and said at the ticket (`Circuit · plan : …`).
|
|
1545
1567
|
function ecrireLaSorte(ctx, sorte) {
|
|
1546
1568
|
ctx.sorte = sorte;
|
|
1569
|
+
ctx.circuit = circuitSuivant(ctx.circuit, sorte);
|
|
1547
1570
|
inscrire(ctx, { role: AUTEUR_DU_CIRCUIT, sorte });
|
|
1548
1571
|
ecrireLePlan(ctx, ctx.paquets, redecrireLaSorte(leTicket(ctx).description, sorte));
|
|
1549
1572
|
commenter(ctx, 'plan', `la sorte du ticket devient ${texteDeLaSorte(sorte)} ; le plan reste.`);
|
|
@@ -1600,8 +1623,8 @@ export function testsEtendusDuPlan(ctx, paquets) {
|
|
|
1600
1623
|
* plan (`--etendre`, kept among the sheets, `etendus`) that it leaves out, in its order
|
|
1601
1624
|
* (`planEtendu`), said at the ticket: the supervisor's word on the plan stands until he changes
|
|
1602
1625
|
* it, as a reviewer's requested change stays on a pull request its author pushes again, and a plan
|
|
1603
|
-
* written again (a description the responsable changed) does not
|
|
1604
|
-
*
|
|
1626
|
+
* written again (a description the responsable changed) does not take back from the developpeur a
|
|
1627
|
+
* package the extension had given. `--recommencer`, which removes the sheets, starts
|
|
1605
1628
|
* the plan over without them.
|
|
1606
1629
|
*/
|
|
1607
1630
|
export function avecLesEtendus(ctx, paquets) {
|
|
@@ -1981,6 +2004,7 @@ const PAS_DU_PLAN = {
|
|
|
1981
2004
|
// « arrete », its question lifted, said at the ticket. Its exit code, 0.
|
|
1982
2005
|
export async function arreter(ctx, e) {
|
|
1983
2006
|
const lu = e;
|
|
2007
|
+
ctx.circuit = ctx.circuit ?? lu.circuit;
|
|
1984
2008
|
ctx.constats = [...(lu.constats ?? [])];
|
|
1985
2009
|
ctx.verifie = lu.verifie ?? null;
|
|
1986
2010
|
ctx.toursDeLaPasseFinale = lu.toursDeLaPasseFinale ?? null;
|
|
@@ -2124,6 +2148,13 @@ function etendre(ctx, e) {
|
|
|
2124
2148
|
// The opening of <ctx> on <e> before its plan: `{ debut }`, or `{ code }`, a stop gone up.
|
|
2125
2149
|
async function avantLePlan(ctx, e) {
|
|
2126
2150
|
rentrerDansLaFile(ctx, e);
|
|
2151
|
+
// The circuit is fixed at the first opening, read in the label of the ticket; a resumption
|
|
2152
|
+
// keeps that of the stopped state.
|
|
2153
|
+
if (e) {
|
|
2154
|
+
ctx.circuit = e.circuit ?? ctx.circuit ?? circuitSansTrace(ctx);
|
|
2155
|
+
} else {
|
|
2156
|
+
ctx.circuit = leTicket(ctx).labels.includes('direct') ? 'direct' : 'long';
|
|
2157
|
+
}
|
|
2127
2158
|
if (ctx.etendre) {
|
|
2128
2159
|
if (e?.etape === 'integre') {
|
|
2129
2160
|
throw new Usage(`--etendre : le lot de ${ctx.ticket} est intégré.`);
|
|
@@ -2146,6 +2177,11 @@ async function avantLePlan(ctx, e) {
|
|
|
2146
2177
|
inscrire(ctx, { role: AUTEUR_DU_CIRCUIT, plan: { empreinte: empreinteDuPlan(leTicket(ctx)) } });
|
|
2147
2178
|
}
|
|
2148
2179
|
const d = departDuCircuit(ctx, e);
|
|
2180
|
+
// A direct circuit has no plan to write: the packages of its title, resolved, are its plan,
|
|
2181
|
+
// written at the ticket as one.
|
|
2182
|
+
if (!e && ctx.circuit === 'direct') {
|
|
2183
|
+
ecrireLePlan(ctx, ctx.paquets);
|
|
2184
|
+
}
|
|
2149
2185
|
// A ticket labelled arbitrage starts and resumes only on the arbitrage its integration will
|
|
2150
2186
|
// ask for: the integration's rule, before any session.
|
|
2151
2187
|
const arbitrage = refusArbitrage({ id: ctx.ticket, ...leTicket(ctx) }, lesCommentaires(ctx));
|
|
@@ -2209,13 +2245,20 @@ export async function ouvrirJusquAuPlan(ctx, e) {
|
|
|
2209
2245
|
if ('code' in o) {
|
|
2210
2246
|
return o;
|
|
2211
2247
|
}
|
|
2212
|
-
const aEcrire =
|
|
2248
|
+
const aEcrire =
|
|
2249
|
+
ctx.circuit !== 'direct' &&
|
|
2250
|
+
o.debut.etape === TESTS &&
|
|
2251
|
+
!planPasse(ctx, empreinteDuPlan(leTicket(ctx)));
|
|
2213
2252
|
return { debut: o.debut, plan: aEcrire ? planAuDebut(ctx) : null };
|
|
2214
2253
|
}
|
|
2215
2254
|
|
|
2216
|
-
/**
|
|
2255
|
+
/**
|
|
2256
|
+
* The end of the opening of <ctx> at the step <d>: the sort of the ticket, none for a direct
|
|
2257
|
+
* circuit, and the circuit that follows it. `{ debut }`.
|
|
2258
|
+
*/
|
|
2217
2259
|
export function finirLOuverture(ctx, d) {
|
|
2218
2260
|
// The sort of the ticket its plan says, which the run reads at each step.
|
|
2219
|
-
ctx.sorte = sorteDuTicket(ctx);
|
|
2261
|
+
ctx.sorte = ctx.circuit === 'direct' ? null : sorteDuTicket(ctx);
|
|
2262
|
+
ctx.circuit = circuitSuivant(ctx.circuit, ctx.sorte);
|
|
2220
2263
|
return { debut: d };
|
|
2221
2264
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// The circuits of a repository as the board (scripts/tableau.mjs) and the supervisor
|
|
2
|
-
// (scripts/superviseur.mjs) read them, from the view of the circuit (circuit.md §4.2):
|
|
3
|
-
// client.ts `lireLesCircuits`, the memo and
|
|
4
|
-
// UI of Temporal lists its workflows, and the progress of the pass under way of each one that runs,
|
|
2
|
+
// (scripts/superviseur.mjs) read them, from the view of the circuit (circuit.md §4.2): lists of the
|
|
3
|
+
// Temporal server that it filters (src/temporal/circuit/client.ts `lireLesCircuits`, the memo and
|
|
4
|
+
// the status of each workflow, no worker living), as the UI of Temporal lists its workflows, and the progress of the pass under way of each one that runs,
|
|
5
5
|
// read in its working directory (scripts/avancement.mjs `avancementDuTravail`); and the night
|
|
6
6
|
// under way on the machine, by the query of the workflow of the nights (`nuitDuServeur`).
|
|
7
7
|
import { existsSync } from 'node:fs';
|
|
@@ -76,8 +76,8 @@ const sansReponse = e =>
|
|
|
76
76
|
[e, e?.cause].some(x => typeof x?.code === 'number' && SANS_REPONSE.has(x.code));
|
|
77
77
|
|
|
78
78
|
/**
|
|
79
|
-
* The circuits of the repository at <racine>, read from the Temporal server of the environment
|
|
80
|
-
*
|
|
79
|
+
* The circuits of the repository at <racine>, read from the Temporal server of the environment
|
|
80
|
+
* (the integrated ones too when <integres> asks for them, `lireLesCircuits`), with their progress (`avecLeurAvancement`) and the page of each one's workflow on the
|
|
81
81
|
* web UI of the server (`lienDuTableauWeb`). A server that does not answer within
|
|
82
82
|
* DELAI_MS throws `ServeurMuet`, which its caller tells from a repository without circuits and
|
|
83
83
|
* from any other fault, thrown as it is; a client not built throws `ClientNonConstruit`.
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
// package it changes. A survey by the types that cannot run says why, and the survey stands on
|
|
44
44
|
// the names; a name the types resolve is not set apart.
|
|
45
45
|
// - By the paths read (`lit`): each component whose tests declare they read a path
|
|
46
|
-
// (`grillhouse.lit` of its package.json
|
|
47
|
-
// path the ticket changes holds or lies in: a path of the repository the sections write (its
|
|
46
|
+
// (`grillhouse.lit` of its package.json, the `lit` of its traces and the `// @lit` lines of its
|
|
47
|
+
// test files, `cheminsLus`) that a path the ticket changes holds or lies in: a path of the repository the sections write (its
|
|
48
48
|
// `:<line>` left out), or the folder of a component they name.
|
|
49
49
|
// - By the architecture: the items of the « Rend » of the `docs/CADRE.md` of each component that
|
|
50
50
|
// publishes an element (by its interface or by the types), each component they name
|
|
@@ -55,29 +55,38 @@
|
|
|
55
55
|
// the order of their names otherwise.
|
|
56
56
|
//
|
|
57
57
|
// The mechanism: docs/architecture/circuit.md §5.2 (the plan of a ticket).
|
|
58
|
-
import { existsSync, readFileSync } from 'node:fs';
|
|
58
|
+
import { existsSync, globSync, readFileSync } from 'node:fs';
|
|
59
59
|
import path from 'node:path';
|
|
60
60
|
import { pathToFileURL } from 'node:url';
|
|
61
61
|
import { spawnSync } from 'node:child_process';
|
|
62
|
-
import { langageDe } from './langages.mjs';
|
|
62
|
+
import { langageDe, langagesDeclares } from './langages.mjs';
|
|
63
|
+
import { lectureNette } from './paquets.mjs';
|
|
63
64
|
|
|
64
65
|
/**
|
|
65
66
|
* The paths that the tests of the package at <dir> declare they read: its `grillhouse.lit`, then
|
|
66
|
-
* the `lit` of each trace it declares (`grillhouse.traces`), each path from the root
|
|
67
|
-
* a package.json or a declaration
|
|
67
|
+
* the `lit` of each trace it declares (`grillhouse.traces`), each path from the root, none without
|
|
68
|
+
* a package.json or a declaration; then, in the project at <racine>, the patterns of the `// @lit`
|
|
69
|
+
* lines of its test files, as the modules of its languages read them (`lecturesDesTests`), none
|
|
70
|
+
* for a project that declares no language.
|
|
68
71
|
* @param {string} dir the directory of the package
|
|
72
|
+
* @param {string} [racine] the root of the project
|
|
69
73
|
* @returns {string[]}
|
|
70
74
|
*/
|
|
71
|
-
export function cheminsLus(dir) {
|
|
75
|
+
export function cheminsLus(dir, racine) {
|
|
76
|
+
const desTests =
|
|
77
|
+
racine && langagesDeclares(racine).length
|
|
78
|
+
? langageDe(racine).lecturesDesTests(dir)
|
|
79
|
+
: [];
|
|
72
80
|
const manifeste = path.join(dir, 'package.json');
|
|
73
81
|
if (!existsSync(manifeste)) {
|
|
74
|
-
return
|
|
82
|
+
return desTests;
|
|
75
83
|
}
|
|
76
84
|
const { grillhouse } = JSON.parse(readFileSync(manifeste, 'utf8'));
|
|
77
85
|
const liste = v => (Array.isArray(v) ? v.filter(l => typeof l === 'string') : []);
|
|
78
86
|
return [
|
|
79
87
|
...liste(grillhouse?.lit),
|
|
80
88
|
...Object.values(grillhouse?.traces ?? {}).flatMap(t => liste(t?.lit)),
|
|
89
|
+
...desTests,
|
|
81
90
|
];
|
|
82
91
|
}
|
|
83
92
|
|
|
@@ -149,6 +158,15 @@ function cheminsEcrits(racine, texte) {
|
|
|
149
158
|
// Whether the path <a> holds the path <b> or lies in it, both from the root.
|
|
150
159
|
const recouvre = (a, b) => a === b || b.startsWith(`${a}/`) || a.startsWith(`${b}/`);
|
|
151
160
|
|
|
161
|
+
// Whether the path <change> from <racine> is one the pattern or path <lu> reads: a path <lu> that
|
|
162
|
+
// holds it or lies in it; a pattern that matches it, or that matches a file under it.
|
|
163
|
+
const atteint = (racine, lu, change) =>
|
|
164
|
+
recouvre(lu, change) ||
|
|
165
|
+
path.matchesGlob(change, lu) ||
|
|
166
|
+
globSync(lu, { cwd: racine, exclude: f => path.basename(String(f)) === 'node_modules' }).some(f =>
|
|
167
|
+
f.split(path.sep).join('/').startsWith(`${change}/`)
|
|
168
|
+
);
|
|
169
|
+
|
|
152
170
|
// The components of <tous> whose tests declare they read a path that one of <changes> holds or
|
|
153
171
|
// lies in, out of their own folder: Map component → Set of « lit <path read> (<paths changed>) ».
|
|
154
172
|
function lecteursDesChemins(racine, tous, changes) {
|
|
@@ -156,9 +174,9 @@ function lecteursDesChemins(racine, tous, changes) {
|
|
|
156
174
|
for (const c of tous) {
|
|
157
175
|
const propre = path.relative(racine, c.dossier).split(path.sep).join('/');
|
|
158
176
|
const par = new Set();
|
|
159
|
-
for (const brut of new Set(cheminsLus(c.dossier))) {
|
|
160
|
-
const lu = brut
|
|
161
|
-
const atteints = changes.filter(ch => !recouvre(propre, ch) &&
|
|
177
|
+
for (const brut of new Set(cheminsLus(c.dossier, racine))) {
|
|
178
|
+
const lu = lectureNette(brut);
|
|
179
|
+
const atteints = changes.filter(ch => !recouvre(propre, ch) && atteint(racine, lu, ch)).sort();
|
|
162
180
|
if (atteints.length) {
|
|
163
181
|
par.add(`lit ${lu} (${atteints.join(', ')})`);
|
|
164
182
|
}
|
|
@@ -370,7 +388,7 @@ export function texteDuReleve(r) {
|
|
|
370
388
|
}
|
|
371
389
|
if (r.lit.length) {
|
|
372
390
|
const lus = r.lit.map(l => `${l.composant} (${l.par.join(' ; ')})`).join(', ');
|
|
373
|
-
out.push(`- Par les chemins lus (\`grillhouse.lit\`) : ${lus}.`);
|
|
391
|
+
out.push(`- Par les chemins lus (\`grillhouse.lit\`, \`// @lit\`) : ${lus}.`);
|
|
374
392
|
}
|
|
375
393
|
if (r.architecture.length) {
|
|
376
394
|
const lus = r.architecture.map(l => `${l.composant} (${l.par.join(' ; ')})`).join(', ');
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
// the order of the declaration; but the index of the interfaces, which each module generates:
|
|
27
27
|
// one of the core (./index-interfaces.mjs), assembled from each module's entries, its command
|
|
28
28
|
// (`index-interfaces`), its generated file and its guard in place of the modules', at the place
|
|
29
|
-
// of the first. What the
|
|
29
|
+
// of the first. What the judgment of a lot, the envelope and the update ask (the lock
|
|
30
30
|
// files, the outputs, the rules of the roles, the tools, the binaries, the directories to
|
|
31
31
|
// ignore): the union, each once.
|
|
32
32
|
//
|
|
@@ -199,6 +199,8 @@ export function composer(modules) {
|
|
|
199
199
|
matieres: racine => modules.flatMap(m => m.matieres(racine)),
|
|
200
200
|
joueDesTests: (racine, composant) =>
|
|
201
201
|
moduleDuComposant(racine, composant)?.joueDesTests(racine, composant) ?? false,
|
|
202
|
+
lecturesDesTests: dossier =>
|
|
203
|
+
unique(modules.flatMap(m => m.lecturesDesTests(dossier))).sort(),
|
|
202
204
|
environnementDuPoste: env => modules.reduce((e, m) => m.environnementDuPoste(e), env),
|
|
203
205
|
empreintes(racine, noms) {
|
|
204
206
|
const parts = modules.map(m => m.empreintes(racine, noms));
|
|
@@ -259,8 +261,8 @@ export function composer(modules) {
|
|
|
259
261
|
: { script: COMMANDES_COMPOSEES, args: [nom] },
|
|
260
262
|
])
|
|
261
263
|
),
|
|
262
|
-
verdict(dossier) {
|
|
263
|
-
const parts = modules.map(m => m.verdict(dossier));
|
|
264
|
+
verdict(dossier, racine) {
|
|
265
|
+
const parts = modules.map(m => m.verdict(dossier, racine));
|
|
264
266
|
return {
|
|
265
267
|
rapports: parts.flatMap(p => p.rapports),
|
|
266
268
|
taches: parts.flatMap(p => p.taches),
|
package/scripts/conformite.mjs
CHANGED
|
@@ -141,7 +141,7 @@ export function cas(langage, exemples, { dans = tmpdir() } = {}) {
|
|
|
141
141
|
return out;
|
|
142
142
|
},
|
|
143
143
|
verdict: dossier => {
|
|
144
|
-
const v = langage.verdict(dossier);
|
|
144
|
+
const v = langage.verdict(dossier, e.racine);
|
|
145
145
|
return [
|
|
146
146
|
...v.taches
|
|
147
147
|
.filter(t => t.code !== null && t.code !== 0)
|
|
@@ -178,9 +178,10 @@ const un = n => (Number.isInteger(n) ? String(n) : n.toFixed(1).replace('.', ','
|
|
|
178
178
|
/**
|
|
179
179
|
* What a pass consumes beyond its part, said, null when it holds to it: the cores it occupied
|
|
180
180
|
* (processor time ÷ duration, once the pass has played SEUIL_DE_DEPASSEMENT_MS) above
|
|
181
|
-
* DEPASSEMENT times its cores, or a peak of memory above its memory
|
|
182
|
-
*
|
|
183
|
-
*
|
|
181
|
+
* DEPASSEMENT times its cores, or a peak of memory above its limit (its memory when it names none;
|
|
182
|
+
* a limit null, a session, has none).
|
|
183
|
+
* @param {{ part: { coeurs: number, memoire: number, limite?: number | null },
|
|
184
|
+
* cpuNs: number | null, dureeMs: number, memoirePic: number | null }} o
|
|
184
185
|
* @returns {string | null}
|
|
185
186
|
*/
|
|
186
187
|
export function depasseLaPart({ part, cpuNs, dureeMs, memoirePic }) {
|
|
@@ -190,8 +191,9 @@ export function depasseLaPart({ part, cpuNs, dureeMs, memoirePic }) {
|
|
|
190
191
|
return `cœurs : ${un(Math.round(occupes * 10) / 10)} mesurés pour ${part.coeurs}`;
|
|
191
192
|
}
|
|
192
193
|
}
|
|
193
|
-
|
|
194
|
-
|
|
194
|
+
const limite = part.limite === undefined ? part.memoire : part.limite;
|
|
195
|
+
if (typeof memoirePic === 'number' && limite !== null && memoirePic > limite) {
|
|
196
|
+
return `mémoire : ${un(Math.round((memoirePic / 1024 ** 3) * 10) / 10)} Go mesurés pour ${un(Math.round((limite / 1024 ** 3) * 10) / 10)}`;
|
|
195
197
|
}
|
|
196
198
|
return null;
|
|
197
199
|
}
|
|
@@ -338,7 +340,7 @@ export function scopeSystemd({
|
|
|
338
340
|
String(poidsDeLaPart(part)),
|
|
339
341
|
'MemoryMax',
|
|
340
342
|
't',
|
|
341
|
-
String(Math.floor(part.memoire)),
|
|
343
|
+
String(Math.floor(part.limite ?? part.memoire)),
|
|
342
344
|
]
|
|
343
345
|
: []),
|
|
344
346
|
// Under the framework slice, whose cores are not those withdrawn from the user's `app.slice`.
|
|
@@ -70,21 +70,13 @@
|
|
|
70
70
|
// - The line of each copy kept names the place it holds, as `du -sk` counts it (« 2,7 Go »).
|
|
71
71
|
// - The branch of a copy removed goes (`git branch -D`), its content being HEAD's, on main; main
|
|
72
72
|
// and a branch another copy holds stay.
|
|
73
|
-
// -
|
|
74
|
-
// temporary directory, which the launcher gives each session of the ticket and
|
|
75
|
-
// `npx grillhouse temporaire <ticket>` the supervisor, `balayerLesTickets` of
|
|
76
|
-
// scripts/mesure/base-de-passe.mjs), as its copy goes; a ticket open, frozen or not, keeps it, as
|
|
77
|
-
// a retention policy fixed in advance. The closed tickets are read only when such a directory
|
|
78
|
-
// is there.
|
|
79
|
-
// - One line per copy removed or kept, and per ticket's temporary directory removed, on the
|
|
80
|
-
// output, which the night adds to its log. The exit is
|
|
73
|
+
// - One line per copy removed or kept, on the output, which the night adds to its log. The exit is
|
|
81
74
|
// 0 whatever is removed or kept: the removal never changes the night's verdict.
|
|
82
75
|
import { spawnSync } from 'node:child_process';
|
|
83
76
|
import { existsSync, lstatSync, realpathSync, rmSync } from 'node:fs';
|
|
84
77
|
import path from 'node:path';
|
|
85
78
|
import { PILOTE } from './fusion-du-changelog.mjs';
|
|
86
79
|
import { langageDe } from './langages.mjs';
|
|
87
|
-
import { balayerLesTickets } from './mesure/base-de-passe.mjs';
|
|
88
80
|
import { nettoyerLeJournal } from './journal-des-etats.mjs';
|
|
89
81
|
|
|
90
82
|
const RETIRER = path.join(import.meta.dirname, 'retirer-copie.sh');
|
|
@@ -494,9 +486,8 @@ function ignoresDuLangage(racine) {
|
|
|
494
486
|
* The removal of the copies of the repository at <racine> (`retirerLesCopiesFinies`), the copy of
|
|
495
487
|
* the night left out, the copies <finies> left out and pruned, their owner having played its pass
|
|
496
488
|
* in them (the night's own, which scripts/nuit.sh names), the tickets read by bd, the tickets
|
|
497
|
-
* whose circuit the server holds <tenus> (null when unread)
|
|
498
|
-
*
|
|
499
|
-
* (scripts/circuit.mjs) run. Its lines.
|
|
489
|
+
* whose circuit the server holds <tenus> (null when unread): what the night and the end of each
|
|
490
|
+
* circuit (scripts/circuit.mjs) run. Its lines.
|
|
500
491
|
* @param {string} racine the main tree
|
|
501
492
|
* @param {string[]} [finies]
|
|
502
493
|
* @param {Set<string> | null} [tenus]
|
|
@@ -511,12 +502,10 @@ export function retirerLesCopiesDuDepot(racine, finies = [], tenus = null) {
|
|
|
511
502
|
lireFermes: () => tickets(racine, 'closed'),
|
|
512
503
|
ignorer: ignoresDuLangage(racine),
|
|
513
504
|
});
|
|
514
|
-
const retires = balayerLesTickets(() => tickets(racine, 'closed'));
|
|
515
505
|
// The journal of states, bounded as the other working files (scripts/journal-des-etats.mjs).
|
|
516
506
|
const segments = nettoyerLeJournal(racine).retires;
|
|
517
507
|
return [
|
|
518
508
|
...lignes,
|
|
519
|
-
...retires.map(t => `✓ dossier temporaire du ticket ${t} retiré.`),
|
|
520
509
|
...segments.map(s => `✓ segment ${s} du journal des états retiré.`),
|
|
521
510
|
];
|
|
522
511
|
}
|