@roomi-fields/grillhouse 0.24.14 → 0.25.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/bin/grillhouse.mjs +40 -12
- package/cadre/templates/cargo/.config/nextest.toml +8 -0
- package/cadre/templates/cargo/deny.toml +36 -0
- package/cadre/templates/cargo/package.json +15 -0
- package/cadre/templates/cargo/rust-toolchain.toml +6 -0
- package/cadre/templates/projet/package.json +5 -1
- package/cadre/templates/turbo/paquets.json +1 -1
- package/cadre/templates/turbo/sans-paquets.json +1 -1
- package/charte.md +16 -0
- package/docs/ARCHITECTURE.md +167 -17
- package/docs/CADRE.md +47 -0
- package/docs/INTERFACE.md +168 -0
- package/package.json +71 -14
- package/scripts/arbitrages.mjs +23 -0
- package/scripts/avancement.mjs +15 -29
- package/scripts/circuit.mjs +89 -97
- package/scripts/commande-du-langage.mjs +56 -0
- package/scripts/composants-affectes.mjs +47 -170
- package/scripts/conformite.d.ts +27 -0
- package/scripts/conformite.mjs +226 -0
- package/scripts/demon.mjs +1 -1
- package/scripts/dernier-vert.mjs +11 -9
- package/scripts/droits.mjs +27 -21
- package/scripts/enveloppe/enveloppe.mjs +206 -64
- package/scripts/enveloppe/lancer.sh +24 -75
- package/scripts/enveloppe/paquets-du-plan.mjs +24 -2
- package/scripts/etapes.mjs +2 -2
- package/scripts/gardes-du-cadre.mjs +12 -18
- package/scripts/grillhouse-maj.mjs +246 -389
- package/scripts/init.mjs +2 -1
- package/scripts/integration/file.mjs +3 -3
- package/scripts/integration/integrer.mjs +13 -10
- package/scripts/integration/rejeu.mjs +36 -7
- package/scripts/jointure.d.ts +304 -0
- package/scripts/langages/cargo/binaires.json +4 -0
- package/scripts/langages/cargo/binaires.mjs +60 -0
- package/scripts/langages/cargo/clippy.mjs +103 -0
- package/scripts/langages/cargo/commandes.mjs +378 -0
- package/scripts/langages/cargo/composants.mjs +191 -0
- package/scripts/langages/cargo/elements-du-lot.mjs +139 -0
- package/scripts/langages/cargo/exemples.mjs +357 -0
- package/scripts/langages/cargo/frontieres.mjs +84 -0
- package/scripts/langages/cargo/index-interfaces.mjs +138 -0
- package/scripts/langages/cargo/index.mjs +115 -0
- package/scripts/langages/cargo/mise-a-jour.mjs +93 -0
- package/scripts/langages/cargo/nextest.toml +5 -0
- package/scripts/langages/cargo/touches.mjs +93 -0
- package/scripts/langages/cargo/verdict.mjs +85 -0
- package/scripts/langages/typescript/chemins-des-tests.mjs +68 -0
- package/scripts/{code-mort.mjs → langages/typescript/code-mort.mjs} +5 -5
- package/scripts/langages/typescript/composants.mjs +64 -0
- package/scripts/{consommateurs-arbitres.mjs → langages/typescript/consommateurs-arbitres.mjs} +6 -24
- package/scripts/{consommateurs.mjs → langages/typescript/consommateurs.mjs} +13 -71
- package/scripts/langages/typescript/construire.mjs +176 -0
- package/scripts/{elements-du-lot.mjs → langages/typescript/elements-du-lot.mjs} +2 -2
- package/scripts/langages/typescript/exemples.mjs +289 -0
- package/scripts/{frontieres.mjs → langages/typescript/frontieres.mjs} +3 -5
- package/scripts/{index-interfaces.mjs → langages/typescript/index-interfaces.mjs} +3 -3
- package/scripts/langages/typescript/index.mjs +335 -0
- package/scripts/{interfaces-contre-code.mjs → langages/typescript/interfaces-contre-code.mjs} +2 -2
- package/scripts/langages/typescript/lecteurs.mjs +179 -0
- package/scripts/{migrations → langages/typescript/migrations}/0.23.0-config-vitest.mjs +14 -29
- package/scripts/{migrations → langages/typescript/migrations}/0.24.4-noms-declares-inutilises.mjs +2 -2
- package/scripts/{migrations → langages/typescript/migrations}/0.24.6-lignes-mal-formees.mjs +2 -2
- package/scripts/{migrations → langages/typescript/migrations}/0.24.7-matiere-dans-les-tests.mjs +2 -2
- package/scripts/langages/typescript/migrations/0.25.0-chemins-des-tests.mjs +27 -0
- package/scripts/langages/typescript/migrations/0.25.0-tailles-des-tests.mjs +31 -0
- package/scripts/langages/typescript/mise-a-jour.mjs +320 -0
- package/scripts/{references-par-les-types.mjs → langages/typescript/references-par-les-types.mjs} +3 -3
- package/scripts/langages/typescript/regle-des-tests.mjs +39 -0
- package/scripts/{resumes.mjs → langages/typescript/resumes.mjs} +4 -4
- package/scripts/langages/typescript/script-des-tests.mjs +6 -0
- package/scripts/langages/typescript/tailles-des-tests.mjs +219 -0
- package/scripts/langages/typescript/tests-de-nuit.mjs +57 -0
- package/scripts/{tests.mjs → langages/typescript/tests.mjs} +41 -32
- package/scripts/{turbo-des-paquets.mjs → langages/typescript/turbo-des-paquets.mjs} +61 -34
- package/scripts/langages/typescript/verdict.mjs +105 -0
- package/scripts/{verifier.mjs → langages/typescript/verifier.mjs} +53 -34
- package/scripts/{vitest-config → langages/typescript/vitest-config}/avancement.reporter.mjs +10 -2
- package/scripts/{vitest-config → langages/typescript/vitest-config}/base.mjs +63 -9
- package/scripts/{vitest-config → langages/typescript/vitest-config}/changements.mjs +18 -9
- package/scripts/{vitest-config → langages/typescript/vitest-config}/cibles.mjs +7 -6
- package/scripts/{vitest-config → langages/typescript/vitest-config}/duree.reporter.mjs +6 -1
- package/scripts/langages/typescript/vitest-config/lances.mjs +473 -0
- package/scripts/{vitest-config → langages/typescript/vitest-config}/mesure.setup.mjs +1 -1
- package/scripts/{vitest-config → langages/typescript/vitest-config}/resultats.mjs +5 -5
- package/scripts/{vitest-config → langages/typescript/vitest-config}/resultats.setup.mjs +4 -3
- package/scripts/{vitest.nuit.config.mjs → langages/typescript/vitest.nuit.config.mjs} +2 -2
- package/scripts/langages.mjs +85 -0
- package/scripts/{vitest-config → mesure}/avancement.mjs +4 -13
- package/scripts/{vitest-config → mesure}/base-de-passe.mjs +70 -33
- package/scripts/{vitest-config → mesure}/pression.mjs +5 -6
- package/scripts/migrations/0.23.2-copies-du-cadre.mjs +29 -6
- package/scripts/migrations/0.24.0-circuit-simplifie.mjs +13 -6
- package/scripts/migrations/0.25.0-script-des-tests.mjs +92 -0
- package/scripts/migrations.mjs +17 -13
- package/scripts/nuit.sh +59 -63
- package/scripts/paquets.d.ts +5 -0
- package/scripts/paquets.mjs +24 -2
- package/scripts/resultats.mjs +8 -82
- package/scripts/services-du-noyau.mjs +30 -0
- package/scripts/session-start.sh +17 -9
- package/scripts/sources.mjs +35 -13
- package/scripts/sous-commandes.mjs +57 -17
- package/scripts/superviseur.mjs +1 -1
- package/scripts/tableau.mjs +1 -1
- package/scripts/un-commit-par-ticket.mjs +48 -14
- package/scripts/verrou-de-fichier.mjs +1 -1
- package/scripts/verrou-de-machine.mjs +4 -4
- package/scripts/verrous/verrou.mjs +28 -37
- package/skills/developpeur/SKILL.md +2 -2
- package/skills/explorateur/SKILL.md +13 -5
- package/skills/grill/SKILL.md +2 -2
- package/skills/pitmaster/references/cadre.md +1 -1
- package/skills/pitmaster/references/consigne-agent.md +10 -3
- package/skills/redacteur/references/documents-d-un-composant.md +4 -4
- package/skills/relecteur/SKILL.md +4 -1
- package/skills/testwriter/SKILL.md +20 -6
- /package/scripts/{consommateurs.d.ts → langages/typescript/consommateurs.d.ts} +0 -0
- /package/scripts/{vitest-config → langages/typescript/vitest-config}/base.d.ts +0 -0
- /package/scripts/{vitest-config → langages/typescript/vitest-config}/machine.setup.mjs +0 -0
- /package/scripts/{vitest-config → langages/typescript/vitest-config}/mesure.d.ts +0 -0
- /package/scripts/{vitest-config → langages/typescript/vitest-config}/mesure.mjs +0 -0
package/scripts/circuit.mjs
CHANGED
|
@@ -158,14 +158,15 @@
|
|
|
158
158
|
// a change that does not pass it: the question names each criterion and its package, the
|
|
159
159
|
// supervisor answers `--etendre <paquet>`, or amends the criterion and `--reprendre` (BP 320.17:
|
|
160
160
|
// « critère 10 hors plan, non fait » in three handovers fell at the review).
|
|
161
|
-
// - A plan that carries no test (sansTests: in a repository of packages, no package
|
|
162
|
-
// `
|
|
163
|
-
// out of every package or in a package without
|
|
161
|
+
// - A plan that carries no test (sansTests: in a repository of packages, no package that plays
|
|
162
|
+
// tests, as the module of language answers (`joueDesTests`), lies in a path of the plan or holds
|
|
163
|
+
// it, as `npm test -- <chemin>` refuses a path out of every package or in a package without
|
|
164
|
+
// tests) skips the testwriter and the proof:
|
|
164
165
|
// the circuit writes `Circuit · testwriter : aucun test …` at the ticket and launches the
|
|
165
166
|
// developpeur, the reason as his report, then his checks.
|
|
166
167
|
// - Each command of the proof and of the checks runs with its own results directory
|
|
167
|
-
// (`GRILLHOUSE_RESULTATS`), where Turborepo writes its summary (scripts/tests.mjs,
|
|
168
|
-
// scripts/verifier.mjs), Vitest its JSON report (scripts/vitest-config/resultats.mjs) and each
|
|
168
|
+
// (`GRILLHOUSE_RESULTATS`), where Turborepo writes its summary (scripts/langages/typescript/tests.mjs,
|
|
169
|
+
// scripts/langages/typescript/verifier.mjs), Vitest its JSON report (scripts/langages/typescript/vitest-config/resultats.mjs) and each
|
|
169
170
|
// guard its SARIF; its output goes to the log, for the human. Each `npm test` of them carries
|
|
170
171
|
// the mark `GRILLHOUSE_DEPUIS_LE_VERT` (scripts/dernier-vert.mjs): in a package named whole,
|
|
171
172
|
// the tests that play are those Vitest relates to the files changed since the last green of the
|
|
@@ -183,10 +184,10 @@
|
|
|
183
184
|
// - The proof of the red plays the new tests alone, as test-driven development runs the test it
|
|
184
185
|
// has just written to see it red, not the whole suite: one run per package, `npm test -- --force
|
|
185
186
|
// <files>` in the copy, the test files the testwriter's lot adds or changes (git status of the
|
|
186
|
-
// copy, the testwriter's files as the integration shares them, `
|
|
187
|
+
// copy, the testwriter's files as the integration shares them, `estUnTest`), played for real,
|
|
187
188
|
// since a run replayed from Turborepo's cache writes no report; the other tests of the plan play
|
|
188
189
|
// at its checks and at the final pass. With no file of the lot (a reader whose provider changed a
|
|
189
|
-
// type, no new test to write), each package of the plan that
|
|
190
|
+
// type, no new test to write), each package of the plan that plays tests (`joueDesTests`) plays
|
|
190
191
|
// whole, `npm test -- <package>`: main is green, so a test HEAD holds that
|
|
191
192
|
// turns red in the copy is a regression of the lot, a red, written `rouge existant : <file> ›
|
|
192
193
|
// <name> — <message>`, and so is a file that does not load while no build of the plan fails (it
|
|
@@ -235,8 +236,8 @@
|
|
|
235
236
|
// that named the guard's line). That output is kept in the state (`controlesRouges`), so that a
|
|
236
237
|
// `--reprendre` or a `--depuis` keeps it.
|
|
237
238
|
// - The checks after the developpeur judge the plan, as Bazel plays the targets of a change: `npm
|
|
238
|
-
// test -- <package>` for each package of the plan, touched by the lot or not (a package
|
|
239
|
-
//
|
|
239
|
+
// test -- <package>` for each package of the plan, touched by the lot or not (a package that plays no
|
|
240
|
+
// tests, `joueDesTests`, plays only when the lot touches it), `npm test -- <test files of the lot>`
|
|
240
241
|
// that none of them holds, each test played once, then the guards in the envelope of the plan (`GRILLHOUSE_ENVELOPPE=<plan> npm run
|
|
241
242
|
// grillhouse:gardes`, and `npm run gardes` when the project has it). Each red is read in the
|
|
242
243
|
// results of its command: a failed test of the reports of Vitest, a finding of level error of
|
|
@@ -278,7 +279,7 @@
|
|
|
278
279
|
// the root, as the inputs of Turborepo), the test files that judge it, as `rustc --bless` ties a
|
|
279
280
|
// test to its expected outputs, `lit`, the files it reads that another reference writes, and the
|
|
280
281
|
// guards of the project that judge it, by the name their SARIF finding carries (its guard or its
|
|
281
|
-
// rule). The frame's references follow in every project (
|
|
282
|
+
// rule). The frame's references follow in every project (`referencesDuCadre`): the files the
|
|
282
283
|
// frame generates, each judged by a guard of the frame, by the names its findings carry (the
|
|
283
284
|
// index of the interfaces, which reads the interfaces, the turbo.json of the packages, the API
|
|
284
285
|
// reports, which write the generated part of the interfaces), and the known debt of the guards;
|
|
@@ -340,7 +341,7 @@
|
|
|
340
341
|
// description as `bd show` gives it at the session's launch, written by the circuit in its
|
|
341
342
|
// working folder, which the session may read; the instruction carries no criteria, which the
|
|
342
343
|
// reviewer's skill reads only after its first passes), the files of the lot (the testwriter's by
|
|
343
|
-
// `
|
|
344
|
+
// `estUnTest`, then the others), the elements of the lot (scripts/langages/typescript/elements-du-lot.mjs: each
|
|
344
345
|
// function, class, type, interface, constant at the top and export the lot adds, changes or
|
|
345
346
|
// removes against the copy's HEAD, its package, its place, whether its package exports it) and
|
|
346
347
|
// the circuit's reports since its last sheet (its proofs and checks). Its errors go to the log
|
|
@@ -384,7 +385,7 @@
|
|
|
384
385
|
// - ACCEPTÉ: the integration, once the whole final pass has played on the lot accepted (its tree
|
|
385
386
|
// is `verifie`); else that pass first, once, its red going to the developpeur and the lot then
|
|
386
387
|
// to the reviewer again. The circuit builds the lot from the copy: the files the copy changes
|
|
387
|
-
// against its HEAD, the testwriter's (`
|
|
388
|
+
// against its HEAD, the testwriter's (`estUnTest`: test files and the shared test material)
|
|
388
389
|
// in one patch, the others in another, each file against HEAD and a new one against nothing
|
|
389
390
|
// (`git diff --no-index /dev/null`), the copy's index untouched; the message
|
|
390
391
|
// `<type>(<paquets>): <sujet> (<ticket>)`, the type read from the ticket's type (bug fix,
|
|
@@ -422,7 +423,7 @@
|
|
|
422
423
|
// long as the ticket, as the workspace of a pipeline: a circuit relaunched takes it up again, no
|
|
423
424
|
// sweep touches it, the queue removes it at the ticket's closure, and scripts/retirer-copie.sh
|
|
424
425
|
// with the copy of a ticket closed without integration. The results and progress of the passes
|
|
425
|
-
// live in the base of the run (scripts/
|
|
426
|
+
// live in the base of the run (scripts/mesure/base-de-passe.mjs), removed at its end.
|
|
426
427
|
// - The state is `.claude/worktrees/<ticket>.circuit.json`, written again at each step and at the
|
|
427
428
|
// start and end of each session: `{ etape, tentative, code, raison, rapport, finale, boucles,
|
|
428
429
|
// seance, question, questionnement, processus, depart, paquets, constats, verifie, mene, reprise,
|
|
@@ -545,9 +546,7 @@ import { pathToFileURL } from 'node:url';
|
|
|
545
546
|
import { stripVTControlCharacters } from 'node:util';
|
|
546
547
|
import { ecrireLeBilan } from './bilan.mjs';
|
|
547
548
|
import { DEPUIS_LE_VERT } from './dernier-vert.mjs';
|
|
548
|
-
import {
|
|
549
|
-
import { optionsDuRole } from './droits.mjs';
|
|
550
|
-
import { NOM_DE_TEST } from './consommateurs.mjs';
|
|
549
|
+
import { commandesPermises, optionsDuRole } from './droits.mjs';
|
|
551
550
|
import { ecrireLaListe, VARIABLE as VARIABLE_ENVELOPPE } from './enveloppe/paquets-du-plan.mjs';
|
|
552
551
|
import {
|
|
553
552
|
AGENTS_DU_LOT,
|
|
@@ -575,8 +574,6 @@ import {
|
|
|
575
574
|
conformiteDuLot,
|
|
576
575
|
conformiteDuTri,
|
|
577
576
|
lireFiche,
|
|
578
|
-
lireRapportsVitest,
|
|
579
|
-
lireResumes,
|
|
580
577
|
lireSarif,
|
|
581
578
|
regleDeLaLigne,
|
|
582
579
|
reponsesAuxConstats,
|
|
@@ -593,11 +590,11 @@ import { AUTEUR_DU_VERDICT } from './integration/verdict.mjs';
|
|
|
593
590
|
import { attendreUnPeu } from './verrou-de-fichier.mjs';
|
|
594
591
|
import { AttenteDeLaMachine, avecLaMachine } from './verrou-de-machine.mjs';
|
|
595
592
|
import { garderLeTotal, ouvrirAvancement } from './avancement.mjs';
|
|
596
|
-
import { AVANCEMENT } from './
|
|
597
|
-
import {
|
|
598
|
-
import {
|
|
599
|
-
import { A_REPASSER } from './
|
|
600
|
-
import { departDe, leMemeVivant, ouvrirBase, vivant } from './
|
|
593
|
+
import { AVANCEMENT } from './mesure/avancement.mjs';
|
|
594
|
+
import { nomsDesGardes } from './gardes-du-cadre.mjs';
|
|
595
|
+
import { langageDe } from './langages.mjs';
|
|
596
|
+
import { A_REPASSER } from './mesure/pression.mjs';
|
|
597
|
+
import { departDe, leMemeVivant, ouvrirBase, vivant } from './mesure/base-de-passe.mjs';
|
|
601
598
|
import { GREFFON } from './cadre.mjs';
|
|
602
599
|
import { executerEnDemon } from './demon.mjs';
|
|
603
600
|
|
|
@@ -663,7 +660,8 @@ const REGISTRE = path.join(ici, 'registre.mjs');
|
|
|
663
660
|
const generateur = (script, ...args) =>
|
|
664
661
|
[`node ${JSON.stringify(path.join(ici, script))}`, ...args].join(' ');
|
|
665
662
|
// The references of the circuit that no project declares (4.2), as Bazel's genrules: the files the
|
|
666
|
-
//
|
|
663
|
+
// module of the project's language generates (`fichiersEngendres`, scripts/jointure.d.ts), each
|
|
664
|
+
// judged by a guard of the frame and written again by its generator, whose
|
|
667
665
|
// code the circuit does not read (a real failure aside): what it writes, then the pass that
|
|
668
666
|
// follows, judge it; and the known debt of the guards, lowered from the notes of the final pass (`dette.mjs --abaisser`,
|
|
669
667
|
// `abaisser`: its command names the file of those notes). Each `{ nom, commande, fichiers, lit,
|
|
@@ -672,39 +670,12 @@ const generateur = (script, ...args) =>
|
|
|
672
670
|
// reports write), `gardes` the names the findings its regeneration lifts carry (their guard or
|
|
673
671
|
// their rule), `entiers` the files of `fichiers` its command writes in full, which the integration
|
|
674
672
|
// does not apply from the lot but regenerates on main of the moment
|
|
675
|
-
// (scripts/integration/integrer.mjs)
|
|
676
|
-
//
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
commande: generateur('index-interfaces.mjs'),
|
|
682
|
-
fichiers: ['docs/agents/index-des-interfaces.md'],
|
|
683
|
-
lit: ['docs/INTERFACE.md', '**/docs/INTERFACE.md'],
|
|
684
|
-
gardes: ['index-interfaces'],
|
|
685
|
-
entiers: ['docs/agents/index-des-interfaces.md'],
|
|
686
|
-
},
|
|
687
|
-
{
|
|
688
|
-
nom: 'les turbo.json des paquets',
|
|
689
|
-
commande: generateur('turbo-des-paquets.mjs', '--ecrire'),
|
|
690
|
-
fichiers: ['turbo.json', 'turbo.jsonc', '**/turbo.json'],
|
|
691
|
-
lit: [],
|
|
692
|
-
gardes: ['turbo-des-paquets'],
|
|
693
|
-
entiers: ['*/**/turbo.json'],
|
|
694
|
-
},
|
|
695
|
-
{
|
|
696
|
-
nom: "les rapports d'API",
|
|
697
|
-
commande: generateur('interfaces-contre-code.mjs', '--ecrire'),
|
|
698
|
-
fichiers: [
|
|
699
|
-
'docs/INTERFACE.api.md',
|
|
700
|
-
'docs/INTERFACE.md',
|
|
701
|
-
'**/docs/INTERFACE.api.md',
|
|
702
|
-
'**/docs/INTERFACE.md',
|
|
703
|
-
],
|
|
704
|
-
lit: [],
|
|
705
|
-
gardes: ['rapport-api', 'partie-generee'],
|
|
706
|
-
entiers: [],
|
|
707
|
-
},
|
|
673
|
+
// (scripts/integration/integrer.mjs), as the module says of each of its own; not the debt, which
|
|
674
|
+
// reads the notes of a pass.
|
|
675
|
+
const referencesDuCadre = racine => [
|
|
676
|
+
...langageDe(racine)
|
|
677
|
+
.fichiersEngendres(racine)
|
|
678
|
+
.map(({ verifier: _verifier, ...reference }) => reference),
|
|
708
679
|
{
|
|
709
680
|
nom: 'la dette des gardes',
|
|
710
681
|
commande: generateur('dette.mjs', '--abaisser', '<notes>'),
|
|
@@ -880,7 +851,7 @@ function contexte(o) {
|
|
|
880
851
|
// files after those it finds, and the queue removes it at the ticket's closure, or the removal of
|
|
881
852
|
// the copy of a ticket closed without integration (scripts/retirer-copie.sh). The results and
|
|
882
853
|
// the progress of the circuit's passes live in the base of its run
|
|
883
|
-
// (scripts/
|
|
854
|
+
// (scripts/mesure/base-de-passe.mjs), removed at its end, swept when the run is killed.
|
|
884
855
|
const tmp = `${copie}.travail`;
|
|
885
856
|
mkdirSync(tmp, { recursive: true });
|
|
886
857
|
const numero = Math.max(
|
|
@@ -1529,12 +1500,12 @@ function rapportsDuCircuit(ctx) {
|
|
|
1529
1500
|
}
|
|
1530
1501
|
|
|
1531
1502
|
// The files of the lot, as the copy holds them against its HEAD: `{ tests, code }`, the
|
|
1532
|
-
// testwriter's files (`
|
|
1503
|
+
// testwriter's files (`estUnTest`: test files and the shared test material) and the others.
|
|
1533
1504
|
function fichiersDuLot(ctx) {
|
|
1534
1505
|
const tests = [];
|
|
1535
1506
|
const code = [];
|
|
1536
1507
|
for (const { fichier } of changements(ctx)) {
|
|
1537
|
-
(
|
|
1508
|
+
(duTestwriter(ctx, fichier) ? tests : code).push(fichier);
|
|
1538
1509
|
}
|
|
1539
1510
|
return { tests: tests.sort(), code: code.sort() };
|
|
1540
1511
|
}
|
|
@@ -1625,8 +1596,8 @@ async function relire(ctx) {
|
|
|
1625
1596
|
dansLeLot.has(f)
|
|
1626
1597
|
);
|
|
1627
1598
|
lus = {
|
|
1628
|
-
tests: changes.filter(f =>
|
|
1629
|
-
code: changes.filter(f => !
|
|
1599
|
+
tests: changes.filter(f => duTestwriter(ctx, f)),
|
|
1600
|
+
code: changes.filter(f => !duTestwriter(ctx, f)),
|
|
1630
1601
|
};
|
|
1631
1602
|
precedente = [
|
|
1632
1603
|
`la relecture ${precedents}, ${avant.fiche.verdict} : tu relis la différence du lot depuis elle et ses constats, selon ta compétence (« La relecture bornée »).`,
|
|
@@ -1642,13 +1613,15 @@ async function relire(ctx) {
|
|
|
1642
1613
|
const affirmations = path.join(ctx.tmp, 'affirmations.md');
|
|
1643
1614
|
writeFileSync(affirmations, leTicket(ctx).description);
|
|
1644
1615
|
const liste = lot
|
|
1645
|
-
? elementsDuLot(ctx.copie, { avant: 'HEAD', apres: lot.commit })
|
|
1616
|
+
? langageDe(ctx.copie).elementsDuLot(ctx.copie, { avant: 'HEAD', apres: lot.commit })
|
|
1646
1617
|
: { etat: 'impossible', raison: 'le lot n’a pas pu être gardé', elements: [] };
|
|
1647
1618
|
// A bounded review: the lines of the review before, and the elements the difference touches
|
|
1648
1619
|
// (every one when it cannot be computed), as a review unticks « viewed » on the files changed
|
|
1649
1620
|
// since.
|
|
1650
1621
|
const touches =
|
|
1651
|
-
avant &&
|
|
1622
|
+
avant &&
|
|
1623
|
+
lot &&
|
|
1624
|
+
langageDe(ctx.copie).elementsDuLot(ctx.copie, { avant: avant.lot.commit, apres: lot.commit });
|
|
1652
1625
|
const bornee = touches
|
|
1653
1626
|
? {
|
|
1654
1627
|
touches: touches.etat === 'fait' ? new Set(touches.elements.map(e => e.id)) : null,
|
|
@@ -1687,7 +1660,7 @@ async function relire(ctx) {
|
|
|
1687
1660
|
return { verdict: fiche.verdict, fiche, texte, arbre: lot?.arbre ?? null };
|
|
1688
1661
|
}
|
|
1689
1662
|
|
|
1690
|
-
// The elements of the lot <liste> (
|
|
1663
|
+
// The elements of the lot <liste> (`elementsDuLot` of the module of language) as the reviewer's instruction
|
|
1691
1664
|
// lists them: one line each, its id, its kind, its status, its export, its package and its place;
|
|
1692
1665
|
// in a bounded review (<bornee>: `{ touches, lignes }`, the ids the difference touches, null for
|
|
1693
1666
|
// every one, and the lines of the review before by element), each marked to judge again, or to
|
|
@@ -1808,7 +1781,7 @@ function laPasseFinale(ctx) {
|
|
|
1808
1781
|
// The references of the circuit: those the project declares in the package.json of the copy
|
|
1809
1782
|
// (`grillhouse.references`), each `{ nom, commande, fichiers, tests, lit, gardes }` with a name, a
|
|
1810
1783
|
// command and files, `tests`, `lit` and `gardes` arrays when given, empty when not, `entiers` empty;
|
|
1811
|
-
// then the frame's (
|
|
1784
|
+
// then the frame's (`referencesDuCadre`, `cadre`), each but one whose first file a reference of the
|
|
1812
1785
|
// project covers, which replaces it.
|
|
1813
1786
|
function lesReferences(ctx) {
|
|
1814
1787
|
const l = lireJson(path.join(existsSync(ctx.copie) ? ctx.copie : ctx.racine, 'package.json'))
|
|
@@ -1832,9 +1805,9 @@ function lesReferences(ctx) {
|
|
|
1832
1805
|
entiers: [],
|
|
1833
1806
|
cadre: false,
|
|
1834
1807
|
}));
|
|
1835
|
-
const duCadre =
|
|
1836
|
-
c => !duProjet.some(r => couvertPar(r.fichiers, c.fichiers[0]))
|
|
1837
|
-
|
|
1808
|
+
const duCadre = referencesDuCadre(existsSync(ctx.copie) ? ctx.copie : ctx.racine)
|
|
1809
|
+
.filter(c => !duProjet.some(r => couvertPar(r.fichiers, c.fichiers[0])))
|
|
1810
|
+
.map(c => ({ ...c, tests: [], cadre: true }));
|
|
1838
1811
|
return [...duProjet, ...duCadre];
|
|
1839
1812
|
}
|
|
1840
1813
|
|
|
@@ -2233,7 +2206,7 @@ function fileEnCours(ctx) {
|
|
|
2233
2206
|
// envelope, on Sonnet, in the main tree, under the rights of its role (reading, the build of a
|
|
2234
2207
|
// package, no pass), its instruction from the eighth template (the ticket, its commit on main, the
|
|
2235
2208
|
// one the queue names in the reason it closes the ticket with, `commitIntegre`, its discoveries,
|
|
2236
|
-
// one per line), its sheet the tri's (`tri` of scripts/resultats.mjs): one line per discovery
|
|
2209
|
+
// one per line, the commands its rights permit, `commandesPermises`), its sheet the tri's (`tri` of scripts/resultats.mjs): one line per discovery
|
|
2237
2210
|
// (`conformiteDuTri`), asked again once of the same session. Each verdict is written at the ticket
|
|
2238
2211
|
// of its discovery (`Circuit · tri : <verdict> — <texte> (<piece>)`), its label set there; an
|
|
2239
2212
|
// a-porter or a non-confirmee reopens under `a-valider`, the pane's list « à valider »; the others
|
|
@@ -2273,6 +2246,7 @@ async function trier(ctx) {
|
|
|
2273
2246
|
sujet: ctx.sujet,
|
|
2274
2247
|
commit: commit || 'inconnu',
|
|
2275
2248
|
decouvertes: decouvertes.map(d => `- ${d.id} — ${d.sujet}`).join('\n'),
|
|
2249
|
+
commandes: commandesPermises(EXPLORATEUR),
|
|
2276
2250
|
},
|
|
2277
2251
|
7
|
|
2278
2252
|
),
|
|
@@ -2443,13 +2417,17 @@ function changements(ctx) {
|
|
|
2443
2417
|
return out;
|
|
2444
2418
|
}
|
|
2445
2419
|
|
|
2420
|
+
// Whether the testwriter writes <fichier> of the copy: the rule of a test file of the module of its
|
|
2421
|
+
// language (`estUnTest`, scripts/jointure.d.ts).
|
|
2422
|
+
const duTestwriter = (ctx, fichier) => langageDe(ctx.copie).estUnTest(fichier, ctx.copie) !== null;
|
|
2423
|
+
|
|
2446
2424
|
// The test files of the lot that the testwriter writes, present in the copy: in the packages of
|
|
2447
2425
|
// the plan and in the shared test material.
|
|
2448
2426
|
function testsDuLot(ctx) {
|
|
2449
2427
|
return changements(ctx)
|
|
2450
2428
|
.filter(c => !c.supprime)
|
|
2451
2429
|
.map(c => c.fichier)
|
|
2452
|
-
.filter(f =>
|
|
2430
|
+
.filter(f => langageDe(ctx.copie).estUnTest(f, ctx.copie)?.joue)
|
|
2453
2431
|
.sort();
|
|
2454
2432
|
}
|
|
2455
2433
|
|
|
@@ -2477,7 +2455,7 @@ function npm(ctx, etape, args, env = {}) {
|
|
|
2477
2455
|
try {
|
|
2478
2456
|
const r = avecLaMachine(
|
|
2479
2457
|
envMachine =>
|
|
2480
|
-
avecAvancement(ctx, genreDeLaPasse(etape, args), avancement =>
|
|
2458
|
+
avecAvancement(ctx, genreDeLaPasse(ctx, etape, args), avancement =>
|
|
2481
2459
|
spawnSync('npm', args, {
|
|
2482
2460
|
cwd: ctx.copie,
|
|
2483
2461
|
stdio: ['ignore', fd, fd],
|
|
@@ -2505,9 +2483,9 @@ function npm(ctx, etape, args, env = {}) {
|
|
|
2505
2483
|
// The kind of an automatic pass, by which its total is kept from one pass to the next
|
|
2506
2484
|
// (scripts/avancement.mjs): its step (the checks once final, the final pass) and its command
|
|
2507
2485
|
// without the test files and the filters, which move from one lot to the next.
|
|
2508
|
-
function genreDeLaPasse(etape, args) {
|
|
2486
|
+
function genreDeLaPasse(ctx, etape, args) {
|
|
2509
2487
|
const commande = args.filter(
|
|
2510
|
-
a => !
|
|
2488
|
+
a => !langageDe(ctx.copie).estUnTest(a, ctx.copie)?.joue && !a.startsWith('--filter=')
|
|
2511
2489
|
);
|
|
2512
2490
|
return etape === 'controles' && args[1] === 'verifier'
|
|
2513
2491
|
? ['passe finale', ...commande].join(' ')
|
|
@@ -2594,7 +2572,7 @@ function mesureDeLaPreuve(ctx, liste, fichiers) {
|
|
|
2594
2572
|
entier,
|
|
2595
2573
|
avant,
|
|
2596
2574
|
code: r.code,
|
|
2597
|
-
resultats:
|
|
2575
|
+
resultats: langageDe(ctx.copie).verdict(r.dossier).rapports,
|
|
2598
2576
|
// The builds of the plan's packages that failed: each one a red, not compiling is failing.
|
|
2599
2577
|
constructions: constructionsEchouees(ctx, liste, r.dossier),
|
|
2600
2578
|
});
|
|
@@ -2768,8 +2746,9 @@ function preuve(ctx) {
|
|
|
2768
2746
|
// task `<package>#build`) of a package of the plan: `{ nom, erreur }`, `erreur` its log file and
|
|
2769
2747
|
// the beginning of its own output.
|
|
2770
2748
|
function constructionsEchouees(ctx, liste, dossier) {
|
|
2771
|
-
return
|
|
2772
|
-
.
|
|
2749
|
+
return langageDe(ctx.copie)
|
|
2750
|
+
.verdict(dossier)
|
|
2751
|
+
.taches.filter(t => t.script === 'build' && t.code !== null && t.code !== 0)
|
|
2773
2752
|
.flatMap(t => {
|
|
2774
2753
|
const p = liste.find(x => x.pkg.name === t.paquet);
|
|
2775
2754
|
if (!p || !dansLePlan(ctx, p.dossier)) return [];
|
|
@@ -2805,7 +2784,8 @@ function situer(ctx, liste, chemin) {
|
|
|
2805
2784
|
function rougesDe(ctx, liste, c) {
|
|
2806
2785
|
const lus = lireSarif(c.dossier).constats.filter(k => k.genre !== A_ELAGUER);
|
|
2807
2786
|
const vert = c.code === 0 || c.code === A_REPASSER;
|
|
2808
|
-
const
|
|
2787
|
+
const gardesDuCadre = nomsDesGardes(ctx.copie);
|
|
2788
|
+
const duCadre = k => gardesDuCadre.includes(k.garde);
|
|
2809
2789
|
const rouge = k => k.niveau === 'error';
|
|
2810
2790
|
const ligneDe = k => {
|
|
2811
2791
|
const ou = k.fichier ? ` ${k.fichier}${k.ligne ? `:${k.ligne}` : ''}` : '';
|
|
@@ -2815,7 +2795,7 @@ function rougesDe(ctx, liste, c) {
|
|
|
2815
2795
|
if (vert) return { rouges: [], avertissements };
|
|
2816
2796
|
const out = [];
|
|
2817
2797
|
const testes = new Set();
|
|
2818
|
-
for (const res of
|
|
2798
|
+
for (const res of langageDe(ctx.copie).verdict(c.dossier).rapports) {
|
|
2819
2799
|
const f = path.relative(ctx.copie, res.fichier);
|
|
2820
2800
|
const lieu = situer(ctx, liste, f);
|
|
2821
2801
|
if (res.tests.length === 0 && res.etat === 'failed') {
|
|
@@ -2851,9 +2831,9 @@ function rougesDe(ctx, liste, c) {
|
|
|
2851
2831
|
}
|
|
2852
2832
|
// The guards of the project wrote findings when one comes from a guard out of the frame's.
|
|
2853
2833
|
const duProjet = constats.some(k => !duCadre(k));
|
|
2854
|
-
for (const t of
|
|
2834
|
+
for (const t of langageDe(ctx.copie).verdict(c.dossier).taches) {
|
|
2855
2835
|
if (t.code === null || t.code === 0 || t.code === A_REPASSER) continue;
|
|
2856
|
-
if (t.
|
|
2836
|
+
if (t.tests && testes.has(t.dossier)) continue;
|
|
2857
2837
|
if (t.script === 'grillhouse:gardes' && constats.length) continue;
|
|
2858
2838
|
if (t.script === 'gardes' && duProjet) continue;
|
|
2859
2839
|
const p = liste.find(x => x.pkg.name === t.paquet);
|
|
@@ -2929,7 +2909,13 @@ function controles(ctx, finale, restreinte = null, reportes = null) {
|
|
|
2929
2909
|
return { ...c, ...rougesDe(ctx, liste, c) };
|
|
2930
2910
|
});
|
|
2931
2911
|
// The packages the commands played (the root's tasks under « // »), whose reds are read again.
|
|
2932
|
-
const joues = new Set(
|
|
2912
|
+
const joues = new Set(
|
|
2913
|
+
resultats.flatMap(r =>
|
|
2914
|
+
langageDe(ctx.copie)
|
|
2915
|
+
.verdict(r.dossier)
|
|
2916
|
+
.taches.map(t => t.paquet)
|
|
2917
|
+
)
|
|
2918
|
+
);
|
|
2933
2919
|
const tous = [
|
|
2934
2920
|
...resultats.flatMap(r => r.rouges),
|
|
2935
2921
|
...(reportes?.rouges ?? []).filter(
|
|
@@ -3073,28 +3059,34 @@ function commandesDuPlan(ctx, liste) {
|
|
|
3073
3059
|
];
|
|
3074
3060
|
}
|
|
3075
3061
|
|
|
3076
|
-
//
|
|
3077
|
-
//
|
|
3062
|
+
// Whether the package <p> of the repository at <racine> (an entry of `paquets`) plays tests, as the
|
|
3063
|
+
// module of its language answers.
|
|
3064
|
+
const joueDesTests = (racine, p) =>
|
|
3065
|
+
langageDe(racine).joueDesTests(racine, {
|
|
3066
|
+
dossier: path.join(racine, p.dossier),
|
|
3067
|
+
nom: path.basename(p.dossier),
|
|
3068
|
+
paquet: p.pkg.name ?? null,
|
|
3069
|
+
});
|
|
3070
|
+
|
|
3071
|
+
// The directories of the packages of <liste> that play tests (`joueDesTests`) and that the plan
|
|
3072
|
+
// holds; sorted.
|
|
3078
3073
|
function paquetsDuPlan(ctx, liste) {
|
|
3079
3074
|
return liste
|
|
3080
|
-
.filter(p => p.
|
|
3075
|
+
.filter(p => dansLePlan(ctx, p.dossier) && joueDesTests(ctx.copie, p))
|
|
3081
3076
|
.map(p => p.dossier)
|
|
3082
3077
|
.sort();
|
|
3083
3078
|
}
|
|
3084
3079
|
|
|
3085
|
-
// Whether the plan carries no test: in a repository of packages, no package of the frame
|
|
3086
|
-
//
|
|
3087
|
-
//
|
|
3088
|
-
//
|
|
3080
|
+
// Whether the plan carries no test: in a repository of packages, no package of the frame that
|
|
3081
|
+
// plays tests (`joueDesTests`) lies in a path of the plan or holds it, as `npm test -- <chemin>`
|
|
3082
|
+
// refuses a path out of every package or in a package without tests. A repository without
|
|
3083
|
+
// packages plays its tests at its root: each plan has them.
|
|
3089
3084
|
function sansTests(ctx) {
|
|
3090
|
-
const
|
|
3085
|
+
const racine = existsSync(ctx.copie) ? ctx.copie : ctx.racine;
|
|
3086
|
+
const liste = paquets(racine).filter(p => !p.hors);
|
|
3091
3087
|
if (liste.length === 0) return false;
|
|
3092
3088
|
const touche = (c, d) => c === '.' || d === c || d.startsWith(`${c}/`) || c.startsWith(`${d}/`);
|
|
3093
|
-
return !liste.some(
|
|
3094
|
-
p =>
|
|
3095
|
-
typeof p.pkg.scripts?.['test:vitest'] === 'string' &&
|
|
3096
|
-
ctx.paquets.some(c => touche(c, p.dossier))
|
|
3097
|
-
);
|
|
3089
|
+
return !liste.some(p => ctx.paquets.some(c => touche(c, p.dossier)) && joueDesTests(racine, p));
|
|
3098
3090
|
}
|
|
3099
3091
|
|
|
3100
3092
|
// Whether the copy holds a change of the plan against its HEAD.
|
|
@@ -3191,10 +3183,10 @@ async function derouler(ctx, debut) {
|
|
|
3191
3183
|
commenter(
|
|
3192
3184
|
ctx,
|
|
3193
3185
|
'testwriter',
|
|
3194
|
-
'aucun test dans le plan (aucun paquet
|
|
3186
|
+
'aucun test dans le plan (aucun paquet qui joue des tests ne le tient) : ni testwriter ni preuve, le développeur directement.'
|
|
3195
3187
|
);
|
|
3196
3188
|
rapport = [
|
|
3197
|
-
`Le plan (${ctx.paquets.join(', ')}) ne porte aucun test (aucun paquet
|
|
3189
|
+
`Le plan (${ctx.paquets.join(', ')}) ne porte aucun test (aucun paquet qui joue des tests ne le tient) : le circuit te lance sans testwriter ni preuve. Tu écris le ticket d'après ses critères ; les contrôles suivent ta séance.`,
|
|
3198
3190
|
rapport,
|
|
3199
3191
|
]
|
|
3200
3192
|
.filter(Boolean)
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// A command of the module of the project's language, run when the module describes it: the one
|
|
3
|
+
// point by which the launcher (scripts/enveloppe/lancer.sh, `construire`) and the night
|
|
4
|
+
// (scripts/nuit.sh, `tests-de-nuit`) play a step that a language may have or not, as a build tool
|
|
5
|
+
// skips a goal its backend does not bring.
|
|
6
|
+
//
|
|
7
|
+
// node commande-du-langage.mjs <nom> [arguments…] from the root of the project
|
|
8
|
+
//
|
|
9
|
+
// - The command is the subcommand <nom> of the module (`commandeDe` of ./sous-commandes.mjs), run
|
|
10
|
+
// by Node with its arguments then these, in the working directory, this process's standard
|
|
11
|
+
// streams; its exit code is this command's, 128 plus the number of a signal that ended it.
|
|
12
|
+
// - A project that declares no language (`grillhouse.langages`), or whose module describes no
|
|
13
|
+
// command <nom>, plays nothing: exit 0.
|
|
14
|
+
// - A name of the core (`grillhouse <nom>`), or none, is refused, exit 2.
|
|
15
|
+
import { spawnSync } from 'node:child_process';
|
|
16
|
+
import { constants } from 'node:os';
|
|
17
|
+
import { pathToFileURL } from 'node:url';
|
|
18
|
+
import { langagesDeclares } from './langages.mjs';
|
|
19
|
+
import { commandeDe, SOUS_COMMANDES } from './sous-commandes.mjs';
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Runs the command <nom> of the module of the language of the project at <racine> with <args>,
|
|
23
|
+
* when the project declares a language and its module describes it: its exit code, 0 otherwise.
|
|
24
|
+
* @param {string} nom the command of the module
|
|
25
|
+
* @param {string[]} args its arguments
|
|
26
|
+
* @param {string} [racine] the root of the project, the working directory by default
|
|
27
|
+
* @returns {number}
|
|
28
|
+
*/
|
|
29
|
+
export function lancerDuLangage(nom, args, racine = process.cwd()) {
|
|
30
|
+
if (langagesDeclares(racine).length === 0) {
|
|
31
|
+
return 0;
|
|
32
|
+
}
|
|
33
|
+
const c = commandeDe(nom, racine);
|
|
34
|
+
if (c === null) {
|
|
35
|
+
return 0;
|
|
36
|
+
}
|
|
37
|
+
const r = spawnSync(process.execPath, [c.script, ...c.args, ...args], {
|
|
38
|
+
cwd: racine,
|
|
39
|
+
stdio: 'inherit',
|
|
40
|
+
});
|
|
41
|
+
if (r.error) {
|
|
42
|
+
process.stderr.write(`⛔ ${nom} : ${r.error.message}\n`);
|
|
43
|
+
return 1;
|
|
44
|
+
}
|
|
45
|
+
return r.status ?? 128 + (constants.signals[r.signal ?? 'SIGTERM'] ?? 0);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) {
|
|
49
|
+
const [nom, ...args] = process.argv.slice(2);
|
|
50
|
+
if (!nom || Object.hasOwn(SOUS_COMMANDES, nom)) {
|
|
51
|
+
process.stderr.write('usage: commande-du-langage.mjs <commande du module> [arguments…]\n');
|
|
52
|
+
process.exitCode = 2;
|
|
53
|
+
} else {
|
|
54
|
+
process.exitCode = lancerDuLangage(nom, args);
|
|
55
|
+
}
|
|
56
|
+
}
|