@roomi-fields/grillhouse 0.28.3 → 0.29.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.
Files changed (68) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/bin/grillhouse.mjs +55 -14
  3. package/cadre/templates/projet/CLAUDE.md +1 -1
  4. package/cadre/templates/projet/README.md +11 -11
  5. package/cadre/templates/projet/_gitignore +2 -5
  6. package/charte.md +13 -4
  7. package/docs/ARCHITECTURE.md +260 -29
  8. package/docs/INTERFACE.md +51 -12
  9. package/package.json +1 -1
  10. package/scripts/aiguillage.mjs +324 -0
  11. package/scripts/avancement.mjs +33 -50
  12. package/scripts/circuit.mjs +558 -146
  13. package/scripts/composition-des-langages.mjs +16 -1
  14. package/scripts/conformite.mjs +16 -0
  15. package/scripts/copies-finies.mjs +171 -30
  16. package/scripts/demon.mjs +134 -21
  17. package/scripts/enveloppe/lancer.sh +13 -14
  18. package/scripts/enveloppe/travail-de-la-copie.mjs +94 -11
  19. package/scripts/etapes.mjs +1 -1
  20. package/scripts/fusion-du-changelog.mjs +0 -1
  21. package/scripts/grillhouse-maj.mjs +16 -7
  22. package/scripts/integration/file.mjs +3 -3
  23. package/scripts/integration/integrer.mjs +3 -3
  24. package/scripts/jointure.d.ts +39 -17
  25. package/scripts/langages/cargo/commandes.mjs +152 -25
  26. package/scripts/langages/cargo/composants.mjs +90 -2
  27. package/scripts/langages/cargo/exemples.mjs +68 -1
  28. package/scripts/langages/cargo/index.mjs +17 -8
  29. package/scripts/langages/cargo/migrations/0.28.4-tailles-des-tests.mjs +35 -0
  30. package/scripts/langages/cargo/sccache.mjs +54 -2
  31. package/scripts/langages/cargo/squelette.mjs +72 -3
  32. package/scripts/langages/cargo/tailles-des-tests.mjs +195 -0
  33. package/scripts/langages/cargo/tests-de-head.mjs +159 -0
  34. package/scripts/langages/python/commandes.mjs +44 -7
  35. package/scripts/langages/python/composants.mjs +33 -3
  36. package/scripts/langages/python/exemples.mjs +19 -0
  37. package/scripts/langages/python/index.mjs +4 -0
  38. package/scripts/langages/python/squelette.mjs +119 -17
  39. package/scripts/langages/typescript/exemples.mjs +16 -0
  40. package/scripts/langages/typescript/index.mjs +6 -3
  41. package/scripts/langages/typescript/regle-des-tests.mjs +13 -0
  42. package/scripts/langages/typescript/squelette.mjs +18 -2
  43. package/scripts/langages/typescript/tests-de-nuit.mjs +41 -21
  44. package/scripts/langages/typescript/verifier.mjs +82 -288
  45. package/scripts/langages/typescript/vitest-config/base.mjs +8 -9
  46. package/scripts/langages/typescript/vitest-config/cibles.mjs +92 -53
  47. package/scripts/langages/typescript/vitest-config/duree.reporter.mjs +11 -5
  48. package/scripts/langages/typescript/vitest-config/machine.setup.mjs +4 -2
  49. package/scripts/langages/typescript/vitest-config/mesure.mjs +3 -2
  50. package/scripts/langages/typescript/vitest.nuit.config.mjs +18 -13
  51. package/scripts/lecture-unique.mjs +51 -0
  52. package/scripts/mesure/pression.mjs +9 -7
  53. package/scripts/nuit.sh +19 -12
  54. package/scripts/outil.mjs +72 -0
  55. package/scripts/paquet.mjs +39 -10
  56. package/scripts/resultats.mjs +22 -5
  57. package/scripts/services-du-noyau.mjs +8 -9
  58. package/scripts/session-start.sh +10 -1
  59. package/scripts/sortie.mjs +20 -1
  60. package/scripts/sources.mjs +3 -3
  61. package/scripts/sous-commandes.mjs +1 -0
  62. package/scripts/superviseur.mjs +369 -14
  63. package/scripts/tableau.mjs +219 -58
  64. package/scripts/verrou-de-machine.mjs +303 -58
  65. package/skills/developpeur/SKILL.md +11 -3
  66. package/skills/pitmaster/SKILL.md +58 -23
  67. package/skills/relecteur/SKILL.md +18 -6
  68. package/skills/testwriter/SKILL.md +11 -15
