@roomi-fields/grillhouse 0.29.0 → 0.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (263) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/CHANGELOG.md +769 -0
  3. package/agents/developpeur.md +0 -1
  4. package/agents/explorateur.md +0 -1
  5. package/agents/questionneur.md +0 -1
  6. package/agents/testwriter.md +0 -1
  7. package/bin/grillhouse.mjs +79 -18
  8. package/cadre/templates/projet/.github/workflows/ci.yml +2 -13
  9. package/cadre/templates/projet/CLAUDE.md +5 -1
  10. package/cadre/templates/projet/docs/agents/issue-tracker.md +1 -1
  11. package/cadre/templates/projet/package.json +2 -2
  12. package/charte.md +24 -0
  13. package/dist/temporal/acte.d.ts +24 -0
  14. package/dist/temporal/acte.js +139 -0
  15. package/dist/temporal/acte.js.map +1 -0
  16. package/dist/temporal/attributs.d.ts +6 -0
  17. package/dist/temporal/attributs.js +15 -0
  18. package/dist/temporal/attributs.js.map +1 -0
  19. package/dist/temporal/circuit/activites.d.ts +13 -0
  20. package/dist/temporal/circuit/activites.js +33 -0
  21. package/dist/temporal/circuit/activites.js.map +1 -0
  22. package/dist/temporal/circuit/client.d.ts +72 -0
  23. package/dist/temporal/circuit/client.js +247 -0
  24. package/dist/temporal/circuit/client.js.map +1 -0
  25. package/dist/temporal/circuit/commande.d.ts +2 -0
  26. package/dist/temporal/circuit/commande.js +238 -0
  27. package/dist/temporal/circuit/commande.js.map +1 -0
  28. package/dist/temporal/circuit/contrat.d.ts +305 -0
  29. package/dist/temporal/circuit/contrat.js +30 -0
  30. package/dist/temporal/circuit/contrat.js.map +1 -0
  31. package/dist/temporal/circuit/deroule.d.ts +3 -0
  32. package/dist/temporal/circuit/deroule.js +540 -0
  33. package/dist/temporal/circuit/deroule.js.map +1 -0
  34. package/dist/temporal/client.d.ts +47 -0
  35. package/dist/temporal/client.js +69 -0
  36. package/dist/temporal/client.js.map +1 -0
  37. package/dist/temporal/commande.d.ts +2 -0
  38. package/dist/temporal/commande.js +94 -0
  39. package/dist/temporal/commande.js.map +1 -0
  40. package/dist/temporal/deroules.d.ts +5 -0
  41. package/dist/temporal/deroules.js +10 -0
  42. package/dist/temporal/deroules.js.map +1 -0
  43. package/dist/temporal/etat.d.ts +33 -0
  44. package/dist/temporal/etat.js +59 -0
  45. package/dist/temporal/etat.js.map +1 -0
  46. package/dist/temporal/file/activites.d.ts +10 -0
  47. package/dist/temporal/file/activites.js +25 -0
  48. package/dist/temporal/file/activites.js.map +1 -0
  49. package/dist/temporal/file/client.d.ts +4 -0
  50. package/dist/temporal/file/client.js +6 -0
  51. package/dist/temporal/file/client.js.map +1 -0
  52. package/dist/temporal/file/contrat.d.ts +158 -0
  53. package/dist/temporal/file/contrat.js +14 -0
  54. package/dist/temporal/file/contrat.js.map +1 -0
  55. package/dist/temporal/file/deroule.d.ts +15 -0
  56. package/dist/temporal/file/deroule.js +235 -0
  57. package/dist/temporal/file/deroule.js.map +1 -0
  58. package/dist/temporal/installation.d.ts +120 -0
  59. package/dist/temporal/installation.js +386 -0
  60. package/dist/temporal/installation.js.map +1 -0
  61. package/dist/temporal/places/activites.d.ts +8 -0
  62. package/dist/temporal/places/activites.js +13 -0
  63. package/dist/temporal/places/activites.js.map +1 -0
  64. package/dist/temporal/places/client.d.ts +28 -0
  65. package/dist/temporal/places/client.js +64 -0
  66. package/dist/temporal/places/client.js.map +1 -0
  67. package/dist/temporal/places/contrat.d.ts +106 -0
  68. package/dist/temporal/places/contrat.js +21 -0
  69. package/dist/temporal/places/contrat.js.map +1 -0
  70. package/dist/temporal/places/deroule.d.ts +3 -0
  71. package/dist/temporal/places/deroule.js +198 -0
  72. package/dist/temporal/places/deroule.js.map +1 -0
  73. package/dist/temporal/sonde/activites.d.ts +6 -0
  74. package/dist/temporal/sonde/activites.js +52 -0
  75. package/dist/temporal/sonde/activites.js.map +1 -0
  76. package/dist/temporal/sonde/contrat.d.ts +35 -0
  77. package/dist/temporal/sonde/contrat.js +10 -0
  78. package/dist/temporal/sonde/contrat.js.map +1 -0
  79. package/dist/temporal/sonde/deroule.d.ts +3 -0
  80. package/dist/temporal/sonde/deroule.js +39 -0
  81. package/dist/temporal/sonde/deroule.js.map +1 -0
  82. package/dist/temporal/tickets/activites.d.ts +7 -0
  83. package/dist/temporal/tickets/activites.js +81 -0
  84. package/dist/temporal/tickets/activites.js.map +1 -0
  85. package/dist/temporal/tickets/client.d.ts +10 -0
  86. package/dist/temporal/tickets/client.js +31 -0
  87. package/dist/temporal/tickets/client.js.map +1 -0
  88. package/dist/temporal/tickets/contrat.d.ts +56 -0
  89. package/dist/temporal/tickets/contrat.js +13 -0
  90. package/dist/temporal/tickets/contrat.js.map +1 -0
  91. package/dist/temporal/tickets/deroule.d.ts +3 -0
  92. package/dist/temporal/tickets/deroule.js +94 -0
  93. package/dist/temporal/tickets/deroule.js.map +1 -0
  94. package/dist/temporal/travailleur.d.ts +2 -0
  95. package/dist/temporal/travailleur.js +69 -0
  96. package/dist/temporal/travailleur.js.map +1 -0
  97. package/docs/ARCHITECTURE.md +646 -87
  98. package/docs/CADRE.md +27 -0
  99. package/docs/INTERFACE.md +139 -42
  100. package/hooks/crochet.mjs +19 -2
  101. package/hooks/hooks.json +11 -0
  102. package/package.json +16 -4
  103. package/scripts/activites.mjs +2255 -0
  104. package/scripts/aiguillage.d.mts +37 -0
  105. package/scripts/aiguillage.mjs +40 -14
  106. package/scripts/avancement.mjs +155 -26
  107. package/scripts/bilan.mjs +137 -43
  108. package/scripts/cadre.mjs +16 -4
  109. package/scripts/circuit.mjs +993 -4075
  110. package/scripts/circuits-cles.d.mts +4 -0
  111. package/scripts/circuits-cles.mjs +21 -0
  112. package/scripts/circuits-du-serveur.mjs +105 -0
  113. package/scripts/codes-de-sortie.mjs +9 -0
  114. package/scripts/commandes-composees.mjs +45 -41
  115. package/scripts/commandes-du-path.d.mts +7 -0
  116. package/scripts/commandes-du-path.mjs +25 -0
  117. package/scripts/composants-affectes.mjs +64 -21
  118. package/scripts/composition-des-langages.mjs +18 -12
  119. package/scripts/conformite.mjs +56 -28
  120. package/scripts/copies-finies.mjs +52 -47
  121. package/scripts/depart-du-ticket.d.mts +53 -0
  122. package/scripts/depart-du-ticket.mjs +124 -0
  123. package/scripts/dependances-internes.mjs +121 -0
  124. package/scripts/dernier-vert.mjs +61 -34
  125. package/scripts/dette.mjs +32 -11
  126. package/scripts/donnees-cles.mjs +244 -0
  127. package/scripts/droits.mjs +51 -16
  128. package/scripts/effets.mjs +352 -0
  129. package/scripts/empreinte-d-etape.mjs +17 -0
  130. package/scripts/engendres.mjs +15 -5
  131. package/scripts/enveloppe/enveloppe.mjs +259 -55
  132. package/scripts/enveloppe/lancer.sh +14 -18
  133. package/scripts/enveloppe/paquets-du-plan.mjs +2 -2
  134. package/scripts/enveloppe/travail-de-la-copie.mjs +41 -13
  135. package/scripts/etapes.mjs +5 -2
  136. package/scripts/faits-du-circuit.mjs +493 -0
  137. package/scripts/file-des-tickets.d.mts +21 -0
  138. package/scripts/file-des-tickets.mjs +58 -0
  139. package/scripts/flux-des-paquets.mjs +201 -0
  140. package/scripts/gardes-du-cadre.mjs +21 -5
  141. package/scripts/init.mjs +11 -4
  142. package/scripts/integration/file.mjs +544 -434
  143. package/scripts/integration/integrer.mjs +87 -43
  144. package/scripts/integration/rejeu.mjs +45 -13
  145. package/scripts/jointure.d.ts +151 -28
  146. package/scripts/langages/cargo/commandes.mjs +383 -124
  147. package/scripts/langages/cargo/composants.mjs +154 -42
  148. package/scripts/langages/cargo/exemples.mjs +12 -21
  149. package/scripts/langages/cargo/index.mjs +22 -8
  150. package/scripts/langages/cargo/sccache.mjs +8 -14
  151. package/scripts/langages/cargo/tests-de-head.mjs +25 -9
  152. package/scripts/langages/python/commandes.mjs +218 -100
  153. package/scripts/langages/python/composants.mjs +53 -21
  154. package/scripts/langages/python/exemples.mjs +6 -16
  155. package/scripts/langages/python/index.mjs +28 -8
  156. package/scripts/langages/python/lot.mjs +1 -36
  157. package/scripts/langages/typescript/chemins-des-tests.mjs +6 -2
  158. package/scripts/langages/typescript/composants.mjs +9 -3
  159. package/scripts/langages/typescript/consommateurs-arbitres.mjs +40 -14
  160. package/scripts/langages/typescript/consommateurs.mjs +39 -14
  161. package/scripts/langages/typescript/construire.mjs +6 -163
  162. package/scripts/langages/typescript/elements-du-lot.mjs +36 -12
  163. package/scripts/langages/typescript/exemples.mjs +3 -11
  164. package/scripts/langages/typescript/frontieres.mjs +66 -22
  165. package/scripts/langages/typescript/index-interfaces.mjs +36 -13
  166. package/scripts/langages/typescript/index.mjs +50 -61
  167. package/scripts/langages/typescript/interfaces-contre-code.mjs +113 -45
  168. package/scripts/langages/typescript/lecteurs.mjs +36 -11
  169. package/scripts/langages/typescript/migrations/0.23.0-config-vitest.mjs +15 -5
  170. package/scripts/langages/typescript/migrations/0.25.0-chemins-des-tests.mjs +6 -2
  171. package/scripts/langages/typescript/migrations/0.25.0-tailles-des-tests.mjs +6 -2
  172. package/scripts/langages/typescript/migrations/0.30.0-prefixe-des-tickets.mjs +63 -0
  173. package/scripts/langages/typescript/migrations/0.30.0-tailles-des-outils-lourds.mjs +33 -0
  174. package/scripts/langages/typescript/migrations/0.30.0-titres-nommant-un-ticket.mjs +40 -0
  175. package/scripts/langages/typescript/mise-a-jour.mjs +1 -2
  176. package/scripts/langages/typescript/parcours.mjs +12 -4
  177. package/scripts/langages/typescript/regle-des-tests.mjs +9 -3
  178. package/scripts/langages/typescript/resumes.mjs +9 -3
  179. package/scripts/langages/typescript/tailles-des-tests.mjs +93 -20
  180. package/scripts/langages/typescript/tests-de-nuit.mjs +15 -10
  181. package/scripts/langages/typescript/tests.mjs +40 -15
  182. package/scripts/langages/typescript/titres-de-tests.mjs +320 -0
  183. package/scripts/langages/typescript/turbo-des-paquets.mjs +327 -81
  184. package/scripts/langages/typescript/verdict.mjs +4 -2
  185. package/scripts/langages/typescript/verifier.mjs +58 -20
  186. package/scripts/langages/typescript/vitest-config/avancement.reporter.mjs +15 -5
  187. package/scripts/langages/typescript/vitest-config/base.mjs +29 -3
  188. package/scripts/langages/typescript/vitest-config/bornes.mjs +13 -0
  189. package/scripts/langages/typescript/vitest-config/changements.mjs +21 -8
  190. package/scripts/langages/typescript/vitest-config/cibles.mjs +36 -14
  191. package/scripts/langages/typescript/vitest-config/delais.mjs +60 -0
  192. package/scripts/langages/typescript/vitest-config/delais.setup.mjs +11 -0
  193. package/scripts/langages/typescript/vitest-config/duree.classement.mjs +108 -0
  194. package/scripts/langages/typescript/vitest-config/duree.reporter.mjs +56 -59
  195. package/scripts/langages/typescript/vitest-config/lances.mjs +83 -27
  196. package/scripts/langages/typescript/vitest-config/machine.setup.mjs +10 -0
  197. package/scripts/langages/typescript/vitest-config/resultats.mjs +3 -1
  198. package/scripts/langages/typescript/vitest.nuit.config.mjs +4 -0
  199. package/scripts/lint-des-scripts.mjs +58 -0
  200. package/scripts/mesure/base-de-passe.mjs +117 -25
  201. package/scripts/mesure/pression.mjs +12 -6
  202. package/scripts/mesure-de-la-machine.d.mts +21 -0
  203. package/scripts/mesure-de-la-machine.mjs +76 -0
  204. package/scripts/migrations/0.23.0-charte-importee.mjs +6 -2
  205. package/scripts/migrations/0.23.0-crochets-de-seance.mjs +25 -8
  206. package/scripts/migrations/0.23.0-marche-du-projet.mjs +18 -6
  207. package/scripts/migrations/0.23.2-copies-du-cadre.mjs +56 -18
  208. package/scripts/migrations/0.24.12-tri-des-decouvertes.mjs +6 -2
  209. package/scripts/migrations/0.25.0-script-des-tests.mjs +15 -5
  210. package/scripts/migrations/0.30.0-ci-appelle-la-verification.mjs +124 -0
  211. package/scripts/migrations/0.31.0-paquets-dans-le-graphe.mjs +81 -0
  212. package/scripts/migrations.mjs +5 -0
  213. package/scripts/nuit.sh +25 -3
  214. package/scripts/outil.mjs +3 -1
  215. package/scripts/outils-cles.d.mts +24 -0
  216. package/scripts/outils-cles.mjs +18 -8
  217. package/scripts/paquet-npm.mjs +157 -0
  218. package/scripts/paquet.mjs +73 -4
  219. package/scripts/paquets.mjs +46 -10
  220. package/scripts/passe-de-la-machine.mjs +71 -0
  221. package/scripts/places-de-la-machine.mjs +414 -0
  222. package/scripts/places-du-serveur.mjs +170 -0
  223. package/scripts/prefixe-des-tickets.mjs +68 -0
  224. package/scripts/preparation.mjs +25 -8
  225. package/scripts/registre.mjs +9 -4
  226. package/scripts/regles-des-places.d.mts +36 -0
  227. package/scripts/regles-des-places.mjs +70 -0
  228. package/scripts/reponses-du-circuit.d.mts +6 -0
  229. package/scripts/reponses-du-circuit.mjs +28 -0
  230. package/scripts/reprise.mjs +66 -0
  231. package/scripts/resultats.mjs +112 -46
  232. package/scripts/retirer-les-copies-finies.mjs +25 -0
  233. package/scripts/sans-reponse.d.mts +4 -0
  234. package/scripts/sans-reponse.mjs +13 -0
  235. package/scripts/seances.mjs +936 -0
  236. package/scripts/services-du-noyau.mjs +27 -8
  237. package/scripts/session-start.sh +2 -2
  238. package/scripts/sortie.mjs +3 -3
  239. package/scripts/sous-commandes.mjs +41 -10
  240. package/scripts/style-a-l-ecriture.mjs +260 -0
  241. package/scripts/superviseur.mjs +122 -111
  242. package/scripts/tableau.mjs +180 -117
  243. package/scripts/taches-du-graphe.mjs +348 -0
  244. package/scripts/ticket-du-circuit.mjs +216 -0
  245. package/scripts/transitions.d.mts +148 -0
  246. package/scripts/transitions.mjs +1018 -0
  247. package/scripts/verrou-de-fichier.mjs +8 -4
  248. package/scripts/verrou-de-machine.mjs +150 -51
  249. package/scripts/verrous/commande.mjs +50 -17
  250. package/scripts/verrous/ticket-du-sous-agent.mjs +9 -3
  251. package/scripts/verrous/verrou.mjs +42 -14
  252. package/skills/explorateur/SKILL.md +9 -2
  253. package/skills/grill/SKILL.md +1 -1
  254. package/skills/mesure/SKILL.md +3 -0
  255. package/skills/pitmaster/SKILL.md +17 -18
  256. package/skills/pitmaster/references/consigne-agent.md +5 -1
  257. package/skills/release/SKILL.md +3 -3
  258. package/skills/relecteur/SKILL.md +5 -3
  259. package/skills/testwriter/SKILL.md +49 -31
  260. package/scripts/demon.mjs +0 -251
  261. package/scripts/integration/file-attente.mjs +0 -61
  262. package/scripts/langages/cargo/touches.mjs +0 -93
  263. package/scripts/langages/typescript/script-des-tests.mjs +0 -6
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  name: developpeur
3
3
  model: sonnet
