@roomi-fields/grillhouse 0.28.3 → 0.30.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 (238) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/CHANGELOG.md +739 -0
  3. package/bin/grillhouse.mjs +128 -26
  4. package/cadre/templates/projet/.github/workflows/ci.yml +2 -13
  5. package/cadre/templates/projet/CLAUDE.md +5 -1
  6. package/cadre/templates/projet/README.md +11 -11
  7. package/cadre/templates/projet/_gitignore +2 -5
  8. package/cadre/templates/projet/docs/agents/issue-tracker.md +1 -1
  9. package/cadre/templates/projet/package.json +2 -2
  10. package/charte.md +37 -4
  11. package/dist/temporal/acte.d.ts +24 -0
  12. package/dist/temporal/acte.js +139 -0
  13. package/dist/temporal/acte.js.map +1 -0
  14. package/dist/temporal/attributs.d.ts +6 -0
  15. package/dist/temporal/attributs.js +15 -0
  16. package/dist/temporal/attributs.js.map +1 -0
  17. package/dist/temporal/circuit/activites.d.ts +13 -0
  18. package/dist/temporal/circuit/activites.js +33 -0
  19. package/dist/temporal/circuit/activites.js.map +1 -0
  20. package/dist/temporal/circuit/client.d.ts +72 -0
  21. package/dist/temporal/circuit/client.js +247 -0
  22. package/dist/temporal/circuit/client.js.map +1 -0
  23. package/dist/temporal/circuit/commande.d.ts +2 -0
  24. package/dist/temporal/circuit/commande.js +238 -0
  25. package/dist/temporal/circuit/commande.js.map +1 -0
  26. package/dist/temporal/circuit/contrat.d.ts +305 -0
  27. package/dist/temporal/circuit/contrat.js +24 -0
  28. package/dist/temporal/circuit/contrat.js.map +1 -0
  29. package/dist/temporal/circuit/deroule.d.ts +3 -0
  30. package/dist/temporal/circuit/deroule.js +540 -0
  31. package/dist/temporal/circuit/deroule.js.map +1 -0
  32. package/dist/temporal/client.d.ts +47 -0
  33. package/dist/temporal/client.js +69 -0
  34. package/dist/temporal/client.js.map +1 -0
  35. package/dist/temporal/commande.d.ts +2 -0
  36. package/dist/temporal/commande.js +95 -0
  37. package/dist/temporal/commande.js.map +1 -0
  38. package/dist/temporal/deroules.d.ts +5 -0
  39. package/dist/temporal/deroules.js +10 -0
  40. package/dist/temporal/deroules.js.map +1 -0
  41. package/dist/temporal/etat.d.ts +33 -0
  42. package/dist/temporal/etat.js +59 -0
  43. package/dist/temporal/etat.js.map +1 -0
  44. package/dist/temporal/file/activites.d.ts +10 -0
  45. package/dist/temporal/file/activites.js +25 -0
  46. package/dist/temporal/file/activites.js.map +1 -0
  47. package/dist/temporal/file/client.d.ts +4 -0
  48. package/dist/temporal/file/client.js +6 -0
  49. package/dist/temporal/file/client.js.map +1 -0
  50. package/dist/temporal/file/contrat.d.ts +158 -0
  51. package/dist/temporal/file/contrat.js +14 -0
  52. package/dist/temporal/file/contrat.js.map +1 -0
  53. package/dist/temporal/file/deroule.d.ts +15 -0
  54. package/dist/temporal/file/deroule.js +235 -0
  55. package/dist/temporal/file/deroule.js.map +1 -0
  56. package/dist/temporal/installation.d.ts +124 -0
  57. package/dist/temporal/installation.js +408 -0
  58. package/dist/temporal/installation.js.map +1 -0
  59. package/dist/temporal/places/activites.d.ts +8 -0
  60. package/dist/temporal/places/activites.js +13 -0
  61. package/dist/temporal/places/activites.js.map +1 -0
  62. package/dist/temporal/places/client.d.ts +28 -0
  63. package/dist/temporal/places/client.js +64 -0
  64. package/dist/temporal/places/client.js.map +1 -0
  65. package/dist/temporal/places/contrat.d.ts +106 -0
  66. package/dist/temporal/places/contrat.js +21 -0
  67. package/dist/temporal/places/contrat.js.map +1 -0
  68. package/dist/temporal/places/deroule.d.ts +3 -0
  69. package/dist/temporal/places/deroule.js +198 -0
  70. package/dist/temporal/places/deroule.js.map +1 -0
  71. package/dist/temporal/sonde/activites.d.ts +6 -0
  72. package/dist/temporal/sonde/activites.js +52 -0
  73. package/dist/temporal/sonde/activites.js.map +1 -0
  74. package/dist/temporal/sonde/contrat.d.ts +35 -0
  75. package/dist/temporal/sonde/contrat.js +10 -0
  76. package/dist/temporal/sonde/contrat.js.map +1 -0
  77. package/dist/temporal/sonde/deroule.d.ts +3 -0
  78. package/dist/temporal/sonde/deroule.js +39 -0
  79. package/dist/temporal/sonde/deroule.js.map +1 -0
  80. package/dist/temporal/tickets/activites.d.ts +7 -0
  81. package/dist/temporal/tickets/activites.js +81 -0
  82. package/dist/temporal/tickets/activites.js.map +1 -0
  83. package/dist/temporal/tickets/client.d.ts +10 -0
  84. package/dist/temporal/tickets/client.js +31 -0
  85. package/dist/temporal/tickets/client.js.map +1 -0
  86. package/dist/temporal/tickets/contrat.d.ts +56 -0
  87. package/dist/temporal/tickets/contrat.js +13 -0
  88. package/dist/temporal/tickets/contrat.js.map +1 -0
  89. package/dist/temporal/tickets/deroule.d.ts +3 -0
  90. package/dist/temporal/tickets/deroule.js +94 -0
  91. package/dist/temporal/tickets/deroule.js.map +1 -0
  92. package/dist/temporal/travailleur.d.ts +2 -0
  93. package/dist/temporal/travailleur.js +69 -0
  94. package/dist/temporal/travailleur.js.map +1 -0
  95. package/docs/ARCHITECTURE.md +813 -53
  96. package/docs/CADRE.md +17 -0
  97. package/docs/INTERFACE.md +161 -30
  98. package/hooks/crochet.mjs +19 -2
  99. package/hooks/hooks.json +11 -0
  100. package/package.json +16 -4
  101. package/scripts/activites.mjs +2182 -0
  102. package/scripts/aiguillage.d.mts +37 -0
  103. package/scripts/aiguillage.mjs +328 -0
  104. package/scripts/avancement.mjs +159 -64
  105. package/scripts/bilan.mjs +37 -19
  106. package/scripts/cadre.mjs +11 -2
  107. package/scripts/circuit.mjs +888 -3654
  108. package/scripts/circuits-cles.d.mts +4 -0
  109. package/scripts/circuits-cles.mjs +21 -0
  110. package/scripts/circuits-du-serveur.mjs +105 -0
  111. package/scripts/codes-de-sortie.mjs +9 -0
  112. package/scripts/commandes-composees.mjs +45 -41
  113. package/scripts/commandes-du-path.d.mts +7 -0
  114. package/scripts/commandes-du-path.mjs +25 -0
  115. package/scripts/composition-des-langages.mjs +30 -11
  116. package/scripts/conformite.mjs +19 -10
  117. package/scripts/copies-finies.mjs +188 -42
  118. package/scripts/depart-du-ticket.d.mts +53 -0
  119. package/scripts/depart-du-ticket.mjs +124 -0
  120. package/scripts/dependances-internes.mjs +115 -0
  121. package/scripts/dernier-vert.mjs +7 -15
  122. package/scripts/donnees-cles.mjs +228 -0
  123. package/scripts/droits.mjs +11 -1
  124. package/scripts/effets.mjs +352 -0
  125. package/scripts/enveloppe/enveloppe.mjs +119 -8
  126. package/scripts/enveloppe/lancer.sh +27 -32
  127. package/scripts/enveloppe/paquets-du-plan.mjs +2 -2
  128. package/scripts/enveloppe/travail-de-la-copie.mjs +99 -12
  129. package/scripts/etapes.mjs +6 -3
  130. package/scripts/faits-du-circuit.mjs +493 -0
  131. package/scripts/file-des-tickets.d.mts +21 -0
  132. package/scripts/file-des-tickets.mjs +58 -0
  133. package/scripts/flux-des-paquets.mjs +187 -0
  134. package/scripts/fusion-du-changelog.mjs +0 -1
  135. package/scripts/gardes-du-cadre.mjs +12 -2
  136. package/scripts/grillhouse-maj.mjs +16 -7
  137. package/scripts/integration/file.mjs +477 -422
  138. package/scripts/integration/integrer.mjs +20 -22
  139. package/scripts/integration/rejeu.mjs +19 -4
  140. package/scripts/jointure.d.ts +168 -28
  141. package/scripts/langages/cargo/commandes.mjs +426 -119
  142. package/scripts/langages/cargo/composants.mjs +187 -3
  143. package/scripts/langages/cargo/exemples.mjs +75 -17
  144. package/scripts/langages/cargo/index.mjs +32 -13
  145. package/scripts/langages/cargo/migrations/0.28.4-tailles-des-tests.mjs +35 -0
  146. package/scripts/langages/cargo/sccache.mjs +62 -16
  147. package/scripts/langages/cargo/squelette.mjs +72 -3
  148. package/scripts/langages/cargo/tailles-des-tests.mjs +195 -0
  149. package/scripts/langages/cargo/tests-de-head.mjs +159 -0
  150. package/scripts/langages/python/commandes.mjs +232 -79
  151. package/scripts/langages/python/composants.mjs +65 -3
  152. package/scripts/langages/python/exemples.mjs +21 -12
  153. package/scripts/langages/python/index.mjs +25 -5
  154. package/scripts/langages/python/lot.mjs +1 -36
  155. package/scripts/langages/python/squelette.mjs +119 -17
  156. package/scripts/langages/typescript/construire.mjs +6 -163
  157. package/scripts/langages/typescript/exemples.mjs +19 -11
  158. package/scripts/langages/typescript/frontieres.mjs +1 -1
  159. package/scripts/langages/typescript/index.mjs +48 -63
  160. package/scripts/langages/typescript/interfaces-contre-code.mjs +4 -4
  161. package/scripts/langages/typescript/migrations/0.30.0-prefixe-des-tickets.mjs +63 -0
  162. package/scripts/langages/typescript/migrations/0.30.0-tailles-des-outils-lourds.mjs +31 -0
  163. package/scripts/langages/typescript/migrations/0.30.0-titres-nommant-un-ticket.mjs +40 -0
  164. package/scripts/langages/typescript/mise-a-jour.mjs +1 -2
  165. package/scripts/langages/typescript/regle-des-tests.mjs +13 -0
  166. package/scripts/langages/typescript/squelette.mjs +18 -2
  167. package/scripts/langages/typescript/tailles-des-tests.mjs +40 -9
  168. package/scripts/langages/typescript/tests-de-nuit.mjs +44 -21
  169. package/scripts/langages/typescript/tests.mjs +17 -8
  170. package/scripts/langages/typescript/titres-de-tests.mjs +297 -0
  171. package/scripts/langages/typescript/turbo-des-paquets.mjs +183 -38
  172. package/scripts/langages/typescript/verdict.mjs +1 -1
  173. package/scripts/langages/typescript/verifier.mjs +110 -296
  174. package/scripts/langages/typescript/vitest-config/base.mjs +30 -10
  175. package/scripts/langages/typescript/vitest-config/bornes.mjs +13 -0
  176. package/scripts/langages/typescript/vitest-config/cibles.mjs +123 -62
  177. package/scripts/langages/typescript/vitest-config/delais.mjs +54 -0
  178. package/scripts/langages/typescript/vitest-config/delais.setup.mjs +11 -0
  179. package/scripts/langages/typescript/vitest-config/duree.classement.mjs +100 -0
  180. package/scripts/langages/typescript/vitest-config/duree.reporter.mjs +56 -64
  181. package/scripts/langages/typescript/vitest-config/machine.setup.mjs +7 -2
  182. package/scripts/langages/typescript/vitest-config/mesure.mjs +3 -2
  183. package/scripts/langages/typescript/vitest.nuit.config.mjs +22 -13
  184. package/scripts/lecture-unique.mjs +51 -0
  185. package/scripts/mesure/pression.mjs +11 -9
  186. package/scripts/mesure-de-la-machine.d.mts +21 -0
  187. package/scripts/mesure-de-la-machine.mjs +76 -0
  188. package/scripts/migrations/0.23.2-copies-du-cadre.mjs +8 -2
  189. package/scripts/migrations/0.30.0-ci-appelle-la-verification.mjs +120 -0
  190. package/scripts/migrations/0.31.0-paquets-dans-le-graphe.mjs +81 -0
  191. package/scripts/migrations.mjs +5 -0
  192. package/scripts/nuit.sh +29 -15
  193. package/scripts/outil.mjs +72 -0
  194. package/scripts/outils-cles.d.mts +24 -0
  195. package/scripts/outils-cles.mjs +0 -1
  196. package/scripts/paquet-npm.mjs +147 -0
  197. package/scripts/paquet.mjs +112 -14
  198. package/scripts/paquets.mjs +34 -6
  199. package/scripts/passe-de-la-machine.mjs +66 -0
  200. package/scripts/places-de-la-machine.mjs +360 -0
  201. package/scripts/places-du-serveur.mjs +170 -0
  202. package/scripts/prefixe-des-tickets.mjs +68 -0
  203. package/scripts/preparation.mjs +10 -3
  204. package/scripts/registre.mjs +3 -2
  205. package/scripts/regles-des-places.d.mts +36 -0
  206. package/scripts/regles-des-places.mjs +70 -0
  207. package/scripts/reponses-du-circuit.d.mts +6 -0
  208. package/scripts/reponses-du-circuit.mjs +28 -0
  209. package/scripts/resultats.mjs +29 -14
  210. package/scripts/retirer-les-copies-finies.mjs +25 -0
  211. package/scripts/sans-reponse.d.mts +4 -0
  212. package/scripts/sans-reponse.mjs +13 -0
  213. package/scripts/seances.mjs +918 -0
  214. package/scripts/services-du-noyau.mjs +28 -11
  215. package/scripts/session-start.sh +10 -1
  216. package/scripts/sortie.mjs +23 -4
  217. package/scripts/sources.mjs +3 -3
  218. package/scripts/sous-commandes.mjs +39 -9
  219. package/scripts/style-a-l-ecriture.mjs +229 -0
  220. package/scripts/superviseur.mjs +382 -16
  221. package/scripts/tableau.mjs +329 -130
  222. package/scripts/taches-du-graphe.mjs +328 -0
  223. package/scripts/ticket-du-circuit.mjs +206 -0
  224. package/scripts/transitions.d.mts +148 -0
  225. package/scripts/transitions.mjs +901 -0
  226. package/scripts/verrou-de-fichier.mjs +2 -2
  227. package/scripts/verrou-de-machine.mjs +322 -62
  228. package/skills/developpeur/SKILL.md +11 -3
  229. package/skills/explorateur/SKILL.md +2 -1
  230. package/skills/pitmaster/SKILL.md +62 -28
  231. package/skills/pitmaster/references/consigne-agent.md +5 -1
  232. package/skills/release/SKILL.md +3 -3
  233. package/skills/relecteur/SKILL.md +22 -8
  234. package/skills/testwriter/SKILL.md +47 -39
  235. package/scripts/demon.mjs +0 -138
  236. package/scripts/integration/file-attente.mjs +0 -61
  237. package/scripts/langages/cargo/touches.mjs +0 -93
  238. package/scripts/langages/typescript/script-des-tests.mjs +0 -6
