@roomi-fields/grillhouse 0.24.15 → 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.
Files changed (124) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/bin/grillhouse.mjs +40 -12
  3. package/cadre/templates/cargo/.config/nextest.toml +8 -0
  4. package/cadre/templates/cargo/deny.toml +36 -0
  5. package/cadre/templates/cargo/package.json +15 -0
  6. package/cadre/templates/cargo/rust-toolchain.toml +6 -0
  7. package/cadre/templates/projet/package.json +5 -1
  8. package/cadre/templates/turbo/paquets.json +1 -1
  9. package/cadre/templates/turbo/sans-paquets.json +1 -1
  10. package/charte.md +16 -0
  11. package/docs/ARCHITECTURE.md +157 -54
  12. package/docs/CADRE.md +47 -0
  13. package/docs/INTERFACE.md +168 -0
  14. package/package.json +62 -13
  15. package/scripts/arbitrages.mjs +23 -0
  16. package/scripts/avancement.mjs +15 -29
  17. package/scripts/circuit.mjs +89 -97
  18. package/scripts/commande-du-langage.mjs +56 -0
  19. package/scripts/composants-affectes.mjs +47 -170
  20. package/scripts/conformite.d.ts +27 -0
  21. package/scripts/conformite.mjs +226 -0
  22. package/scripts/demon.mjs +1 -1
  23. package/scripts/dernier-vert.mjs +11 -9
  24. package/scripts/droits.mjs +27 -21
  25. package/scripts/enveloppe/enveloppe.mjs +206 -64
  26. package/scripts/enveloppe/lancer.sh +20 -91
  27. package/scripts/enveloppe/paquets-du-plan.mjs +24 -2
  28. package/scripts/etapes.mjs +2 -2
  29. package/scripts/gardes-du-cadre.mjs +12 -18
  30. package/scripts/grillhouse-maj.mjs +246 -389
  31. package/scripts/init.mjs +2 -1
  32. package/scripts/integration/file.mjs +3 -3
  33. package/scripts/integration/integrer.mjs +13 -10
  34. package/scripts/integration/rejeu.mjs +36 -7
  35. package/scripts/jointure.d.ts +304 -0
  36. package/scripts/langages/cargo/binaires.json +4 -0
  37. package/scripts/langages/cargo/binaires.mjs +60 -0
  38. package/scripts/langages/cargo/clippy.mjs +103 -0
  39. package/scripts/langages/cargo/commandes.mjs +378 -0
  40. package/scripts/langages/cargo/composants.mjs +191 -0
  41. package/scripts/langages/cargo/elements-du-lot.mjs +139 -0
  42. package/scripts/langages/cargo/exemples.mjs +357 -0
  43. package/scripts/langages/cargo/frontieres.mjs +84 -0
  44. package/scripts/langages/cargo/index-interfaces.mjs +138 -0
  45. package/scripts/langages/cargo/index.mjs +115 -0
  46. package/scripts/langages/cargo/mise-a-jour.mjs +93 -0
  47. package/scripts/langages/cargo/nextest.toml +5 -0
  48. package/scripts/langages/cargo/touches.mjs +93 -0
  49. package/scripts/langages/cargo/verdict.mjs +85 -0
  50. package/scripts/langages/typescript/chemins-des-tests.mjs +68 -0
  51. package/scripts/{code-mort.mjs → langages/typescript/code-mort.mjs} +5 -5
  52. package/scripts/langages/typescript/composants.mjs +64 -0
  53. package/scripts/{consommateurs-arbitres.mjs → langages/typescript/consommateurs-arbitres.mjs} +6 -24
  54. package/scripts/{consommateurs.mjs → langages/typescript/consommateurs.mjs} +13 -71
  55. package/scripts/langages/typescript/construire.mjs +176 -0
  56. package/scripts/{elements-du-lot.mjs → langages/typescript/elements-du-lot.mjs} +2 -2
  57. package/scripts/langages/typescript/exemples.mjs +289 -0
  58. package/scripts/{frontieres.mjs → langages/typescript/frontieres.mjs} +3 -5
  59. package/scripts/{index-interfaces.mjs → langages/typescript/index-interfaces.mjs} +3 -3
  60. package/scripts/langages/typescript/index.mjs +335 -0
  61. package/scripts/{interfaces-contre-code.mjs → langages/typescript/interfaces-contre-code.mjs} +2 -2
  62. package/scripts/langages/typescript/lecteurs.mjs +179 -0
  63. package/scripts/{migrations → langages/typescript/migrations}/0.23.0-config-vitest.mjs +14 -29
  64. package/scripts/{migrations → langages/typescript/migrations}/0.24.4-noms-declares-inutilises.mjs +2 -2
  65. package/scripts/{migrations → langages/typescript/migrations}/0.24.6-lignes-mal-formees.mjs +2 -2
  66. package/scripts/{migrations → langages/typescript/migrations}/0.24.7-matiere-dans-les-tests.mjs +2 -2
  67. package/scripts/langages/typescript/migrations/0.25.0-chemins-des-tests.mjs +27 -0
  68. package/scripts/langages/typescript/migrations/0.25.0-tailles-des-tests.mjs +31 -0
  69. package/scripts/langages/typescript/mise-a-jour.mjs +320 -0
  70. package/scripts/{references-par-les-types.mjs → langages/typescript/references-par-les-types.mjs} +3 -3
  71. package/scripts/langages/typescript/regle-des-tests.mjs +39 -0
  72. package/scripts/{resumes.mjs → langages/typescript/resumes.mjs} +4 -4
  73. package/scripts/langages/typescript/script-des-tests.mjs +6 -0
  74. package/scripts/langages/typescript/tailles-des-tests.mjs +219 -0
  75. package/scripts/langages/typescript/tests-de-nuit.mjs +57 -0
  76. package/scripts/{tests.mjs → langages/typescript/tests.mjs} +41 -32
  77. package/scripts/{turbo-des-paquets.mjs → langages/typescript/turbo-des-paquets.mjs} +49 -23
  78. package/scripts/langages/typescript/verdict.mjs +105 -0
  79. package/scripts/{verifier.mjs → langages/typescript/verifier.mjs} +53 -34
  80. package/scripts/{vitest-config → langages/typescript/vitest-config}/avancement.reporter.mjs +10 -2
  81. package/scripts/{vitest-config → langages/typescript/vitest-config}/base.mjs +63 -9
  82. package/scripts/{vitest-config → langages/typescript/vitest-config}/changements.mjs +18 -11
  83. package/scripts/{vitest-config → langages/typescript/vitest-config}/cibles.mjs +7 -6
  84. package/scripts/{vitest-config → langages/typescript/vitest-config}/duree.reporter.mjs +6 -1
  85. package/scripts/langages/typescript/vitest-config/lances.mjs +473 -0
  86. package/scripts/{vitest-config → langages/typescript/vitest-config}/mesure.setup.mjs +1 -1
  87. package/scripts/{vitest-config → langages/typescript/vitest-config}/resultats.mjs +5 -5
  88. package/scripts/{vitest-config → langages/typescript/vitest-config}/resultats.setup.mjs +4 -3
  89. package/scripts/{vitest.nuit.config.mjs → langages/typescript/vitest.nuit.config.mjs} +2 -2
  90. package/scripts/langages.mjs +85 -0
  91. package/scripts/{vitest-config → mesure}/avancement.mjs +4 -13
  92. package/scripts/{vitest-config → mesure}/base-de-passe.mjs +70 -33
  93. package/scripts/{vitest-config → mesure}/pression.mjs +5 -6
  94. package/scripts/migrations/0.23.2-copies-du-cadre.mjs +29 -6
  95. package/scripts/migrations/0.24.0-circuit-simplifie.mjs +13 -6
  96. package/scripts/migrations/0.25.0-script-des-tests.mjs +92 -0
  97. package/scripts/migrations.mjs +17 -13
  98. package/scripts/nuit.sh +59 -63
  99. package/scripts/paquets.d.ts +5 -0
  100. package/scripts/paquets.mjs +24 -2
  101. package/scripts/resultats.mjs +8 -82
  102. package/scripts/services-du-noyau.mjs +30 -0
  103. package/scripts/session-start.sh +17 -9
  104. package/scripts/sources.mjs +35 -13
  105. package/scripts/sous-commandes.mjs +57 -17
  106. package/scripts/superviseur.mjs +1 -1
  107. package/scripts/tableau.mjs +1 -1
  108. package/scripts/un-commit-par-ticket.mjs +48 -14
  109. package/scripts/verrou-de-fichier.mjs +1 -1
  110. package/scripts/verrou-de-machine.mjs +4 -4
  111. package/scripts/verrous/verrou.mjs +28 -37
  112. package/skills/developpeur/SKILL.md +2 -2
  113. package/skills/explorateur/SKILL.md +13 -5
  114. package/skills/grill/SKILL.md +2 -2
  115. package/skills/pitmaster/references/cadre.md +1 -1
  116. package/skills/pitmaster/references/consigne-agent.md +10 -3
  117. package/skills/redacteur/references/documents-d-un-composant.md +4 -4
  118. package/skills/relecteur/SKILL.md +4 -1
  119. package/skills/testwriter/SKILL.md +20 -6
  120. /package/scripts/{consommateurs.d.ts → langages/typescript/consommateurs.d.ts} +0 -0
  121. /package/scripts/{vitest-config → langages/typescript/vitest-config}/base.d.ts +0 -0
  122. /package/scripts/{vitest-config → langages/typescript/vitest-config}/machine.setup.mjs +0 -0
  123. /package/scripts/{vitest-config → langages/typescript/vitest-config}/mesure.d.ts +0 -0
  124. /package/scripts/{vitest-config → langages/typescript/vitest-config}/mesure.mjs +0 -0