4
- effort: medium
5
4
  description: Travaille le code d'un ticket dont les tests existent. N'écrit aucun test, ni la matière de test partagée, ni de code avant la section Architecture du ticket.
6
5
  skills:
7
6
  - grillhouse:developpeur
@@ -4,7 +4,6 @@ description: "Écrit le plan d'un ticket à l'étape 1 de son circuit (ses crit
4
4
  skills:
5
5
  - grillhouse:explorateur
6
6
  model: sonnet
7
- effort: medium
8
7
  disallowedTools: Write, Edit, MultiEdit, NotebookEdit
9
8
  ---
10
9
 
@@ -4,7 +4,6 @@ description: Questionne une proposition qu'il n'a pas écrite (le plan d'un tick
4
4
  skills:
5
5
  - grillhouse:questionneur
6
6
  model: sonnet
7
- effort: medium
8
7
  disallowedTools: Write, Edit, MultiEdit, NotebookEdit
9
8
  ---
10
9
 
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  name: testwriter
3
3
  model: sonnet
4
- effort: medium
5
4
  description: Écrit les tests d'un ticket depuis la spécification, avant le code. N'écrit que des fichiers de test, la matière de test partagée et ce dont ses tests dépendent ; aucun test ne lit le CHANGELOG, que juge la relecture.
6
5
  skills:
7
6
  - grillhouse:testwriter
@@ -22,12 +22,17 @@
22
22
  // nothing run, and the exit code is 2.
23
23
  // - In a project whose package.json names its published version (`grillhouse.outil`, the frame's
24
24
  // repository), a subcommand of the orchestration (circuit, superviseur, nuit, tableau, the status
25
- // line and the hooks of Claude Code) runs by that version, installed under
25
+ // line, the hooks of Claude Code and the write lock) runs by that version, installed under
26
26
  // ~/.cache/grillhouse/outil/<version>/ at its first launch, its arguments, streams and exit
27
27
  // code this command's; every other subcommand runs here (scripts/aiguillage.mjs). A faulty key
28
28
  // is refused by its name on the error stream, nothing run, and the exit code is 2; a version
29
29
  // that cannot be installed is said in one line on the error stream, and the subcommand runs
30
- // here.
30
+ // here, or, when the code of this repository does not load either, is refused by its version
31
+ // and its cause, exit code 2. The code of the copy is loaded only once the subcommand is known to
32
+ // run here, so a module of the copy that no longer loads never stops a subcommand that the
33
+ // published version runs (the write lock).
34
+ // - A subcommand whose script is missing (the package's TypeScript unbuilt, `dist/`) says so with
35
+ // the command that builds it on the error stream, and the exit code is 1.
31
36
  // - A subcommand missing or unknown writes the usage and the list of the subcommands on the error
32
37
  // stream, and the exit code is 2.
33
38
  // - A script finds its neighbours by its own directory, and the project by the working directory
@@ -37,27 +42,31 @@ import { realpathSync } from 'node:fs';
37
42
  import { constants } from 'node:os';
38
43
  import { pathToFileURL } from 'node:url';
39
44
  import { aiguillage, installer } from '../scripts/aiguillage.mjs';
40
- import {
41
- commandeDe,
42
- environnementDe,
43
- SOUS_COMMANDES,
44
- sousCommandes,
45
- } from '../scripts/sous-commandes.mjs';
45
+
46
+ // The code of the copy, loaded once the subcommand is known to run here: a module of the copy that
47
+ // no longer loads must not stop a subcommand the published version runs (the write lock above all).
48
+ async function chargerLeCode() {
49
+ const [donnees, sous] = await Promise.all([
50
+ import('../scripts/donnees-cles.mjs'),
51
+ import('../scripts/sous-commandes.mjs'),
52
+ ]);
53
+ return { ...donnees, ...sous };
54
+ }
46
55
 
47
56
  // The subcommands in the working directory: the core's, and the ones of the module of its
48
57
  // language; the core's alone when the frame refuses its language.
49
- const lesSousCommandes = () => {
58
+ const lesSousCommandes = code => {
50
59
  try {
51
- return sousCommandes();
60
+ return code.sousCommandes();
52
61
  } catch {
53
- return SOUS_COMMANDES;
62
+ return code.SOUS_COMMANDES;
54
63
  }
55
64
  };
56
65
 
57
66
  // The usage and the list of the subcommands, as the error stream receives them.
58
- const usage = () =>
67
+ const usage = code =>
59
68
  'Usage : grillhouse <sous-commande> [arguments…]\n' +
60
- `Sous-commandes : ${Object.keys(lesSousCommandes()).join(', ')}\n`;
69
+ `Sous-commandes : ${Object.keys(lesSousCommandes(code)).join(', ')}\n`;
61
70
 
62
71
  // The command is run by its link (`node_modules/.bin/grillhouse`), which Node resolves for the
63
72
  // module, not for `process.argv[1]`.
@@ -89,9 +98,10 @@ function lancerLeScript(nom, commande, args, env = process.env) {
89
98
  }
90
99
 
91
100
  // The subcommand <nom> handed to the published version the project names (scripts/aiguillage.mjs),
92
- // installed at its first launch: true when it is handed, false when it runs here, a version that
93
- // cannot be installed said in one line.
94
- function aiguiller(nom, args) {
101
+ // installed at its first launch: true when it is handed (or refused), false when it runs here, a
102
+ // version that cannot be installed said in one line; when the code here does not load either, the
103
+ // subcommand is refused (exit code 2) by the version and both causes.
104
+ async function aiguiller(nom, args) {
95
105
  let vers;
96
106
  try {
97
107
  vers = nom === undefined ? null : aiguillage(nom);
@@ -104,6 +114,17 @@ function aiguiller(nom, args) {
104
114
  try {
105
115
  installer(vers.version);
106
116
  } catch (e) {
117
+ try {
118
+ await chargerLeCode();
119
+ } catch (c) {
120
+ process.stderr.write(
121
+ `⛔ grillhouse ${nom} : version publiée ${vers.version} non installable : ${e.message} ; ` +
122
+ `le code de ce dépôt ne se charge pas non plus : ${c.message} ; ` +
123
+ "la réparation de l'arbre principal revient au superviseur, hors séance d'agent.\n"
124
+ );
125
+ process.exitCode = 2;
126
+ return true;
127
+ }
107
128
  process.stderr.write(
108
129
  `⚠️ grillhouse ${nom} : version publiée ${vers.version} non installable : ${e.message} ; le code du dépôt la remplace.\n`
109
130
  );
@@ -116,7 +137,28 @@ function aiguiller(nom, args) {
116
137
  // The script of the subcommand, run (see the header); the exit code is set, never forced
117
138
  // (`process.exitCode`), so that what the command wrote on a pipe reaches its reader.
118
139
  async function lancer([nom, ...args]) {
119
- if (aiguiller(nom, args)) return;
140
+ if (await aiguiller(nom, args)) return;
141
+ let code;
142
+ try {
143
+ code = await chargerLeCode();
144
+ } catch (e) {
145
+ process.stderr.write(
146
+ `⛔ grillhouse ${nom ?? ''} : le code de ce dépôt ne se charge pas : ${e.message}\n`
147
+ );
148
+ process.exitCode = 2;
149
+ return;
150
+ }
151
+ const {
152
+ avecLesDonnees,
153
+ commandeDe,
154
+ construireLesFournisseurs,
155
+ controlerLesDonnees,
156
+ donneesDuPaquet,
157
+ environnementDe,
158
+ fournisseursDuPaquet,
159
+ scriptAbsent,
160
+ SOUS_COMMANDES,
161
+ } = code;
120
162
  let commande;
121
163
  try {
122
164
  commande = nom === undefined ? null : commandeDe(nom);
@@ -127,12 +169,18 @@ async function lancer([nom, ...args]) {
127
169
  }
128
170
  if (commande === null) {
129
171
  process.stderr.write(
130
- nom === undefined ? usage() : `⛔ sous-commande inconnue : ${nom}\n${usage()}`
172
+ nom === undefined ? usage(code) : `⛔ sous-commande inconnue : ${nom}\n${usage(code)}`
131
173
  );
132
174
  process.exitCode = 2;
133
175
  return;
134
176
  }
135
177
  const script = commande.script;
178
+ const absent = scriptAbsent(nom, script);
179
+ if (absent !== null) {
180
+ process.stderr.write(`${absent}\n`);
181
+ process.exitCode = 1;
182
+ return;
183
+ }
136
184
  args = [...commande.args, ...args];
137
185
  const duNoyau = typeof SOUS_COMMANDES[nom] === 'string';
138
186
  if (duNoyau && script.endsWith('.mjs')) {
@@ -143,6 +191,19 @@ async function lancer([nom, ...args]) {
143
191
  let env;
144
192
  try {
145
193
  env = environnementDe(nom);
194
+ // The tests of a package, named by its folder or a path in it, get the data it declares. Run
195
+ // by the graph of the packages, its providers are built already; run by hand, they are built
196
+ // first (by the module of the language, which skips it inside the graph), then each output is
197
+ // checked once built.
198
+ if (nom === 'tests') {
199
+ for (const a of args.filter(x => !x.startsWith('-'))) {
200
+ const chemin = a.replace(/\/$/, '');
201
+ const donnees = donneesDuPaquet(process.cwd(), chemin);
202
+ construireLesFournisseurs(fournisseursDuPaquet(process.cwd(), chemin));
203
+ controlerLesDonnees(donnees);
204
+ env = avecLesDonnees(donnees, env);
205
+ }
206
+ }
146
207
  } catch (e) {
147
208
  process.stderr.write(`⛔ grillhouse ${nom} : ${e.message}\n`);
148
209
  process.exitCode = 2;
@@ -27,19 +27,8 @@ jobs:
27
27
  - name: Install dependencies
28
28
  run: npm ci
29
29
 
30
- - name: Check formatting
31
- run: npm run format:check
32
-
33
- - name: Lint
34
- run: npm run lint
35
-
36
- - name: Typecheck
37
- run: npm run typecheck
38
-
39
- - name: Build
40
- run: npm run build --if-present
41
-
42
- - name: Guards and tests
30
+ # Formatting, lint, typing, build, guards and tests: the one command of the poste.
31
+ - name: Verification
43
32
  run: npm run verifier
44
33
 
45
34
  build:
@@ -37,7 +37,7 @@ interface publiée…>. Le cadre et l'architecture montent toujours (charte comm
37
37
 
38
38
  ## Commandes
39
39
 
40
- - `npm test` (Turborepo : construction, puis tests ; une tâche dont rien n'a bougé est relue de son cache, `npm run test:forcer` rejoue) · `npm test -- <chemins>` (un lancement ciblé : chaque chemin écrit depuis la racine, joué dans son paquet, avec les constructions dont ses tests dépendent, relues du cache ; ses tests rejouent dès que bouge ce qu'ils importent ; un lancement qui ne joue aucun test échoue ; un test de nuit ou une mesure de temps — un banc, un témoin de temps — se joue quand son propre fichier est nommé, sous la mesure du temps) · `npm run verifier` (après la construction, les gardes du cadre, celles du projet — son script `gardes` —, le typage de chaque paquet — son script `typecheck`, ses sources et ses tests — et les tests, côte à côte, sous le verrou de la machine, sans aucune mesure de temps, que joue la nuit seule : ce que jouent l'intégration, la file, la CI et la nuit ; mesuré contre le dernier vert, un paquet rejoué joue les tests que Vitest relie aux fichiers changés depuis, tous quand un changement sort de son graphe ; 0 vert, 1 rouge, un délai dépassé compris ; 75 quand l'attente du verrou de la machine ou de place sous /tmp atteint sa borne) · `npm run verifier -- --tout` (la passe complète, chaque test joué pour de vrai : ce que joue la nuit) · `npm run verifier -- --gardes` (les gardes seules, même verdict : ce que joue le relecteur) · `npm run typecheck` · `npm run lint` · `npm run format:check`.
40
+ - `npm test` (Turborepo : construction, puis tests ; une tâche dont rien n'a bougé est relue de son cache, `npm run test:forcer` rejoue) · `npm test -- <chemins>` (un lancement ciblé : chaque chemin écrit depuis la racine, joué dans son paquet, avec les constructions dont ses tests dépendent, relues du cache ; ses tests rejouent dès que bouge ce qu'ils importent ; un lancement qui ne joue aucun test échoue ; un test de nuit nommé est refusé, la nuit seule le joue ; une mesure de temps — un banc, un témoin de temps — se joue quand son propre fichier est nommé, sous la mesure du temps) · `npm run verifier` (après la construction, les gardes du cadre, celles du projet — son script `gardes` —, le typage de chaque paquet — son script `typecheck`, ses sources et ses tests —, la mise en forme et le lint de la racine — ses scripts `format:check` et `lint`, joués quand ils existent — et les tests, côte à côte, sous le verrou de la machine, sans aucune mesure de temps, que joue la nuit seule : ce que jouent l'intégration, la file, la CI et la nuit ; mesuré contre le dernier vert, un paquet rejoué joue les tests que Vitest relie aux fichiers changés depuis, tous quand un changement sort de son graphe ; 0 vert, 1 rouge, un délai dépassé compris ; 75 quand l'attente du verrou de la machine ou de place sous /tmp atteint sa borne) · `npm run verifier -- --tout` (la passe complète, chaque test joué pour de vrai : ce que joue la nuit) · `npm run verifier -- --gardes` (les gardes, la mise en forme et le lint, même verdict : ce que joue le relecteur) · `npm run typecheck` · `npm run lint` · `npm run format:check`.
41
41
  - Préfixe des tickets : `<prefixe>-`.
42
42
  - La politique de poussée : la clé `grillhouse.poussee` du `package.json` (`commit` : la branche où
43
43
  part chaque commit, main par défaut ; `nuit` : la branche où la nuit pousse son commit vert ;
@@ -61,3 +61,7 @@ interface publiée…>. Le cadre et l'architecture montent toujours (charte comm
61
61
  sur main ne le fusionnent pas, elles prennent la version de main et rejouent sa commande sur le
62
62
  lot appliqué ; lue dans l'arbre principal ; une clé sans commande, sans fichiers ou avec un
63
63
  motif hors du dépôt est refusée par son nom avant tout travail).
64
+ - Le nombre de circuits à la fois : la clé `grillhouse.circuits` du `package.json` (un entier
65
+ ≥ 1, **1** quand elle est absente : les circuits du projet qui tournent à la fois, que la file
66
+ des tickets tient ; un circuit qui attend la réponse du superviseur compte ; lue dans l'arbre
67
+ principal ; toute autre valeur est refusée par son nom avant tout travail).
@@ -6,7 +6,7 @@ Issues for this repo live in Beads, a git-backed tracker: data under `.beads/`,
6
6
 
7
7
  - One ticket = one agent session's worth of work; the body holds the brief, the plan, and (on close) the answer.
8
8
  - Every ticket opens with an **Architecture** section, three answers written before any code: the mature model (how the mature product of the domain handles it, named), the address (where it lives in the specified architecture), the common mechanism (existing, or missing — then the missing mechanism is the work, and the reported case only its witness). A ticket without it does not start.
9
- - A realisation ticket is created with its **Acceptance criteria** section (`## Critères d'acceptation`) after « Architecture »: criteria numbered `1.`, `2.`… (cited « critère 1 » in tests and comments), each a checkable statement answering a real need of the current use, edge cases and refusals included, covering every place that applies the same rule (found through the index). So the flow starts on criteria already numbered, and no agent rewrites the ticket to number them; a ticket does not go to the `testwriter` without them. A criterion on the changelog reads « the CHANGELOG says it », never tied to a section title (each release moves the entry out of the open section): the `relecteur` judges the entry on the lot; no test reads it.
9
+ - A realisation ticket is created with its **Acceptance criteria** section (`## Critères d'acceptation`) after « Architecture »: criteria numbered `1.`, `2.`… (cited « critère 1 » in tests and comments), each a checkable statement answering a real need of the current use, edge cases and refusals included, covering every place that applies the same rule (found through the index). So the flow starts on criteria already numbered, and no agent rewrites the ticket to number them; a ticket does not go to the `testwriter` without them. A criterion on the changelog reads « the CHANGELOG says it », never tied to a section title (each release moves the entry out of the open section): the `relecteur` judges the entry on the lot; no test reads it. The entry goes in the CHANGELOG.md of the published package the lot touches, in the folder of that package (the root `CHANGELOG.md` only for a project whose root is its package).
10
10
  - A change of behaviour is one ticket that passes from agent to agent, never a ticket per post: in the ticket's copy, the `testwriter` writes the tests; the `developpeur` finds them there and writes the code; the `relecteur` gives its verdict (`ACCEPTÉ` or `RENDU`, each finding naming its recipient, a role and a component) in its sheet, which the circuit writes on the same ticket; the circuit (`packages/grillhouse/scripts/circuit.mjs`) leads them, sends a lot RENDU back to the agents its findings name, and on `ACCEPTÉ` builds both lots from the copy and commits them in one commit on the branch `agent/<ticket>` through `packages/grillhouse/scripts/integration/integrer.mjs` (the ticket is labelled `en-file`); the queue (`packages/grillhouse/scripts/integration/file.mjs`) brings that branch onto main, closes the ticket and pushes main.
11
11
  - One ticket, one delivery: a goal whose split is unknown opens an exploration ticket (no code, agent `explorateur`), which closes on the realisation tickets it proposes, recorded closed and labelled `decouverte`; the supervisor reopens those the owner validates. A realisation ticket names the components it touches (« Numéros et titres ») and enters in one commit, under its own number alone; the `commit-msg` hook refuses a second commit for a closed ticket whose delivery stands, and lets a ticket reopened after its delivery (open in Beads) take correction commits; a revert (`Revert "…"`, `Reapply "…"`) passes and withdraws the delivery it names.
12
12
  - An open ticket is born of the owner's word, or of a direct need of a project that uses the frame (a defect it meets). A discovery during work is recorded, with its example and address, in a closed ticket under the ticket that found it, labelled `decouverte` (see « Numéros et titres »). Once the ticket's lot is on main, the tri of the discoveries (step 5.3, the `explorateur`) gives each one its verdict at its ticket, with its piece, as a label: `traitee`, `doublon` or `sans-suite` leave it closed; `a-porter` (a defect of the actual use) or `non-confirmee` (no proof played again, what lacks written) reopen it under `a-valider`, for the owner. A discovery that blocks stops the agent, and its handoff names it.
@@ -19,10 +19,10 @@
19
19
  "test": "grillhouse tests",
20
20
  "test:watch": "vitest",
21
21
  "test:coverage": "vitest run --coverage",
22
- "lint": "eslint src tests --ext .ts,.js,.mjs",
22
+ "lint": "eslint src tests --cache --cache-location node_modules/.cache/eslint/.eslintcache --ext .ts,.js,.mjs",
23
23
  "lint:fix": "eslint src tests --ext .ts,.js,.mjs --fix",
24
24
  "format": "prettier --write \"src/**/*.{ts,js,mjs}\" \"tests/**/*.{ts,js,mjs}\"",
25
- "format:check": "prettier --check \"src/**/*.{ts,js,mjs}\" \"tests/**/*.{ts,js,mjs}\"",
25
+ "format:check": "prettier --check --cache --cache-location node_modules/.cache/prettier/.prettiercache \"src/**/*.{ts,js,mjs}\" \"tests/**/*.{ts,js,mjs}\"",
26
26
  "prepare": "grillhouse hooks && npm run build",
27
27
  "prepublishOnly": "npm run lint && npm run typecheck && npm run verifier && npm run build",
28
28
  "daemon:start": "pm2 start ecosystem.config.cjs",
package/charte.md CHANGED
@@ -79,6 +79,22 @@ en un seul commit, et se crée sous sa mère (`docs/agents/issue-tracker.md`). U
79
79
  découpage n'est pas connu commence par une exploration, sans code. Ainsi l'avancement se lit
80
80
  ticket par ticket.
81
81
 
82
+ **Le rouge prouve le travail du ticket** : un test qui échoue avant le code prouve qu'avant le
83
+ travail le comportement manque, et qu'après il est là ; c'est son seul sens. Seul un test qui
84
+ porte le travail du ticket rougit donc d'abord ; les autres sont verts avant le code, sans
85
+ justification à donner. Chaque sorte de test prouve une chose :
86
+
87
+ | Sorte | Ce qu'elle prouve | Rouge avant le code |
88
+ |---|---|---|
89
+ | Test du comportement développé | Le ticket fait ce que dit son critère | Oui : c'est la preuve du travail |
90
+ | Test d'un défaut corrigé | Le défaut est reproduit, puis corrigé | Oui : il montre le défaut |
91
+ | Test d'un comportement existant | Le lot ne casse rien | Non : vert attendu |
92
+ | Test d'interface | Un paquet tient ce qu'il publie | Oui s'il porte le travail du ticket, sinon non |
93
+ | Banc de temps, témoin de temps | Un temps reste sous sa borne | Non : mesuré la nuit |
94
+ | Test de nuit | Le produit entier, monté dans un projet d'essai | Oui s'il porte le travail du ticket, joué la nuit |
95
+
96
+ Ainsi la preuve du rouge mesure le travail, et aucun test ne rougit pour la forme.
97
+
82
98
  **La taille d'un test suit la pyramide** (la pyramide des tests de Google, les tailles de
83
99
  Bazel) : un test petit vérifie son module par son interface, sans processus ; un test moyen
84
100
  assemble quelques modules sur la machine, avec des processus locaux ; un test grand monte un
@@ -88,6 +104,10 @@ Grillhouse comme dans chaque projet. La garde des tailles (`grillhouse tailles-d
88
104
  un grand test de jour, et la dette inscrite des grands tests existants ne fait que baisser. Ainsi
89
105
  le jour reste court, et la preuve longue tourne la nuit.
90
106
 
107
+ **Un test porte le nom du comportement qu'il prouve**, jamais le numéro de son ticket, qui va au
108
+ message du commit (Software Engineering at Google, chap. 12 : un test par comportement). Ainsi un
109
+ test vit autant que son comportement, pas que son ticket.
110
+
91
111
  **Une mesure de temps joue la nuit** (les tests `manual` de Bazel, les bancs de rustc-perf hors de
92
112
  la CI de chaque commit) : le jour sert l'activité, et sa machine est toujours chargée. Un test qui
93
113
  mesure un temps (un banc de temps, un témoin de temps) est hors du jour dans chaque langage, comme
@@ -167,6 +187,10 @@ dossier.
167
187
  Ainsi le cadre ne maintient aucune spécificité par composant.
168
188
  - **Une dette connue s'inscrit et se gèle** (`grillhouse-dette.json`) : une garde refuse tout
169
189
  constat neuf, et le compte ne remonte jamais. Ainsi la dette ne fait que baisser.
190
+ - **Un flux de la CI déclare les paquets qu'il exerce, le relecteur le lit** (`grillhouse.flux` du
191
+ `package.json` racine) : une garde refuse un flux sans entrée ou un paquet inconnu, et la
192
+ consigne du relecteur nomme chaque flux que le lot touche. Ainsi un flux qui ne suit pas un
193
+ changement est lu avant le commit.
170
194
  - **Un fichier engendré se construit** plutôt que de se commiter (au démarrage, au déploiement),
171
195
  comme les index de Homebrew ou de caniuse. Un fichier qu'un lecteur ne peut pas construire
172
196
  (une page lue sur GitHub, une somme de contrôle publiée) reste commité : le projet le déclare
@@ -0,0 +1,24 @@
1
+ /**
2
+ * The group of the process <mort> of a dead attempt ended (SIGKILL) before the attempt played
3
+ * again plays, its leader gone or not (`groupeVivant`: a command of the dead act still running in
4
+ * its group); nothing without one.
5
+ */
6
+ export declare function finirLaTentativeMorte(mort: {
7
+ pid: number;
8
+ depart: string | null;
9
+ } | null | undefined): void;
10
+ /**
11
+ * The key of the activity whose information is <info>: its workflow, its run and its activity id,
12
+ * the same for each of its attempts, as Temporal recommends an idempotency key (the run, because
13
+ * a workflow starts again under a new run, Continue-As-New or a circuit launched again, its
14
+ * activity ids counted anew); null out of a workflow.
15
+ */
16
+ export declare function cleDeLActivite(info: {
17
+ workflowExecution?: {
18
+ workflowId: string;
19
+ runId: string;
20
+ } | null;
21
+ activityId: string;
22
+ }): string | null;
23
+ /** Plays the act <acte> on <entree> in the main tree <racine>: its outcome. */
24
+ export declare function jouer<T>(acte: string, entree: object, racine: string): Promise<T>;
@@ -0,0 +1,139 @@
1
+ // One act of the circuit (scripts/faits-du-circuit.mjs), which the activities of the workflow of a
2
+ // ticket (./circuit/activites.ts) and of the queue of a project (./file/activites.ts) play, in a
3
+ // process of its own, in the main tree of the repository, as
4
+ // a CI runner plays each job in a child process. While the act plays, the activity sends a
5
+ // heartbeat every few seconds, the last sign of life of its session among its details; an attempt
6
+ // played again after its worker died hands that sign to its session (`precedent`), which waits
7
+ // for the group the dead attempt left before it launches its own (scripts/seances.mjs `lancer`),
8
+ // and kills the group of the dead attempt first, its leader gone or not (`finirLaTentativeMorte`).
9
+ // Each act receives the key of its activity (`cle`, `cleDeLActivite`), the same for each of its
10
+ // attempts, under which the act `effet` writes its effect once, the attempt of its activity
11
+ // (`essai`, 1 for the first), which says whether Temporal plays it again, and whether it is its
12
+ // last (`derniere`), past which Temporal tries it no more. The act leads a process group of its own, with
13
+ // the commands it runs (a rebase, a verification), as a session does (scripts/seances.mjs
14
+ // `jouerLeGroupe`). A cancellation (the supervisor's `--arreter`, a timeout of the activity) sends
15
+ // SIGTERM to its group, which ends its session, its group killed, then SIGKILL 10 s later; the
16
+ // activity fails once the whole group is gone, so that no command of the act outlives it. An act
17
+ // that fails is an error of the activity that is not tried again (`ApplicationFailure`, its
18
+ // message and its stack).
19
+ import { spawn } from 'node:child_process';
20
+ import { fileURLToPath } from 'node:url';
21
+ import { Context } from '@temporalio/activity';
22
+ import { ApplicationFailure } from '@temporalio/common';
23
+ import { departDe, groupeVivant, signalerGroupe } from '../../scripts/mesure-de-la-machine.mjs';
24
+ // The program of the acts: the circuit's, or a machine of trial's (GRILLHOUSE_ACTE_DU_CIRCUIT).
25
+ const ACTE = process.env.GRILLHOUSE_ACTE_DU_CIRCUIT ??
26
+ fileURLToPath(new URL('../../scripts/faits-du-circuit.mjs', import.meta.url));
27
+ // How often an act in progress sends its heartbeat.
28
+ const BATTEMENT_MS = 5_000;
29
+ // How long a cancelled act's group has after SIGTERM, before SIGKILL: beyond the 5 s the act gives
30
+ // its session's group (scripts/seances.mjs), so that the act kills that group first.
31
+ const GRACE_MS = 10_000;
32
+ /**
33
+ * The group of the process <mort> of a dead attempt ended (SIGKILL) before the attempt played
34
+ * again plays, its leader gone or not (`groupeVivant`: a command of the dead act still running in
35
+ * its group); nothing without one.
36
+ */
37
+ export function finirLaTentativeMorte(mort) {
38
+ if (groupeVivant(mort)) {
39
+ signalerGroupe(mort.pid, 'SIGKILL');
40
+ }
41
+ }
42
+ /**
43
+ * The key of the activity whose information is <info>: its workflow, its run and its activity id,
44
+ * the same for each of its attempts, as Temporal recommends an idempotency key (the run, because
45
+ * a workflow starts again under a new run, Continue-As-New or a circuit launched again, its
46
+ * activity ids counted anew); null out of a workflow.
47
+ */
48
+ export function cleDeLActivite(info) {
49
+ const d = info.workflowExecution;
50
+ return d ? `${d.workflowId}:${d.runId}:${info.activityId}` : null;
51
+ }
52
+ /** Plays the act <acte> on <entree> in the main tree <racine>: its outcome. */
53
+ export async function jouer(acte, entree, racine) {
54
+ const contexte = Context.current();
55
+ const avant = contexte.info.heartbeatDetails ?? null;
56
+ // The group of a dead attempt ends before this one plays; its session's group stays, which
57
+ // the session of this attempt waits for.
58
+ finirLaTentativeMorte(avant?.processus);
59
+ const precedent = avant?.vie ?? null;
60
+ const cle = cleDeLActivite(contexte.info);
61
+ const enfant = spawn(process.execPath, [ACTE, acte], {
62
+ cwd: racine,
63
+ stdio: ['pipe', 'pipe', 'inherit'],
64
+ env: process.env,
65
+ detached: true,
66
+ });
67
+ const moi = { pid: enfant.pid, depart: departDe(enfant.pid) };
68
+ let vie = precedent;
69
+ let resultat = null;
70
+ let reste = '';
71
+ enfant.stdout.on('data', (d) => {
72
+ reste += d.toString();
73
+ const lignes = reste.split('\n');
74
+ reste = lignes.pop() ?? '';
75
+ for (const l of lignes) {
76
+ const m = /^(vie|resultat|erreur) (.*)$/.exec(l);
77
+ if (!m) {
78
+ continue;
79
+ }
80
+ const valeur = JSON.parse(m[2]);
81
+ if (m[1] === 'vie') {
82
+ // The end of a launch (null) keeps the group it named: what remains of it may run.
83
+ if (valeur !== null) {
84
+ vie = valeur;
85
+ }
86
+ contexte.heartbeat({ processus: moi, vie });
87
+ }
88
+ else {
89
+ resultat = { genre: m[1], valeur };
90
+ }
91
+ }
92
+ });
93
+ // An act dead before it reads its input says so by its exit, which the close gives.
94
+ enfant.stdin.on('error', () => { });
95
+ // Its last attempt: the one past which Temporal tries it no more (none under an unbounded policy,
96
+ // 0 or absent, as Temporal's default).
97
+ const tentatives = contexte.info.retryPolicy?.maximumAttempts ?? 0;
98
+ const derniere = tentatives > 0 && contexte.info.attempt >= tentatives;
99
+ enfant.stdin.end(JSON.stringify({ ...entree, precedent, cle, essai: contexte.info.attempt, derniere }));
100
+ contexte.heartbeat({ processus: moi, vie });
101
+ const battre = setInterval(() => contexte.heartbeat({ processus: moi, vie }), BATTEMENT_MS);
102
+ let tuer = null;
103
+ const annuler = () => {
104
+ signalerGroupe(moi.pid, 'SIGTERM');
105
+ tuer = setTimeout(() => signalerGroupe(moi.pid, 'SIGKILL'), GRACE_MS);
106
+ };
107
+ contexte.cancellationSignal.addEventListener('abort', annuler);
108
+ try {
109
+ const code = await new Promise(ok => enfant.on('close', c => ok(c)));
110
+ const r = resultat;
111
+ if (contexte.cancellationSignal.aborted) {
112
+ // What remains of the group ends before the activity fails.
113
+ while (signalerGroupe(moi.pid, 0)) {
114
+ await new Promise(ok => setTimeout(ok, 200));
115
+ }
116
+ throw ApplicationFailure.nonRetryable(`acte ${acte} annulé`, 'Annule');
117
+ }
118
+ if (r?.genre === 'resultat') {
119
+ return r.valeur;
120
+ }
121
+ const e = (r?.valeur ?? {});
122
+ // An effect not written before its last attempt: Temporal tries it again (its policy).
123
+ if (e.reessayable) {
124
+ throw ApplicationFailure.retryable(e.message ?? `acte ${acte} sans résultat`, 'EffetNonEcrit', {
125
+ message: e.message ?? null,
126
+ pile: e.pile ?? null,
127
+ });
128
+ }
129
+ throw ApplicationFailure.nonRetryable(e.message ?? `acte ${acte} sorti (${code}) sans résultat`, 'Inattendu', { message: e.message ?? null, pile: e.pile ?? null });
130
+ }
131
+ finally {
132
+ if (tuer) {
133
+ clearTimeout(tuer);
134
+ }
135
+ clearInterval(battre);
136
+ contexte.cancellationSignal.removeEventListener('abort', annuler);
137
+ }
138
+ }
139
+ //# sourceMappingURL=acte.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acte.js","sourceRoot":"","sources":["../../src/temporal/acte.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,iGAAiG;AACjG,6DAA6D;AAC7D,2FAA2F;AAC3F,kGAAkG;AAClG,+FAA+F;AAC/F,iGAAiG;AACjG,mGAAmG;AACnG,gGAAgG;AAChG,4FAA4F;AAC5F,gGAAgG;AAChG,0GAA0G;AAC1G,0FAA0F;AAC1F,mGAAmG;AACnG,+FAA+F;AAC/F,iGAAiG;AACjG,4FAA4F;AAC5F,0BAA0B;AAC1B,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAEhG,gGAAgG;AAChG,MAAM,IAAI,GACR,OAAO,CAAC,GAAG,CAAC,0BAA0B;IACtC,aAAa,CAAC,IAAI,GAAG,CAAC,oCAAoC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAChF,oDAAoD;AACpD,MAAM,YAAY,GAAG,KAAK,CAAC;AAC3B,mGAAmG;AACnG,qFAAqF;AACrF,MAAM,QAAQ,GAAG,MAAM,CAAC;AAQxB;;;;GAIG;AACH,MA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TRIBUT_TICKET: import("@temporalio/common/lib/search-attributes.js").SearchAttributeKey<"KEYWORD">;
3
+ /** The step a workflow is at. */
4
+ export declare const ATTRIBUT_ETAPE: import("@temporalio/common/lib/search-attributes.js").SearchAttributeKey<"KEYWORD">;
5
+ /** Each search attribute and its type, in the words of `temporal server start-dev`. */
6
+ export declare const ATTRIBUTS_DE_RECHERCHE: Readonly<Record<string, 'Keyword'>>;
@@ -0,0 +1,15 @@
1
+ // The search attributes of the frame's workflows: the ticket and the step, two keywords, which the
2
+ // server registers at its start (`--search-attribute`, the unit of the server) and which a
3
+ // workflow upserts at each step, so that the board and `workflow list` read them from the server
4
+ // alone, no worker living. A module without network, which a workflow imports as the client does.
5
+ import { defineSearchAttributeKey, SearchAttributeType } from '@temporalio/common';
6
+ /** The ticket a workflow carries. */
7
+ export const ATTRIBUT_TICKET = defineSearchAttributeKey('GrillhouseTicket', SearchAttributeType.KEYWORD);
8
+ /** The step a workflow is at. */
9
+ export const ATTRIBUT_ETAPE = defineSearchAttributeKey('GrillhouseEtape', SearchAttributeType.KEYWORD);
10
+ /** Each search attribute and its type, in the words of `temporal server start-dev`. */
11
+ export const ATTRIBUTS_DE_RECHERCHE = {
12
+ [ATTRIBUT_TICKET.name]: 'Keyword',
13
+ [ATTRIBUT_ETAPE.name]: 'Keyword',
14
+ };
15
+ //# sourceMappingURL=attributs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attributs.js","sourceRoot":"","sources":["../../src/temporal/attributs.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,2FAA2F;AAC3F,iGAAiG;AACjG,kGAAkG;AAClG,OAAO,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEnF,qCAAqC;AACrC,MAAM,CAAC,MAAM,eAAe,GAAG,wBAAwB,CACrD,kBAAkB,EAClB,mBAAmB,CAAC,OAAO,CAC5B,CAAC;AAEF,iCAAiC;AACjC,MAAM,CAAC,MAAM,cAAc,GAAG,wBAAwB,CACpD,iBAAiB,EACjB,mBAAmB,CAAC,OAAO,CAC5B,CAAC;AAEF,uFAAuF;AACvF,MAAM,CAAC,MAAM,sBAAsB,GAAwC;IACzE,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,SAAS;IACjC,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,SAAS;CACjC,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { Activites } from './contrat.js';
2
+ type Entree<K extends keyof Activites> = Parameters<Activites[K]>[0];
3
+ type Sortie<K extends keyof Activites> = Awaited<ReturnType<Activites[K]>>;
4
+ export declare function ouvrirLeCircuit(e: Entree<'ouvrirLeCircuit'>): Promise<Sortie<'ouvrirLeCircuit'>>;
5
+ export declare function preparerLaPasse(e: Entree<'preparerLaPasse'>): Promise<Sortie<'preparerLaPasse'>>;
6
+ export declare function lireUnFait(e: Entree<'lireUnFait'>): Promise<Sortie<'lireUnFait'>>;
7
+ export declare function appliquerLesEffets(e: Entree<'appliquerLesEffets'>): Promise<Sortie<'appliquerLesEffets'>>;
8
+ export declare function publierLArret(e: Entree<'publierLArret'>): Promise<Sortie<'publierLArret'>>;
9
+ export declare function finirLeTicket(e: Entree<'finirLeTicket'>): Promise<Sortie<'finirLeTicket'>>;
10
+ export declare function arreterLeTicket(e: Entree<'arreterLeTicket'>): Promise<Sortie<'arreterLeTicket'>>;
11
+ export declare function jouerUnEffet(e: Entree<'jouerUnEffet'>): Promise<void>;
12
+ export declare function jouerUnPasDuPlan(e: Entree<'jouerUnPasDuPlan'>): Promise<Sortie<'jouerUnPasDuPlan'>>;
13
+ export {};
@@ -0,0 +1,33 @@
1
+ // The activities of the workflow of a ticket (./deroule.ts): each plays one act of the circuit
2
+ // in a process of its own (../acte.ts); each act but `effet` gives back the effects it emitted,
3
+ // which the workflow plays one by one (`jouerUnEffet`).
4
+ import { jouer } from '../acte.js';
5
+ const ou = (e) => e.racine;
6
+ export async function ouvrirLeCircuit(e) {
7
+ return jouer('ouvrir', e, ou(e));
8
+ }
9
+ export async function preparerLaPasse(e) {
10
+ return jouer('preparer', e, ou(e));
11
+ }
12
+ export async function lireUnFait(e) {
13
+ return jouer('fait', e, ou(e));
14
+ }
15
+ export async function appliquerLesEffets(e) {
16
+ return jouer('effets', e, ou(e));
17
+ }
18
+ export async function publierLArret(e) {
19
+ return jouer('arret', e, ou(e));
20
+ }
21
+ export async function finirLeTicket(e) {
22
+ return jouer('fin', e, ou(e));
23
+ }
24
+ export async function arreterLeTicket(e) {
25
+ return jouer('arreter', e, ou(e));
26
+ }
27
+ export async function jouerUnEffet(e) {
28
+ await jouer('effet', e, ou(e));
29
+ }
30
+ export async function jouerUnPasDuPlan(e) {
31
+ return jouer('plan', e, ou(e));
32
+ }
33
+ //# sourceMappingURL=activites.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"activites.js","sourceRoot":"","sources":["../../../src/temporal/circuit/activites.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,gGAAgG;AAChG,wDAAwD;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAInC,MAAM,EAAE,GAAG,CAAC,CAAqB,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;AAI/C,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,CAA4B;IAE5B,OAAO,KAAK,CAA4B,QAAQ,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9D,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,CAA4B;IAE5B,OAAO,KAAK,CAA4B,UAAU,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AAChE,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,CAAuB;IACtD,OAAO,KAAK,CAAuB,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AACvD,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC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