@roomi-fields/grillhouse 0.30.0 → 0.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +48 -0
- package/agents/developpeur.md +0 -1
- package/agents/explorateur.md +0 -1
- package/agents/questionneur.md +0 -1
- package/agents/testwriter.md +0 -1
- package/dist/temporal/circuit/client.d.ts +2 -2
- package/dist/temporal/circuit/client.js.map +1 -1
- package/dist/temporal/circuit/commande.js +4 -4
- package/dist/temporal/circuit/commande.js.map +1 -1
- package/dist/temporal/circuit/contrat.d.ts +3 -3
- package/dist/temporal/circuit/contrat.js +8 -2
- package/dist/temporal/circuit/contrat.js.map +1 -1
- package/dist/temporal/circuit/deroule.js +3 -3
- package/dist/temporal/circuit/deroule.js.map +1 -1
- package/dist/temporal/commande.js +5 -6
- package/dist/temporal/commande.js.map +1 -1
- package/dist/temporal/installation.d.ts +3 -6
- package/dist/temporal/installation.js +19 -38
- package/dist/temporal/installation.js.map +1 -1
- package/dist/temporal/tickets/activites.d.ts +1 -0
- package/dist/temporal/tickets/activites.js +5 -0
- package/dist/temporal/tickets/activites.js.map +1 -1
- package/dist/temporal/tickets/contrat.d.ts +10 -0
- package/dist/temporal/tickets/deroule.js +8 -1
- package/dist/temporal/tickets/deroule.js.map +1 -1
- package/docs/ARCHITECTURE.md +119 -27
- package/docs/CADRE.md +20 -0
- package/docs/INTERFACE.md +17 -4
- package/hooks/hooks.json +4 -0
- package/package.json +2 -2
- package/scripts/activites.mjs +155 -84
- package/scripts/aiguillage.mjs +35 -11
- package/scripts/attente-au-tour.mjs +99 -0
- package/scripts/avancement.mjs +27 -10
- package/scripts/base-des-workflows.mjs +57 -0
- package/scripts/bilan.mjs +101 -25
- package/scripts/cadre.mjs +5 -2
- package/scripts/circuit.mjs +173 -58
- package/scripts/composants-affectes.mjs +64 -21
- package/scripts/composition-des-langages.mjs +5 -3
- package/scripts/conformite.mjs +54 -19
- package/scripts/copies-finies.mjs +8 -1
- package/scripts/dependances-internes.mjs +9 -3
- package/scripts/dernier-vert.mjs +84 -23
- package/scripts/dette.mjs +32 -11
- package/scripts/donnees-cles.mjs +24 -8
- package/scripts/droits.mjs +40 -15
- package/scripts/effets.mjs +9 -0
- package/scripts/empreinte-d-etape.mjs +17 -0
- package/scripts/engendres.mjs +15 -5
- package/scripts/enveloppe/enveloppe.mjs +141 -48
- package/scripts/enveloppe/travail-de-la-copie.mjs +36 -12
- package/scripts/etapes.mjs +1 -1
- package/scripts/faits-du-circuit.mjs +1 -1
- package/scripts/flux-des-paquets.mjs +21 -7
- package/scripts/gardes-du-cadre.mjs +9 -3
- package/scripts/init.mjs +11 -4
- package/scripts/integration/file.mjs +84 -29
- package/scripts/integration/integrer.mjs +70 -24
- package/scripts/integration/rejeu.mjs +26 -9
- package/scripts/jointure.d.ts +10 -1
- package/scripts/journal-des-etats.d.mts +41 -0
- package/scripts/journal-des-etats.mjs +273 -0
- package/scripts/journal.mjs +119 -0
- package/scripts/langages/cargo/commandes.mjs +97 -18
- package/scripts/langages/cargo/composants.mjs +24 -8
- package/scripts/langages/cargo/index.mjs +7 -0
- package/scripts/langages/cargo/tests-de-head.mjs +25 -9
- package/scripts/langages/python/commandes.mjs +3 -1
- package/scripts/langages/python/index.mjs +6 -0
- package/scripts/langages/typescript/chemins-des-tests.mjs +6 -2
- package/scripts/langages/typescript/composants.mjs +9 -3
- package/scripts/langages/typescript/consommateurs-arbitres.mjs +40 -14
- package/scripts/langages/typescript/consommateurs.mjs +39 -14
- package/scripts/langages/typescript/elements-du-lot.mjs +36 -12
- package/scripts/langages/typescript/frontieres.mjs +112 -22
- package/scripts/langages/typescript/index-interfaces.mjs +36 -13
- package/scripts/langages/typescript/index.mjs +12 -3
- package/scripts/langages/typescript/interfaces-contre-code.mjs +109 -41
- package/scripts/langages/typescript/lecteurs.mjs +36 -11
- package/scripts/langages/typescript/migrations/0.23.0-config-vitest.mjs +15 -5
- package/scripts/langages/typescript/migrations/0.25.0-chemins-des-tests.mjs +6 -2
- package/scripts/langages/typescript/migrations/0.25.0-tailles-des-tests.mjs +6 -2
- package/scripts/langages/typescript/migrations/0.30.0-tailles-des-outils-lourds.mjs +3 -1
- package/scripts/langages/typescript/parcours.mjs +12 -4
- package/scripts/langages/typescript/regle-des-tests.mjs +9 -3
- package/scripts/langages/typescript/resumes.mjs +9 -3
- package/scripts/langages/typescript/tailles-des-tests.mjs +58 -16
- package/scripts/langages/typescript/tests-de-nuit.mjs +3 -1
- package/scripts/langages/typescript/tests.mjs +24 -8
- package/scripts/langages/typescript/titres-de-tests.mjs +35 -12
- package/scripts/langages/typescript/turbo-des-paquets.mjs +152 -51
- package/scripts/langages/typescript/verdict.mjs +3 -1
- package/scripts/langages/typescript/verifier.mjs +61 -14
- package/scripts/langages/typescript/vitest-config/avancement.reporter.mjs +15 -5
- package/scripts/langages/typescript/vitest-config/base.mjs +10 -2
- package/scripts/langages/typescript/vitest-config/changements.mjs +21 -8
- package/scripts/langages/typescript/vitest-config/delais.mjs +9 -3
- package/scripts/langages/typescript/vitest-config/duree.classement.mjs +12 -4
- package/scripts/langages/typescript/vitest-config/duree.reporter.mjs +17 -6
- package/scripts/langages/typescript/vitest-config/lances.mjs +83 -27
- package/scripts/langages/typescript/vitest-config/machine.setup.mjs +7 -0
- package/scripts/langages/typescript/vitest-config/resultats.mjs +3 -1
- package/scripts/langages.d.mts +20 -0
- package/scripts/lint-des-scripts.mjs +58 -0
- package/scripts/matiere-de-test.d.ts +11 -0
- package/scripts/mesure/base-de-passe.mjs +117 -25
- package/scripts/mesure/pression.mjs +9 -3
- package/scripts/migrations/0.23.0-charte-importee.mjs +6 -2
- package/scripts/migrations/0.23.0-crochets-de-seance.mjs +25 -8
- package/scripts/migrations/0.23.0-marche-du-projet.mjs +18 -6
- package/scripts/migrations/0.23.2-copies-du-cadre.mjs +48 -16
- package/scripts/migrations/0.24.12-tri-des-decouvertes.mjs +6 -2
- package/scripts/migrations/0.25.0-script-des-tests.mjs +15 -5
- package/scripts/migrations/0.30.0-ci-appelle-la-verification.mjs +6 -2
- package/scripts/migrations/0.31.0-paquets-dans-le-graphe.mjs +7 -7
- package/scripts/nuit.sh +24 -0
- package/scripts/outil.mjs +3 -1
- package/scripts/outils-cles.mjs +18 -7
- package/scripts/paquet-npm.mjs +15 -5
- package/scripts/paquets.mjs +12 -4
- package/scripts/passe-de-la-machine.mjs +7 -2
- package/scripts/places-de-la-machine.mjs +72 -12
- package/scripts/preparation.mjs +15 -5
- package/scripts/registre.mjs +6 -2
- package/scripts/reprise.mjs +66 -0
- package/scripts/resultats.mjs +105 -37
- package/scripts/seances.mjs +22 -4
- package/scripts/services-du-noyau.mjs +1 -0
- package/scripts/sous-commandes.mjs +5 -1
- package/scripts/style-a-l-ecriture.mjs +48 -17
- package/scripts/superviseur.mjs +127 -75
- package/scripts/tableau.mjs +133 -10
- package/scripts/taches-du-graphe.mjs +33 -13
- package/scripts/ticket-du-circuit.mjs +40 -0
- package/scripts/transitions.mjs +159 -29
- package/scripts/verrou-de-fichier.mjs +6 -2
- package/scripts/verrou-de-machine.mjs +123 -39
- package/scripts/verrous/commande.mjs +50 -17
- package/scripts/verrous/ticket-du-sous-agent.mjs +9 -3
- package/scripts/verrous/verrou.mjs +42 -14
- package/skills/developpeur/SKILL.md +1 -1
- package/skills/explorateur/SKILL.md +8 -2
- package/skills/grill/SKILL.md +3 -57
- package/skills/grill/references/paquets.md +60 -0
- package/skills/mesure/SKILL.md +3 -0
- package/skills/pitmaster/SKILL.md +16 -27
- package/skills/questionneur/SKILL.md +1 -1
- package/skills/relecteur/SKILL.md +2 -2
- package/skills/testwriter/SKILL.md +19 -7
- package/skills/release/SKILL.md +0 -134
- package/skills/release/scripts/update-version.cjs +0 -92
package/scripts/circuit.mjs
CHANGED
|
@@ -260,7 +260,10 @@
|
|
|
260
260
|
// of its paths and the content of each file it lists, taken before and after the session; the
|
|
261
261
|
// sheet and the handover do not count) has nothing to deliver, the gesture `rien-a-livrer`, as a
|
|
262
262
|
// CI skips a job without object: the checks judge the lot; green, the run goes on; red, the
|
|
263
|
-
// circuit stops at « sans-livraison », its report sending to the developpeur's handover
|
|
263
|
+
// circuit stops at « sans-livraison », its report sending to the developpeur's handover; but the
|
|
264
|
+
// red of a reference the lot lowers, the debt of the guards (its notes `a-elaguer`), is
|
|
265
|
+
// regenerated (4.2) instead of stopping, and the checks of the plan play again on the
|
|
266
|
+
// regenerated tree. A
|
|
264
267
|
// developpeur that `--depuis developpeur` launches on the lot the integration refused (`refus`,
|
|
265
268
|
// the fingerprint of its plan), as a merge queue lets a lot it sends back pass again only with a
|
|
266
269
|
// change, a session that changes nothing does not go to the checks of the copy, which do not see
|
|
@@ -309,14 +312,12 @@
|
|
|
309
312
|
// changed since the last green of the copy (scripts/dernier-vert.mjs, main's while the copy has
|
|
310
313
|
// none); what the lot reaches plays again, by the dependencies, the inputs of the tasks and
|
|
311
314
|
// `grillhouse.lit` (a reader out of the plan whose tests read a directory the lot changes
|
|
312
|
-
// included).
|
|
313
|
-
//
|
|
314
|
-
// (`laPasseFinale`): the circuit keeps the copy as it stands as a commit on
|
|
315
|
-
//
|
|
316
|
-
//
|
|
317
|
-
//
|
|
318
|
-
// base, the lot read, where a single `[<commit>]` would be read against HEAD. The whole final
|
|
319
|
-
// pass green keeps the tree of its lot (`verifie`). A red of a package of the plan goes to the
|
|
315
|
+
// included). The final pass always plays the band of the lot, never the whole repository, as
|
|
316
|
+
// Bazel and Nx `affected` play the reverse-dependency closure of a change
|
|
317
|
+
// (`laPasseFinale`): the circuit keeps the copy as it stands as a commit on the copy's HEAD,
|
|
318
|
+
// the base of the lot, and plays `npm run verifier --
|
|
319
|
+
// --filter=...[<base>...<copie>] --filter=//`, the root's tasks (the guards) with them; the
|
|
320
|
+
// complete one is the night's and the integration's. The final pass green on the band keeps the tree of its lot (`verifie`). A red of a package of the plan goes to the
|
|
320
321
|
// developpeur, three sessions for the final pass, counted apart from those of the checks, the
|
|
321
322
|
// third on the strong model. A red in a package out of the plan, or that no package of the plan
|
|
322
323
|
// holds, stops at « controles », a question for the supervisor: he extends the plan to that
|
|
@@ -368,7 +369,7 @@
|
|
|
368
369
|
// package that pass does not play again stands, and a regeneration that changes nothing plays no
|
|
369
370
|
// pass, every red of the pass before standing. What remains goes each to its owner, as any red
|
|
370
371
|
// of the final pass; a ceiling never rises (its command lowers it), so a lot beyond it stays red.
|
|
371
|
-
// That pass green
|
|
372
|
+
// That pass green keeps its tree as verified. The files regenerated stay in
|
|
372
373
|
// the copy: the lot carries them, without a word of the plan, as a genrule writes its output,
|
|
373
374
|
// and the reviewer reads them with the rest of the lot, the step's report among the circuit's. A
|
|
374
375
|
// file changed that the files of no reference run cover, or a command that fails stops at
|
|
@@ -394,10 +395,10 @@
|
|
|
394
395
|
// the 75 of verifier, the final pass's, is final (its wait for the lock of the machine reached
|
|
395
396
|
// its bound). A check still at 75 ends the circuit at 75, the gesture `a-repasser`. A red relaunches the developpeur
|
|
396
397
|
// with its report, twice at most, the third session on the strong model (`lancer.sh --modele
|
|
397
|
-
// opus
|
|
398
|
+
// opus`; the other sessions name `sonnet`, and none fixes the effort): three sessions for the checks, and three for the final pass.
|
|
398
399
|
// - After the final pass, green, the reviewer: a session out of the envelope, which sees the whole
|
|
399
400
|
// repository with its index, claude itself (`claude -p --agent relecteur --session-id <uuid>`,
|
|
400
|
-
// CLAUDE_BIN replaces claude) in the ticket's copy, on
|
|
401
|
+
// CLAUDE_BIN replaces claude) in the ticket's copy, on Sonnet, under the rights and the
|
|
401
402
|
// context of its role (scripts/droits.mjs: the commands its skill names, its index), its instruction from the second template of
|
|
402
403
|
// consigne-agent.md: the ticket, its plan, the path of the claims file (the ticket's
|
|
403
404
|
// description as `bd show` gives it at the session's launch, written by the circuit in its
|
|
@@ -451,7 +452,7 @@
|
|
|
451
452
|
// (`arretDuTestwriterSaute`; OSC Bridge SH-13y.1: three RENDU « Agent : testwriter » on a
|
|
452
453
|
// package whose tests no command of the frame plays, the developpeur relaunched on an empty
|
|
453
454
|
// diff each time); its question, declare the tests of the package or settle the finding.
|
|
454
|
-
// - ACCEPTÉ: the integration, once the
|
|
455
|
+
// - ACCEPTÉ: the integration, once the final pass has played its band on the lot accepted (its tree
|
|
455
456
|
// is `verifie`); else that pass first, once, its red going to the developpeur and the lot then
|
|
456
457
|
// to the reviewer again. The circuit builds the lot from the copy: the files the copy changes
|
|
457
458
|
// against its HEAD, the testwriter's (`estUnTest`: test files and the shared test material)
|
|
@@ -511,7 +512,7 @@
|
|
|
511
512
|
// agent; `boucles` the counts of the bounded loops of the step under way, by their key (`tests`,
|
|
512
513
|
// the testwriter's sessions with their proofs; `code`, the developpeur's with their checks;
|
|
513
514
|
// `relecture`, the reviews), null at a step without one; `finale` whether the final pass has
|
|
514
|
-
// begun; `verifie` the tree of the lot the last
|
|
515
|
+
// begun; `verifie` the tree of the lot the last final pass green played, null before;
|
|
515
516
|
// `mene` the start (an ISO date) of the step the circuit leads itself while it runs, null
|
|
516
517
|
// otherwise; `reprise` the session of the testwriter or developpeur its relaunches resume,
|
|
517
518
|
// `{ agent, seance }`, null before any; `refus` the integration's refusal of the lot (`{ rapport,
|
|
@@ -525,7 +526,12 @@
|
|
|
525
526
|
// lot, as bors retries: a refusal can come from the load or from main (BP 320.16, 320.16.2). On
|
|
526
527
|
// a stop « questionnement », it lets the plan pass as it is then (the supervisor
|
|
527
528
|
// changed it or kept it), from the testwriter.
|
|
528
|
-
// - `--depuis <testwriter|developpeur>`
|
|
529
|
+
// - `--depuis <testwriter|preuve|developpeur|controles|passe-finale>` (`departDepuis` of
|
|
530
|
+
// scripts/reprise.mjs) plays that step and the ones after it, no fingerprint kept (`verts`
|
|
531
|
+
// emptied, no resumption at a red): nothing is read back. Without it, a red of the checks or
|
|
532
|
+
// of the final pass resumes at the step that carries it, and a step whose inputs did not
|
|
533
|
+
// change since its last green is read back (scripts/transitions.mjs). With the developpeur's
|
|
534
|
+
// or the testwriter's step, it has the lot corrected: the whole ticket from
|
|
529
535
|
// that step, the text of `--contexte` the task at the head of each agent's instruction in the
|
|
530
536
|
// run, the reviewer's line CONTEXTE (after a stop
|
|
531
537
|
// « integration », from the developpeur, the refusal as his report, the red to lift, as a merge
|
|
@@ -640,11 +646,13 @@ import {
|
|
|
640
646
|
rapportDuRefus,
|
|
641
647
|
TESTS,
|
|
642
648
|
} from './transitions.mjs';
|
|
649
|
+
import { departDepuis } from './reprise.mjs';
|
|
643
650
|
import {
|
|
644
651
|
arbreDeLaCopie,
|
|
645
652
|
balayerLesSoeurs,
|
|
646
653
|
controles,
|
|
647
654
|
empreinte,
|
|
655
|
+
empreinteDeLEtape,
|
|
648
656
|
environnementDeLaPasse,
|
|
649
657
|
horsDeLEnveloppe,
|
|
650
658
|
integrer,
|
|
@@ -653,6 +661,7 @@ import {
|
|
|
653
661
|
leLotGarde,
|
|
654
662
|
lesReferences,
|
|
655
663
|
livre,
|
|
664
|
+
portesDuRouge,
|
|
656
665
|
preuve,
|
|
657
666
|
referencesDesRouges,
|
|
658
667
|
regenerer,
|
|
@@ -665,6 +674,7 @@ import {
|
|
|
665
674
|
ACTEUR,
|
|
666
675
|
Arret,
|
|
667
676
|
AUTEUR_DU_CIRCUIT,
|
|
677
|
+
codeDejaPresent,
|
|
668
678
|
commenter,
|
|
669
679
|
composantsDe,
|
|
670
680
|
derniereDe,
|
|
@@ -684,6 +694,7 @@ import {
|
|
|
684
694
|
sansCouleurs,
|
|
685
695
|
} from './ticket-du-circuit.mjs';
|
|
686
696
|
import { emettre } from './effets.mjs';
|
|
697
|
+
import { heureLocale } from './journal-des-etats.mjs';
|
|
687
698
|
import { consigne, auLancement, idDeSeance, jusquALaFiche, seance } from './seances.mjs';
|
|
688
699
|
import { releve } from './composants-affectes.mjs';
|
|
689
700
|
import { ligneDEtape, transcriptionsDeLaCopie } from './registre.mjs';
|
|
@@ -706,7 +717,7 @@ import { lesReponses } from './reponses-du-circuit.mjs';
|
|
|
706
717
|
// The time a session's transcripts may stand still before the circuit stops it.
|
|
707
718
|
export const IMMOBILE_MS = 20 * 60 * 1000;
|
|
708
719
|
// The exit code of each stop, from the list of the steps and stops.
|
|
709
|
-
export { ARRETS };
|
|
720
|
+
export { ARRETS, codeDejaPresent };
|
|
710
721
|
// The steps the circuit leads itself, with no agent: each one counts in the ticket's working time.
|
|
711
722
|
const MENEES = new Set(SUITE.filter(e => e.qui.includes(AUTO) && e.etat).map(e => e.etat));
|
|
712
723
|
|
|
@@ -754,7 +765,9 @@ function arbrePrincipal() {
|
|
|
754
765
|
const r = spawnSync('git', ['rev-parse', '--path-format=absolute', '--git-common-dir'], {
|
|
755
766
|
encoding: 'utf8',
|
|
756
767
|
});
|
|
757
|
-
if (r.status !== 0)
|
|
768
|
+
if (r.status !== 0) {
|
|
769
|
+
throw new Usage("le dossier courant n'est pas dans un dépôt git.");
|
|
770
|
+
}
|
|
758
771
|
return path.dirname(r.stdout.trim());
|
|
759
772
|
}
|
|
760
773
|
|
|
@@ -858,6 +871,8 @@ export function ecrireEtat(ctx, etat) {
|
|
|
858
871
|
paquets: ctx.paquets,
|
|
859
872
|
constats: ctx.constats ?? [],
|
|
860
873
|
verifie: ctx.verifie ?? null,
|
|
874
|
+
seanceReprise: ctx.seanceReprise ?? null,
|
|
875
|
+
verts: ctx.verts ?? null,
|
|
861
876
|
reprise: ctx.reprise ?? null,
|
|
862
877
|
aRegenerer: ctx.aRegenerer ?? null,
|
|
863
878
|
refus: ctx.refus ?? null,
|
|
@@ -865,6 +880,21 @@ export function ecrireEtat(ctx, etat) {
|
|
|
865
880
|
rang: ctx.rang ?? null,
|
|
866
881
|
};
|
|
867
882
|
emettre(ctx, { genre: 'etat', etat: { ...ctx.courant, journal: ctx.journal } });
|
|
883
|
+
// The same transition, dated, in the journal of states (scripts/journal-des-etats.mjs): its
|
|
884
|
+
// loop the first counted, its reason the stop's name or the cause of the return, empty for a
|
|
885
|
+
// normal transition.
|
|
886
|
+
emettre(ctx, {
|
|
887
|
+
genre: 'trace',
|
|
888
|
+
ligne: {
|
|
889
|
+
ts: heureLocale(),
|
|
890
|
+
genre: 'circuit',
|
|
891
|
+
ticket: ctx.ticket,
|
|
892
|
+
etape: etat.etape,
|
|
893
|
+
boucle: Object.values(etat.boucles ?? {})[0] ?? null,
|
|
894
|
+
place: null,
|
|
895
|
+
raison: etat.raison ?? '',
|
|
896
|
+
},
|
|
897
|
+
});
|
|
868
898
|
}
|
|
869
899
|
|
|
870
900
|
// The register's line of the step <etape> the circuit led itself from <debut> (an ISO date) to
|
|
@@ -902,7 +932,9 @@ export function avantLaPasse(
|
|
|
902
932
|
regeneration,
|
|
903
933
|
env = environnementDeLaPasse(ctx, process.env)
|
|
904
934
|
) {
|
|
905
|
-
if (!SUR_LA_POINTE.has(etape))
|
|
935
|
+
if (!SUR_LA_POINTE.has(etape)) {
|
|
936
|
+
return { avancee: false, regeneration };
|
|
937
|
+
}
|
|
906
938
|
const tete = dossier =>
|
|
907
939
|
spawnSync('git', ['-C', dossier, 'rev-parse', 'HEAD'], { encoding: 'utf8' });
|
|
908
940
|
const cible = tete(ctx.racine);
|
|
@@ -1061,7 +1093,9 @@ function arretHorsDuPlan(ctx, tentative, fiche) {
|
|
|
1061
1093
|
// checks when checks ran since the testwriter's session (`ctx.controlesRouges`); null without a
|
|
1062
1094
|
// sending.
|
|
1063
1095
|
function renvoiDe(ctx, fiche) {
|
|
1064
|
-
if (!fiche.renvoi)
|
|
1096
|
+
if (!fiche.renvoi) {
|
|
1097
|
+
return null;
|
|
1098
|
+
}
|
|
1065
1099
|
const passation = derniereDe(ctx, 'developpeur')?.text ?? 'aucune';
|
|
1066
1100
|
const raison = fiche.raison ? ` : ${fiche.raison}` : '';
|
|
1067
1101
|
const controles = ctx.controlesRouges
|
|
@@ -1083,8 +1117,9 @@ export function constatsOuverts(ctx, fiche, texte) {
|
|
|
1083
1117
|
const arret = raison =>
|
|
1084
1118
|
new Arret('relecture-arret', `${raison}\n\nLe verdict :\n\n${texte}`, { piece: raison });
|
|
1085
1119
|
const neufs = bloquantsDeLaFiche(fiche).map(c => {
|
|
1086
|
-
if (c.critere_en_cause)
|
|
1120
|
+
if (c.critere_en_cause) {
|
|
1087
1121
|
throw arret(`Le constat « ${c.titre} » met en cause un critère du ticket.`);
|
|
1122
|
+
}
|
|
1088
1123
|
if (!AGENTS_DU_LOT.includes(c.role)) {
|
|
1089
1124
|
throw arret(
|
|
1090
1125
|
`Le constat « ${c.titre} » n'a pas de destinataire valide : il nomme ${c.role ? `« ${c.role} »` : 'personne'}, quand le rôle est ${AGENTS_DU_LOT.join(' ou ')}.`
|
|
@@ -1107,7 +1142,9 @@ export function constatsOuverts(ctx, fiche, texte) {
|
|
|
1107
1142
|
// answers, so that the field survives the answer; null without a sheet of the plan.
|
|
1108
1143
|
export function ficheDuPlan(plans, champ) {
|
|
1109
1144
|
const derniere = plans.at(-1);
|
|
1110
|
-
if (!derniere)
|
|
1145
|
+
if (!derniere) {
|
|
1146
|
+
return null;
|
|
1147
|
+
}
|
|
1111
1148
|
if (derniere.reponse && !(champ in derniere.fiche) && plans.length > 1) {
|
|
1112
1149
|
return plans.at(-2).fiche;
|
|
1113
1150
|
}
|
|
@@ -1184,7 +1221,9 @@ export function commencerLEtape(ctx, { etape, tentative, rapport, finale }) {
|
|
|
1184
1221
|
// The end of a step of the run of <ctx> the circuit led itself (<menee>, null for another): its
|
|
1185
1222
|
// line to the register.
|
|
1186
1223
|
export function finirLEtape(ctx, menee) {
|
|
1187
|
-
if (menee)
|
|
1224
|
+
if (menee) {
|
|
1225
|
+
inscrireEtape(ctx, menee);
|
|
1226
|
+
}
|
|
1188
1227
|
}
|
|
1189
1228
|
|
|
1190
1229
|
// The stop <erreur> of the run of <ctx> at the step <etat>, written: any exception but an Arret is
|
|
@@ -1240,6 +1279,9 @@ export const MEMOIRE = [
|
|
|
1240
1279
|
'aRegenerer',
|
|
1241
1280
|
'verifie',
|
|
1242
1281
|
'constats',
|
|
1282
|
+
'verts',
|
|
1283
|
+
'reprise',
|
|
1284
|
+
'relancesTestwriter',
|
|
1243
1285
|
];
|
|
1244
1286
|
|
|
1245
1287
|
// The fact <fait> of the circuit of <ctx>, with its <parametres>, the facts <faits> of the step
|
|
@@ -1286,9 +1328,9 @@ export async function lireLeFait(ctx, fait, parametres, faits) {
|
|
|
1286
1328
|
const { fiche, constats } = await seance(ctx, role, {
|
|
1287
1329
|
...options,
|
|
1288
1330
|
constats: ctx.constats ?? [],
|
|
1289
|
-
reprise: ctx.
|
|
1331
|
+
reprise: ctx.seanceReprise ?? null,
|
|
1290
1332
|
retenir: reprise => {
|
|
1291
|
-
ctx.
|
|
1333
|
+
ctx.seanceReprise = reprise;
|
|
1292
1334
|
},
|
|
1293
1335
|
signeDeVie: ctx.ports?.signeDeVie,
|
|
1294
1336
|
seanceId: idDeSeance(ctx, `neuve:${role}`),
|
|
@@ -1305,14 +1347,19 @@ export async function lireLeFait(ctx, fait, parametres, faits) {
|
|
|
1305
1347
|
// own, and a measure is too large for the memory of the workflow.
|
|
1306
1348
|
const fichier = path.join(ctx.tmp, 'mesure-de-la-preuve.json');
|
|
1307
1349
|
const derniere = existsSync(fichier) ? JSON.parse(readFileSync(fichier, 'utf8')) : null;
|
|
1308
|
-
const
|
|
1350
|
+
const debut = Date.now();
|
|
1351
|
+
const { mesure, ...p } = preuve(ctx, { mesure: derniere, fichiers: parametres.fichiers });
|
|
1309
1352
|
if (mesure) {
|
|
1310
1353
|
writeFileSync(fichier, JSON.stringify(mesure));
|
|
1311
1354
|
} else {
|
|
1312
1355
|
rmSync(fichier, { force: true });
|
|
1313
1356
|
}
|
|
1314
|
-
return p;
|
|
1357
|
+
return { ...p, empreinte: empreinteDeLEtape(ctx, 'preuve'), ms: Date.now() - debut };
|
|
1315
1358
|
}
|
|
1359
|
+
case 'empreinteEtape':
|
|
1360
|
+
return empreinteDeLEtape(ctx, parametres.etape);
|
|
1361
|
+
case 'portes':
|
|
1362
|
+
return portesDuRouge(ctx, parametres.lieux);
|
|
1316
1363
|
case 'empreinteAvant':
|
|
1317
1364
|
case 'empreinte':
|
|
1318
1365
|
return empreinte(ctx);
|
|
@@ -1325,8 +1372,26 @@ export async function lireLeFait(ctx, fait, parametres, faits) {
|
|
|
1325
1372
|
return arbreDeLaCopie(ctx);
|
|
1326
1373
|
case 'passeFinale':
|
|
1327
1374
|
return laPasseFinale(ctx);
|
|
1328
|
-
case 'controles':
|
|
1329
|
-
|
|
1375
|
+
case 'controles': {
|
|
1376
|
+
const debut = Date.now();
|
|
1377
|
+
const k = controles(
|
|
1378
|
+
ctx,
|
|
1379
|
+
parametres.finale,
|
|
1380
|
+
parametres.restreinte,
|
|
1381
|
+
parametres.reportes,
|
|
1382
|
+
parametres.fichiers
|
|
1383
|
+
);
|
|
1384
|
+
const ms = Date.now() - debut;
|
|
1385
|
+
// The fingerprint of a green step, which its next pass on the same inputs reads back.
|
|
1386
|
+
return {
|
|
1387
|
+
...k,
|
|
1388
|
+
empreinte:
|
|
1389
|
+
k.rouge || k.aRepasser
|
|
1390
|
+
? null
|
|
1391
|
+
: empreinteDeLEtape(ctx, parametres.finale ? 'passe-finale' : 'controles'),
|
|
1392
|
+
ms,
|
|
1393
|
+
};
|
|
1394
|
+
}
|
|
1330
1395
|
case 'referencesDesRouges':
|
|
1331
1396
|
return referencesDesRouges(ctx, parametres.lieux, parametres.aElaguer);
|
|
1332
1397
|
case 'lotAccepte':
|
|
@@ -1342,7 +1407,9 @@ export async function lireLeFait(ctx, fait, parametres, faits) {
|
|
|
1342
1407
|
try {
|
|
1343
1408
|
return { constats: constatsOuverts(ctx, faits.relecture.fiche, faits.relecture.texte) };
|
|
1344
1409
|
} catch (e) {
|
|
1345
|
-
if (!(e instanceof Arret))
|
|
1410
|
+
if (!(e instanceof Arret)) {
|
|
1411
|
+
throw e;
|
|
1412
|
+
}
|
|
1346
1413
|
return { arret: { nom: e.nom, rapport: e.rapport, piece: e.piece } };
|
|
1347
1414
|
}
|
|
1348
1415
|
case 'integration': {
|
|
@@ -1368,19 +1435,29 @@ export async function lireLeFait(ctx, fait, parametres, faits) {
|
|
|
1368
1435
|
// The effect <e> of a decision of the circuit of <ctx>: a line at the ticket, a gesture, a report,
|
|
1369
1436
|
// a result kept.
|
|
1370
1437
|
export function appliquer(ctx, e) {
|
|
1371
|
-
if (e.genre === 'commenter')
|
|
1372
|
-
|
|
1373
|
-
else if (e.genre === '
|
|
1374
|
-
|
|
1375
|
-
else
|
|
1438
|
+
if (e.genre === 'commenter') {
|
|
1439
|
+
commenter(ctx, e.etape, e.texte);
|
|
1440
|
+
} else if (e.genre === 'geste') {
|
|
1441
|
+
geste(ctx, e.nom);
|
|
1442
|
+
} else if (e.genre === 'rapport') {
|
|
1443
|
+
ecrireRapport(ctx, e.etape, e.texte, e.resultat, e.rapport);
|
|
1444
|
+
} else if (e.genre === 'inscrire') {
|
|
1445
|
+
inscrire(ctx, { role: AUTEUR_DU_CIRCUIT, ...e.entree });
|
|
1446
|
+
} else {
|
|
1447
|
+
throw new Error(`effet inconnu des décisions du circuit : ${e.genre}`);
|
|
1448
|
+
}
|
|
1376
1449
|
}
|
|
1377
1450
|
|
|
1378
1451
|
// The Arret of the stop <a> a decision of the circuit of <ctx> returns: an agent's sheet that is
|
|
1379
1452
|
// not FAIT (`statut`) or that does not hold criteria out of the plan (`horsDuPlan`), with its
|
|
1380
1453
|
// handover; else its name, its report and its options.
|
|
1381
1454
|
export function arretDe(ctx, a) {
|
|
1382
|
-
if (a.statut)
|
|
1383
|
-
|
|
1455
|
+
if (a.statut) {
|
|
1456
|
+
return arretDuStatut(ctx, a.statut.role, a.statut.tentative, a.statut.fiche);
|
|
1457
|
+
}
|
|
1458
|
+
if (a.horsDuPlan) {
|
|
1459
|
+
return arretHorsDuPlan(ctx, a.horsDuPlan.tentative, a.horsDuPlan.fiche);
|
|
1460
|
+
}
|
|
1384
1461
|
const { nom, rapport, ...options } = a;
|
|
1385
1462
|
return new Arret(nom, rapport, options);
|
|
1386
1463
|
}
|
|
@@ -1429,30 +1506,41 @@ const laQuestion = (ticket, { arret, qui, ou, question }) =>
|
|
|
1429
1506
|
// the state <e> (null without one) on --reprendre, the integration or the queue played again on
|
|
1430
1507
|
// the same lot after their stop, as bors retries, else the testwriter, the run starting over.
|
|
1431
1508
|
function depart(ctx, e) {
|
|
1509
|
+
// A --depuis plays its step and the ones after it, no result read back: no fingerprint kept, no
|
|
1510
|
+
// resumption at a red, no attribution counted.
|
|
1511
|
+
if (ctx.depuis) {
|
|
1512
|
+
ctx.verts = {};
|
|
1513
|
+
ctx.reprise = null;
|
|
1514
|
+
ctx.relancesTestwriter = null;
|
|
1515
|
+
}
|
|
1432
1516
|
if (ctx.depuis === 'developpeur' && e?.raison === 'integration' && ctx.refus) {
|
|
1433
1517
|
ctx.refus = { ...ctx.refus, lance: true, relance: false };
|
|
1434
1518
|
return { etape: CODE, tentative: 1, rapport: rapportDuRefus(ctx.refus), finale: false };
|
|
1435
1519
|
}
|
|
1436
|
-
if (ctx.depuis === 'testwriter')
|
|
1520
|
+
if (ctx.depuis === 'testwriter') {
|
|
1521
|
+
ctx.refus = null;
|
|
1522
|
+
}
|
|
1437
1523
|
if (ctx.depuis) {
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
tentative: 1,
|
|
1441
|
-
rapport: null,
|
|
1442
|
-
finale: false,
|
|
1443
|
-
};
|
|
1524
|
+
const { etape, tentative, rapport, finale } = departDepuis(ctx.depuis);
|
|
1525
|
+
return { etape, tentative, rapport, finale };
|
|
1444
1526
|
}
|
|
1445
1527
|
if (!ctx.reprendre) {
|
|
1446
1528
|
// The run starts over: no lot verified, no finding of a review open, no refusal, no checks played.
|
|
1529
|
+
ctx.verts = null;
|
|
1530
|
+
ctx.reprise = null;
|
|
1531
|
+
ctx.relancesTestwriter = null;
|
|
1447
1532
|
ctx.verifie = null;
|
|
1448
1533
|
ctx.constats = [];
|
|
1449
1534
|
ctx.refus = null;
|
|
1450
1535
|
ctx.controlesRouges = null;
|
|
1451
1536
|
return { etape: TESTS, tentative: 1, rapport: null, finale: false };
|
|
1452
1537
|
}
|
|
1453
|
-
if (!e)
|
|
1454
|
-
|
|
1538
|
+
if (!e) {
|
|
1539
|
+
throw new Usage(`rien à reprendre : le circuit de ${ctx.ticket} n'a aucun état d'arrêt.`);
|
|
1540
|
+
}
|
|
1541
|
+
if (e.etape === 'integre') {
|
|
1455
1542
|
throw new Usage(`rien à reprendre : le lot de ${ctx.ticket} est intégré.`);
|
|
1543
|
+
}
|
|
1456
1544
|
return {
|
|
1457
1545
|
etape: e.etape,
|
|
1458
1546
|
tentative: e.etape === CONTROLES ? 0 : 1,
|
|
@@ -1534,7 +1622,9 @@ const lignesOuvertes = questions =>
|
|
|
1534
1622
|
function rubrique(ctx, titre) {
|
|
1535
1623
|
const lignes = lire(path.join(ctx.racine, 'CLAUDE.md')).split('\n');
|
|
1536
1624
|
const i = lignes.findIndex(l => l.trim() === `## ${titre}`);
|
|
1537
|
-
if (i < 0)
|
|
1625
|
+
if (i < 0) {
|
|
1626
|
+
return 'absente de la charte du projet (CLAUDE.md)';
|
|
1627
|
+
}
|
|
1538
1628
|
const fin = lignes.findIndex((l, j) => j > i && l.startsWith('## '));
|
|
1539
1629
|
return (
|
|
1540
1630
|
lignes
|
|
@@ -1595,8 +1685,11 @@ const texteDeLaSorte = sorte =>
|
|
|
1595
1685
|
function sectionsDe(description) {
|
|
1596
1686
|
const sections = [{ tete: null, lignes: [] }];
|
|
1597
1687
|
for (const l of description.trimEnd().split('\n')) {
|
|
1598
|
-
if (l.startsWith('## '))
|
|
1599
|
-
|
|
1688
|
+
if (l.startsWith('## ')) {
|
|
1689
|
+
sections.push({ tete: l, lignes: [] });
|
|
1690
|
+
} else {
|
|
1691
|
+
sections.at(-1).lignes.push(l);
|
|
1692
|
+
}
|
|
1600
1693
|
}
|
|
1601
1694
|
return sections;
|
|
1602
1695
|
}
|
|
@@ -1638,7 +1731,9 @@ export function decrireLePlan(description, criteres, questions, sorte = null, no
|
|
|
1638
1731
|
const ecrits = gardees[i].lignes.map(numerotee).filter(c => c !== null);
|
|
1639
1732
|
const ajouts = criteres.map(c => c.trim());
|
|
1640
1733
|
const avant = [...gardees[i].lignes];
|
|
1641
|
-
while (avant.length && avant.at(-1).trim() === '')
|
|
1734
|
+
while (avant.length && avant.at(-1).trim() === '') {
|
|
1735
|
+
avant.pop();
|
|
1736
|
+
}
|
|
1642
1737
|
const liste = ajouts.map((c, n) => `${ecrits.length + n + 1}. ${c}`);
|
|
1643
1738
|
gardees[i] = {
|
|
1644
1739
|
tete: gardees[i].tete,
|
|
@@ -1814,7 +1909,9 @@ export async function unPasDuPlan(ctx, pas, e) {
|
|
|
1814
1909
|
return r;
|
|
1815
1910
|
} catch (x) {
|
|
1816
1911
|
// A session of the plan that cannot end goes up, before any testwriter.
|
|
1817
|
-
if (!(x instanceof Arret))
|
|
1912
|
+
if (!(x instanceof Arret)) {
|
|
1913
|
+
throw x;
|
|
1914
|
+
}
|
|
1818
1915
|
return {
|
|
1819
1916
|
code: monter(ctx, {
|
|
1820
1917
|
code: ARRETS[x.nom],
|
|
@@ -1993,6 +2090,8 @@ export async function arreter(ctx, e) {
|
|
|
1993
2090
|
const lu = e;
|
|
1994
2091
|
ctx.constats = [...(lu.constats ?? [])];
|
|
1995
2092
|
ctx.verifie = lu.verifie ?? null;
|
|
2093
|
+
ctx.seanceReprise = lu.seanceReprise ?? null;
|
|
2094
|
+
ctx.verts = lu.verts ?? null;
|
|
1996
2095
|
ctx.reprise = lu.reprise ?? null;
|
|
1997
2096
|
ctx.refus = lu.refus ?? null;
|
|
1998
2097
|
ecrireEtat(ctx, {
|
|
@@ -2059,7 +2158,9 @@ function etendre(ctx, e) {
|
|
|
2059
2158
|
'plan',
|
|
2060
2159
|
`le superviseur étend le plan à ${ctx.etendre.join(', ')} : ${titre.split(' — ').at(-1)}.`
|
|
2061
2160
|
);
|
|
2062
|
-
if (!e)
|
|
2161
|
+
if (!e) {
|
|
2162
|
+
return e;
|
|
2163
|
+
}
|
|
2063
2164
|
ctx.contexte =
|
|
2064
2165
|
[e.question ? `${e.question.fait}\n\n${e.question.piece}` : null, ctx.contexte]
|
|
2065
2166
|
.filter(Boolean)
|
|
@@ -2075,7 +2176,9 @@ function etendre(ctx, e) {
|
|
|
2075
2176
|
// The opening of <ctx> on <e> before its plan: `{ debut }`, or `{ code }`, a stop gone up.
|
|
2076
2177
|
async function avantLePlan(ctx, e) {
|
|
2077
2178
|
if (ctx.etendre) {
|
|
2078
|
-
if (e?.etape === 'integre')
|
|
2179
|
+
if (e?.etape === 'integre') {
|
|
2180
|
+
throw new Usage(`--etendre : le lot de ${ctx.ticket} est intégré.`);
|
|
2181
|
+
}
|
|
2079
2182
|
e = etendre(ctx, e);
|
|
2080
2183
|
}
|
|
2081
2184
|
// The findings open at the launch of a run with the supervisor's context (`--contexte`, or the
|
|
@@ -2110,21 +2213,29 @@ async function avantLePlan(ctx, e) {
|
|
|
2110
2213
|
// The tools of the project, which every pass of the circuit plays with: a faulty key stops the
|
|
2111
2214
|
// run before any session, by its name.
|
|
2112
2215
|
const lancement = outilsAuLancement(ctx.racine);
|
|
2113
|
-
if (lancement.arret)
|
|
2216
|
+
if (lancement.arret) {
|
|
2217
|
+
return { code: monter(ctx, { ...lancement.arret, etat: d }) };
|
|
2218
|
+
}
|
|
2114
2219
|
ctx.outils = lancement.outils;
|
|
2115
2220
|
const donnees = donneesAuLancement(ctx.racine);
|
|
2116
|
-
if (donnees.arret)
|
|
2221
|
+
if (donnees.arret) {
|
|
2222
|
+
return { code: monter(ctx, { ...donnees.arret, etat: d }) };
|
|
2223
|
+
}
|
|
2117
2224
|
ctx.donnees = donnees.donnees;
|
|
2118
2225
|
// The generated files the project declares: references of the circuit, which 4.2 regenerates
|
|
2119
2226
|
// only when a red of a pass lies in their files (`referencesDesRouges`); the integration
|
|
2120
2227
|
// regenerates them whenever the lot touches their files or what they read.
|
|
2121
2228
|
const engendres = engendresAuLancement(ctx.racine);
|
|
2122
|
-
if (engendres.arret)
|
|
2229
|
+
if (engendres.arret) {
|
|
2230
|
+
return { code: monter(ctx, { ...engendres.arret, etat: d }) };
|
|
2231
|
+
}
|
|
2123
2232
|
ctx.engendres = engendres.engendres;
|
|
2124
2233
|
// The flows of the CI, refused at the launch when their key is faulty: the reviewer's instruction
|
|
2125
2234
|
// reads those the lot touches (`consigneDesFlux`).
|
|
2126
2235
|
const flux = fluxAuLancement(ctx.racine);
|
|
2127
|
-
if (flux.arret)
|
|
2236
|
+
if (flux.arret) {
|
|
2237
|
+
return { code: monter(ctx, { ...flux.arret, etat: d }) };
|
|
2238
|
+
}
|
|
2128
2239
|
return { debut: d };
|
|
2129
2240
|
}
|
|
2130
2241
|
|
|
@@ -2136,7 +2247,9 @@ async function avantLePlan(ctx, e) {
|
|
|
2136
2247
|
*/
|
|
2137
2248
|
export async function ouvrirJusquAuPlan(ctx, e) {
|
|
2138
2249
|
const o = await avantLePlan(ctx, e);
|
|
2139
|
-
if ('code' in o)
|
|
2250
|
+
if ('code' in o) {
|
|
2251
|
+
return o;
|
|
2252
|
+
}
|
|
2140
2253
|
const aEcrire = o.debut.etape === TESTS && !planPasse(ctx, empreinteDuPlan(leTicket(ctx)));
|
|
2141
2254
|
return { debut: o.debut, plan: aEcrire ? planAuDebut(ctx) : null };
|
|
2142
2255
|
}
|
|
@@ -2146,6 +2259,8 @@ export function finirLOuverture(ctx, d) {
|
|
|
2146
2259
|
// The sort of the ticket its plan says, which the run reads at each step.
|
|
2147
2260
|
ctx.sorte = sorteDuTicket(ctx);
|
|
2148
2261
|
// A sibling of HEAD's version a killed circuit left in the copy never enters the lot.
|
|
2149
|
-
if (existsSync(ctx.copie))
|
|
2262
|
+
if (existsSync(ctx.copie)) {
|
|
2263
|
+
balayerLesSoeurs(ctx);
|
|
2264
|
+
}
|
|
2150
2265
|
return { debut: d };
|
|
2151
2266
|
}
|