package/scripts/nuit.sh CHANGED
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env bash
2
2
  # The night: once a day, the full pass played for real, then what the day never plays: the night
3
- # tests and the time budget benches. During the day `npm run verifier` (the integration's) replays
4
- # from Turborepo's cache every task whose inputs are unchanged, and plays the tests Vitest relates
5
- # to the files changed since the last green (scripts/integration/integrer.mjs,
6
- # scripts/dernier-vert.mjs).
3
+ # tests and the time budget benches. During the day `npm run verifier` (the integration's) plays
4
+ # what the changes since the last green touch (scripts/integration/integrer.mjs,
5
+ # scripts/dernier-vert.mjs); the module of the project's language plays each step
6
+ # (scripts/jointure.d.ts).
7
7
  #
8
8
  # npx grillhouse nuit from the root of the project, by the crontab of the machine, as the
9
9
  # session start proposes it, with the directory of its Node, e.g.
@@ -17,15 +17,14 @@
17
17
  # modification overwritten; one that cannot be set turns the night red; a submodule the project
18
18
  # shares, `grillhouse.partage`, is linked to the main repository's instead, not set),
19
19
  # dependencies reinstalled (npm ci) when package-lock.json changes, then
20
- # `npm run verifier -- --force`: Turborepo's build, guards (the frame's and the project's own,
21
- # its root script `gardes`) and every test of the day, each task
22
- # played for real (`--force`, no log replayed from the cache, no measure against the last
23
- # green: the complete pass, scripts/verifier.mjs), its result written to the cache again; green,
24
- # its tree becomes the last green of the day's passes.
20
+ # `npm run verifier -- --force`: the build, the guards (the frame's and the project's own, its
21
+ # root script `gardes`) and every test of the day, each task played for real (`--force`, no log
22
+ # replayed from a cache, no measure against the last green: the complete pass); green, its tree
23
+ # becomes the last green of the day's passes.
25
24
  # Its three steps (the full pass, the night tests, the project's night script) each play even