@@ -15,7 +15,9 @@
15
15
  // names; a row whose cell of the column « Langage » is empty; a language out of the frame's
16
16
  // list; a folder that already holds the manifest of its language (`manifeste` of its module). A
17
17
  // folder that holds docs/ alone, the documents of the second time, is accepted, as `cargo init`
18
- // takes a folder without its Cargo.toml.
18
+ // takes a folder without its Cargo.toml; a folder that already holds code is given to the
19
+ // module with its files (`existants`), which takes them as they are, or refuses, by its name,
20
+ // what it cannot take.
19
21
  // - The skeleton: the module of the row's language gives the files of the package and the entry
20
22
  // of the workspace (`squelette`, scripts/jointure.d.ts), the versions of its tools from its
21
23
  // template (`miseAJour.gabarit`); the documents of the package, docs/CADRE.md and
@@ -26,15 +28,15 @@
26
28
  // - The tools of the language, as `nx add` installs them before the first generator: the share
27
29
  // of the update of each declared language (`mettreAJour` of ./grillhouse-maj.mjs: its tools at
28
30
  // its template's versions, its scripts, its files, `turbo.json` for typescript), then `npm
29
- // install` when the update asks it, the module's command that locks the versions of the new
30
- // package (`verrouiller`), the binaries of the declared languages (`installerBinaires`), and the
31
+ // install` when the update asks it, the module's commands that lock the versions of the new
32
+ // package (`verrouiller`), in their order, the binaries of the declared languages (`installerBinaires`), and the
31
33
  // generators (`regenerer`), those of the package's language whatever files the project holds:
32
34
  // the first package of a language receives its boundaries' configuration and its index.
33
35
  // - The report: each file written, then the lines of the update; on the error stream, each
34
36
  // command that fails, named with its output. The exit code: 0; 1 for a refusal (⛔ and its
35
37
  // reason) or a command that fails; 2 for the usage.
36
38
  import { spawnSync } from 'node:child_process';
37
- import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
39
+ import { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync } from 'node:fs';
38
40
  import path from 'node:path';
39
41
  import { pathToFileURL } from 'node:url';
40
42
  import { CADRE } from './cadre.mjs';
@@ -46,6 +48,7 @@ import {
46
48
  regenerer,
47
49
  } from './grillhouse-maj.mjs';
48
50
  import { LANGAGES, langage } from './langages.mjs';
