@roomi-fields/grillhouse 0.54.1 → 0.55.2

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 +73 -0
  3. package/cadre/templates/projet/.github/workflows/ci.yml +4 -2
  4. package/cadre/templates/projet/.github/workflows/machine-vierge.yml +5 -42
  5. package/cadre/templates/projet/CONTRIBUTING.md +0 -5
  6. package/cadre/templates/projet/README.md +0 -126
  7. package/cadre/templates/projet/_npmignore +1 -6
  8. package/cadre/templates/projet/package.json +5 -32
  9. package/cadre/templates/projet/tsconfig.json +4 -4
  10. package/cadre/templates/projet/vitest.config.cjs +3 -2
  11. package/charte/tests.md +14 -0
  12. package/dist/machine/part-par-sorte.d.ts +9 -9
  13. package/dist/machine/part-par-sorte.js +20 -24
  14. package/dist/machine/part-par-sorte.js.map +1 -1
  15. package/dist/machine/table-des-consommations.d.ts +65 -0
  16. package/dist/machine/table-des-consommations.js +94 -0
  17. package/dist/machine/table-des-consommations.js.map +1 -0
  18. package/dist/temporal/circuit/activites.d.ts +2 -0
  19. package/dist/temporal/circuit/activites.js +87 -3
  20. package/dist/temporal/circuit/activites.js.map +1 -1
  21. package/dist/temporal/circuit/client.js +9 -4
  22. package/dist/temporal/circuit/client.js.map +1 -1
  23. package/dist/temporal/circuit/contrat.d.ts +32 -4
  24. package/dist/temporal/circuit/deroule.js +54 -4
  25. package/dist/temporal/circuit/deroule.js.map +1 -1
  26. package/dist/temporal/circuit/versions.d.ts +12 -0
  27. package/dist/temporal/circuit/versions.js +22 -0
  28. package/dist/temporal/circuit/versions.js.map +1 -0
  29. package/dist/temporal/consommation/activites.d.ts +2 -0
  30. package/dist/temporal/consommation/activites.js +9 -0
  31. package/dist/temporal/consommation/activites.js.map +1 -0
  32. package/dist/temporal/consommation/actualisation.d.ts +2 -0
  33. package/dist/temporal/consommation/actualisation.js +71 -0
  34. package/dist/temporal/consommation/actualisation.js.map +1 -0
  35. package/dist/temporal/consommation/client.d.ts +12 -0
  36. package/dist/temporal/consommation/client.js +28 -0
  37. package/dist/temporal/consommation/client.js.map +1 -0
  38. package/dist/temporal/consommation/commande.d.ts +5 -0
  39. package/dist/temporal/consommation/commande.js +32 -0
  40. package/dist/temporal/consommation/commande.js.map +1 -0
  41. package/dist/temporal/consommation/contrat.d.ts +15 -0
  42. package/dist/temporal/consommation/contrat.js +13 -0
  43. package/dist/temporal/consommation/contrat.js.map +1 -0
  44. package/dist/temporal/consommation/deroule.d.ts +2 -0
  45. package/dist/temporal/consommation/deroule.js +14 -0
  46. package/dist/temporal/consommation/deroule.js.map +1 -0
  47. package/dist/temporal/deroules.d.ts +2 -1
  48. package/dist/temporal/deroules.js +3 -2
  49. package/dist/temporal/deroules.js.map +1 -1
  50. package/dist/temporal/file/contrat.d.ts +2 -0
  51. package/dist/temporal/file/deroule.js +14 -4
  52. package/dist/temporal/file/deroule.js.map +1 -1
  53. package/dist/temporal/installation.d.ts +6 -0
  54. package/dist/temporal/installation.js +15 -0
  55. package/dist/temporal/installation.js.map +1 -1
  56. package/dist/temporal/nuits/activites.d.ts +2 -1
  57. package/dist/temporal/nuits/activites.js +127 -3
  58. package/dist/temporal/nuits/activites.js.map +1 -1
  59. package/dist/temporal/nuits/client.d.ts +19 -5
  60. package/dist/temporal/nuits/client.js +33 -23
  61. package/dist/temporal/nuits/client.js.map +1 -1
  62. package/dist/temporal/nuits/commande.js +16 -11
  63. package/dist/temporal/nuits/commande.js.map +1 -1
  64. package/dist/temporal/nuits/contrat.d.ts +29 -0
  65. package/dist/temporal/nuits/contrat.js +10 -0
  66. package/dist/temporal/nuits/contrat.js.map +1 -1
  67. package/dist/temporal/nuits/deroule.d.ts +5 -0
  68. package/dist/temporal/nuits/deroule.js +18 -1
  69. package/dist/temporal/nuits/deroule.js.map +1 -1
  70. package/dist/temporal/nuits/pc2.d.ts +72 -0
  71. package/dist/temporal/nuits/pc2.js +206 -0
  72. package/dist/temporal/nuits/pc2.js.map +1 -0
  73. package/dist/temporal/places/activites.d.ts +23 -1
  74. package/dist/temporal/places/activites.js +38 -2
  75. package/dist/temporal/places/activites.js.map +1 -1
  76. package/dist/temporal/places/client.d.ts +18 -2
  77. package/dist/temporal/places/client.js +28 -3
  78. package/dist/temporal/places/client.js.map +1 -1
  79. package/dist/temporal/places/contrat.d.ts +79 -14
  80. package/dist/temporal/places/contrat.js +7 -0
  81. package/dist/temporal/places/contrat.js.map +1 -1
  82. package/dist/temporal/places/deroule.js +159 -23
  83. package/dist/temporal/places/deroule.js.map +1 -1
  84. package/dist/temporal/places/reservation.d.ts +54 -0
  85. package/dist/temporal/places/reservation.js +69 -0
  86. package/dist/temporal/places/reservation.js.map +1 -0
  87. package/dist/temporal/planification.d.ts +6 -0
  88. package/dist/temporal/planification.js +26 -0
  89. package/dist/temporal/planification.js.map +1 -0
  90. package/dist/temporal/tickets/activites.d.ts +0 -2
  91. package/dist/temporal/tickets/activites.js +2 -52
  92. package/dist/temporal/tickets/activites.js.map +1 -1
  93. package/dist/temporal/tickets/contrat.d.ts +7 -26
  94. package/dist/temporal/tickets/deroule.js +35 -23
  95. package/dist/temporal/tickets/deroule.js.map +1 -1
  96. package/dist/temporal/travailleur.js +2 -0
  97. package/dist/temporal/travailleur.js.map +1 -1
  98. package/docs/ARCHITECTURE.md +2 -2
  99. package/docs/CADRE.md +1 -1
  100. package/docs/INTERFACE.md +16 -11
  101. package/docs/architecture/circuit.md +62 -58
  102. package/docs/architecture/entree.md +87 -63
  103. package/docs/architecture/greffon.md +24 -21
  104. package/docs/architecture/installation.md +35 -30
  105. package/docs/architecture/machine.md +48 -40
  106. package/docs/architecture/tests.md +37 -33
  107. package/docs/lexique.md +4 -3
  108. package/package.json +1 -1
  109. package/scripts/activites.mjs +351 -180
  110. package/scripts/aiguillage.mjs +1 -0
  111. package/scripts/attente-de-la-machine.mjs +3 -22
  112. package/scripts/avancement.mjs +21 -30
  113. package/scripts/bilan.mjs +22 -2
  114. package/scripts/branche-de-nuit.mjs +1 -1
  115. package/scripts/circuit.mjs +75 -39
  116. package/scripts/codes-de-sortie.mjs +0 -6
  117. package/scripts/coeurs-dedies.mjs +19 -2
  118. package/scripts/consommation-des-passes.mjs +67 -35
  119. package/scripts/consommation.mjs +152 -24
  120. package/scripts/copies-finies.mjs +15 -35
  121. package/scripts/dernier-vert.mjs +4 -5
  122. package/scripts/dette.mjs +5 -3
  123. package/scripts/droits.mjs +2 -2
  124. package/scripts/echantillonneur-de-la-passe.mjs +7 -31
  125. package/scripts/engendres.mjs +5 -61
  126. package/scripts/enveloppe/enveloppe.mjs +30 -34
  127. package/scripts/enveloppe/travail-de-la-copie.mjs +5 -0
  128. package/scripts/etapes.mjs +21 -7
  129. package/scripts/etat-du-depot.mjs +61 -0
  130. package/scripts/faits-du-circuit.mjs +7 -4
  131. package/scripts/fermeture-de-la-machine.d.mts +6 -4
  132. package/scripts/fermeture-de-la-machine.mjs +12 -16
  133. package/scripts/fichier-du-poste.d.mts +9 -0
  134. package/scripts/file-des-tickets.d.mts +0 -18
  135. package/scripts/file-des-tickets.mjs +0 -42
  136. package/scripts/fusion-du-changelog.mjs +1 -1
  137. package/scripts/grillhouse-maj.mjs +1 -1
  138. package/scripts/index-des-rouges.d.mts +40 -0
  139. package/scripts/index-des-rouges.mjs +104 -0
  140. package/scripts/integration/file.mjs +13 -63
  141. package/scripts/integration/integrer.mjs +157 -424
  142. package/scripts/integration/jugement.mjs +109 -0
  143. package/scripts/integration/rejeu.mjs +94 -71
  144. package/scripts/jointure.d.ts +34 -27
  145. package/scripts/journal-des-etats.d.mts +1 -1
  146. package/scripts/langages/c/commandes.mjs +27 -12
  147. package/scripts/langages/cargo/commandes.mjs +148 -94
  148. package/scripts/langages/cargo/index.mjs +2 -1
  149. package/scripts/langages/cargo/lectures-des-tests.mjs +132 -0
  150. package/scripts/langages/cargo/migrations/lectures-des-tests.mjs +31 -0
  151. package/scripts/langages/python/commandes.mjs +31 -15
  152. package/scripts/langages/python/index.mjs +2 -1
  153. package/scripts/langages/python/lectures-des-tests.mjs +148 -0
  154. package/scripts/langages/python/migrations/lectures-des-tests.mjs +31 -0
  155. package/scripts/langages/typescript/consommateurs-arbitres.mjs +2 -2
  156. package/scripts/langages/typescript/index.mjs +4 -0
  157. package/scripts/langages/typescript/lectures-des-tests.mjs +95 -0
  158. package/scripts/langages/typescript/migrations/lectures-des-tests.mjs +31 -0
  159. package/scripts/langages/typescript/tests-de-nuit.mjs +9 -15
  160. package/scripts/langages/typescript/tests.mjs +11 -37
  161. package/scripts/langages/typescript/titres-de-tests.mjs +5 -4
  162. package/scripts/langages/typescript/verifier.mjs +74 -44
  163. package/scripts/langages/typescript/vitest-config/base.mjs +3 -3
  164. package/scripts/langages/typescript/vitest-config/machine.setup.mjs +6 -25
  165. package/scripts/lectures-communes.mjs +234 -0
  166. package/scripts/machine.mjs +11 -18
  167. package/scripts/mesure/base-de-passe.mjs +1 -2
  168. package/scripts/mesure-de-la-machine.d.mts +43 -3
  169. package/scripts/mesure-de-la-machine.mjs +209 -11
  170. package/scripts/migrations/0.33.0-ci-du-cadre.mjs +3 -3
  171. package/scripts/migrations/nuit-yml-retire.mjs +25 -0
  172. package/scripts/migrations/part-retiree.mjs +31 -0
  173. package/scripts/migrations/table-des-consommations.mjs +36 -0
  174. package/scripts/migrations.mjs +6 -0
  175. package/scripts/montee.mjs +9 -0
  176. package/scripts/nuit-de-pc2.mjs +628 -0
  177. package/scripts/nuit.sh +8 -131
  178. package/scripts/paquets.mjs +1 -1
  179. package/scripts/passe-de-la-machine.mjs +365 -105
  180. package/scripts/place-du-circuit.d.mts +15 -0
  181. package/scripts/place-du-circuit.mjs +32 -0
  182. package/scripts/places-de-la-machine.mjs +148 -627
  183. package/scripts/places-du-serveur.mjs +43 -16
  184. package/scripts/plafond-de-la-machine.d.mts +8 -13
  185. package/scripts/plafond-de-la-machine.mjs +37 -69
  186. package/scripts/registre-des-entrees.mjs +57 -0
  187. package/scripts/regles-des-places.d.mts +84 -50
  188. package/scripts/regles-des-places.mjs +200 -156
  189. package/scripts/retirer-copie.sh +2 -2
  190. package/scripts/seances.mjs +181 -63
  191. package/scripts/secours.mjs +95 -0
  192. package/scripts/services-du-noyau.mjs +11 -19
  193. package/scripts/sous-commandes.mjs +1 -0
  194. package/scripts/sous-modules.sh +1 -1
  195. package/scripts/superviseur.mjs +16 -7
  196. package/scripts/table-des-consommations.d.mts +9 -0
  197. package/scripts/table-des-consommations.mjs +35 -0
  198. package/scripts/tableau.mjs +33 -19
  199. package/scripts/taches-du-graphe.mjs +124 -2
  200. package/scripts/transitions.d.mts +27 -5
  201. package/scripts/transitions.mjs +125 -104
  202. package/scripts/verdict-de-la-nuit.d.mts +13 -0
  203. package/scripts/verdict-de-la-nuit.mjs +34 -7
  204. package/scripts/verrou-de-fichier.mjs +1 -2
  205. package/scripts/workflows-du-cadre.mjs +2 -2
  206. package/skills/developpeur/SKILL.md +8 -2
  207. package/skills/direct/SKILL.md +5 -0
  208. package/skills/explorateur/SKILL.md +10 -1
  209. package/skills/grill/SKILL.md +2 -4
  210. package/skills/pitmaster/SKILL.md +7 -5
  211. package/skills/pitmaster/references/consigne-agent.md +1 -1
  212. package/skills/relecteur/SKILL.md +4 -1
  213. package/skills/testwriter/SKILL.md +15 -2
  214. package/cadre/templates/projet/.env.example +0 -57
  215. package/cadre/templates/projet/.github/workflows/nuit.yml +0 -139
  216. package/cadre/templates/projet/deployment/README.md +0 -98
  217. package/cadre/templates/projet/deployment/docs/01-INSTALL.md +0 -145
  218. package/cadre/templates/projet/deployment/docs/02-CONFIGURATION.md +0 -117
  219. package/cadre/templates/projet/deployment/docs/03-API.md +0 -264
  220. package/cadre/templates/projet/deployment/docs/04-TROUBLESHOOTING.md +0 -262
  221. package/cadre/templates/projet/deployment/scripts/install.ps1 +0 -100
  222. package/cadre/templates/projet/deployment/scripts/start.ps1 +0 -61
  223. package/cadre/templates/projet/deployment/scripts/stop.ps1 +0 -37
  224. package/cadre/templates/projet/deployment/scripts/test.ps1 +0 -118
  225. package/cadre/templates/projet/ecosystem.config.cjs +0 -73
  226. package/cadre/templates/projet/src/config.ts +0 -68
  227. package/cadre/templates/projet/src/errors.ts +0 -102
  228. package/cadre/templates/projet/src/index.ts +0 -46
  229. package/cadre/templates/projet/src/services/.gitkeep +0 -8
  230. package/cadre/templates/projet/src/types/index.ts +0 -24
  231. package/cadre/templates/projet/src/utils/logger.ts +0 -106
  232. package/cadre/templates/projet/tests/unit/config.spec.ts +0 -68
  233. package/cadre/templates/projet/tests/unit/errors.spec.ts +0 -132
  234. package/cadre/templates/projet/tests/unit/types.spec.ts +0 -73
  235. package/cadre/templates/projet/tsconfig.build.json +0 -14
  236. package/scripts/flux-de-la-nuit.mjs +0 -39
  237. package/scripts/garde-de-la-memoire.mjs +0 -231
  238. package/scripts/repli-de-la-nuit.mjs +0 -184