26
25
  # when one before is red, as a CI plays its independent jobs; the night is red when one of them
27
- # is. A full pass « à repasser » (75, scripts/verifier.mjs: a failure of duration under load,
28
- # which found no rest in its bound) ends the night there, « à repasser », below.
26
+ # is. A full pass « à repasser » (75: a failure of duration under load, which found no rest in
27
+ # its bound) ends the night there, « à repasser », below.
29
28
  # An existing copy that does not get ready (its move onto HEAD, its cleaning or the setting of
30
29
  # its submodules fails) is removed by `scripts/retirer-copie.sh --jetable` (local work does not
31
30
  # hold it, a lock does) and created again, once; a copy that does not get ready the second time
@@ -35,16 +34,14 @@
35
34
  # read-only, its working tree and its git repository (the list the preparation's pose printed,
36
35
  # whatever a command rewrites afterwards): a write into it fails. With a shared submodule and no possible mount (bwrap absent
37
36
  # or refused), the night turns red, the log saying so, before any command runs.
38
- # - The night tests: after the full pass, the files `*.nuit.test.*`, `*.nuit.spec.*`,
39
- # `*.budget.test.*` and `*.budget.spec.*` of the copy (outside node_modules, dist and .git): the
40
- # night tests and the time budget benches, which `npm test` and the integration leave out
41
- # (the package @roomi-fields/grillhouse/vitest-config, scripts/vitest-config/, which every day configuration
42
- # extends), run by Vitest with the frame's configuration (scripts/vitest.nuit.config.mjs, beside
43
- # this script), bench or night test alone as well. A red turns the night red, with a log line that says so, and the
44
- # project's night script still plays. A copy with neither plays none. A run « à repasser » (75:
45
- # every failure depended on a duration, one under load, scripts/vitest-config/duree.reporter.mjs)
46
- # waits for rest (`npx grillhouse pression attendre`, bound 15 min) and plays
47
- # once more; green then, the night goes on; à repasser again, or no rest in the bound, the night
37
+ # - The night tests: after the full pass, the night tests and the time budget benches, which
38
+ # `npm test` and the integration leave out, played by the command `tests-de-nuit` of the module
39
+ # of the copy's language (the module typescript's: the files `*.nuit.test.*`, `*.nuit.spec.*`,
40
+ # `*.budget.test.*` and `*.budget.spec.*`, by Vitest), when the project declares a language
41
+ # whose module describes it (scripts/commande-du-langage.mjs); none otherwise. A red turns the night red, with a log line that
42
+ # says so, and the project's night script still plays. A run « à repasser » (75: every failure
43
+ # depended on a duration, one under load) waits for rest (`npx grillhouse pression attendre`,
44
+ # bound 15 min) and plays once more; green then, the night goes on; à repasser again, or no rest in the bound, the night
48
45
  # ends there, « à repasser », red if the full pass is.
49
46
  # - « À repasser » (exit 75): neither green nor red. The last green stays, no ticket opens, nothing
50
47
  # is pushed, the log says so; the next night plays again.
@@ -71,17 +68,19 @@
71
68
  # - Its log is <git common dir>/nuit/<date>.log. Green: HEAD becomes the last green commit
72
69
  # (<git common dir>/nuit/dernier-vert). Red: the red tasks, each grouped by its cause as an
73
70
  # alerting system groups by fingerprint: each red task of the full pass (the file
74
- # GRILLHOUSE_ROUGES names, which scripts/verifier.mjs writes: `<package>#<task>` per line, no
75
- # task à repasser among them), else the full pass by its command, the night tests, the project's
71
+ # GRILLHOUSE_ROUGES names, which the verification of the module writes: `<task>` per line, then
72
+ # a tab and the command that replays it alone when the language has one, no task à repasser
73
+ # among them), else the full pass by its command, the night tests, the project's
76
74
  # night script by its command, or the preparation when the night is red before any step. Each
77
75
  # red task comments the open ticket labelled `nuit` whose title names it (« <task> »), once per
78
76
  # ticket, or opens its own, « La nuit est rouge sur « <task> » depuis la nuit du <date> ». The
79
77
  # text, the same for each, gives the commits since the last green, where `git bisect` looks for
80
78
  # the culprit, each red step and each red task, with or without a last green, then the end of
81
- # the log. With a last green, each red task of the full pass gets the command that looks for the
82
- # culprit with that task alone:
83
- # `git bisect start <head> <last green> && git bisect run npx turbo run <task> --filter=<package>`
84
- # (`--filter=//` for the root), Turborepo's hash replaying at each step only what changed.
79
+ # the log. With a last green, each red task of the full pass that comes with its command gets the
80
+ # command that looks for the culprit with that task alone:
81
+ # `git bisect start <head> <last green> && git bisect run <its command>` (the module typescript's:
82
+ # `npx turbo run <task> --filter=<package>`, `--filter=//` for the root, Turborepo's hash
83
+ # replaying at each step only what changed).
85
84
  set -u
