@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
@@ -0,0 +1,235 @@
1
+ // The queue of integration of a project (grillhouse-4nr.8, decision Q3), `file:<racine>`, and the CI
2
+ // of a commit, as a merge queue takes one entry at a time and waits for its checks: the queue of
3
+ // scripts/integration/file.mjs, its gestures its acts (./activites.ts). The circuit of a ticket
4
+ // sends its branch at its step 5.2 (the signal ENTRER) and awaits its issue (the signal
5
+ // ISSUE_DE_LA_FILE). For each entry, in its order of arrival: main moved onto the branch, or the
6
+ // branch out of the queue, or kept; entered, the ticket closed and main pushed, then the CI of the
7
+ // commit followed to its conclusion before the next entry, so that nothing is pushed on a red
8
+ // main. An act that fails (its activity, the reading of the CI) gives the entry the issue `echec`,
9
+ // its reason, on which the circuit of the ticket stops, and the queue goes on. The CI of a commit (`ciDuCommit`, a child workflow) is read by one reading at a time, a
10
+ // durable timer between two, so that the death of the worker loses none of its wait: its run
11
+ // looked for during `rechercheMs` (2 min), then read every `pasMs` (10 s) for `attenteMs` (30 min)
12
+ // at most, counted on the workflow's clock. Past its length of history, the queue continues as new
13
+ // between two entries, with those that wait. Deterministic: it imports the workflow API and the
14
+ // contract.
15
+ import { allHandlersFinished, ChildWorkflowCancellationType, condition, continueAsNew, defineQuery, defineSignal, executeChild, getExternalWorkflowHandle, isCancellation, ParentClosePolicy, proxyActivities, setHandler, sleep, startChild, workflowInfo, } from '@temporalio/workflow';
16
+ import { WorkflowExecutionAlreadyStartedError } from '@temporalio/common';
17
+ import { idDeLaFile, ENTRER, ISSUE_DE_LA_FILE, L_ETAT_DE_LA_FILE, } from './contrat.js';
18
+ // Every act of the queue: a replay of `npm run verifier` lasts 2 h at most; the reading of the CI
19
+ // a minute. An act played again after its worker died replays its gestures without harm
20
+ // (scripts/integration/file.mjs), and gives back its comments, which the workflow writes one per
21
+ // activity, under the key of that activity (`jouerLesEffets`).
22
+ const actes = proxyActivities({
23
+ startToCloseTimeout: '2 hours',
24
+ heartbeatTimeout: '90 seconds',
25
+ retry: { initialInterval: '1 second', maximumAttempts: 4 },
26
+ });
27
+ // An effect an act of the queue gave back, one per activity, whose id the workflow sets.
28
+ const unEffet = (activityId) => proxyActivities({
29
+ startToCloseTimeout: '5 minutes',
30
+ heartbeatTimeout: '90 seconds',
31
+ retry: { initialInterval: '5 seconds', maximumAttempts: 4 },
32
+ activityId,
33
+ }).jouerUnEffetDeLaFile;
34
+ // The effects <effets> an act of the queue gave back, in the main tree <racine>, played one by one,
35
+ // each in an activity of id `<lieu>:effet:<rang>:<sorte>`, <lieu> unique in the workflow, the key
36
+ // of its writing (../acte.ts `cleDeLActivite`).
37
+ async function jouerLesEffets(racine, effets, lieu) {
38
+ for (const [i, effet] of effets.entries()) {
39
+ await unEffet(`${lieu}:effet:${i + 1}:${effet.genre}`)({ racine, effet });
40
+ }
41
+ }
42
+ const entrer = defineSignal(ENTRER);
43
+ export const issueDeLaFile = defineSignal(ISSUE_DE_LA_FILE);
44
+ const lEtat = defineQuery(L_ETAT_DE_LA_FILE);
45
+ const DELAIS = {
46
+ rechercheMs: 2 * 60_000,
47
+ attenteMs: 30 * 60_000,
48
+ pasMs: 10_000,
49
+ };
50
+ const LIMITE_D_HISTOIRE = 10_000;
51
+ // The message of the failure <e> of an activity or of a child workflow, as its act gave it.
52
+ function messageDe(e) {
53
+ let c = e;
54
+ for (let i = 0; i < 4 && c && typeof c === 'object'; i++) {
55
+ const d = c.details?.[0];
56
+ if (d?.message) {
57
+ return d.message;
58
+ }
59
+ const suite = c.cause;
60
+ if (!suite) {
61
+ break;
62
+ }
63
+ c = suite;
64
+ }
65
+ return String(c?.message ?? c);
66
+ }
67
+ /** The CI of a commit, read to its conclusion: its verdict, its run, the reason of a CI not read. */
68
+ export async function ciDuCommit(e) {
69
+ const { rechercheMs, attenteMs, pasMs } = { ...DELAIS, ...e.ci };
70
+ const debut = Date.now();
71
+ let passage = null;
72
+ let limite = Infinity;
73
+ const nonLue = (raison) => ({ verdict: 'non-lue', passage, raison });
74
+ for (;;) {
75
+ const l = await actes.lireLaCI({
76
+ racine: e.racine,
77
+ ticket: e.ticket,
78
+ sha: e.sha,
79
+ branche: e.branche,
80
+ passage,
81
+ });
82
+ if (l.etat === 'sans-ci') {
83
+ return { verdict: 'sans-ci', passage: null, raison: null };
84
+ }
85
+ if (l.etat === 'non-lue') {
86
+ return nonLue(l.raison);
87
+ }
88
+ if (l.etat === 'finie') {
89
+ const verdict = l.conclusion === 'success' ? 'verte' : 'rouge';
90
+ return { verdict, passage: l.passage, raison: null };
91
+ }
92
+ if (l.etat === 'en-cours' && passage === null) {
93
+ passage = l.passage;
94
+ limite = Date.now() + attenteMs;
95
+ }
96
+ const reste = passage === null ? debut + rechercheMs - Date.now() : limite - Date.now();
97
+ if (reste <= 0) {
98
+ return nonLue(passage === null
99
+ ? `aucun passage de la CI pour ce commit en ${Math.round(rechercheMs / 1000)} s.`
100
+ : `le passage ${passage} n'a pas fini en ${Math.round(attenteMs / 60_000)} min.`);
101
+ }
102
+ await sleep(Math.min(pasMs, reste));
103
+ }
104
+ }
105
+ // The CI of <sha> pushed to <branche> for <ticket> read as a child workflow of the caller, then
106
+ // concluded at the ticket (<relue>, a reading again on `--reprendre`): the issue for the circuit. A
107
+ // reading that fails (its act, after the push) concludes the CI not read, the failure its reason.
108
+ export async function lireEtConclureLaCI(e, id) {
109
+ let verdict;
110
+ try {
111
+ verdict = await executeChild(ciDuCommit, {
112
+ workflowId: id,
113
+ args: [{ racine: e.racine, ticket: e.ticket, sha: e.sha, branche: e.branche, ci: e.ci }],
114
+ });
115
+ }
116
+ catch (x) {
117
+ if (isCancellation(x)) {
118
+ throw x;
119
+ }
120
+ verdict = { verdict: 'non-lue', passage: null, raison: `sa lecture échoue : ${messageDe(x)}` };
121
+ }
122
+ const { effets, ...issue } = await actes.conclureLaCI({
123
+ racine: e.racine,
124
+ ticket: e.ticket,
125
+ sha: e.sha,
126
+ branche: e.branche,
127
+ relue: e.relue,
128
+ ...verdict,
129
+ });
130
+ await jouerLesEffets(e.racine, effets, `${id}:conclure`);
131
+ return issue;
132
+ }
133
+ /**
134
+ * The entry <e> sent to the queue of the project <projet> from the workflow of its circuit; the
135
+ * queue started first when none runs, as a child that outlives its parent and that its
136
+ * cancellation does not reach, so that the queue of a project is one whoever starts it.
137
+ */
138
+ export async function entrerDansLaFile(projet, e) {
139
+ const id = idDeLaFile(projet.racine);
140
+ try {
141
+ await startChild(fileDuProjet, {
142
+ workflowId: id,
143
+ args: [{ racine: projet.racine, ci: projet.ci }],
144
+ parentClosePolicy: ParentClosePolicy.ABANDON,
145
+ cancellationType: ChildWorkflowCancellationType.ABANDON,
146
+ });
147
+ }
148
+ catch (x) {
149
+ if (!(x instanceof WorkflowExecutionAlreadyStartedError)) {
150
+ throw x;
151
+ }
152
+ }
153
+ await getExternalWorkflowHandle(id).signal(entrer, e);
154
+ }
155
+ /** The queue of the project at <racine>: one entry at a time, its CI concluded before the next. */
156
+ export async function fileDuProjet(entree) {
157
+ const { racine } = entree;
158
+ const attente = [...(entree.suite?.attente ?? [])];
159
+ let enCours = null;
160
+ // An entry already in the queue, under way or waiting, is not added twice.
161
+ setHandler(entrer, e => {
162
+ if (enCours?.ticket !== e.ticket && !attente.some(a => a.ticket === e.ticket)) {
163
+ attente.push(e);
164
+ }
165
+ });
166
+ setHandler(lEtat, () => ({
167
+ enCours: enCours?.ticket ?? null,
168
+ attente: attente.map(a => a.ticket),
169
+ }));
170
+ const aContinuer = () => workflowInfo().continueAsNewSuggested || workflowInfo().historyLength >= LIMITE_D_HISTOIRE;
171
+ let n = 0;
172
+ let entrees = 0;
173
+ // The commit main moved onto for the entry under way, until it is pushed.
174
+ let avance = null;
175
+ // The entry <e> to its issue.
176
+ const traiter = async (e) => {
177
+ avance = null;
178
+ entrees += 1;
179
+ const lieu = `entree:${entrees}`;
180
+ const r = await actes.avancerMain({ racine, ticket: e.ticket, branche: e.branche });
181
+ await jouerLesEffets(racine, r.effets, `${lieu}:avancer`);
182
+ if ('issue' in r) {
183
+ return r.issue;
184
+ }
185
+ const { commit } = r.entre;
186
+ avance = commit;
187
+ const f = await actes.fermerLEntree({ racine, ticket: e.ticket, branche: e.branche, commit });
188
+ await jouerLesEffets(racine, f.effets, `${lieu}:fermer`);
189
+ if (!f.poussee) {
190
+ // The lot is on main: its closure first, then why it is not pushed.
191
+ const ferme = `intégré : ${commit.slice(0, 7)}`;
192
+ return { etat: 'ferme', raison: f.raison ? `${ferme} ; ${f.raison}` : ferme };
193
+ }
194
+ avance = null;
195
+ n += 1;
196
+ return lireEtConclureLaCI({ racine, ticket: e.ticket, sha: commit, branche: f.poussee, ci: entree.ci, relue: false }, `${workflowInfo().workflowId}:ci:${workflowInfo().runId}:${n}`);
197
+ };
198
+ // The entry <e> to its issue, an act that fails included: the queue goes on with the next
199
+ // entries, and the circuit of the ticket stops on it (`echec`, its reason), its question up. A
200
+ // closure that fails once main moved says that the local main holds the lot, not pushed.
201
+ const traiterSansTomber = async (e) => {
202
+ try {
203
+ return await traiter(e);
204
+ }
205
+ catch (x) {
206
+ if (isCancellation(x)) {
207
+ throw x;
208
+ }
209
+ const raison = `un acte de la file échoue : ${messageDe(x)}`;
210
+ return {
211
+ etat: 'echec',
212
+ raison: avance
213
+ ? `${raison}. Le main local porte le lot en ${avance.slice(0, 7)}, non poussé et le ticket non fermé ; --reprendre le repasse par la file, qui le ferme et le pousse.`
214
+ : raison,
215
+ };
216
+ }
217
+ };
218
+ for (;;) {
219
+ await condition(() => attente.length > 0 || aContinuer());
220
+ if (attente.length > 0) {
221
+ enCours = attente.shift();
222
+ const issue = await traiterSansTomber(enCours);
223
+ // A circuit gone (stopped meanwhile) has no issue to await.
224
+ await getExternalWorkflowHandle(enCours.deroule)
225
+ .signal(issueDeLaFile, issue)
226
+ .catch(() => undefined);
227
+ enCours = null;
228
+ }
229
+ if (aContinuer()) {
230
+ await condition(allHandlersFinished);
231
+ return continueAsNew({ ...entree, suite: { attente } });
232
+ }
233
+ }
234
+ }
235
+ //# sourceMappingURL=deroule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deroule.js","sourceRoot":"","sources":["../../../src/temporal/file/deroule.ts"],"names":[],"mappings":"AAAA,qGAAqG;AACrG,iGAAiG;AACjG,gGAAgG;AAChG,wFAAwF;AACxF,iGAAiG;AACjG,mGAAmG;AACnG,8FAA8F;AAC9F,mGAAmG;AACnG,uKAAuK;AACvK,6FAA6F;AAC7F,mGAAmG;AACnG,mGAAmG;AACnG,gGAAgG;AAChG,YAAY;AACZ,OAAO,EACL,mBAAmB,EACnB,6BAA6B,EAC7B,SAAS,EACT,aAAa,EACb,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,yBAAyB,EACzB,cAAc,EACd,iBAAiB,EACjB,eAAe,EACf,UAAU,EACV,KAAK,EACL,UAAU,EACV,YAAY,GACb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,oCAAoC,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EACL,UAAU,EACV,MAAM,EACN,gBAAgB,EAChB,iBAAiB,GAWlB,MAAM,cAAc,CAAC;AAEtB,kGAAkG;AAClG,wFAAwF;AACxF,iGAAiG;AACjG,+DAA+D;AAC/D,MAAM,KAAK,GAAG,eAAe,CAAoB;IAC/C,mBAAmB,EAAE,SAAS;IAC9B,gBAAgB,EAAE,YAAY;IAC9B,KAAK,EAAE,EAAE,eAAe,EAAE,UAAU,EAAE,eAAe,EAAE,CAAC,EAAE;CAC3D,CAAC,CAAC;AAEH,yFAAyF;AACzF,MAAM,OAAO,GAAG,CAAC,UAAkB,EAAE,EAAE,CACrC,eAAe,CAAoB;IACjC,mBAAmB,EAAE,WAAW;IAChC,gBAAgB,EAAE,YAAY;IAC9B,KAAK,EAAE,EAAE,eAAe,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC,EAA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AG,MAAM,iBAAiB,CAAC,OAAO,CAAC,CAAC;YAC/C,4DAA4D;YAC5D,MAAM,yBAAyB,CAAC,OAAO,CAAC,OAAO,CAAC;iBAC7C,MAAM,CAAC,aAAa,EAAE,KAAK,CAAC;iBAC5B,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;YAC1B,OAAO,GAAG,IAAI,CAAC;QACjB,CAAC;QACD,IAAI,UAAU,EAAE,EAAE,CAAC;YACjB,MAAM,SAAS,CAAC,mBAAmB,CAAC,CAAC;YACrC,OAAO,aAAa,CAAsB,EAAE,GAAG,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC;QAC/E,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -0,0 +1,120 @@
1
+ /** A platform the pin has an archive for, in the release's words. */
2
+ export type Plateforme = 'linux_amd64' | 'linux_arm64' | 'darwin_amd64' | 'darwin_arm64';
3
+ /** The version of the program `temporal` and the SHA-256 of the archive of each platform. */
4
+ export interface Epingle {
5
+ version: string;
6
+ sommes: Partial<Record<Plateforme, string>>;
7
+ }
8
+ /** The pin: temporal 1.9.1 (Server 1.32.0), its sums from the release's checksums.txt. */
9
+ export declare const EPINGLE: Epingle;
10
+ /** The unit of the server. */
11
+ export declare const UNITE_DU_SERVEUR = "grillhouse-temporal.service";
12
+ /** The unit of the worker of the machine. */
13
+ export declare const UNITE_DE_LA_MACHINE = "grillhouse-travailleur-machine.service";
14
+ /** The task queue of the worker of the machine. */
15
+ export declare const FILE_DE_LA_MACHINE = "grillhouse-machine";
16
+ /** The platform of Node's <platform> and <arch>; refused by its name when the pin has none. */
17
+ export declare function plateformeDe(platform?: string, arch?: string): Plateforme;
18
+ /** The URL of the archive of <version> for <plateforme>, in the project's releases. */
19
+ export declare const urlDeLArchive: (version: string, plateforme: Plateforme) => string;
20
+ /** Where the installation lays down: the home, the directory of the units, the project. */
21
+ export interface Lieux {
22
+ maison: string;
23
+ unites: string;
24
+ racine: string;
25
+ }
26
+ /** The places, each from the environment when absent: $HOME, its systemd/user, the cwd. */
27
+ export declare function lieuxDe({ maison, unites, racine }?: Partial<Lieux>, env?: Record<string, string | undefined>): Lieux;
28
+ /** The program of <version> and the server's database file, under the home of <lieux>. */
29
+ export declare function cheminsDe(lieux: Lieux, version: string): {
30
+ programme: string;
31
+ donnees: string;
32
+ appliquees: string;
33
+ };
34
+ /** The unit of the worker of the project at <racine>. */
35
+ export declare const uniteDuProjet: (racine: string) => string;
36
+ /** The task queue of the worker of the project at <racine>. */
37
+ export declare const fileDuProjet: (racine: string) => string;
38
+ /** The three units, in their order: the server, the worker of the project, the machine's. */
39
+ export declare const unitesDe: (racine: string) => string[];
40
+ /**
41
+ * What a worker's unit runs: Node and the frame's worker, under the PATH <chemin> and the tools of
42
+ * the project <outils> (each its variable and its path).
43
+ */
44
+ export interface Travail {
45
+ version: string;
46
+ node: string;
47
+ travailleur: string;
48
+ chemin: string;
49
+ outils: Record<string, string>;
50
+ }
51
+ /** The text of each unit of the account, by its file's name. */
52
+ export declare function textesDesUnites(lieux: Lieux, { version, node, travailleur, chemin, outils }: Travail): Record<string, string>;
53
+ /**
54
+ * The frame's worker of the project at <racine>: that of the published version it names, laid down
55
+ * by <outil> (its folder), refused when that version carries none; else its own version of the
56
+ * frame, else this one.
57
+ */
58
+ export declare function travailleurDe(racine: string, outil: (version: string) => string): string;
59
+ /**
60
+ * The PATH of each worker's unit: the folder of Node <node>, then those of the account's tools
61
+ * <trouver> finds, then the system's; a tool not found refused by its name.
62
+ */
63
+ export declare function cheminDesUnites(node: string, trouver: (nom: string) => string | null): string;
64
+ /** A call of `systemctl --user <args>`. */
65
+ export type Systemctl = (args: string[]) => {
66
+ status: number | null;
67
+ stdout: string;
68
+ stderr: string;
69
+ };
70
+ /** The account's systemctl, by the program <programme>. */
71
+ export declare const systemctlDuCompte: (programme?: string) => Systemctl;
72
+ /** The refusal of an archive whose sum differs from the pinned one. */
73
+ export declare class SommeRefusee extends Error {
74
+ readonly url: string;
75
+ readonly attendue: string;
76
+ readonly lue: string;
77
+ constructor(url: string, attendue: string, lue: string);
78
+ }
79
+ /** What laying the program down receives; each one but the places has its default. */
80
+ export interface OptionsDuProgramme {
81
+ lieux: Lieux;
82
+ epingle?: Epingle;
83
+ plateforme?: Plateforme;
84
+ obtenir?: (url: string) => Promise<Buffer>;
85
+ }
86
+ /** What the installation receives; each one but the places and systemctl has its default. */
87
+ export interface OptionsDInstallation extends OptionsDuProgramme {
88
+ systemctl: Systemctl;
89
+ node?: string;
90
+ travailleur?: string;
91
+ /**
92
+ * Lays down the published version of the frame a project names: its folder, under the cache of
93
+ * the home of the places by default.
94
+ */
95
+ outil?: (version: string) => string;
96
+ /** The path of an account's tool, or null (`trouverDansLePath`). */
97
+ trouver?: (nom: string) => string | null;
98
+ }
99
+ /** What the installation did. */
100
+ export interface RapportDInstallation {
101
+ programme: string;
102
+ /** Whether it laid the program down. */
103
+ pose: boolean;
104
+ /** The units it wrote. */
105
+ unites: string[];
106
+ /** The units systemd was told of (written now, or written before and never applied). */
107
+ appliquees: string[];
108
+ /** Whether anything changed. */
109
+ change: boolean;
110
+ }
111
+ /**
112
+ * Lays down the program `temporal` of the pin at the places <lieux>, its archive checked against
113
+ * its pinned sum, unless it lies there already; whether it laid it down.
114
+ */
115
+ export declare function poserLeProgramme(options: OptionsDuProgramme): Promise<{
116
+ programme: string;
117
+ pose: boolean;
118
+ }>;
119
+ /** Installs the account's Temporal at the places <lieux> (see the header). */
120
+ export declare function installer({ lieux, systemctl, epingle, plateforme, obtenir, node, outil, travailleur, trouver, }: OptionsDInstallation): Promise<RapportDInstallation>;