@roomi-fields/grillhouse 0.30.0 → 0.31.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 +30 -0
- package/agents/developpeur.md +0 -1
- package/agents/explorateur.md +0 -1
- package/agents/questionneur.md +0 -1
- package/agents/testwriter.md +0 -1
- package/dist/temporal/circuit/client.d.ts +2 -2
- package/dist/temporal/circuit/client.js.map +1 -1
- package/dist/temporal/circuit/commande.js +4 -4
- package/dist/temporal/circuit/commande.js.map +1 -1
- package/dist/temporal/circuit/contrat.d.ts +3 -3
- package/dist/temporal/circuit/contrat.js +8 -2
- package/dist/temporal/circuit/contrat.js.map +1 -1
- package/dist/temporal/circuit/deroule.js +3 -3
- package/dist/temporal/circuit/deroule.js.map +1 -1
- package/dist/temporal/commande.js +5 -6
- package/dist/temporal/commande.js.map +1 -1
- package/dist/temporal/installation.d.ts +0 -4
- package/dist/temporal/installation.js +12 -34
- package/dist/temporal/installation.js.map +1 -1
- package/docs/ARCHITECTURE.md +49 -19
- package/docs/CADRE.md +10 -0
- package/docs/INTERFACE.md +8 -3
- package/package.json +2 -2
- package/scripts/activites.mjs +150 -77
- package/scripts/aiguillage.mjs +33 -11
- package/scripts/avancement.mjs +27 -10
- package/scripts/bilan.mjs +101 -25
- package/scripts/cadre.mjs +5 -2
- package/scripts/circuit.mjs +153 -57
- package/scripts/composants-affectes.mjs +64 -21
- package/scripts/composition-des-langages.mjs +5 -3
- package/scripts/conformite.mjs +54 -19
- package/scripts/dependances-internes.mjs +9 -3
- package/scripts/dernier-vert.mjs +54 -19
- package/scripts/dette.mjs +32 -11
- package/scripts/donnees-cles.mjs +24 -8
- package/scripts/droits.mjs +40 -15
- package/scripts/empreinte-d-etape.mjs +17 -0
- package/scripts/engendres.mjs +15 -5
- package/scripts/enveloppe/enveloppe.mjs +141 -48
- package/scripts/enveloppe/travail-de-la-copie.mjs +36 -12
- package/scripts/faits-du-circuit.mjs +1 -1
- package/scripts/flux-des-paquets.mjs +21 -7
- package/scripts/gardes-du-cadre.mjs +9 -3
- package/scripts/init.mjs +11 -4
- package/scripts/integration/file.mjs +84 -29
- package/scripts/integration/integrer.mjs +70 -24
- package/scripts/integration/rejeu.mjs +26 -9
- package/scripts/jointure.d.ts +6 -1
- package/scripts/langages/cargo/commandes.mjs +97 -18
- package/scripts/langages/cargo/composants.mjs +24 -8
- package/scripts/langages/cargo/index.mjs +4 -0
- package/scripts/langages/cargo/tests-de-head.mjs +25 -9
- package/scripts/langages/python/commandes.mjs +3 -1
- package/scripts/langages/python/index.mjs +4 -0
- package/scripts/langages/typescript/chemins-des-tests.mjs +6 -2
- package/scripts/langages/typescript/composants.mjs +9 -3
- package/scripts/langages/typescript/consommateurs-arbitres.mjs +40 -14
- package/scripts/langages/typescript/consommateurs.mjs +39 -14
- package/scripts/langages/typescript/elements-du-lot.mjs +36 -12
- package/scripts/langages/typescript/frontieres.mjs +66 -22
- package/scripts/langages/typescript/index-interfaces.mjs +36 -13
- package/scripts/langages/typescript/index.mjs +10 -3
- package/scripts/langages/typescript/interfaces-contre-code.mjs +109 -41
- package/scripts/langages/typescript/lecteurs.mjs +36 -11
- package/scripts/langages/typescript/migrations/0.23.0-config-vitest.mjs +15 -5
- package/scripts/langages/typescript/migrations/0.25.0-chemins-des-tests.mjs +6 -2
- package/scripts/langages/typescript/migrations/0.25.0-tailles-des-tests.mjs +6 -2
- package/scripts/langages/typescript/migrations/0.30.0-tailles-des-outils-lourds.mjs +3 -1
- package/scripts/langages/typescript/parcours.mjs +12 -4
- package/scripts/langages/typescript/regle-des-tests.mjs +9 -3
- package/scripts/langages/typescript/resumes.mjs +9 -3
- package/scripts/langages/typescript/tailles-des-tests.mjs +58 -16
- package/scripts/langages/typescript/tests-de-nuit.mjs +3 -1
- package/scripts/langages/typescript/tests.mjs +24 -8
- package/scripts/langages/typescript/titres-de-tests.mjs +35 -12
- package/scripts/langages/typescript/turbo-des-paquets.mjs +152 -51
- package/scripts/langages/typescript/verdict.mjs +3 -1
- package/scripts/langages/typescript/verifier.mjs +28 -10
- package/scripts/langages/typescript/vitest-config/avancement.reporter.mjs +15 -5
- package/scripts/langages/typescript/vitest-config/base.mjs +7 -2
- package/scripts/langages/typescript/vitest-config/changements.mjs +21 -8
- package/scripts/langages/typescript/vitest-config/delais.mjs +9 -3
- package/scripts/langages/typescript/vitest-config/duree.classement.mjs +12 -4
- package/scripts/langages/typescript/vitest-config/duree.reporter.mjs +17 -6
- package/scripts/langages/typescript/vitest-config/lances.mjs +83 -27
- package/scripts/langages/typescript/vitest-config/machine.setup.mjs +7 -0
- package/scripts/langages/typescript/vitest-config/resultats.mjs +3 -1
- package/scripts/lint-des-scripts.mjs +58 -0
- package/scripts/mesure/base-de-passe.mjs +117 -25
- package/scripts/mesure/pression.mjs +9 -3
- package/scripts/migrations/0.23.0-charte-importee.mjs +6 -2
- package/scripts/migrations/0.23.0-crochets-de-seance.mjs +25 -8
- package/scripts/migrations/0.23.0-marche-du-projet.mjs +18 -6
- package/scripts/migrations/0.23.2-copies-du-cadre.mjs +48 -16
- package/scripts/migrations/0.24.12-tri-des-decouvertes.mjs +6 -2
- package/scripts/migrations/0.25.0-script-des-tests.mjs +15 -5
- package/scripts/migrations/0.30.0-ci-appelle-la-verification.mjs +6 -2
- package/scripts/migrations/0.31.0-paquets-dans-le-graphe.mjs +7 -7
- package/scripts/nuit.sh +15 -0
- package/scripts/outil.mjs +3 -1
- package/scripts/outils-cles.mjs +18 -7
- package/scripts/paquet-npm.mjs +15 -5
- package/scripts/paquets.mjs +12 -4
- package/scripts/passe-de-la-machine.mjs +7 -2
- package/scripts/places-de-la-machine.mjs +66 -12
- package/scripts/preparation.mjs +15 -5
- package/scripts/registre.mjs +6 -2
- package/scripts/reprise.mjs +66 -0
- package/scripts/resultats.mjs +105 -37
- package/scripts/seances.mjs +22 -4
- package/scripts/services-du-noyau.mjs +1 -0
- package/scripts/sous-commandes.mjs +3 -1
- package/scripts/style-a-l-ecriture.mjs +48 -17
- package/scripts/tableau.mjs +34 -9
- package/scripts/taches-du-graphe.mjs +33 -13
- package/scripts/ticket-du-circuit.mjs +10 -0
- package/scripts/transitions.mjs +141 -24
- package/scripts/verrou-de-fichier.mjs +6 -2
- package/scripts/verrou-de-machine.mjs +123 -39
- package/scripts/verrous/commande.mjs +50 -17
- package/scripts/verrous/ticket-du-sous-agent.mjs +9 -3
- package/scripts/verrous/verrou.mjs +42 -14
- package/skills/explorateur/SKILL.md +7 -1
- package/skills/grill/SKILL.md +1 -1
- package/skills/mesure/SKILL.md +3 -0
- package/skills/relecteur/SKILL.md +1 -1
- package/skills/testwriter/SKILL.md +12 -6
package/scripts/activites.mjs
CHANGED
|
@@ -14,7 +14,6 @@ import { createHash, randomUUID } from 'node:crypto';
|
|
|
14
14
|
import {
|
|
15
15
|
appendFileSync,
|
|
16
16
|
closeSync,
|
|
17
|
-
copyFileSync,
|
|
18
17
|
cpSync,
|
|
19
18
|
existsSync,
|
|
20
19
|
mkdirSync,
|
|
@@ -31,6 +30,7 @@ import path from 'node:path';
|
|
|
31
30
|
import { avecLAvancementDuTravail } from './avancement.mjs';
|
|
32
31
|
import { A_REPASSER } from './codes-de-sortie.mjs';
|
|
33
32
|
import { DEPUIS_LE_VERT } from './dernier-vert.mjs';
|
|
33
|
+
import { empreinteDEtape } from './empreinte-d-etape.mjs';
|
|
34
34
|
import { FICHIER as DETTE } from './dette.mjs';
|
|
35
35
|
import { commandesPermises, optionsDuRole } from './droits.mjs';
|
|
36
36
|
import { couvertPar } from './engendres.mjs';
|
|
@@ -62,6 +62,7 @@ import { consigne, idDeSeance, jusquALaFiche } from './seances.mjs';
|
|
|
62
62
|
import {
|
|
63
63
|
Arret,
|
|
64
64
|
AUTEUR_DU_CIRCUIT,
|
|
65
|
+
codeDejaPresent,
|
|
65
66
|
commenter,
|
|
66
67
|
composantsDe,
|
|
67
68
|
entete,
|
|
@@ -83,7 +84,7 @@ import { AttenteDeLaMachine, nommerLAvancement } from './verrou-de-machine.mjs';
|
|
|
83
84
|
import { avecLaMachineEtUnePlace } from './places-de-la-machine.mjs';
|
|
84
85
|
|
|
85
86
|
const ici = import.meta.dirname;
|
|
86
|
-
// The sessions out of the envelope (the reviewer
|
|
87
|
+
// The sessions out of the envelope (the reviewer, the explorateur and the questionneur, all on
|
|
87
88
|
// Sonnet), each in the
|
|
88
89
|
// ticket's copy, the main tree once the integration removed it, under the rights and the context
|
|
89
90
|
// of its role (scripts/droits.mjs: the commands its skill names, the refusal of a change of its
|
|
@@ -308,7 +309,7 @@ export async function relire(ctx, { constats = [] } = {}) {
|
|
|
308
309
|
id: idDeSeance(ctx, 'relecture'),
|
|
309
310
|
evenement: 'relecture',
|
|
310
311
|
horsEnveloppe: true,
|
|
311
|
-
droits: horsDeLEnveloppe(ctx, 'relecteur', '
|
|
312
|
+
droits: horsDeLEnveloppe(ctx, 'relecteur', 'sonnet'),
|
|
312
313
|
avec: lot ? { lot: { ...lot, fichiers: [...tests, ...code] } } : {},
|
|
313
314
|
// Every review judges the findings still open, bounded or whole (`suiviDesConstats`).
|
|
314
315
|
valider: f =>
|
|
@@ -392,22 +393,16 @@ function relectureDAvant(ctx) {
|
|
|
392
393
|
return tient(e.lot.commit) && tient(e.lot.base) ? e : null;
|
|
393
394
|
}
|
|
394
395
|
|
|
395
|
-
// The tree of the copy as it stands, the copy's HEAD and index untouched:
|
|
396
|
-
//
|
|
397
|
-
//
|
|
396
|
+
// The tree of the copy as it stands, the copy's HEAD and index untouched: a fresh index of the
|
|
397
|
+
// circuit's, read from HEAD (no stat cache, so git hashes every file's content and a file changed
|
|
398
|
+
// within the second of the index, the racy case, is never missed), every file of the copy added to
|
|
399
|
+
// it (`git add -A`, the ignored files left out), written as a tree. Its id, or null when git fails.
|
|
398
400
|
export function arbreDeLaCopie(ctx) {
|
|
399
401
|
const index = path.join(ctx.tmp, `index-${randomUUID().replaceAll('-', '')}`);
|
|
400
|
-
const reel = spawnSync(
|
|
401
|
-
'git',
|
|
402
|
-
['-C', ctx.copie, 'rev-parse', '--path-format=absolute', '--git-path', 'index'],
|
|
403
|
-
{ encoding: 'utf8' }
|
|
404
|
-
).stdout?.trim();
|
|
405
402
|
const env = { ...process.env, GIT_INDEX_FILE: index };
|
|
406
403
|
const git = (...a) => spawnSync('git', ['-C', ctx.copie, ...a], { encoding: 'utf8', env });
|
|
407
404
|
try {
|
|
408
|
-
if (
|
|
409
|
-
copyFileSync(reel, index);
|
|
410
|
-
} else if (git('read-tree', 'HEAD').status !== 0) {
|
|
405
|
+
if (git('read-tree', 'HEAD').status !== 0) {
|
|
411
406
|
return null;
|
|
412
407
|
}
|
|
413
408
|
if (git('add', '-A').status !== 0) {
|
|
@@ -486,8 +481,8 @@ function leLotSurLaBase(ctx, lot) {
|
|
|
486
481
|
// The lot of the copy kept against the review before: `{ avant, depuis, lot }`, that review
|
|
487
482
|
// (`relectureDAvant`, null before any), the lot it read set on the copy's HEAD (`leLotSurLaBase`,
|
|
488
483
|
// null when nothing bounds), and the copy kept as a lot on it (on HEAD without it). The bounded
|
|
489
|
-
// review
|
|
490
|
-
//
|
|
484
|
+
// review and its elements to judge again read the difference from `depuis` to `lot`; the final
|
|
485
|
+
// pass does not read it, it plays the band of the lot (`laPasseFinale`).
|
|
491
486
|
export function leLotGarde(ctx) {
|
|
492
487
|
const avant = relectureDAvant(ctx);
|
|
493
488
|
const depuis = avant ? leLotSurLaBase(ctx, avant.lot) : null;
|
|
@@ -526,21 +521,19 @@ function differenceDesLots(ctx, avant, apres) {
|
|
|
526
521
|
return r.status === 0 ? r.stdout.split('\0').filter(Boolean).sort() : [];
|
|
527
522
|
}
|
|
528
523
|
|
|
529
|
-
// The final pass the lot calls for: `{ arbre, restreinte }`, the tree of the copy
|
|
530
|
-
//
|
|
531
|
-
//
|
|
532
|
-
//
|
|
533
|
-
//
|
|
524
|
+
// The final pass the lot calls for: `{ arbre, restreinte }`, the tree of the copy and the band
|
|
525
|
+
// Turborepo plays (`{ avant, apres }`: the copy's HEAD, the base of the lot, and the copy kept as a
|
|
526
|
+
// commit on it), as Bazel and Nx `affected` play the reverse-dependency closure of a change: always
|
|
527
|
+
// the band of the lot, before any review, after one, on an accepted lot, main advanced or not,
|
|
528
|
+
// never the whole repository, which the night and the integration play. It throws, naming git,
|
|
529
|
+
// when git cannot keep the lot: a null band would be the whole repository.
|
|
534
530
|
export function laPasseFinale(ctx) {
|
|
535
531
|
const arbre = arbreDeLaCopie(ctx);
|
|
536
|
-
|
|
537
|
-
|
|
532
|
+
const lot = arbre ? garderLeLot(ctx, null) : null;
|
|
533
|
+
if (!arbre || !lot) {
|
|
534
|
+
throw new Error(`la passe finale ne peut borner le lot de ${ctx.ticket} : git ne le garde pas`);
|
|
538
535
|
}
|
|
539
|
-
|
|
540
|
-
return {
|
|
541
|
-
arbre,
|
|
542
|
-
restreinte: depuis && lot ? { avant: depuis, apres: lot.commit } : null,
|
|
543
|
-
};
|
|
536
|
+
return { arbre, restreinte: { avant: lot.base, apres: lot.commit } };
|
|
544
537
|
}
|
|
545
538
|
|
|
546
539
|
// The references of the circuit: those the project declares in the package.json of the copy
|
|
@@ -607,7 +600,7 @@ export function referencesDesRouges(ctx, lieux, aElaguer = false) {
|
|
|
607
600
|
// follows (null when nothing changed: no pass plays again, and the reds stand); <suite>, the
|
|
608
601
|
// regeneration the checks of the plan call for: `controles`, beside other reds, the checks of the
|
|
609
602
|
// plan follow, on the regenerated tree; `passe`, without, the final pass that is due follows,
|
|
610
|
-
//
|
|
603
|
+
// on the band of the lot; null after a final pass. A file a reference writes follows from the lot, as
|
|
611
604
|
// the output of a genrule, without a word of the plan, and the reviewer reads its difference; a
|
|
612
605
|
// file changed that none of the references run declares, or a command that fails (a reference of
|
|
613
606
|
// the project at another code than 0, one of the frame on a real failure alone) restores the copy
|
|
@@ -839,11 +832,16 @@ function restaurer(ctx, commit, fichiers) {
|
|
|
839
832
|
// The files of the lot that only the night plays (<misDeCote>, `separerLesFichiersDuJour`) are no
|
|
840
833
|
// part of the proof: the red proves the behaviour the ticket develops, and a bench or a night test
|
|
841
834
|
// is neither required red nor a cause of refusal. A lot whose only test files are those passes.
|
|
842
|
-
|
|
835
|
+
// With the code of the behaviour already in the copy (<codePresent>, `codeDejaPresent`), no test
|
|
836
|
+
// can turn red: the proof abstains the same way, a lot that holds a red keeps its verdict.
|
|
837
|
+
export function preuveReussie(
|
|
838
|
+
{ fichiers, rouges, casses, nommes, misDeCote = 0 },
|
|
839
|
+
{ inchange, codePresent = false }
|
|
840
|
+
) {
|
|
843
841
|
if (casses > 0) {
|
|
844
842
|
return false;
|
|
845
843
|
}
|
|
846
|
-
if (inchange) {
|
|
844
|
+
if (inchange || codePresent) {
|
|
847
845
|
return true;
|
|
848
846
|
}
|
|
849
847
|
if (nommes > 0) {
|
|
@@ -1623,9 +1621,11 @@ export const portentLeTravail = fiches =>
|
|
|
1623
1621
|
// separator between its group and its title, a blank, or « > » as Vitest prints it, or « › » as
|
|
1624
1622
|
// Jest and the report of the proof print it (`sansSeparateur`); the measure plays again only when
|
|
1625
1623
|
// the copy changed (`mesureDeLaPreuve`).
|
|
1626
|
-
export function preuve(ctx, { mesure: derniere = null } = {}) {
|
|
1624
|
+
export function preuve(ctx, { mesure: derniere = null, fichiers: seuls = null } = {}) {
|
|
1627
1625
|
// Only the files of the day are proved; the ones only the night plays are put aside, named.
|
|
1628
|
-
|
|
1626
|
+
// Resumed at a red (<seuls>, the files it names), the proof plays these files alone and passes
|
|
1627
|
+
// when they load: a test fixed is green, not red.
|
|
1628
|
+
const { jour: fichiers, misDeCote } = separerLesFichiersDuJour(ctx, seuls ?? testsDuLot(ctx));
|
|
1629
1629
|
const portent = portentLeTravail(fichesDe(ctx, 'testwriter'));
|
|
1630
1630
|
// Whether the sheet names the test <a> of the file <f>, by its full name or by its whole file.
|
|
1631
1631
|
const nomme = (f, a) =>
|
|
@@ -1654,6 +1654,8 @@ export function preuve(ctx, { mesure: derniere = null } = {}) {
|
|
|
1654
1654
|
}));
|
|
1655
1655
|
// A plan « comportement inchangé »: every green of the lot is expected.
|
|
1656
1656
|
const inchange = Boolean(ctx.sorte?.inchange);
|
|
1657
|
+
// The developpeur already ran after the last testwriter: the code is there, no test can turn red.
|
|
1658
|
+
const codePresent = codeDejaPresent(ctx);
|
|
1657
1659
|
for (const { groupe, entier, avant, lus, arbres, code, resultats, constructions } of mesure) {
|
|
1658
1660
|
for (const { nom, erreur } of constructions) {
|
|
1659
1661
|
if (reportes.includes(nom)) {
|
|
@@ -1704,18 +1706,20 @@ export function preuve(ctx, { mesure: derniere = null } = {}) {
|
|
|
1704
1706
|
}
|
|
1705
1707
|
const section = (titre, l) =>
|
|
1706
1708
|
l.length ? [`${titre} (${l.length}) :`, ...l.map(x => `- ${x}`), ''] : [];
|
|
1707
|
-
const ok =
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1709
|
+
const ok = seuls
|
|
1710
|
+
? casses.length === 0
|
|
1711
|
+
: preuveReussie(
|
|
1712
|
+
{
|
|
1713
|
+
fichiers: fichiers.length,
|
|
1714
|
+
rouges: rouges.length,
|
|
1715
|
+
casses: casses.length,
|
|
1716
|
+
nommes: nommes.length,
|
|
1717
|
+
nonNommes: nonNommes.length,
|
|
1718
|
+
anciens,
|
|
1719
|
+
misDeCote: misDeCote.length,
|
|
1720
|
+
},
|
|
1721
|
+
{ inchange, codePresent }
|
|
1722
|
+
);
|
|
1719
1723
|
const resume = `${rouges.length} rouge(s), ${nommes.length} vert(s) nommé(s) qui portent le travail, ${nonNommes.length} vert(s) non nommé(s), ${casses.length} fichier(s) qui ne se charge(nt) pas, ${anciens} test(s) vert(s) que HEAD tient déjà, laissé(s) de côté`;
|
|
1720
1724
|
const ecrit = (...sections) =>
|
|
1721
1725
|
[
|
|
@@ -1724,14 +1728,16 @@ export function preuve(ctx, { mesure: derniere = null } = {}) {
|
|
|
1724
1728
|
nom => `Les tests de ${nom} se jouent aux contrôles, après le développeur.`
|
|
1725
1729
|
),
|
|
1726
1730
|
'',
|
|
1727
|
-
...(
|
|
1728
|
-
? []
|
|
1729
|
-
:
|
|
1730
|
-
? [
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1731
|
+
...(codePresent && !inchange && ok && rouges.length === 0
|
|
1732
|
+
? ['Le code du développeur est déjà dans la copie : le rouge n’a rien à prouver.', '']
|
|
1733
|
+
: fichiers.length || rouges.length || misDeCote.length
|
|
1734
|
+
? []
|
|
1735
|
+
: inchange
|
|
1736
|
+
? [
|
|
1737
|
+
'Aucun fichier de test du lot : le plan dit « comportement inchangé », rien à prouver.',
|
|
1738
|
+
'',
|
|
1739
|
+
]
|
|
1740
|
+
: ['Aucun fichier de test du lot dans le plan : rien ne prouve le rouge.', '']),
|
|
1735
1741
|
...section('Rouges', rouges),
|
|
1736
1742
|
...sections,
|
|
1737
1743
|
...(nommes.length
|
|
@@ -1799,9 +1805,10 @@ const STYLE = new Set(['lint', 'format:check']);
|
|
|
1799
1805
|
|
|
1800
1806
|
// Where <chemin> (from the root of the copy) lies: `{ dansLePlan, paquet, horsTitre }`, whether
|
|
1801
1807
|
// a path of the plan holds it, the name of the package of <liste> that holds it, and that name
|
|
1802
|
-
// again when the plan does not hold it.
|
|
1808
|
+
// again when the plan does not hold it. A red with no path (null) is in the plan when the plan
|
|
1809
|
+
// names « . », which holds the whole copy.
|
|
1803
1810
|
function situer(ctx, liste, chemin) {
|
|
1804
|
-
const dedans =
|
|
1811
|
+
const dedans = chemin ? dansLePlan(ctx, chemin) : nommeLaRacine(ctx);
|
|
1805
1812
|
const p = chemin ? liste.find(x => chemin.startsWith(`${x.dossier}/`)) : null;
|
|
1806
1813
|
const paquet = p ? p.pkg.name : null;
|
|
1807
1814
|
return { dansLePlan: dedans, paquet, horsTitre: dedans ? null : paquet };
|
|
@@ -1887,9 +1894,7 @@ function rougesDe(ctx, liste, c) {
|
|
|
1887
1894
|
continue;
|
|
1888
1895
|
}
|
|
1889
1896
|
const p = liste.find(x => x.pkg.name === t.paquet);
|
|
1890
|
-
const lieu = p
|
|
1891
|
-
? situer(ctx, liste, `${p.dossier}/`)
|
|
1892
|
-
: { dansLePlan: false, paquet: null, horsTitre: null };
|
|
1897
|
+
const lieu = p ? situer(ctx, liste, `${p.dossier}/`) : situer(ctx, liste, null);
|
|
1893
1898
|
const j = journalDeTache(ctx, t);
|
|
1894
1899
|
out.push({
|
|
1895
1900
|
texte:
|
|
@@ -1907,9 +1912,7 @@ function rougesDe(ctx, liste, c) {
|
|
|
1907
1912
|
if (out.length === 0) {
|
|
1908
1913
|
out.push({
|
|
1909
1914
|
texte: `${ligneDeCommande(c)} rouge (code ${c.code}), sans résultat qui situe son rouge — le journal du ticket : ${ctx.journal}`,
|
|
1910
|
-
|
|
1911
|
-
paquet: null,
|
|
1912
|
-
horsTitre: null,
|
|
1915
|
+
...situer(ctx, liste, null),
|
|
1913
1916
|
});
|
|
1914
1917
|
}
|
|
1915
1918
|
return { rouges: out, avertissements };
|
|
@@ -1939,17 +1942,27 @@ const ligneDeCommande = c =>
|
|
|
1939
1942
|
// which their regeneration lifts before the checks judge the lot again, or before the final pass; `tous` every red as it was read; `notes`,
|
|
1940
1943
|
// at the final pass, each key of the debt a guard wrote inscribed above what it finds, `{ garde,
|
|
1941
1944
|
// fichier, regle, trouve }`.
|
|
1942
|
-
export function controles(ctx, finale, restreinte = null, reportes = null) {
|
|
1945
|
+
export function controles(ctx, finale, restreinte = null, reportes = null, fichiers = null) {
|
|
1943
1946
|
const liste = composantsDe(ctx.copie).filter(p => !p.hors);
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
+
// Resumed at a red in the test files <fichiers>: the final pass plays their packages alone (the
|
|
1948
|
+
// graph of packages of Turborepo, the root's tasks beside), the checks of the plan their tests
|
|
1949
|
+
// alone (Vitest plays what the files import) and the guards.
|
|
1950
|
+
const duReprise = fichiers
|
|
1951
|
+
? [...new Set(fichiers.map(f => liste.find(p => f.startsWith(`${p.dossier}/`))?.pkg.name))]
|
|
1952
|
+
.filter(Boolean)
|
|
1953
|
+
.sort()
|
|
1954
|
+
: null;
|
|
1955
|
+
const filtres = duReprise
|
|
1956
|
+
? ['--', ...duReprise.map(n => `--filter=${n}`), '--filter=//']
|
|
1957
|
+
: restreinte
|
|
1958
|
+
? ['--', `--filter=...[${restreinte.avant}...${restreinte.apres}]`, '--filter=//']
|
|
1959
|
+
: [];
|
|
1947
1960
|
const commandes =
|
|
1948
1961
|
reportes && !reportes.rejouee
|
|
1949
1962
|
? []
|
|
1950
1963
|
: finale
|
|
1951
1964
|
? [{ args: ['run', 'verifier', ...filtres] }]
|
|
1952
|
-
: commandesDuPlan(ctx, liste);
|
|
1965
|
+
: commandesDuPlan(ctx, liste, fichiers);
|
|
1953
1966
|
const resultats = commandes.map(({ args, env }) => {
|
|
1954
1967
|
let r = npm(ctx, 'controles', args, env);
|
|
1955
1968
|
// The 75 of verifier is final (its wait for the lock reached its bound); a command of the
|
|
@@ -2008,14 +2021,12 @@ export function controles(ctx, finale, restreinte = null, reportes = null) {
|
|
|
2008
2021
|
? ` ; laissés à la passe finale, ${laisses.length} rouge(s) hors du plan`
|
|
2009
2022
|
: ''
|
|
2010
2023
|
}`;
|
|
2011
|
-
// Where the checks played: the final pass out of the envelope, on the
|
|
2012
|
-
//
|
|
2013
|
-
//
|
|
2024
|
+
// Where the checks played: the final pass out of the envelope, on the band of the lot (its base
|
|
2025
|
+
// and its dependents); the checks of the plan, its tests and packages, its guards in its
|
|
2026
|
+
// envelope.
|
|
2014
2027
|
const ou = !finale
|
|
2015
2028
|
? 'Contrôles du plan, ses tests et ses paquets, ses gardes dans son enveloppe'
|
|
2016
|
-
:
|
|
2017
|
-
? "Contrôles de la passe finale, hors enveloppe, restreinte à ce que le lot change depuis la relecture d'avant et à ses dépendants"
|
|
2018
|
-
: 'Contrôles de la passe finale, hors enveloppe, sur la copie entière';
|
|
2029
|
+
: 'Contrôles de la passe finale, hors enveloppe, sur la bande du lot (sa base et ses dépendants)';
|
|
2019
2030
|
const ligne = r => [`- ${r.texte}`, ...(r.detail ? ['', r.detail, ''] : [])];
|
|
2020
2031
|
const nomDuPaquet = r => r.paquet ?? 'hors des paquets';
|
|
2021
2032
|
const journal = `Le journal du ticket, pour le détail des commandes : ${ctx.journal}`;
|
|
@@ -2088,15 +2099,20 @@ export function controles(ctx, finale, restreinte = null, reportes = null) {
|
|
|
2088
2099
|
// plan and each the lot touches in it, `npm test -- <test files of the lot>` that none of them
|
|
2089
2100
|
// holds (the shared test material's out of the plan), each test played once, then the guards in
|
|
2090
2101
|
// the envelope of the plan, whose findings on its files alone count.
|
|
2091
|
-
function commandesDuPlan(ctx, liste) {
|
|
2102
|
+
function commandesDuPlan(ctx, liste, seuls = null) {
|
|
2092
2103
|
const lot = changements(ctx);
|
|
2093
2104
|
const touches = liste.length
|
|
2094
2105
|
? [...new Set(lot.map(c => paquetDe(liste, c.fichier)).filter(d => d !== '.'))].sort()
|
|
2095
2106
|
: ['.'];
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2107
|
+
// Resumed at a red (<seuls>, the test files it names): these tests alone, no package whole.
|
|
2108
|
+
const entiers = seuls
|
|
2109
|
+
? []
|
|
2110
|
+
: [
|
|
2111
|
+
...new Set([...touches.filter(d => dansLePlan(ctx, d)), ...paquetsDuPlan(ctx, liste)]),
|
|
2112
|
+
].sort();
|
|
2113
|
+
const tests = (seuls ?? testsDuLot(ctx)).filter(
|
|
2114
|
+
f => !entiers.some(d => d === '.' || f.startsWith(`${d}/`))
|
|
2115
|
+
);
|
|
2100
2116
|
const scripts = lireJson(path.join(ctx.copie, 'package.json'))?.scripts ?? {};
|
|
2101
2117
|
const enveloppe = { [VARIABLE_ENVELOPPE]: ecrireLaListe(ctx.paquets) };
|
|
2102
2118
|
return [
|
|
@@ -2176,6 +2192,63 @@ export function empreinte(ctx, chemins = ctx.paquets) {
|
|
|
2176
2192
|
return h.digest('hex');
|
|
2177
2193
|
}
|
|
2178
2194
|
|
|
2195
|
+
// The fingerprint of the step <etape> (`preuve`, `controles`, `passe-finale`) on the copy
|
|
2196
|
+
// (scripts/reprise.mjs `empreinteDEtape`): its command and the hashes of what it reads, each
|
|
2197
|
+
// package of the plan and its dependents by the hash of its test task in the plan of Turborepo
|
|
2198
|
+
// (`turbo run test:unit --filter=...<package> --dry=json`: the hash of the inputs of a task), the
|
|
2199
|
+
// files of the plan in the copy (`empreinte`), and the configuration at the root of the copy by
|
|
2200
|
+
// its content. Null when Turborepo does not give its plan: nothing is then read back.
|
|
2201
|
+
export function empreinteDeLEtape(ctx, etape) {
|
|
2202
|
+
const liste = composantsDe(ctx.copie).filter(p => !p.hors);
|
|
2203
|
+
const commande =
|
|
2204
|
+
etape === 'preuve'
|
|
2205
|
+
? `preuve ${testsDuLot(ctx).join(' ')}`
|
|
2206
|
+
: etape === 'controles'
|
|
2207
|
+
? JSON.stringify(commandesDuPlan(ctx, liste))
|
|
2208
|
+
: 'npm run verifier';
|
|
2209
|
+
const noms = liste
|
|
2210
|
+
.filter(p => dansLePlan(ctx, p.dossier))
|
|
2211
|
+
.map(p => p.pkg.name)
|
|
2212
|
+
.filter(Boolean)
|
|
2213
|
+
.sort();
|
|
2214
|
+
const empreintes = langageDe(ctx.copie).empreintes(ctx.copie, noms);
|
|
2215
|
+
if (!empreintes) {
|
|
2216
|
+
return null;
|
|
2217
|
+
}
|
|
2218
|
+
const hashes = { plan: empreinte(ctx), ...empreintes };
|
|
2219
|
+
const racine = createHash('sha256');
|
|
2220
|
+
for (const f of readdirSync(ctx.copie).sort()) {
|
|
2221
|
+
const chemin = path.join(ctx.copie, f);
|
|
2222
|
+
if (statSync(chemin, { throwIfNoEntry: false })?.isFile()) {
|
|
2223
|
+
racine.update(f).update(readFileSync(chemin));
|
|
2224
|
+
}
|
|
2225
|
+
}
|
|
2226
|
+
hashes['//'] = racine.digest('hex');
|
|
2227
|
+
return empreinteDEtape({ commande, hashes });
|
|
2228
|
+
}
|
|
2229
|
+
|
|
2230
|
+
// The test files and the files of code a red lies in (<lieux>, the places of the red as the
|
|
2231
|
+
// checks name them) that the testwriter and the developpeur carry (scripts/reprise.mjs
|
|
2232
|
+
// `attribuerLeRouge`): `{ tests, code }`. The testwriter carries the test files of the lot; the
|
|
2233
|
+
// developpeur, every other file of a path of the plan.
|
|
2234
|
+
export function portesDuRouge(ctx, lieux) {
|
|
2235
|
+
const dulot = new Set(
|
|
2236
|
+
changements(ctx)
|
|
2237
|
+
.filter(c => !c.supprime && duTestwriter(ctx, c.fichier))
|
|
2238
|
+
.map(c => c.fichier)
|
|
2239
|
+
);
|
|
2240
|
+
const nommes = [...new Set((lieux ?? []).map(l => l.fichier).filter(Boolean))];
|
|
2241
|
+
return {
|
|
2242
|
+
tests: nommes.filter(f => dulot.has(f)),
|
|
2243
|
+
code: nommes.filter(f => !dulot.has(f) && dansLePlan(ctx, f)),
|
|
2244
|
+
};
|
|
2245
|
+
}
|
|
2246
|
+
|
|
2247
|
+
// Whether the plan names `.`, which holds the whole copy.
|
|
2248
|
+
function nommeLaRacine(ctx) {
|
|
2249
|
+
return ctx.paquets.includes('.');
|
|
2250
|
+
}
|
|
2251
|
+
|
|
2179
2252
|
// Whether a path of the plan holds <chemin> (relative to the copy), `.` holding every path.
|
|
2180
2253
|
function dansLePlan(ctx, chemin) {
|
|
2181
2254
|
return ctx.paquets.some(c => c === '.' || chemin === c || chemin.startsWith(`${c}/`));
|
package/scripts/aiguillage.mjs
CHANGED
|
@@ -148,7 +148,9 @@ export function versionDeLOutil(racine = process.cwd()) {
|
|
|
148
148
|
return null;
|
|
149
149
|
}
|
|
150
150
|
const v = pkg?.grillhouse?.outil;
|
|
151
|
-
if (v === undefined || v === null)
|
|
151
|
+
if (v === undefined || v === null) {
|
|
152
|
+
return null;
|
|
153
|
+
}
|
|
152
154
|
if (typeof v !== 'string' || !X_Y_Z.test(v)) {
|
|
153
155
|
throw new Error(`la clé ${CLE} vaut ${JSON.stringify(v)}, pas une version x.y.z.`);
|
|
154
156
|
}
|
|
@@ -167,12 +169,18 @@ export function aiguillage(
|
|
|
167
169
|
nom,
|
|
168
170
|
{ racine = process.cwd(), cache = cacheDesOutils(), paquet = PAQUET_QUI_TOURNE } = {}
|
|
169
171
|
) {
|
|
170
|
-
if (!REDIRIGEES.has(nom))
|
|
172
|
+
if (!REDIRIGEES.has(nom)) {
|
|
173
|
+
return null;
|
|
174
|
+
}
|
|
171
175
|
const version = versionDeLOutil(racine);
|
|
172
|
-
if (version === null)
|
|
176
|
+
if (version === null) {
|
|
177
|
+
return null;
|
|
178
|
+
}
|
|
173
179
|
const dossier = dossierDeLOutil(version, cache);
|
|
174
180
|
const commande = commandeDans(dossier);
|
|
175
|
-
if (realpath(paquet) === realpath(path.resolve(path.dirname(commande), '..')))
|
|
181
|
+
if (realpath(paquet) === realpath(path.resolve(path.dirname(commande), '..'))) {
|
|
182
|
+
return null;
|
|
183
|
+
}
|
|
176
184
|
return { version, dossier, commande };
|
|
177
185
|
}
|
|
178
186
|
|
|
@@ -206,7 +214,9 @@ export function echecDeLOutil(racine = process.cwd(), { cache = cacheDesOutils()
|
|
|
206
214
|
} catch {
|
|
207
215
|
return null;
|
|
208
216
|
}
|
|
209
|
-
if (version === null)
|
|
217
|
+
if (version === null) {
|
|
218
|
+
return null;
|
|
219
|
+
}
|
|
210
220
|
const f = fichierDEchec(version, cache);
|
|
211
221
|
// A failure written after another launch installed the version: the version stands.
|
|
212
222
|
if (existsSync(commandeDans(dossierDeLOutil(version, cache)))) {
|
|
@@ -228,7 +238,9 @@ function balayer(cache) {
|
|
|
228
238
|
}
|
|
229
239
|
for (const e of entrees) {
|
|
230
240
|
const pid = Number(/\.installation-(\d+)$/.exec(e)?.[1]);
|
|
231
|
-
if (pid && !vivant(pid))
|
|
241
|
+
if (pid && !vivant(pid)) {
|
|
242
|
+
rmSync(path.join(cache, e), { recursive: true, force: true });
|
|
243
|
+
}
|
|
232
244
|
}
|
|
233
245
|
}
|
|
234
246
|
|
|
@@ -250,7 +262,9 @@ function npmInstall(npm, prefixe, specs) {
|
|
|
250
262
|
{ stdio: ['ignore', 2, 'pipe'], encoding: 'utf8' }
|
|
251
263
|
);
|
|
252
264
|
process.stderr.write(r.stderr ?? '');
|
|
253
|
-
if (r.status === 0)
|
|
265
|
+
if (r.status === 0) {
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
254
268
|
const ligne = String(r.stderr ?? '')
|
|
255
269
|
.trim()
|
|
256
270
|
.split('\n')
|
|
@@ -275,10 +289,14 @@ export function installer(
|
|
|
275
289
|
{ cache = cacheDesOutils(), npm = 'npm', retenue = RETENUE_MS } = {}
|
|
276
290
|
) {
|
|
277
291
|
const dossier = dossierDeLOutil(version, cache);
|
|
278
|
-
if (existsSync(commandeDans(dossier)))
|
|
292
|
+
if (existsSync(commandeDans(dossier))) {
|
|
293
|
+
return { dossier, installe: false };
|
|
294
|
+
}
|
|
279
295
|
const echec = fichierDEchec(version, cache);
|
|
280
296
|
const garde = lireLEchec(echec);
|
|
281
|
-
if (garde && Date.now() - Date.parse(garde.date) < retenue)
|
|
297
|
+
if (garde && Date.now() - Date.parse(garde.date) < retenue) {
|
|
298
|
+
throw new Error(garde.raison);
|
|
299
|
+
}
|
|
282
300
|
mkdirSync(cache, { recursive: true });
|
|
283
301
|
balayer(cache);
|
|
284
302
|
const chantier = `${dossier}.installation-${process.pid}`;
|
|
@@ -291,7 +309,9 @@ export function installer(
|
|
|
291
309
|
readFileSync(path.join(chantier, 'node_modules', NOM_DU_PAQUET, 'package.json'), 'utf8')
|
|
292
310
|
);
|
|
293
311
|
const pairs = Object.entries(pkg.peerDependencies ?? {}).map(([n, r]) => `${n}@${r}`);
|
|
294
|
-
if (pairs.length)
|
|
312
|
+
if (pairs.length) {
|
|
313
|
+
npmInstall(npm, chantier, pairs);
|
|
314
|
+
}
|
|
295
315
|
if (!existsSync(commandeDans(chantier))) {
|
|
296
316
|
throw new Error(`npm n'a pas posé la commande de ${NOM_DU_PAQUET}@${version}`);
|
|
297
317
|
}
|
|
@@ -305,7 +325,9 @@ export function installer(
|
|
|
305
325
|
renameSync(chantier, dossier);
|
|
306
326
|
} catch (e) {
|
|
307
327
|
// Another launch installed it meanwhile: its folder stands.
|
|
308
|
-
if (!existsSync(commandeDans(dossier)))
|
|
328
|
+
if (!existsSync(commandeDans(dossier))) {
|
|
329
|
+
throw e;
|
|
330
|
+
}
|
|
309
331
|
}
|
|
310
332
|
return { dossier, installe: true };
|
|
311
333
|
} finally {
|
package/scripts/avancement.mjs
CHANGED
|
@@ -105,7 +105,9 @@ export function ouvrirAvancement({ racine, genre = null, dans = tmpdir(), debut
|
|
|
105
105
|
* @param {{ racine: string, taches: { hash: string, cache: boolean }[] }} o
|
|
106
106
|
*/
|
|
107
107
|
export function inscrireLePlan(dossier, { racine, taches }) {
|
|
108
|
-
if (!dossier || !taches.length)
|
|
108
|
+
if (!dossier || !taches.length) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
109
111
|
const { taches: connues } = lireLesTotaux(racine);
|
|
110
112
|
try {
|
|
111
113
|
for (const t of taches.filter(x => x.cache)) {
|
|
@@ -133,11 +135,16 @@ function enregistrements(dossier) {
|
|
|
133
135
|
const sans = [];
|
|
134
136
|
for (const f of lister(path.join(dossier, TACHES))) {
|
|
135
137
|
const e = lireJson(path.join(dossier, TACHES, f));
|
|
136
|
-
if (!e || !Number.isFinite(e.faits) || !Number.isFinite(e.prevus))
|
|
137
|
-
|
|
138
|
-
|
|
138
|
+
if (!e || !Number.isFinite(e.faits) || !Number.isFinite(e.prevus)) {
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
if (!e.hash) {
|
|
142
|
+
sans.push(e);
|
|
143
|
+
} else {
|
|
139
144
|
const avant = parHash.get(e.hash);
|
|
140
|
-
if (!avant || (!e.cache && (avant.cache || e.a > avant.a)))
|
|
145
|
+
if (!avant || (!e.cache && (avant.cache || e.a > avant.a))) {
|
|
146
|
+
parHash.set(e.hash, e);
|
|
147
|
+
}
|
|
141
148
|
}
|
|
142
149
|
}
|
|
143
150
|
return [...parHash.values(), ...sans];
|
|
@@ -151,7 +158,9 @@ function enregistrements(dossier) {
|
|
|
151
158
|
*/
|
|
152
159
|
export function lireAvancement(dossier) {
|
|
153
160
|
const passe = lireJson(path.join(dossier, PASSE));
|
|
154
|
-
if (!passe)
|
|
161
|
+
if (!passe) {
|
|
162
|
+
return null;
|
|
163
|
+
}
|
|
155
164
|
const liste = enregistrements(dossier);
|
|
156
165
|
const faits = liste.reduce((s, e) => s + e.faits, 0);
|
|
157
166
|
const demarres = liste.reduce((s, e) => s + e.prevus, 0);
|
|
@@ -274,17 +283,25 @@ export function avecLAvancementDuTravail(travail, { racine, genre, garder = () =
|
|
|
274
283
|
*/
|
|
275
284
|
export function garderLeTotal(dossier) {
|
|
276
285
|
const passe = lireJson(path.join(dossier, PASSE));
|
|
277
|
-
if (!passe)
|
|
286
|
+
if (!passe) {
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
278
289
|
const t = totauxDe(passe.totaux ?? null);
|
|
279
|
-
if (!t.fichier)
|
|
290
|
+
if (!t.fichier) {
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
280
293
|
const liste = enregistrements(dossier);
|
|
281
|
-
if (passe.genre && liste.length)
|
|
294
|
+
if (passe.genre && liste.length) {
|
|
295
|
+
t.passes[passe.genre] = liste.reduce((s, e) => s + e.prevus, 0);
|
|
296
|
+
}
|
|
282
297
|
for (const e of liste.filter(x => x.hash && !x.cache)) {
|
|
283
298
|
delete t.taches[e.hash];
|
|
284
299
|
t.taches[e.hash] = e.prevus;
|
|
285
300
|
}
|
|
286
301
|
const cles = Object.keys(t.taches);
|
|
287
|
-
for (const c of cles.slice(0, Math.max(0, cles.length - TACHES_GARDEES)))
|
|
302
|
+
for (const c of cles.slice(0, Math.max(0, cles.length - TACHES_GARDEES))) {
|
|
303
|
+
delete t.taches[c];
|
|
304
|
+
}
|
|
288
305
|
try {
|
|
289
306
|
ecrireAtomique(t.fichier, { passes: t.passes, taches: t.taches });
|
|
290
307
|
} catch {
|