@@ -1,20 +1,19 @@
1
- // The sampler of a heavy pass, a process apart outside its scope: while the pass lives it reads the
1
+ // The sampler of a pass, a process apart outside its scope: while the pass lives it reads the
2
2
  // scope again and keeps the last reading; when the pass has gone without writing its final line
3
3
  // (SIGKILL, the watch of the memory), it writes the line « interrompue » with that reading. Started
4
4
  // by `scopeSystemd` (./consommation-des-passes.mjs); a pass that ends by itself leaves the marker
5
5
  // file `<id>.fin` the sampler removes. Architecture: docs/architecture/machine.md (§3.1, §5.6).
6
- import { existsSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
7
- import path from 'node:path';
6
+ import { existsSync, rmSync, writeFileSync } from 'node:fs';
8
7
  import { pathToFileURL } from 'node:url';
9
- import { depasseLaPart, garderLaConsommation, lireLUnite } from './consommation-des-passes.mjs';
10
- import { ecrireAtomique } from './mesure/avancement.mjs';
8
+ import { garderLaConsommation, lireLUnite, marquesDeLaPasse } from './consommation-des-passes.mjs';
11
9
 
12
10
  const PERIODE_MS = 1000;
13
11
 
14
12
  /**
15
13
  * Samples the pass behind <port> until it is over, then writes its line if it left none.
16
14
  * @param {{
17
- * base: { sorte: string, ticket?: string, coeurs: number, debut: number },
15
+ * base: { sorte: string, phase?: string, execution?: string, lourde?: boolean, ticket?: string,
16
+ * coeurs: number, debut: number },
18
17
  * lire: () => ({ cpuNs: number | null, memoirePic: number | null } | null),
19
18
  * vivante: () => boolean,
20
19
  * finale: () => boolean,
@@ -40,6 +39,7 @@ export function echantillonner({ base, lire, vivante, finale, noter, garder, mai
40
39
  const fin = maintenant();
41
40
  garder({
42
41
  sorte: base.sorte,
42
+ ...marquesDeLaPasse(base),
43
43
  ...(base.ticket ? { ticket: base.ticket } : {}),
44
44
  dureeMs: fin - base.debut,
45
45
  cpuNs: derniere?.cpuNs ?? null,
@@ -59,29 +59,8 @@ const vit = pid => {
59
59
  }
60
60
  };
61
61
 
62
- // Says in the file of the part <part> (`{ dossier, id, coeurs, memoire }` of the parts of the
63
- // machine) what the pass consumes beyond it, from the reading <l> and the start of the pass; the
64
- // file is left as it is when the pass holds to its part or its file is gone.
65
- function signalerLeDepassement(part, base, l) {
66
- const f = path.join(part.dossier, `${part.id}.json`);
67
- try {
68
- const p = JSON.parse(readFileSync(f, 'utf8'));
69
- const depasse = depasseLaPart({
70
- part,
71
- cpuNs: l.cpuNs,
72
- dureeMs: Date.now() - base.debut,
73
- memoirePic: l.memoirePic,
74
- });
75
- if (depasse !== (p.depasse ?? null)) {
76
- ecrireAtomique(f, depasse === null ? { ...p, depasse: undefined } : { ...p, depasse });
77
- }
78
- } catch {
79
- // the part is given back: nothing to say
80
- }
81
- }
82
-
83
62
  if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) {
84
- const { unite, pid, racine, marqueur, base, part } = JSON.parse(process.argv[2]);
63
+ const { unite, pid, racine, marqueur, base } = JSON.parse(process.argv[2]);
85
64
  const attente = new Int32Array(new SharedArrayBuffer(4));
86
65
  echantillonner({
87
66
  base,
@@ -90,9 +69,6 @@ if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) {
90
69
  finale: () => existsSync(marqueur),
91
70
  noter: l => {
92
71
  writeFileSync(`${marqueur}.lecture`, JSON.stringify(l));
93
- if (part) {
94
- signalerLeDepassement(part, base, l);
95
- }
96
72
  },
97
73
  garder: l => garderLaConsommation(racine, l),
98
74
  maintenant: Date.now,
@@ -18,15 +18,15 @@
18
18
  // - `regenerer` plays the command of each, in order, then stages every file they changed; a command
19
19
  // of the project at another code than 0, one of the frame on a real failure (126, 127, a signal,
20
20
  // 128 + its number), or a file changed that their `fichiers` do not cover refuses, the command,
21
- // its code and its output named. The integration (scripts/integration/integrer.mjs), the queue
21
+ // its code and its output named. The final pass of the circuit (scripts/activites.mjs), the queue
22
22
  // (scripts/integration/file.mjs) and the move of a copy onto main
23
- // (scripts/enveloppe/travail-de-la-copie.mjs) call it on the tree where they applied the lot,
24
- // main's version of each file taken.
23
+ // (scripts/enveloppe/travail-de-la-copie.mjs) call it on the tree that holds the lot on main.
25
24
  // - `installerEtRegenerer` orders that play around the install of the copy, as Bazel builds an
26
25
  // output before what reads it: first the references that write `package-lock.json`, from the
27
26
  // manifests of the lot (`npm install --package-lock-only`, as Renovate writes a lock again),
28
27
  // then the install, which reads that file, then the other references, which may need what it
29
- // installed. The integration and the queue play it.
28
+ // installed. The final pass of the circuit and the queue
29
+ // play it.
30
30
  // - `encoreDeclares` keeps the generated files the tree where the lot is applied still declares, by
31
31
  // their names: as a genrule of Bazel removed with its output in one change plays no more, the
32
32
  // one a lot removes from the key is not played, and its files follow the lot, their deletion
@@ -108,7 +108,7 @@ export function lireEngendres(pkg) {
108
108
 
109
109
  /**
110
110
  * The generated files of the project that holds <dir>, from the package.json of its main tree,
111
- * never of a copy, so that no lot writes the command line the integration then runs; the script
111
+ * never of a copy, so that no lot writes the command line the circuit then runs; the script
112
112
  * that line launches is the one of the tree it runs in, which the lot may change. None without one.
113
113
  * @param {string} dir a directory of the project: its main tree or a copy
114
114
  * @throws {Error} the faults of the key, one per line
@@ -169,25 +169,6 @@ export function encoreDeclares(engendres, arbre, etages = null) {
169
169
  return avant && avec ? engendres.filter(e => !avant.has(e.nom) || avec.has(e.nom)) : engendres;
170
170
  }
171
171
 
172
- /**
173
- * What the lots applied in the tree <arbre> ask of the references <references> (`{ nom, entiers }`,
174
- * those of the project, <duProjet>, among them): `suivis`, the files of <entiers> (the files of
175
- * the lots a reference writes in full, left out of their application) that follow the lots, the
176
- * ones no reference still declared writes; `rejouees`, the references of <touchees> (those the
177
- * lots touch) still declared, whose commands play. A reference of the frame is always declared.
178
- * @template {{ nom: string, entiers: string[] }} R
179
- * @param {{ references: R[], duProjet: R[], entiers: string[], touchees: R[], arbre: string }} o
180
- * @returns {{ suivis: string[], rejouees: R[] }}
181
- */
182
- export function partDesLots({ references, duProjet, entiers, touchees, arbre }) {
183
- const declares = encoreDeclares(duProjet, arbre);
184
- const retire = r => duProjet.includes(r) && !declares.includes(r);
185
- return {
186
- suivis: entiers.filter(f => !references.some(r => !retire(r) && couvertPar(r.entiers, f))),
187
- rejouees: touchees.filter(r => !retire(r)),
188
- };
189
- }
190
-
191
172
  /**
192
173
  * The generated files of <engendres> still declared in the tree <arbre> that the lot of
193
174
  * <fichiers> touches: those whose commands play once the lot is applied there.
@@ -200,43 +181,6 @@ export function partDesLots({ references, duProjet, entiers, touchees, arbre })
200
181
  export const aRejouer = (engendres, arbre, fichiers) =>
201
182
  touchesPar(encoreDeclares(engendres, arbre), fichiers);
202
183
 
203
- /**
204
- * Applies to the tree of <dansCopie> (git in the tree) the files <fichiers> of the lots <lots>
205
- * (patch files) that an earlier application left out, those of a generated file the lots remove
206
- * from the key: a deletion is done whatever main's version is, any other change is applied three
207
- * ways, to the index too. Null, or the refusal; `surNonApplique` is called when the refusal is a
208
- * lot that does not apply.
209
- * @param {{ lots: string[], fichiers: string[], dansCopie: (...args: string[]) => import('node:child_process').SpawnSyncReturns<string>, surNonApplique?: () => void }} o
210
- * @returns {string | null}
211
- */
212
- export function poserLesRetires({ lots, fichiers, dansCopie, surNonApplique }) {
213
- if (!fichiers.length) {
214
- return null;
215
- }
216
- const seuls = fichiers.map(f => `--include=${f}`);
217
- for (const p of lots) {
218
- const supprimes = dansCopie('apply', '--summary', ...seuls, p)
219
- .stdout.split('\n')
220
- .map(l => /^ delete mode \d+ (.+)$/.exec(l)?.[1])
221
- .filter(f => f !== undefined && fichiers.includes(f));
222
- if (
223
- supprimes.length &&
224
- dansCopie('rm', '-q', '-f', '--ignore-unmatch', '--', ...supprimes).status !== 0
225
- ) {
226
- return `Les fichiers que le lot ${p} supprime ne se retirent pas :\n${supprimes.map(f => ` ${f}`).join('\n')}`;
227
- }
228
- const restent = fichiers.filter(f => !supprimes.includes(f)).map(f => `--include=${f}`);
229
- if (restent.length) {
230
- const r = dansCopie('apply', '--3way', '--index', '--allow-empty', ...restent, p);
231
- if (r.status !== 0) {
232
- surNonApplique?.();
233
- return `Le lot ${p} ne s'applique pas :\n${r.stdout}${r.stderr}`;
234
- }
235
- }
236
- }
237
- return null;
238
- }
239
-
240
184
  /**
241
185
  * Resolves the conflicts <conflits> of a rebase stopped in the tree of <dansCopie>, each on a file
242
186
  * a generated file writes in full: main's version (`--ours`, the base of the rebase) for one of
@@ -86,6 +86,7 @@
86
86
  // plan leaves the root read-only and the file exists.
87
87
  // - The exit codes are named in `codes.mjs`.
88
88
  import { execFileSync, spawnSync } from 'node:child_process';
89
+ import { randomUUID } from 'node:crypto';
89
90
  import {
90
91
  copyFileSync,
91
92
  existsSync,
@@ -114,18 +115,16 @@ import {
114
115
  export { paquetsDuLangage };
115
116
  import { cacheDesOutils, installer, versionDeLOutil } from '../aiguillage.mjs';
116
117
  import { ouvrirBase } from '../mesure/base-de-passe.mjs';
118
+ import { phaseDeLaSeance } from '../etapes.mjs';
117
119
  import {
118
- partDeLaPasse,
119
- prendreUnePart,
120
+ reservationDeLaPasse,
121
+ reservationDeLEtape,
120
122
  sousNiceEtIonice,
121
123
  travailleursDe,
124
+ VARIABLE_PHASE_DE_SEANCE,
122
125
  VARIABLE_TENUE,
123
126
  } from '../places-de-la-machine.mjs';
124
- import {
125
- commandeDuGroupe,
126
- groupeIndisponible,
127
- mesureDeLaSeance,
128
- } from '../passe-de-la-machine.mjs';
127
+ import { commandeDuGroupe, groupeIndisponible, mesureDeLaSeance } from '../passe-de-la-machine.mjs';
129
128
  import { donneesDe } from '../donnees-cles.mjs';
130
129
  import { matieresDeclareesDe } from '../matieres-cles.mjs';
131
130
  import { outilsDe } from '../outils-cles.mjs';
@@ -240,7 +239,9 @@ const MAISON_EN_LECTURE = [
240
239
  // The programs of the index, as paths of the home: the program that the `.mcp.json` of the project
241
240
  // launches by its name (codegraph, found in `~/.local/bin`) and the home of its versions. rtfm
242
241
  // needs none: its server comes with its plugin, which the envelope mounts (`plugins`).
243
- const INDEX_DE_LA_MAISON = [{ nom: 'codegraph', programme: '.local/bin/codegraph', maison: '.codegraph' }];
242
+ const INDEX_DE_LA_MAISON = [
243
+ { nom: 'codegraph', programme: '.local/bin/codegraph', maison: '.codegraph' },
244
+ ];
244
245
 
245
246
  /**
246
247
  * The paths that the envelope of <role> mounts read-only for the index, as a sandbox mounts the
@@ -373,16 +374,17 @@ export function environnementDeLaSeance(
373
374
  * environment of the session, GRILLHOUSE_TRAVAILLEURS set to max(1, cores ÷ places) of <env>.
374
375
  * @param {{ argsBwrap: string[], commande: string[], env: Record<string, string | undefined>,
375
376
  * cacheNpm: string, paquets: string[], travail: string, outils?: Record<string, string>,
376
- * donnees?: Record<string, string>, part?: { coeurs: number, memoire: number },
377
+ * donnees?: Record<string, string>, part?: { coeurs: number, memoire: number,
378
+ * limite?: number, limiteCoeurs?: number },
377
379
  * sonde?: () => boolean, unite?: string | null }} o <unite> names the group, which the measure
378
380
  * of the session reads
379
381
  * @returns {{ cmd: string, args: string[], env: Record<string, string>, sansBorne: string | null }}
380
382
  * `sansBorne`: why the session starts without a group (null when it has one)
381
383
  *
382
384
  * The session runs in a scope of its own (`systemd-run --user --scope`, a foreground scope that
383
- * leaves with its process) with a hard CPU ceiling of the cores of the part of the project; the
384
- * passes it launches play inside that ceiling. Without a part or a manager of groups, it starts as
385
- * it is.
385
+ * leaves with its process) under the slice of the frame (`grillhouse.slice`), with a hard CPU
386
+ * ceiling and a memory ceiling of the phase of its step; the passes it launches play inside that
387
+ * ceiling. Without a part or a manager of groups, it starts as it is.
386
388
  */
387
389
  export function lancementDeLaSeance({
388
390
  argsBwrap,
@@ -413,7 +415,7 @@ export function lancementDeLaSeance({
413
415
  args: seance.args,
414
416
  unite,
415
417
  plafond: true,
416
- memoire: false,
418
+ tranche: true,
417
419
  })
418
420
  : seance;
419
421
  return {
@@ -1033,35 +1035,30 @@ function envelopper(argv) {
1033
1035
  process.stderr.write(`⛔ ENVELOPPE REFUSÉE — ${refus}\n`);
1034
1036
  code = CODE_REFUS;
1035
1037
  } else {
1036
- // The session reserves its cores for its phase alone (3 by default, a direct's too) against
1037
- // the budget of the machine, and gives them back at its end; under a part already held, its cap is that part.
1038
+ // The session runs within the reservation its step holds (the arbiter granted it, the
1039
+ // workflow of the circuit asked it: VARIABLE_RESERVATION_D_ETAPE); out of a circuit, within
1040
+ // the reservation of its phase, from the table of the consumptions.
1038
1041
  let part;
1039
- let prise = null;
1040
1042
  try {
1041
- prise = prendreUnePart({
1042
- racine: copie,
1043
- ticket: path.basename(copie),
1044
- sorte: `séance ${role ?? ''}`.trim(),
1045
- bornee: false,
1046
- dire: l => process.stderr.write(`${l}\n`),
1047
- });
1048
1043
  part =
1049
- prise.part ??
1050
- partDeLaPasse({ racine: copie, sorte: `séance ${role ?? ''}`.trim() });
1044
+ reservationDeLEtape(process.env) ??
1045
+ reservationDeLaPasse({
1046
+ racine: copie,
1047
+ env: process.env,
1048
+ phase: process.env[VARIABLE_PHASE_DE_SEANCE] || phaseDeLaSeance(role) || 'verification',
1049
+ });
1051
1050
  } catch (e) {
1052
1051
  process.stderr.write(`⛔ ENVELOPPE REFUSÉE — ${e.message}\n`);
1053
1052
  temporaire.fermer();
1054
1053
  return CODE_REFUS;
1055
1054
  }
1056
1055
  // The peak of the session, which its group measures, enters the register under its role.
1057
- const mesure = prise.part
1058
- ? mesureDeLaSeance({
1059
- racine: copie,
1060
- role,
1061
- ticket: path.basename(copie),
1062
- part: { ...prise.part, id: prise.id },
1063
- })
1064
- : null;
1056
+ const mesure = mesureDeLaSeance({
1057
+ racine: copie,
1058
+ role,
1059
+ ticket: path.basename(copie),
1060
+ part: { ...part, id: part.id ?? randomUUID() },
1061
+ });
1065
1062
  const lancement = lancementDeLaSeance({
1066
1063
  unite: mesure?.unite ?? null,
1067
1064
  argsBwrap: args,
@@ -1083,7 +1080,6 @@ function envelopper(argv) {
1083
1080
  r = spawnSync(lancement.cmd, lancement.args, { stdio: 'inherit', env: lancement.env });
1084
1081
  } finally {
1085
1082
  mesure?.garder(r ?? { error: true });
1086
- prise.rendre();
1087
1083
  }
1088
1084
  if (r.error) {
1089
1085
  process.stderr.write(`⛔ ENVELOPPE IMPOSSIBLE — ${r.error.message}\n`);
@@ -105,6 +105,7 @@ import {
105
105
  import { tmpdir } from 'node:os';
106
106
  import path from 'node:path';
107
107
  import { pathToFileURL } from 'node:url';
108
+ import { rendreEnTravail } from '../etat-du-depot.mjs';
108
109
  import { couvertPar, encoreDeclares, engendresDe, regenerer, touchesPar } from '../engendres.mjs';
109
110
  import { avecLesDonnees, donneesDe } from '../donnees-cles.mjs';
110
111
  import { matieresDeclareesDe } from '../matieres-cles.mjs';
@@ -666,6 +667,10 @@ const conflit = (copie, conflits, entete) =>
666
667
  */
667
668
  export function avancer(copie, cible, { ecrit, suspects = [], duCadre, dire = surStderr } = {}) {
668
669
  rendreLIndex(copie);
670
+ // The commit of the lot is local work again before the copy moves, its work kept as any other.
671
+ if (git(copie, ['merge-base', '--is-ancestor', cible, 'HEAD']).status !== 0) {
672
+ rendreEnTravail(copie);
673
+ }
669
674
  releverLesResolus(copie);
670
675
  const restants = [
671
676
  ...new Set([...enConflit(copie), ...suspects.filter(f => porteDesMarques(copie, f))]),
@@ -130,7 +130,7 @@ export const ETAPES = [
130
130
  etat: null,
131
131
  sous: [
132
132
  { numero: '5.1', titre: 'Commit', circuits: TOUS, qui: [AUTO], etat: 'integration' },
133
- { numero: '5.2', titre: 'File : passe finale, main', circuits: TOUS, qui: [AUTO], etat: 'file' },
133
+ { numero: '5.2', titre: 'File : entrée sur main', circuits: TOUS, qui: [AUTO], etat: 'file' },
134
134
  // The tri of the discoveries of the ticket, on the lot entered on main.
135
135
  { numero: '5.3', titre: 'Tri des découvertes', circuits: TOUS, qui: [EXPLORATEUR], etat: 'tri' },
136
136
  ],
@@ -250,6 +250,24 @@ export const etapeDuCircuit = ({ etape, finale, raison, questionnement }) => {
250
250
  );
251
251
  };
252
252
 
253
+ /** The phase, in the register of the consumptions, of a pass of the step the circuit's state
254
+ * names (`etapeDuCircuit`): « <numéro>:passe ». */
255
+ export const phaseDeLaPasse = etat => `${etapeDuCircuit(etat).numero}:passe`;
256
+
257
+ // The steps of the sessions of the explorateur that are not its plan, by the object of their launch.
258
+ const ETAPE_DE_L_OBJET = { geste: '1.1', tri: '5.3' };
259
+
260
+ /**
261
+ * The phase, in the register of the consumptions, of a session of the agent <role> whose launch
262
+ * names <objet>: « <numéro>:<rôle> », the first step where the role works; null for an agent of no
263
+ * step.
264
+ */
265
+ export const phaseDeLaSeance = (role, objet) => {
266
+ const numero =
267
+ ETAPE_DE_L_OBJET[objet] ?? SUITE.find(e => tousLesRolesDe(e).includes(role))?.numero;
268
+ return numero ? `${numero}:${role}` : null;
269
+ };
270
+
253
271
  // The step where the role agent <role> works, or null for any other agent.
254
272
  export const etapeDuRole = role =>
255
273
  role === AUTO ? null : (SUITE.find(e => e.qui.includes(role)) ?? null);
@@ -283,7 +301,7 @@ export const GESTES = [
283
301
  {
284
302
  genre: 'regeneration',
285
303
  geste:
286
- 'à la régénération des références (4.2), puis la passe qui juge l’arbre régénéré : après les contrôles, les contrôles du plan encore quand d’autres rouges s’y mêlent, sinon la passe finale qui est due ; après une passe finale, la passe finale restreinte à ce qu’elle change',
304
+ 'à la régénération des références (4.2), puis la passe qui juge l’arbre régénéré : après les contrôles, les contrôles du plan encore quand d’autres rouges s’y mêlent, sinon la passe finale qui est due ; après une passe finale, la passe finale encore, sur toute la bande du lot',
287
305
  regle:
288
306
  'un rouge des contrôles du plan ou de la passe finale est celui d’une référence, même mêlé à d’autres : une que le projet déclare (`grillhouse.references`), ou un fichier que le cadre engendre (l’index des interfaces, les fichiers que le module du langage engendre) ; ou la passe abaisse la dette des gardes (`dette.mjs --abaisser`, depuis ses notes)',
289
307
  cas: 'BP 320.9 : 292 min autour des références, dont 163 min d’attente pour régénérer à la main l’index des interfaces, le plafond et l’empreinte, des rouges de références mêlés à d’autres ; BP 320.3.9 : le plafond rouge aux contrôles, laissé à une passe finale qui rejoue les mêmes tests sur le même arbre (6,1 min) ; BP 320.6.5 : un test qui lit les références des paquets, rouge à côté de leur garde, envoyé au développeur, qui n’a rien à livrer puis ne peut pas les écrire',
@@ -316,7 +334,7 @@ export const GESTES = [
316
334
  geste:
317
335
  'au rôle qui écrit les fichiers en conflit ou au lot gardé, les marques posées dans la copie : le testwriter pour un test ou la matière de test partagée, quelle que soit la sorte du lot, le développeur pour le code, le testwriter d’abord puis le développeur sur les fichiers des deux ; après un lot que l’intégration (5.1) dit ne plus s’appliquer sur main, ou que la file (5.2) rend sur un conflit, le circuit revient à la passe qui juge le lot, dont la préparation joue ce geste',
318
336
  regle:
319
- 'l’avance d’une copie sur main, avant une passe, après le refus d’application à 5.1 ou le conflit de la file à 5.2, laisse des fichiers en conflit ou un lot gardé : le rôle que `estUnTest` du module du langage désigne pour chacun les écrit ; un conflit que la seconde séance du rôle ne lève pas monte (lancement)',
337
+ 'l’avance d’une copie sur main, avant une passe, ou après le conflit de la file à 5.2, laisse des fichiers en conflit ou un lot gardé : le rôle que `estUnTest` du module du langage désigne pour chacun les écrit ; un conflit que la seconde séance du rôle ne lève pas monte (lancement)',
320
338
  cas: 'SH-b52.2 : marques dans 2 fichiers de test, résolues à la main par le superviseur ; SH-br0.3 : 8 fichiers de test dans le lot gardé, la copie sur main sans eux',
321
339
  },
322
340
  ];
@@ -333,10 +351,6 @@ export const RESPONSABLE = 'responsable';
333
351
  // (circuit.md §4.4, §5.6): the circuit stops, and the answer `--planifier` switches it to the plan.
334
352
  export const DEMANDE_UN_PLAN = 'demande-un-plan';
335
353
 
336
- // The exit code of the integration (scripts/integration/integrer.mjs) for a lot that does not
337
- // apply on main: the one refusal the gesture `conflit-de-l-avance` may settle.
338
- export const LOT_NE_S_APPLIQUE_PAS = 3;
339
-
340
354
  // The commands by which the supervisor answers a question (scripts/circuit.mjs): resume, extend
341
355
  // the plan, stop.
342
356
  export const REPONSES =
@@ -114,3 +114,64 @@ export function etatDuDepot(racine) {
114
114
  rmSync(dir, { recursive: true, force: true });
115
115
  }
116
116
  }
117
+
118
+ // The commit of the lot in the copy of its ticket (packages/grillhouse/docs/architecture/entree.md
119
+ // §5.1): the final pass (4.1) commits the lot on the tip of main and judges that tree, and the
120
+ // integration (5.1) sends that commit into the queue, as bors tests the commit that will enter main.
121
+ // The commit the circuit posed is marked by a ref of the repository, `refs/grillhouse/lots/<branch>`:
122
+ // while the copy's HEAD is that commit, the lot is read against its parent, its base on main, and
123
+ // it goes back to local work before anything changes it. Any other commit of the branch is never
124
+ // touched.
125
+
126
+ // The ref that marks the commit of the lot of the branch of HEAD in `copie`, null when detached.
127
+ function marque(copie) {
128
+ const branche = sortie(copie, ['symbolic-ref', '--short', '-q', 'HEAD']);
129
+ return branche ? `refs/grillhouse/lots/${branche}` : null;
130
+ }
131
+
132
+ /** The commit of the lot the circuit posed, when it is the HEAD of `copie`; else null. */
133
+ export function commitDuLot(copie) {
134
+ const ref = marque(copie);
135
+ const pose = ref ? sortie(copie, ['rev-parse', '--verify', '-q', ref]) : null;
136
+ const tete = pose ? sortie(copie, ['rev-parse', '--verify', '-q', 'HEAD']) : null;
137
+ return pose && pose === tete ? tete : null;
138
+ }
139
+
140
+ /** The base of the lot of `copie`: the parent of its commit, else HEAD; null out of git. */
141
+ export function baseDuLot(copie) {
142
+ const rev = commitDuLot(copie) ? 'HEAD^' : 'HEAD';
143
+ return sortie(copie, ['rev-parse', '--verify', '-q', rev]) || null;
144
+ }
145
+
146
+ /** HEAD of `copie` marked as the commit of the lot; false when git refuses. */
147
+ export function marquerLeLot(copie) {
148
+ const ref = marque(copie);
149
+ return Boolean(ref) && git(copie, ['update-ref', ref, 'HEAD']).status === 0;
150
+ }
151
+
152
+ /**
153
+ * The commit of the lot of `copie` back to local work on its base, the files untouched. The commit
154
+ * undone, or null when HEAD is none; it throws when git refuses.
155
+ */
156
+ export function rendreEnTravail(copie) {
157
+ const commit = commitDuLot(copie);
158
+ if (!commit) {
159
+ return null;
160
+ }
161
+ const r = git(copie, ['reset', '-q', 'HEAD^']);
162
+ if (r.status !== 0) {
163
+ throw new Error(`le commit du lot de ${copie} ne redevient pas du travail local : ${r.stderr}`);
164
+ }
165
+ return commit;
166
+ }
167
+
168
+ /**
169
+ * The commit `commit` of the lot, undone by `rendreEnTravail`, posed again, the files untouched:
170
+ * nothing when HEAD has left its base since.
171
+ */
172
+ export function reposerLeCommit(copie, commit) {
173
+ const tete = sortie(copie, ['rev-parse', '--verify', '-q', 'HEAD']);
174
+ if (tete === sortie(copie, ['rev-parse', '--verify', '-q', `${commit}^`])) {
175
+ git(copie, ['reset', '-q', commit]);
176
+ }
177
+ }
@@ -246,8 +246,9 @@ const ACTES = {
246
246
  },
247
247
  // One step of the plan (`unPasDuPlan`): the state of the plan that follows, the opening once it
248
248
  // passes, or its stop gone up.
249
- async plan({ ticket, memoire, reponse, pas, plan, cle, essai }) {
249
+ async plan({ ticket, memoire, reponse, pas, plan, cle, essai, reservation }) {
250
250
  const ctx = leContexte(ticket, memoire, optionsDe(reponse));
251
+ ctx.reservation = reservation ?? null;
251
252
  ctx.cle = cle ?? null;
252
253
  ctx.essaiDeLActe = essai ?? 1;
253
254
  ctx.contexte = plan.contexte ?? ctx.contexte ?? null;
@@ -299,10 +300,12 @@ const ACTES = {
299
300
  });
300
301
  },
301
302
  async fait(
302
- { ticket, memoire, fait, parametres, faits, sorte, paquets, precedent, cle, essai },
303
+ { ticket, memoire, fait, parametres, faits, sorte, paquets, precedent, cle, essai, reservation },
303
304
  annulation
304
305
  ) {
305
306
  const ctx = leContexte(ticket, memoire, { paquets });
307
+ // The cores and the memory the arbiter reserved for the step, which its session runs within.
308
+ ctx.reservation = reservation ?? null;
306
309
  ctx.sorte = sorte;
307
310
  // A fact is read again on an attempt played again: the key of its activity names its sessions
308
311
  // (`idDeSeance`), and its attempt says whether Temporal plays it again (`lancer` of
@@ -482,9 +485,9 @@ Object.assign(ACTES, {
482
485
  effets: o.rendus,
483
486
  };
484
487
  },
485
- async fermer({ racine, ticket, branche, commit }) {
488
+ async fermer({ racine, ticket, branche, commit, mainABouge }) {
486
489
  const o = laFile(racine);
487
- return { ...fermerLEntree(o, { ticket, branche, commit }), effets: o.rendus };
490
+ return { ...fermerLEntree(o, { ticket, branche, commit, mainABouge }), effets: o.rendus };
488
491
  },
489
492
  // The final pass on the candidate, played in the queue's copy (`jugerLeCandidat`).
490
493
  async juger({ racine, ticket, branche, commit }) {
@@ -13,15 +13,17 @@ export function decisionDeReouverture(
13
13
 
14
14
  /** What still runs by project and by ticket, or « la machine est vide ». */
15
15
  export function direCeQuiTourne(o: {
16
- prises: readonly { ticket?: string | null; racine?: string | null }[];
17
- parts: readonly { ticket?: string | null; projet?: string | null; etat?: string }[];
16
+ /** The reservations granted: a session, or a pass (its `sorte`). */
17
+ prises: readonly { ticket?: string | null; racine?: string | null; sorte?: string | null }[];
18
+ /** The requests that wait: they do not run, and are not counted. */
19
+ attentes?: readonly object[];
18
20
  }): string[];
19
21
 
20
22
  /** The lines a command says once it has played. */
21
23
  export function direLaFermeture(o: {
22
24
  issue: string;
23
25
  reservation: { depuis: number } | null;
24
- prises: readonly { ticket?: string | null; racine?: string | null }[];
25
- parts: readonly { ticket?: string | null; projet?: string | null; etat?: string }[];
26
+ prises: readonly { ticket?: string | null; racine?: string | null; sorte?: string | null }[];
27
+ attentes?: readonly object[];
26
28
  maintenant: number;
27
29
  }): string[];
@@ -1,7 +1,8 @@
1
1
  // The closure of the machine by the supervisor (docs/architecture/machine.md, §5.7):
2
2
  // the decision of each command on the reservation of the machine in place, and the lines it
3
- // says, what still runs by project and by ticket (sessions: the places of the workflow of the
4
- // machine; passes: their parts), « la machine est vide » when nothing plays, and how long the
3
+ // says, what still runs by project and by ticket (the reservations the arbiter holds: those of the
4
+ // sessions, and those of the passes, which carry their sort), « la machine est vide » when nothing
5
+ // plays, and how long the
5
6
  // closure has lasted. Pure: the workflow of the places (src/temporal/places/deroule.ts) bundles
6
7
  // the decisions, so this module imports only a rule that imports nothing. The commands themselves
7
8
  // are scripts/machine.mjs.
@@ -33,14 +34,13 @@ const nomDuProjet = racine => (racine ? (racine.split('/').filter(Boolean).at(-1
33
34
  const pluriel = (n, mot) => `${n} ${mot}${n > 1 ? 's' : ''}`;
34
35
 
35
36
  /**
36
- * What still runs, one line by project: its sessions (`prises`, the places of the workflow of the
37
- * machine) and its passes (`parts` that hold their part; a pass that waits does not run), each with
38
- * its tickets. Only « la machine est vide » when nothing runs.
39
- * @param {{ prises: { ticket?: string | null, racine?: string | null }[],
40
- * parts: { ticket?: string | null, projet?: string | null, etat?: string }[] }} o
37
+ * What still runs, one line by project: the reservations the arbiter holds (`prises`), a session
38
+ * (no `sorte`) or a pass (its `sorte`), each with its tickets; a request that waits does not run.
39
+ * Only « la machine est vide » when nothing runs.
40
+ * @param {{ prises: { ticket?: string | null, racine?: string | null, sorte?: string | null }[] }} o
41
41
  * @returns {string[]}
42
42
  */
43
- export function direCeQuiTourne({ prises, parts }) {
43
+ export function direCeQuiTourne({ prises }) {
44
44
  /** @type {Map<string, { seances: string[], passes: string[] }>} */
45
45
  const projets = new Map();
46
46
  const de = nom => {
@@ -50,10 +50,7 @@ export function direCeQuiTourne({ prises, parts }) {
50
50
  return projets.get(nom);
51
51
  };
52
52
  for (const p of prises) {
53
- de(nomDuProjet(p.racine)).seances.push(p.ticket ?? 'sans ticket');
54
- }
55
- for (const p of parts.filter(x => x.etat !== 'attend')) {
56
- de(nomDuProjet(p.projet)).passes.push(p.ticket ?? 'sans ticket');
53
+ de(nomDuProjet(p.racine))[p.sorte ? 'passes' : 'seances'].push(p.ticket ?? 'sans ticket');
57
54
  }
58
55
  if (!projets.size) {
59
56
  return ['la machine est vide'];
@@ -74,12 +71,11 @@ export function direCeQuiTourne({ prises, parts }) {
74
71
  * closure; `rouverte`, `deja-ouverte` for the reopening), then, for a closure, what still runs. <reservation> is the one in place after the
75
72
  * command (its start gives how long the closure has lasted), <maintenant> the time in ms.
76
73
  * @param {{ issue: string, reservation: { depuis: number } | null,
77
- * prises: Parameters<typeof direCeQuiTourne>[0]['prises'],
78
- * parts: Parameters<typeof direCeQuiTourne>[0]['parts'], maintenant: number }} o
74
+ * prises: Parameters<typeof direCeQuiTourne>[0]['prises'], maintenant: number }} o
79
75
  * @returns {string[]}
80
76
  */
81
- export function direLaFermeture({ issue, reservation, prises, parts, maintenant }) {
82
- const tourne = direCeQuiTourne({ prises, parts });
77
+ export function direLaFermeture({ issue, reservation, prises, maintenant }) {
78
+ const tourne = direCeQuiTourne({ prises });
83
79
  switch (issue) {
84
80
  case 'fermee':
85
81
  return ['machine fermée par le superviseur : aucune place neuve, aucun circuit neuf', ...tourne];
@@ -0,0 +1,9 @@
1
+ /** The frame's directory of configuration on the poste, null without HOME nor XDG_CONFIG_HOME. */
2
+ export function configurationDuPoste(env: Record<string, string | undefined>): string | null;
3
+ /** The variables of the text of a file of the poste (`VARIABLE=valeur` lines). */
4
+ export function variablesDuTexte(texte: string): Record<string, string>;
5
+ /** `env` with the variables of the file of the poste `fichier`, then `ajouts`; `env` itself when it already holds one. */
6
+ export function avecLeFichierDuPoste<T extends Record<string, string | undefined>>(
7
+ env: T,
8
+ o: { fichier: string; ajouts?: Record<string, string>; lire?: (f: string) => string | null }
9
+ ): T;
@@ -49,24 +49,6 @@ export function attentesExternes(
49
49
  o?: { enCours?: Set<string>; externes?: Record<string, TicketDeBeads[]> }
50
50
  ): Array<{ ticket: string; attend: string; faute: string | null }>;
51
51
 
52
- /**
53
- * The circuits that hold a place in the limit of the project: those that work, those resumed and
54
- * waiting for their place of the machine, and those stopped on a question to the supervisor (no
55
- * recipient, or « superviseur »); the question to the owner, the ticket deferred (to a later time
56
- * at `maintenant`, or with no hour) and the wait for
57
- * another project release it. `superviseur`: those of `tenant` that wait for the supervisor.
58
- */
59
- export function circuitsDeLaLimite(
60
- circuits: Array<{
61
- ticket: string;
62
- etape?: string | null;
63
- question?: { qui?: string } | null;
64
- report?: object | null;
65
- }>,
66
- tous: TicketDeBeads[],
67
- o?: { externes?: Record<string, TicketDeBeads[]>; maintenant?: number }
68
- ): { tenant: string[]; superviseur: string[] };
69
-
70
52
  /** The instant (ms) until which the ticket `t` is deferred at `maintenant`, else null. */
71
53
  export function reporteJusqua(t: { defer_until?: string }, maintenant: number): number | null;
72
54