@roomi-fields/grillhouse 0.54.0 → 0.55.1
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 +75 -0
- package/cadre/templates/projet/.github/workflows/ci.yml +4 -2
- package/cadre/templates/projet/.github/workflows/machine-vierge.yml +5 -42
- package/cadre/templates/projet/CONTRIBUTING.md +0 -5
- package/cadre/templates/projet/README.md +0 -126
- package/cadre/templates/projet/_npmignore +1 -6
- package/cadre/templates/projet/package.json +5 -32
- package/cadre/templates/projet/tsconfig.json +4 -4
- package/cadre/templates/projet/vitest.config.cjs +3 -2
- package/charte/tests.md +14 -0
- package/dist/machine/part-par-sorte.d.ts +9 -9
- package/dist/machine/part-par-sorte.js +20 -24
- package/dist/machine/part-par-sorte.js.map +1 -1
- package/dist/machine/table-des-consommations.d.ts +65 -0
- package/dist/machine/table-des-consommations.js +94 -0
- package/dist/machine/table-des-consommations.js.map +1 -0
- package/dist/temporal/circuit/activites.d.ts +2 -0
- package/dist/temporal/circuit/activites.js +87 -3
- package/dist/temporal/circuit/activites.js.map +1 -1
- package/dist/temporal/circuit/client.js +9 -4
- package/dist/temporal/circuit/client.js.map +1 -1
- package/dist/temporal/circuit/contrat.d.ts +32 -4
- package/dist/temporal/circuit/deroule.js +54 -4
- package/dist/temporal/circuit/deroule.js.map +1 -1
- package/dist/temporal/circuit/versions.d.ts +12 -0
- package/dist/temporal/circuit/versions.js +22 -0
- package/dist/temporal/circuit/versions.js.map +1 -0
- package/dist/temporal/consommation/activites.d.ts +2 -0
- package/dist/temporal/consommation/activites.js +9 -0
- package/dist/temporal/consommation/activites.js.map +1 -0
- package/dist/temporal/consommation/actualisation.d.ts +2 -0
- package/dist/temporal/consommation/actualisation.js +71 -0
- package/dist/temporal/consommation/actualisation.js.map +1 -0
- package/dist/temporal/consommation/client.d.ts +12 -0
- package/dist/temporal/consommation/client.js +28 -0
- package/dist/temporal/consommation/client.js.map +1 -0
- package/dist/temporal/consommation/commande.d.ts +5 -0
- package/dist/temporal/consommation/commande.js +32 -0
- package/dist/temporal/consommation/commande.js.map +1 -0
- package/dist/temporal/consommation/contrat.d.ts +15 -0
- package/dist/temporal/consommation/contrat.js +13 -0
- package/dist/temporal/consommation/contrat.js.map +1 -0
- package/dist/temporal/consommation/deroule.d.ts +2 -0
- package/dist/temporal/consommation/deroule.js +14 -0
- package/dist/temporal/consommation/deroule.js.map +1 -0
- package/dist/temporal/deroules.d.ts +2 -1
- package/dist/temporal/deroules.js +3 -2
- package/dist/temporal/deroules.js.map +1 -1
- package/dist/temporal/file/contrat.d.ts +2 -0
- package/dist/temporal/file/deroule.js +14 -4
- package/dist/temporal/file/deroule.js.map +1 -1
- package/dist/temporal/installation.d.ts +6 -0
- package/dist/temporal/installation.js +15 -0
- package/dist/temporal/installation.js.map +1 -1
- package/dist/temporal/nuits/activites.d.ts +2 -1
- package/dist/temporal/nuits/activites.js +127 -3
- package/dist/temporal/nuits/activites.js.map +1 -1
- package/dist/temporal/nuits/client.d.ts +19 -5
- package/dist/temporal/nuits/client.js +33 -23
- package/dist/temporal/nuits/client.js.map +1 -1
- package/dist/temporal/nuits/commande.js +16 -11
- package/dist/temporal/nuits/commande.js.map +1 -1
- package/dist/temporal/nuits/contrat.d.ts +29 -0
- package/dist/temporal/nuits/contrat.js +10 -0
- package/dist/temporal/nuits/contrat.js.map +1 -1
- package/dist/temporal/nuits/deroule.d.ts +5 -0
- package/dist/temporal/nuits/deroule.js +18 -1
- package/dist/temporal/nuits/deroule.js.map +1 -1
- package/dist/temporal/nuits/pc2.d.ts +72 -0
- package/dist/temporal/nuits/pc2.js +206 -0
- package/dist/temporal/nuits/pc2.js.map +1 -0
- package/dist/temporal/places/activites.d.ts +23 -1
- package/dist/temporal/places/activites.js +38 -2
- package/dist/temporal/places/activites.js.map +1 -1
- package/dist/temporal/places/client.d.ts +16 -0
- package/dist/temporal/places/client.js +25 -1
- package/dist/temporal/places/client.js.map +1 -1
- package/dist/temporal/places/contrat.d.ts +79 -14
- package/dist/temporal/places/contrat.js +7 -0
- package/dist/temporal/places/contrat.js.map +1 -1
- package/dist/temporal/places/deroule.js +159 -23
- package/dist/temporal/places/deroule.js.map +1 -1
- package/dist/temporal/places/reservation.d.ts +54 -0
- package/dist/temporal/places/reservation.js +69 -0
- package/dist/temporal/places/reservation.js.map +1 -0
- package/dist/temporal/planification.d.ts +6 -0
- package/dist/temporal/planification.js +26 -0
- package/dist/temporal/planification.js.map +1 -0
- package/dist/temporal/tickets/activites.d.ts +0 -2
- package/dist/temporal/tickets/activites.js +2 -52
- package/dist/temporal/tickets/activites.js.map +1 -1
- package/dist/temporal/tickets/contrat.d.ts +7 -26
- package/dist/temporal/tickets/deroule.js +35 -23
- package/dist/temporal/tickets/deroule.js.map +1 -1
- package/dist/temporal/travailleur.js +2 -0
- package/dist/temporal/travailleur.js.map +1 -1
- package/docs/ARCHITECTURE.md +2 -2
- package/docs/CADRE.md +1 -1
- package/docs/INTERFACE.md +16 -11
- package/docs/architecture/circuit.md +62 -58
- package/docs/architecture/entree.md +87 -63
- package/docs/architecture/greffon.md +32 -27
- package/docs/architecture/installation.md +43 -32
- package/docs/architecture/machine.md +48 -40
- package/docs/architecture/tests.md +37 -33
- package/docs/lexique.md +4 -3
- package/package.json +1 -1
- package/scripts/activites.mjs +351 -180
- package/scripts/aiguillage.mjs +1 -0
- package/scripts/attente-de-la-machine.mjs +3 -22
- package/scripts/avancement.mjs +21 -30
- package/scripts/bilan.mjs +22 -2
- package/scripts/branche-de-nuit.mjs +1 -1
- package/scripts/circuit.mjs +75 -39
- package/scripts/codes-de-sortie.mjs +0 -6
- package/scripts/consommation-des-passes.mjs +67 -31
- package/scripts/consommation.mjs +152 -24
- package/scripts/copies-finies.mjs +15 -35
- package/scripts/dernier-vert.mjs +4 -5
- package/scripts/dette.mjs +5 -3
- package/scripts/droits.mjs +2 -2
- package/scripts/echantillonneur-de-la-passe.mjs +7 -31
- package/scripts/engendres.mjs +5 -61
- package/scripts/enveloppe/enveloppe.mjs +30 -34
- package/scripts/enveloppe/travail-de-la-copie.mjs +5 -0
- package/scripts/etapes.mjs +21 -7
- package/scripts/etat-du-depot.mjs +61 -0
- package/scripts/faits-du-circuit.mjs +7 -4
- package/scripts/fermeture-de-la-machine.d.mts +6 -4
- package/scripts/fermeture-de-la-machine.mjs +12 -16
- package/scripts/fichier-du-poste.d.mts +9 -0
- package/scripts/file-des-tickets.d.mts +0 -18
- package/scripts/file-des-tickets.mjs +0 -42
- package/scripts/fusion-du-changelog.mjs +1 -1
- package/scripts/greffons.mjs +282 -17
- package/scripts/grillhouse-maj.mjs +1 -1
- package/scripts/index-des-rouges.d.mts +40 -0
- package/scripts/index-des-rouges.mjs +104 -0
- package/scripts/integration/file.mjs +13 -63
- package/scripts/integration/integrer.mjs +157 -424
- package/scripts/integration/jugement.mjs +109 -0
- package/scripts/integration/rejeu.mjs +94 -71
- package/scripts/jointure.d.ts +34 -27
- package/scripts/journal-des-etats.d.mts +1 -1
- package/scripts/langages/c/commandes.mjs +27 -12
- package/scripts/langages/cargo/commandes.mjs +148 -94
- package/scripts/langages/cargo/index.mjs +2 -1
- package/scripts/langages/cargo/lectures-des-tests.mjs +132 -0
- package/scripts/langages/cargo/migrations/lectures-des-tests.mjs +31 -0
- package/scripts/langages/python/commandes.mjs +31 -15
- package/scripts/langages/python/index.mjs +2 -1
- package/scripts/langages/python/lectures-des-tests.mjs +148 -0
- package/scripts/langages/python/migrations/lectures-des-tests.mjs +31 -0
- package/scripts/langages/typescript/consommateurs-arbitres.mjs +2 -2
- package/scripts/langages/typescript/index.mjs +4 -0
- package/scripts/langages/typescript/lectures-des-tests.mjs +95 -0
- package/scripts/langages/typescript/migrations/lectures-des-tests.mjs +31 -0
- package/scripts/langages/typescript/tests-de-nuit.mjs +9 -15
- package/scripts/langages/typescript/tests.mjs +11 -37
- package/scripts/langages/typescript/titres-de-tests.mjs +5 -4
- package/scripts/langages/typescript/verifier.mjs +74 -44
- package/scripts/langages/typescript/vitest-config/base.mjs +3 -3
- package/scripts/langages/typescript/vitest-config/machine.setup.mjs +6 -25
- package/scripts/lectures-communes.mjs +234 -0
- package/scripts/machine.mjs +11 -18
- package/scripts/mesure/base-de-passe.mjs +1 -2
- package/scripts/mesure-de-la-machine.d.mts +40 -3
- package/scripts/mesure-de-la-machine.mjs +201 -11
- package/scripts/migrations/0.33.0-ci-du-cadre.mjs +3 -3
- package/scripts/migrations/nuit-yml-retire.mjs +25 -0
- package/scripts/migrations/part-retiree.mjs +31 -0
- package/scripts/migrations.mjs +4 -0
- package/scripts/montee.mjs +22 -1
- package/scripts/nuit-de-pc2.mjs +628 -0
- package/scripts/nuit.sh +8 -131
- package/scripts/paquets.mjs +1 -1
- package/scripts/passe-de-la-machine.mjs +340 -103
- package/scripts/place-du-circuit.d.mts +15 -0
- package/scripts/place-du-circuit.mjs +32 -0
- package/scripts/places-de-la-machine.mjs +148 -626
- package/scripts/places-du-serveur.mjs +26 -13
- package/scripts/plafond-de-la-machine.d.mts +8 -13
- package/scripts/plafond-de-la-machine.mjs +26 -56
- package/scripts/registre-des-entrees.mjs +57 -0
- package/scripts/regles-des-places.d.mts +82 -50
- package/scripts/regles-des-places.mjs +192 -156
- package/scripts/retirer-copie.sh +9 -2
- package/scripts/seances.mjs +181 -63
- package/scripts/secours.mjs +95 -0
- package/scripts/services-du-noyau.mjs +11 -19
- package/scripts/sous-commandes.mjs +1 -0
- package/scripts/sous-modules.sh +1 -1
- package/scripts/superviseur.mjs +98 -20
- package/scripts/table-des-consommations.d.mts +9 -0
- package/scripts/table-des-consommations.mjs +35 -0
- package/scripts/tableau.mjs +33 -19
- package/scripts/taches-du-graphe.mjs +124 -2
- package/scripts/transitions.d.mts +27 -5
- package/scripts/transitions.mjs +122 -104
- package/scripts/verdict-de-la-nuit.d.mts +13 -0
- package/scripts/verdict-de-la-nuit.mjs +34 -7
- package/scripts/verrou-de-fichier.mjs +1 -2
- package/scripts/workflows-du-cadre.mjs +2 -2
- package/skills/developpeur/SKILL.md +8 -2
- package/skills/direct/SKILL.md +5 -0
- package/skills/explorateur/SKILL.md +10 -1
- package/skills/grill/SKILL.md +2 -4
- package/skills/pitmaster/SKILL.md +14 -7
- package/skills/pitmaster/references/consigne-agent.md +1 -1
- package/skills/relecteur/SKILL.md +4 -1
- package/skills/testwriter/SKILL.md +15 -2
- package/cadre/templates/projet/.env.example +0 -57
- package/cadre/templates/projet/.github/workflows/nuit.yml +0 -139
- package/cadre/templates/projet/deployment/README.md +0 -98
- package/cadre/templates/projet/deployment/docs/01-INSTALL.md +0 -145
- package/cadre/templates/projet/deployment/docs/02-CONFIGURATION.md +0 -117
- package/cadre/templates/projet/deployment/docs/03-API.md +0 -264
- package/cadre/templates/projet/deployment/docs/04-TROUBLESHOOTING.md +0 -262
- package/cadre/templates/projet/deployment/scripts/install.ps1 +0 -100
- package/cadre/templates/projet/deployment/scripts/start.ps1 +0 -61
- package/cadre/templates/projet/deployment/scripts/stop.ps1 +0 -37
- package/cadre/templates/projet/deployment/scripts/test.ps1 +0 -118
- package/cadre/templates/projet/ecosystem.config.cjs +0 -73
- package/cadre/templates/projet/src/config.ts +0 -68
- package/cadre/templates/projet/src/errors.ts +0 -102
- package/cadre/templates/projet/src/index.ts +0 -46
- package/cadre/templates/projet/src/services/.gitkeep +0 -8
- package/cadre/templates/projet/src/types/index.ts +0 -24
- package/cadre/templates/projet/src/utils/logger.ts +0 -106
- package/cadre/templates/projet/tests/unit/config.spec.ts +0 -68
- package/cadre/templates/projet/tests/unit/errors.spec.ts +0 -132
- package/cadre/templates/projet/tests/unit/types.spec.ts +0 -73
- package/cadre/templates/projet/tsconfig.build.json +0 -14
- package/scripts/flux-de-la-nuit.mjs +0 -39
- package/scripts/garde-de-la-memoire.mjs +0 -231
- package/scripts/repli-de-la-nuit.mjs +0 -184
package/scripts/superviseur.mjs
CHANGED
|
@@ -36,20 +36,24 @@
|
|
|
36
36
|
// Exit 0, whatever it finds.
|
|
37
37
|
//
|
|
38
38
|
// npx grillhouse superviseur --jalon <fichier>
|
|
39
|
+
// npx grillhouse superviseur --note <fichier>
|
|
39
40
|
// npx grillhouse superviseur --question <fichier>
|
|
40
41
|
//
|
|
41
42
|
// - Played by the session that holds the lock, from the root of the repository. The note of
|
|
42
43
|
// resumption, one per repository, is `<git common dir>/grillhouse-reprise.md`. `--jalon` replaces
|
|
43
44
|
// it whole by the text of <fichier> and declares a milestone, which replaces the one before
|
|
44
|
-
// (`<git common dir>/grillhouse-jalon.json`);
|
|
45
|
-
//
|
|
45
|
+
// (`<git common dir>/grillhouse-jalon.json`); in the 30 minutes that follow a renewal at a
|
|
46
|
+
// milestone, it declares none and says on its output from which hour one holds. `--note` replaces
|
|
47
|
+
// the note whole and `--question` adds the text at its end, creating it; both declare nothing.
|
|
48
|
+
// Exit 2 and the reason on the error stream, nothing written, on a file
|
|
46
49
|
// that is absent or empty, a session that does not hold the lock, a session of a role or a copy.
|
|
47
50
|
//
|
|
48
51
|
// npx grillhouse superviseur --renouveler <dossier> <arretA> <messageA> [sans-reponse]
|
|
49
52
|
//
|
|
50
53
|
// - Played by the greffon at each period: writes the line `{"reprise": <message>}` when the session
|
|
51
54
|
// is to be compacted (`renouvellement`: the message of resumption at a milestone that is due,
|
|
52
|
-
//
|
|
55
|
+
// after 15 minutes of silence of the owner and of the session, empty after 55 minutes of
|
|
56
|
+
// idleness), nothing otherwise. `sans-reponse` says that <arretA> is
|
|
53
57
|
// the end of a turn with no answer, which serves idleness alone.
|
|
54
58
|
//
|
|
55
59
|
// npx grillhouse pre-compact
|
|
@@ -122,16 +126,24 @@ import {
|
|
|
122
126
|
|
|
123
127
|
const VERROU_SUPERVISEUR = 'grillhouse-superviseur.lock';
|
|
124
128
|
// In the common directory of git: the note of resumption of the supervisor, its declared milestone,
|
|
125
|
-
// and the start of the last night whose request was
|
|
129
|
+
// what is held of its last renewal at a milestone, and the start of the last night whose request was
|
|
130
|
+
// given.
|
|
126
131
|
const NOTE_DE_REPRISE = 'grillhouse-reprise.md';
|
|
127
132
|
const JALON = 'grillhouse-jalon.json';
|
|
133
|
+
const RENOUVELLEMENT = 'grillhouse-renouvellement.json';
|
|
128
134
|
const DEMANDE_DE_NUIT = 'grillhouse-demande-de-nuit.json';
|
|
129
135
|
// The message the greffon submits once the compaction of a milestone is installed; the note, the
|
|
130
136
|
// questions and the circuits come with the opening.
|
|
131
137
|
const MESSAGE_DE_REPRISE =
|
|
132
138
|
"Reprends la supervision : ta séance vient d'être compactée au jalon que tu as déclaré. L'ouverture te donne la note de reprise, les questions et les circuits : suis-la.";
|
|
139
|
+
// How long the owner and the session both stay silent before a declared milestone is played: an
|
|
140
|
+
// exchange with the owner is never compacted, as an update waits for the inactivity of the user.
|
|
141
|
+
const SILENCE_DU_JALON_MS = 15 * 60_000;
|
|
133
142
|
// How long a session without a turn stays before it is compacted: its prompt cache lasts one hour.
|
|
134
143
|
const INACTIVITE_MS = 55 * 60_000;
|
|
144
|
+
// One renewal at a milestone per period, as the intensity and the period of an OTP supervisor
|
|
145
|
+
// (`StartLimitBurst` and `StartLimitIntervalSec` of systemd), the intensity being 1.
|
|
146
|
+
const PERIODE_DU_RENOUVELLEMENT_MS = 30 * 60_000;
|
|
135
147
|
// The output of a hook of Claude Code stays under this many characters.
|
|
136
148
|
const PLAFOND_DU_CROCHET = 10_000;
|
|
137
149
|
const COQUILLES = new Set(['sh', 'bash', 'dash', 'zsh']);
|
|
@@ -784,18 +796,49 @@ function surLaNote(dossier, fichier, env, ecrire) {
|
|
|
784
796
|
/**
|
|
785
797
|
* The session that holds the lock of the supervisor of <dossier> declares a milestone: the text of
|
|
786
798
|
* <fichier> replaces its note of resumption whole, and the milestone, which holds for the context
|
|
787
|
-
* that declares it, replaces the one before (`superviseur --jalon`).
|
|
799
|
+
* that declares it, replaces the one before (`superviseur --jalon`). In the period that follows a
|
|
800
|
+
* renewal at a milestone of this session, the note is replaced and no milestone is declared.
|
|
788
801
|
* @param {string} dossier
|
|
789
802
|
* @param {string} fichier
|
|
790
803
|
* @param {{ env?: Record<string, string | undefined> }} [options]
|
|
791
|
-
* @returns {Promise<{ code: number, raison: string }>} code 2 and its reason,
|
|
792
|
-
* refusal
|
|
804
|
+
* @returns {Promise<{ code: number, raison: string, avis?: string }>} code 2 and its reason,
|
|
805
|
+
* nothing written, on a refusal; `avis` says that no milestone is declared, and from which hour one
|
|
806
|
+
* holds
|
|
793
807
|
*/
|
|
794
808
|
export async function declarerLeJalon(dossier, fichier, { env = process.env } = {}) {
|
|
795
|
-
|
|
809
|
+
let avis;
|
|
810
|
+
const rendu = surLaNote(dossier, fichier, env, ({ commun, tenant }, texte) => {
|
|
796
811
|
ecrireEntier(path.join(commun, NOTE_DE_REPRISE), texte);
|
|
812
|
+
const tenu = lireJson(path.join(commun, RENOUVELLEMENT));
|
|
813
|
+
const fin = tenu?.tenant === tenant ? tenu.depuisA + PERIODE_DU_RENOUVELLEMENT_MS : NaN;
|
|
814
|
+
if (Date.now() < fin) {
|
|
815
|
+
avis = `La note est remplacée, aucun jalon n'est déclaré : ta séance a été renouvelée à un jalon il y a moins de 30 minutes. Une déclaration vaut à partir de ${heureDe(fin)}.`;
|
|
816
|
+
return;
|
|
817
|
+
}
|
|
797
818
|
ecrireEntier(path.join(commun, JALON), `${JSON.stringify({ declareA: Date.now(), tenant })}\n`);
|
|
798
819
|
});
|
|
820
|
+
return avis ? { ...rendu, avis } : rendu;
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
// The local hour and minutes of the first whole minute at or after `ms`.
|
|
824
|
+
function heureDe(ms) {
|
|
825
|
+
const d = new Date(Math.ceil(ms / 60_000) * 60_000);
|
|
826
|
+
return `${d.getHours()}:${String(d.getMinutes()).padStart(2, '0')}`;
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
/**
|
|
830
|
+
* The text of <fichier> replaces whole the note of resumption of the session that holds the lock; no
|
|
831
|
+
* milestone is declared, and one not yet played stays as it was (`superviseur --note`).
|
|
832
|
+
* @param {string} dossier
|
|
833
|
+
* @param {string} fichier
|
|
834
|
+
* @param {{ env?: Record<string, string | undefined> }} [options]
|
|
835
|
+
* @returns {Promise<{ code: number, raison: string }>} code 2 and its reason, nothing written, on a
|
|
836
|
+
* refusal
|
|
837
|
+
*/
|
|
838
|
+
export async function ecrireLaNote(dossier, fichier, { env = process.env } = {}) {
|
|
839
|
+
return surLaNote(dossier, fichier, env, ({ commun }, texte) => {
|
|
840
|
+
ecrireEntier(path.join(commun, NOTE_DE_REPRISE), texte);
|
|
841
|
+
});
|
|
799
842
|
}
|
|
800
843
|
|
|
801
844
|
/**
|
|
@@ -819,11 +862,13 @@ export async function ajouterLaQuestion(dossier, fichier, { env = process.env }
|
|
|
819
862
|
/**
|
|
820
863
|
* Whether the session of supervision of <dossier> is to be compacted (`superviseur --renouveler`),
|
|
821
864
|
* the session holding the lock: at a milestone it declared, once a quiet Stop (<arretA>, ms, 0
|
|
822
|
-
* without one) is later than it
|
|
823
|
-
*
|
|
824
|
-
*
|
|
825
|
-
*
|
|
826
|
-
*
|
|
865
|
+
* without one) is later than it and both that Stop and the last message of the owner (<messageA>,
|
|
866
|
+
* ms, 0 without one) are 15 minutes old, with the message of resumption; else once that Stop is 55
|
|
867
|
+
* minutes old, with an empty message, a note or a milestone or not. With <sansReponse>, <arretA> is
|
|
868
|
+
* the end of a turn that gave no answer, not a Stop: it serves idleness alone and plays no
|
|
869
|
+
* milestone. A message of the owner later than the declaration cancels the milestone. The reading
|
|
870
|
+
* keeps a milestone that is due, and records that its message was given: the opening that follows the compaction
|
|
871
|
+
* removes it.
|
|
827
872
|
* @param {string} dossier
|
|
828
873
|
* @param {{ arretA: number, messageA: number, sansReponse?: boolean,
|
|
829
874
|
* env?: Record<string, string | undefined> }} options
|
|
@@ -842,7 +887,15 @@ export async function renouvellement(
|
|
|
842
887
|
if (jalon && jalon.tenant === session.tenant) {
|
|
843
888
|
if (messageA > jalon.declareA) {
|
|
844
889
|
rmSync(f, { force: true });
|
|
845
|
-
} else if (
|
|
890
|
+
} else if (
|
|
891
|
+
!sansReponse &&
|
|
892
|
+
arretA > jalon.declareA &&
|
|
893
|
+
Date.now() - Math.max(arretA, messageA) >= SILENCE_DU_JALON_MS
|
|
894
|
+
) {
|
|
895
|
+
ecrireEntier(
|
|
896
|
+
path.join(session.commun, RENOUVELLEMENT),
|
|
897
|
+
`${JSON.stringify({ tenant: session.tenant, rendu: jalon.declareA })}\n`
|
|
898
|
+
);
|
|
846
899
|
return { reprise: MESSAGE_DE_REPRISE };
|
|
847
900
|
}
|
|
848
901
|
}
|
|
@@ -912,12 +965,29 @@ const REPRISES = {
|
|
|
912
965
|
].join('\n'),
|
|
913
966
|
};
|
|
914
967
|
|
|
968
|
+
// At an opening of the holder of the lock, before the declared milestone is removed: a compaction
|
|
969
|
+
// that removes a milestone given due starts the period of the renewal; any other compaction leaves
|
|
970
|
+
// what is held, and any other source removes it.
|
|
971
|
+
function tenirLaPeriode(commun, { compactage, source, tenant }) {
|
|
972
|
+
const f = path.join(commun, RENOUVELLEMENT);
|
|
973
|
+
if (source !== 'compact') {
|
|
974
|
+
rmSync(f, { force: true });
|
|
975
|
+
return;
|
|
976
|
+
}
|
|
977
|
+
const jalon = lireJson(path.join(commun, JALON));
|
|
978
|
+
const tenu = lireJson(f);
|
|
979
|
+
if (compactage && jalon?.tenant === tenant && tenu?.rendu === jalon.declareA) {
|
|
980
|
+
ecrireEntier(f, `${JSON.stringify({ tenant, depuisA: Date.now() })}\n`);
|
|
981
|
+
}
|
|
982
|
+
}
|
|
983
|
+
|
|
915
984
|
/**
|
|
916
985
|
* The check of the supervisor at the opening of a session in <dossier> (greffon.md, §5.2): what it
|
|
917
986
|
* says (empty when nothing), the lock taken when it is free. <source> is the one of the
|
|
918
987
|
* SessionStart hook. The session that takes the lock, and the holder after a /clear or a
|
|
919
988
|
* compaction, receive the circuits and the note of resumption; every opening of the holder removes
|
|
920
|
-
* the declared milestone.
|
|
989
|
+
* the declared milestone. A compaction of the holder that removes a milestone given due starts the
|
|
990
|
+
* period of the renewal; every opening of another source lifts it.
|
|
921
991
|
* @param {string} dossier the directory the session opens in
|
|
922
992
|
* @param {{ source?: string, env?: Record<string, string | undefined>, circuitsDe?: (racine: string) => Promise<import('./circuits-du-serveur.mjs').CircuitDuServeur[]> }} [options]
|
|
923
993
|
* @returns {Promise<string>}
|
|
@@ -936,6 +1006,7 @@ export async function ouvertureDuSuperviseur(
|
|
|
936
1006
|
if (!tenait && !prendreVerrou(verrou, { attendre: false, pid: moi })) {
|
|
937
1007
|
return unAutreSuperviseur(verrou, moi);
|
|
938
1008
|
}
|
|
1009
|
+
tenirLaPeriode(commun, { compactage: tenait && source === 'compact', source, tenant: moi });
|
|
939
1010
|
rmSync(path.join(commun, JALON), { force: true });
|
|
940
1011
|
const reprise = Object.hasOwn(REPRISES, source) ? REPRISES[source] : '';
|
|
941
1012
|
if (tenait && !reprise) {
|
|
@@ -1134,12 +1205,19 @@ function racineDe(dossier) {
|
|
|
1134
1205
|
}
|
|
1135
1206
|
|
|
1136
1207
|
if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) {
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1208
|
+
const gestes = {
|
|
1209
|
+
'--jalon': declarerLeJalon,
|
|
1210
|
+
'--note': ecrireLaNote,
|
|
1211
|
+
'--question': ajouterLaQuestion,
|
|
1212
|
+
};
|
|
1213
|
+
if (Object.hasOwn(gestes, process.argv[2] ?? '')) {
|
|
1214
|
+
// superviseur --jalon|--note|--question <fichier> : played from the root of the repository.
|
|
1215
|
+
const { code, raison, avis } = process.argv[3]
|
|
1216
|
+
? await gestes[process.argv[2]](process.cwd(), process.argv[3])
|
|
1142
1217
|
: { code: 2, raison: 'le fichier manque' };
|
|
1218
|
+
if (avis) {
|
|
1219
|
+
process.stdout.write(`${avis}\n`);
|
|
1220
|
+
}
|
|
1143
1221
|
if (raison) {
|
|
1144
1222
|
process.stderr.write(`${process.argv[2]} : ${raison}.\n`);
|
|
1145
1223
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// The types of ./table-des-consommations.mjs, for the frame's TypeScript
|
|
2
|
+
// (src/temporal/consommation/actualisation.ts).
|
|
3
|
+
|
|
4
|
+
/** The file of the table of the project at `racine`; null out of git. */
|
|
5
|
+
export function fichierDeLaTable(racine: string): string | null;
|
|
6
|
+
/** The table written for the project at `racine`; null without one that reads. */
|
|
7
|
+
export function lireLaTable(
|
|
8
|
+
racine: string
|
|
9
|
+
): { actualisee: string; phases?: Record<string, unknown> } | null;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// The file of the table of the consumptions of a project,
|
|
2
|
+
// `<git common dir>/grillhouse/table-des-consommations.json`, beside the register it is drawn from
|
|
3
|
+
// (./consommation-des-passes.mjs): its path and its reading. Its computation is
|
|
4
|
+
// src/machine/table-des-consommations.ts, its command ./consommation.mjs. Architecture:
|
|
5
|
+
// docs/architecture/machine.md (§4.2).
|
|
6
|
+
import { readFileSync } from 'node:fs';
|
|
7
|
+
import path from 'node:path';
|
|
8
|
+
import { fichierDeConsommation } from './consommation-des-passes.mjs';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The file of the table of the project at <racine>, the same from each of its copies; null out of
|
|
12
|
+
* git.
|
|
13
|
+
* @param {string} racine
|
|
14
|
+
* @returns {string | null}
|
|
15
|
+
*/
|
|
16
|
+
export function fichierDeLaTable(racine) {
|
|
17
|
+
const registre = fichierDeConsommation(racine);
|
|
18
|
+
return registre === null
|
|
19
|
+
? null
|
|
20
|
+
: path.join(path.dirname(registre), 'table-des-consommations.json');
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The table written for the project at <racine>; null without one that reads.
|
|
25
|
+
* @param {string} racine
|
|
26
|
+
* @returns {{ actualisee: string, phases?: Record<string, any> } | null}
|
|
27
|
+
*/
|
|
28
|
+
export function lireLaTable(racine) {
|
|
29
|
+
try {
|
|
30
|
+
const t = JSON.parse(readFileSync(fichierDeLaTable(racine) ?? '', 'utf8'));
|
|
31
|
+
return typeof t?.actualisee === 'string' ? t : null;
|
|
32
|
+
} catch {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
}
|
package/scripts/tableau.mjs
CHANGED
|
@@ -65,8 +65,9 @@
|
|
|
65
65
|
// <durée> » read in the progress directory its state names (scripts/avancement.mjs), as Bazel's
|
|
66
66
|
// counter of actions; the subject is cut when room lacks, never the figures nor the number.
|
|
67
67
|
// Past FIGEE without a sign: « figée <durée> · faits/prévus », signed ⛔.
|
|
68
|
-
// -
|
|
69
|
-
//
|
|
68
|
+
// - Passes (the view of the arbiter, scripts/places-de-la-machine.mjs, read by `lireLaMesure`),
|
|
69
|
+
// as Slurm's `squeue` names who holds
|
|
70
|
+
// what: a reservation held or awaited stands on the ticket's line, « 🔒 » (holds) or « ⏳ »
|
|
70
71
|
// (waits) after the head, before the subject: « · <sorte> · 2 cœurs · 4 Go, limite 8 Go ·
|
|
71
72
|
// <durée> » (the memory reserved and where the group is cut, « sans limite » for a session), with
|
|
72
73
|
// « ⚠ » when it consumes beyond its part, « · <sorte> figée <durée> » past FIGEE, « · attend 2
|
|
@@ -142,7 +143,7 @@ import {
|
|
|
142
143
|
circuitsDuServeur,
|
|
143
144
|
nuitDuServeur,
|
|
144
145
|
} from './circuits-du-serveur.mjs';
|
|
145
|
-
import { lireLeVerdict } from './verdict-de-la-nuit.mjs';
|
|
146
|
+
import { lireLeVerdict, lireLesRaisonsAPasser } from './verdict-de-la-nuit.mjs';
|
|
146
147
|
import {
|
|
147
148
|
aSonArchitecture,
|
|
148
149
|
attendDeLAutreProjet,
|
|
@@ -251,6 +252,7 @@ export const TONS = Object.freeze({
|
|
|
251
252
|
sansIssue: 'alerte',
|
|
252
253
|
panne: 'alerte',
|
|
253
254
|
nuitRouge: 'alerte',
|
|
255
|
+
nuitARepasser: 'attention',
|
|
254
256
|
plafondRefuse: 'alerte',
|
|
255
257
|
// The layout.
|
|
256
258
|
titre: 'titre',
|
|
@@ -1227,7 +1229,7 @@ const limiteDite = p =>
|
|
|
1227
1229
|
: `, limite ${goDe(p.limite)} Go`;
|
|
1228
1230
|
// What a pass that waits asks of the memory, its reservation and its limit.
|
|
1229
1231
|
const demandeDite = p =>
|
|
1230
|
-
p.
|
|
1232
|
+
p.memoire === undefined ? '' : ` · ${goDe(p.memoire)} Go réservés${limiteDite(p)}`;
|
|
1231
1233
|
|
|
1232
1234
|
/**
|
|
1233
1235
|
* The parts of the machine as the board says them, in lines: first the budget taken, « Parts · 2
|
|
@@ -1283,6 +1285,7 @@ export function lignesDesParts({
|
|
|
1283
1285
|
* failed, the time of the last one that succeeded, whose circuits `circuits` holds and whose age
|
|
1284
1286
|
* the alert says; `fauteTickets`, the fault of the reading of the tickets, said in an alert, and
|
|
1285
1287
|
* `ticketsLusA`, the time of the last one that succeeded, whose tickets `tous` holds;
|
|
1288
|
+
* `raisonsDeLaNuit`, the reasons the part of PC2 of the last night is « à repasser » (`lireLesRaisonsAPasser`), one alert each;
|
|
1286
1289
|
* `echecPrefixe`, the cause of a ticket prefix that did not read, named in an alert; `voies`, the
|
|
1287
1290
|
* way of each circuit done (`voiesDesCircuits`), whose sign FAITS AUJOURD'HUI shows; `bilans`,
|
|
1288
1291
|
* the kept bilan of each ticket (`bilansGardes`), whose status says whether the engine led it.
|
|
@@ -1297,7 +1300,7 @@ export function lignesDesParts({
|
|
|
1297
1300
|
* depuis: number, disque?: string | null }[],
|
|
1298
1301
|
* fermeture?: { auteur: 'superviseur', depuis: number, phase: string } | null } | null,
|
|
1299
1302
|
* nuit?: { racine: string, depuis: number | null } | null, muet?: boolean, faute?: string | null,
|
|
1300
|
-
* echecPrefixe?: string | null, voies?: Record<string, 'complet' | 'court'>,
|
|
1303
|
+
* raisonsDeLaNuit?: string[], echecPrefixe?: string | null, voies?: Record<string, 'complet' | 'court'>,
|
|
1301
1304
|
* bilans?: Record<string, { statut?: string }> }} lu
|
|
1302
1305
|
*/
|
|
1303
1306
|
export function assembler({
|
|
@@ -1315,6 +1318,7 @@ export function assembler({
|
|
|
1315
1318
|
places: placesDeLaMachine = null,
|
|
1316
1319
|
nuit: nuitEnCours = null,
|
|
1317
1320
|
verdictDeLaNuit = null,
|
|
1321
|
+
raisonsDeLaNuit = [],
|
|
1318
1322
|
muet = false,
|
|
1319
1323
|
faute = null,
|
|
1320
1324
|
circuitsLusA = null,
|
|
@@ -1780,6 +1784,11 @@ export function assembler({
|
|
|
1780
1784
|
id: t.id,
|
|
1781
1785
|
});
|
|
1782
1786
|
}
|
|
1787
|
+
// The part of PC2 of the last night is « à repasser »: each reason (a tranche or the measures,
|
|
1788
|
+
// with its cause, « aucun passage créé » included) stands on its line, whatever the verdict.
|
|
1789
|
+
for (const raison of raisonsDeLaNuit) {
|
|
1790
|
+
alerter('nuitARepasser', { signe: '🌙', texte: `PC2 · ${raison}` });
|
|
1791
|
+
}
|
|
1783
1792
|
// The published version that leads the repository cannot be installed: the orchestration runs on
|
|
1784
1793
|
// the code of the repository (scripts/aiguillage.mjs).
|
|
1785
1794
|
if (outil) {
|
|
@@ -2002,11 +2011,20 @@ export const k = n =>
|
|
|
2002
2011
|
: n >= 1e3
|
|
2003
2012
|
? `${Math.round(n / 1e3)} k`
|
|
2004
2013
|
: `${n}`;
|
|
2005
|
-
// A cost
|
|
2014
|
+
// A cost as the measures line says it, the unit glued: whole dollars, « 73$ », then from 1 000 $
|
|
2015
|
+
// thousands to two decimals, « 9.24K$ ». A partial cost is a floor, never rounded up; the line does
|
|
2016
|
+
// not mark it.
|
|
2006
2017
|
const dollars = (cout, partiel) => {
|
|
2007
|
-
// A known cost marked partial is a floor: never rounded up.
|
|
2008
2018
|
const entiers = partiel ? Math.floor(cout + 1e-6) : Math.round(cout);
|
|
2009
|
-
return
|
|
2019
|
+
return entiers >= 1000
|
|
2020
|
+
? `${(partiel ? Math.floor(entiers / 10) / 100 : Math.round(entiers / 10) / 100).toFixed(2)}K$`
|
|
2021
|
+
: `${entiers}$`;
|
|
2022
|
+
};
|
|
2023
|
+
// A working time in whole hours, « 733h », from 1 000 h in thousands to two decimals, « 1.23Kh »;
|
|
2024
|
+
// under an hour as `duree`.
|
|
2025
|
+
const heures = ms => {
|
|
2026
|
+
const h = Math.round(ms / (60 * MINUTE));
|
|
2027
|
+
return h >= 1000 ? `${(Math.round(h / 10) / 100).toFixed(2)}Kh` : h >= 1 ? `${h}h` : duree(ms);
|
|
2010
2028
|
};
|
|
2011
2029
|
export const duree = ms => {
|
|
2012
2030
|
const min = Math.round(ms / MINUTE);
|
|
@@ -2241,7 +2259,7 @@ export function etatsDAgents(t) {
|
|
|
2241
2259
|
icone: '🔒',
|
|
2242
2260
|
texte: fige
|
|
2243
2261
|
? ` · ${sorte} figée ${ilYa(age)}${compte ? ` · ${compte}` : ''}`
|
|
2244
|
-
: ` · ${sorte}${compte ? ` ${compte}` : ''}${tenu.coeurs ? ` · ${tenu.coeurs} cœurs` : ''}${tenu.
|
|
2262
|
+
: ` · ${sorte}${compte ? ` ${compte}` : ''}${tenu.coeurs ? ` · ${tenu.coeurs} cœurs` : ''}${tenu.memoire === undefined ? '' : ` · ${goDe(tenu.memoire)} Go${limiteDite(tenu)}`} · ${ilYa(maintenant - (tenu.depuis ?? maintenant))}${tenu.depasse ? ` · ⚠ ${tenu.depasse}` : ''}`,
|
|
2245
2263
|
});
|
|
2246
2264
|
}
|
|
2247
2265
|
const reserves = (t.machine?.prises ?? []).reduce((n, x) => n + (x.coeurs ?? 0), 0);
|
|
@@ -2431,17 +2449,12 @@ export function lignes(t, nom, largeur = LARGEUR, groupes = {}) {
|
|
|
2431
2449
|
// The day's and the cumul's lines of <m> (`{ jour, cumul }`), each its working time, its billed
|
|
2432
2450
|
// tokens and its cost.
|
|
2433
2451
|
const lignesDesMesures = m => {
|
|
2434
|
-
|
|
2452
|
+
const dit = (tete, cumul) => {
|
|
2435
2453
|
const x = { travail: 0, jetons: 0, cout: 0, partiel: false, ...m[tete] };
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
largeur
|
|
2441
|
-
),
|
|
2442
|
-
TONS.mesure
|
|
2443
|
-
);
|
|
2444
|
-
}
|
|
2454
|
+
const temps = cumul ? heures(x.travail) : duree(x.travail);
|
|
2455
|
+
return `${tete === 'jour' ? 'Jour' : 'Cumul'} ${temps} ${k(x.jetons).replace(' ', '')} ${dollars(x.cout, x.partiel)}`;
|
|
2456
|
+
};
|
|
2457
|
+
L(cadre(`${dit('jour', false)} · ${dit('cumul', true)}`, '', largeur), TONS.mesure);
|
|
2445
2458
|
};
|
|
2446
2459
|
if (plusieurs) {
|
|
2447
2460
|
// The lines of each project, as one project's board says them: « toi » under its label, its
|
|
@@ -3423,6 +3436,7 @@ function lire(
|
|
|
3423
3436
|
places,
|
|
3424
3437
|
nuit,
|
|
3425
3438
|
verdictDeLaNuit: lireLeVerdict(commun),
|
|
3439
|
+
raisonsDeLaNuit: lireLesRaisonsAPasser(commun),
|
|
3426
3440
|
muet,
|
|
3427
3441
|
faute,
|
|
3428
3442
|
circuitsLusA: lesCircuitsLus.lu,
|
|
@@ -14,6 +14,11 @@
|
|
|
14
14
|
// `test:unit` names: it enters that task's hash alone, so a run by path of a package unchanged
|
|
15
15
|
// replays from the cache, and another path moves the hash. `rejouer`, the moment of the run, is a
|
|
16
16
|
// value no cached run holds: the task plays for real. The variable of the caller never passes on.
|
|
17
|
+
// - `lancerLesTests` is the run of the task of the tests of packages, the one code of every module of
|
|
18
|
+
// language (`cibles` of typescript, `tester` of cargo): out of an envelope, one run of the tests; in
|
|
19
|
+
// an envelope, the build `--only` of the packages it shows in writing, then the tests `--only`, a
|
|
20
|
+
// package it shows read-only arriving built. `construirePourLesGardes` leaves the build tasks of such
|
|
21
|
+
// a package out of its run as well.
|
|
17
22
|
// - `construireDuPlan` is the command `construire --echec <fichier> <plan>` of every module, which
|
|
18
23
|
// the launcher (scripts/enveloppe/lancer.sh) runs in the prepared copy: the session finds built
|
|
19
24
|
// what it reads out of its plan. As Bazel builds the dependencies of a target before the target:
|
|
@@ -47,10 +52,10 @@
|
|
|
47
52
|
// The mechanism: docs/architecture/tests.md §3.1 (the launcher of the tasks of the graph), §5.1
|
|
48
53
|
// and §5.4.
|
|
49
54
|
import { spawnSync } from 'node:child_process';
|
|
50
|
-
import { closeSync, openSync, readFileSync, writeFileSync } from 'node:fs';
|
|
55
|
+
import { accessSync, closeSync, constants, openSync, readFileSync, writeFileSync } from 'node:fs';
|
|
51
56
|
import { availableParallelism } from 'node:os';
|
|
52
57
|
import path from 'node:path';
|
|
53
|
-
import { lireLaListe } from './enveloppe/paquets-du-plan.mjs';
|
|
58
|
+
import { lireLaListe, paquetsDeLEnveloppe } from './enveloppe/paquets-du-plan.mjs';
|
|
54
59
|
import { paquets } from './paquets.mjs';
|
|
55
60
|
import { langage } from './langages.mjs';
|
|
56
61
|
import { travailleursDeLaSeance } from './places-de-la-machine.mjs';
|
|
@@ -181,6 +186,82 @@ export function lancerLesTaches({
|
|
|
181
186
|
return r.status ?? 1;
|
|
182
187
|
}
|
|
183
188
|
|
|
189
|
+
/**
|
|
190
|
+
* True when this process may write the directory <dir>: false under a read-only mount.
|
|
191
|
+
* @param {string} dir
|
|
192
|
+
*/
|
|
193
|
+
const inscriptible = dir => {
|
|
194
|
+
try {
|
|
195
|
+
accessSync(dir, constants.W_OK);
|
|
196
|
+
return true;
|
|
197
|
+
} catch {
|
|
198
|
+
return false;
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* The directory of each package of the frame at <racine>, by its name.
|
|
204
|
+
* @param {string} racine
|
|
205
|
+
* @returns {Map<string, string>}
|
|
206
|
+
*/
|
|
207
|
+
const dossiersDesPaquets = racine =>
|
|
208
|
+
new Map(paquets(racine).map(p => [p.pkg.name, path.join(racine, p.dossier)]));
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* The run of the task of the tests of the packages <filtres> (`--filter=<nom>`, none for the whole
|
|
212
|
+
* graph), the one code of every module of language. Out of an envelope, one run of the tests with
|
|
213
|
+
* what they depend on. In the envelope of an agent, a package it shows read-only arrives built: only
|
|
214
|
+
* the packages it shows in writing build (`run build <traces> --only --filter=…`, `inscriptible`),
|
|
215
|
+
* then the tests alone (`run test:unit --only --filter=…`), <tests> in the variable of the tests.
|
|
216
|
+
* <lancer>(args, tests) runs one `run <args>` of the module and gives its exit code; <traces>
|
|
217
|
+
* (optional) gives, from the filters and the names of the packages to build, the task ids of the
|
|
218
|
+
* traces their tests wait for, `{ ids }`, or `{ code }` for a plan that fails. The exit code: the
|
|
219
|
+
* first that is not 0, else the tests'.
|
|
220
|
+
* @param {{ racine: string, filtres: string[], tests?: object, env?: NodeJS.ProcessEnv,
|
|
221
|
+
* lancer: (args: string[], tests?: object) => number,
|
|
222
|
+
* traces?: (filtres: string[], noms: Set<string>) => { ids?: string[], code?: number } }} o
|
|
223
|
+
* @returns {number}
|
|
224
|
+
*/
|
|
225
|
+
export function lancerLesTests({
|
|
226
|
+
racine,
|
|
227
|
+
filtres,
|
|
228
|
+
tests,
|
|
229
|
+
env = process.env,
|
|
230
|
+
lancer,
|
|
231
|
+
traces = () => ({ ids: [] }),
|
|
232
|
+
}) {
|
|
233
|
+
if (paquetsDeLEnveloppe(env) === null) {
|
|
234
|
+
return lancer([SCRIPT_DES_TESTS, ...filtres], tests);
|
|
235
|
+
}
|
|
236
|
+
const dossiers = dossiersDesPaquets(racine);
|
|
237
|
+
const nom = f => f.slice('--filter='.length);
|
|
238
|
+
const construits = filtres.filter(f => inscriptible(dossiers.get(nom(f))));
|
|
239
|
+
if (filtres.length === 0 || construits.length > 0) {
|
|
240
|
+
const propres = construits.length
|
|
241
|
+
? traces(construits, new Set(construits.map(nom)))
|
|
242
|
+
: { ids: [] };
|
|
243
|
+
if (propres.code !== undefined) {
|
|
244
|
+
return propres.code;
|
|
245
|
+
}
|
|
246
|
+
const construction = lancer(['build', ...(propres.ids ?? []), '--only', ...construits]);
|
|
247
|
+
if (construction !== 0) {
|
|
248
|
+
return construction;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
return lancer([SCRIPT_DES_TESTS, '--only', ...filtres], tests);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Whether the pass is complete: `--tout` or `--force` (the night) among the raw arguments of
|
|
256
|
+
* `verifier`. The one answer the modules of language read; a complete pass plays every task of
|
|
257
|
+
* tests for real, as `turbo run --force` and `bazel test --nocache_test_results`.
|
|
258
|
+
* @param {string[]} args
|
|
259
|
+
* @returns {boolean}
|
|
260
|
+
*/
|
|
261
|
+
export function passeComplete(args) {
|
|
262
|
+
return args.includes('--tout') || args.includes('--force');
|
|
263
|
+
}
|
|
264
|
+
|
|
184
265
|
/**
|
|
185
266
|
* The content of the variable `TESTS_CIBLES` for a targeted run: the paths and options
|
|
186
267
|
* <arguments> it names, and the moment of the run when <force> (the task plays for real); undefined
|
|
@@ -195,6 +276,43 @@ export function testsCibles({ arguments: donnes, force = false }) {
|
|
|
195
276
|
return { arguments: donnes, ...(force ? { rejouer: new Date().toISOString() } : {}) };
|
|
196
277
|
}
|
|
197
278
|
|
|
279
|
+
/**
|
|
280
|
+
* The runs of a targeted pass, as the module of TypeScript plays them: the packages named whole
|
|
281
|
+
* (the exact folder of a package of <dossiers>) play in a run of their own whose variable
|
|
282
|
+
* `TESTS_CIBLES` carries no path (the options and the moment of `--force` alone), so their tasks
|
|
283
|
+
* hash as the complete pass's, as Bazel's `//pkg/...` shares the cache of `//...`; the other paths
|
|
284
|
+
* play in a run of theirs, their paths in the variable. Without a path, one run, no path.
|
|
285
|
+
* Each run is played by <lancer>, which receives its `chemins` and its `tests` (the content of the
|
|
286
|
+
* variable); the code is the first that is not 0.
|
|
287
|
+
* @param {{ chemins: string[], dossiers: string[], options?: string[], force?: boolean,
|
|
288
|
+
* lancer: (lot: { chemins: string[], tests: ReturnType<typeof testsCibles> }) => number }} o
|
|
289
|
+
* @returns {number}
|
|
290
|
+
*/
|
|
291
|
+
export function lancerEntiersEtFichiers({
|
|
292
|
+
chemins,
|
|
293
|
+
dossiers,
|
|
294
|
+
options = [],
|
|
295
|
+
force = false,
|
|
296
|
+
lancer,
|
|
297
|
+
}) {
|
|
298
|
+
const sep = s => path.resolve(s);
|
|
299
|
+
const connus = new Set(dossiers.map(sep));
|
|
300
|
+
const entiers = chemins.filter(c => connus.has(sep(c)));
|
|
301
|
+
const fichiers = chemins.filter(c => !connus.has(sep(c)));
|
|
302
|
+
const lots = [];
|
|
303
|
+
if (chemins.length === 0 || entiers.length) {
|
|
304
|
+
lots.push({ chemins: entiers, tests: testsCibles({ arguments: options, force }) });
|
|
305
|
+
}
|
|
306
|
+
if (fichiers.length) {
|
|
307
|
+
lots.push({
|
|
308
|
+
chemins: fichiers,
|
|
309
|
+
tests: testsCibles({ arguments: [...fichiers, ...options], force }),
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
const codes = lots.map(lancer);
|
|
313
|
+
return codes.find(c => c !== 0) ?? 0;
|
|
314
|
+
}
|
|
315
|
+
|
|
198
316
|
/**
|
|
199
317
|
* The paths and the options of a task of the tests of a package, run by its script: the paths
|
|
200
318
|
* <donnes> its script names (its own folder), each replaced by the paths of the variable
|
|
@@ -448,8 +566,12 @@ function construirePourLesGardes(outil, racine, env = process.env) {
|
|
|
448
566
|
process.stderr.write(`⛔ ${e.message} échoue.\n`);
|
|
449
567
|
return 1;
|
|
450
568
|
}
|
|
569
|
+
// A package the envelope shows read-only arrives built: its build is not run (a runner would
|
|
570
|
+
// write its log in its folder), as with the tests (`lancerLesTests`).
|
|
571
|
+
const dossiers = paquetsDeLEnveloppe(env) === null ? null : dossiersDesPaquets(racine);
|
|
451
572
|
const attendues = (graphe.tasks ?? [])
|
|
452
573
|
.filter(t => !gardes.includes(t.task))
|
|
574
|
+
.filter(t => !dossiers?.has(t.package) || inscriptible(dossiers.get(t.package)))
|
|
453
575
|
.map(t => t.taskId)
|
|
454
576
|
.sort();
|
|
455
577
|
if (attendues.length === 0) {
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
// The types of the decisions of the circuit (./transitions.mjs), which the workflow of a ticket
|
|
2
2
|
// under Temporal (src/temporal/circuit/) imports.
|
|
3
3
|
|
|
4
|
+
import type { IndexDesRouges } from './index-des-rouges.mjs';
|
|
5
|
+
|
|
6
|
+
/** The mark of the reds a memory keeps: their index, the fingerprint of their whole text and the address of their detail. */
|
|
7
|
+
export interface MarqueDesRouges {
|
|
8
|
+
forme: 'index';
|
|
9
|
+
index: IndexDesRouges;
|
|
10
|
+
empreinte: string;
|
|
11
|
+
detail: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
4
14
|
/** The run at its step. */
|
|
5
15
|
export interface EtatDeLaTransition {
|
|
6
16
|
etape: string;
|
|
@@ -44,13 +54,19 @@ export function circuitSuivant(
|
|
|
44
54
|
/** What the circuit keeps between steps, which the decisions read and change. */
|
|
45
55
|
export const MEMOIRE: string[];
|
|
46
56
|
|
|
57
|
+
/** Whether a lot out of the rule holds a file the circuit did not give back. */
|
|
58
|
+
export function resteAuLot(hors: { fichiers: string[]; rendus?: string[] }): boolean;
|
|
59
|
+
|
|
47
60
|
/** The steps `--depuis` names. */
|
|
48
61
|
export const ETAPES_DE_REPRISE: (
|
|
49
62
|
'testwriter' | 'preuve' | 'developpeur' | 'direct' | 'controles' | 'passe-finale'
|
|
50
63
|
)[];
|
|
51
64
|
|
|
52
65
|
/** The refusal of `--depuis <depuis>` in the circuit <circuit>, naming the resumptions it accepts, or null. */
|
|
53
|
-
export function refusDeLaReprise(entree: {
|
|
66
|
+
export function refusDeLaReprise(entree: {
|
|
67
|
+
depuis: string;
|
|
68
|
+
circuit?: string | null;
|
|
69
|
+
}): string | null;
|
|
54
70
|
|
|
55
71
|
/** The decision of the step of <entree>, or the next fact it needs. */
|
|
56
72
|
export function transition(entree: EntreeDeLaTransition): Transition;
|
|
@@ -70,12 +86,12 @@ export function depart(entree: {
|
|
|
70
86
|
export function renvoiDe(entree: {
|
|
71
87
|
fiche: { renvoi?: { role: string } | null; raison?: string };
|
|
72
88
|
passation: string | null;
|
|
73
|
-
controlesRouges: string | null;
|
|
89
|
+
controlesRouges: MarqueDesRouges | string | null;
|
|
74
90
|
fichiersRouges?: string[];
|
|
75
91
|
}): string | null;
|
|
76
92
|
|
|
77
93
|
/** The test files the red output of checks names, each once. */
|
|
78
|
-
export function fichiersDeTestRouges(controlesRouges: string | null): string[];
|
|
94
|
+
export function fichiersDeTestRouges(controlesRouges: MarqueDesRouges | string | null): string[];
|
|
79
95
|
|
|
80
96
|
/** The context `--etendre` gives the sessions of the run it resumes. */
|
|
81
97
|
export function contexteDeLExtension(entree: {
|
|
@@ -107,6 +123,14 @@ export interface EtatDuPlan {
|
|
|
107
123
|
/** The step of the plan that follows <e>. */
|
|
108
124
|
export function pasDuPlan(e: EtatDuPlan): 'explorateur' | 'questionneur' | 'reponse' | 'conclure';
|
|
109
125
|
|
|
126
|
+
/** The phase of the session the step <pas> of the plan launches; null for the conclusion. */
|
|
127
|
+
export function phaseDuPasDuPlan(
|
|
128
|
+
pas: 'explorateur' | 'questionneur' | 'reponse' | 'conclure'
|
|
129
|
+
): string | null;
|
|
130
|
+
|
|
131
|
+
/** The phase of the session the fact <fait> launches, with its <parametres>; null for a fact that launches none. */
|
|
132
|
+
export function phaseDuFait(fait: string, parametres: Record<string, unknown>): string | null;
|
|
133
|
+
|
|
110
134
|
/** The questions the explorateur answers in the questionneur's sheet <lu>. */
|
|
111
135
|
export function questionsPosees(lu: {
|
|
112
136
|
issue: string;
|
|
@@ -190,8 +214,6 @@ export const TRI: string;
|
|
|
190
214
|
export const RELANCES_TESTWRITER: number;
|
|
191
215
|
export const SEANCES_DEVELOPPEUR: number;
|
|
192
216
|
export const RELECTURES: number;
|
|
193
|
-
/** The bound of the ACCEPTÉ ↔ final pass cycle before the circuit goes up to the supervisor. */
|
|
194
|
-
export const TOURS_DE_LA_PASSE_FINALE: number;
|
|
195
217
|
|
|
196
218
|
/** What changed for a developpeur relaunched on the integration's refusal of his lot unchanged. */
|
|
197
219
|
export const CHANGE_DU_REFUS: string;
|