51
+ import { hors } from './sources.mjs';
49
52
  import {
50
53
  ARCHITECTURE,
51
54
  colonneDesNoms,
@@ -100,13 +103,34 @@ export function ligneDuPaquet(racine, rel) {
100
103
 
101
104
  const lireJson = f => (existsSync(f) ? JSON.parse(readFileSync(f, 'utf8')) : {});
102
105
 
106
+ // The files the folder <dossier> of the project at <racine> already holds, from it, in the order of
107
+ // their path: its docs/ (the documents of the second time), its hidden entries and the folders the
108
+ // sources of the project leave out (`hors` of ./sources.mjs: the frame's, node_modules and dist,
109
+ // and what the tools of its languages write, cargo's target, Python's .venv and
110
+ // __pycache__) left out.
111
+ function existants(racine, dossier) {
112
+ const exclus = hors(racine);
113
+ if (!existsSync(dossier)) {
114
+ return [];
115
+ }
116
+ return readdirSync(dossier, { recursive: true, withFileTypes: true })
117
+ .filter(e => e.isFile())
118
+ .map(e => path.relative(dossier, path.join(e.parentPath, e.name)).split(path.sep).join('/'))
119
+ .filter(
120
+ f => !f.startsWith('docs/') && !f.split('/').some(p => p.startsWith('.') || exclus.has(p))
121
+ )
122
+ .sort();
123
+ }
124
+
103
125
  /**
104
126
  * The plan of the package at <chemin> of the project at <racine>, nothing written: `{ chemin,
105
127
  * langage, fichiers, espace, verrouiller }`, `fichiers` the skeleton of its language and its
106
128
  * documents (path from the root → text), `espace` the manifest of the workspace with its entry
107
- * (null when it holds it), `verrouiller` the command that locks its versions. Throws a Refus, by
108
- * its name, for a path no row names, a row without language, a language out of the frame's list,
109
- * or a folder that holds the manifest of its language.
129
+ * (null when it holds it), `verrouiller` the commands that lock its versions, played in their
130
+ * order. Throws a Refus, by its name, for a path no row names, a row without language, a language
131
+ * out of the frame's list, a folder that holds the manifest of its language, and a folder whose
132
+ * code the module cannot take (a manifest of Python it does not read, Rust or TypeScript out of
133
+ * its layout), what is missing named.
110
134
  * @param {string} racine the root of the project
111
135
  * @param {string} chemin the package's folder, from the root
112
136
  * @param {{ source?: string }} [o] the frame's files (CADRE)
@@ -139,7 +163,11 @@ export function planDuPaquet(racine, chemin, { source = CADRE } = {}) {
139
163
  const modele = lireJson(path.join(source, m.miseAJour.gabarit, 'package.json'));
140
164
  let s;
141
165
  try {
142
- s = m.squelette(racine, { chemin: rel, modele });
166
+ s = m.squelette(racine, {
167
+ chemin: rel,
168
+ modele,
169
+ existants: existants(racine, path.join(racine, rel)),
170
+ });
143
171
  } catch (e) {
144
172
  throw new Refus(e.message);
145
173
  }
@@ -219,8 +247,9 @@ export function creerPaquet(racine, chemin, { source = CADRE, executer = lancer
219
247
  if (aInstaller(b)) {
220
248
  jouer('npm', ['install'], '.');
221
249
  }
222
- const v = plan.verrouiller;
223
- jouer(v.commande, v.args, v.dossier);
250
+ for (const v of plan.verrouiller) {
251
+ jouer(v.commande, v.args, v.dossier);
252
+ }
224
253
  const binaires = installerBinaires(racine);
225
254
  echecs.push(...binaires.lignes, ...regenerer(racine, { langage: plan.langage.nom }));
226
255
  const lignes = rapport(b)
@@ -51,10 +51,11 @@
51
51
  // and the circuit refuses a sheet without a line for each element, or with a line on an
52
52
  // element out of the list, a file the lot changes named alone or as `<fichier>#<nom>`
53
53
  // (`conformiteDuLot`) (reviewer);
54
- // - `suivi` (`titre`, `etat` levé or non levé, `preuve`): after a review sent back, each finding
55
- // before it judged on the difference of the lot, by its title (its number « Constat N — »
56
- // recognised, `cleDuConstat`), which the circuit writes at the ticket with the verdict, for
57
- // the human (reviewer);
54
+ // - `suivi` (`titre`, `etat` levé or non levé, `preuve`): each finding still open judged on the
55
+ // lot, bounded or whole, by its title (its number « Constat N — » recognised, `cleDuConstat`),
56
+ // which the circuit writes at the ticket with the verdict, for the human; the circuit refuses
57
+ // a sheet without a line for one, or an ACCEPTÉ that holds one not lifted
58
+ // (`suiviDesConstats`) (reviewer);
58
59
  // - `question`, with its `piece` (reviewer): what goes up to the owner, a real word of the
59
60
  // language written in the code; the circuit stops at « besoin » before it commits or
60
61
  // relaunches anyone;
@@ -425,7 +426,7 @@ const FICHES = {
425
426
  },
426
427
  ['titre', 'etat']
427
428
  ),
428
- 'Relecture bornée : chaque constat de la relecture d’avant, levé ou non.'
429
+ 'Chaque constat encore ouvert, levé ou non, en relecture bornée comme entière.'
429
430
  ),
430
431
  question: texte(
431
432
  'Ce qui revient au responsable (par exemple un vrai mot du langage écrit en dur) : la question et ta recommandation ; le circuit s’arrête avant de commiter ou de relancer.'
@@ -618,6 +619,22 @@ export function reponsesAuxConstats(fiche, titres) {
618
619
  return `reponses : sans réponse ${sans.length > 1 ? 'aux constats' : 'au constat'} ${sans.join(', ')}`;
619
620
  }
620
621
 
622
+ // What makes the reviewer's sheet <fiche> out of conformity with the findings still open (their
623
+ // <titres>), as Gerrit carries each unresolved comment to the next patch set whatever the form of
624
+ // the review: a finding without its line in `suivi` (by its title, numbered or not), or an ACCEPTÉ
625
+ // that holds one not lifted. The fault, or null.
626
+ export function suiviDesConstats(fiche, titres) {
627
+ const etats = new Map((fiche.suivi ?? []).map(s => [cleDuConstat(s.titre), s.etat]));
628
+ const liste = l => l.map(t => `« ${t} »`).join(', ');
629
+ const sans = titres.filter(t => !etats.has(t));
630
+ if (sans.length) {
631
+ return `suivi : sans ligne pour ${sans.length > 1 ? 'les constats' : 'le constat'} ${liste(sans)}`;
632
+ }
633
+ const tenus = fiche.verdict === 'ACCEPTÉ' ? titres.filter(t => etats.get(t) !== 'levé') : [];
634
+ if (!tenus.length) return null;
635
+ return `suivi : un ACCEPTÉ tient ${tenus.length > 1 ? 'les constats' : 'le constat'} ${liste(tenus)} non levé${tenus.length > 1 ? 's' : ''}`;
636
+ }
637
+
621
638
  // What makes the sheet of the tri <fiche> out of conformity with the discoveries <decouvertes> of
622
639
  // the ticket (their ids), as a reviewer gives a line to each element of its lot: a discovery
623
640
  // without its line, a line on an id out of the list, a discovery with two lines. The fault, or
@@ -13,8 +13,9 @@ export * from './langages.mjs';
13
13
  // pass and its measure, the base of a pass, the pressure of the machine and its lock, the last
14
14
  // green, the arbitrages of a ticket, the source files of a project.
15
15
  export { arbitrageTranche, estArbitrage } from './arbitrages.mjs';
16
- export { ecrireLaMesure, garderLeTotal, inscrireLePlan, ouvrirAvancement } from './avancement.mjs';
16
+ export { garderLeTotal, inscrireLePlan, ouvrirAvancement } from './avancement.mjs';
17
17
  export { sources } from './sources.mjs';
18
+ export { luUneFois } from './lecture-unique.mjs';
18
19
  export { CHANGEMENTS, DEPUIS_LE_VERT, garderLeVert, mesure } from './dernier-vert.mjs';
19
20
  export { lireLaListe, paquetsDeLEnveloppe } from './enveloppe/paquets-du-plan.mjs';
20
21
  export { AVANCEMENT, ecrireTache } from './mesure/avancement.mjs';
@@ -26,12 +27,10 @@ export {
26
27
  ouvrirBase,
27
28
  retirerALInterruption,
28
29
  } from './mesure/base-de-passe.mjs';
30
+ export { A_REPASSER, ecrirePression, lirePression, SEUIL_PRESSION } from './mesure/pression.mjs';
29
31
  export {
30
- A_REPASSER,
31
- attendreLeRepos,
32
- BORNE_ATTENTE_MS,
33
- ecrirePression,
34
- lirePression,
35
- SEUIL_PRESSION,
36
- } from './mesure/pression.mjs';
37
- export { attendreDeLaPlace, AttenteDeLaMachine, avecLaMachine } from './verrou-de-machine.mjs';
32
+ attendreDeLaPlace,
33
+ AttenteDeLaMachine,
34
+ avecLaMachine,
35
+ nommerLAvancement,
36
+ } from './verrou-de-machine.mjs';
@@ -28,7 +28,11 @@
28
28
  # one version, with the command that aligns the one behind. An agent's copy does not read them.
29
29
  #
30
30
  # One supervisor per project (scripts/superviseur.mjs): the session takes the lock of its
31
- # repository; a second session, while the first one lives, receives first the section « Un autre
31
+ # repository, and, when its opening takes the lock (not when it keeps it, after a compaction or a
32
+ # /clear), receives the section « L'attente des questions », the wait to launch in the background,
33
+ # then « Les circuits du dépôt » when there are some: each circuit that runs, each one stopped on a
34
+ # question with its question and the command that answers it, each one dead without a final state
35
+ # with the command that resumes it; a second session, while the first one lives, receives first the section « Un autre
32
36
  # superviseur tient ce dépôt », which asks it to say so to the owner and to launch no circuit. An
33
37
  # agent's copy and a session of a role the circuit launches take nothing and receive nothing.
34
38
  #
@@ -56,6 +60,11 @@ fi
56
60
  # One supervisor per project: the lock of the repository, or the section that says who holds it.
57
61
  superviseur="$(node "$ici/superviseur.mjs" "$root" 2>/dev/null)"
58
62
  [ -z "$superviseur" ] || echo "$superviseur"
63
+ # The published version that leads the repository (grillhouse.outil), when it cannot be installed:
64
+ # the orchestration runs on the code of the repository, which the session is told
65
+ # (scripts/aiguillage.mjs).
66
+ outil="$(node "$ici/aiguillage.mjs" --echec "$root" 2>/dev/null)"
67
+ [ -z "$outil" ] || echo "$outil"
59
68
 
60
69
  missing=()
61
70
 
@@ -4,6 +4,7 @@
4
4
  //
5
5
  // npx grillhouse sortie <x.y.z> the release's files: the package's package.json, CHANGELOG.md
6
6
  // npx grillhouse sortie --etiqueter the annotated tag v<version> on HEAD, the release commit
7
+ // and the gesture that leads Grillhouse with it once published
7
8
  // npx grillhouse sortie --verifier-etiquette <v> exits 0 when the tag <v> names the version of the package
8
9
  // npx grillhouse sortie --entree-du-marche the entry of the plugin in the marketplace roomi-fields
9
10
  //
@@ -115,6 +116,23 @@ export function etiqueter(
115
116
  return etiquette;
116
117
  }
117
118
 
119
+ /**
120
+ * What follows the tag <etiquette> once its package is published: the gesture that leads Grillhouse
121
+ * with it (`npx grillhouse outil <version>`, scripts/outil.mjs, which writes `grillhouse.outil` and
122
+ * installs the version), and the update of the frame's plugin installed for the repository, at
123
+ * its local scope, as in the other projects.
124
+ * @param {string} etiquette v<x.y.z>
125
+ * @returns {string}
126
+ */
127
+ export function suiteDeLaSortie(etiquette) {
128
+ const version = etiquette.replace(/^v/, '');
129
+ return (
130
+ `Une fois ${version} publiée, Grillhouse se mène avec elle : npx grillhouse outil ${version} ` +
131
+ '(la clé grillhouse.outil, à commiter, et la version installée), puis ' +
132
+ 'claude plugin update grillhouse@roomi-fields --scope local (le greffon de Grillhouse).\n'
133
+ );
134
+ }
135
+
118
136
  const USAGE =
119
137
  'Usage : npx grillhouse sortie <x.y.z> prépare la sortie (package.json du paquet, CHANGELOG.md)\n' +
120
138
  " npx grillhouse sortie --etiqueter pose l'étiquette v<version> sur le commit de sortie\n" +
@@ -136,7 +154,8 @@ if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) {
136
154
  const e = etiqueter(racine);
137
155
  process.stdout.write(
138
156
  `Étiquette ${e} posée sur HEAD, en local. La poussée, que valide le responsable : git push origin ${e} ` +
139
- '(la CI joue alors le commit, puis publie le paquet sur npm)\n'
157
+ '(la CI joue alors le commit, puis publie le paquet sur npm)\n' +
158
+ suiteDeLaSortie(e)
140
159
  );
141
160
  } else if (args.length === 1 && args[0] === '--entree-du-marche') {
142
161
  process.stdout.write(`${JSON.stringify(ENTREE_DU_MARCHE, null, 2)}\n`);
@@ -24,9 +24,9 @@ const HORS = [
24
24
  '.rtfm',
25
25
  ];
26
26
 
27
- // The directories left out in the project at <racine>: the frame's, and what its language's tools
28
- // write (every language's, for a project that declares none).
29
- function hors(racine) {
27
+ /** The directories left out in the project at <racine>: the frame's, and what its language's tools
28
+ * write (every language's, for a project that declares none). */
29
+ export function hors(racine) {
30
30
  const declares = langagesDeclares(racine);
31
31
  const ecrits =
32
32
  declares.length > 0
@@ -41,6 +41,7 @@ export const SOUS_COMMANDES = {
41
41
  'ligne-etat': 'ligne-etat/ligne-etat.mjs',
42
42
  maj: 'grillhouse-maj.mjs',
43
43
  nuit: 'nuit.sh',
44
+ outil: 'outil.mjs',
44
45
  paquet: 'paquet.mjs',
45
46
  pression: 'mesure/pression.mjs',
46
47
  registre: 'registre.mjs',