86
85
  usage() {
87
86
  echo "Usage : grillhouse nuit"
@@ -111,18 +110,19 @@ commun="$(git -C "$racine" rev-parse --path-format=absolute --git-common-dir)"
111
110
  dossier="$commun/nuit"
112
111
  mkdir -p "$dossier"
113
112
  journal="$dossier/$(date +%Y-%m-%d).log"
114
- # The red tasks of the full pass, written by scripts/verifier.mjs.
113
+ # The red tasks of the full pass, written by the verification of the module of the language.
115
114
  rouges="$dossier/rouges"
116
115
  rm -f "$rouges"
117
116
 
118
117
  tete="$(git -C "$racine" rev-parse HEAD)"
119
118
  copie="$racine/.claude/worktrees/nuit"
120
119
  branche=
121
- # The red steps of the night, and its red tasks: those of the full pass (turbo 1, which a bisect
122
- # replays alone), then a step red without a task of its own, named by its command (turbo 0).
120
+ # The red steps of the night, and its red tasks: those of the full pass, each with the command
121
+ # that replays it alone when the language has one (in `rejeux`, which a bisect runs), then a step
122
+ # red without a task of its own, named by its command (no command).
123
123
  etapes=()
124
124
  taches=()
125
- turbo=()
125
+ rejeux=()
126
126
  # Gets the copy ready on HEAD: detached, cleaned, its submodules set; `partages` holds the list the
127
127
  # pose fixes, which every mount gets. Prints the reason on failure.
128
128
  partages=
@@ -215,50 +215,46 @@ jouer() {
215
215
  etapes+=("la passe complète (npm run verifier -- --force)")
216
216
  avant=${#taches[@]}
217
217
  if [ -s "$rouges" ]; then
218
- while IFS= read -r tache; do
219
- [ -n "$tache" ] || continue
220
- taches+=("$tache")
221
- turbo+=(1)
218
+ while IFS= read -r ligne; do
219
+ [ -n "$ligne" ] || continue
220
+ taches+=("${ligne%%$'\t'*}")
221
+ if [[ "$ligne" == *$'\t'* ]]; then rejeux+=("${ligne#*$'\t'}"); else rejeux+=(""); fi
222
222
  done < "$rouges"
223
223
  fi
224
224
  if [ "${#taches[@]}" -eq "$avant" ]; then
225
225
  taches+=("npm run verifier -- --force")
226
- turbo+=(0)
226
+ rejeux+=("")
227
227
  fi
228
228
  fi
229
- if [ -n "$(find "$copie" \( -name node_modules -o -name dist -o -name .git \) -prune -o \
230
- -type f -regextype posix-extended -regex '.*\.(nuit|budget)\.(test|spec)\.(c|m)?[jt]sx?' -print -quit)" ]; then
231
- bancs() { (cd "$copie" && monter npx --no-install vitest run --root "$copie" \
232
- --config "$ici/vitest.nuit.config.mjs"); }
229
+ bancs() { (cd "$copie" && monter node "$ici/commande-du-langage.mjs" tests-de-nuit); }
230
+ bancs
231
+ code=$?
232
+ if [ "$code" -eq 75 ]; then
233
+ echo "⏱ les bancs de temps ou les tests de nuit sont à repasser (code 75) : attente du repos, puis une relance."
234
+ if ! node "$ici/mesure/pression.mjs" attendre; then
235
+ echo "⏱ à repasser : pas de repos dans la borne."
236
+ fin 75
237
+ return
238
+ fi
233
239
  bancs
234
240
  code=$?
235
241
  if [ "$code" -eq 75 ]; then
236
- echo "⏱ les bancs de temps ou les tests de nuit sont à repasser (code 75) : attente du repos, puis une relance."
237
- if ! node "$ici/vitest-config/pression.mjs" attendre; then
238
- echo "⏱ à repasser : pas de repos dans la borne."
239
- fin 75
240
- return
241
- fi
242
- bancs
243
- code=$?
244
- if [ "$code" -eq 75 ]; then
245
- echo "⏱ à repasser : les bancs échouent encore sous charge après la relance."
246
- fin 75
247
- return
248
- fi
249
- fi
250
- if [ "$code" -ne 0 ]; then
251
- echo "✗ les bancs de temps ou les tests de nuit (*.budget.*, *.nuit.*) ont échoué."
252
- etapes+=("les bancs de temps et les tests de nuit (*.budget.*, *.nuit.*)")
253
- taches+=("les bancs de temps et les tests de nuit")
254
- turbo+=(0)
242
+ echo "⏱ à repasser : les bancs échouent encore sous charge après la relance."
243
+ fin 75
244
+ return
255
245
  fi
256
246
  fi
247
+ if [ "$code" -ne 0 ]; then
248
+ echo "✗ les bancs de temps ou les tests de nuit (*.budget.*, *.nuit.*) ont échoué."
249
+ etapes+=("les bancs de temps et les tests de nuit (*.budget.*, *.nuit.*)")
250
+ taches+=("les bancs de temps et les tests de nuit")
251
+ rejeux+=("")
252
+ fi
257
253
  if [ -n "$nuit" ] && ! monter npm --prefix "$copie" run "$nuit"; then
258
254
  echo "✗ le script de nuit du projet \`npm run $nuit\` (grillhouse.nuit) a échoué."
259
255
  etapes+=("le script de nuit du projet (npm run $nuit, grillhouse.nuit)")
260
256
  taches+=("npm run $nuit")
261
- turbo+=(0)
257
+ rejeux+=("")
262
258
  fi
263
259
  fin 0
264
260
  }
@@ -328,7 +324,7 @@ intervalle="${vert:+${vert:0:7}..}${tete:0:7}"
328
324
  if [ "${#etapes[@]}" -eq 0 ]; then
329
325
  etapes=("la préparation (la copie, ses sous-modules, les clés grillhouse, l'installation)")
330
326
  taches=("la préparation")
331
- turbo=(0)
327
+ rejeux=("")
332
328
  fi
333
329
  liste="Étapes rouges :"
334
330
  for e in "${etapes[@]}"; do
@@ -341,8 +337,8 @@ Tâches rouges"
341
337
  liste="$liste :"
342
338
  for i in "${!taches[@]}"; do
343
339
  tache="${taches[$i]}"
344
- if [ -n "$vert" ] && [ "${turbo[$i]}" -eq 1 ]; then
345
- tache="$tache : git bisect start ${tete:0:7} ${vert:0:7} && git bisect run npx turbo run ${tache#*#} --filter=${tache%%#*}"
340
+ if [ -n "$vert" ] && [ -n "${rejeux[$i]}" ]; then
341
+ tache="$tache : git bisect start ${tete:0:7} ${vert:0:7} && git bisect run ${rejeux[$i]}"
346
342
  fi
347
343
  liste="$liste
348
344
  - $tache"
@@ -1,5 +1,10 @@
1
1
  // The types of ./paquets.mjs as the entry `@roomi-fields/grillhouse/paquets` publishes it, for a
2
2
  // project's guard that leaves out the packages out of the frame.
3
3
 
4
+ /** The code of `src/` (the root's, or a package's under `packages/`), as a pattern of a path from
5
+ * the root: what a project publishes, out of its tests. */
6
+ export const CODE: string;
7
+ /** The script of a package that types it, which the verification plays in each package. */
8
+ export const TYPAGE: string;
4
9
  /** The names listed in `racine`'s `docs/agents/hors-cadre.txt`: empty without the file. */
5
10
  export function horsCadre(racine: string): Set<string>;
@@ -1,6 +1,6 @@
1
1
  // The packages of a repository: the frame's one list of them, each marked out of the frame or not.
2
2
  // The update of the frame (scripts/grillhouse-maj.mjs), the generator of the packages' turbo.json
3
- // (scripts/turbo-des-paquets.mjs) and the targeted test runs (scripts/tests.mjs) read it.
3
+ // (scripts/langages/typescript/turbo-des-paquets.mjs) and the targeted test runs (scripts/langages/typescript/tests.mjs) read it.
4
4
  //
5
5
  // The packages are the directories holding a `package.json` that the `workspaces` of the root
6
6
  // `package.json` select (an array, or its `packages` key), mapped as npm maps them
@@ -15,9 +15,15 @@
15
15
  //
16
16
  // A project's guard imports `horsCadre` by the package's entry `@roomi-fields/grillhouse/paquets`,
17
17
  // its types in ./paquets.d.ts (docs/ARCHITECTURE.md, the package's named entries).
18
- import { existsSync, globSync, readFileSync } from 'node:fs';
18
+ import { existsSync, globSync, readdirSync, readFileSync } from 'node:fs';
19
19
  import path from 'node:path';
20
20
 
21
+ /** The code of `src/` (the root's, or a package's under `packages/`), as a pattern of a path from
22
+ * the root: what a project publishes, out of its tests. */
23
+ export const CODE = '^src/|^packages/[^/]+/src/';
24
+ /** The script of a package that types it, which the verification plays in each package. */
25
+ export const TYPAGE = 'typecheck';
26
+
21
27
  // The list of the packages out of the frame: one line per package, « <package> <reason> », its
22
28
  // first word the name of a directory under `packages/` or `src/`; a blank line or a line starting
23
29
  // with `#` names nothing.
@@ -35,6 +41,22 @@ export function horsCadre(racine) {
35
41
  return noms;
36
42
  }
37
43
 
44
+ // The names of <racine>'s `docs/agents/hors-cadre.txt` that no directory under `packages/` or
45
+ // `src/` bears, in the order of the list: a line the session start names (a typo names nothing).
46
+ export function horsCadreInconnus(racine) {
47
+ const presents = new Set(
48
+ ['packages', 'src'].flatMap(parent => {
49
+ const base = path.join(racine, parent);
50
+ return existsSync(base)
51
+ ? readdirSync(base, { withFileTypes: true })
52
+ .filter(e => e.isDirectory())
53
+ .map(e => e.name)
54
+ : [];
55
+ })
56
+ );
57
+ return [...horsCadre(racine)].filter(nom => !presents.has(nom));
58
+ }
59
+
38
60
  const lireJson = f => {
39
61
  try {
40
62
  return JSON.parse(readFileSync(f, 'utf8'));
@@ -1,4 +1,3 @@
1
- #!/usr/bin/env node
2
1
  // The formats of the results the circuit decides on, in one module, which the circuit
3
2
  // (scripts/circuit.mjs), the guards and the tests read; as Bazel's Build Event Protocol and the
4
3
  // JUnit reports carry the outcome of a build, no reader reads an output meant for the human.
@@ -41,7 +40,7 @@
41
40
  // it; a RENDU carries a blocking finding, an ACCEPTÉ none (reviewer);
42
41
  // - `conformite` (`element`, `conforme` oui or non, `document` CADRE, INTERFACE or
43
42
  // ARCHITECTURE, `reference`, `piece`; a « non » with `role` its recipient):
44
- // one line per element of the lot (scripts/elements-du-lot.mjs), its rule cited from a
43
+ // one line per element of the lot (scripts/langages/typescript/elements-du-lot.mjs), its rule cited from a
45
44
  // document of its package, a new export's the entry of the INTERFACE that names it; a line
46
45
  // without its reference is refused; a « non » is a blocking finding (`bloquantsDeLaFiche`),
47
46
  // and the circuit refuses a sheet without a line for each element, or with a line on an
@@ -106,33 +105,17 @@
106
105
  // (scripts/gardes-du-cadre.mjs) writes for a red guard that wrote none a finding without
107
106
  // location, and a project's guards (its script `gardes`) import `ecrireSarif` by the package's
108
107
  // entry `@roomi-fields/grillhouse/resultats`, whose types (./resultats.d.ts) declare it alone.
109
- // - The summary of a run of Turborepo (`turbo run … --summarize`, `.turbo/runs/<id>.json`):
110
- // `garderLesResumes` moves the summaries a run wrote into `<dossier>/turbo/`, and `lireResumes`
111
- // gives each task, its package and directory, its script, its exit code, its cache status and
112
- // its log file (from the root).
113
- // - The JSON report of Vitest, which the frame's base configuration writes under
114
- // `<dossier>/vitest/` while the variable is set (scripts/vitest-config/resultats.mjs):
115
- // `lireRapportsVitest` gives each test file, its status, the message of a file that does not
116
- // load, and each test, its title, its full name, its status and its first message.
117
- import {
118
- copyFileSync,
119
- existsSync,
120
- mkdirSync,
121
- readdirSync,
122
- readFileSync,
123
- rmdirSync,
124
- rmSync,
125
- statSync,
126
- writeFileSync,
127
- } from 'node:fs';
108
+ // - The verdict of a run of tests, the summaries and reports its tools write in the results
109
+ // directory, is the module of the project's language's to read (`verdict`, scripts/jointure.d.ts,
110
+ // scripts/langages.mjs).
111
+ import { existsSync, mkdirSync, readdirSync, readFileSync, statSync, writeFileSync } from 'node:fs';
128
112
  import path from 'node:path';
129
113
  import { pathToFileURL } from 'node:url';
130
114
  import { paquets } from './paquets.mjs';
131
- import { RESULTATS, VITEST } from './vitest-config/resultats.mjs';
132
115
 
133
- export { RESULTATS };
116
+ // The variable that names the results directory of a run.
117
+ export const RESULTATS = 'GRILLHOUSE_RESULTATS';
134
118
  const SARIF = 'sarif';
135
- const TURBO = 'turbo';
136
119
  // The kind of a note of a guard, no red: a key of the known debt inscribed above what the guard
137
120
  // finds, which the circuit lowers (scripts/dette.mjs, scripts/circuit.mjs).
138
121
  export const A_ELAGUER = 'a-elaguer';
@@ -485,7 +468,7 @@ export const bloquantsDeLaFiche = fiche => [
485
468
  ];
486
469
 
487
470
  // What makes the reviewer's sheet <fiche> out of conformity with the list of its lot
488
- // (scripts/elements-du-lot.mjs: <elements>, each `{ id, nom, statut, exporte }`, and <fichiers>,
471
+ // (scripts/langages/typescript/elements-du-lot.mjs: <elements>, each `{ id, nom, statut, exporte }`, and <fichiers>,
489
472
  // every file the lot changes), as a review asks a word on every changed element: an element
490
473
  // without its line, a line on an element out of the list, a new export whose rule does not name
491
474
  // its entry in the INTERFACE of its package. A line on a changed file, a source or not, names it
@@ -892,63 +875,6 @@ export function lireSarif(dossier) {
892
875
  return { gardes: [...gardes].sort(), constats };
893
876
  }
894
877
 
895
- // Moves the summaries of Turborepo that a run in <racine> wrote (`.turbo/runs/*.json` absent from
896
- // <avant>, the names there before it) into the results directory <env> names; removes them
897
- // without it. `.turbo/runs` goes too when the run created it (<avant> empty) and it is left empty.
898
- export function garderLesResumes(racine, avant, env = process.env) {
899
- const runs = path.join(racine, '.turbo', 'runs');
900
- const neufs = (existsSync(runs) ? readdirSync(runs) : []).filter(
901
- f => !avant.has(f) && f.endsWith('.json')
902
- );
903
- const dossier = env[RESULTATS];
904
- for (const f of neufs) {
905
- if (dossier) {
906
- mkdirSync(path.join(dossier, TURBO), { recursive: true });
907
- // The results directory may lie on another file system: a copy, then the removal.
908
- copyFileSync(path.join(runs, f), path.join(dossier, TURBO, f));
909
- rmSync(path.join(runs, f), { force: true });
910
- } else rmSync(path.join(runs, f), { force: true });
911
- }
912
- if (neufs.length && !avant.size && existsSync(runs) && readdirSync(runs).length === 0) {
913
- rmdirSync(runs);
914
- }
915
- }
916
-
917
- // The tasks of the summaries of Turborepo under the results directory <dossier>, in their order:
918
- // `{ tache, paquet, dossier, script, code, cache, journal }`, `dossier` « . » for the root,
919
- // `code` null for a task that did not run.
920
- export function lireResumes(dossier) {
921
- return fichiers(path.join(dossier, TURBO), '.json').flatMap(f =>
922
- (lireJson(f)?.tasks ?? []).map(t => ({
923
- tache: t.taskId,
924
- paquet: t.package,
925
- dossier: t.directory || '.',
926
- script: t.task,
927
- code: t.execution?.exitCode ?? null,
928
- cache: t.cache?.status ?? null,
929
- journal: t.logFile ?? null,
930
- }))
931
- );
932
- }
933
-
934
- // The test files of the reports of Vitest under the results directory <dossier>: `{ fichier,
935
- // etat, message, tests }`, `fichier` its absolute path, each test `{ titre, nom, etat, message }`.
936
- export function lireRapportsVitest(dossier) {
937
- return fichiers(path.join(dossier, VITEST), '.json').flatMap(f =>
938
- (lireJson(f)?.testResults ?? []).map(r => ({
939
- fichier: r.name,
940
- etat: r.status,
941
- message: String(r.message ?? ''),
942
- tests: (r.assertionResults ?? []).map(a => ({
943
- titre: a.title,
944
- nom: a.fullName || a.title,
945
- etat: a.status,
946
- message: String(a.failureMessages?.[0] ?? ''),
947
- })),
948
- }))
949
- );
950
- }
951
-
952
878
  if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) {
953
879
  const [option, role] = process.argv.slice(2);
954
880
  const schema = option === '--schema' ? schemaDeFiche(role) : null;
@@ -0,0 +1,30 @@
1
+ // The entry `@roomi-fields/grillhouse/jointure`: the join of the languages (./langages.mjs), and
2
+ // the services of the core to a module of language, whose types are ./jointure.d.ts.
3
+ //
4
+ // - A module of language imports of the core its published entries alone (./jointure, ./paquets,
5
+ // ./dette, ./resultats, ./conformite), as a plugin of Nx imports `@nx/devkit` alone; the guard
6
+ // of the boundaries refuses any other import (.dependency-cruiser.projet.cjs of the frame's
7
+ // repository).
8
+ // - The core imports ./langages.mjs, never this entry: the command (bin/grillhouse.mjs) loads it
9
+ // at each call, and a script of the core it loads before running one would not run again.
10
+ export * from './langages.mjs';
11
+
12
+ // The services of the core to a module of language: the plan of an envelope, the progress of a
13
+ // pass and its measure, the base of a pass, the pressure of the machine and its lock, the last
14
+ // green, the arbitrages of a ticket, the source files of a project.
15
+ export { arbitrageTranche, estArbitrage } from './arbitrages.mjs';
16
+ export { ecrireLaMesure, garderLeTotal, inscrireLePlan, ouvrirAvancement } from './avancement.mjs';
17
+ export { sources } from './sources.mjs';
18
+ export { CHANGEMENTS, DEPUIS_LE_VERT, garderLeVert, mesure } from './dernier-vert.mjs';
19
+ export { lireLaListe, paquetsDeLEnveloppe } from './enveloppe/paquets-du-plan.mjs';
20
+ export { AVANCEMENT, ecrireTache } from './mesure/avancement.mjs';
21
+ export { ligneDesRestes, ouvrirBase, retirerALInterruption } from './mesure/base-de-passe.mjs';
22
+ export {
23
+ A_REPASSER,
24
+ attendreLeRepos,
25
+ BORNE_ATTENTE_MS,
26
+ ecrirePression,
27
+ lirePression,
28
+ SEUIL_PRESSION,
29
+ } from './mesure/pression.mjs';
30
+ export { AttenteDeLaMachine, avecLaMachine } from './verrou-de-machine.mjs';
@@ -11,6 +11,9 @@
11
11
  # written; the session start goes on. Without the key (or with null), nothing runs; a value that is
12
12
  # not a non-blank string runs nothing and adds a line that says so. An agent's copy does not play it.
13
13
  #
14
+ # The project's language: a package.json without `grillhouse.langages` (scripts/langages.mjs)
15
+ # joins « Manque » as « la déclaration du langage », with `npx grillhouse maj`, which writes it.
16
+ #
14
17
  # The frame's plugins: scripts/greffons.mjs --absents reads `.claude/settings.json` and
15
18
  # `claude plugin list --json` (each call stopped after 5 s). Each declared plugin not installed for
16
19
  # the project joins « Manque » as « le greffon <id> », the missing claude command as « la commande
@@ -66,6 +69,11 @@ if [ -z "$copie_agent" ]; then
66
69
  [ -d "$root/.codegraph" ] || missing+=("l'index CodeGraph du code (\`codegraph init .\`)")
67
70
  fi
68
71
  [ ! -f "$root/package.json" ] || [ -d "$root/node_modules" ] || missing+=("les dépendances npm (\`npm install\`)")
72
+ # The project's language (scripts/langages.mjs): a package.json without `grillhouse.langages` is
73
+ # refused by the frame's scripts and locks until the update writes it.
74
+ if [ -f "$root/package.json" ] && ! node -e 'const l=JSON.parse(require("fs").readFileSync(process.argv[1],"utf8"))?.grillhouse?.langages;process.exit(Array.isArray(l)&&l.length>0?0:1)' "$root/package.json" 2>/dev/null; then
75
+ missing+=("la déclaration du langage (grillhouse.langages du package.json : \`npx grillhouse maj\` l'écrit)")
76
+ fi
69
77
  # The frame's plugins not installed for the project (scripts/greffons.mjs): the plugins are the
70
78
  # machine's installation for the project, so an agent's copy does not read them.
71
79
  if [ -z "$copie_agent" ]; then
@@ -101,15 +109,14 @@ else
101
109
  || pending+=("les critères d'arbitrage (section « Comment on arbitre » de CLAUDE.md : la référence mature du domaine, l'existant à reprendre, les exigences du domaine)")
102
110
  fi
103
111
  # The packages out of the frame: docs/agents/hors-cadre.txt ("<package> <reason>", e.g. a frozen
104
- # version), read by scripts/paquets.mjs as every check reads it; Turborepo plays none of
105
- # its tasks (scripts/turbo-des-paquets.mjs). Line 1: the names listed;
106
- # line 2: the names that no directory under packages/ or src/ bears.
112
+ # version), read by scripts/paquets.mjs as every check reads it; the verification plays none of
113
+ # their tasks. Line 1: the names listed; line 2: the names that no directory under packages/ or
114
+ # src/ bears.
107
115
  { read -r hors; read -r inconnus; } < <(node --input-type=module -e '
108
116
  const { pathToFileURL } = await import("node:url");
109
- const { horsCadre } = await import(pathToFileURL(process.argv[1]).href);
110
- const { horsCadreInconnus } = await import(pathToFileURL(process.argv[2]).href);
111
- process.stdout.write(`${[...horsCadre(process.argv[3])].join(" ")}\n${horsCadreInconnus(process.argv[3]).join(" ")}\n`);
112
- ' "$ici/paquets.mjs" "$ici/consommateurs.mjs" "$root" 2>/dev/null)
117
+ const { horsCadre, horsCadreInconnus } = await import(pathToFileURL(process.argv[1]).href);
118
+ process.stdout.write(`${[...horsCadre(process.argv[2])].join(" ")}\n${horsCadreInconnus(process.argv[2]).join(" ")}\n`);
119
+ ' "$ici/paquets.mjs" "$root" 2>/dev/null)
113
120
  # One package: docs/ at the root. Several: each package under packages/ has its own three documents,
114
121
  # unless it is out of the frame.
115
122
  if ls -d "$root"/packages/*/ >/dev/null 2>&1; then
@@ -157,7 +164,8 @@ if [ -n "$demarrage" ]; then
157
164
  fi
158
165
 
159
166
  # The agents run the tests by `npm test`; the integration, the queue and the night run the guards
160
- # and the tests by `npm run verifier` (Turborepo): two npm scripts to wire.
167
+ # and the tests by `npm run verifier`, each the command of the project's language: two npm scripts
168
+ # to wire.
161
169
  wiring=()
162
170
  if [ -f "$root/package.json" ]; then
163
171
  for s in test verifier; do
@@ -210,7 +218,7 @@ if [ ${#pending[@]} -gt 0 ]; then
210
218
  echo "Dès ta première réponse, propose au responsable de les griller, chacun avec ce que tu recommandes pour ce projet (compétence \`grill\`). Il peut accepter, en choisir un, ou reporter ; tant qu'un élément reste vide, cette proposition revient à chaque séance."
211
219
  fi
212
220
  if [ ${#wiring[@]} -gt 0 ]; then
213
- echo "À brancher : $(IFS=' '; echo "${wiring[*]}") dans le package.json de la racine. L'intégration (\`npx grillhouse integrer\`, contrat en tête de son script) et la nuit lancent \`npm run verifier\` (Turborepo, \`turbo.json\` : construction, puis gardes et tests), les agents \`npm test\` ; sans eux, l'intégration refuse chaque lot. Un projet testé par Vitest les reçoit de \`npm run grillhouse:maj\`, qui finit par \`npm run verifier\`, une passe longue : lance-la en tâche de fond et relis son code à la fin ; sinon, écris-les pour ses tests."
221
+ echo "À brancher : $(IFS=' '; echo "${wiring[*]}") dans le package.json de la racine. L'intégration (\`npx grillhouse integrer\`, contrat en tête de son script) et la nuit lancent \`npm run verifier\` (les gardes et les tests, par l'outil du langage du projet), les agents \`npm test\` ; sans eux, l'intégration refuse chaque lot. \`npm run grillhouse:maj\` les écrit quand le langage du projet sait jouer ses tests, et finit par \`npm run verifier\`, une passe longue : lance-la en tâche de fond et relis son code à la fin ; sinon, écris-les pour ses tests."
214
222
  fi
215
223
  if [ -n "$nuit_absente" ]; then
216
224
  echo "La nuit ne tourne plus : la table des tâches du poste $nuit_absente. Propose au responsable de remplacer cette ligne (\`crontab -e\`) par : \`$nuit\`."
@@ -1,30 +1,52 @@
1
1
  // The source files of a project, as the migrations read them (scripts/migrations/): each `.ts`,
2
- // `.mts`, `.cts`, `.js`, `.mjs`, `.cjs` under its root, as a path from it, the directories of
3
- // tools and of what is installed or built (node_modules, .git, dist, coverage, .turbo, .claude,
4
- // .beads, .codegraph, .rtfm) left out; and whether a source text imports a package (`importe`).
2
+ // `.mts`, `.cts`, `.js`, `.mjs`, `.cjs` under its root, as a path from it; and whether a source
3
+ // text imports a package (`importe`).
4
+ //
5
+ // - Left out: the directories of the frame's tools and of what npm installs (node_modules, .git,
6
+ // dist, coverage, .claude, .beads, .codegraph, .rtfm), and what the tools of the project's
7
+ // language write (`ignorer` of its module, scripts/jointure.d.ts: typescript's `.turbo`, cargo's
8
+ // `target`), as git leaves out what a `.gitignore` names. A project that declares no language
9
+ // (`grillhouse.langages`) leaves out what every language of the frame writes.
5
10
  import { readdirSync } from 'node:fs';
6
11
  import path from 'node:path';
12
+ import { LANGAGES, langage, langageDe, langagesDeclares } from './langages.mjs';
7
13
 
8
14
  const EXTENSIONS = /\.(?:[mc]?ts|[mc]?js)$/;
9
- const HORS = new Set([
15
+ const HORS = [
10
16
  'node_modules',
11
17
  '.git',
12
18
  'dist',
13
19
  'coverage',
14
- '.turbo',
15
20
  '.claude',
16
21
  '.beads',
17
22
  '.codegraph',
18
23
  '.rtfm',
19
- ]);
24
+ ];
20
25
 
21
- /** The source files of the project at <racine>, as paths from it. */
22
- export function sources(racine, rel = '') {
23
- return readdirSync(path.join(racine, rel), { withFileTypes: true }).flatMap(e => {
24
- const r = rel === '' ? e.name : `${rel}/${e.name}`;
25
- if (e.isDirectory()) return HORS.has(e.name) ? [] : sources(racine, r);
26
- return e.isFile() && EXTENSIONS.test(e.name) ? [r] : [];
27
- });
26
+ // The directories left out in the project at <racine>: the frame's, and what its language's tools
27
+ // write (every language's, for a project that declares none).
28
+ function hors(racine) {
29
+ const declares = langagesDeclares(racine);
30
+ const ecrits =
31
+ declares.length > 0
32
+ ? langageDe(racine).ignorer
33
+ : Object.keys(LANGAGES).flatMap(nom => langage(nom).ignorer);
34
+ return new Set([...HORS, ...ecrits]);
35
+ }
36
+
37
+ /** The source files of the project at <racine>, under <dossier> (from it; the root by default),
38
+ * as paths from <racine>. */
39
+ export function sources(racine, dossier = '') {
40
+ const exclus = hors(racine);
41
+ const parcourir = rel =>
42
+ readdirSync(path.join(racine, rel), { withFileTypes: true }).flatMap(e => {
43
+ const r = rel === '' ? e.name : `${rel}/${e.name}`;
44
+ if (e.isDirectory()) {
45
+ return exclus.has(e.name) ? [] : parcourir(r);
46
+ }
47
+ return e.isFile() && EXTENSIONS.test(e.name) ? [r] : [];
48
+ });
49
+ return parcourir(dossier);
28
50
  }
29
51
 
30
52
  const echapper = t => t.replace(/[.*+?^${}()|[\]\\/]/g, '\\$&');