@roomi-fields/grillhouse 0.29.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 +769 -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/bin/grillhouse.mjs +79 -18
- package/cadre/templates/projet/.github/workflows/ci.yml +2 -13
- package/cadre/templates/projet/CLAUDE.md +5 -1
- package/cadre/templates/projet/docs/agents/issue-tracker.md +1 -1
- package/cadre/templates/projet/package.json +2 -2
- package/charte.md +24 -0
- package/dist/temporal/acte.d.ts +24 -0
- package/dist/temporal/acte.js +139 -0
- package/dist/temporal/acte.js.map +1 -0
- package/dist/temporal/attributs.d.ts +6 -0
- package/dist/temporal/attributs.js +15 -0
- package/dist/temporal/attributs.js.map +1 -0
- package/dist/temporal/circuit/activites.d.ts +13 -0
- package/dist/temporal/circuit/activites.js +33 -0
- package/dist/temporal/circuit/activites.js.map +1 -0
- package/dist/temporal/circuit/client.d.ts +72 -0
- package/dist/temporal/circuit/client.js +247 -0
- package/dist/temporal/circuit/client.js.map +1 -0
- package/dist/temporal/circuit/commande.d.ts +2 -0
- package/dist/temporal/circuit/commande.js +238 -0
- package/dist/temporal/circuit/commande.js.map +1 -0
- package/dist/temporal/circuit/contrat.d.ts +305 -0
- package/dist/temporal/circuit/contrat.js +30 -0
- package/dist/temporal/circuit/contrat.js.map +1 -0
- package/dist/temporal/circuit/deroule.d.ts +3 -0
- package/dist/temporal/circuit/deroule.js +540 -0
- package/dist/temporal/circuit/deroule.js.map +1 -0
- package/dist/temporal/client.d.ts +47 -0
- package/dist/temporal/client.js +69 -0
- package/dist/temporal/client.js.map +1 -0
- package/dist/temporal/commande.d.ts +2 -0
- package/dist/temporal/commande.js +94 -0
- package/dist/temporal/commande.js.map +1 -0
- package/dist/temporal/deroules.d.ts +5 -0
- package/dist/temporal/deroules.js +10 -0
- package/dist/temporal/deroules.js.map +1 -0
- package/dist/temporal/etat.d.ts +33 -0
- package/dist/temporal/etat.js +59 -0
- package/dist/temporal/etat.js.map +1 -0
- package/dist/temporal/file/activites.d.ts +10 -0
- package/dist/temporal/file/activites.js +25 -0
- package/dist/temporal/file/activites.js.map +1 -0
- package/dist/temporal/file/client.d.ts +4 -0
- package/dist/temporal/file/client.js +6 -0
- package/dist/temporal/file/client.js.map +1 -0
- package/dist/temporal/file/contrat.d.ts +158 -0
- package/dist/temporal/file/contrat.js +14 -0
- package/dist/temporal/file/contrat.js.map +1 -0
- package/dist/temporal/file/deroule.d.ts +15 -0
- package/dist/temporal/file/deroule.js +235 -0
- package/dist/temporal/file/deroule.js.map +1 -0
- package/dist/temporal/installation.d.ts +120 -0
- package/dist/temporal/installation.js +386 -0
- package/dist/temporal/installation.js.map +1 -0
- package/dist/temporal/places/activites.d.ts +8 -0
- package/dist/temporal/places/activites.js +13 -0
- package/dist/temporal/places/activites.js.map +1 -0
- package/dist/temporal/places/client.d.ts +28 -0
- package/dist/temporal/places/client.js +64 -0
- package/dist/temporal/places/client.js.map +1 -0
- package/dist/temporal/places/contrat.d.ts +106 -0
- package/dist/temporal/places/contrat.js +21 -0
- package/dist/temporal/places/contrat.js.map +1 -0
- package/dist/temporal/places/deroule.d.ts +3 -0
- package/dist/temporal/places/deroule.js +198 -0
- package/dist/temporal/places/deroule.js.map +1 -0
- package/dist/temporal/sonde/activites.d.ts +6 -0
- package/dist/temporal/sonde/activites.js +52 -0
- package/dist/temporal/sonde/activites.js.map +1 -0
- package/dist/temporal/sonde/contrat.d.ts +35 -0
- package/dist/temporal/sonde/contrat.js +10 -0
- package/dist/temporal/sonde/contrat.js.map +1 -0
- package/dist/temporal/sonde/deroule.d.ts +3 -0
- package/dist/temporal/sonde/deroule.js +39 -0
- package/dist/temporal/sonde/deroule.js.map +1 -0
- package/dist/temporal/tickets/activites.d.ts +7 -0
- package/dist/temporal/tickets/activites.js +81 -0
- package/dist/temporal/tickets/activites.js.map +1 -0
- package/dist/temporal/tickets/client.d.ts +10 -0
- package/dist/temporal/tickets/client.js +31 -0
- package/dist/temporal/tickets/client.js.map +1 -0
- package/dist/temporal/tickets/contrat.d.ts +56 -0
- package/dist/temporal/tickets/contrat.js +13 -0
- package/dist/temporal/tickets/contrat.js.map +1 -0
- package/dist/temporal/tickets/deroule.d.ts +3 -0
- package/dist/temporal/tickets/deroule.js +94 -0
- package/dist/temporal/tickets/deroule.js.map +1 -0
- package/dist/temporal/travailleur.d.ts +2 -0
- package/dist/temporal/travailleur.js +69 -0
- package/dist/temporal/travailleur.js.map +1 -0
- package/docs/ARCHITECTURE.md +646 -87
- package/docs/CADRE.md +27 -0
- package/docs/INTERFACE.md +139 -42
- package/hooks/crochet.mjs +19 -2
- package/hooks/hooks.json +11 -0
- package/package.json +16 -4
- package/scripts/activites.mjs +2255 -0
- package/scripts/aiguillage.d.mts +37 -0
- package/scripts/aiguillage.mjs +40 -14
- package/scripts/avancement.mjs +155 -26
- package/scripts/bilan.mjs +137 -43
- package/scripts/cadre.mjs +16 -4
- package/scripts/circuit.mjs +993 -4075
- package/scripts/circuits-cles.d.mts +4 -0
- package/scripts/circuits-cles.mjs +21 -0
- package/scripts/circuits-du-serveur.mjs +105 -0
- package/scripts/codes-de-sortie.mjs +9 -0
- package/scripts/commandes-composees.mjs +45 -41
- package/scripts/commandes-du-path.d.mts +7 -0
- package/scripts/commandes-du-path.mjs +25 -0
- package/scripts/composants-affectes.mjs +64 -21
- package/scripts/composition-des-langages.mjs +18 -12
- package/scripts/conformite.mjs +56 -28
- package/scripts/copies-finies.mjs +52 -47
- package/scripts/depart-du-ticket.d.mts +53 -0
- package/scripts/depart-du-ticket.mjs +124 -0
- package/scripts/dependances-internes.mjs +121 -0
- package/scripts/dernier-vert.mjs +61 -34
- package/scripts/dette.mjs +32 -11
- package/scripts/donnees-cles.mjs +244 -0
- package/scripts/droits.mjs +51 -16
- package/scripts/effets.mjs +352 -0
- package/scripts/empreinte-d-etape.mjs +17 -0
- package/scripts/engendres.mjs +15 -5
- package/scripts/enveloppe/enveloppe.mjs +259 -55
- package/scripts/enveloppe/lancer.sh +14 -18
- package/scripts/enveloppe/paquets-du-plan.mjs +2 -2
- package/scripts/enveloppe/travail-de-la-copie.mjs +41 -13
- package/scripts/etapes.mjs +5 -2
- package/scripts/faits-du-circuit.mjs +493 -0
- package/scripts/file-des-tickets.d.mts +21 -0
- package/scripts/file-des-tickets.mjs +58 -0
- package/scripts/flux-des-paquets.mjs +201 -0
- package/scripts/gardes-du-cadre.mjs +21 -5
- package/scripts/init.mjs +11 -4
- package/scripts/integration/file.mjs +544 -434
- package/scripts/integration/integrer.mjs +87 -43
- package/scripts/integration/rejeu.mjs +45 -13
- package/scripts/jointure.d.ts +151 -28
- package/scripts/langages/cargo/commandes.mjs +383 -124
- package/scripts/langages/cargo/composants.mjs +154 -42
- package/scripts/langages/cargo/exemples.mjs +12 -21
- package/scripts/langages/cargo/index.mjs +22 -8
- package/scripts/langages/cargo/sccache.mjs +8 -14
- package/scripts/langages/cargo/tests-de-head.mjs +25 -9
- package/scripts/langages/python/commandes.mjs +218 -100
- package/scripts/langages/python/composants.mjs +53 -21
- package/scripts/langages/python/exemples.mjs +6 -16
- package/scripts/langages/python/index.mjs +28 -8
- package/scripts/langages/python/lot.mjs +1 -36
- 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/construire.mjs +6 -163
- package/scripts/langages/typescript/elements-du-lot.mjs +36 -12
- package/scripts/langages/typescript/exemples.mjs +3 -11
- package/scripts/langages/typescript/frontieres.mjs +66 -22
- package/scripts/langages/typescript/index-interfaces.mjs +36 -13
- package/scripts/langages/typescript/index.mjs +50 -61
- package/scripts/langages/typescript/interfaces-contre-code.mjs +113 -45
- 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-prefixe-des-tickets.mjs +63 -0
- package/scripts/langages/typescript/migrations/0.30.0-tailles-des-outils-lourds.mjs +33 -0
- package/scripts/langages/typescript/migrations/0.30.0-titres-nommant-un-ticket.mjs +40 -0
- package/scripts/langages/typescript/mise-a-jour.mjs +1 -2
- package/scripts/langages/typescript/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 +93 -20
- package/scripts/langages/typescript/tests-de-nuit.mjs +15 -10
- package/scripts/langages/typescript/tests.mjs +40 -15
- package/scripts/langages/typescript/titres-de-tests.mjs +320 -0
- package/scripts/langages/typescript/turbo-des-paquets.mjs +327 -81
- package/scripts/langages/typescript/verdict.mjs +4 -2
- package/scripts/langages/typescript/verifier.mjs +58 -20
- package/scripts/langages/typescript/vitest-config/avancement.reporter.mjs +15 -5
- package/scripts/langages/typescript/vitest-config/base.mjs +29 -3
- package/scripts/langages/typescript/vitest-config/bornes.mjs +13 -0
- package/scripts/langages/typescript/vitest-config/changements.mjs +21 -8
- package/scripts/langages/typescript/vitest-config/cibles.mjs +36 -14
- package/scripts/langages/typescript/vitest-config/delais.mjs +60 -0
- package/scripts/langages/typescript/vitest-config/delais.setup.mjs +11 -0
- package/scripts/langages/typescript/vitest-config/duree.classement.mjs +108 -0
- package/scripts/langages/typescript/vitest-config/duree.reporter.mjs +56 -59
- package/scripts/langages/typescript/vitest-config/lances.mjs +83 -27
- package/scripts/langages/typescript/vitest-config/machine.setup.mjs +10 -0
- package/scripts/langages/typescript/vitest-config/resultats.mjs +3 -1
- package/scripts/langages/typescript/vitest.nuit.config.mjs +4 -0
- package/scripts/lint-des-scripts.mjs +58 -0
- package/scripts/mesure/base-de-passe.mjs +117 -25
- package/scripts/mesure/pression.mjs +12 -6
- package/scripts/mesure-de-la-machine.d.mts +21 -0
- package/scripts/mesure-de-la-machine.mjs +76 -0
- 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 +56 -18
- 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 +124 -0
- package/scripts/migrations/0.31.0-paquets-dans-le-graphe.mjs +81 -0
- package/scripts/migrations.mjs +5 -0
- package/scripts/nuit.sh +25 -3
- package/scripts/outil.mjs +3 -1
- package/scripts/outils-cles.d.mts +24 -0
- package/scripts/outils-cles.mjs +18 -8
- package/scripts/paquet-npm.mjs +157 -0
- package/scripts/paquet.mjs +73 -4
- package/scripts/paquets.mjs +46 -10
- package/scripts/passe-de-la-machine.mjs +71 -0
- package/scripts/places-de-la-machine.mjs +414 -0
- package/scripts/places-du-serveur.mjs +170 -0
- package/scripts/prefixe-des-tickets.mjs +68 -0
- package/scripts/preparation.mjs +25 -8
- package/scripts/registre.mjs +9 -4
- package/scripts/regles-des-places.d.mts +36 -0
- package/scripts/regles-des-places.mjs +70 -0
- package/scripts/reponses-du-circuit.d.mts +6 -0
- package/scripts/reponses-du-circuit.mjs +28 -0
- package/scripts/reprise.mjs +66 -0
- package/scripts/resultats.mjs +112 -46
- package/scripts/retirer-les-copies-finies.mjs +25 -0
- package/scripts/sans-reponse.d.mts +4 -0
- package/scripts/sans-reponse.mjs +13 -0
- package/scripts/seances.mjs +936 -0
- package/scripts/services-du-noyau.mjs +27 -8
- package/scripts/session-start.sh +2 -2
- package/scripts/sortie.mjs +3 -3
- package/scripts/sous-commandes.mjs +41 -10
- package/scripts/style-a-l-ecriture.mjs +260 -0
- package/scripts/superviseur.mjs +122 -111
- package/scripts/tableau.mjs +180 -117
- package/scripts/taches-du-graphe.mjs +348 -0
- package/scripts/ticket-du-circuit.mjs +216 -0
- package/scripts/transitions.d.mts +148 -0
- package/scripts/transitions.mjs +1018 -0
- package/scripts/verrou-de-fichier.mjs +8 -4
- package/scripts/verrou-de-machine.mjs +150 -51
- 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 +9 -2
- package/skills/grill/SKILL.md +1 -1
- package/skills/mesure/SKILL.md +3 -0
- package/skills/pitmaster/SKILL.md +17 -18
- package/skills/pitmaster/references/consigne-agent.md +5 -1
- package/skills/release/SKILL.md +3 -3
- package/skills/relecteur/SKILL.md +5 -3
- package/skills/testwriter/SKILL.md +49 -31
- package/scripts/demon.mjs +0 -251
- package/scripts/integration/file-attente.mjs +0 -61
- package/scripts/langages/cargo/touches.mjs +0 -93
- package/scripts/langages/typescript/script-des-tests.mjs +0 -6
package/scripts/resultats.mjs
CHANGED
|
@@ -13,8 +13,9 @@
|
|
|
13
13
|
// with its `piece`: the circuit goes on, or stops at « hors-portee » or « besoin », the piece
|
|
14
14
|
// with the stop (testwriter, developpeur, and the explorateur's gesture of a mechanical ticket,
|
|
15
15
|
// its own schema, `geste`);
|
|
16
|
-
// - `
|
|
17
|
-
// file
|
|
16
|
+
// - `portent_le_travail` (`fichier` from the root, `test` its full name, or none for every test of
|
|
17
|
+
// the file): the tests of the lot that carry the ticket's work, which the proof of the red
|
|
18
|
+
// requires red (testwriter);
|
|
18
19
|
// - `renvoi` (`role` testwriter): the circuit relaunches the testwriter, then the proof and the
|
|
19
20
|
// developpeur (developpeur);
|
|
20
21
|
// - `hors_plan` (`critere` its number, `paquet` the package out of the plan that would hold it,
|
|
@@ -303,18 +304,15 @@ const FICHES = {
|
|
|
303
304
|
testwriter: objet(
|
|
304
305
|
{
|
|
305
306
|
...STATUT,
|
|
306
|
-
|
|
307
|
+
portent_le_travail: liste(
|
|
307
308
|
objet(
|
|
308
309
|
{
|
|
309
310
|
fichier: texte('Le fichier de tests, depuis la racine du dépôt.'),
|
|
310
|
-
test: texte(
|
|
311
|
-
'Le nom complet du test ; absent, chaque vert du fichier, s’il est un fichier que HEAD tient.'
|
|
312
|
-
),
|
|
313
|
-
raison: texte('Pourquoi ce test passe avant le code.'),
|
|
311
|
+
test: texte('Le nom complet du test ; absent, chaque test du fichier.'),
|
|
314
312
|
},
|
|
315
|
-
['fichier'
|
|
313
|
+
['fichier']
|
|
316
314
|
),
|
|
317
|
-
'
|
|
315
|
+
'Les tests du lot qui portent le travail du ticket : la preuve du rouge exige qu’ils échouent avant le code.'
|
|
318
316
|
),
|
|
319
317
|
...DECOUVERTES,
|
|
320
318
|
},
|
|
@@ -506,25 +504,35 @@ export function sorteDuPlan(fiche) {
|
|
|
506
504
|
function erreurs(schema, valeur, ou) {
|
|
507
505
|
const nom = ou || 'la fiche';
|
|
508
506
|
if (schema.type === 'object') {
|
|
509
|
-
if (!valeur || typeof valeur !== 'object' || Array.isArray(valeur))
|
|
507
|
+
if (!valeur || typeof valeur !== 'object' || Array.isArray(valeur)) {
|
|
510
508
|
return [`${nom} : un objet`];
|
|
509
|
+
}
|
|
511
510
|
const out = [];
|
|
512
511
|
for (const k of schema.required ?? []) {
|
|
513
|
-
if (!(k in valeur))
|
|
512
|
+
if (!(k in valeur)) {
|
|
513
|
+
out.push(`${ou ? `${ou}.` : ''}${k} : manque`);
|
|
514
|
+
}
|
|
514
515
|
}
|
|
515
516
|
for (const [k, v] of Object.entries(valeur)) {
|
|
516
517
|
const sous = schema.properties[k];
|
|
517
518
|
const chemin = `${ou ? `${ou}.` : ''}${k}`;
|
|
518
|
-
if (!sous)
|
|
519
|
-
|
|
519
|
+
if (!sous) {
|
|
520
|
+
out.push(`${chemin} : hors du schéma`);
|
|
521
|
+
} else {
|
|
522
|
+
out.push(...erreurs(sous, v, chemin));
|
|
523
|
+
}
|
|
520
524
|
}
|
|
521
525
|
return out;
|
|
522
526
|
}
|
|
523
527
|
if (schema.type === 'array') {
|
|
524
|
-
if (!Array.isArray(valeur))
|
|
528
|
+
if (!Array.isArray(valeur)) {
|
|
529
|
+
return [`${nom} : une liste`];
|
|
530
|
+
}
|
|
525
531
|
return valeur.flatMap((v, i) => erreurs(schema.items, v, `${ou}[${i}]`));
|
|
526
532
|
}
|
|
527
|
-
if (typeof valeur !== 'string')
|
|
533
|
+
if (typeof valeur !== 'string') {
|
|
534
|
+
return [`${nom} : un texte`];
|
|
535
|
+
}
|
|
528
536
|
if (schema.enum && !schema.enum.includes(valeur)) {
|
|
529
537
|
return [`${nom} : « ${valeur} » n'est pas l'un de ${schema.enum.join(', ')}`];
|
|
530
538
|
}
|
|
@@ -563,13 +571,17 @@ export function conformiteDuLot(fiche, { elements, fichiers }) {
|
|
|
563
571
|
const ids = new Set(elements.map(e => e.id));
|
|
564
572
|
const hors = new Set(fichiers ?? []);
|
|
565
573
|
const duLot = element => {
|
|
566
|
-
if (ids.has(element) || hors.has(element))
|
|
574
|
+
if (ids.has(element) || hors.has(element)) {
|
|
575
|
+
return true;
|
|
576
|
+
}
|
|
567
577
|
const diese = element.lastIndexOf('#');
|
|
568
578
|
return diese > 0 && diese < element.length - 1 && hors.has(element.slice(0, diese));
|
|
569
579
|
};
|
|
570
580
|
const fautes = [];
|
|
571
581
|
const sans = elements.filter(e => !lignes.some(l => l.element === e.id)).map(e => e.id);
|
|
572
|
-
if (sans.length)
|
|
582
|
+
if (sans.length) {
|
|
583
|
+
fautes.push(`conformite : sans ligne pour ${sans.join(', ')}`);
|
|
584
|
+
}
|
|
573
585
|
for (const [i, l] of lignes.entries()) {
|
|
574
586
|
if (!duLot(l.element)) {
|
|
575
587
|
fautes.push(`conformite[${i}].element : ${l.element} n'est pas un élément du lot`);
|
|
@@ -612,10 +624,14 @@ export function cleDuConstat(titre) {
|
|
|
612
624
|
// (<titres>), as the author answers in each thread of a review: a FAIT without the answer to one,
|
|
613
625
|
// by its title (a BLOQUÉ or a BESOIN stops the circuit before any review). The fault, or null.
|
|
614
626
|
export function reponsesAuxConstats(fiche, titres) {
|
|
615
|
-
if (fiche.statut !== 'FAIT')
|
|
627
|
+
if (fiche.statut !== 'FAIT') {
|
|
628
|
+
return null;
|
|
629
|
+
}
|
|
616
630
|
const repondus = new Set((fiche.reponses ?? []).map(r => cleDuConstat(r.titre)));
|
|
617
631
|
const sans = titres.filter(t => !repondus.has(t)).map(t => `« ${t} »`);
|
|
618
|
-
if (!sans.length)
|
|
632
|
+
if (!sans.length) {
|
|
633
|
+
return null;
|
|
634
|
+
}
|
|
619
635
|
return `reponses : sans réponse ${sans.length > 1 ? 'aux constats' : 'au constat'} ${sans.join(', ')}`;
|
|
620
636
|
}
|
|
621
637
|
|
|
@@ -631,7 +647,9 @@ export function suiviDesConstats(fiche, titres) {
|
|
|
631
647
|
return `suivi : sans ligne pour ${sans.length > 1 ? 'les constats' : 'le constat'} ${liste(sans)}`;
|
|
632
648
|
}
|
|
633
649
|
const tenus = fiche.verdict === 'ACCEPTÉ' ? titres.filter(t => etats.get(t) !== 'levé') : [];
|
|
634
|
-
if (!tenus.length)
|
|
650
|
+
if (!tenus.length) {
|
|
651
|
+
return null;
|
|
652
|
+
}
|
|
635
653
|
return `suivi : un ACCEPTÉ tient ${tenus.length > 1 ? 'les constats' : 'le constat'} ${liste(tenus)} non levé${tenus.length > 1 ? 's' : ''}`;
|
|
636
654
|
}
|
|
637
655
|
|
|
@@ -643,10 +661,15 @@ export function conformiteDuTri(fiche, decouvertes) {
|
|
|
643
661
|
const lignes = (fiche.verdicts ?? []).map(l => l.decouverte);
|
|
644
662
|
const fautes = [];
|
|
645
663
|
const sans = decouvertes.filter(d => !lignes.includes(d));
|
|
646
|
-
if (sans.length)
|
|
664
|
+
if (sans.length) {
|
|
665
|
+
fautes.push(`verdicts : sans ligne pour ${sans.join(', ')}`);
|
|
666
|
+
}
|
|
647
667
|
for (const d of new Set(lignes)) {
|
|
648
|
-
if (!decouvertes.includes(d))
|
|
649
|
-
|
|
668
|
+
if (!decouvertes.includes(d)) {
|
|
669
|
+
fautes.push(`verdicts : ${d} n'est pas une découverte du ticket`);
|
|
670
|
+
} else if (lignes.filter(x => x === d).length > 1) {
|
|
671
|
+
fautes.push(`verdicts : ${d} a deux lignes`);
|
|
672
|
+
}
|
|
650
673
|
}
|
|
651
674
|
return fautes.length ? fautes.join(' ; ') : null;
|
|
652
675
|
}
|
|
@@ -663,7 +686,9 @@ export function conformiteDuTri(fiche, decouvertes) {
|
|
|
663
686
|
export function lirePiece(texte) {
|
|
664
687
|
const t = String(texte ?? '').trim();
|
|
665
688
|
const ticket = /^ticket\s*,\s*/i.exec(t);
|
|
666
|
-
if (ticket)
|
|
689
|
+
if (ticket) {
|
|
690
|
+
return pieceDuTicket(t.slice(ticket[0].length));
|
|
691
|
+
}
|
|
667
692
|
if (t.startsWith('$ ')) {
|
|
668
693
|
const vrai = t.indexOf('\n');
|
|
669
694
|
const saut = vrai < 0 ? t.indexOf('\\n') : vrai;
|
|
@@ -672,15 +697,25 @@ export function lirePiece(texte) {
|
|
|
672
697
|
return commande && sortie ? { commande, sortie } : null;
|
|
673
698
|
}
|
|
674
699
|
let lieu = t.split(/\s/)[0];
|
|
675
|
-
while (lieu && '`.,;:)'.includes(lieu.at(-1)))
|
|
676
|
-
|
|
700
|
+
while (lieu && '`.,;:)'.includes(lieu.at(-1))) {
|
|
701
|
+
lieu = lieu.slice(0, -1);
|
|
702
|
+
}
|
|
703
|
+
while (lieu.startsWith('`')) {
|
|
704
|
+
lieu = lieu.slice(1);
|
|
705
|
+
}
|
|
677
706
|
const deux = lieu.lastIndexOf(':');
|
|
678
707
|
const [debut, fin, ...reste] = lieu.slice(deux + 1).split('-');
|
|
679
708
|
const nombre = n => (/^\d+$/.test(n ?? '') && Number(n) >= 1 ? Number(n) : null);
|
|
680
709
|
const ligne = nombre(debut);
|
|
681
|
-
if (deux < 1 || !ligne || reste.length)
|
|
682
|
-
|
|
683
|
-
|
|
710
|
+
if (deux < 1 || !ligne || reste.length) {
|
|
711
|
+
return null;
|
|
712
|
+
}
|
|
713
|
+
if (fin === undefined) {
|
|
714
|
+
return { fichier: lieu.slice(0, deux), ligne };
|
|
715
|
+
}
|
|
716
|
+
if (!nombre(fin) || nombre(fin) < ligne) {
|
|
717
|
+
return null;
|
|
718
|
+
}
|
|
684
719
|
return { fichier: lieu.slice(0, deux), ligne, fin: nombre(fin) };
|
|
685
720
|
}
|
|
686
721
|
|
|
@@ -689,8 +724,12 @@ export function lirePiece(texte) {
|
|
|
689
724
|
// piece cites one criterion: « critère 1 et 7 » is none.
|
|
690
725
|
function pieceDuTicket(reste) {
|
|
691
726
|
const critere = /^critère\s+([1-9]\d*)(?!\d)(?!\s*(?:et|,)\s*\d)(?:$|[\s.,;:])/i.exec(reste);
|
|
692
|
-
if (critere)
|
|
693
|
-
|
|
727
|
+
if (critere) {
|
|
728
|
+
return { critere: Number(critere[1]) };
|
|
729
|
+
}
|
|
730
|
+
if (!reste.startsWith('§')) {
|
|
731
|
+
return null;
|
|
732
|
+
}
|
|
694
733
|
const apres = reste.slice(1).trim();
|
|
695
734
|
const cite = /^«\s*([^»]*?)\s*»/.exec(apres);
|
|
696
735
|
const section = (cite ? cite[1] : apres.split(/\s:(?:\s|$)|:$/)[0]).trim();
|
|
@@ -714,7 +753,9 @@ function introuvables(f, copie) {
|
|
|
714
753
|
const racine = path.resolve(copie);
|
|
715
754
|
for (const [ou, p] of piecesDe(f)) {
|
|
716
755
|
const lu = lirePiece(p);
|
|
717
|
-
if (!lu?.fichier)
|
|
756
|
+
if (!lu?.fichier) {
|
|
757
|
+
continue;
|
|
758
|
+
}
|
|
718
759
|
const abs = path.resolve(racine, lu.fichier);
|
|
719
760
|
const lieu = `${lu.fichier}:${lu.ligne}${lu.fin ? `-${lu.fin}` : ''}`;
|
|
720
761
|
if (!abs.startsWith(`${racine}${path.sep}`) || !existsSync(abs) || !statSync(abs).isFile()) {
|
|
@@ -748,7 +789,9 @@ function horsDuTicket(f, description) {
|
|
|
748
789
|
continue;
|
|
749
790
|
}
|
|
750
791
|
const numero = /^\s*(\d+)[.)]\s/.exec(ligne);
|
|
751
|
-
if (dedans && numero)
|
|
792
|
+
if (dedans && numero) {
|
|
793
|
+
criteres.add(Number(numero[1]));
|
|
794
|
+
}
|
|
752
795
|
}
|
|
753
796
|
const out = [];
|
|
754
797
|
for (const [ou, p] of piecesDe(f)) {
|
|
@@ -778,8 +821,12 @@ function horsDuTicket(f, description) {
|
|
|
778
821
|
function manques(role, f) {
|
|
779
822
|
const out = [];
|
|
780
823
|
const plein = k => typeof f[k] === 'string' && f[k].trim() !== '';
|
|
781
|
-
if (f.statut === 'BLOQUÉ' && !plein('raison'))
|
|
782
|
-
|
|
824
|
+
if (f.statut === 'BLOQUÉ' && !plein('raison')) {
|
|
825
|
+
out.push('raison : manque, pour BLOQUÉ');
|
|
826
|
+
}
|
|
827
|
+
if (f.statut === 'BESOIN' && !plein('question')) {
|
|
828
|
+
out.push('question : manque, pour BESOIN');
|
|
829
|
+
}
|
|
783
830
|
if (['BLOQUÉ', 'BESOIN'].includes(f.statut) && !('piece' in f)) {
|
|
784
831
|
out.push(`piece : manque, pour ${f.statut}`);
|
|
785
832
|
}
|
|
@@ -831,7 +878,9 @@ function manques(role, f) {
|
|
|
831
878
|
}
|
|
832
879
|
}
|
|
833
880
|
if (role === 'explorateur') {
|
|
834
|
-
if (!(f.paquets ?? []).length)
|
|
881
|
+
if (!(f.paquets ?? []).length) {
|
|
882
|
+
out.push('paquets : manque, pour un plan');
|
|
883
|
+
}
|
|
835
884
|
for (const [i, r] of (f.reponses ?? []).entries()) {
|
|
836
885
|
if (!/^[1-9]\d*$/.test(r.numero)) {
|
|
837
886
|
out.push(`reponses[${i}].numero : « ${r.numero} » n'est pas le numéro d'une question`);
|
|
@@ -840,7 +889,9 @@ function manques(role, f) {
|
|
|
840
889
|
}
|
|
841
890
|
if (role === 'tri') {
|
|
842
891
|
for (const [i, l] of (f.verdicts ?? []).entries()) {
|
|
843
|
-
if (!l.texte.trim())
|
|
892
|
+
if (!l.texte.trim()) {
|
|
893
|
+
out.push(`verdicts[${i}].texte : manque, pour ${l.verdict}`);
|
|
894
|
+
}
|
|
844
895
|
if (VERDICTS_PROUVES.includes(l.verdict) && !('piece' in l)) {
|
|
845
896
|
out.push(
|
|
846
897
|
`verdicts[${i}].piece : manque, pour ${l.verdict} : « $ <commande> » rejouée sur main et sa sortie, ou fichier:ligne ; sans elle, le verdict est non-confirmee`
|
|
@@ -863,7 +914,9 @@ function manques(role, f) {
|
|
|
863
914
|
// the description of the ticket, each piece of the ticket names a criterion or a section of it.
|
|
864
915
|
export function lireFiche(role, sortie, { copie, ticket } = {}) {
|
|
865
916
|
const schema = schemaDeFiche(role);
|
|
866
|
-
if (!schema)
|
|
917
|
+
if (!schema) {
|
|
918
|
+
return { erreur: `le rôle ${role} n'a pas de fiche` };
|
|
919
|
+
}
|
|
867
920
|
let resultat;
|
|
868
921
|
try {
|
|
869
922
|
resultat = JSON.parse(String(sortie ?? ''));
|
|
@@ -875,16 +928,26 @@ export function lireFiche(role, sortie, { copie, ticket } = {}) {
|
|
|
875
928
|
}
|
|
876
929
|
const fiche = resultat.structured_output;
|
|
877
930
|
const fautes = erreurs(schema, fiche, '');
|
|
878
|
-
if (!fautes.length)
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
if (fautes.length
|
|
931
|
+
if (!fautes.length) {
|
|
932
|
+
fautes.push(...manques(role, fiche));
|
|
933
|
+
}
|
|
934
|
+
if (!fautes.length && copie) {
|
|
935
|
+
fautes.push(...introuvables(fiche, copie));
|
|
936
|
+
}
|
|
937
|
+
if (!fautes.length && typeof ticket === 'string') {
|
|
938
|
+
fautes.push(...horsDuTicket(fiche, ticket));
|
|
939
|
+
}
|
|
940
|
+
if (fautes.length) {
|
|
941
|
+
return { erreur: `fiche non conforme : ${fautes.join(' ; ')}` };
|
|
942
|
+
}
|
|
882
943
|
return { fiche, seance: resultat.session_id ?? null };
|
|
883
944
|
}
|
|
884
945
|
|
|
885
946
|
// The directory of the package of <racine> that holds <fichier> (from the root), null for none.
|
|
886
947
|
function paquetDe(racine, fichier) {
|
|
887
|
-
if (!fichier)
|
|
948
|
+
if (!fichier) {
|
|
949
|
+
return null;
|
|
950
|
+
}
|
|
888
951
|
const p = paquets(racine)
|
|
889
952
|
.filter(({ dossier }) => fichier === dossier || fichier.startsWith(`${dossier}/`))
|
|
890
953
|
.sort((a, b) => b.dossier.length - a.dossier.length)[0];
|
|
@@ -934,7 +997,9 @@ let numero = 0;
|
|
|
934
997
|
// its path, or null without the variable.
|
|
935
998
|
export function ecrireSarif({ garde, constats, racine = process.cwd(), env = process.env }) {
|
|
936
999
|
const dossier = env[RESULTATS];
|
|
937
|
-
if (!dossier)
|
|
1000
|
+
if (!dossier) {
|
|
1001
|
+
return null;
|
|
1002
|
+
}
|
|
938
1003
|
const f = path.join(dossier, SARIF, `${garde}-${process.pid}-${++numero}.sarif`);
|
|
939
1004
|
mkdirSync(path.dirname(f), { recursive: true });
|
|
940
1005
|
writeFileSync(f, `${JSON.stringify(sarif({ garde, constats, racine }), null, 2)}\n`);
|
|
@@ -989,8 +1054,9 @@ export function lireSarif(dossier) {
|
|
|
989
1054
|
if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) {
|
|
990
1055
|
const [option, role] = process.argv.slice(2);
|
|
991
1056
|
const schema = option === '--schema' ? schemaDeFiche(role) : null;
|
|
992
|
-
if (schema)
|
|
993
|
-
|
|
1057
|
+
if (schema) {
|
|
1058
|
+
process.stdout.write(`${JSON.stringify(schema)}\n`);
|
|
1059
|
+
} else {
|
|
994
1060
|
process.stderr.write(
|
|
995
1061
|
option === '--schema'
|
|
996
1062
|
? `⛔ le rôle ${role} n'a pas de fiche.\n`
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// The command of the removal of the finished copies (./copies-finies.mjs), which the night runs
|
|
2
|
+
// once its steps are played (scripts/nuit.sh):
|
|
3
|
+
//
|
|
4
|
+
// node scripts/retirer-les-copies-finies.mjs [<copie finie de jouer>…] from the main tree
|
|
5
|
+
//
|
|
6
|
+
// - The circuits that run are what the Temporal server says (./circuits-du-serveur.mjs, one call,
|
|
7
|
+
// 5 s at most); a server that does not answer, a client not built or any other fault of that
|
|
8
|
+
// reading leaves them unread (null), as the removal of ./copies-finies.mjs takes them.
|
|
9
|
+
// - The removal lives in ./copies-finies.mjs, which imports nothing of the built `dist/`: the lock
|
|
10
|
+
// of the machine (./verrou-de-machine.mjs) and the base configuration of the tests import it,
|
|
11
|
+
// and a project of trial holds the frame's scripts without `dist/`.
|
|
12
|
+
import { circuitsDuServeur } from './circuits-du-serveur.mjs';
|
|
13
|
+
import { retirerLesCopiesDuDepot } from './copies-finies.mjs';
|
|
14
|
+
|
|
15
|
+
const racine = process.cwd();
|
|
16
|
+
let vivants = null;
|
|
17
|
+
try {
|
|
18
|
+
vivants = new Set((await circuitsDuServeur(racine)).filter(c => c.vivant).map(c => c.ticket));
|
|
19
|
+
} catch {
|
|
20
|
+
vivants = null;
|
|
21
|
+
}
|
|
22
|
+
const lignes = retirerLesCopiesDuDepot(racine, process.argv.slice(2), vivants);
|
|
23
|
+
if (lignes.length) {
|
|
24
|
+
process.stdout.write(`${lignes.join('\n')}\n`);
|
|
25
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// What a reading of the Temporal server says when the server does not answer within its delay:
|
|
2
|
+
// the fact measured, « Temporal ne répond pas en <n> s », since a server slow under load and a port
|
|
3
|
+
// where none listens look the same from the client. One rule for every reader: the board, the
|
|
4
|
+
// opening of a session (scripts/circuits-du-serveur.mjs), the command of the circuit
|
|
5
|
+
// (src/temporal/circuit/commande.ts) and the state of the service (src/temporal/etat.ts), each
|
|
6
|
+
// with the delay of its own reading.
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* « Temporal ne répond pas en <n> s », <n> the delay <delaiMs> in seconds.
|
|
10
|
+
* @param {number} delaiMs
|
|
11
|
+
* @returns {string}
|
|
12
|
+
*/
|
|
13
|
+
export const sansReponseEn = delaiMs => `Temporal ne répond pas en ${delaiMs / 1000} s`;
|