@roomi-fields/grillhouse 0.30.0 → 0.32.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 +0 -1
- package/agents/explorateur.md +0 -1
- package/agents/questionneur.md +0 -1
- package/agents/testwriter.md +0 -1
- package/dist/temporal/circuit/client.d.ts +2 -2
- package/dist/temporal/circuit/client.js.map +1 -1
- package/dist/temporal/circuit/commande.js +4 -4
- package/dist/temporal/circuit/commande.js.map +1 -1
- package/dist/temporal/circuit/contrat.d.ts +3 -3
- package/dist/temporal/circuit/contrat.js +8 -2
- package/dist/temporal/circuit/contrat.js.map +1 -1
- package/dist/temporal/circuit/deroule.js +3 -3
- package/dist/temporal/circuit/deroule.js.map +1 -1
- package/dist/temporal/commande.js +5 -6
- package/dist/temporal/commande.js.map +1 -1
- package/dist/temporal/installation.d.ts +3 -6
- package/dist/temporal/installation.js +19 -38
- package/dist/temporal/installation.js.map +1 -1
- package/dist/temporal/tickets/activites.d.ts +1 -0
- package/dist/temporal/tickets/activites.js +5 -0
- package/dist/temporal/tickets/activites.js.map +1 -1
- package/dist/temporal/tickets/contrat.d.ts +10 -0
- package/dist/temporal/tickets/deroule.js +8 -1
- package/dist/temporal/tickets/deroule.js.map +1 -1
- package/docs/ARCHITECTURE.md +119 -27
- package/docs/CADRE.md +20 -0
- package/docs/INTERFACE.md +17 -4
- package/hooks/hooks.json +4 -0
- package/package.json +2 -2
- package/scripts/activites.mjs +155 -84
- package/scripts/aiguillage.mjs +35 -11
- package/scripts/attente-au-tour.mjs +99 -0
- package/scripts/avancement.mjs +27 -10
- package/scripts/base-des-workflows.mjs +57 -0
- package/scripts/bilan.mjs +101 -25
- package/scripts/cadre.mjs +5 -2
- package/scripts/circuit.mjs +173 -58
- package/scripts/composants-affectes.mjs +64 -21
- package/scripts/composition-des-langages.mjs +5 -3
- package/scripts/conformite.mjs +54 -19
- package/scripts/copies-finies.mjs +8 -1
- package/scripts/dependances-internes.mjs +9 -3
- package/scripts/dernier-vert.mjs +84 -23
- package/scripts/dette.mjs +32 -11
- package/scripts/donnees-cles.mjs +24 -8
- package/scripts/droits.mjs +40 -15
- package/scripts/effets.mjs +9 -0
- package/scripts/empreinte-d-etape.mjs +17 -0
- package/scripts/engendres.mjs +15 -5
- package/scripts/enveloppe/enveloppe.mjs +141 -48
- package/scripts/enveloppe/travail-de-la-copie.mjs +36 -12
- package/scripts/etapes.mjs +1 -1
- package/scripts/faits-du-circuit.mjs +1 -1
- package/scripts/flux-des-paquets.mjs +21 -7
- package/scripts/gardes-du-cadre.mjs +9 -3
- package/scripts/init.mjs +11 -4
- package/scripts/integration/file.mjs +84 -29
- package/scripts/integration/integrer.mjs +70 -24
- package/scripts/integration/rejeu.mjs +26 -9
- package/scripts/jointure.d.ts +10 -1
- package/scripts/journal-des-etats.d.mts +41 -0
- package/scripts/journal-des-etats.mjs +273 -0
- package/scripts/journal.mjs +119 -0
- package/scripts/langages/cargo/commandes.mjs +97 -18
- package/scripts/langages/cargo/composants.mjs +24 -8
- package/scripts/langages/cargo/index.mjs +7 -0
- package/scripts/langages/cargo/tests-de-head.mjs +25 -9
- package/scripts/langages/python/commandes.mjs +3 -1
- package/scripts/langages/python/index.mjs +6 -0
- package/scripts/langages/typescript/chemins-des-tests.mjs +6 -2
- package/scripts/langages/typescript/composants.mjs +9 -3
- package/scripts/langages/typescript/consommateurs-arbitres.mjs +40 -14
- package/scripts/langages/typescript/consommateurs.mjs +39 -14
- package/scripts/langages/typescript/elements-du-lot.mjs +36 -12
- package/scripts/langages/typescript/frontieres.mjs +112 -22
- package/scripts/langages/typescript/index-interfaces.mjs +36 -13
- package/scripts/langages/typescript/index.mjs +12 -3
- package/scripts/langages/typescript/interfaces-contre-code.mjs +109 -41
- package/scripts/langages/typescript/lecteurs.mjs +36 -11
- package/scripts/langages/typescript/migrations/0.23.0-config-vitest.mjs +15 -5
- package/scripts/langages/typescript/migrations/0.25.0-chemins-des-tests.mjs +6 -2
- package/scripts/langages/typescript/migrations/0.25.0-tailles-des-tests.mjs +6 -2
- package/scripts/langages/typescript/migrations/0.30.0-tailles-des-outils-lourds.mjs +3 -1
- package/scripts/langages/typescript/parcours.mjs +12 -4
- package/scripts/langages/typescript/regle-des-tests.mjs +9 -3
- package/scripts/langages/typescript/resumes.mjs +9 -3
- package/scripts/langages/typescript/tailles-des-tests.mjs +58 -16
- package/scripts/langages/typescript/tests-de-nuit.mjs +3 -1
- package/scripts/langages/typescript/tests.mjs +24 -8
- package/scripts/langages/typescript/titres-de-tests.mjs +35 -12
- package/scripts/langages/typescript/turbo-des-paquets.mjs +152 -51
- package/scripts/langages/typescript/verdict.mjs +3 -1
- package/scripts/langages/typescript/verifier.mjs +61 -14
- package/scripts/langages/typescript/vitest-config/avancement.reporter.mjs +15 -5
- package/scripts/langages/typescript/vitest-config/base.mjs +10 -2
- package/scripts/langages/typescript/vitest-config/changements.mjs +21 -8
- package/scripts/langages/typescript/vitest-config/delais.mjs +9 -3
- package/scripts/langages/typescript/vitest-config/duree.classement.mjs +12 -4
- package/scripts/langages/typescript/vitest-config/duree.reporter.mjs +17 -6
- package/scripts/langages/typescript/vitest-config/lances.mjs +83 -27
- package/scripts/langages/typescript/vitest-config/machine.setup.mjs +7 -0
- package/scripts/langages/typescript/vitest-config/resultats.mjs +3 -1
- package/scripts/langages.d.mts +20 -0
- package/scripts/lint-des-scripts.mjs +58 -0
- package/scripts/matiere-de-test.d.ts +11 -0
- package/scripts/mesure/base-de-passe.mjs +117 -25
- package/scripts/mesure/pression.mjs +9 -3
- package/scripts/migrations/0.23.0-charte-importee.mjs +6 -2
- package/scripts/migrations/0.23.0-crochets-de-seance.mjs +25 -8
- package/scripts/migrations/0.23.0-marche-du-projet.mjs +18 -6
- package/scripts/migrations/0.23.2-copies-du-cadre.mjs +48 -16
- package/scripts/migrations/0.24.12-tri-des-decouvertes.mjs +6 -2
- package/scripts/migrations/0.25.0-script-des-tests.mjs +15 -5
- package/scripts/migrations/0.30.0-ci-appelle-la-verification.mjs +6 -2
- package/scripts/migrations/0.31.0-paquets-dans-le-graphe.mjs +7 -7
- package/scripts/nuit.sh +24 -0
- package/scripts/outil.mjs +3 -1
- package/scripts/outils-cles.mjs +18 -7
- package/scripts/paquet-npm.mjs +15 -5
- package/scripts/paquets.mjs +12 -4
- package/scripts/passe-de-la-machine.mjs +7 -2
- package/scripts/places-de-la-machine.mjs +72 -12
- package/scripts/preparation.mjs +15 -5
- package/scripts/registre.mjs +6 -2
- package/scripts/reprise.mjs +66 -0
- package/scripts/resultats.mjs +105 -37
- package/scripts/seances.mjs +22 -4
- package/scripts/services-du-noyau.mjs +1 -0
- package/scripts/sous-commandes.mjs +5 -1
- package/scripts/style-a-l-ecriture.mjs +48 -17
- package/scripts/superviseur.mjs +127 -75
- package/scripts/tableau.mjs +133 -10
- package/scripts/taches-du-graphe.mjs +33 -13
- package/scripts/ticket-du-circuit.mjs +40 -0
- package/scripts/transitions.mjs +159 -29
- package/scripts/verrou-de-fichier.mjs +6 -2
- package/scripts/verrou-de-machine.mjs +123 -39
- package/scripts/verrous/commande.mjs +50 -17
- package/scripts/verrous/ticket-du-sous-agent.mjs +9 -3
- package/scripts/verrous/verrou.mjs +42 -14
- package/skills/developpeur/SKILL.md +1 -1
- package/skills/explorateur/SKILL.md +8 -2
- package/skills/grill/SKILL.md +3 -57
- package/skills/grill/references/paquets.md +60 -0
- package/skills/mesure/SKILL.md +3 -0
- package/skills/pitmaster/SKILL.md +16 -27
- package/skills/questionneur/SKILL.md +1 -1
- package/skills/relecteur/SKILL.md +2 -2
- package/skills/testwriter/SKILL.md +19 -7
- package/skills/release/SKILL.md +0 -134
- package/skills/release/scripts/update-version.cjs +0 -92
package/scripts/transitions.mjs
CHANGED
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
// same decision.
|
|
31
31
|
import { A_REPASSER } from './codes-de-sortie.mjs';
|
|
32
32
|
import { ARRETS, boucle, RESPONSABLE, SUITE } from './etapes.mjs';
|
|
33
|
+
import { attribuerLeRouge } from './reprise.mjs';
|
|
33
34
|
|
|
34
35
|
// The steps of the circuit's state, read from the list of the steps.
|
|
35
36
|
const etatDe = n => SUITE.find(e => e.numero === n).etat;
|
|
@@ -247,6 +248,28 @@ function decider({ etat, memoire = {}, ticket, reprend = false }, lire, partiel)
|
|
|
247
248
|
const ecrireRapport = (lieu, texte, resultat, r = texte) =>
|
|
248
249
|
effets.push({ genre: 'rapport', etape: lieu, texte, resultat, rapport: r });
|
|
249
250
|
const inscrire = (entree, evenement) => effets.push({ genre: 'inscrire', entree, evenement });
|
|
251
|
+
// The last green of a step (`verts`: the fingerprint of its inputs, its duration, what it
|
|
252
|
+
// needs to be read back) kept in the memory, or dropped (<vert> null): only a step green keeps
|
|
253
|
+
// one, as a task of Turborepo caches only its success.
|
|
254
|
+
const garderLeVert = (nom, vert) => {
|
|
255
|
+
const verts = { ...(m('verts') ?? {}) };
|
|
256
|
+
if (vert) {
|
|
257
|
+
verts[nom] = vert;
|
|
258
|
+
} else {
|
|
259
|
+
delete verts[nom];
|
|
260
|
+
}
|
|
261
|
+
maj.verts = verts;
|
|
262
|
+
};
|
|
263
|
+
// A step whose inputs are those of its last green: its result is read back, its duration
|
|
264
|
+
// (<ms>) the one the bilan counts as not replayed (scripts/bilan.mjs).
|
|
265
|
+
const releve = (nom, ms) => {
|
|
266
|
+
const lieu = nom === 'passe-finale' ? 'controles' : nom;
|
|
267
|
+
commenter(
|
|
268
|
+
lieu,
|
|
269
|
+
`${nom} relue sans se rejouer : ses entrées (fichiers, commande) sont celles de son dernier vert.`
|
|
270
|
+
);
|
|
271
|
+
inscrire({ etape: nom, relue: { ms: ms ?? 0 } }, 'relue');
|
|
272
|
+
};
|
|
250
273
|
const decision = (extra = {}) => ({
|
|
251
274
|
suivant: { etape, tentative, rapport, finale, relanceSurLeRefus },
|
|
252
275
|
memoire: maj,
|
|
@@ -314,11 +337,13 @@ function decider({ etat, memoire = {}, ticket, reprend = false }, lire, partiel)
|
|
|
314
337
|
return decision();
|
|
315
338
|
}
|
|
316
339
|
if (etape === TESTS) {
|
|
340
|
+
const reprise = m('reprise');
|
|
317
341
|
const fiche = lire('seance', {
|
|
318
342
|
role: 'testwriter',
|
|
319
343
|
tentative,
|
|
320
344
|
rapport,
|
|
321
345
|
derniere: tentative > RELANCES_TESTWRITER,
|
|
346
|
+
...(reprise ? { fichiers: reprise.fichiers } : {}),
|
|
322
347
|
});
|
|
323
348
|
// A testwriter who declares himself blocked or in need of an answer goes up to the supervisor.
|
|
324
349
|
if (fiche.statut !== 'FAIT') {
|
|
@@ -349,26 +374,51 @@ function decider({ etat, memoire = {}, ticket, reprend = false }, lire, partiel)
|
|
|
349
374
|
return decision();
|
|
350
375
|
}
|
|
351
376
|
if (etape === PREUVE) {
|
|
352
|
-
const
|
|
377
|
+
const reprise = m('reprise');
|
|
378
|
+
// A finding of the reviewer still open for the developpeur launches him, red or not.
|
|
379
|
+
const pourLui = ouverts(m('constats'), 'developpeur').length > 0;
|
|
380
|
+
const inchange = Boolean(ticket.sorte?.inchange);
|
|
381
|
+
const vert = m('verts')?.preuve;
|
|
382
|
+
if (vert && !reprise && lire('empreinteEtape', { etape: 'preuve' }) === vert.empreinte) {
|
|
383
|
+
// The proof's inputs are those of its last green: its result is read back, not played.
|
|
384
|
+
releve('preuve', vert.ms);
|
|
385
|
+
rapport = vert.texte ?? null;
|
|
386
|
+
const auDeveloppeur =
|
|
387
|
+
apresLaPreuve({ rouges: vert.rouges, pourLeDeveloppeur: pourLui, inchange }) === CODE;
|
|
388
|
+
etape = auDeveloppeur ? CODE : CONTROLES;
|
|
389
|
+
tentative = auDeveloppeur ? 1 : 0;
|
|
390
|
+
return decision();
|
|
391
|
+
}
|
|
392
|
+
const p = lire('preuve', reprise ? { fichiers: reprise.fichiers } : {});
|
|
353
393
|
rapport = p.texte;
|
|
354
394
|
if (p.ok) {
|
|
355
|
-
//
|
|
356
|
-
const
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
395
|
+
// Resumed at a red, a proof restricted to the file the red names goes to the checks.
|
|
396
|
+
const auDeveloppeur = reprise
|
|
397
|
+
? false
|
|
398
|
+
: apresLaPreuve({ rouges: p.rouges, pourLeDeveloppeur: pourLui, inchange }) === CODE;
|
|
399
|
+
const suite = reprise
|
|
400
|
+
? 'reprise à un rouge : aux contrôles'
|
|
401
|
+
: p.rouges
|
|
402
|
+
? 'au développeur'
|
|
403
|
+
: pourLui
|
|
404
|
+
? 'aucun rouge ; au développeur, que nomme un constat du relecteur'
|
|
405
|
+
: inchange
|
|
406
|
+
? 'aucun rouge : le plan dit « comportement inchangé », au développeur'
|
|
407
|
+
: 'aucun rouge : un lot de tests seul, aux contrôles';
|
|
367
408
|
ecrireRapport('preuve', `${p.resume} ; ${suite}.\n\n${p.texte}`, p.resultat);
|
|
409
|
+
if (!reprise && p.empreinte) {
|
|
410
|
+
garderLeVert('preuve', {
|
|
411
|
+
empreinte: p.empreinte,
|
|
412
|
+
rouges: p.rouges,
|
|
413
|
+
ms: p.ms,
|
|
414
|
+
texte: p.texte,
|
|
415
|
+
});
|
|
416
|
+
}
|
|
368
417
|
etape = auDeveloppeur ? CODE : CONTROLES;
|
|
369
418
|
tentative = auDeveloppeur ? 1 : 0;
|
|
370
419
|
return decision();
|
|
371
420
|
}
|
|
421
|
+
garderLeVert('preuve', null);
|
|
372
422
|
if (tentative <= RELANCES_TESTWRITER) {
|
|
373
423
|
ecrireRapport(
|
|
374
424
|
'preuve',
|
|
@@ -461,7 +511,7 @@ function decider({ etat, memoire = {}, ticket, reprend = false }, lire, partiel)
|
|
|
461
511
|
change: relanceSurLeRefus ? CHANGE_DU_REFUS : undefined,
|
|
462
512
|
});
|
|
463
513
|
relanceSurLeRefus = false;
|
|
464
|
-
const fortement = fort ? ' (opus
|
|
514
|
+
const fortement = fort ? ' (opus)' : '';
|
|
465
515
|
// A question goes up to the supervisor; a red out of reach, to the testwriter its sheet sends
|
|
466
516
|
// it to, else up to the supervisor.
|
|
467
517
|
if (fiche.statut === 'BESOIN') {
|
|
@@ -568,11 +618,33 @@ function decider({ etat, memoire = {}, ticket, reprend = false }, lire, partiel)
|
|
|
568
618
|
function controles() {
|
|
569
619
|
const passeFinale = finale;
|
|
570
620
|
// The final pass: after a regeneration of the references, restricted to what it changed,
|
|
571
|
-
// the reds of the pass before it carried (none plays when it changed nothing); else
|
|
572
|
-
//
|
|
621
|
+
// the reds of the pass before it carried (none plays when it changed nothing); else the band
|
|
622
|
+
// of the lot, its base and its dependents. The checks of the plan after a
|
|
573
623
|
// regeneration that changed nothing: none plays, the reds of the checks before standing.
|
|
574
624
|
const regeneration = m('regeneration');
|
|
575
625
|
maj.regeneration = null;
|
|
626
|
+
const nomEtape = passeFinale ? 'passe-finale' : 'controles';
|
|
627
|
+
const reprise = m('reprise');
|
|
628
|
+
const vert = m('verts')?.[nomEtape];
|
|
629
|
+
if (
|
|
630
|
+
vert &&
|
|
631
|
+
!reprise &&
|
|
632
|
+
!regeneration &&
|
|
633
|
+
lire('empreinteEtape', { etape: nomEtape }) === vert.empreinte
|
|
634
|
+
) {
|
|
635
|
+
// The step's inputs are those of its last green: its result is read back, not played.
|
|
636
|
+
releve(nomEtape, vert.ms);
|
|
637
|
+
maj.controlesRouges = null;
|
|
638
|
+
if (!passeFinale) {
|
|
639
|
+
etape = CONTROLES;
|
|
640
|
+
tentative = 0;
|
|
641
|
+
finale = true;
|
|
642
|
+
return decision();
|
|
643
|
+
}
|
|
644
|
+
maj.verifie = vert.arbre;
|
|
645
|
+
etape = lire('lotAccepte', { arbre: vert.arbre }) ? INTEGRATION : RELECTURE;
|
|
646
|
+
return decision();
|
|
647
|
+
}
|
|
576
648
|
const passe = !passeFinale
|
|
577
649
|
? { arbre: null, restreinte: null }
|
|
578
650
|
: regeneration
|
|
@@ -582,7 +654,11 @@ function decider({ etat, memoire = {}, ticket, reprend = false }, lire, partiel)
|
|
|
582
654
|
finale: passeFinale,
|
|
583
655
|
restreinte: passe.restreinte,
|
|
584
656
|
reportes: regeneration?.reportes ?? null,
|
|
657
|
+
...(reprise ? { fichiers: reprise.fichiers } : {}),
|
|
585
658
|
});
|
|
659
|
+
if (k.rouge || k.aRepasser) {
|
|
660
|
+
garderLeVert(nomEtape, null);
|
|
661
|
+
}
|
|
586
662
|
// The output of these checks, red, which a sending to the testwriter carries.
|
|
587
663
|
maj.controlesRouges = k.rouge ? k.texte : null;
|
|
588
664
|
// The outcome the bilan reads (scripts/bilan.mjs): with the reds, each its place and its
|
|
@@ -627,18 +703,31 @@ function decider({ etat, memoire = {}, ticket, reprend = false }, lire, partiel)
|
|
|
627
703
|
// that reads the reference; alone, the final pass that is due (BPScript 320.6.5: a test
|
|
628
704
|
// that reads the turbo.json, red beside their guard, sent to the developpeur, who could not
|
|
629
705
|
// write them).
|
|
706
|
+
// The debt the lot lowers, seen at the checks of the plan by its notes (`a-elaguer`), is the
|
|
707
|
+
// red of a reference too: regenerated before the checks judge the lot again, whether the
|
|
708
|
+
// developpeur delivered or not (the regeneration only lowers the keys noted, it hides no
|
|
709
|
+
// defect).
|
|
710
|
+
const dette =
|
|
711
|
+
!passeFinale && k.notes.length > 0
|
|
712
|
+
? lire('referencesDesRouges', { lieux: [], aElaguer: true })
|
|
713
|
+
: [];
|
|
630
714
|
const regenereesAuxControles =
|
|
631
|
-
!passeFinale &&
|
|
715
|
+
!passeFinale &&
|
|
716
|
+
(k.references.length || k.notes.length) &&
|
|
717
|
+
regenereSur?.arbre === lire('arbreApres')
|
|
632
718
|
? regenereSur.noms
|
|
633
719
|
: [];
|
|
634
720
|
const avantLesControles = passeFinale
|
|
635
721
|
? []
|
|
636
|
-
: k.references.filter(
|
|
722
|
+
: [...k.references, ...dette.filter(d => !k.references.some(r => r.nom === d.nom))].filter(
|
|
723
|
+
r => !regenereesAuxControles.includes(r.nom)
|
|
724
|
+
);
|
|
637
725
|
if (avantLesControles.length) {
|
|
638
726
|
const noms = avantLesControles.map(r => r.nom);
|
|
639
|
-
const
|
|
727
|
+
const deLaDette = dette.some(d => noms.includes(d.nom));
|
|
728
|
+
const meles = k.rouge || k.aRepasser || deLaDette;
|
|
640
729
|
geste('regeneration');
|
|
641
|
-
const phrase = `${k.resume} ; des rouges sont ceux de références (${noms.join(', ')}) : à leur régénération, puis ${meles ? 'les contrôles du plan' : 'la passe finale'}.`;
|
|
730
|
+
const phrase = `${k.resume} ; ${deLaDette ? 'la dette des gardes baisse, ou des rouges sont ceux de références' : 'des rouges sont ceux de références'} (${noms.join(', ')}) : à leur régénération, puis ${meles ? 'les contrôles du plan' : 'la passe finale'}.`;
|
|
642
731
|
ecrireRapport(
|
|
643
732
|
'controles',
|
|
644
733
|
phrase,
|
|
@@ -658,7 +747,7 @@ function decider({ etat, memoire = {}, ticket, reprend = false }, lire, partiel)
|
|
|
658
747
|
// project refuses the lot, as at the final pass (BPScript 320.10).
|
|
659
748
|
maj.aRegenerer = {
|
|
660
749
|
noms,
|
|
661
|
-
notes:
|
|
750
|
+
notes: k.notes,
|
|
662
751
|
suite: meles ? 'controles' : 'passe',
|
|
663
752
|
rouges: meles ? k.tous : [],
|
|
664
753
|
auDeveloppeur: meles && k.auDeveloppeur && !k.arbitrer ? k.texte : null,
|
|
@@ -682,7 +771,6 @@ function decider({ etat, memoire = {}, ticket, reprend = false }, lire, partiel)
|
|
|
682
771
|
noms,
|
|
683
772
|
rouges: k.tous,
|
|
684
773
|
notes: k.notes,
|
|
685
|
-
entiere: !passe.restreinte,
|
|
686
774
|
auDeveloppeur: k.auDeveloppeur && !k.arbitrer ? k.texte : null,
|
|
687
775
|
};
|
|
688
776
|
etape = REFERENCES;
|
|
@@ -719,6 +807,36 @@ function decider({ etat, memoire = {}, ticket, reprend = false }, lire, partiel)
|
|
|
719
807
|
return arret('sans-livraison', rien, CODE);
|
|
720
808
|
}
|
|
721
809
|
if (k.rouge && suivante <= SEANCES_DEVELOPPEUR) {
|
|
810
|
+
// The red goes back to the step that carries it, by the files it names (scripts/reprise.mjs).
|
|
811
|
+
const portes = lire('portes', { lieux: k.lieux });
|
|
812
|
+
const a = attribuerLeRouge({ lieux: k.lieux, portes });
|
|
813
|
+
if (!a.etape) {
|
|
814
|
+
return arret('controles', `Le rouge n'est attribué à aucune étape : ${a.motif}.`);
|
|
815
|
+
}
|
|
816
|
+
if (a.etape === 'testwriter') {
|
|
817
|
+
const relances = (m('relancesTestwriter') ?? 0) + 1;
|
|
818
|
+
if (relances > RELANCES_TESTWRITER + 1) {
|
|
819
|
+
return arret('controles', null);
|
|
820
|
+
}
|
|
821
|
+
maj.relancesTestwriter = relances;
|
|
822
|
+
// The final pass red in one test file alone: that file is replayed, then the checks and
|
|
823
|
+
// the final pass restricted to what it reaches, with no session for the rest of the lot.
|
|
824
|
+
maj.reprise =
|
|
825
|
+
passeFinale && a.fichiers.length === 1 && portes.tests.includes(a.fichiers[0])
|
|
826
|
+
? { fichiers: a.fichiers }
|
|
827
|
+
: null;
|
|
828
|
+
ecrireRapport(
|
|
829
|
+
'controles',
|
|
830
|
+
`${k.resume} ; le rouge nomme ${a.fichiers.join(', ')} : testwriter relancé (séance 1).`,
|
|
831
|
+
resultat('rouge'),
|
|
832
|
+
`${k.texte}${k.avertissements}`
|
|
833
|
+
);
|
|
834
|
+
etape = TESTS;
|
|
835
|
+
tentative = 1;
|
|
836
|
+
finale = false;
|
|
837
|
+
return decision();
|
|
838
|
+
}
|
|
839
|
+
maj.reprise = null;
|
|
722
840
|
ecrireRapport(
|
|
723
841
|
'controles',
|
|
724
842
|
`${k.resume} ; développeur relancé (séance ${suivante}).`,
|
|
@@ -738,7 +856,12 @@ function decider({ etat, memoire = {}, ticket, reprend = false }, lire, partiel)
|
|
|
738
856
|
ecrireRapport('controles', `${k.resume}.`, resultat('vert'), `${k.resume}.${k.avertissements}`);
|
|
739
857
|
// Green checks: a sending of the developpeur to the testwriter may come again.
|
|
740
858
|
maj.renvoiAuTestwriter = null;
|
|
859
|
+
maj.relancesTestwriter = 0;
|
|
860
|
+
const entierement = !reprise && !regeneration;
|
|
741
861
|
if (!passeFinale) {
|
|
862
|
+
if (entierement && k.empreinte) {
|
|
863
|
+
garderLeVert('controles', { empreinte: k.empreinte, ms: k.ms });
|
|
864
|
+
}
|
|
742
865
|
// The checks green: the final pass, its sessions counted apart.
|
|
743
866
|
etape = CONTROLES;
|
|
744
867
|
tentative = 0;
|
|
@@ -747,11 +870,19 @@ function decider({ etat, memoire = {}, ticket, reprend = false }, lire, partiel)
|
|
|
747
870
|
}
|
|
748
871
|
// The whole pass green on this lot; the lot the last review accepted goes to the
|
|
749
872
|
// integration, any other to the review.
|
|
750
|
-
// A pass
|
|
751
|
-
//
|
|
752
|
-
|
|
873
|
+
// A final pass green on the band of the lot (after a regeneration, on what it changed, or not
|
|
874
|
+
// played when it changed nothing) verifies its tree: the lot accepted on it goes to the
|
|
875
|
+
// integration.
|
|
876
|
+
if (passe.arbre) {
|
|
753
877
|
maj.verifie = passe.arbre;
|
|
754
878
|
}
|
|
879
|
+
if (entierement && k.empreinte) {
|
|
880
|
+
garderLeVert('passe-finale', { empreinte: k.empreinte, arbre: passe.arbre, ms: k.ms });
|
|
881
|
+
}
|
|
882
|
+
if (reprise) {
|
|
883
|
+
// The restricted pass is green: the resumption ends.
|
|
884
|
+
maj.reprise = null;
|
|
885
|
+
}
|
|
755
886
|
etape = lire('lotAccepte', { arbre: passe.arbre }) ? INTEGRATION : RELECTURE;
|
|
756
887
|
return decision();
|
|
757
888
|
}
|
|
@@ -809,7 +940,6 @@ function decider({ etat, memoire = {}, ticket, reprend = false }, lire, partiel)
|
|
|
809
940
|
: { reportes: { rouges: a.rouges, rejouee: false } }
|
|
810
941
|
: {
|
|
811
942
|
restreinte: g.restreinte,
|
|
812
|
-
entiere: a.entiere,
|
|
813
943
|
reportes: { rouges: a.rouges, rejouee: g.fichiers.length > 0 },
|
|
814
944
|
};
|
|
815
945
|
maj.aRegenerer = null;
|
|
@@ -841,11 +971,11 @@ function decider({ etat, memoire = {}, ticket, reprend = false }, lire, partiel)
|
|
|
841
971
|
etape = INTEGRATION;
|
|
842
972
|
return decision();
|
|
843
973
|
}
|
|
844
|
-
// The
|
|
974
|
+
// The final pass has not played on the lot accepted: its band plays once, then the
|
|
845
975
|
// integration.
|
|
846
976
|
commenter(
|
|
847
977
|
'relecture',
|
|
848
|
-
'ACCEPTÉ ; la passe finale
|
|
978
|
+
'ACCEPTÉ ; la passe finale sur la bande du lot (sa base et ses dépendants), qui n’a pas joué sur ce lot, puis l’intégration.'
|
|
849
979
|
);
|
|
850
980
|
etape = CONTROLES;
|
|
851
981
|
tentative = 0;
|
|
@@ -890,7 +1020,7 @@ function decider({ etat, memoire = {}, ticket, reprend = false }, lire, partiel)
|
|
|
890
1020
|
finale = false;
|
|
891
1021
|
commenter(
|
|
892
1022
|
'relecture',
|
|
893
|
-
`RENDU (relecture ${rendus}) ; le circuit relance ${auTestwriter ? 'le testwriter' : 'le développeur'}, ses ${lus.constats.length} constat(s) ouvert(s) dans la consigne de chaque séance, puis la passe finale
|
|
1023
|
+
`RENDU (relecture ${rendus}) ; le circuit relance ${auTestwriter ? 'le testwriter' : 'le développeur'}, ses ${lus.constats.length} constat(s) ouvert(s) dans la consigne de chaque séance, puis la passe finale sur la bande du lot (sa base et ses dépendants), et le relecteur sur la différence.`
|
|
894
1024
|
);
|
|
895
1025
|
return decision();
|
|
896
1026
|
}
|
|
@@ -64,7 +64,9 @@ function creer(verrou, marque) {
|
|
|
64
64
|
linkSync(prive, verrou);
|
|
65
65
|
return true;
|
|
66
66
|
} catch (e) {
|
|
67
|
-
if (e.code !== 'EEXIST')
|
|
67
|
+
if (e.code !== 'EEXIST') {
|
|
68
|
+
throw e;
|
|
69
|
+
}
|
|
68
70
|
return false;
|
|
69
71
|
} finally {
|
|
70
72
|
rmSync(prive, { force: true });
|
|
@@ -112,7 +114,9 @@ export function prendreVerrou(verrou, { attendre, perime = null, pid = process.p
|
|
|
112
114
|
reprendre(verrou, perime);
|
|
113
115
|
continue;
|
|
114
116
|
}
|
|
115
|
-
if (!attendre)
|
|
117
|
+
if (!attendre) {
|
|
118
|
+
return false;
|
|
119
|
+
}
|
|
116
120
|
attendreUnPeu(perime === null ? 200 : 20);
|
|
117
121
|
}
|
|
118
122
|
}
|
|
@@ -153,7 +153,9 @@ export class AttenteDeLaMachine extends Error {
|
|
|
153
153
|
// The lock file of the machine under <env>, beside which its holder and its waits name
|
|
154
154
|
// themselves.
|
|
155
155
|
export function verrouDeMachine(env = process.env) {
|
|
156
|
-
if (env[VARIABLE_VERROU])
|
|
156
|
+
if (env[VARIABLE_VERROU]) {
|
|
157
|
+
return env[VARIABLE_VERROU];
|
|
158
|
+
}
|
|
157
159
|
const cache = env.XDG_CACHE_HOME || path.join(env.HOME || homedir(), '.cache');
|
|
158
160
|
return path.join(cache, 'grillhouse', 'mesure-lourde.lock');
|
|
159
161
|
}
|
|
@@ -200,7 +202,9 @@ function processus(pid) {
|
|
|
200
202
|
// (« le processus 12 (dans /d) : node x, depuis 10:04:31 (3 min) »).
|
|
201
203
|
function qui(verrou) {
|
|
202
204
|
const pid = detenteur(verrou);
|
|
203
|
-
if (pid === null)
|
|
205
|
+
if (pid === null) {
|
|
206
|
+
return 'une autre mesure';
|
|
207
|
+
}
|
|
204
208
|
let depuis = '';
|
|
205
209
|
try {
|
|
206
210
|
const t = statSync(verrou).mtimeMs;
|
|
@@ -295,7 +299,9 @@ function attentesDe(verrou) {
|
|
|
295
299
|
continue;
|
|
296
300
|
}
|
|
297
301
|
const a = nom.endsWith('.json') ? lireJson(path.join(dossier, nom)) : null;
|
|
298
|
-
if (a?.pid === pid)
|
|
302
|
+
if (a?.pid === pid) {
|
|
303
|
+
out.push(a);
|
|
304
|
+
}
|
|
299
305
|
}
|
|
300
306
|
return out.sort((a, b) => (a.depuis ?? 0) - (b.depuis ?? 0));
|
|
301
307
|
}
|
|
@@ -325,7 +331,9 @@ function nommerLeDetenteur(verrou, id) {
|
|
|
325
331
|
return () => {};
|
|
326
332
|
}
|
|
327
333
|
return () => {
|
|
328
|
-
if (lireJson(f)?.marque === marque)
|
|
334
|
+
if (lireJson(f)?.marque === marque) {
|
|
335
|
+
rmSync(f, { force: true });
|
|
336
|
+
}
|
|
329
337
|
};
|
|
330
338
|
}
|
|
331
339
|
|
|
@@ -342,7 +350,9 @@ export function nommerLAvancement({ env = process.env, dossier }) {
|
|
|
342
350
|
const marque = env[VARIABLE_TENUE];
|
|
343
351
|
const ecrire = d => {
|
|
344
352
|
const n = lireJson(f);
|
|
345
|
-
if (!marque || n?.marque !== marque)
|
|
353
|
+
if (!marque || n?.marque !== marque) {
|
|
354
|
+
return false;
|
|
355
|
+
}
|
|
346
356
|
try {
|
|
347
357
|
ecrireAtomique(f, { ...n, dossier: d });
|
|
348
358
|
return true;
|
|
@@ -376,7 +386,9 @@ export function lireLeVerrou(env = process.env) {
|
|
|
376
386
|
}));
|
|
377
387
|
const marque = lire(verrou);
|
|
378
388
|
const pid = detenteur(verrou);
|
|
379
|
-
if (marque === null || pid === null || !vivant(pid))
|
|
389
|
+
if (marque === null || pid === null || !vivant(pid)) {
|
|
390
|
+
return { detenteur: null, attentes };
|
|
391
|
+
}
|
|
380
392
|
const n = lireJson(fichierDuDetenteur(verrou));
|
|
381
393
|
if (n?.marque === marque) {
|
|
382
394
|
const { depot, ticket, sorte, depuis, dossier } = n;
|
|
@@ -433,7 +445,11 @@ function parent(pid) {
|
|
|
433
445
|
|
|
434
446
|
// Whether <pid> is this process or one of its ancestors.
|
|
435
447
|
function ancetre(pid) {
|
|
436
|
-
for (let p = process.pid; p !== null; p = parent(p))
|
|
448
|
+
for (let p = process.pid; p !== null; p = parent(p)) {
|
|
449
|
+
if (p === pid) {
|
|
450
|
+
return true;
|
|
451
|
+
}
|
|
452
|
+
}
|
|
437
453
|
return false;
|
|
438
454
|
}
|
|
439
455
|
|
|
@@ -468,7 +484,9 @@ function occupants(dossier) {
|
|
|
468
484
|
} catch {
|
|
469
485
|
return 'illisible';
|
|
470
486
|
}
|
|
471
|
-
if (noms.length === 0)
|
|
487
|
+
if (noms.length === 0) {
|
|
488
|
+
return 'rien';
|
|
489
|
+
}
|
|
472
490
|
let budget = ENTREES_LUES;
|
|
473
491
|
const taille = racine => {
|
|
474
492
|
let octets = 0;
|
|
@@ -484,7 +502,9 @@ function occupants(dossier) {
|
|
|
484
502
|
octets += e.blocks * 512;
|
|
485
503
|
if (e.isDirectory()) {
|
|
486
504
|
try {
|
|
487
|
-
for (const n of readdirSync(p))
|
|
505
|
+
for (const n of readdirSync(p)) {
|
|
506
|
+
pile.push(path.join(p, n));
|
|
507
|
+
}
|
|
488
508
|
} catch {
|
|
489
509
|
// an unreadable directory counts for itself alone
|
|
490
510
|
}
|
|
@@ -539,29 +559,48 @@ function attendreLaPlace(dossier, { inscrire, ...o }) {
|
|
|
539
559
|
|
|
540
560
|
function attendreLaPlaceEnNommant(
|
|
541
561
|
dossier,
|
|
542
|
-
{
|
|
562
|
+
{
|
|
563
|
+
disque,
|
|
564
|
+
plancher,
|
|
565
|
+
libre,
|
|
566
|
+
occupe,
|
|
567
|
+
dire,
|
|
568
|
+
borneMs,
|
|
569
|
+
rappelMs,
|
|
570
|
+
nommer,
|
|
571
|
+
maintenant = Date.now,
|
|
572
|
+
dormir = attendreUnPeu,
|
|
573
|
+
debut = maintenant(),
|
|
574
|
+
}
|
|
543
575
|
) {
|
|
544
576
|
let dit = null;
|
|
545
577
|
for (;;) {
|
|
546
578
|
const l = libre(dossier);
|
|
547
579
|
if (l >= plancher) {
|
|
548
|
-
if (dit !== null)
|
|
580
|
+
if (dit !== null) {
|
|
581
|
+
dire(`✓ place ${disque.ou} après ${duree(maintenant() - debut)}.`);
|
|
582
|
+
}
|
|
549
583
|
return;
|
|
550
584
|
}
|
|
551
585
|
nommer();
|
|
552
|
-
const t =
|
|
586
|
+
const t = maintenant();
|
|
553
587
|
const etat = () =>
|
|
554
588
|
`${disque.nom} (${dossier}) n'a que ${go(l)} libres, moins des ${go(plancher)} qu'une passe lourde demande (${disque.variable}) ; l'occupent : ${occupe(dossier)}`;
|
|
555
|
-
if (t - debut >= borneMs)
|
|
589
|
+
if (t - debut >= borneMs) {
|
|
556
590
|
throw new AttenteDeLaMachine(
|
|
557
591
|
`⏱ attente de place bornée à ${duree(borneMs)} (${VARIABLE_ATTENTE}) : ${etat()} ; à repasser (code ${A_REPASSER}).`,
|
|
558
592
|
A_REPASSER
|
|
559
593
|
);
|
|
560
|
-
|
|
561
|
-
|
|
594
|
+
}
|
|
595
|
+
if (dit === null) {
|
|
596
|
+
dire(`⏳ ${etat()} ; attente de place, ${duree(borneMs)} au plus.`);
|
|
597
|
+
} else if (t - dit >= rappelMs) {
|
|
562
598
|
dire(`⏳ attente de place depuis ${duree(t - debut)} : ${etat()}.`);
|
|
563
|
-
|
|
564
|
-
|
|
599
|
+
}
|
|
600
|
+
if (dit === null || t - dit >= rappelMs) {
|
|
601
|
+
dit = t;
|
|
602
|
+
}
|
|
603
|
+
dormir(Math.max(1, Math.min(200, borneMs - (maintenant() - debut))));
|
|
565
604
|
}
|
|
566
605
|
}
|
|
567
606
|
|
|
@@ -572,7 +611,9 @@ function attendreLaPlaceEnNommant(
|
|
|
572
611
|
* @param {{ env?: Record<string, string | undefined>, dire?: (l: string) => void, borneMs?: number,
|
|
573
612
|
* rappelMs?: number, libre?: (dossier: string) => number, occupe?: (dossier: string) => string,
|
|
574
613
|
* occupeLaCopie?: (racine: string) => string, racine?: string, ticket?: string | null,
|
|
575
|
-
* sorte?: string
|
|
614
|
+
* sorte?: string, maintenant?: () => number, dormir?: (ms: number) => void }} [o]
|
|
615
|
+
* `maintenant` and `dormir` are the clock (Date.now) and the sleep of the wait, the real ones
|
|
616
|
+
* when left out; `libre` reads the room of each disk, `occupe` what holds the temporary
|
|
576
617
|
* directory, `occupeLaCopie` the copies that hold the disk of the copy; the wait names its
|
|
577
618
|
* project <racine>, its ticket and its kind among the waits of the lock of the machine under
|
|
578
619
|
* <env> while it waits
|
|
@@ -589,12 +630,14 @@ export function attendreDeLaPlace({
|
|
|
589
630
|
racine = process.cwd(),
|
|
590
631
|
ticket,
|
|
591
632
|
sorte,
|
|
633
|
+
maintenant = Date.now,
|
|
634
|
+
dormir = attendreUnPeu,
|
|
592
635
|
} = {}) {
|
|
593
636
|
const temporaire = env.TMPDIR || env.TMP || env.TEMP || tmpdir();
|
|
594
637
|
const id = identite({ racine, env, ticket, sorte });
|
|
595
638
|
const inscrire = () => inscrireLAttente(verrouDeMachine(env), id, 'place');
|
|
596
|
-
const debut =
|
|
597
|
-
const commun = { libre, dire, borneMs, rappelMs, inscrire, debut };
|
|
639
|
+
const debut = maintenant();
|
|
640
|
+
const commun = { libre, dire, borneMs, rappelMs, inscrire, debut, maintenant, dormir };
|
|
598
641
|
attendreLaPlace(temporaire, {
|
|
599
642
|
...commun,
|
|
600
643
|
disque: DISQUES.temporaire,
|
|
@@ -624,43 +667,52 @@ export function borneDe(env) {
|
|
|
624
667
|
// <rappelMs>; returns the time waited, in ms. Throws an AttenteDeLaMachine at once when an ancestor
|
|
625
668
|
// holds the lock, and at the bound <borneMs>. The measure, <id>, names itself among the waits,
|
|
626
669
|
// with its rank, while it waits.
|
|
627
|
-
function attendreLaMachine(verrou, { id, rang, dire, borneMs, rappelMs }) {
|
|
670
|
+
function attendreLaMachine(verrou, { id, rang, dire, borneMs, rappelMs, maintenant, dormir }) {
|
|
628
671
|
const retirer = inscrireLAttente(verrou, id, 'verrou', rang);
|
|
629
672
|
try {
|
|
630
|
-
return attendreAuRang(verrou, { rang, dire, borneMs, rappelMs });
|
|
673
|
+
return attendreAuRang(verrou, { rang, dire, borneMs, rappelMs, maintenant, dormir });
|
|
631
674
|
} finally {
|
|
632
675
|
retirer();
|
|
633
676
|
}
|
|
634
677
|
}
|
|
635
678
|
|
|
636
|
-
function attendreAuRang(
|
|
637
|
-
|
|
679
|
+
function attendreAuRang(
|
|
680
|
+
verrou,
|
|
681
|
+
{ rang, dire, borneMs, rappelMs, maintenant = Date.now, dormir = attendreUnPeu }
|
|
682
|
+
) {
|
|
683
|
+
const debut = maintenant();
|
|
638
684
|
let dit = null;
|
|
639
685
|
for (;;) {
|
|
640
686
|
const pid = detenteur(verrou);
|
|
641
|
-
if (pid !== null && ancetre(pid))
|
|
687
|
+
if (pid !== null && ancetre(pid)) {
|
|
642
688
|
throw new AttenteDeLaMachine(
|
|
643
689
|
`✗ blocage : le verrou de la mesure lourde (${verrou}) est tenu par un ancêtre de ce processus (${process.pid}), ${qui(verrou)} ; il attend la fin de ce processus, qui attendrait la sienne. L'environnement a perdu la marque de la prise (${VARIABLE_TENUE}) ; un essai nomme son propre verrou (${VARIABLE_VERROU}).`,
|
|
644
690
|
1
|
|
645
691
|
);
|
|
646
|
-
|
|
647
|
-
|
|
692
|
+
}
|
|
693
|
+
const t = maintenant();
|
|
694
|
+
if (t - debut >= borneMs) {
|
|
648
695
|
throw new AttenteDeLaMachine(
|
|
649
696
|
`⏱ attente du verrou de la machine bornée à ${duree(borneMs)} (${VARIABLE_ATTENTE}), ${RANGS[rang]} : ${attendus(verrou, rang)} ; à repasser (code ${A_REPASSER}).`,
|
|
650
697
|
A_REPASSER
|
|
651
698
|
);
|
|
652
|
-
|
|
699
|
+
}
|
|
700
|
+
if (dit === null) {
|
|
653
701
|
dire(
|
|
654
702
|
`⏳ ${RANGS[rang]}, la machine mesure déjà : ${attendus(verrou, rang)} ; attente de son tour, ${duree(borneMs)} au plus.`
|
|
655
703
|
);
|
|
656
|
-
else if (t - dit >= rappelMs)
|
|
704
|
+
} else if (t - dit >= rappelMs) {
|
|
657
705
|
dire(
|
|
658
706
|
`⏳ ${RANGS[rang]}, attente du verrou de la machine depuis ${duree(t - debut)} : ${attendus(verrou, rang)}.`
|
|
659
707
|
);
|
|
660
|
-
|
|
661
|
-
if (
|
|
662
|
-
|
|
663
|
-
|
|
708
|
+
}
|
|
709
|
+
if (dit === null || t - dit >= rappelMs) {
|
|
710
|
+
dit = t;
|
|
711
|
+
}
|
|
712
|
+
if (peutPrendre(verrou, rang) && prendreVerrou(verrou, { attendre: false })) {
|
|
713
|
+
return maintenant() - debut;
|
|
714
|
+
}
|
|
715
|
+
dormir(Math.max(1, Math.min(200, borneMs - (maintenant() - debut))));
|
|
664
716
|
}
|
|
665
717
|
}
|
|
666
718
|
|
|
@@ -671,7 +723,9 @@ function attendreAuRang(verrou, { rang, dire, borneMs, rappelMs }) {
|
|
|
671
723
|
* @param {{ env?: Record<string, string | undefined>, racine?: string,
|
|
672
724
|
* dire?: (ligne: string) => void, borneMs?: number, rappelMs?: number,
|
|
673
725
|
* libre?: (dossier: string) => number, occupe?: (dossier: string) => string,
|
|
674
|
-
* ticket?: string | null, sorte?: string
|
|
726
|
+
* ticket?: string | null, sorte?: string, maintenant?: () => number,
|
|
727
|
+
* dormir?: (ms: number) => void }} options `maintenant` and `dormir`, the clock and the sleep of
|
|
728
|
+
* the wait (Date.now and the real sleep when left out); `racine`, the
|
|
675
729
|
* root of the repository the measure plays in, which gives its rank (`rangDeLaMesure`; the
|
|
676
730
|
* working directory by default); `borneMs`, the bound of the wait
|
|
677
731
|
* (GRILLHOUSE_ATTENTE_MACHINE_MS, else ATTENTE_MACHINE_MS); `rappelMs`, the gap between two
|
|
@@ -697,23 +751,53 @@ export function avecLaMachine(
|
|
|
697
751
|
occupe = occupants,
|
|
698
752
|
ticket,
|
|
699
753
|
sorte,
|
|
754
|
+
maintenant = Date.now,
|
|
755
|
+
dormir = attendreUnPeu,
|
|
700
756
|
} = {}
|
|
701
757
|
) {
|
|
702
|
-
if (paquetsDeLEnveloppe(env))
|
|
758
|
+
if (paquetsDeLEnveloppe(env)) {
|
|
759
|
+
return mesure(env);
|
|
760
|
+
}
|
|
703
761
|
const verrou = verrouDeMachine(env);
|
|
704
|
-
if (env[VARIABLE_TENUE] && lire(verrou) === env[VARIABLE_TENUE])
|
|
705
|
-
|
|
762
|
+
if (env[VARIABLE_TENUE] && lire(verrou) === env[VARIABLE_TENUE]) {
|
|
763
|
+
return mesure(env);
|
|
764
|
+
}
|
|
765
|
+
attendreDeLaPlace({
|
|
766
|
+
env,
|
|
767
|
+
libre,
|
|
768
|
+
occupe,
|
|
769
|
+
dire,
|
|
770
|
+
borneMs,
|
|
771
|
+
rappelMs,
|
|
772
|
+
racine,
|
|
773
|
+
ticket,
|
|
774
|
+
sorte,
|
|
775
|
+
maintenant,
|
|
776
|
+
dormir,
|
|
777
|
+
});
|
|
706
778
|
const id = identite({ racine, env, ticket, sorte });
|
|
707
779
|
mkdirSync(path.dirname(verrou), { recursive: true });
|
|
708
780
|
const rang = rangDeLaMesure(racine);
|
|
709
781
|
if (!(peutPrendre(verrou, rang) && prendreVerrou(verrou, { attendre: false }))) {
|
|
710
|
-
const attendu = attendreLaMachine(verrou, {
|
|
782
|
+
const attendu = attendreLaMachine(verrou, {
|
|
783
|
+
id,
|
|
784
|
+
rang,
|
|
785
|
+
dire,
|
|
786
|
+
borneMs,
|
|
787
|
+
rappelMs,
|
|
788
|
+
maintenant,
|
|
789
|
+
dormir,
|
|
790
|
+
});
|
|
711
791
|
dire(`✓ verrou de la machine pris après ${Math.round(attendu / 1000)} s.`);
|
|
712
792
|
}
|
|
713
793
|
let oublier = () => {};
|
|
714
794
|
try {
|
|
715
795
|
oublier = nommerLeDetenteur(verrou, id);
|
|
716
|
-
const {
|
|
796
|
+
const {
|
|
797
|
+
[VARIABLE_VERIFICATION_SORTE]: _s,
|
|
798
|
+
[VARIABLE_VERIFICATION_TICKET]: _t,
|
|
799
|
+
...enfant
|
|
800
|
+
} = env;
|
|
717
801
|
return mesure({ ...enfant, [VARIABLE_TENUE]: lire(verrou) ?? '' });
|
|
718
802
|
} finally {
|
|
719
803
|
oublier();
|