@@ -0,0 +1,540 @@
1
+ // The workflow of a ticket (grillhouse-4nr.6, decision Q3), `circuit:<racine>:<ticket>`: the
2
+ // circuit of scripts/circuit.mjs, its decisions the pure ones of scripts/transitions.mjs, each
3
+ // act an activity (./activites.ts: the opening and the plan, the preparation of a pass, each fact
4
+ // a decision asks for, the effects, the stops, the end). A stop does not end the workflow: it
5
+ // writes its question, then the workflow waits for the supervisor's answer, durably, as a pipeline
6
+ // of GitLab waits on a manual job: the updates REPRENDRE, DEPUIS and ETENDRE, whose validators
7
+ // refuse an answer out of a wait, or a second answer to the same question, without writing it in
8
+ // the history, and the signal ARRETER. ARRETER while a step plays cancels its activity, its session
9
+ // killed; while a stop is written, it stops the circuit once the stop is written. An act that
10
+ // fails is the stop « inattendu » at the step it fell, its question awaited; when the act of the
11
+ // stop fails too, the stop stands in the memo alone (scripts/transitions.mjs `arretSansActe`). A « a-repasser » (75)
12
+ // plays again by itself after `repasserMs` (10 min), `repassesMax` times (6) in a row, then its
13
+ // question goes up (decision D4). The effects a step decided before a fact that fails are written
14
+ // before its stop (scripts/transitions.mjs gives them with each fact it asks for). The step and the
15
+ // question are a search attribute and the memo, which the board reads from the server alone; past
16
+ // its length of history, the workflow continues as new at a step's start. At its step 5.2, the
17
+ // fact `file` is the queue of the project's (../file/deroule.ts, grillhouse-4nr.8): a lot to enter
18
+ // goes into the queue (the signal ENTRER, the queue started when none runs), whose issue the workflow awaits; a lot on main whose
19
+ // ticket a red CI reopened has its CI read again (the child workflow of the CI of its commit);
20
+ // a ticket closed is the queue's end. Deterministic: it imports the workflow API, the search
21
+ // attributes, the contracts, the workflows of the queue and the pure decisions.
22
+ import { ActivityCancellationType, ApplicationFailure, allHandlersFinished, CancellationScope, condition, defineQuery, defineSignal, defineUpdate, isCancellation, makeContinueAsNewFunc, proxyActivities, setHandler, upsertMemo, upsertSearchAttributes, workflowInfo, } from '@temporalio/workflow';
23
+ import { arretSansActe, effetsAJouer, pasDuPlan, transition, } from '../../../scripts/transitions.mjs';
24
+ import { ATTRIBUT_ETAPE, ATTRIBUT_TICKET } from '../attributs.js';
25
+ import { entrerDansLaFile, issueDeLaFile, lireEtConclureLaCI } from '../file/deroule.js';
26
+ import { AGENTS_DU_LOT, ARRETER, DEPUIS, ETENDRE, L_ETAT, REFUS_DU_VALIDATEUR, REPRENDRE, } from './contrat.js';
27
+ // Every act: a session lasts 4 h at most; its heartbeat every 5 s, awaited 90 s, so that a dead
28
+ // worker's attempt is played again by the next worker; an act that fails is not tried again.
29
+ const actes = proxyActivities({
30
+ startToCloseTimeout: '6 hours',
31
+ heartbeatTimeout: '90 seconds',
32
+ retry: { initialInterval: '5 seconds', maximumAttempts: 4 },
33
+ cancellationType: ActivityCancellationType.WAIT_CANCELLATION_COMPLETED,
34
+ });
35
+ // An effect an act gave back, one per activity (docs/ARCHITECTURE.md, « une activité, un effet,
36
+ // une clé »): a writing lasts a minute at most, tried again as an activity is.
37
+ const OPTIONS_D_UN_EFFET = {
38
+ startToCloseTimeout: '5 minutes',
39
+ heartbeatTimeout: '90 seconds',
40
+ retry: { initialInterval: '5 seconds', maximumAttempts: 4 },
41
+ };
42
+ // The activity of the effect of id <activityId>, which the workflow sets.
43
+ const unEffet = (activityId) => proxyActivities({ ...OPTIONS_D_UN_EFFET, activityId }).jouerUnEffet;
44
+ // The acts of the queue the circuit plays itself at its step 5.2.
45
+ const actesDeLaFile = proxyActivities({
46
+ startToCloseTimeout: '1 minute',
47
+ retry: { initialInterval: '1 second', maximumAttempts: 4 },
48
+ });
49
+ // Each answer carries the supervisor's session that gives it (`superviseur`, undefined: the
50
+ // session of before stays), which the acts of the run receive from then on.
51
+ const reprendre = defineUpdate(REPRENDRE);
52
+ const arreter = defineSignal(ARRETER);
53
+ const depuis = defineUpdate(DEPUIS);
54
+ const etendre = defineUpdate(ETENDRE);
55
+ const lEtat = defineQuery(L_ETAT);
56
+ const REPASSER_MS = 10 * 60_000;
57
+ const REPASSES_MAX = 6;
58
+ const LIMITE_D_HISTOIRE = 10_000;
59
+ // The message and the stack of the failure <e> of an activity.
60
+ function inattendu(e) {
61
+ const cause = e.cause;
62
+ const d = (cause?.details?.[0] ?? {});
63
+ const message = d.message ?? cause?.message ?? String(e?.message ?? e);
64
+ return { inattendu: { message, pile: d.pile ?? null } };
65
+ }
66
+ // What the board shows of the state <e> a run wrote (the effect `etat`), published in the memo
67
+ // (./client.ts `lireLesCircuits` reads it): its step, its attempt, its stop and the first line of
68
+ // its report, the object of its questioning, its loops, the start of its step led.
69
+ function resumeDeLEtat(e) {
70
+ const x = (e ?? {});
71
+ const rapport = typeof x.rapport === 'string' ? x.rapport : '';
72
+ const objet = x.questionnement?.objet;
73
+ return {
74
+ etape: typeof x.etape === 'string' ? x.etape : null,
75
+ tentative: typeof x.tentative === 'number' ? x.tentative : null,
76
+ finale: x.finale === true,
77
+ code: typeof x.code === 'number' ? x.code : null,
78
+ raison: typeof x.raison === 'string' ? x.raison : null,
79
+ rapport: rapport
80
+ .split('\n')
81
+ .map(l => l.trim())
82
+ .find(Boolean) ?? null,
83
+ questionnement: typeof objet === 'string' ? objet : null,
84
+ boucles: x.boucles && typeof x.boucles === 'object' ? x.boucles : {},
85
+ mene: typeof x.mene === 'string' ? x.mene : null,
86
+ };
87
+ }
88
+ // The name of the stop <a>.
89
+ const nomDe = (a) => a.leve?.nom ?? (a.inattendu ? 'inattendu' : (a.nom ?? null));
90
+ /** The circuit of a ticket, from its plan to its integration or to the supervisor's stop. */
91
+ export async function circuitDuTicket(entree) {
92
+ const repasserMs = entree.repasserMs ?? REPASSER_MS;
93
+ const repassesMax = entree.repassesMax ?? REPASSES_MAX;
94
+ let ouverture = entree.suite?.ouverture ?? null;
95
+ let repasses = entree.suite?.repasses ?? 0;
96
+ // The session of the supervisor who put the ticket in the queue, then of the last who answered.
97
+ let superviseur = entree.superviseur ?? null;
98
+ // A circuit stopped on the supervisor's word, its workflow ended, reopens on his answer.
99
+ let reprend = entree.suite?.reprend ??
100
+ (entree.reprise?.genre === 'reprendre' || entree.reprise?.genre === 'etendre');
101
+ // The supervisor's answer awaited (`attente`), and the answer once given.
102
+ let attente = false;
103
+ let reponse = null;
104
+ let question = null;
105
+ // The stop the run resumes from, and the answer it opens on.
106
+ let arrete = entree.etatDArret ?? null;
107
+ // The state the circuit wrote last, which the workflow holds and gives back at a stop on the
108
+ // supervisor's word: the state a stopped circuit reopens from.
109
+ let etatEcrit = entree.suite?.etat ?? entree.etatDArret ?? null;
110
+ let ouvrirSur = entree.reprise ?? null;
111
+ let memoire = ouverture?.memoire ?? {};
112
+ let etat = ouverture?.debut ?? {
113
+ etape: 'plan',
114
+ tentative: 1,
115
+ rapport: null,
116
+ finale: false,
117
+ };
118
+ // ARRETER while a step plays: its motive, and the scope it cancels.
119
+ let arretDemande = null;
120
+ let enCours = null;
121
+ const repondre = (r) => {
122
+ reponse = r;
123
+ };
124
+ // The refusal of an answer by a validator, under its type (REFUS_DU_VALIDATEUR), which the
125
+ // client names apart from any other failure of an update.
126
+ const refuser = (message) => {
127
+ throw ApplicationFailure.nonRetryable(message, REFUS_DU_VALIDATEUR);
128
+ };
129
+ // An answer is taken only while a question waits for one, and once: a second answer of the
130
+ // same wait, in the same activation, is refused.
131
+ const uneQuestionAttend = () => {
132
+ if (!attente) {
133
+ refuser('aucune question n’attend de réponse : le circuit tourne.');
134
+ }
135
+ if (reponse !== null) {
136
+ refuser('la question a déjà sa réponse : le circuit reprend.');
137
+ }
138
+ };
139
+ // What became of the answer of the wait: the circuit resumes on it, or a --arreter of the same
140
+ // turn stops it. An answer says it once the turn has decided, so that it says the true one.
141
+ let issueDeLaReponse = null;
142
+ const laReponse = () => issueDeLaReponse;
143
+ const repondreEtDire = async (r, dit) => {
144
+ issueDeLaReponse = null;
145
+ repondre(r);
146
+ await condition(() => issueDeLaReponse !== null);
147
+ return laReponse() === 'arret' ? 'arrêté : un --arreter du même tour arrête le circuit' : dit;
148
+ };
149
+ // The session of the supervisor who answers, from then on the acts'.
150
+ const parLaSeance = (s) => {
151
+ if (s !== undefined) {
152
+ superviseur = s;
153
+ }
154
+ };
155
+ setHandler(reprendre, (contexte, seance) => {
156
+ parLaSeance(seance);
157
+ return repondreEtDire({ genre: 'reprendre', contexte }, 'repris');
158
+ }, {
159
+ validator: (_contexte, _seance) => uneQuestionAttend(),
160
+ });
161
+ // ARRETER answers a question that waits; anywhere else (a step that plays, a stop being written,
162
+ // an answer already given) it is kept, the step cancelled, and the circuit stops at the first
163
+ // point it reaches.
164
+ setHandler(arreter, contexte => {
165
+ if (attente && reponse === null) {
166
+ repondre({ genre: 'arreter', contexte });
167
+ }
168
+ else if (!arretDemande) {
169
+ arretDemande = { contexte };
170
+ enCours?.cancel();
171
+ }
172
+ });
173
+ setHandler(depuis, ({ superviseur: seance, ...r }) => {
174
+ parLaSeance(seance);
175
+ return repondreEtDire({ genre: 'depuis', ...r }, `depuis ${r.role}`);
176
+ }, {
177
+ validator: (r) => {
178
+ uneQuestionAttend();
179
+ if (!AGENTS_DU_LOT.includes(r?.role)) {
180
+ refuser(`--depuis attend une étape du ticket : ${AGENTS_DU_LOT.join(' ou ')}.`);
181
+ }
182
+ },
183
+ });
184
+ setHandler(etendre, ({ superviseur: seance, ...r }) => {
185
+ parLaSeance(seance);
186
+ return repondreEtDire({ genre: 'etendre', ...r }, `étendu à ${r.paquets.join(', ')}`);
187
+ }, {
188
+ validator: (r) => {
189
+ uneQuestionAttend();
190
+ if (!Array.isArray(r?.paquets) || !r.paquets.length || r.paquets.some((p) => !p)) {
191
+ refuser('--etendre attend les paquets que le plan gagne.');
192
+ }
193
+ },
194
+ });
195
+ // The issue of the entry the queue gives back.
196
+ let issue = null;
197
+ setHandler(issueDeLaFile, i => {
198
+ issue = i;
199
+ });
200
+ let relectures = 0;
201
+ // The fact `file` of the step 5.2: where the lot stands, then the queue, or its CI read again.
202
+ const laFile = async () => {
203
+ const { racine, ticket } = entree;
204
+ const lot = await actesDeLaFile.situerLeLot({ racine, ticket });
205
+ if (lot.statut === 'closed') {
206
+ return { etat: 'ferme', raison: lot.raison ?? 'ticket fermé' };
207
+ }
208
+ // A lot on main whose place on origin is unknown (origin does not answer) does not go back to
209
+ // the queue: the reason goes up, the stop « inattendu ».
210
+ if (!lot.aEntrer && lot.commit && lot.branche && lot.surOrigin === 'inconnu') {
211
+ throw new Error(`la place du lot ${lot.commit.slice(0, 7)} sur origin ne se lit pas (${lot.raisonOrigin ?? 'sans raison'}) : il ne retourne pas en file.`);
212
+ }
213
+ // A lot on main and on origin: its CI read again. A lot on the local main alone (its closure
214
+ // failed before its push) goes through the queue again, which closes and pushes it.
215
+ if (!lot.aEntrer && lot.commit && (lot.surOrigin === 'oui' || !lot.branche)) {
216
+ if (!lot.branche) {
217
+ return {
218
+ etat: 'rouvert',
219
+ raison: 'grillhouse.poussee.commit ne nomme pas une branche : la CI ne se relit pas.',
220
+ };
221
+ }
222
+ relectures += 1;
223
+ return lireEtConclureLaCI({ racine, ticket, sha: lot.commit, branche: lot.branche, ci: entree.ci, relue: true }, `${workflowInfo().workflowId}:ci:${workflowInfo().runId}:${relectures}`);
224
+ }
225
+ issue = null;
226
+ await entrerDansLaFile({ racine, ci: entree.ci }, { ticket, branche: `agent/${ticket}`, deroule: workflowInfo().workflowId });
227
+ await condition(() => issue !== null);
228
+ const i = issue;
229
+ // An act of the queue that failed: the stop « inattendu » of the step, its reason its message.
230
+ if (i.etat === 'echec') {
231
+ throw new Error(i.raison);
232
+ }
233
+ return i;
234
+ };
235
+ setHandler(lEtat, () => ({
236
+ etape: etat.etape,
237
+ tentative: etat.tentative,
238
+ attente,
239
+ question,
240
+ repasses,
241
+ ecrit: etatEcrit,
242
+ }));
243
+ // The step <etape> and the question <q> published, for the board and `workflow list`; each
244
+ // question its rank in the run (`numero`), which tells a new question from one already gone up.
245
+ let numero = 0;
246
+ const publier = (etape, q) => {
247
+ const attributs = [{ key: ATTRIBUT_ETAPE, value: etape }];
248
+ if (workflowInfo().typedSearchAttributes.get(ATTRIBUT_TICKET) !== entree.ticket) {
249
+ attributs.push({ key: ATTRIBUT_TICKET, value: entree.ticket });
250
+ }
251
+ upsertSearchAttributes(attributs);
252
+ if (q) {
253
+ numero += 1;
254
+ }
255
+ upsertMemo({ ticket: entree.ticket, etape, question: q, numero });
256
+ };
257
+ const lieu = () => ({
258
+ racine: entree.racine,
259
+ ticket: entree.ticket,
260
+ memoire,
261
+ superviseur,
262
+ });
263
+ // The effects an act gave back, played one by one, each in an activity whose id the workflow
264
+ // sets (its rank in the run, then its sort), the key of its writing (../acte.ts
265
+ // `cleDeLActivite`); consecutive states are one (`effetsAJouer`). The state is no writing out of
266
+ // the workflow: it holds it (`etatEcrit`), and the memo holds it whole (`ecrit`), which
267
+ // `--reprendre` reopens from when the workflow ends without its issue (./client.ts), and its
268
+ // summary, which the board reads (`resumeDeLEtat`). ARRETER does not cut them: they are written to their end, out of the scope
269
+ // it cancels, and the run stops at its next act.
270
+ let effetsJoues = 0;
271
+ const jouerLesEffets = (effets) => CancellationScope.nonCancellable(async () => {
272
+ for (const effet of effetsAJouer(effets ?? [])) {
273
+ if (effet.genre === 'etat') {
274
+ etatEcrit = effet.etat;
275
+ upsertMemo({ etat: resumeDeLEtat(effet.etat), ecrit: effet.etat });
276
+ continue;
277
+ }
278
+ effetsJoues += 1;
279
+ await unEffet(`effet:${effetsJoues}:${effet.genre}`)({
280
+ racine: entree.racine,
281
+ ticket: entree.ticket,
282
+ effet,
283
+ });
284
+ }
285
+ });
286
+ const limite = entree.limiteDHistoire ?? LIMITE_D_HISTOIRE;
287
+ const aContinuer = () => workflowInfo().continueAsNewSuggested || workflowInfo().historyLength >= limite;
288
+ // The steps of the run, from its opening to its end or its stop. An act that fails anywhere (the
289
+ // opening, the preparation of a pass, a fact, the effects, the end) is the stop « inattendu » at
290
+ // the step the run had reached, its answer awaited.
291
+ const courir = async () => {
292
+ // The state the step wrote (its loops counted) and the step the circuit leads, which a stop keeps.
293
+ let ici = { etat, menee: null };
294
+ try {
295
+ return await lesEtapes(e => (ici = e));
296
+ }
297
+ catch (e) {
298
+ if (isCancellation(e)) {
299
+ throw e;
300
+ }
301
+ return { arreter: inattendu(e), ...ici };
302
+ }
303
+ };
304
+ const lesEtapes = async (marquer) => {
305
+ if (!ouverture) {
306
+ publier('ouverture', null);
307
+ let o = await actes.ouvrirLeCircuit({ ...lieu(), reponse: ouvrirSur, arrete });
308
+ await jouerLesEffets(o.effets);
309
+ // The plan still to write: each of its steps an activity, the next decided by `pasDuPlan`.
310
+ while ('plan' in o) {
311
+ publier('plan', null);
312
+ const plan = o.plan;
313
+ memoire = plan.memoire;
314
+ o = await actes.jouerUnPasDuPlan({
315
+ ...lieu(),
316
+ pas: pasDuPlan(plan.etat),
317
+ plan,
318
+ reponse: ouvrirSur,
319
+ });
320
+ await jouerLesEffets(o.effets);
321
+ }
322
+ if ('arret' in o) {
323
+ return { arret: o.arret };
324
+ }
325
+ ouverture = o.ouverture;
326
+ memoire = ouverture.memoire;
327
+ etat = ouverture.debut;
328
+ }
329
+ const { ticket } = ouverture;
330
+ for (;;) {
331
+ if (aContinuer()) {
332
+ return { continuer: { debut: etat, memoire, ticket } };
333
+ }
334
+ publier(etat.etape, null);
335
+ marquer({ etat, menee: null });
336
+ const pointe = await actes.preparerLaPasse({
337
+ ...lieu(),
338
+ etape: etat,
339
+ paquets: ticket.paquets,
340
+ });
341
+ await jouerLesEffets(pointe.effets);
342
+ // The state the step writes (its loops counted), which its stop keeps.
343
+ const ecrit = pointe.etat;
344
+ const { menee } = pointe;
345
+ marquer({ etat: ecrit, menee });
346
+ const finir = async (effets, fin) => {
347
+ if (effets?.length || fin) {
348
+ const r = await actes.appliquerLesEffets({
349
+ ...lieu(),
350
+ effets: effets ?? [],
351
+ menee: fin,
352
+ paquets: ticket.paquets,
353
+ });
354
+ await jouerLesEffets(r.effets);
355
+ }
356
+ };
357
+ if (pointe.arret) {
358
+ return { arreter: pointe.arret, etat: ecrit, menee };
359
+ }
360
+ memoire = { ...memoire, ...pointe.memoire };
361
+ const faits = {};
362
+ let d;
363
+ for (;;) {
364
+ d = transition({ etat, memoire, ticket, reprend, faits });
365
+ if (!d.besoin) {
366
+ break;
367
+ }
368
+ const { fait, ...parametres } = d.besoin;
369
+ // What the step decided before this fact is written before a stop the fact raises.
370
+ const avantLArret = async (arret) => {
371
+ await finir(d.effets, null);
372
+ memoire = { ...memoire, ...d.memoire };
373
+ return { arreter: arret, etat: ecrit, menee };
374
+ };
375
+ let r;
376
+ try {
377
+ r =
378
+ fait === 'file'
379
+ ? { valeur: await laFile(), memoire: {}, effets: [] }
380
+ : await actes.lireUnFait({
381
+ ...lieu(),
382
+ fait,
383
+ parametres,
384
+ faits,
385
+ sorte: ticket.sorte,
386
+ paquets: ticket.paquets,
387
+ });
388
+ await jouerLesEffets(r.effets);
389
+ }
390
+ catch (e) {
391
+ if (isCancellation(e)) {
392
+ throw e;
393
+ }
394
+ return avantLArret(inattendu(e));
395
+ }
396
+ memoire = { ...memoire, ...r.memoire };
397
+ if (r.leve) {
398
+ return avantLArret({ leve: r.leve });
399
+ }
400
+ faits[fait] = r.valeur;
401
+ }
402
+ reprend = false;
403
+ memoire = { ...memoire, ...d.memoire };
404
+ const arret = d.usage
405
+ ? { inattendu: { message: d.usage, pile: null } }
406
+ : (d.arret ?? null);
407
+ // A stop ends its step once written; any other decision ends it with its effects.
408
+ await finir(d.effets, arret ? null : menee);
409
+ if (arret) {
410
+ return { arreter: arret, etat: ecrit, menee };
411
+ }
412
+ if (d.fin) {
413
+ const f = await actes.finirLeTicket({ ...lieu(), etat, paquets: ticket.paquets });
414
+ await jouerLesEffets(f.effets);
415
+ return { fin: true };
416
+ }
417
+ etat = d.suivant;
418
+ repasses = 0;
419
+ ouverture = { debut: etat, memoire, ticket };
420
+ }
421
+ };
422
+ // The stop <issue> written: its act, or, when the act itself fails, the stop « inattendu » in
423
+ // the memo alone (scripts/transitions.mjs `arretSansActe`); `rejoue`, a « a-repasser » played again.
424
+ const ecrire = async (issue) => {
425
+ if ('arret' in issue) {
426
+ return { publie: issue.arret, rejoue: false };
427
+ }
428
+ const rejoue = nomDe(issue.arreter) === 'a-repasser' && repasses < repassesMax;
429
+ try {
430
+ const publie = await actes.publierLArret({
431
+ ...lieu(),
432
+ arret: issue.arreter,
433
+ etat: issue.etat,
434
+ monter: !rejoue,
435
+ paquets: ouverture?.ticket.paquets ?? null,
436
+ menee: issue.menee,
437
+ });
438
+ await jouerLesEffets(publie.effets);
439
+ return { publie, rejoue };
440
+ }
441
+ catch (e) {
442
+ const { message } = inattendu(e).inattendu;
443
+ return {
444
+ publie: arretSansActe(issue.etat, message, `le déroulé ${workflowInfo().workflowId}`),
445
+ rejoue: false,
446
+ };
447
+ }
448
+ };
449
+ for (;;) {
450
+ let issue;
451
+ try {
452
+ enCours = new CancellationScope();
453
+ issue = await enCours.run(courir);
454
+ }
455
+ catch (e) {
456
+ if (!arretDemande || !isCancellation(e)) {
457
+ throw e;
458
+ }
459
+ issue = { arreter: { arrete: true }, etat, menee: null };
460
+ }
461
+ finally {
462
+ enCours = null;
463
+ }
464
+ if ('continuer' in issue) {
465
+ await condition(allHandlersFinished);
466
+ // The memo goes to the next run, which Continue-As-New does not carry by itself: the board
467
+ // keeps the step it shows until the next state written.
468
+ return makeContinueAsNewFunc({ memo: workflowInfo().memo })({
469
+ ...entree,
470
+ superviseur,
471
+ suite: { ouverture: issue.continuer, repasses, reprend, etat: etatEcrit },
472
+ });
473
+ }
474
+ if ('fin' in issue) {
475
+ publier('integre', null);
476
+ return { code: 0, raison: 'integre', ...(etatEcrit ? { etat: etatEcrit } : {}) };
477
+ }
478
+ // The stop, until the supervisor's answer resumes the run: the supervisor's word ends the
479
+ // circuit; any other stop is written, then played again (75) or its question awaited.
480
+ let suite = issue;
481
+ for (;;) {
482
+ // Set by the signal's handler, which the compiler does not follow.
483
+ const demande = arretDemande;
484
+ const a = 'arret' in suite ? suite.arret.etat : suite.etat;
485
+ if (demande) {
486
+ arretDemande = null;
487
+ try {
488
+ const r = await actes.arreterLeTicket({
489
+ ...lieu(),
490
+ etat: a,
491
+ contexte: demande.contexte,
492
+ });
493
+ await jouerLesEffets(r.effets);
494
+ publier('arrete', null);
495
+ return { code: 0, raison: 'arrete', ...(etatEcrit ? { etat: etatEcrit } : {}) };
496
+ }
497
+ catch (e) {
498
+ suite = { arreter: inattendu(e), etat: a, menee: null };
499
+ }
500
+ }
501
+ const { publie, rejoue } = await ecrire(suite);
502
+ suite = { arret: publie };
503
+ // ARRETER while the stop was written.
504
+ if (arretDemande) {
505
+ continue;
506
+ }
507
+ question = publie.question;
508
+ reponse = null;
509
+ attente = true;
510
+ publier(rejoue ? 'a-repasser' : 'question', question);
511
+ if (rejoue) {
512
+ // A « a-repasser » plays again after its sleep, unless the supervisor answers before.
513
+ if (!(await condition(() => reponse !== null, repasserMs))) {
514
+ repondre({ genre: 'reprendre', contexte: null });
515
+ }
516
+ repasses += 1;
517
+ }
518
+ else {
519
+ await condition(() => reponse !== null);
520
+ repasses = 0;
521
+ }
522
+ attente = false;
523
+ const r = reponse;
524
+ question = null;
525
+ if (r?.genre === 'arreter') {
526
+ arretDemande = { contexte: r.contexte ?? null };
527
+ }
528
+ issueDeLaReponse = arretDemande ? 'arret' : 'reprise';
529
+ if (arretDemande) {
530
+ continue;
531
+ }
532
+ arrete = { ...publie.etat, question: publie.question };
533
+ ouvrirSur = r;
534
+ reprend = r?.genre === 'reprendre' || r?.genre === 'etendre';
535
+ ouverture = null;
536
+ break;
537
+ }
538
+ }
539
+ }
540
+ //# sourceMappingURL=deroule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deroule.js","sourceRoot":"","sources":["../../../src/temporal/circuit/deroule.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,+FAA+F;AAC/F,kGAAkG;AAClG,8FAA8F;AAC9F,mGAAmG;AACnG,+FAA+F;AAC/F,iGAAiG;AACjG,oGAAoG;AACpG,8FAA8F;AAC9F,iGAAiG;AACjG,qHAAqH;AACrH,gGAAgG;AAChG,kGAAkG;AAClG,oGAAoG;AACpG,kGAAkG;AAClG,+FAA+F;AAC/F,mGAAmG;AACnG,kIAAkI;AAClI,+FAA+F;AAC/F,6FAA6F;AAC7F,gFAAgF;AAChF,OAAO,EACL,wBAAwB,EACxB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,SAAS,EACT,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,qBAAqB,EACrB,eAAe,EACf,UAAU,EACV,UAAU,EACV,sBAAsB,EACtB,YAAY,GACb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,aAAa,EACb,YAAY,EACZ,SAAS,EACT,UAAU,GAEX,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElE,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACzF,OAAO,EACL,aAAa,EACb,OAAO,EACP,MAAM,EACN,OAAO,EACP,MAAM,EACN,mBAAmB,EACnB,SAAS,GAgBV,MAAM,cAAc,CAAC;AAEtB,gGAAgG;AAChG,6FAA6F;AAC7F,MAAM,KAAK,GAAG,eAAe,CAAY;IACvC,mBAAm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,UAAU,CAAC,CAAC,EAAE,CAAC;oBAC3D,QAAQ,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;gBACnD,CAAC;gBACD,QAAQ,IAAI,CAAC,CAAC;YAChB,CAAC;iBAAM,CAAC;gBACN,MAAM,SAAS,CAAC,GAAG,EAAE,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC;gBACxC,QAAQ,GAAG,CAAC,CAAC;YACf,CAAC;YACD,OAAO,GAAG,KAAK,CAAC;YAChB,MAAM,CAAC,GAAG,OAAyB,CAAC;YACpC,QAAQ,GAAG,IAAI,CAAC;YAChB,IAAI,CAAC,EAAE,KAAK,KAAK,SAAS,EAAE,CAAC;gBAC3B,YAAY,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC,QAAQ,IAAI,IAAI,EAAE,CAAC;YAClD,CAAC;YACD,gBAAgB,GAAG,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;YACtD,IAAI,YAAY,EAAE,CAAC;gBACjB,SAAS;YACX,CAAC;YACD,MAAM,GAAG,EAAE,GAAG,MAAM,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC;YACvD,SAAS,GAAG,CAA2C,CAAC;YACxD,OAAO,GAAG,CAAC,EAAE,KAAK,KAAK,WAAW,IAAI,CAAC,EAAE,KAAK,KAAK,SAAS,CAAC;YAC7D,SAAS,GAAG,IAAI,CAAC;YACjB,MAAM;QACR,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -0,0 +1,47 @@
1
+ import { Client } from '@temporalio/client';
2
+ import { NativeConnection } from '@temporalio/worker';
3
+ import type { SigneDeVie } from './sonde/contrat.js';
4
+ export { ATTRIBUTS_DE_RECHERCHE } from './attributs.js';
5
+ type Env = Record<string, string | undefined>;
6
+ /** The account's server: the loopback, Temporal's port. */
7
+ export declare const ADRESSE_PAR_DEFAUT = "127.0.0.1:7233";
8
+ /** The address of the server: TEMPORAL_ADDRESS, or the account's server. */
9
+ export declare const adresseDuServeur: (env?: Env) => string;
10
+ /** The namespace: TEMPORAL_NAMESPACE, or `default`. */
11
+ export declare const espaceDeNoms: (env?: Env) => string;
12
+ /**
13
+ * The page of the workflow <id> on the web UI of the server at <adresse>, in the namespace
14
+ * <espace>: the UI listens on the server's port plus 1000, as `temporal server start-dev` sets it
15
+ * by default and the installer writes it (`--ui-port`).
16
+ */
17
+ export declare function lienDuTableauWeb(adresse: string, espace: string, id: string): string;
18
+ /** Where to reach the server; each field from the environment when absent. */
19
+ export interface OuOuvrir {
20
+ adresse?: string;
21
+ espace?: string;
22
+ }
23
+ /** A client opened, its address, and how to close it. */
24
+ export interface ClientOuvert {
25
+ client: Client;
26
+ adresse: string;
27
+ fermer(): Promise<void>;
28
+ }
29
+ /** Opens the Temporal client of the server <adresse>, lazily: no network until its first call. */
30
+ export declare function ouvrirLeClient({ adresse, espace }?: OuOuvrir): ClientOuvert;
31
+ /** Opens the connection of a worker to the server <adresse>; it connects at once. */
32
+ export declare function ouvrirLaConnexionDuTravailleur({ adresse, }?: Pick<OuOuvrir, 'adresse'>): Promise<NativeConnection>;
33
+ /** How long `serveurJoignable` waits for the server by default. */
34
+ export declare const DELAI_JOIGNABLE_MS = 2000;
35
+ /** Whether the server <adresse> answers within <delaiMs> ms. */
36
+ export declare function serveurJoignable(adresse?: string, delaiMs?: number): Promise<boolean>;
37
+ /** What the server alone says of a workflow, no worker living. */
38
+ export interface LectureDuDeroule {
39
+ statut: string;
40
+ memo: Record<string, unknown> | undefined;
41
+ ticket: string | undefined;
42
+ etape: string | undefined;
43
+ /** The last sign of life of its running activity, if any. */
44
+ signeDeVie: SigneDeVie | undefined;
45
+ }
46
+ /** Reads the workflow <id> from the server: its status, memo, search attributes, sign of life. */
47
+ export declare function lireLeDeroule(client: Client, id: string): Promise<LectureDuDeroule>;