@roomi-fields/grillhouse 0.28.3 → 0.30.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 +739 -0
- package/bin/grillhouse.mjs +128 -26
- package/cadre/templates/projet/.github/workflows/ci.yml +2 -13
- package/cadre/templates/projet/CLAUDE.md +5 -1
- package/cadre/templates/projet/README.md +11 -11
- package/cadre/templates/projet/_gitignore +2 -5
- package/cadre/templates/projet/docs/agents/issue-tracker.md +1 -1
- package/cadre/templates/projet/package.json +2 -2
- package/charte.md +37 -4
- package/dist/temporal/acte.d.ts +24 -0
- package/dist/temporal/acte.js +139 -0
- package/dist/temporal/acte.js.map +1 -0
- package/dist/temporal/attributs.d.ts +6 -0
- package/dist/temporal/attributs.js +15 -0
- package/dist/temporal/attributs.js.map +1 -0
- package/dist/temporal/circuit/activites.d.ts +13 -0
- package/dist/temporal/circuit/activites.js +33 -0
- package/dist/temporal/circuit/activites.js.map +1 -0
- package/dist/temporal/circuit/client.d.ts +72 -0
- package/dist/temporal/circuit/client.js +247 -0
- package/dist/temporal/circuit/client.js.map +1 -0
- package/dist/temporal/circuit/commande.d.ts +2 -0
- package/dist/temporal/circuit/commande.js +238 -0
- package/dist/temporal/circuit/commande.js.map +1 -0
- package/dist/temporal/circuit/contrat.d.ts +305 -0
- package/dist/temporal/circuit/contrat.js +24 -0
- package/dist/temporal/circuit/contrat.js.map +1 -0
- package/dist/temporal/circuit/deroule.d.ts +3 -0
- package/dist/temporal/circuit/deroule.js +540 -0
- package/dist/temporal/circuit/deroule.js.map +1 -0
- package/dist/temporal/client.d.ts +47 -0
- package/dist/temporal/client.js +69 -0
- package/dist/temporal/client.js.map +1 -0
- package/dist/temporal/commande.d.ts +2 -0
- package/dist/temporal/commande.js +95 -0
- package/dist/temporal/commande.js.map +1 -0
- package/dist/temporal/deroules.d.ts +5 -0
- package/dist/temporal/deroules.js +10 -0
- package/dist/temporal/deroules.js.map +1 -0
- package/dist/temporal/etat.d.ts +33 -0
- package/dist/temporal/etat.js +59 -0
- package/dist/temporal/etat.js.map +1 -0
- package/dist/temporal/file/activites.d.ts +10 -0
- package/dist/temporal/file/activites.js +25 -0
- package/dist/temporal/file/activites.js.map +1 -0
- package/dist/temporal/file/client.d.ts +4 -0
- package/dist/temporal/file/client.js +6 -0
- package/dist/temporal/file/client.js.map +1 -0
- package/dist/temporal/file/contrat.d.ts +158 -0
- package/dist/temporal/file/contrat.js +14 -0
- package/dist/temporal/file/contrat.js.map +1 -0
- package/dist/temporal/file/deroule.d.ts +15 -0
- package/dist/temporal/file/deroule.js +235 -0
- package/dist/temporal/file/deroule.js.map +1 -0
- package/dist/temporal/installation.d.ts +124 -0
- package/dist/temporal/installation.js +408 -0
- package/dist/temporal/installation.js.map +1 -0
- package/dist/temporal/places/activites.d.ts +8 -0
- package/dist/temporal/places/activites.js +13 -0
- package/dist/temporal/places/activites.js.map +1 -0
- package/dist/temporal/places/client.d.ts +28 -0
- package/dist/temporal/places/client.js +64 -0
- package/dist/temporal/places/client.js.map +1 -0
- package/dist/temporal/places/contrat.d.ts +106 -0
- package/dist/temporal/places/contrat.js +21 -0
- package/dist/temporal/places/contrat.js.map +1 -0
- package/dist/temporal/places/deroule.d.ts +3 -0
- package/dist/temporal/places/deroule.js +198 -0
- package/dist/temporal/places/deroule.js.map +1 -0
- package/dist/temporal/sonde/activites.d.ts +6 -0
- package/dist/temporal/sonde/activites.js +52 -0
- package/dist/temporal/sonde/activites.js.map +1 -0
- package/dist/temporal/sonde/contrat.d.ts +35 -0
- package/dist/temporal/sonde/contrat.js +10 -0
- package/dist/temporal/sonde/contrat.js.map +1 -0
- package/dist/temporal/sonde/deroule.d.ts +3 -0
- package/dist/temporal/sonde/deroule.js +39 -0
- package/dist/temporal/sonde/deroule.js.map +1 -0
- package/dist/temporal/tickets/activites.d.ts +7 -0
- package/dist/temporal/tickets/activites.js +81 -0
- package/dist/temporal/tickets/activites.js.map +1 -0
- package/dist/temporal/tickets/client.d.ts +10 -0
- package/dist/temporal/tickets/client.js +31 -0
- package/dist/temporal/tickets/client.js.map +1 -0
- package/dist/temporal/tickets/contrat.d.ts +56 -0
- package/dist/temporal/tickets/contrat.js +13 -0
- package/dist/temporal/tickets/contrat.js.map +1 -0
- package/dist/temporal/tickets/deroule.d.ts +3 -0
- package/dist/temporal/tickets/deroule.js +94 -0
- package/dist/temporal/tickets/deroule.js.map +1 -0
- package/dist/temporal/travailleur.d.ts +2 -0
- package/dist/temporal/travailleur.js +69 -0
- package/dist/temporal/travailleur.js.map +1 -0
- package/docs/ARCHITECTURE.md +813 -53
- package/docs/CADRE.md +17 -0
- package/docs/INTERFACE.md +161 -30
- package/hooks/crochet.mjs +19 -2
- package/hooks/hooks.json +11 -0
- package/package.json +16 -4
- package/scripts/activites.mjs +2182 -0
- package/scripts/aiguillage.d.mts +37 -0
- package/scripts/aiguillage.mjs +328 -0
- package/scripts/avancement.mjs +159 -64
- package/scripts/bilan.mjs +37 -19
- package/scripts/cadre.mjs +11 -2
- package/scripts/circuit.mjs +888 -3654
- package/scripts/circuits-cles.d.mts +4 -0
- package/scripts/circuits-cles.mjs +21 -0
- package/scripts/circuits-du-serveur.mjs +105 -0
- package/scripts/codes-de-sortie.mjs +9 -0
- package/scripts/commandes-composees.mjs +45 -41
- package/scripts/commandes-du-path.d.mts +7 -0
- package/scripts/commandes-du-path.mjs +25 -0
- package/scripts/composition-des-langages.mjs +30 -11
- package/scripts/conformite.mjs +19 -10
- package/scripts/copies-finies.mjs +188 -42
- package/scripts/depart-du-ticket.d.mts +53 -0
- package/scripts/depart-du-ticket.mjs +124 -0
- package/scripts/dependances-internes.mjs +115 -0
- package/scripts/dernier-vert.mjs +7 -15
- package/scripts/donnees-cles.mjs +228 -0
- package/scripts/droits.mjs +11 -1
- package/scripts/effets.mjs +352 -0
- package/scripts/enveloppe/enveloppe.mjs +119 -8
- package/scripts/enveloppe/lancer.sh +27 -32
- package/scripts/enveloppe/paquets-du-plan.mjs +2 -2
- package/scripts/enveloppe/travail-de-la-copie.mjs +99 -12
- package/scripts/etapes.mjs +6 -3
- package/scripts/faits-du-circuit.mjs +493 -0
- package/scripts/file-des-tickets.d.mts +21 -0
- package/scripts/file-des-tickets.mjs +58 -0
- package/scripts/flux-des-paquets.mjs +187 -0
- package/scripts/fusion-du-changelog.mjs +0 -1
- package/scripts/gardes-du-cadre.mjs +12 -2
- package/scripts/grillhouse-maj.mjs +16 -7
- package/scripts/integration/file.mjs +477 -422
- package/scripts/integration/integrer.mjs +20 -22
- package/scripts/integration/rejeu.mjs +19 -4
- package/scripts/jointure.d.ts +168 -28
- package/scripts/langages/cargo/commandes.mjs +426 -119
- package/scripts/langages/cargo/composants.mjs +187 -3
- package/scripts/langages/cargo/exemples.mjs +75 -17
- package/scripts/langages/cargo/index.mjs +32 -13
- package/scripts/langages/cargo/migrations/0.28.4-tailles-des-tests.mjs +35 -0
- package/scripts/langages/cargo/sccache.mjs +62 -16
- package/scripts/langages/cargo/squelette.mjs +72 -3
- package/scripts/langages/cargo/tailles-des-tests.mjs +195 -0
- package/scripts/langages/cargo/tests-de-head.mjs +159 -0
- package/scripts/langages/python/commandes.mjs +232 -79
- package/scripts/langages/python/composants.mjs +65 -3
- package/scripts/langages/python/exemples.mjs +21 -12
- package/scripts/langages/python/index.mjs +25 -5
- package/scripts/langages/python/lot.mjs +1 -36
- package/scripts/langages/python/squelette.mjs +119 -17
- package/scripts/langages/typescript/construire.mjs +6 -163
- package/scripts/langages/typescript/exemples.mjs +19 -11
- package/scripts/langages/typescript/frontieres.mjs +1 -1
- package/scripts/langages/typescript/index.mjs +48 -63
- package/scripts/langages/typescript/interfaces-contre-code.mjs +4 -4
- package/scripts/langages/typescript/migrations/0.30.0-prefixe-des-tickets.mjs +63 -0
- package/scripts/langages/typescript/migrations/0.30.0-tailles-des-outils-lourds.mjs +31 -0
- package/scripts/langages/typescript/migrations/0.30.0-titres-nommant-un-ticket.mjs +40 -0
- package/scripts/langages/typescript/mise-a-jour.mjs +1 -2
- package/scripts/langages/typescript/regle-des-tests.mjs +13 -0
- package/scripts/langages/typescript/squelette.mjs +18 -2
- package/scripts/langages/typescript/tailles-des-tests.mjs +40 -9
- package/scripts/langages/typescript/tests-de-nuit.mjs +44 -21
- package/scripts/langages/typescript/tests.mjs +17 -8
- package/scripts/langages/typescript/titres-de-tests.mjs +297 -0
- package/scripts/langages/typescript/turbo-des-paquets.mjs +183 -38
- package/scripts/langages/typescript/verdict.mjs +1 -1
- package/scripts/langages/typescript/verifier.mjs +110 -296
- package/scripts/langages/typescript/vitest-config/base.mjs +30 -10
- package/scripts/langages/typescript/vitest-config/bornes.mjs +13 -0
- package/scripts/langages/typescript/vitest-config/cibles.mjs +123 -62
- package/scripts/langages/typescript/vitest-config/delais.mjs +54 -0
- package/scripts/langages/typescript/vitest-config/delais.setup.mjs +11 -0
- package/scripts/langages/typescript/vitest-config/duree.classement.mjs +100 -0
- package/scripts/langages/typescript/vitest-config/duree.reporter.mjs +56 -64
- package/scripts/langages/typescript/vitest-config/machine.setup.mjs +7 -2
- package/scripts/langages/typescript/vitest-config/mesure.mjs +3 -2
- package/scripts/langages/typescript/vitest.nuit.config.mjs +22 -13
- package/scripts/lecture-unique.mjs +51 -0
- package/scripts/mesure/pression.mjs +11 -9
- package/scripts/mesure-de-la-machine.d.mts +21 -0
- package/scripts/mesure-de-la-machine.mjs +76 -0
- package/scripts/migrations/0.23.2-copies-du-cadre.mjs +8 -2
- package/scripts/migrations/0.30.0-ci-appelle-la-verification.mjs +120 -0
- package/scripts/migrations/0.31.0-paquets-dans-le-graphe.mjs +81 -0
- package/scripts/migrations.mjs +5 -0
- package/scripts/nuit.sh +29 -15
- package/scripts/outil.mjs +72 -0
- package/scripts/outils-cles.d.mts +24 -0
- package/scripts/outils-cles.mjs +0 -1
- package/scripts/paquet-npm.mjs +147 -0
- package/scripts/paquet.mjs +112 -14
- package/scripts/paquets.mjs +34 -6
- package/scripts/passe-de-la-machine.mjs +66 -0
- package/scripts/places-de-la-machine.mjs +360 -0
- package/scripts/places-du-serveur.mjs +170 -0
- package/scripts/prefixe-des-tickets.mjs +68 -0
- package/scripts/preparation.mjs +10 -3
- package/scripts/registre.mjs +3 -2
- package/scripts/regles-des-places.d.mts +36 -0
- package/scripts/regles-des-places.mjs +70 -0
- package/scripts/reponses-du-circuit.d.mts +6 -0
- package/scripts/reponses-du-circuit.mjs +28 -0
- package/scripts/resultats.mjs +29 -14
- package/scripts/retirer-les-copies-finies.mjs +25 -0
- package/scripts/sans-reponse.d.mts +4 -0
- package/scripts/sans-reponse.mjs +13 -0
- package/scripts/seances.mjs +918 -0
- package/scripts/services-du-noyau.mjs +28 -11
- package/scripts/session-start.sh +10 -1
- package/scripts/sortie.mjs +23 -4
- package/scripts/sources.mjs +3 -3
- package/scripts/sous-commandes.mjs +39 -9
- package/scripts/style-a-l-ecriture.mjs +229 -0
- package/scripts/superviseur.mjs +382 -16
- package/scripts/tableau.mjs +329 -130
- package/scripts/taches-du-graphe.mjs +328 -0
- package/scripts/ticket-du-circuit.mjs +206 -0
- package/scripts/transitions.d.mts +148 -0
- package/scripts/transitions.mjs +901 -0
- package/scripts/verrou-de-fichier.mjs +2 -2
- package/scripts/verrou-de-machine.mjs +322 -62
- package/skills/developpeur/SKILL.md +11 -3
- package/skills/explorateur/SKILL.md +2 -1
- package/skills/pitmaster/SKILL.md +62 -28
- package/skills/pitmaster/references/consigne-agent.md +5 -1
- package/skills/release/SKILL.md +3 -3
- package/skills/relecteur/SKILL.md +22 -8
- package/skills/testwriter/SKILL.md +47 -39
- package/scripts/demon.mjs +0 -138
- package/scripts/integration/file-attente.mjs +0 -61
- package/scripts/langages/cargo/touches.mjs +0 -93
- package/scripts/langages/typescript/script-des-tests.mjs +0 -6
|
@@ -0,0 +1,901 @@
|
|
|
1
|
+
// The decisions of the circuit of a ticket (scripts/circuit.mjs), with no input nor output, as a
|
|
2
|
+
// workflow of Temporal decides on the results of its activities and a reducer of Redux on its
|
|
3
|
+
// actions: from the state of the run, the circuit's memory and the facts read so far, the step
|
|
4
|
+
// that follows. The circuit reads the facts and interprets what this module returns; this module
|
|
5
|
+
// reads no file, launches no process and imports no module that does (a guard holds it:
|
|
6
|
+
// tests/unit/transitions.spec.ts).
|
|
7
|
+
//
|
|
8
|
+
// `transition({ etat, memoire, ticket, reprend, faits })`:
|
|
9
|
+
//
|
|
10
|
+
// - `etat`, the run at its step: `{ etape, tentative, rapport, finale, relanceSurLeRefus }`;
|
|
11
|
+
// - `memoire`, what the circuit keeps between steps (`controlesRouges`, `renvoiAuTestwriter`,
|
|
12
|
+
// `refus`, `rienALivrer`, `regeneration`, `regenereSur`, `aRegenerer`, `verifie`, `constats`);
|
|
13
|
+
// - `ticket`, `{ id, paquets, sorte, copie }`;
|
|
14
|
+
// - `reprend`, whether this step is the first of a `--reprendre`;
|
|
15
|
+
// - `faits`, the facts read for this step, by their name.
|
|
16
|
+
//
|
|
17
|
+
// It returns either the next fact to read, `{ besoin: { fait, ...parametres }, effets, memoire }` (a
|
|
18
|
+
// session, a pass, a reading of the copy), which the circuit reads and gives back in `faits` with
|
|
19
|
+
// the same call, `effets` and `memoire` what the step decided before it, so that an engine applies
|
|
20
|
+
// them before the fact and loses none when the fact fails; or the decision: `{ suivant, memoire, effets, arret, fin, usage }`, `suivant` the state of
|
|
21
|
+
// the next step, `memoire` what changes in the circuit's memory, `effets` in their order (a line
|
|
22
|
+
// at the ticket `{ genre: 'commenter', etape, texte }`, a gesture `{ genre: 'geste', nom }`, a
|
|
23
|
+
// report `{ genre: 'rapport', etape, texte, resultat, rapport }`, a result kept
|
|
24
|
+
// `{ genre: 'inscrire', entree, evenement }`, its event named), then a stop `arret` (its name `nom` and its `rapport`, with the
|
|
25
|
+
// options of an Arret of the circuit: `piece`, `question`, `qui`, `rouges`, `motif`, `resultat`,
|
|
26
|
+
// `etape`; or `{ nom, statut: { role, tentative, fiche } }` and `{ nom, horsDuPlan: { tentative,
|
|
27
|
+
// fiche } }`, which the circuit builds with the agent's handover), the end of the run `fin`, or a
|
|
28
|
+
// step the list does not hold `usage`. Each call is played again from the start of its step with
|
|
29
|
+
// the facts read so far, as Temporal replays a workflow on its history: the same facts give the
|
|
30
|
+
// same decision.
|
|
31
|
+
import { A_REPASSER } from './codes-de-sortie.mjs';
|
|
32
|
+
import { ARRETS, boucle, RESPONSABLE, SUITE } from './etapes.mjs';
|
|
33
|
+
|
|
34
|
+
// The steps of the circuit's state, read from the list of the steps.
|
|
35
|
+
const etatDe = n => SUITE.find(e => e.numero === n).etat;
|
|
36
|
+
export const [
|
|
37
|
+
GESTE,
|
|
38
|
+
TESTS,
|
|
39
|
+
PREUVE,
|
|
40
|
+
CODE,
|
|
41
|
+
CONTROLES,
|
|
42
|
+
REFERENCES,
|
|
43
|
+
RELECTURE,
|
|
44
|
+
INTEGRATION,
|
|
45
|
+
EN_FILE,
|
|
46
|
+
TRI,
|
|
47
|
+
] = ['1.1', '2', '2.1', '3', '3.1', '4.2', '4.3', '5.1', '5.2', '5.3'].map(etatDe);
|
|
48
|
+
|
|
49
|
+
// The bounded loops, each declared with its step (scripts/etapes.mjs, `boucles`): the testwriter is
|
|
50
|
+
// relaunched twice at most after a failed proof (three sessions); the developpeur has three
|
|
51
|
+
// sessions, the last on the strong model; the third RENDU of one ticket stops the circuit.
|
|
52
|
+
export const RELANCES_TESTWRITER = boucle('tests').max - 1;
|
|
53
|
+
export const SEANCES_DEVELOPPEUR = boucle('code').max;
|
|
54
|
+
export const RELECTURES = boucle('relecture').max;
|
|
55
|
+
|
|
56
|
+
// What changed for a developpeur relaunched on the integration's refusal of the lot he left as it was.
|
|
57
|
+
export const CHANGE_DU_REFUS =
|
|
58
|
+
'l’intégration refuse ton lot, et ta séance n’a changé aucun fichier du plan : son refus, dans le rapport ci-dessous, est le rouge à lever';
|
|
59
|
+
|
|
60
|
+
// The developpeur's report on the integration's refusal <refus>: the red to lift, which the checks
|
|
61
|
+
// of the copy, green, do not see.
|
|
62
|
+
export const rapportDuRefus = refus =>
|
|
63
|
+
`L’intégration refuse ce lot : son refus, ci-dessous, est le rouge à lever ; les contrôles de ta copie, verts, ne le voient pas, et le lot ne repasse à l’intégration qu’avec un changement.\n\n${refus.rapport}`;
|
|
64
|
+
|
|
65
|
+
// The step after the plan of sort <sorte> (null when the path is not mechanical): the gesture of
|
|
66
|
+
// a mechanical ticket (1.1), in place of the testwriter, the proof and the developpeur; the
|
|
67
|
+
// developpeur of a plan without tests (<sansTests>); else the testwriter.
|
|
68
|
+
export const etapeApresLePlan = ({ sorte, sansTests }) =>
|
|
69
|
+
sorte?.genre === 'mécanique' ? GESTE : sansTests ? CODE : TESTS;
|
|
70
|
+
|
|
71
|
+
// The step after a proof that passes: the developpeur on a red (<rouges>), on a finding of the
|
|
72
|
+
// reviewer still open for him (<pourLeDeveloppeur>), or under a plan « comportement inchangé »
|
|
73
|
+
// (<inchange>), whose lot has code to write though nothing turns red, as a reorganisation does
|
|
74
|
+
// (decision 3, amended by the owner on 2026-11-01); else the checks, a lot of tests alone, with
|
|
75
|
+
// no session of the developpeur.
|
|
76
|
+
export const apresLaPreuve = ({ rouges, pourLeDeveloppeur, inchange }) =>
|
|
77
|
+
rouges > 0 || pourLeDeveloppeur || inchange ? CODE : CONTROLES;
|
|
78
|
+
|
|
79
|
+
// What follows a red of the reading of the copy after the session <tentative> of <role>: the agent
|
|
80
|
+
// again, one attempt used as a red build uses it, or, the attempts used up, the stop « controles »
|
|
81
|
+
// as the red checks.
|
|
82
|
+
export function suiteDuRougeDeLecture(role, tentative) {
|
|
83
|
+
const max = boucle(role === 'testwriter' ? 'tests' : 'code').max;
|
|
84
|
+
return tentative < max ? { etape: role, tentative: tentative + 1 } : { arret: 'controles' };
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// The findings of the reviewer open for <role> among <constats>, in their order.
|
|
88
|
+
export const ouverts = (constats, role) => (constats ?? []).filter(c => c.role === role);
|
|
89
|
+
|
|
90
|
+
// The stop for the findings open (<constats>) that go to the testwriter when the plan skips him
|
|
91
|
+
// (<sansTests>), or null: no new pass treats them, as a CI fails fast on a step it cannot run
|
|
92
|
+
// (grillhouse-26x). A stop `relecture-arret` whose report names each finding, the role skipped
|
|
93
|
+
// and why, then the verdict <texte>; its piece, the findings' pieces; its question, declare the
|
|
94
|
+
// tests of the package or settle the finding.
|
|
95
|
+
export function arretDuTestwriterSaute({ constats, sansTests, paquets }, texte) {
|
|
96
|
+
const auTestwriter = ouverts(constats, 'testwriter');
|
|
97
|
+
if (!auTestwriter.length || !sansTests) {
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
const titres = auTestwriter.map(c => `« ${c.titre} »`).join(', ');
|
|
101
|
+
const plan = paquets.join(', ');
|
|
102
|
+
return {
|
|
103
|
+
nom: 'relecture-arret',
|
|
104
|
+
rapport: `Le relecteur adresse au testwriter ${titres}, quand le plan saute le testwriter : aucun paquet du plan ne joue de tests (${plan}).\n\nLe verdict :\n\n${texte}`,
|
|
105
|
+
piece: auTestwriter.map(c => c.piece ?? c.titre).join('\n'),
|
|
106
|
+
question: `Le constat ${titres} va au testwriter, que le plan (${plan}) saute : déclarer les tests du paquet au cadre, puis \`--reprendre\`, ou trancher le constat (\`--depuis developpeur --contexte\`, ou \`--arreter\`).`,
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// The stop for a RENDU of a mechanical lot (<mecanique>), or null: no testwriter nor developpeur
|
|
111
|
+
// wrote it, so no relaunch treats its findings (<constats>). A stop `relecture-arret`, the verdict
|
|
112
|
+
// <texte> in its report, the findings' pieces as its piece; its question, have the lot corrected
|
|
113
|
+
// by the developpeur or stop the circuit.
|
|
114
|
+
export function arretDuGesteMecanique({ constats, mecanique, sorte }, texte) {
|
|
115
|
+
if (!mecanique) {
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
const pieces = (constats ?? []).map(c => c.piece ?? c.titre).join('\n');
|
|
119
|
+
return {
|
|
120
|
+
nom: 'relecture-arret',
|
|
121
|
+
rapport: `Le relecteur rend un lot mécanique (${sorte.raison}), que la commande du plan a fait sans testwriter ni développeur : le circuit ne relance personne.\n\nLe verdict :\n\n${texte}`,
|
|
122
|
+
piece: pieces || null,
|
|
123
|
+
question: `Le lot mécanique est rendu : le faire corriger par le développeur (\`--depuis developpeur --contexte\`), ou arrêter le circuit (\`--arreter\`) et changer le plan.`,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// The last <n> lines of <t>, a text the circuit gives without its colours.
|
|
128
|
+
const fin = (t, n) =>
|
|
129
|
+
String(t ?? '')
|
|
130
|
+
.split('\n')
|
|
131
|
+
.slice(-n)
|
|
132
|
+
.join('\n');
|
|
133
|
+
|
|
134
|
+
// A fact the decision has not read yet: its name and what reads it.
|
|
135
|
+
class Besoin {
|
|
136
|
+
constructor(fait, parametres) {
|
|
137
|
+
this.fait = fait;
|
|
138
|
+
this.parametres = parametres;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// The plan of a ticket, its decisions as the circuit and the workflow of a ticket take them
|
|
143
|
+
// (grillhouse-4nr.6.3): the step of the plan that follows its state <e> (`{ plan, lu, posees,
|
|
144
|
+
// reponse }`, the explorateur's sheet, the questionneur's, the questions put, the explorateur's
|
|
145
|
+
// answer): `explorateur`, `questionneur`, `reponse` (questions were put), then `conclure`.
|
|
146
|
+
export const pasDuPlan = e =>
|
|
147
|
+
!e.plan
|
|
148
|
+
? 'explorateur'
|
|
149
|
+
: !e.lu
|
|
150
|
+
? 'questionneur'
|
|
151
|
+
: e.posees.length && !e.reponse
|
|
152
|
+
? 'reponse'
|
|
153
|
+
: 'conclure';
|
|
154
|
+
|
|
155
|
+
// The questions the explorateur answers in the questionneur's sheet <lu>: its questions, or its
|
|
156
|
+
// disagreement as one; none for « AUCUNE ».
|
|
157
|
+
export const questionsPosees = lu =>
|
|
158
|
+
lu.issue === 'AUCUNE'
|
|
159
|
+
? []
|
|
160
|
+
: lu.issue === 'DÉSACCORD'
|
|
161
|
+
? [lu.desaccord]
|
|
162
|
+
: lu.questions.map(q => q.question);
|
|
163
|
+
|
|
164
|
+
// What stays open of the plan <plan> once the explorateur answered <reponses> to the questions
|
|
165
|
+
// <posees>: the plan's own questions, then each question put left without its answer.
|
|
166
|
+
export const ouvertesDuPlan = (plan, posees, reponses) => [
|
|
167
|
+
...plan.questions,
|
|
168
|
+
...posees
|
|
169
|
+
.filter((_q, i) => !reponses.some(r => Number(r.numero) === i + 1))
|
|
170
|
+
.map(question => ({ question, piece: 'question du questionneur, sans réponse' })),
|
|
171
|
+
];
|
|
172
|
+
|
|
173
|
+
// The effects <effets> an act gave back as the workflow plays them (scripts/effets.mjs), in their
|
|
174
|
+
// order: a state followed by another state is not played, since the state is written whole and
|
|
175
|
+
// nothing reads it between the two.
|
|
176
|
+
export const effetsAJouer = effets =>
|
|
177
|
+
effets.filter((e, i) => !(e.genre === 'etat' && effets[i + 1]?.genre === 'etat'));
|
|
178
|
+
|
|
179
|
+
// The text <t> without the escape sequences of a terminal (colours, ECMA-48 CSI and OSC), as
|
|
180
|
+
// `stripVTControlCharacters` of node:util removes them; written here, since the workflow of a
|
|
181
|
+
// ticket imports this module and a workflow imports no module of node.
|
|
182
|
+
const SEQUENCES = new RegExp(
|
|
183
|
+
String.raw`\u001b(?:\[[0-?]*[ -/]*[@-~]|\][^\u0007\u001b]*(?:\u0007|\u001b\\)|[@-Z\\-_])`,
|
|
184
|
+
'g'
|
|
185
|
+
);
|
|
186
|
+
const sansLesCodes = t => String(t ?? '').replace(SEQUENCES, '');
|
|
187
|
+
|
|
188
|
+
// The stop « inattendu » at the step <etat> that no act could write at the ticket (the act of the
|
|
189
|
+
// stop itself failed, its message <message>), as the workflow of a ticket under Temporal publishes
|
|
190
|
+
// it in its memo alone (src/temporal/circuit/deroule.ts): `{ code, nom, question, etat }`. Its
|
|
191
|
+
// question names the cause, the first line of <message>, since it is all the supervisor reads;
|
|
192
|
+
// the codes of colour of a command's output go (`sansLesCodes`).
|
|
193
|
+
export const arretSansActe = (etat, message, ou) => ({
|
|
194
|
+
code: ARRETS.inattendu,
|
|
195
|
+
nom: 'inattendu',
|
|
196
|
+
question: {
|
|
197
|
+
arret: 'inattendu',
|
|
198
|
+
fait: `L'arrêt de l'étape « ${etat.etape} » ne s'écrit pas au ticket : ${sansLesCodes(message)}`,
|
|
199
|
+
piece: ou,
|
|
200
|
+
question: `L'arrêt de l'étape « ${etat.etape} » ne s'écrit pas au ticket : ${
|
|
201
|
+
sansLesCodes(message)
|
|
202
|
+
.split('\n')
|
|
203
|
+
.find(l => l.trim())
|
|
204
|
+
?.trim() ?? 'sans message'
|
|
205
|
+
}. Lever la cause, puis reprendre le circuit (--reprendre) ou l’arrêter (--arreter).`,
|
|
206
|
+
qui: 'superviseur',
|
|
207
|
+
},
|
|
208
|
+
etat: { ...etat, raison: 'inattendu' },
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
// The decision of the step of <entree> (see the header), or the next fact it needs.
|
|
212
|
+
export function transition(entree) {
|
|
213
|
+
const faits = entree.faits ?? {};
|
|
214
|
+
const lire = (fait, parametres = {}) => {
|
|
215
|
+
if (fait in faits) {
|
|
216
|
+
return faits[fait];
|
|
217
|
+
}
|
|
218
|
+
throw new Besoin(fait, parametres);
|
|
219
|
+
};
|
|
220
|
+
// What the step decided before the fact it needs.
|
|
221
|
+
const partiel = { effets: [], maj: {} };
|
|
222
|
+
try {
|
|
223
|
+
return decider(entree, lire, partiel);
|
|
224
|
+
} catch (e) {
|
|
225
|
+
if (e instanceof Besoin) {
|
|
226
|
+
return {
|
|
227
|
+
besoin: { fait: e.fait, ...e.parametres },
|
|
228
|
+
effets: [...partiel.effets],
|
|
229
|
+
memoire: { ...partiel.maj },
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
throw e;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
function decider({ etat, memoire = {}, ticket, reprend = false }, lire, partiel) {
|
|
237
|
+
let { etape, tentative, rapport, finale } = etat;
|
|
238
|
+
let relanceSurLeRefus = Boolean(etat.relanceSurLeRefus);
|
|
239
|
+
const maj = {};
|
|
240
|
+
// The memory as this decision leaves it so far.
|
|
241
|
+
const m = cle => (cle in maj ? maj[cle] : (memoire[cle] ?? null));
|
|
242
|
+
const effets = [];
|
|
243
|
+
partiel.effets = effets;
|
|
244
|
+
partiel.maj = maj;
|
|
245
|
+
const commenter = (lieu, texte) => effets.push({ genre: 'commenter', etape: lieu, texte });
|
|
246
|
+
const geste = nom => effets.push({ genre: 'geste', nom });
|
|
247
|
+
const ecrireRapport = (lieu, texte, resultat, r = texte) =>
|
|
248
|
+
effets.push({ genre: 'rapport', etape: lieu, texte, resultat, rapport: r });
|
|
249
|
+
const inscrire = (entree, evenement) => effets.push({ genre: 'inscrire', entree, evenement });
|
|
250
|
+
const decision = (extra = {}) => ({
|
|
251
|
+
suivant: { etape, tentative, rapport, finale, relanceSurLeRefus },
|
|
252
|
+
memoire: maj,
|
|
253
|
+
effets,
|
|
254
|
+
...extra,
|
|
255
|
+
});
|
|
256
|
+
const arreter = (nom, r, options = {}) => decision({ arret: { nom, rapport: r, ...options } });
|
|
257
|
+
const plan = ticket.paquets.join(', ');
|
|
258
|
+
|
|
259
|
+
// After the plan: the gesture of a mechanical ticket, the developpeur of a plan without tests,
|
|
260
|
+
// else the testwriter.
|
|
261
|
+
const route =
|
|
262
|
+
etape === TESTS
|
|
263
|
+
? etapeApresLePlan({
|
|
264
|
+
sorte: lire('mecanique') ? ticket.sorte : null,
|
|
265
|
+
sansTests: lire('sansTests'),
|
|
266
|
+
})
|
|
267
|
+
: null;
|
|
268
|
+
if (route === GESTE) {
|
|
269
|
+
geste('mecanique');
|
|
270
|
+
etape = GESTE;
|
|
271
|
+
tentative = 1;
|
|
272
|
+
return decision();
|
|
273
|
+
}
|
|
274
|
+
if (etape === GESTE) {
|
|
275
|
+
if (reprend && lire('livreAvant')) {
|
|
276
|
+
// The copy already carries the gesture (the supervisor played the command himself).
|
|
277
|
+
commenter(
|
|
278
|
+
'mecanique',
|
|
279
|
+
'la copie porte déjà un changement du plan : le geste ne rejoue pas, aux contrôles.'
|
|
280
|
+
);
|
|
281
|
+
} else {
|
|
282
|
+
const fiche = lire('seanceDuGeste');
|
|
283
|
+
if (fiche.statut !== 'FAIT') {
|
|
284
|
+
return decision({
|
|
285
|
+
arret: { nom: nomDuStatut(fiche), statut: { role: 'explorateur', tentative, fiche } },
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
if (!lire('livre')) {
|
|
289
|
+
return arreter(
|
|
290
|
+
'sans-livraison',
|
|
291
|
+
`Le geste mécanique ne change aucun fichier du plan (${plan}) : la commande du plan, \`${ticket.sorte.commande}\`, n'a rien changé dans la copie.`,
|
|
292
|
+
{ piece: `$ ${ticket.sorte.commande}\naucun fichier du plan changé dans ${ticket.copie}` }
|
|
293
|
+
);
|
|
294
|
+
}
|
|
295
|
+
commenter('mecanique', 'la commande du plan a joué dans la copie : aux contrôles.');
|
|
296
|
+
}
|
|
297
|
+
etape = CONTROLES;
|
|
298
|
+
tentative = 0;
|
|
299
|
+
return decision();
|
|
300
|
+
}
|
|
301
|
+
if (route === CODE) {
|
|
302
|
+
commenter(
|
|
303
|
+
'testwriter',
|
|
304
|
+
'aucun test dans le plan (aucun paquet qui joue des tests ne le tient) : ni testwriter ni preuve, le développeur directement.'
|
|
305
|
+
);
|
|
306
|
+
rapport = [
|
|
307
|
+
`Le plan (${plan}) ne porte aucun test (aucun paquet qui joue des tests ne le tient) : le circuit te lance sans testwriter ni preuve. Tu écris le ticket d'après ses critères ; les contrôles suivent ta séance.`,
|
|
308
|
+
rapport,
|
|
309
|
+
]
|
|
310
|
+
.filter(Boolean)
|
|
311
|
+
.join('\n\n');
|
|
312
|
+
etape = CODE;
|
|
313
|
+
tentative = 1;
|
|
314
|
+
return decision();
|
|
315
|
+
}
|
|
316
|
+
if (etape === TESTS) {
|
|
317
|
+
const fiche = lire('seance', {
|
|
318
|
+
role: 'testwriter',
|
|
319
|
+
tentative,
|
|
320
|
+
rapport,
|
|
321
|
+
derniere: tentative > RELANCES_TESTWRITER,
|
|
322
|
+
});
|
|
323
|
+
// A testwriter who declares himself blocked or in need of an answer goes up to the supervisor.
|
|
324
|
+
if (fiche.statut !== 'FAIT') {
|
|
325
|
+
return decision({
|
|
326
|
+
arret: { nom: nomDuStatut(fiche), statut: { role: 'testwriter', tentative, fiche } },
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
// No checks have run since this session.
|
|
330
|
+
maj.controlesRouges = null;
|
|
331
|
+
commenter('testwriter', `séance ${tentative} finie, sa fiche lue.`);
|
|
332
|
+
// A copy the module of the language no longer reads is a red of the testwriter.
|
|
333
|
+
const illisible = lire('lecture');
|
|
334
|
+
if (illisible) {
|
|
335
|
+
const suite = suiteDuRougeDeLecture('testwriter', tentative);
|
|
336
|
+
if (suite.arret) {
|
|
337
|
+
return arreter(suite.arret, illisible.rapport);
|
|
338
|
+
}
|
|
339
|
+
commenter(
|
|
340
|
+
'testwriter',
|
|
341
|
+
`la copie ne se lit plus ; testwriter relancé (séance ${suite.tentative}).\n\n${illisible.rapport}`
|
|
342
|
+
);
|
|
343
|
+
etape = TESTS;
|
|
344
|
+
tentative = suite.tentative;
|
|
345
|
+
rapport = illisible.rapport;
|
|
346
|
+
return decision();
|
|
347
|
+
}
|
|
348
|
+
etape = PREUVE;
|
|
349
|
+
return decision();
|
|
350
|
+
}
|
|
351
|
+
if (etape === PREUVE) {
|
|
352
|
+
const p = lire('preuve');
|
|
353
|
+
rapport = p.texte;
|
|
354
|
+
if (p.ok) {
|
|
355
|
+
// A finding of the reviewer still open for the developpeur launches him, red or not.
|
|
356
|
+
const pourLui = ouverts(m('constats'), 'developpeur').length > 0;
|
|
357
|
+
const inchange = Boolean(ticket.sorte?.inchange);
|
|
358
|
+
const auDeveloppeur =
|
|
359
|
+
apresLaPreuve({ rouges: p.rouges, pourLeDeveloppeur: pourLui, inchange }) === CODE;
|
|
360
|
+
const suite = p.rouges
|
|
361
|
+
? 'au développeur'
|
|
362
|
+
: pourLui
|
|
363
|
+
? 'aucun rouge ; au développeur, que nomme un constat du relecteur'
|
|
364
|
+
: inchange
|
|
365
|
+
? 'aucun rouge : le plan dit « comportement inchangé », au développeur'
|
|
366
|
+
: 'aucun rouge : un lot de tests seul, aux contrôles';
|
|
367
|
+
ecrireRapport('preuve', `${p.resume} ; ${suite}.\n\n${p.texte}`, p.resultat);
|
|
368
|
+
etape = auDeveloppeur ? CODE : CONTROLES;
|
|
369
|
+
tentative = auDeveloppeur ? 1 : 0;
|
|
370
|
+
return decision();
|
|
371
|
+
}
|
|
372
|
+
if (tentative <= RELANCES_TESTWRITER) {
|
|
373
|
+
ecrireRapport(
|
|
374
|
+
'preuve',
|
|
375
|
+
`${p.resume} ; testwriter relancé (séance ${tentative + 1}).\n\n${p.texte}`,
|
|
376
|
+
p.resultat
|
|
377
|
+
);
|
|
378
|
+
etape = TESTS;
|
|
379
|
+
tentative++;
|
|
380
|
+
return decision();
|
|
381
|
+
}
|
|
382
|
+
return arreter('preuve', p.texte, { resultat: p.resultat });
|
|
383
|
+
}
|
|
384
|
+
if (etape === CODE) {
|
|
385
|
+
return code();
|
|
386
|
+
}
|
|
387
|
+
if (etape === CONTROLES) {
|
|
388
|
+
return controles();
|
|
389
|
+
}
|
|
390
|
+
if (etape === REFERENCES) {
|
|
391
|
+
return references();
|
|
392
|
+
}
|
|
393
|
+
if (etape === RELECTURE) {
|
|
394
|
+
return relecture();
|
|
395
|
+
}
|
|
396
|
+
if (etape === INTEGRATION) {
|
|
397
|
+
const r = lire('integration');
|
|
398
|
+
if (r.code === A_REPASSER) {
|
|
399
|
+
return arreter('a-repasser', fin(r.sortie, 40));
|
|
400
|
+
}
|
|
401
|
+
if (r.code !== 0) {
|
|
402
|
+
return refuser(
|
|
403
|
+
`Le script d'intégration refuse le lot (code ${r.code}).\n\n${fin(r.sortie, 60)}`,
|
|
404
|
+
`$ ${r.commande}\n${fin(r.sortie, 30)}`
|
|
405
|
+
);
|
|
406
|
+
}
|
|
407
|
+
maj.refus = null;
|
|
408
|
+
const branche = `agent/${ticket.id}`;
|
|
409
|
+
const commit = lire('commit');
|
|
410
|
+
commenter(
|
|
411
|
+
'integration',
|
|
412
|
+
`${commit ? `commit ${commit} sur ${branche}` : 'lot commité'} ; la branche est en file.`
|
|
413
|
+
);
|
|
414
|
+
etape = EN_FILE;
|
|
415
|
+
return decision();
|
|
416
|
+
}
|
|
417
|
+
if (etape === EN_FILE) {
|
|
418
|
+
const f = lire('file');
|
|
419
|
+
if (f.etat === 'ferme') {
|
|
420
|
+
commenter('file', `${f.raison}.`);
|
|
421
|
+
etape = TRI;
|
|
422
|
+
return decision();
|
|
423
|
+
}
|
|
424
|
+
if (f.etat === 'en-file') {
|
|
425
|
+
return arreter('a-repasser', f.raison);
|
|
426
|
+
}
|
|
427
|
+
return refuser(`La file rouvre le ticket.\n\n${f.raison}`, f.raison);
|
|
428
|
+
}
|
|
429
|
+
if (etape === TRI) {
|
|
430
|
+
// The lot is on main: the tri of its discoveries, which neither stops nor undoes it.
|
|
431
|
+
lire('tri');
|
|
432
|
+
return decision({ fin: { code: 0 } });
|
|
433
|
+
}
|
|
434
|
+
return decision({ usage: `étape inconnue dans l'état : ${etape}` });
|
|
435
|
+
|
|
436
|
+
// The stop « integration » of the motive <motif> and the piece <piece>, the refusal of the lot
|
|
437
|
+
// kept in the memory (`refus`: `{ rapport, piece, empreinte, lance, relance }`, the fingerprint
|
|
438
|
+
// of the plan refused, whether a --depuis developpeur launched the developpeur on it, and whether
|
|
439
|
+
// a session so launched already left it unchanged once), which --depuis developpeur gives the
|
|
440
|
+
// developpeur.
|
|
441
|
+
function refuser(motif, piece) {
|
|
442
|
+
maj.refus = {
|
|
443
|
+
rapport: motif,
|
|
444
|
+
piece,
|
|
445
|
+
empreinte: lire('empreinte'),
|
|
446
|
+
lance: false,
|
|
447
|
+
relance: false,
|
|
448
|
+
};
|
|
449
|
+
return arreter('integration', motif, { piece });
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
function code() {
|
|
453
|
+
const fort = tentative >= SEANCES_DEVELOPPEUR;
|
|
454
|
+
const avant = lire('empreinteAvant');
|
|
455
|
+
const fiche = lire('seance', {
|
|
456
|
+
role: 'developpeur',
|
|
457
|
+
tentative,
|
|
458
|
+
rapport,
|
|
459
|
+
fort,
|
|
460
|
+
derniere: fort,
|
|
461
|
+
change: relanceSurLeRefus ? CHANGE_DU_REFUS : undefined,
|
|
462
|
+
});
|
|
463
|
+
relanceSurLeRefus = false;
|
|
464
|
+
const fortement = fort ? ' (opus, effort high)' : '';
|
|
465
|
+
// A question goes up to the supervisor; a red out of reach, to the testwriter its sheet sends
|
|
466
|
+
// it to, else up to the supervisor.
|
|
467
|
+
if (fiche.statut === 'BESOIN') {
|
|
468
|
+
return decision({
|
|
469
|
+
arret: { nom: 'besoin', statut: { role: 'developpeur', tentative, fiche } },
|
|
470
|
+
});
|
|
471
|
+
}
|
|
472
|
+
const renvoi = lire('renvoi');
|
|
473
|
+
if (renvoi) {
|
|
474
|
+
// The red that remains lies in the tests of the lot: the gesture `renvoi-au-testwriter`,
|
|
475
|
+
// the testwriter, the sending and the handover as its report, then the proof and the
|
|
476
|
+
// developpeur. `renvoiAuTestwriter` keeps the red output of the checks the sending before
|
|
477
|
+
// carried ('' for none), null after green checks: the same output twice in a row is a
|
|
478
|
+
// round trip without a new fact.
|
|
479
|
+
const sortie = m('controlesRouges') ?? '';
|
|
480
|
+
if (m('renvoiAuTestwriter') === sortie) {
|
|
481
|
+
if (lire('empreinte') === avant) {
|
|
482
|
+
inscrire({ etape: CODE, inchange: true }, 'inchange');
|
|
483
|
+
}
|
|
484
|
+
return arreter(
|
|
485
|
+
'sans-livraison',
|
|
486
|
+
`La fiche de la séance ${tentative} du développeur renvoie une deuxième fois de suite au testwriter, sur la même sortie rouge des contrôles que le premier renvoi (aucune, ou la même), sans contrôles verts entre eux : le testwriter n'a pas levé ce rouge.\n\n${renvoi}`
|
|
487
|
+
);
|
|
488
|
+
}
|
|
489
|
+
maj.renvoiAuTestwriter = sortie;
|
|
490
|
+
commenter(
|
|
491
|
+
'developpeur',
|
|
492
|
+
`séance ${tentative}${fortement} finie ; sa fiche renvoie le rouge au testwriter : le circuit relance le testwriter, puis la preuve et le développeur.`
|
|
493
|
+
);
|
|
494
|
+
geste('renvoi-au-testwriter');
|
|
495
|
+
etape = TESTS;
|
|
496
|
+
tentative = 1;
|
|
497
|
+
rapport = renvoi;
|
|
498
|
+
finale = false;
|
|
499
|
+
return decision();
|
|
500
|
+
}
|
|
501
|
+
if (fiche.statut === 'BLOQUÉ') {
|
|
502
|
+
return decision({
|
|
503
|
+
arret: { nom: 'hors-portee', statut: { role: 'developpeur', tentative, fiche } },
|
|
504
|
+
});
|
|
505
|
+
}
|
|
506
|
+
if (fiche.hors_plan?.length) {
|
|
507
|
+
return decision({ arret: { nom: 'hors-portee', horsDuPlan: { tentative, fiche } } });
|
|
508
|
+
}
|
|
509
|
+
// A copy the module of the language no longer reads is a red of the developpeur.
|
|
510
|
+
const illisible = lire('lecture');
|
|
511
|
+
if (illisible) {
|
|
512
|
+
const suite = suiteDuRougeDeLecture('developpeur', tentative);
|
|
513
|
+
if (suite.arret) {
|
|
514
|
+
return arreter(suite.arret, illisible.rapport);
|
|
515
|
+
}
|
|
516
|
+
commenter(
|
|
517
|
+
'developpeur',
|
|
518
|
+
`séance ${tentative} finie ; la copie ne se lit plus, développeur relancé (séance ${suite.tentative}).\n\n${illisible.rapport}`
|
|
519
|
+
);
|
|
520
|
+
tentative = suite.tentative;
|
|
521
|
+
rapport = illisible.rapport;
|
|
522
|
+
return decision();
|
|
523
|
+
}
|
|
524
|
+
const inchangee = lire('empreinte') === avant;
|
|
525
|
+
const refus = m('refus');
|
|
526
|
+
if (inchangee && refus?.lance && refus.empreinte === avant) {
|
|
527
|
+
// The lot the integration refused, unchanged: as a merge queue lets a lot pass again only
|
|
528
|
+
// with a change, neither the gesture `rien-a-livrer` nor the checks of the copy, which
|
|
529
|
+
// the refusal does not see; the developpeur relaunched once with the refusal, then the
|
|
530
|
+
// stop goes up.
|
|
531
|
+
inscrire({ etape: CODE, inchange: true }, 'inchange');
|
|
532
|
+
if (refus.relance) {
|
|
533
|
+
return arreter(
|
|
534
|
+
'sans-livraison',
|
|
535
|
+
`La séance ${tentative} du développeur ne change aucun fichier du plan (${plan}), une seconde fois sur le lot que l'intégration refuse.\n\n${refus.rapport}`,
|
|
536
|
+
{ piece: refus.piece }
|
|
537
|
+
);
|
|
538
|
+
}
|
|
539
|
+
maj.refus = { ...refus, relance: true };
|
|
540
|
+
commenter(
|
|
541
|
+
'developpeur',
|
|
542
|
+
`séance ${tentative}${fortement} finie sans changement, sur le lot que l'intégration refuse : le circuit le relance une fois, le refus comme rapport.`
|
|
543
|
+
);
|
|
544
|
+
tentative++;
|
|
545
|
+
rapport = rapportDuRefus(refus);
|
|
546
|
+
relanceSurLeRefus = true;
|
|
547
|
+
return decision();
|
|
548
|
+
}
|
|
549
|
+
if (inchangee && reprend && lire('livre')) {
|
|
550
|
+
// A resumed developpeur that finds the lot delivered: the checks judge it.
|
|
551
|
+
commenter(
|
|
552
|
+
'developpeur',
|
|
553
|
+
`séance ${tentative} reprise sans changement, le plan garde la livraison d'avant : aux contrôles.`
|
|
554
|
+
);
|
|
555
|
+
inscrire({ etape: CODE, inchange: true }, 'inchange');
|
|
556
|
+
} else if (inchangee) {
|
|
557
|
+
// Nothing to deliver: the gesture `rien-a-livrer`, the checks judge the lot; red, the
|
|
558
|
+
// stop goes up.
|
|
559
|
+
geste('rien-a-livrer');
|
|
560
|
+
inscrire({ etape: CODE, inchange: true }, 'inchange');
|
|
561
|
+
maj.rienALivrer = `La séance ${tentative} du développeur ne change aucun fichier du plan (${plan}), et les contrôles restent rouges. Sa passation au ticket dit pourquoi :\n\n${lire('passation') ?? 'aucune'}`;
|
|
562
|
+
}
|
|
563
|
+
commenter('developpeur', `séance ${tentative}${fortement} finie, sa fiche lue.`);
|
|
564
|
+
etape = CONTROLES;
|
|
565
|
+
return decision();
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
function controles() {
|
|
569
|
+
const passeFinale = finale;
|
|
570
|
+
// 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 whole,
|
|
572
|
+
// or restricted to what changed since the last review. The checks of the plan after a
|
|
573
|
+
// regeneration that changed nothing: none plays, the reds of the checks before standing.
|
|
574
|
+
const regeneration = m('regeneration');
|
|
575
|
+
maj.regeneration = null;
|
|
576
|
+
const passe = !passeFinale
|
|
577
|
+
? { arbre: null, restreinte: null }
|
|
578
|
+
: regeneration
|
|
579
|
+
? { arbre: lire('arbreAvant'), restreinte: regeneration.restreinte }
|
|
580
|
+
: lire('passeFinale');
|
|
581
|
+
const k = lire('controles', {
|
|
582
|
+
finale: passeFinale,
|
|
583
|
+
restreinte: passe.restreinte,
|
|
584
|
+
reportes: regeneration?.reportes ?? null,
|
|
585
|
+
});
|
|
586
|
+
// The output of these checks, red, which a sending to the testwriter carries.
|
|
587
|
+
maj.controlesRouges = k.rouge ? k.texte : null;
|
|
588
|
+
// The outcome the bilan reads (scripts/bilan.mjs): with the reds, each its place and its
|
|
589
|
+
// text, by which it knows two checks that measured the same thing.
|
|
590
|
+
const resultat = issue => ({
|
|
591
|
+
issue,
|
|
592
|
+
finale: passeFinale,
|
|
593
|
+
rouges: k.rouges.map(r => `${r.paquet} : ${r.texte}`),
|
|
594
|
+
});
|
|
595
|
+
rapport = k.texte;
|
|
596
|
+
// A developpeur who had nothing to deliver before these checks.
|
|
597
|
+
const rien = m('rienALivrer');
|
|
598
|
+
maj.rienALivrer = null;
|
|
599
|
+
// A stop of the checks: <phrase>, then the report, its reds also kept apart, as its piece;
|
|
600
|
+
// the stop kept at the checks keeps their outcome.
|
|
601
|
+
const arret = (nom, phrase, lieu = null) => {
|
|
602
|
+
const avant = phrase ? `${phrase}\n\n` : '';
|
|
603
|
+
return arreter(nom, `${avant}${k.complet}`, {
|
|
604
|
+
rouges: k.rouges,
|
|
605
|
+
motif: `${avant}${k.sansListe}`,
|
|
606
|
+
etape: lieu,
|
|
607
|
+
resultat: lieu ? null : resultat(nom === 'a-repasser' ? 'a-repasser' : 'rouge'),
|
|
608
|
+
});
|
|
609
|
+
};
|
|
610
|
+
const suivante = tentative + 1;
|
|
611
|
+
const regenereSur = m('regenereSur');
|
|
612
|
+
// A final pass with a red of a reference, mixed with others or not, or a debt the lot
|
|
613
|
+
// lowers: their regeneration, once for this pass, but for a reference the checks had
|
|
614
|
+
// regenerated on this same tree, whose inputs have not changed since; the reds that remain
|
|
615
|
+
// then go each to its owner.
|
|
616
|
+
const dejaRegenerees = regenereSur && regenereSur.arbre === passe.arbre ? regenereSur.noms : [];
|
|
617
|
+
const aRegenerer =
|
|
618
|
+
passeFinale && !regeneration && (k.rouge || k.notes.length > 0)
|
|
619
|
+
? lire('referencesDesRouges', { lieux: k.lieux, aElaguer: k.notes.length > 0 }).filter(
|
|
620
|
+
r => !dejaRegenerees.includes(r.nom)
|
|
621
|
+
)
|
|
622
|
+
: [];
|
|
623
|
+
// The checks of the plan with a red of a reference, mixed with others or not: its
|
|
624
|
+
// regeneration before any red goes to the developpeur, as Bazel builds a genrule before the
|
|
625
|
+
// tests that read it, but for a reference regenerated on this same tree; mixed with other
|
|
626
|
+
// reds, the checks of the plan play again on the regenerated tree, which judges a test
|
|
627
|
+
// that reads the reference; alone, the final pass that is due (BPScript 320.6.5: a test
|
|
628
|
+
// that reads the turbo.json, red beside their guard, sent to the developpeur, who could not
|
|
629
|
+
// write them).
|
|
630
|
+
const regenereesAuxControles =
|
|
631
|
+
!passeFinale && k.references.length && regenereSur?.arbre === lire('arbreApres')
|
|
632
|
+
? regenereSur.noms
|
|
633
|
+
: [];
|
|
634
|
+
const avantLesControles = passeFinale
|
|
635
|
+
? []
|
|
636
|
+
: k.references.filter(r => !regenereesAuxControles.includes(r.nom));
|
|
637
|
+
if (avantLesControles.length) {
|
|
638
|
+
const noms = avantLesControles.map(r => r.nom);
|
|
639
|
+
const meles = k.rouge || k.aRepasser;
|
|
640
|
+
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'}.`;
|
|
642
|
+
ecrireRapport(
|
|
643
|
+
'controles',
|
|
644
|
+
phrase,
|
|
645
|
+
resultat(meles ? 'rouge' : 'vert'),
|
|
646
|
+
meles ? `${k.texte}${k.avertissements}` : `${phrase}${k.avertissements}`
|
|
647
|
+
);
|
|
648
|
+
// Mixed, the developpeur who had nothing to deliver, for the checks of the plan that
|
|
649
|
+
// follow; green, the final pass, its sessions counted apart, which a developpeur with
|
|
650
|
+
// nothing to deliver before green checks does not concern.
|
|
651
|
+
if (meles) {
|
|
652
|
+
maj.rienALivrer = rien;
|
|
653
|
+
} else {
|
|
654
|
+
maj.renvoiAuTestwriter = null;
|
|
655
|
+
tentative = 0;
|
|
656
|
+
}
|
|
657
|
+
// The report of the reds of the plan, which go to the developpeur when a command of the
|
|
658
|
+
// project refuses the lot, as at the final pass (BPScript 320.10).
|
|
659
|
+
maj.aRegenerer = {
|
|
660
|
+
noms,
|
|
661
|
+
notes: [],
|
|
662
|
+
suite: meles ? 'controles' : 'passe',
|
|
663
|
+
rouges: meles ? k.tous : [],
|
|
664
|
+
auDeveloppeur: meles && k.auDeveloppeur && !k.arbitrer ? k.texte : null,
|
|
665
|
+
};
|
|
666
|
+
etape = REFERENCES;
|
|
667
|
+
finale = true;
|
|
668
|
+
return decision();
|
|
669
|
+
}
|
|
670
|
+
if (aRegenerer.length) {
|
|
671
|
+
const noms = aRegenerer.map(r => r.nom);
|
|
672
|
+
geste('regeneration');
|
|
673
|
+
ecrireRapport(
|
|
674
|
+
'controles',
|
|
675
|
+
`${k.resume} ; ${k.rouge ? 'des rouges sont ceux de références' : 'la dette des gardes baisse'} (${noms.join(', ')}) : à leur régénération.`,
|
|
676
|
+
resultat(k.rouge ? 'rouge' : 'vert'),
|
|
677
|
+
`${k.texte}${k.avertissements}`
|
|
678
|
+
);
|
|
679
|
+
// The report of the reds of the plan, which go to the developpeur when a command of the
|
|
680
|
+
// project refuses the lot.
|
|
681
|
+
maj.aRegenerer = {
|
|
682
|
+
noms,
|
|
683
|
+
rouges: k.tous,
|
|
684
|
+
notes: k.notes,
|
|
685
|
+
entiere: !passe.restreinte,
|
|
686
|
+
auDeveloppeur: k.auDeveloppeur && !k.arbitrer ? k.texte : null,
|
|
687
|
+
};
|
|
688
|
+
etape = REFERENCES;
|
|
689
|
+
finale = true;
|
|
690
|
+
return decision();
|
|
691
|
+
}
|
|
692
|
+
if (k.rouge && passeFinale && k.horsTitre.length) {
|
|
693
|
+
return arret(
|
|
694
|
+
'controles',
|
|
695
|
+
`La passe finale est rouge dans ${k.horsTitre.join(', ')}, hors du plan du ticket (${plan}) : le développeur n'est pas relancé. Le superviseur étend le plan à ce paquet (\`--etendre\`), le rouge allant ensuite au développeur, ou fait corriger le lot (\`--depuis developpeur\`, le rouge en \`--contexte\`).`
|
|
696
|
+
);
|
|
697
|
+
}
|
|
698
|
+
if (k.rouge && !k.auDeveloppeur) {
|
|
699
|
+
return arret(
|
|
700
|
+
'controles',
|
|
701
|
+
`Aucun paquet du plan (${plan}) ne tient ce rouge de la passe finale (un rouge de la racine, ou que rien ne situe).`
|
|
702
|
+
);
|
|
703
|
+
}
|
|
704
|
+
if (k.rouge && k.arbitrer) {
|
|
705
|
+
return arret(
|
|
706
|
+
'controles',
|
|
707
|
+
'Les rouges du plan sont des constats à arbitrer : aucun développeur ne les tranche.'
|
|
708
|
+
);
|
|
709
|
+
}
|
|
710
|
+
if (k.rouge && lire('mecanique')) {
|
|
711
|
+
// A mechanical lot: no testwriter nor developpeur lifts the red of its command.
|
|
712
|
+
return arret(
|
|
713
|
+
'controles',
|
|
714
|
+
`Le ticket est mécanique (${ticket.sorte.raison}) : ni testwriter ni développeur ne lève ce rouge du lot de sa commande. Le superviseur fait corriger le lot (\`--depuis developpeur\`, le rouge en \`--contexte\`), corrige le geste dans la copie puis \`--reprendre\`, ou arrête le circuit (\`--arreter\`).`
|
|
715
|
+
);
|
|
716
|
+
}
|
|
717
|
+
// The stop stands at the developpeur's step, which a resumption plays again.
|
|
718
|
+
if (k.rouge && rien) {
|
|
719
|
+
return arret('sans-livraison', rien, CODE);
|
|
720
|
+
}
|
|
721
|
+
if (k.rouge && suivante <= SEANCES_DEVELOPPEUR) {
|
|
722
|
+
ecrireRapport(
|
|
723
|
+
'controles',
|
|
724
|
+
`${k.resume} ; développeur relancé (séance ${suivante}).`,
|
|
725
|
+
resultat('rouge'),
|
|
726
|
+
`${k.texte}${k.avertissements}`
|
|
727
|
+
);
|
|
728
|
+
etape = CODE;
|
|
729
|
+
tentative = suivante;
|
|
730
|
+
return decision();
|
|
731
|
+
}
|
|
732
|
+
if (k.rouge) {
|
|
733
|
+
return arret('controles', null);
|
|
734
|
+
}
|
|
735
|
+
if (k.aRepasser) {
|
|
736
|
+
return arret('a-repasser', null);
|
|
737
|
+
}
|
|
738
|
+
ecrireRapport('controles', `${k.resume}.`, resultat('vert'), `${k.resume}.${k.avertissements}`);
|
|
739
|
+
// Green checks: a sending of the developpeur to the testwriter may come again.
|
|
740
|
+
maj.renvoiAuTestwriter = null;
|
|
741
|
+
if (!passeFinale) {
|
|
742
|
+
// The checks green: the final pass, its sessions counted apart.
|
|
743
|
+
etape = CONTROLES;
|
|
744
|
+
tentative = 0;
|
|
745
|
+
finale = true;
|
|
746
|
+
return decision();
|
|
747
|
+
}
|
|
748
|
+
// The whole pass green on this lot; the lot the last review accepted goes to the
|
|
749
|
+
// integration, any other to the review.
|
|
750
|
+
// A pass after a regeneration counts as whole after a whole one: restricted to what
|
|
751
|
+
// the regeneration changed, or not played when it changed nothing.
|
|
752
|
+
if (passe.arbre && (regeneration ? regeneration.entiere : !passe.restreinte)) {
|
|
753
|
+
maj.verifie = passe.arbre;
|
|
754
|
+
}
|
|
755
|
+
etape = lire('lotAccepte', { arbre: passe.arbre }) ? INTEGRATION : RELECTURE;
|
|
756
|
+
return decision();
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
function references() {
|
|
760
|
+
// The references to regenerate and the reds of the pass before, kept in the state from
|
|
761
|
+
// the pass that called for them (the checks of the plan, `suite`, or the final pass), so
|
|
762
|
+
// that a regeneration resumed knows them.
|
|
763
|
+
const a = m('aRegenerer');
|
|
764
|
+
if (!a) {
|
|
765
|
+
return arreter(
|
|
766
|
+
'references',
|
|
767
|
+
"L'état du circuit ne garde pas les références à régénérer : la passe finale les redonne (`--depuis developpeur`)."
|
|
768
|
+
);
|
|
769
|
+
}
|
|
770
|
+
// A command of the project that refuses beside reds of the plan, within the developpeur's
|
|
771
|
+
// sessions: the copy restored, those reds go to him with its output, then the pass that
|
|
772
|
+
// called for the regeneration, the checks of the plan or the final pass.
|
|
773
|
+
const suivante = tentative + 1;
|
|
774
|
+
const auLot = Boolean(a.auDeveloppeur) && suivante <= SEANCES_DEVELOPPEUR;
|
|
775
|
+
const g = lire('regeneration', {
|
|
776
|
+
noms: a.noms,
|
|
777
|
+
notes: a.notes,
|
|
778
|
+
suite: a.suite ?? null,
|
|
779
|
+
refusAuLot: auLot,
|
|
780
|
+
});
|
|
781
|
+
if (g.refus) {
|
|
782
|
+
const texte = [
|
|
783
|
+
`La régénération des références refuse le lot ; la copie est rendue telle qu'avant elle, et les rouges du plan vont au développeur (séance ${suivante}).`,
|
|
784
|
+
'',
|
|
785
|
+
...g.refus,
|
|
786
|
+
].join('\n');
|
|
787
|
+
ecrireRapport('references', texte, { regenerees: [], fichiers: [] });
|
|
788
|
+
rapport = `${texte}\n\n${a.auDeveloppeur}`;
|
|
789
|
+
maj.aRegenerer = null;
|
|
790
|
+
maj.rienALivrer = null;
|
|
791
|
+
etape = CODE;
|
|
792
|
+
tentative = suivante;
|
|
793
|
+
finale = a.suite !== 'controles';
|
|
794
|
+
return decision();
|
|
795
|
+
}
|
|
796
|
+
ecrireRapport('references', g.texte, { regenerees: g.regenerees, fichiers: g.fichiers });
|
|
797
|
+
// After the checks, the pass that judges the regenerated tree, which does not regenerate
|
|
798
|
+
// again the references just regenerated on it: beside other reds, the checks of the plan
|
|
799
|
+
// again (none plays when the regeneration changed nothing, the reds of the checks before
|
|
800
|
+
// standing); without, the final pass that is due. After a final pass, the pass restricted
|
|
801
|
+
// to what the regeneration changed, with the reds of the pass before.
|
|
802
|
+
maj.regenereSur = a.suite ? { arbre: lire('arbreApres'), noms: a.noms } : null;
|
|
803
|
+
maj.regeneration =
|
|
804
|
+
a.suite === 'passe'
|
|
805
|
+
? null
|
|
806
|
+
: a.suite === 'controles'
|
|
807
|
+
? g.fichiers.length
|
|
808
|
+
? null
|
|
809
|
+
: { reportes: { rouges: a.rouges, rejouee: false } }
|
|
810
|
+
: {
|
|
811
|
+
restreinte: g.restreinte,
|
|
812
|
+
entiere: a.entiere,
|
|
813
|
+
reportes: { rouges: a.rouges, rejouee: g.fichiers.length > 0 },
|
|
814
|
+
};
|
|
815
|
+
maj.aRegenerer = null;
|
|
816
|
+
etape = CONTROLES;
|
|
817
|
+
finale = a.suite !== 'controles';
|
|
818
|
+
return decision();
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
function relecture() {
|
|
822
|
+
const v = lire('relecture');
|
|
823
|
+
// A question for the owner: nothing is committed nor relaunched before his answer.
|
|
824
|
+
if (v.fiche.question) {
|
|
825
|
+
return arreter(
|
|
826
|
+
'besoin',
|
|
827
|
+
`Le relecteur attend une réponse : ${v.fiche.question}\n\nLe verdict :\n\n${v.texte}`,
|
|
828
|
+
{
|
|
829
|
+
piece: v.fiche.piece,
|
|
830
|
+
question: `Le relecteur demande : ${v.fiche.question}`,
|
|
831
|
+
qui: RESPONSABLE,
|
|
832
|
+
}
|
|
833
|
+
);
|
|
834
|
+
}
|
|
835
|
+
if (v.verdict === 'ACCEPTÉ') {
|
|
836
|
+
// The review that accepts the lot closes every finding, each one it judged lifted
|
|
837
|
+
// (`suiviDesConstats`).
|
|
838
|
+
maj.constats = [];
|
|
839
|
+
if (!v.arbre || m('verifie') === v.arbre) {
|
|
840
|
+
commenter('relecture', 'ACCEPTÉ ; le lot va à l’intégration.');
|
|
841
|
+
etape = INTEGRATION;
|
|
842
|
+
return decision();
|
|
843
|
+
}
|
|
844
|
+
// The whole final pass has not played on the lot accepted: it plays once, then the
|
|
845
|
+
// integration.
|
|
846
|
+
commenter(
|
|
847
|
+
'relecture',
|
|
848
|
+
'ACCEPTÉ ; la passe finale entière, qui n’a pas joué sur ce lot, puis l’intégration.'
|
|
849
|
+
);
|
|
850
|
+
etape = CONTROLES;
|
|
851
|
+
tentative = 0;
|
|
852
|
+
finale = true;
|
|
853
|
+
return decision();
|
|
854
|
+
}
|
|
855
|
+
// The reviews since the last ACCEPTÉ: a lot the queue sent back starts a new count.
|
|
856
|
+
const rendus = lire('rendus');
|
|
857
|
+
if (rendus >= RELECTURES) {
|
|
858
|
+
return arreter(
|
|
859
|
+
'relecture-arret',
|
|
860
|
+
`${rendus} relectures ont rendu le lot : le circuit s'arrête à la troisième.\n\nLe dernier verdict :\n\n${v.texte}`
|
|
861
|
+
);
|
|
862
|
+
}
|
|
863
|
+
// The findings still open once the sheet is read (`constatsOuverts` of scripts/circuit.mjs),
|
|
864
|
+
// or its stop for a finding without a valid recipient.
|
|
865
|
+
const lus = lire('constats');
|
|
866
|
+
if (lus.arret) {
|
|
867
|
+
return decision({ arret: lus.arret });
|
|
868
|
+
}
|
|
869
|
+
maj.constats = lus.constats;
|
|
870
|
+
const saute =
|
|
871
|
+
arretDuTestwriterSaute(
|
|
872
|
+
{
|
|
873
|
+
constats: lus.constats,
|
|
874
|
+
sansTests: ouverts(lus.constats, 'testwriter').length > 0 && lire('sansTests'),
|
|
875
|
+
paquets: ticket.paquets,
|
|
876
|
+
},
|
|
877
|
+
v.texte
|
|
878
|
+
) ??
|
|
879
|
+
arretDuGesteMecanique(
|
|
880
|
+
{ constats: lus.constats, mecanique: lire('mecanique'), sorte: ticket.sorte },
|
|
881
|
+
v.texte
|
|
882
|
+
);
|
|
883
|
+
if (saute) {
|
|
884
|
+
return decision({ arret: saute });
|
|
885
|
+
}
|
|
886
|
+
const auTestwriter = ouverts(lus.constats, 'testwriter').length > 0;
|
|
887
|
+
etape = auTestwriter ? TESTS : CODE;
|
|
888
|
+
tentative = 1;
|
|
889
|
+
rapport = null;
|
|
890
|
+
finale = false;
|
|
891
|
+
commenter(
|
|
892
|
+
'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 restreinte à ce que le correctif change et à ses dépendants, et le relecteur sur la différence.`
|
|
894
|
+
);
|
|
895
|
+
return decision();
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
// The name of the stop of an agent's sheet that is not FAIT: « besoin » for a question, else
|
|
900
|
+
// « hors-portee ».
|
|
901
|
+
const nomDuStatut = fiche => (fiche.statut === 'BESOIN' ? 'besoin' : 'hors-portee');
|