@roomi-fields/grillhouse 0.47.1 → 0.49.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 +116 -0
- package/agents/direct.md +9 -0
- package/cadre/templates/projet/.github/workflows/ci.yml +24 -38
- package/cadre/templates/projet/.github/workflows/machine-vierge.yml +5 -0
- package/cadre/templates/projet/.github/workflows/nuit.yml +14 -2
- package/cadre/templates/projet/CLAUDE.md +31 -10
- package/cadre/templates/projet/docs/agents/issue-tracker.md +1 -1
- package/cadre/templates/turbo/paquets.json +3 -1
- package/cadre/templates/turbo/sans-paquets.json +3 -1
- package/charte.md +46 -13
- package/dist/temporal/circuit/appel.d.ts +4 -1
- package/dist/temporal/circuit/appel.js +15 -1
- package/dist/temporal/circuit/appel.js.map +1 -1
- package/dist/temporal/circuit/client.d.ts +7 -1
- package/dist/temporal/circuit/client.js +54 -1
- package/dist/temporal/circuit/client.js.map +1 -1
- package/dist/temporal/circuit/commande.js +35 -60
- package/dist/temporal/circuit/commande.js.map +1 -1
- package/dist/temporal/circuit/contrat.d.ts +2 -1
- package/dist/temporal/circuit/contrat.js +2 -1
- package/dist/temporal/circuit/contrat.js.map +1 -1
- package/dist/temporal/circuit/deroule.js +9 -2
- package/dist/temporal/circuit/deroule.js.map +1 -1
- package/dist/temporal/commande.js +2 -13
- package/dist/temporal/commande.js.map +1 -1
- package/dist/temporal/deroules.d.ts +1 -1
- package/dist/temporal/deroules.js +2 -2
- package/dist/temporal/deroules.js.map +1 -1
- package/dist/temporal/file/activites.d.ts +1 -4
- package/dist/temporal/file/activites.js +13 -14
- package/dist/temporal/file/activites.js.map +1 -1
- package/dist/temporal/file/contrat.d.ts +34 -91
- package/dist/temporal/file/contrat.js +33 -5
- package/dist/temporal/file/contrat.js.map +1 -1
- package/dist/temporal/file/deroule.d.ts +1 -9
- package/dist/temporal/file/deroule.js +57 -166
- package/dist/temporal/file/deroule.js.map +1 -1
- package/dist/temporal/installation.d.ts +26 -1
- package/dist/temporal/installation.js +111 -2
- package/dist/temporal/installation.js.map +1 -1
- package/dist/temporal/nuits/activites.d.ts +5 -10
- package/dist/temporal/nuits/activites.js +9 -57
- package/dist/temporal/nuits/activites.js.map +1 -1
- package/dist/temporal/nuits/choix.d.ts +15 -0
- package/dist/temporal/nuits/choix.js +20 -0
- package/dist/temporal/nuits/choix.js.map +1 -1
- package/dist/temporal/nuits/contrat.d.ts +11 -16
- package/dist/temporal/nuits/deroule.js +38 -67
- package/dist/temporal/nuits/deroule.js.map +1 -1
- package/dist/temporal/places/client.d.ts +9 -11
- package/dist/temporal/places/client.js +11 -19
- package/dist/temporal/places/client.js.map +1 -1
- package/dist/temporal/places/contrat.d.ts +25 -24
- package/dist/temporal/places/contrat.js +5 -7
- package/dist/temporal/places/contrat.js.map +1 -1
- package/dist/temporal/places/deroule.js +26 -36
- package/dist/temporal/places/deroule.js.map +1 -1
- package/dist/temporal/tickets/activites.js +4 -2
- package/dist/temporal/tickets/activites.js.map +1 -1
- package/dist/temporal/tickets/contrat.d.ts +2 -1
- package/docs/ARCHITECTURE.md +453 -133
- package/docs/CADRE.md +16 -13
- package/docs/INTERFACE.md +100 -25
- package/hooks/hooks.json +9 -0
- package/hooks/register.tsx +59 -5
- package/package.json +1 -1
- package/scripts/activites.mjs +319 -52
- package/scripts/aiguillage.mjs +5 -1
- package/scripts/attente-a-l-arret.mjs +2 -5
- package/scripts/attente-au-tour.mjs +2 -5
- package/scripts/bilan.mjs +125 -2
- package/scripts/branche-de-nuit.mjs +32 -44
- package/scripts/ci-de-main.mjs +215 -16
- package/scripts/circuit.mjs +275 -189
- package/scripts/circuits-cles.d.mts +3 -3
- package/scripts/circuits-cles.mjs +6 -5
- package/scripts/coeurs-dedies.mjs +4 -4
- package/scripts/commandes-composees.mjs +12 -5
- package/scripts/composition-des-langages.mjs +2 -0
- package/scripts/crochets.mjs +2 -2
- package/scripts/dette.d.ts +2 -1
- package/scripts/dette.mjs +49 -6
- package/scripts/direct.mjs +343 -0
- package/scripts/droits.mjs +19 -0
- package/scripts/effets.mjs +6 -5
- package/scripts/engendres.mjs +2 -1
- package/scripts/enveloppe/enveloppe.mjs +127 -18
- package/scripts/enveloppe/lancer.sh +14 -3
- package/scripts/enveloppe/paquets-du-plan.mjs +9 -0
- package/scripts/enveloppe/travail-de-la-copie.mjs +121 -21
- package/scripts/etapes.mjs +14 -4
- package/scripts/etat-du-depot.mjs +23 -0
- package/scripts/faits-du-circuit.mjs +24 -34
- package/scripts/fermeture-de-la-machine.d.mts +27 -0
- package/scripts/fermeture-de-la-machine.mjs +98 -0
- package/scripts/fichiers-nommes.mjs +27 -1
- package/scripts/file-des-tickets.d.mts +18 -1
- package/scripts/file-des-tickets.mjs +63 -15
- package/scripts/greffons.mjs +1 -1
- package/scripts/grillhouse-maj.mjs +13 -25
- package/scripts/groupe-cles.d.mts +6 -0
- package/scripts/groupe-cles.mjs +29 -1
- package/scripts/integration/file.mjs +162 -48
- package/scripts/integration/integrer.mjs +2 -0
- package/scripts/jointure.d.ts +22 -3
- package/scripts/journal-des-etats.d.mts +16 -0
- package/scripts/journal-des-etats.mjs +44 -2
- package/scripts/journal.mjs +3 -0
- package/scripts/langages/c/commandes.mjs +5 -5
- package/scripts/langages/c/composants.mjs +13 -5
- package/scripts/langages/c/index.mjs +2 -0
- package/scripts/langages/c/squelette.mjs +1 -1
- package/scripts/langages/cargo/commandes.mjs +5 -6
- package/scripts/langages/cargo/index.mjs +2 -0
- package/scripts/langages/python/commandes.mjs +5 -5
- package/scripts/langages/python/composants.mjs +10 -2
- package/scripts/langages/python/index.mjs +2 -0
- package/scripts/langages/typescript/composants.mjs +10 -3
- package/scripts/langages/typescript/construire.mjs +2 -0
- package/scripts/langages/typescript/exemples.mjs +33 -1
- package/scripts/langages/typescript/index.mjs +22 -0
- package/scripts/langages/typescript/migrations/0.49.0-tests-equipes.mjs +32 -0
- package/scripts/langages/typescript/module-absent.mjs +24 -0
- package/scripts/langages/typescript/tests-de-nuit.mjs +152 -32
- package/scripts/langages/typescript/tests-du-poste.mjs +65 -23
- package/scripts/langages/typescript/titres-de-tests.mjs +11 -7
- package/scripts/langages/typescript/turbo-des-paquets.mjs +40 -5
- package/scripts/langages/typescript/verifier.mjs +3 -5
- package/scripts/langages/typescript/verrou-des-dependances.mjs +161 -0
- package/scripts/langages/typescript/vitest-config/cibles.mjs +57 -6
- package/scripts/langages/typescript/vitest-config/lances.mjs +3 -1
- package/scripts/langages/typescript/vitest-config/machine.setup.mjs +11 -5
- package/scripts/langages/typescript/vitest.nuit.config.mjs +53 -5
- package/scripts/langages.mjs +25 -3
- package/scripts/machine.mjs +103 -0
- package/scripts/matieres-cles.mjs +17 -0
- package/scripts/matieres-lues.mjs +104 -0
- package/scripts/mesure/base-de-passe.mjs +2 -1
- package/scripts/migrations/0.48.0-ci-declenchee-par-la-file.mjs +32 -0
- package/scripts/migrations/0.48.0-poussee-retiree.mjs +31 -0
- package/scripts/migrations/0.49.0-reservation-de-trois-coeurs.mjs +30 -0
- package/scripts/migrations.mjs +6 -0
- package/scripts/nuit.sh +113 -46
- package/scripts/paquet.mjs +16 -5
- package/scripts/paquets.d.ts +4 -0
- package/scripts/paquets.mjs +57 -0
- package/scripts/passe-de-la-machine.mjs +13 -14
- package/scripts/places-de-la-machine.mjs +120 -44
- package/scripts/places-du-serveur.mjs +29 -8
- package/scripts/plafond-de-la-machine.d.mts +7 -13
- package/scripts/plafond-de-la-machine.mjs +19 -35
- package/scripts/poussee-retiree.mjs +18 -0
- package/scripts/prefixe-des-tickets.mjs +1 -1
- package/scripts/references-changees.mjs +159 -0
- package/scripts/registre.d.mts +2 -2
- package/scripts/regles-des-places.d.mts +20 -12
- package/scripts/regles-des-places.mjs +27 -30
- package/scripts/repli-de-la-nuit.mjs +112 -0
- package/scripts/reponses-du-circuit.d.mts +4 -2
- package/scripts/reponses-du-circuit.mjs +44 -9
- package/scripts/reprise.mjs +27 -8
- package/scripts/resultats.mjs +61 -9
- package/scripts/seances.mjs +258 -40
- package/scripts/services-du-noyau.mjs +3 -0
- package/scripts/sous-commandes.mjs +37 -7
- package/scripts/superviseur.mjs +241 -88
- package/scripts/tableau.mjs +327 -131
- package/scripts/taches-du-graphe.mjs +84 -4
- package/scripts/ticket.mjs +345 -0
- package/scripts/transitions.d.mts +52 -0
- package/scripts/transitions.mjs +194 -16
- package/scripts/un-commit-par-ticket.mjs +4 -3
- package/scripts/verdict-de-la-nuit.mjs +47 -20
- package/scripts/verrou-de-fichier.mjs +2 -2
- package/scripts/verrous/ecriture-hors-enveloppe.mjs +86 -0
- package/scripts/verrous/verrou.mjs +17 -1
- package/skills/developpeur/SKILL.md +1 -1
- package/skills/direct/SKILL.md +57 -0
- package/skills/explorateur/SKILL.md +10 -6
- package/skills/pitmaster/SKILL.md +37 -14
- package/skills/pitmaster/references/consigne-agent.md +7 -1
- package/skills/relecteur/SKILL.md +11 -1
- package/skills/testwriter/SKILL.md +10 -0
- package/scripts/poussee-cles.mjs +0 -46
- package/scripts/ticket.sh +0 -25
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// The key `grillhouse.poussee` is retired from the frame: one branch, main, receives every lot (the
|
|
2
|
+
// trunk-based development of Google and Chromium). This one reading serves the queue
|
|
3
|
+
// (scripts/integration/file.mjs), the night (scripts/nuit.sh) and the pre-push guard
|
|
4
|
+
// (scripts/branche-de-nuit.mjs): whatever the value of the key (null, an object, a string), the
|
|
5
|
+
// project that carries it is refused by its name, with the gesture (remove the key).
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The refusal line of a package.json that carries `grillhouse.poussee`, or null without it.
|
|
9
|
+
* @param {unknown} pkg
|
|
10
|
+
* @returns {string | null}
|
|
11
|
+
*/
|
|
12
|
+
export function pousseeRetiree(pkg) {
|
|
13
|
+
const grillhouse = pkg?.grillhouse;
|
|
14
|
+
if (!grillhouse || typeof grillhouse !== 'object' || !Object.hasOwn(grillhouse, 'poussee')) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
return 'La clé grillhouse.poussee est retirée du cadre : main reçoit seule chaque lot. Retire-la du package.json (npm pkg delete grillhouse.poussee).';
|
|
18
|
+
}
|
|
@@ -82,7 +82,7 @@ export function ecrireLePrefixe(racine, valeur) {
|
|
|
82
82
|
return ligne;
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
// Run as `node prefixe-des-tickets.mjs <racine>`, the shell scripts (
|
|
85
|
+
// Run as `node prefixe-des-tickets.mjs <racine>`, the shell scripts (nuit.sh) read the
|
|
86
86
|
// prefix by the same function: it prints the prefix, or the message of the refusal with exit 1.
|
|
87
87
|
if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) {
|
|
88
88
|
try {
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
// The difference of the reference files a lot changes, as the review of a snapshot (the snapshots
|
|
2
|
+
// of Jest and insta, the review of the goldens of Chromium) shows the difference of each file:
|
|
3
|
+
// measured by git between the base of the lot and the lot kept (`git diff --numstat`), summarised
|
|
4
|
+
// by name of field for a JSON file, so that the reviewer judges the change of a reference on the
|
|
5
|
+
// tree, not on what the agent declares.
|
|
6
|
+
import { spawnSync } from 'node:child_process';
|
|
7
|
+
import { couvertPar } from './engendres.mjs';
|
|
8
|
+
|
|
9
|
+
// The most fields the text of a difference lists per file, the rest counted.
|
|
10
|
+
const CHAMPS_MAX = 40;
|
|
11
|
+
|
|
12
|
+
const objet = v => v !== null && typeof v === 'object' && !Array.isArray(v);
|
|
13
|
+
|
|
14
|
+
const egales = (a, b) => JSON.stringify(a) === JSON.stringify(b);
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The difference of two JSON texts by name of field: `[{ champ, changees, ajoutees, retirees }]`,
|
|
18
|
+
* the fields whose values changed, were added or removed (an object descended into by its keys, a
|
|
19
|
+
* list by its positions, its extra or missing elements counted under the name of the list), in the
|
|
20
|
+
* order they first appear; an empty list for two equal documents; null when a text is no JSON.
|
|
21
|
+
* @param {string} avant
|
|
22
|
+
* @param {string} apres
|
|
23
|
+
* @returns {{ champ: string, changees: number, ajoutees: number, retirees: number }[] | null}
|
|
24
|
+
*/
|
|
25
|
+
export function resumeJson(avant, apres) {
|
|
26
|
+
let a;
|
|
27
|
+
let b;
|
|
28
|
+
try {
|
|
29
|
+
a = JSON.parse(avant);
|
|
30
|
+
b = JSON.parse(apres);
|
|
31
|
+
} catch {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
const champs = new Map();
|
|
35
|
+
const compter = (nom, sorte, n = 1) => {
|
|
36
|
+
const c = champs.get(nom) ?? { champ: nom, changees: 0, ajoutees: 0, retirees: 0 };
|
|
37
|
+
c[sorte] += n;
|
|
38
|
+
champs.set(nom, c);
|
|
39
|
+
};
|
|
40
|
+
const descendre = (x, y, nom) => {
|
|
41
|
+
if (Array.isArray(x) && Array.isArray(y)) {
|
|
42
|
+
for (let i = 0; i < Math.min(x.length, y.length); i++) {
|
|
43
|
+
descendre(x[i], y[i], nom);
|
|
44
|
+
}
|
|
45
|
+
if (y.length > x.length) {
|
|
46
|
+
compter(nom, 'ajoutees', y.length - x.length);
|
|
47
|
+
} else if (x.length > y.length) {
|
|
48
|
+
compter(nom, 'retirees', x.length - y.length);
|
|
49
|
+
}
|
|
50
|
+
} else if (objet(x) && objet(y)) {
|
|
51
|
+
for (const k of new Set([...Object.keys(x), ...Object.keys(y)])) {
|
|
52
|
+
if (!(k in y)) {
|
|
53
|
+
compter(k, 'retirees');
|
|
54
|
+
} else if (!(k in x)) {
|
|
55
|
+
compter(k, 'ajoutees');
|
|
56
|
+
} else {
|
|
57
|
+
descendre(x[k], y[k], k);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
} else if (!egales(x, y)) {
|
|
61
|
+
compter(nom, 'changees');
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
descendre(a, b, '(racine)');
|
|
65
|
+
return [...champs.values()];
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const git = (copie, args) =>
|
|
69
|
+
spawnSync('git', ['-C', copie, ...args], { encoding: 'utf8', maxBuffer: 256 * 1024 * 1024 });
|
|
70
|
+
|
|
71
|
+
// The text of <fichier> at <commit>, or null when it is not there.
|
|
72
|
+
const texteA = (copie, commit, fichier) => {
|
|
73
|
+
const r = git(copie, ['show', `${commit}:${fichier}`]);
|
|
74
|
+
return r.status === 0 ? r.stdout : null;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* The reference files the lot changes, measured by git between <base> and <lot> in <copie>: each
|
|
79
|
+
* `{ fichier, ajoutees, retirees, champs }`, its lines added and removed, and for a JSON file
|
|
80
|
+
* present on both sides its fields (`resumeJson`), else null. A reference file is one that a
|
|
81
|
+
* reference of <references> (`lesReferences`: `fichiers` and `entiers`) covers.
|
|
82
|
+
* @param {{ copie: string, references: { fichiers: string[], entiers?: string[] }[], base: string, lot: string }} o
|
|
83
|
+
* @returns {{ fichier: string, ajoutees: number, retirees: number, champs: { champ: string, changees: number, ajoutees: number, retirees: number }[] | null }[]}
|
|
84
|
+
*/
|
|
85
|
+
export function differencesDesReferences({ copie, references, base, lot }) {
|
|
86
|
+
const motifs = references.flatMap(r => [...(r.fichiers ?? []), ...(r.entiers ?? [])]);
|
|
87
|
+
if (!motifs.length) {
|
|
88
|
+
return [];
|
|
89
|
+
}
|
|
90
|
+
const r = git(copie, ['diff', '--numstat', '--no-renames', '-z', base, lot]);
|
|
91
|
+
if (r.status !== 0) {
|
|
92
|
+
return [];
|
|
93
|
+
}
|
|
94
|
+
const sorties = [];
|
|
95
|
+
for (const entree of r.stdout.split('\0')) {
|
|
96
|
+
const m = /^(\d+|-)\t(\d+|-)\t(.+)$/s.exec(entree);
|
|
97
|
+
if (!m || !couvertPar(motifs, m[3])) {
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
const fichier = m[3];
|
|
101
|
+
let champs = null;
|
|
102
|
+
if (fichier.endsWith('.json')) {
|
|
103
|
+
const avant = texteA(copie, base, fichier);
|
|
104
|
+
const apres = texteA(copie, lot, fichier);
|
|
105
|
+
champs = avant !== null && apres !== null ? resumeJson(avant, apres) : null;
|
|
106
|
+
}
|
|
107
|
+
sorties.push({
|
|
108
|
+
fichier,
|
|
109
|
+
ajoutees: m[1] === '-' ? 0 : Number(m[1]),
|
|
110
|
+
retirees: m[2] === '-' ? 0 : Number(m[2]),
|
|
111
|
+
champs,
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
return sorties.sort((x, y) => x.fichier.localeCompare(y.fichier));
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const ligneDuChamp = c =>
|
|
118
|
+
`${c.champ} : ${[
|
|
119
|
+
c.changees && `${c.changees} changées`,
|
|
120
|
+
c.ajoutees && `${c.ajoutees} ajoutées`,
|
|
121
|
+
c.retirees && `${c.retirees} retirées`,
|
|
122
|
+
]
|
|
123
|
+
.filter(Boolean)
|
|
124
|
+
.join(', ')}`;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* The text the reviewer reads: each changed reference file with its lines (`+a −b`) and, for a
|
|
128
|
+
* JSON file, a line per field; « aucun » when the lot changes no reference.
|
|
129
|
+
* @param {{ fichier: string, ajoutees: number, retirees: number, champs: any[] | null }[]} diffs
|
|
130
|
+
*/
|
|
131
|
+
export function texteDesDifferences(diffs) {
|
|
132
|
+
if (!diffs.length) {
|
|
133
|
+
return 'aucun';
|
|
134
|
+
}
|
|
135
|
+
return diffs
|
|
136
|
+
.map(d => {
|
|
137
|
+
const champs = d.champs ?? [];
|
|
138
|
+
const reste = champs.length - CHAMPS_MAX;
|
|
139
|
+
return [
|
|
140
|
+
`- ${d.fichier} (+${d.ajoutees} −${d.retirees})`,
|
|
141
|
+
...champs.slice(0, CHAMPS_MAX).map(c => ` - ${ligneDuChamp(c)}`),
|
|
142
|
+
...(reste > 0 ? [` - … ${reste} autres champs`] : []),
|
|
143
|
+
].join('\n');
|
|
144
|
+
})
|
|
145
|
+
.join('\n');
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* The line of the commit message: « Références changées (N) : <fichier> (+a −b), … », empty when
|
|
150
|
+
* the lot changes no reference.
|
|
151
|
+
* @param {{ fichier: string, ajoutees: number, retirees: number }[]} diffs
|
|
152
|
+
*/
|
|
153
|
+
export function ligneDesReferences(diffs) {
|
|
154
|
+
return diffs.length
|
|
155
|
+
? `Références changées (${diffs.length}) : ${diffs
|
|
156
|
+
.map(d => `${d.fichier} (+${d.ajoutees} −${d.retirees})`)
|
|
157
|
+
.join(', ')}`
|
|
158
|
+
: '';
|
|
159
|
+
}
|
package/scripts/registre.d.mts
CHANGED
|
@@ -37,7 +37,7 @@ export interface LigneDuRegistre {
|
|
|
37
37
|
cache: number;
|
|
38
38
|
cout: number | null;
|
|
39
39
|
cle?: string;
|
|
40
|
-
nuit?: { verdict: 'sautee'; raison: string; sommet: string; reference: string };
|
|
40
|
+
nuit?: { verdict: 'sautee'; raison: string; sommet: string; reference: string | null };
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
/** The register's file: GRILLHOUSE_REGISTRE, else ~/.claude/grillhouse/registre.jsonl. */
|
|
@@ -77,7 +77,7 @@ export function ligneDeNuit(e: {
|
|
|
77
77
|
quand: string;
|
|
78
78
|
raison: string;
|
|
79
79
|
sommet: string;
|
|
80
|
-
reference: string;
|
|
80
|
+
reference: string | null;
|
|
81
81
|
}): LigneDuRegistre;
|
|
82
82
|
export function aRattraper(
|
|
83
83
|
racine: string,
|
|
@@ -5,8 +5,6 @@
|
|
|
5
5
|
export const MEMOIRE_MIN: number;
|
|
6
6
|
|
|
7
7
|
export const VARIABLE_ESPACEMENT: string;
|
|
8
|
-
/** The jeton of the reservation of the machine by the night, which the passes of the night carry. */
|
|
9
|
-
export const VARIABLE_JETON: string;
|
|
10
8
|
/** The gap between two starts when GRILLHOUSE_ESPACEMENT_MS names none, in ms. */
|
|
11
9
|
export const ESPACEMENT_MS: number;
|
|
12
10
|
/** The gap between two starts under <env>, in ms. */
|
|
@@ -35,10 +33,9 @@ export function refusDeLaPlace(
|
|
|
35
33
|
rang: number;
|
|
36
34
|
ticket?: string | null;
|
|
37
35
|
raison?: string;
|
|
38
|
-
jeton?: string | null;
|
|
39
36
|
}[];
|
|
40
37
|
dernier: number;
|
|
41
|
-
reservation?:
|
|
38
|
+
reservation?: ReservationDeLaMachine | null;
|
|
42
39
|
},
|
|
43
40
|
o: {
|
|
44
41
|
id: string;
|
|
@@ -47,7 +44,6 @@ export function refusDeLaPlace(
|
|
|
47
44
|
espacementMs: number;
|
|
48
45
|
maintenant: number;
|
|
49
46
|
mesurer: () => MesureDeLaMachine;
|
|
50
|
-
jeton?: string | null;
|
|
51
47
|
}
|
|
52
48
|
): string | null;
|
|
53
49
|
|
|
@@ -88,20 +84,32 @@ export function refusDePart(
|
|
|
88
84
|
part: PartDeLaPasse;
|
|
89
85
|
budget: PartDeLaPasse;
|
|
90
86
|
mesurer: () => MesureDeLaMachine;
|
|
87
|
+
dediee?: boolean;
|
|
88
|
+
/** The reservation of the machine read this turn, null without. */
|
|
89
|
+
reservation?: ReservationDeLaMachine | null;
|
|
91
90
|
}
|
|
92
91
|
): string | null;
|
|
93
92
|
|
|
93
|
+
/** Why a pass waits under the supervisor's closure of the machine. */
|
|
94
|
+
export const RAISON_DE_LA_FERMETURE: string;
|
|
95
|
+
|
|
94
96
|
/** A place of a circuit not given by its project's queue for this long is gone, in ms: 10 min. */
|
|
95
97
|
export const PERIME_MS: number;
|
|
96
98
|
|
|
97
|
-
/** The
|
|
98
|
-
export
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}
|
|
99
|
+
/** The reservation of the machine: the supervisor's closure, the only one. */
|
|
100
|
+
export interface ReservationDeLaMachine {
|
|
101
|
+
auteur?: 'superviseur';
|
|
102
|
+
depuis: number;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/** The phase of the closure: none without one, waiting (a place is held) or empty. */
|
|
106
|
+
export function phaseDeLaReservation(etat: {
|
|
107
|
+
prises: readonly object[];
|
|
108
|
+
reservation?: ReservationDeLaMachine | null;
|
|
109
|
+
}): 'attend' | 'vide' | null;
|
|
102
110
|
|
|
103
|
-
/**
|
|
104
|
-
export
|
|
111
|
+
/** Why a place waits under the supervisor's closure. */
|
|
112
|
+
export const RAISON_FERMEE: string;
|
|
105
113
|
|
|
106
114
|
/** The place of a circuit of the machine: held (`accordee`) or waited for, its rank of arrival. */
|
|
107
115
|
export interface PlaceDeCircuit {
|
|
@@ -10,8 +10,9 @@
|
|
|
10
10
|
export const MEMOIRE_MIN = 4 * 1024 ** 3;
|
|
11
11
|
|
|
12
12
|
export const VARIABLE_ESPACEMENT = 'GRILLHOUSE_ESPACEMENT_MS';
|
|
13
|
-
/**
|
|
14
|
-
export const
|
|
13
|
+
/** Why a place waits under the closure of the machine by the supervisor (`cordon` of kubectl). */
|
|
14
|
+
export const RAISON_FERMEE =
|
|
15
|
+
'machine fermée par le superviseur : la place est donnée à la réouverture';
|
|
15
16
|
/** The gap between two starts when GRILLHOUSE_ESPACEMENT_MS names none, in ms. */
|
|
16
17
|
export const ESPACEMENT_MS = 10_000;
|
|
17
18
|
|
|
@@ -78,19 +79,16 @@ export function admission({ coeurs, charge, memoireLibre }) {
|
|
|
78
79
|
*/
|
|
79
80
|
export function refusDeLaPlace(
|
|
80
81
|
etat,
|
|
81
|
-
{ id, rang, plafond, espacementMs, maintenant, mesurer
|
|
82
|
+
{ id, rang, plafond, espacementMs, maintenant, mesurer }
|
|
82
83
|
) {
|
|
83
|
-
|
|
84
|
-
if (reservation
|
|
85
|
-
return
|
|
84
|
+
// The supervisor's closure, the only reservation of the machine, gives no place to anyone.
|
|
85
|
+
if (etat.reservation) {
|
|
86
|
+
return RAISON_FERMEE;
|
|
86
87
|
}
|
|
87
88
|
if (etat.prises.length >= plafond) {
|
|
88
89
|
return `aucune place libre : ${etat.prises.length} prises sur ${plafond}`;
|
|
89
90
|
}
|
|
90
|
-
|
|
91
|
-
const avant = etat.attentes.find(
|
|
92
|
-
a => a.id !== id && a.rang < rang && (!reservation || (a.jeton ?? null) === reservation.jeton)
|
|
93
|
-
);
|
|
91
|
+
const avant = etat.attentes.find(a => a.id !== id && a.rang < rang);
|
|
94
92
|
if (avant) {
|
|
95
93
|
return `place réservée : ${avant.ticket ?? 'un départ'} est arrivé avant et attend (${avant.raison})`;
|
|
96
94
|
}
|
|
@@ -156,13 +154,15 @@ export function admissionDePart({ part, budget, prises, mesure }) {
|
|
|
156
154
|
: { ...a, attend: mesure.charge >= mesure.coeurs ? 'charge' : 'mémoire' };
|
|
157
155
|
}
|
|
158
156
|
|
|
157
|
+
/** Why a pass waits under the supervisor's closure of the machine. */
|
|
158
|
+
export const RAISON_DE_LA_FERMETURE = 'machine fermée par le superviseur';
|
|
159
|
+
|
|
159
160
|
/**
|
|
160
161
|
* Why the pass <id> of the rank <rang> does not take its part <part> now on the state <etat>
|
|
161
162
|
* (`prises`, `attentes`), null when it does: its part does not fit in the <budget>; a wait of a
|
|
162
163
|
* lower rank, alive, which keeps its turn (the measure of the frame has the lower rank of a
|
|
163
164
|
* project's, then the order of arrival); the admission at the load and the memory <mesurer> gives
|
|
164
|
-
* (read only when the part and the turn pass).
|
|
165
|
-
* plays alone. A measure of time (<dediee>) asks for dedicated cores: when they lack, its refusal
|
|
165
|
+
* (read only when the part and the turn pass). A measure of time (<dediee>) asks for dedicated cores: when they lack, its refusal
|
|
166
166
|
* says « cœurs dédiés » and names the passes that hold them; a pass that comes after it waits
|
|
167
167
|
* behind it, its rank reserved, and one measure plays at a time, whatever its part would fit in the free cores; once it plays, an
|
|
168
168
|
* ordinary pass whose part fits in the cores left goes on.
|
|
@@ -173,7 +173,14 @@ export function admissionDePart({ part, budget, prises, mesure }) {
|
|
|
173
173
|
* mesurer: () => { coeurs: number, charge: number, memoireLibre: number } }} o
|
|
174
174
|
* @returns {string | null}
|
|
175
175
|
*/
|
|
176
|
-
export function refusDePart(
|
|
176
|
+
export function refusDePart(
|
|
177
|
+
etat,
|
|
178
|
+
{ id, rang, part, budget, mesurer, dediee = false, reservation = null }
|
|
179
|
+
) {
|
|
180
|
+
// A closed machine gives no new work (`cordon` of kubectl): the supervisor's closure refuses every pass.
|
|
181
|
+
if (reservation) {
|
|
182
|
+
return RAISON_DE_LA_FERMETURE;
|
|
183
|
+
}
|
|
177
184
|
const prises = etat.prises.filter(p => p.id !== id);
|
|
178
185
|
// Two measures of time never play side by side: each would be the load the other is judged on.
|
|
179
186
|
const autre = dediee ? prises.find(p => p.dediee) : undefined;
|
|
@@ -200,29 +207,19 @@ export function refusDePart(etat, { id, rang, part, budget, mesurer, dediee = fa
|
|
|
200
207
|
export const PERIME_MS = 10 * 60_000;
|
|
201
208
|
|
|
202
209
|
/**
|
|
203
|
-
* The phase of the
|
|
204
|
-
*
|
|
205
|
-
*
|
|
206
|
-
* @param {{ prises:
|
|
207
|
-
* @returns {'attend' | '
|
|
210
|
+
* The phase of the supervisor's closure of the machine: null without one; `'attend'` while a place
|
|
211
|
+
* is held (the stages under way finish); then `'vide'` (it holds no place itself: every place held
|
|
212
|
+
* waits to be given back).
|
|
213
|
+
* @param {{ prises: object[], reservation?: object | null }} etat
|
|
214
|
+
* @returns {'attend' | 'vide' | null}
|
|
208
215
|
*/
|
|
209
|
-
export function
|
|
216
|
+
export function phaseDeLaReservation({ prises, reservation = null }) {
|
|
210
217
|
if (!reservation) {
|
|
211
218
|
return null;
|
|
212
219
|
}
|
|
213
|
-
return prises.
|
|
220
|
+
return prises.length > 0 ? 'attend' : 'vide';
|
|
214
221
|
}
|
|
215
222
|
|
|
216
|
-
/**
|
|
217
|
-
* Whether a reservation of the machine is out of date at <maintenant>: its last beat, the one the
|
|
218
|
-
* workflow of the nights renews, is PERIME_MS old, as a place of a circuit is.
|
|
219
|
-
* @param {{ battement: number }} reservation
|
|
220
|
-
* @param {number} maintenant
|
|
221
|
-
* @returns {boolean}
|
|
222
|
-
*/
|
|
223
|
-
export const reservationPerimee = (reservation, maintenant) =>
|
|
224
|
-
maintenant - reservation.battement >= PERIME_MS;
|
|
225
|
-
|
|
226
223
|
/**
|
|
227
224
|
* The places of the circuits of the machine once a demand comes, as Buildkite bounds its pipelines
|
|
228
225
|
* in one fleet of agents. The queue of the project <racine> gives its circuits active <vivants>
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
// The fallback of the night of Grillhouse: the night of PC3 (scripts/nuit.sh) reads, by `gh`, the jobs
|
|
2
|
+
// of the day's Nuit flow, and decides tranche by tranche what PC3 plays in place of PC2, as a queue
|
|
3
|
+
// of agents falls back on another capacity (Buildkite) when no agent takes the job in time.
|
|
4
|
+
//
|
|
5
|
+
// - A tranche finished on PC2, green or red, is never replayed.
|
|
6
|
+
// - A tranche whose job has not started 60 minutes after the hour of the flow is cancelled and
|
|
7
|
+
// played on PC3, on its part; a tranche started then interrupted (cancelled, a runner lost, never
|
|
8
|
+
// started) counts as not played and plays whole again.
|
|
9
|
+
// - A tranche that runs, or waits for less than 60 minutes, stays at PC2.
|
|
10
|
+
// - The statement says which tranches played where: `pc2` the finished ones, `pc3` the replayed.
|
|
11
|
+
//
|
|
12
|
+
// node repli-de-la-nuit.mjs <dépôt owner/nom> <nombre de tranches> [<identifiant du flux>] the
|
|
13
|
+
// decision as JSON, the run cancelled (`gh run cancel`) when a tranche waited too long; a run that
|
|
14
|
+
// waits for its group of concurrence, with no job yet, counts every tranche as not started
|
|
15
|
+
import { spawnSync } from 'node:child_process';
|
|
16
|
+
import { fileURLToPath } from 'node:url';
|
|
17
|
+
import path from 'node:path';
|
|
18
|
+
|
|
19
|
+
/** The minutes a tranche may wait for its job to start before PC3 plays it. */
|
|
20
|
+
export const ATTENTE_MAX_MINUTES = 60;
|
|
21
|
+
|
|
22
|
+
const TRANCHE = /^tranches\b.*?(\d+)\)\s*$/;
|
|
23
|
+
// The conclusions of a job that started or was cancelled without finishing its tranche.
|
|
24
|
+
const INTERROMPUES = new Set(['cancelled', 'skipped', 'startup_failure']);
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The decision on the tranches of a Nuit flow.
|
|
28
|
+
* @param {{ jobs: { name: string, status: string, conclusion: string | null, startedAt: string | null }[], heureDuFlux: string, maintenant: string }} o
|
|
29
|
+
* `jobs` the jobs of the run as `gh run view --json jobs` gives them, `heureDuFlux` the hour the
|
|
30
|
+
* flow was created, `maintenant` the present hour, both ISO.
|
|
31
|
+
* @returns {{ aRejouer: number[], aAnnuler: number[], enAttente: number[], pc2: number[], pc3: number[] }}
|
|
32
|
+
*/
|
|
33
|
+
export function choisirLeRepli({ jobs, heureDuFlux, maintenant }) {
|
|
34
|
+
const attente = Date.parse(maintenant) - Date.parse(heureDuFlux);
|
|
35
|
+
const d = { aRejouer: [], aAnnuler: [], enAttente: [], enCours: [], rouges: [], pc2: [], pc3: [] };
|
|
36
|
+
const tranches = jobs
|
|
37
|
+
.map(j => ({ j, n: Number(TRANCHE.exec(j.name)?.[1]) }))
|
|
38
|
+
.filter(({ n }) => Number.isInteger(n) && n > 0)
|
|
39
|
+
.sort((a, b) => a.n - b.n);
|
|
40
|
+
for (const { j, n } of tranches) {
|
|
41
|
+
if (j.status === 'completed') {
|
|
42
|
+
if (INTERROMPUES.has(j.conclusion ?? '')) {
|
|
43
|
+
d.aRejouer.push(n);
|
|
44
|
+
} else {
|
|
45
|
+
d.pc2.push(n);
|
|
46
|
+
if (j.conclusion !== 'success') {
|
|
47
|
+
d.rouges.push(n);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
} else if (j.startedAt || j.status === 'in_progress') {
|
|
51
|
+
d.pc2.push(n);
|
|
52
|
+
d.enCours.push(n);
|
|
53
|
+
} else if (attente >= ATTENTE_MAX_MINUTES * 60_000) {
|
|
54
|
+
d.aAnnuler.push(n);
|
|
55
|
+
d.aRejouer.push(n);
|
|
56
|
+
} else {
|
|
57
|
+
d.enAttente.push(n);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
d.pc3 = [...d.aRejouer];
|
|
61
|
+
return d;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function gh(args) {
|
|
65
|
+
const r = spawnSync('gh', args, { encoding: 'utf8' });
|
|
66
|
+
if (r.status !== 0) {
|
|
67
|
+
throw new Error(`gh ${args.join(' ')} : ${r.stderr || r.error?.message || r.status}`);
|
|
68
|
+
}
|
|
69
|
+
return r.stdout;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if (process.argv[1] && fileURLToPath(import.meta.url) === path.resolve(process.argv[1])) {
|
|
73
|
+
const [depot, tranches, identifiant] = process.argv.slice(2);
|
|
74
|
+
const vide = { aRejouer: [], aAnnuler: [], enAttente: [], enCours: [], rouges: [], pc2: [], pc3: [] };
|
|
75
|
+
try {
|
|
76
|
+
const id =
|
|
77
|
+
identifiant ||
|
|
78
|
+
JSON.parse(
|
|
79
|
+
gh(['run', 'list', '-R', depot, '--workflow', 'nuit.yml', '--limit', '1', '--json', 'databaseId'])
|
|
80
|
+
)[0]?.databaseId;
|
|
81
|
+
if (!id) {
|
|
82
|
+
process.stdout.write(`${JSON.stringify(vide)}\n`);
|
|
83
|
+
} else {
|
|
84
|
+
const run = JSON.parse(
|
|
85
|
+
gh(['run', 'view', String(id), '-R', depot, '--json', 'jobs,createdAt,status'])
|
|
86
|
+
);
|
|
87
|
+
// A run that waits for the group of concurrence has no job yet: each of its tranches is
|
|
88
|
+
// a job not started.
|
|
89
|
+
const jobs =
|
|
90
|
+
run.jobs.length === 0 && run.status !== 'completed'
|
|
91
|
+
? Array.from({ length: Number(tranches) || 0 }, (_, i) => ({
|
|
92
|
+
name: `tranches (26.x, ${i + 1})`,
|
|
93
|
+
status: 'queued',
|
|
94
|
+
conclusion: null,
|
|
95
|
+
startedAt: null,
|
|
96
|
+
}))
|
|
97
|
+
: run.jobs;
|
|
98
|
+
const d = choisirLeRepli({
|
|
99
|
+
jobs,
|
|
100
|
+
heureDuFlux: run.createdAt,
|
|
101
|
+
maintenant: new Date().toISOString(),
|
|
102
|
+
});
|
|
103
|
+
if (d.aAnnuler.length > 0) {
|
|
104
|
+
gh(['run', 'cancel', String(id), '-R', depot]);
|
|
105
|
+
}
|
|
106
|
+
process.stdout.write(`${JSON.stringify({ ...d, flux: id })}\n`);
|
|
107
|
+
}
|
|
108
|
+
} catch (e) {
|
|
109
|
+
process.stderr.write(`⛔ repli de la nuit : ${e.message}\n`);
|
|
110
|
+
process.exitCode = 1;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
@@ -4,8 +4,10 @@
|
|
|
4
4
|
export const SANS_ISSUE: Set<string>;
|
|
5
5
|
/** The answers accepted for the circuit of <ticket> whose workflow has the status <statut>. */
|
|
6
6
|
export function lesReponses(ticket: string, statut: string, ecrit: boolean): string;
|
|
7
|
-
/** The
|
|
8
|
-
export
|
|
7
|
+
/** The hour `bd update --defer` receives for `--reporter <heure>`, and the phrase of its texts. */
|
|
8
|
+
export function heureDuReport(heure: string, maintenant: Date): { defer: string; quand: string };
|
|
9
|
+
/** The stops `--mecanique` answers, by the step they stand at: the testwriter's, the proof's. */
|
|
10
|
+
export const ARRETS_DE_LA_BASCULE: Record<string, string[]>;
|
|
9
11
|
/** The sort of a ticket, as the plan says it (scripts/resultats.mjs `sorteDuPlan`). */
|
|
10
12
|
export interface SorteDuTicket {
|
|
11
13
|
genre: string;
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
// The answers a circuit accepts from the supervisor, by the status of its workflow, with no input
|
|
2
2
|
// nor output: the one rule the client (src/temporal/circuit/client.ts: its refusals and the
|
|
3
3
|
// circuits it reads), the opening, the wait, the board and the line of a stop name; and the
|
|
4
|
-
// answer `--mecanique`, which turns the sort of a ticket stopped on the testwriter
|
|
5
|
-
|
|
4
|
+
// answer `--mecanique`, which turns the sort of a ticket stopped on the testwriter or on the proof
|
|
5
|
+
// of the red.
|
|
6
|
+
import { CODE, GESTE, PREUVE, TESTS } from './transitions.mjs';
|
|
6
7
|
|
|
7
8
|
/** The statuses of a workflow ended without its issue. */
|
|
8
9
|
export const SANS_ISSUE = new Set(['TERMINATED', 'FAILED', 'TIMED_OUT', 'CANCELLED']);
|
|
9
10
|
|
|
10
|
-
/**
|
|
11
|
-
|
|
11
|
+
/**
|
|
12
|
+
* The stops `--mecanique` answers, by the step they stand at: the testwriter's question and his
|
|
13
|
+
* blocked word, and the proof of the red that refuses the lot of tests, both the sign that no
|
|
14
|
+
* honest test can turn red before the lot.
|
|
15
|
+
*/
|
|
16
|
+
export const ARRETS_DE_LA_BASCULE = { [TESTS]: ['besoin', 'hors-portee'], [PREUVE]: ['preuve'] };
|
|
12
17
|
|
|
13
18
|
/**
|
|
14
19
|
* The answers accepted for the circuit of <ticket> whose workflow has the status <statut>, a state
|
|
@@ -28,15 +33,45 @@ export function lesReponses(ticket, statut, ecrit) {
|
|
|
28
33
|
}
|
|
29
34
|
const etendre = '--etendre <paquet>';
|
|
30
35
|
const mecanique = '--mecanique [<commande>] --contexte <raison>';
|
|
36
|
+
// The question carried to the owner: it stays quiet until the circuit answers.
|
|
37
|
+
const chez = '--chez-le-responsable';
|
|
31
38
|
return statut === 'RUNNING'
|
|
32
|
-
? `${circuit} --reprendre\`, \`${depuis}\`, \`${mecanique}\`, \`${etendre}\`, \`--reporter <heure
|
|
33
|
-
: `${circuit} --reprendre\`, \`${depuis}\`, \`${mecanique}\` ou \`${
|
|
39
|
+
? `${circuit} --reprendre\`, \`${depuis}\`, \`${mecanique}\`, \`${etendre}\`, \`--reporter <heure>\`, \`${chez}\` ou \`--arreter`
|
|
40
|
+
: `${circuit} --reprendre\`, \`${depuis}\`, \`${mecanique}\`, \`${etendre}\` ou \`${chez}`;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* The hour of a deferral (`--reporter <heure>`): a lone hour (`H:MM` or `HH:MM`, 0-23 and 00-59)
|
|
45
|
+
* aims at its next occurrence in the machine's local time, today when strictly after <maintenant>
|
|
46
|
+
* (to the second), else tomorrow, and is handed to `bd update --defer` as `AAAA-MM-JJTHH:MM:00`,
|
|
47
|
+
* the form bd reads as that wall time (bd 1.2.2 reads `2026-11-22 14:00` as 11:22, the month and
|
|
48
|
+
* the day taken for the hour); any other form goes to bd as written. `quand` is the phrase of the texts (« reportée <quand> »).
|
|
49
|
+
* @param {string} heure
|
|
50
|
+
* @param {Date} maintenant
|
|
51
|
+
* @returns {{ defer: string, quand: string }}
|
|
52
|
+
*/
|
|
53
|
+
export function heureDuReport(heure, maintenant) {
|
|
54
|
+
const lue = /^(\d{1,2}):([0-5]\d)$/.exec(heure);
|
|
55
|
+
if (!lue || Number(lue[1]) > 23) {
|
|
56
|
+
return { defer: heure, quand: `au ${heure}` };
|
|
57
|
+
}
|
|
58
|
+
const cible = new Date(maintenant);
|
|
59
|
+
cible.setHours(Number(lue[1]), Number(lue[2]), 0, 0);
|
|
60
|
+
const demain = cible.getTime() <= maintenant.getTime();
|
|
61
|
+
if (demain) {
|
|
62
|
+
cible.setDate(cible.getDate() + 1);
|
|
63
|
+
}
|
|
64
|
+
const deux = (n) => String(n).padStart(2, '0');
|
|
65
|
+
const hhmm = `${deux(cible.getHours())}:${deux(cible.getMinutes())}`;
|
|
66
|
+
const defer = `${cible.getFullYear()}-${deux(cible.getMonth() + 1)}-${deux(cible.getDate())}T${hhmm}:00`;
|
|
67
|
+
return { defer, quand: demain ? `à demain ${hhmm}` : `au ${heure}` };
|
|
34
68
|
}
|
|
35
69
|
|
|
36
70
|
/**
|
|
37
71
|
* The answer `--mecanique [<commande>] --contexte <raison>` to the stop <etat> (`{ etape, raison }`)
|
|
38
72
|
* of a ticket of sort <sorte>: a refusal `{ refus }` unless the ticket is stopped on the testwriter
|
|
39
|
-
* (his question or his blocked word)
|
|
73
|
+
* (his question or his blocked word) or on the proof of the red (`ARRETS_DE_LA_BASCULE`) with a
|
|
74
|
+
* reason, its sort not already mechanical; else the sort
|
|
40
75
|
* it becomes and the step the circuit resumes at, the plan kept as it is. With a <commande>, the
|
|
41
76
|
* gesture a command plays: sort mécanique, 1.1. Without, the gesture written by hand: sort
|
|
42
77
|
* comportement « inchangé », the developpeur writes and the existing suite makes the proof.
|
|
@@ -45,9 +80,9 @@ export function lesReponses(ticket, statut, ecrit) {
|
|
|
45
80
|
* @returns {{ refus: string } | { sorte: object, suivant: { etape: string } }}
|
|
46
81
|
*/
|
|
47
82
|
export function reponseMecanique({ etat, sorte, commande, contexte }) {
|
|
48
|
-
if (etat?.etape
|
|
83
|
+
if (!ARRETS_DE_LA_BASCULE[etat?.etape]?.includes(etat.raison ?? '')) {
|
|
49
84
|
return {
|
|
50
|
-
refus: `--mecanique répond à un arrêt du testwriter (besoin ou hors-portee) : le circuit est à ${etat?.etape ?? 'aucun état'}${etat?.raison ? `, arrêté sur ${etat.raison}` : ''}.`,
|
|
85
|
+
refus: `--mecanique répond à un arrêt du testwriter (besoin ou hors-portee) ou de la preuve du rouge (preuve) : le circuit est à ${etat?.etape ?? 'aucun état'}${etat?.raison ? `, arrêté sur ${etat.raison}` : ''}.`,
|
|
51
86
|
};
|
|
52
87
|
}
|
|
53
88
|
const raison = String(contexte ?? '').trim();
|
package/scripts/reprise.mjs
CHANGED
|
@@ -8,11 +8,14 @@ import { SUITE } from './etapes.mjs';
|
|
|
8
8
|
const etatDe = n => SUITE.find(e => e.numero === n).etat;
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* The step that carries the red whose places are <lieux> (`{ paquet, fichier, gardes,
|
|
11
|
+
* The step that carries the red whose places are <lieux> (`{ paquet, fichier, gardes, nommes,
|
|
12
12
|
* dansLePlan }`), by the files the red names against what the testwriter (`portes.tests`) and the
|
|
13
|
-
* developpeur (`portes.code`) wrote: `{ etape, fichiers, motif? }`. A test file that a
|
|
14
|
-
* the style refuses (`gardes` not empty)
|
|
15
|
-
*
|
|
13
|
+
* developpeur (`portes.code`) wrote: `{ etape, fichiers, motif? }`. A test file of the lot that a
|
|
14
|
+
* guard or the style refuses (`gardes` not empty), or that the message of a failed test out of
|
|
15
|
+
* the lot names (`nommes`, a guard written as a test, which lists what it finds), is the testwriter's, the
|
|
16
|
+
* earliest step (the developpeur replays after him): a red goes to who writes the file it names,
|
|
17
|
+
* as Gerrit gives a failed check back to the author of the file. A test that fails and names no
|
|
18
|
+
* test file of the lot (no guard) and a file of code are the developpeur's. A red
|
|
16
19
|
* that names no file but lies in a package of the plan (a red task: lint, format check, typing,
|
|
17
20
|
* build) is the developpeur's, no file named, as a red job of a CI goes back to its author (the
|
|
18
21
|
* owner's decision on grillhouse-4nr.14.1); one out of the plan, or a file nobody wrote, is never
|
|
@@ -36,11 +39,27 @@ export function attribuerLeRouge({ lieux, portes }) {
|
|
|
36
39
|
motif: `le rouge nomme ${inconnus.join(', ')}, que ni le testwriter ni le développeur ne portent`,
|
|
37
40
|
};
|
|
38
41
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
+
// The test files of the lot the message of a failed test out of the lot names.
|
|
43
|
+
const designes = avecFichier
|
|
44
|
+
.filter(l => !tests.has(l.fichier))
|
|
45
|
+
.flatMap(l => l.nommes ?? [])
|
|
46
|
+
.filter(f => tests.has(f));
|
|
47
|
+
// A test file of a reader package extended to its tests (`portes.lecteurs`): the testwriter
|
|
48
|
+
// alone writes it, the developpeur's lock refuses it.
|
|
49
|
+
const lecteurs = new Set(portes.lecteurs ?? []);
|
|
50
|
+
const refuses = [
|
|
51
|
+
...new Set([
|
|
52
|
+
...nommes.filter(
|
|
53
|
+
f =>
|
|
54
|
+
tests.has(f) &&
|
|
55
|
+
(lecteurs.has(f) || avecFichier.some(l => l.fichier === f && (l.gardes ?? []).length > 0))
|
|
56
|
+
),
|
|
57
|
+
...designes,
|
|
58
|
+
]),
|
|
59
|
+
];
|
|
60
|
+
const tous = [...new Set([...nommes, ...designes])];
|
|
42
61
|
return refuses.length
|
|
43
|
-
? { etape: 'testwriter', fichiers: refuses.length ===
|
|
62
|
+
? { etape: 'testwriter', fichiers: refuses.length === tous.length ? refuses : tous }
|
|
44
63
|
: { etape: 'developpeur', fichiers: nommes };
|
|
45
64
|
}
|
|
46
65
|
|