@roomi-fields/grillhouse 0.54.1 → 0.55.1

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 (236) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/CHANGELOG.md +69 -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 +16 -0
  77. package/dist/temporal/places/client.js +25 -1
  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/consommation-des-passes.mjs +67 -31
  118. package/scripts/consommation.mjs +152 -24
  119. package/scripts/copies-finies.mjs +15 -35
  120. package/scripts/dernier-vert.mjs +4 -5
  121. package/scripts/dette.mjs +5 -3
  122. package/scripts/droits.mjs +2 -2
  123. package/scripts/echantillonneur-de-la-passe.mjs +7 -31
  124. package/scripts/engendres.mjs +5 -61
  125. package/scripts/enveloppe/enveloppe.mjs +30 -34
  126. package/scripts/enveloppe/travail-de-la-copie.mjs +5 -0
  127. package/scripts/etapes.mjs +21 -7
  128. package/scripts/etat-du-depot.mjs +61 -0
  129. package/scripts/faits-du-circuit.mjs +7 -4
  130. package/scripts/fermeture-de-la-machine.d.mts +6 -4
  131. package/scripts/fermeture-de-la-machine.mjs +12 -16
  132. package/scripts/fichier-du-poste.d.mts +9 -0
  133. package/scripts/file-des-tickets.d.mts +0 -18
  134. package/scripts/file-des-tickets.mjs +0 -42
  135. package/scripts/fusion-du-changelog.mjs +1 -1
  136. package/scripts/grillhouse-maj.mjs +1 -1
  137. package/scripts/index-des-rouges.d.mts +40 -0
  138. package/scripts/index-des-rouges.mjs +104 -0
  139. package/scripts/integration/file.mjs +13 -63
  140. package/scripts/integration/integrer.mjs +157 -424
  141. package/scripts/integration/jugement.mjs +109 -0
  142. package/scripts/integration/rejeu.mjs +94 -71
  143. package/scripts/jointure.d.ts +34 -27
  144. package/scripts/journal-des-etats.d.mts +1 -1
  145. package/scripts/langages/c/commandes.mjs +27 -12
  146. package/scripts/langages/cargo/commandes.mjs +148 -94
  147. package/scripts/langages/cargo/index.mjs +2 -1
  148. package/scripts/langages/cargo/lectures-des-tests.mjs +132 -0
  149. package/scripts/langages/cargo/migrations/lectures-des-tests.mjs +31 -0
  150. package/scripts/langages/python/commandes.mjs +31 -15
  151. package/scripts/langages/python/index.mjs +2 -1
  152. package/scripts/langages/python/lectures-des-tests.mjs +148 -0
  153. package/scripts/langages/python/migrations/lectures-des-tests.mjs +31 -0
  154. package/scripts/langages/typescript/consommateurs-arbitres.mjs +2 -2
  155. package/scripts/langages/typescript/index.mjs +4 -0
  156. package/scripts/langages/typescript/lectures-des-tests.mjs +95 -0
  157. package/scripts/langages/typescript/migrations/lectures-des-tests.mjs +31 -0
  158. package/scripts/langages/typescript/tests-de-nuit.mjs +9 -15
  159. package/scripts/langages/typescript/tests.mjs +11 -37
  160. package/scripts/langages/typescript/titres-de-tests.mjs +5 -4
  161. package/scripts/langages/typescript/verifier.mjs +74 -44
  162. package/scripts/langages/typescript/vitest-config/base.mjs +3 -3
  163. package/scripts/langages/typescript/vitest-config/machine.setup.mjs +6 -25
  164. package/scripts/lectures-communes.mjs +234 -0
  165. package/scripts/machine.mjs +11 -18
  166. package/scripts/mesure/base-de-passe.mjs +1 -2
  167. package/scripts/mesure-de-la-machine.d.mts +40 -3
  168. package/scripts/mesure-de-la-machine.mjs +201 -11
  169. package/scripts/migrations/0.33.0-ci-du-cadre.mjs +3 -3
  170. package/scripts/migrations/nuit-yml-retire.mjs +25 -0
  171. package/scripts/migrations/part-retiree.mjs +31 -0
  172. package/scripts/migrations.mjs +4 -0
  173. package/scripts/montee.mjs +9 -0
  174. package/scripts/nuit-de-pc2.mjs +628 -0
  175. package/scripts/nuit.sh +8 -131
  176. package/scripts/paquets.mjs +1 -1
  177. package/scripts/passe-de-la-machine.mjs +340 -103
  178. package/scripts/place-du-circuit.d.mts +15 -0
  179. package/scripts/place-du-circuit.mjs +32 -0
  180. package/scripts/places-de-la-machine.mjs +148 -626
  181. package/scripts/places-du-serveur.mjs +26 -13
  182. package/scripts/plafond-de-la-machine.d.mts +8 -13
  183. package/scripts/plafond-de-la-machine.mjs +26 -56
  184. package/scripts/registre-des-entrees.mjs +57 -0
  185. package/scripts/regles-des-places.d.mts +82 -50
  186. package/scripts/regles-des-places.mjs +192 -156
  187. package/scripts/retirer-copie.sh +2 -2
  188. package/scripts/seances.mjs +181 -63
  189. package/scripts/secours.mjs +95 -0
  190. package/scripts/services-du-noyau.mjs +11 -19
  191. package/scripts/sous-commandes.mjs +1 -0
  192. package/scripts/sous-modules.sh +1 -1
  193. package/scripts/superviseur.mjs +16 -7
  194. package/scripts/table-des-consommations.d.mts +9 -0
  195. package/scripts/table-des-consommations.mjs +35 -0
  196. package/scripts/tableau.mjs +33 -19
  197. package/scripts/taches-du-graphe.mjs +124 -2
  198. package/scripts/transitions.d.mts +27 -5
  199. package/scripts/transitions.mjs +122 -104
  200. package/scripts/verdict-de-la-nuit.d.mts +13 -0
  201. package/scripts/verdict-de-la-nuit.mjs +34 -7
  202. package/scripts/verrou-de-fichier.mjs +1 -2
  203. package/scripts/workflows-du-cadre.mjs +2 -2
  204. package/skills/developpeur/SKILL.md +8 -2
  205. package/skills/direct/SKILL.md +5 -0
  206. package/skills/explorateur/SKILL.md +10 -1
  207. package/skills/grill/SKILL.md +2 -4
  208. package/skills/pitmaster/SKILL.md +7 -5
  209. package/skills/pitmaster/references/consigne-agent.md +1 -1
  210. package/skills/relecteur/SKILL.md +4 -1
  211. package/skills/testwriter/SKILL.md +15 -2
  212. package/cadre/templates/projet/.env.example +0 -57
  213. package/cadre/templates/projet/.github/workflows/nuit.yml +0 -139
  214. package/cadre/templates/projet/deployment/README.md +0 -98
  215. package/cadre/templates/projet/deployment/docs/01-INSTALL.md +0 -145
  216. package/cadre/templates/projet/deployment/docs/02-CONFIGURATION.md +0 -117
  217. package/cadre/templates/projet/deployment/docs/03-API.md +0 -264
  218. package/cadre/templates/projet/deployment/docs/04-TROUBLESHOOTING.md +0 -262
  219. package/cadre/templates/projet/deployment/scripts/install.ps1 +0 -100
  220. package/cadre/templates/projet/deployment/scripts/start.ps1 +0 -61
  221. package/cadre/templates/projet/deployment/scripts/stop.ps1 +0 -37
  222. package/cadre/templates/projet/deployment/scripts/test.ps1 +0 -118
  223. package/cadre/templates/projet/ecosystem.config.cjs +0 -73
  224. package/cadre/templates/projet/src/config.ts +0 -68
  225. package/cadre/templates/projet/src/errors.ts +0 -102
  226. package/cadre/templates/projet/src/index.ts +0 -46
  227. package/cadre/templates/projet/src/services/.gitkeep +0 -8
  228. package/cadre/templates/projet/src/types/index.ts +0 -24
  229. package/cadre/templates/projet/src/utils/logger.ts +0 -106
  230. package/cadre/templates/projet/tests/unit/config.spec.ts +0 -68
  231. package/cadre/templates/projet/tests/unit/errors.spec.ts +0 -132
  232. package/cadre/templates/projet/tests/unit/types.spec.ts +0 -73
  233. package/cadre/templates/projet/tsconfig.build.json +0 -14
  234. package/scripts/flux-de-la-nuit.mjs +0 -39
  235. package/scripts/garde-de-la-memoire.mjs +0 -231
  236. package/scripts/repli-de-la-nuit.mjs +0 -184
@@ -1,7 +1,9 @@
1
1
  // What a heavy pass consumes, kept with the project: the transient scope of the user's systemd
2
2
  // manager a pass runs in (`scopeSystemd`, read for `CPUUsageNSec` and `MemoryPeak`), the
3
3
  // register under `<git common dir>/grillhouse/` where each measure is a line added
4
- // (`garderLaConsommation`), and the figures per kind of pass (`bilanDeLaConsommation`). The pass
4
+ // (`garderLaConsommation`), and the figures per kind of heavy pass (`bilanDeLaConsommation`). A
5
+ // line names its `phase` (the step of the circuit, or the pass out of it), the `execution` its
6
+ // commands of one step share, and `lourde: false` for a pass that is not heavy. The pass
5
7
  // itself is `avecLaPasse` (./passe-de-la-machine.mjs). Architecture: docs/architecture/machine.md
6
8
  // (§3.1, §5.6).
7
9
  import { spawn, spawnSync } from 'node:child_process';
@@ -15,7 +17,9 @@ const TRANCHE_DU_CADRE = 'grillhouse.slice';
15
17
  const REGISTRE = 'consommation.jsonl';
16
18
  // The client of the D-Bus of the user's systemd manager, which starts the transient scope.
17
19
  const CLIENT_DBUS = 'busctl';
18
- const SAMPLEUR =fileURLToPath(new URL('./echantillonneur-de-la-passe.mjs', import.meta.url));
20
+ import { uniteDeLEtape } from './mesure-de-la-machine.mjs';
21
+
22
+ const SAMPLEUR = fileURLToPath(new URL('./echantillonneur-de-la-passe.mjs', import.meta.url));
19
23
  // systemd's "infinity" for a 64-bit counter.
20
24
  const INFINI = 2n ** 64n - 1n;
21
25
 
@@ -54,7 +58,19 @@ export function fichierDeConsommation(racine) {
54
58
  }
55
59
 
56
60
  /**
57
- * Adds <ligne> (`{ sorte, ticket?, dureeMs, cpuNs, memoirePic, coeurs, issue, fin }`) to the
61
+ * What a line of the register says of its pass beside its figures: its `phase`, the `execution`
62
+ * of its step, and `lourde: false` for a pass that is not heavy.
63
+ * @param {{ phase?: string | null, execution?: string, lourde?: boolean }} o
64
+ */
65
+ export const marquesDeLaPasse = ({ phase, execution, lourde }) => ({
66
+ ...(phase ? { phase } : {}),
67
+ ...(execution ? { execution } : {}),
68
+ ...(lourde === false ? { lourde: false } : {}),
69
+ });
70
+
71
+ /**
72
+ * Adds <ligne> (`{ sorte, phase, execution?, lourde?, ticket?, dureeMs, cpuNs, memoirePic, coeurs,
73
+ * issue, fin }`) to the
58
74
  * register of <racine>; nothing out of git.
59
75
  * @param {string} racine
60
76
  * @param {Record<string, unknown>} ligne
@@ -103,9 +119,10 @@ const mediane = valeurs => {
103
119
  };
104
120
 
105
121
  /**
106
- * Per kind of pass, in the order of first appearance: the number of passes, the median and the
107
- * maximum of the cores occupied (processor time ÷ duration) and of the peak of memory. A line
108
- * whose processor time is unreadable, or whose duration is nil, is left out.
122
+ * Per kind of heavy pass, in the order of first appearance: the number of passes, the median and
123
+ * the maximum of the cores occupied (processor time ÷ duration) and of the peak of memory. A line
124
+ * of a pass that is not heavy, whose processor time is unreadable, or whose duration is nil, is
125
+ * left out.
109
126
  * @param {Record<string, any>[]} lignes
110
127
  * @returns {{ sorte: string, passes: number, coeursMediane: number, coeursMax: number,
111
128
  * memoireMediane: number, memoireMax: number }[]}
@@ -113,7 +130,7 @@ const mediane = valeurs => {
113
130
  export function bilanDeLaConsommation(lignes) {
114
131
  const parSorte = new Map();
115
132
  for (const l of lignes) {
116
- if (typeof l.cpuNs !== 'number' || !(l.dureeMs > 0)) {
133
+ if (l.lourde === false || typeof l.cpuNs !== 'number' || !(l.dureeMs > 0)) {
117
134
  continue;
118
135
  }
119
136
  const liste = parSorte.get(l.sorte) ?? [];
@@ -204,10 +221,9 @@ export const DEPASSEMENT = 1.5;
204
221
  export const SEUIL_DE_DEPASSEMENT_MS = 5_000;
205
222
 
206
223
  // Starts the sampler of a pass outside its group (./echantillonneur-de-la-passe.mjs): it reads the
207
- // group <unite> while the pass lives, notes its last reading beside the marker, and, given the part
208
- // of the pass, says in the file of the part when the pass exceeds it. Without a register for the
209
- // project, nothing is started.
210
- function demarrerLEchantillonneur({ racine, sorte, ticket, coeurs, part, unite, id }) {
224
+ // group <unite> while the pass lives and notes its last reading beside the marker. Without a
225
+ // register for the project, nothing is started.
226
+ function demarrerLEchantillonneur({ racine, sorte, marques, ticket, coeurs, unite, id }) {
211
227
  const registre = fichierDeConsommation(racine);
212
228
  const marqueur = registre === null ? null : path.join(path.dirname(registre), `${id}.fin`);
213
229
  if (marqueur === null) {
@@ -223,8 +239,7 @@ function demarrerLEchantillonneur({ racine, sorte, ticket, coeurs, part, unite,
223
239
  pid: process.pid,
224
240
  racine,
225
241
  marqueur,
226
- part,
227
- base: { sorte, ...(ticket ? { ticket } : {}), coeurs, debut: Date.now() },
242
+ base: { sorte, ...marques, ...(ticket ? { ticket } : {}), coeurs, debut: Date.now() },
228
243
  }),
229
244
  ],
230
245
  { detached: true, stdio: 'ignore' }
@@ -238,21 +253,31 @@ function demarrerLEchantillonneur({ racine, sorte, ticket, coeurs, part, unite,
238
253
  * ./passe-de-la-machine.mjs): `ouvrir()` starts the sampler, which reads the group named after the
239
254
  * part of the pass while its command runs, and returns `{ unite, lire, clore }`: `lire()` the last
240
255
  * reading the sampler noted, null without one.
241
- * @param {{ racine: string, sorte: string, ticket?: string, coeurs: number,
242
- * part: { id: string, coeurs: number, memoire: number, dossier: string }, mesurer?: boolean }} o
256
+ * @param {{ racine: string, sorte: string, phase?: string | null, execution?: string,
257
+ * lourde?: boolean, ticket?: string, coeurs: number,
258
+ * part: { id: string, coeurs: number, memoire: number, limite?: number } }} o
243
259
  */
244
- export function scopeDeCommande({ racine, sorte, ticket, coeurs, part, mesurer = true }) {
260
+ export function scopeDeCommande({ racine, sorte, ticket, coeurs, part, ...passe }) {
261
+ const marques = marquesDeLaPasse(passe);
245
262
  return {
246
263
  ouvrir() {
247
- const unite = `grillhouse-passe-${part.id}.scope`;
248
- const { marqueur } = mesurer
249
- ? demarrerLEchantillonneur({ racine, sorte, ticket, coeurs, part, unite, id: part.id })
250
- : { marqueur: null };
264
+ const unite = uniteDeLEtape(part.id);
265
+ const { marqueur } = demarrerLEchantillonneur({
266
+ racine,
267
+ sorte,
268
+ marques,
269
+ ticket,
270
+ coeurs,
271
+ unite,
272
+ id: part.id,
273
+ });
251
274
  return {
252
275
  unite,
253
276
  lire: () => {
254
277
  try {
255
- return marqueur === null ? null : JSON.parse(readFileSync(`${marqueur}.lecture`, 'utf8'));
278
+ return marqueur === null
279
+ ? null
280
+ : JSON.parse(readFileSync(`${marqueur}.lecture`, 'utf8'));
256
281
  } catch {
257
282
  return null;
258
283
  }
@@ -271,11 +296,12 @@ export function scopeDeCommande({ racine, sorte, ticket, coeurs, part, mesurer =
271
296
  * The real scope of a pass that is the process itself: `ouvrir()` moves this process into a
272
297
  * transient scope of the user's systemd manager (`StartTransientUnit` with its PID, which its
273
298
  * children inherit), the CPU weight and the memory bound of its part among its properties, after
274
- * having started the sampler outside it (<mesurer>), and returns `{ lire, clore }`; `{ raison }`
299
+ * having started the sampler outside it, and returns `{ lire, clore }`; `{ raison }`
275
300
  * when no manager of the user is reachable. The scope goes when empty.
276
- * @param {{ racine: string, sorte: string, ticket?: string, coeurs: number,
277
- * part?: { id: string, coeurs: number, memoire: number, dossier: string } | null,
278
- * mesurer?: boolean }} o
301
+ * @param {{ racine: string, sorte: string, phase?: string | null, execution?: string,
302
+ * lourde?: boolean, ticket?: string, coeurs: number,
303
+ * part?: { id: string, coeurs: number, memoire: number, limite?: number } | null,
304
+ * fils?: number[] | null }} o
279
305
  * @returns {{ ouvrir: () => { lire: () => ({ cpuNs: number | null, memoirePic: number | null } | null),
280
306
  * clore: () => void } | { raison: string } }}
281
307
  */
@@ -285,9 +311,10 @@ export function scopeSystemd({
285
311
  ticket,
286
312
  coeurs,
287
313
  part = null,
288
- mesurer = true,
289
314
  fils = null,
315
+ ...passe
290
316
  }) {
317
+ const marques = marquesDeLaPasse(passe);
291
318
  // `AllowedCPUs` of systemd is a bit mask of the threads, a byte array, the first byte the
292
319
  // threads 0 to 7.
293
320
  const masque = (() => {
@@ -296,7 +323,7 @@ export function scopeSystemd({
296
323
  }
297
324
  const octets = new Array(Math.floor(Math.max(...fils) / 8) + 1).fill(0);
298
325
  for (const f of fils) {
299
- octets[Math.floor(f / 8)] |= 1 << f % 8;
326
+ octets[Math.floor(f / 8)] |= 1 << (f % 8);
300
327
  }
301
328
  return octets.map(String);
302
329
  })();
@@ -304,9 +331,15 @@ export function scopeSystemd({
304
331
  ouvrir() {
305
332
  const id = `${process.pid}-${Date.now()}`;
306
333
  const unite = `grillhouse-passe-${id}.scope`;
307
- const { marqueur, echantillonneur } = mesurer
308
- ? demarrerLEchantillonneur({ racine, sorte, ticket, coeurs, part, unite, id })
309
- : { marqueur: null, echantillonneur: null };
334
+ const { marqueur, echantillonneur } = demarrerLEchantillonneur({
335
+ racine,
336
+ sorte,
337
+ marques,
338
+ ticket,
339
+ coeurs,
340
+ unite,
341
+ id,
342
+ });
310
343
  const r = spawnSync(
311
344
  CLIENT_DBUS,
312
345
  [
@@ -319,7 +352,7 @@ export function scopeSystemd({
319
352
  'ssa(sv)a(sa(sv))',
320
353
  unite,
321
354
  'fail',
322
- String(4 + (part ? 2 : 0) + (masque.length > 0 ? 2 : 0)),
355
+ String(4 + (part ? 3 : 0) + (masque.length > 0 ? 2 : 0)),
323
356
  'PIDs',
324
357
  'au',
325
358
  '1',
@@ -341,6 +374,9 @@ export function scopeSystemd({
341
374
  'MemoryMax',
342
375
  't',
343
376
  String(Math.floor(part.limite ?? part.memoire)),
377
+ 'CPUQuotaPerSecUSec',
378
+ 't',
379
+ String((part.limiteCoeurs ?? part.coeurs) * 1_000_000),
344
380
  ]
345
381
  : []),
346
382
  // Under the framework slice, whose cores are not those withdrawn from the user's `app.slice`.
@@ -1,44 +1,172 @@
1
- // `grillhouse consommation [--json]`: what the heavy passes of the project consume, per kind of
2
- // pass, read from its register (./consommation-des-passes.mjs): the number of passes, the median
3
- // and the maximum of the cores occupied (processor time ÷ duration) and of the peak of memory.
4
- // Architecture: docs/architecture/machine.md (§5.6).
1
+ // `grillhouse consommation`, from the register of the consumptions of the project
2
+ // (./consommation-des-passes.mjs): what its heavy passes consume, per kind of pass (the number of
3
+ // passes, the median and the maximum of the cores occupied, processor time ÷ duration, and of the
4
+ // peak of memory), and the table of the consumptions, per phase
5
+ // (src/machine/table-des-consommations.ts, from the build; ./table-des-consommations.mjs).
6
+ //
7
+ // grillhouse consommation the figures per kind, then the table computed again and
8
+ // its difference with the written one, which stands
9
+ // grillhouse consommation --ecrire the same, the table written
10
+ // grillhouse consommation --actualiser writes the table and says each phase whose reservation
11
+ // changes by more than a quarter
12
+ // grillhouse consommation --json the figures per kind alone, in JSON
13
+ // grillhouse consommation --planifier creates or updates the one schedule of the machine that
14
+ // plays `--actualiser` in each of its projects every day
15
+ //
16
+ // Another argument, or two gestures at once, is refused (exit 2). Architecture:
17
+ // docs/architecture/machine.md (§4.2, §5.6).
18
+ import { mkdirSync } from 'node:fs';
19
+ import { createRequire } from 'node:module';
20
+ import path from 'node:path';
5
21
  import { pathToFileURL } from 'node:url';
22
+ import { AttenteDeLaMachine } from './attente-de-la-machine.mjs';
6
23
  import { bilanDeLaConsommation, lireLaConsommation } from './consommation-des-passes.mjs';
24
+ import { ecrireAtomique } from './mesure/avancement.mjs';
25
+ import { budgetDeLaPasse } from './places-de-la-machine.mjs';
26
+ import { partDe } from './plafond-de-la-machine.mjs';
27
+ import { fichierDeLaTable, lireLaTable } from './table-des-consommations.mjs';
7
28
 
8
29
  const GO = 1024 ** 3;
9
30
  const go = o => `${(o / GO).toFixed(1)} Go`;
10
31
  const coeurs = c => c.toFixed(1);
11
32
 
33
+ const GESTES = ['--json', '--ecrire', '--actualiser', '--planifier'];
34
+ const USAGE =
35
+ 'Usage : grillhouse consommation [--json | --ecrire | --actualiser | --planifier]\n';
36
+
37
+ // The modules this command loads from the build of the package's TypeScript, typed by their sources:
38
+ // the computation of the table, and the client of its schedule, loaded when it is asked for.
39
+ /**
40
+ * @returns {{
41
+ * tableDesPhases: typeof import('../src/machine/table-des-consommations.js').tableDesPhases,
42
+ * reservationsChangees:
43
+ * typeof import('../src/machine/table-des-consommations.js').reservationsChangees }}
44
+ */
45
+ const calculDeLaTable = () =>
46
+ createRequire(import.meta.url)('../dist/machine/table-des-consommations.js');
47
+ /**
48
+ * @returns {Promise<{ planifierLeRecalcul:
49
+ * typeof import('../src/temporal/consommation/commande.js').planifierLeRecalcul }>}
50
+ */
51
+ const commandeDeLaPlanification = () => import('../dist/temporal/consommation/commande.js');
52
+
53
+ // The table of the project at <racine> computed again, its `veille` the written one.
54
+ function recalculer(racine, lignes) {
55
+ return calculDeLaTable().tableDesPhases(lignes, {
56
+ budget: budgetDeLaPasse(process.env),
57
+ defaut: partDe({ budget: budgetDeLaPasse(process.env) }),
58
+ maintenant: Date.now(),
59
+ veille: lireLaTable(racine),
60
+ });
61
+ }
62
+
63
+ function ecrireLaTable(racine, table) {
64
+ const f = fichierDeLaTable(racine);
65
+ if (f === null) {
66
+ throw new AttenteDeLaMachine(`✗ ${racine} n'est pas un dépôt git : aucune table.`, 1);
67
+ }
68
+ mkdirSync(path.dirname(f), { recursive: true });
69
+ ecrireAtomique(f, table);
70
+ return f;
71
+ }
72
+
73
+ const reservation = p => `${p.coeurs} cœurs, ${go(p.memoire)}`;
74
+
75
+ // The table <table> beside the one it replaces, a line per phase.
76
+ function direLaTable(table, ecrire) {
77
+ const { jours, minimum } = table.fenetre;
78
+ ecrire(`table des consommations, recalculée sur ${jours} jours :\n`);
79
+ const phases = Object.entries(table.phases).sort(([a], [b]) => a.localeCompare(b));
80
+ if (phases.length === 0) {
81
+ ecrire('aucune phase mesurée\n');
82
+ }
83
+ for (const [phase, p] of phases) {
84
+ const defaut = p.mesures < minimum ? ` (moins de ${minimum} mesures : la part du projet)` : '';
85
+ const ecrite = p.veille
86
+ ? `table écrite : ${reservation(p.veille)}, limite ${go(p.veille.limite)}`
87
+ : 'absente de la table écrite';
88
+ ecrire(
89
+ `${phase} : ${p.mesures} mesures, réserve ${reservation(p)}, limite ${go(p.limite)}${defaut} ; ${ecrite}\n`
90
+ );
91
+ }
92
+ }
93
+
94
+ function direLeBilan(lignes, rangs, ecrire) {
95
+ if (rangs.length === 0) {
96
+ ecrire('aucune mesure\n');
97
+ return;
98
+ }
99
+ for (const r of rangs) {
100
+ // The passes of this kind that consumed clearly more than their part, the last one said.
101
+ const depassent = lignes.filter(l => l.sorte === r.sorte && l.depasse);
102
+ const depasse = depassent.length
103
+ ? ` ; ⚠ ${depassent.length} dépassent leur part (la dernière, ${depassent.at(-1).depasse})`
104
+ : '';
105
+ ecrire(
106
+ `${r.sorte} : ${r.passes} passes, cœurs occupés médiane ${coeurs(r.coeursMediane)} max ${coeurs(r.coeursMax)}, ` +
107
+ `pic de mémoire médiane ${go(r.memoireMediane)} max ${go(r.memoireMax)}${depasse}\n`
108
+ );
109
+ }
110
+ }
111
+
12
112
  /**
13
- * Writes the figures of the project at <racine> through <ecrire>; returns the exit code (0).
14
- * @param {{ args: string[], racine: string, ecrire: (texte: string) => void }} o
15
- * @returns {number}
113
+ * Plays `grillhouse consommation` with <args> on the project at <racine>, written through <ecrire>,
114
+ * a fault through <signaler>: the exit code, a promise of it for `--planifier`.
115
+ * @param {{ args: string[], racine: string, ecrire: (texte: string) => void,
116
+ * signaler?: (texte: string) => void }} o
117
+ * @returns {number | Promise<number>}
16
118
  */
17
- export function consommation({ args, racine, ecrire }) {
119
+ export function consommation({
120
+ args,
121
+ racine,
122
+ ecrire,
123
+ signaler = t => process.stderr.write(t),
124
+ }) {
125
+ if (args.length > 1 || args.some(a => !GESTES.includes(a))) {
126
+ signaler(`⛔ grillhouse consommation : « ${args.join(' ')} » ne se comprend pas.\n${USAGE}`);
127
+ return 2;
128
+ }
129
+ const [geste] = args;
130
+ if (geste === '--planifier') {
131
+ return commandeDeLaPlanification().then(m => m.planifierLeRecalcul(ecrire, signaler));
132
+ }
18
133
  const lignes = lireLaConsommation(racine);
19
134
  const rangs = bilanDeLaConsommation(lignes);
20
- if (args.includes('--json')) {
135
+ if (geste === '--json') {
21
136
  ecrire(`${JSON.stringify(rangs)}\n`);
22
- } else if (rangs.length === 0) {
23
- ecrire('aucune mesure\n');
24
- } else {
25
- for (const r of rangs) {
26
- // The passes of this kind that consumed clearly more than their part, the last one said.
27
- const depassent = lignes.filter(l => l.sorte === r.sorte && l.depasse);
28
- const depasse = depassent.length
29
- ? ` ; ⚠ ${depassent.length} dépassent leur part (la dernière, ${depassent.at(-1).depasse})`
30
- : '';
31
- ecrire(
32
- `${r.sorte} : ${r.passes} passes, cœurs occupés médiane ${coeurs(r.coeursMediane)} max ${coeurs(r.coeursMax)}, ` +
33
- `pic de mémoire médiane ${go(r.memoireMediane)} max ${go(r.memoireMax)}${depasse}\n`
34
- );
137
+ return 0;
138
+ }
139
+ if (geste !== '--actualiser') {
140
+ direLeBilan(lignes, rangs, ecrire);
141
+ }
142
+ try {
143
+ const table = recalculer(racine, lignes);
144
+ if (geste !== '--actualiser') {
145
+ direLaTable(table, ecrire);
146
+ }
147
+ if (geste === undefined) {
148
+ return 0;
149
+ }
150
+ const f = ecrireLaTable(racine, table);
151
+ if (geste === '--actualiser') {
152
+ for (const phase of calculDeLaTable().reservationsChangees(table)) {
153
+ const p = table.phases[phase];
154
+ ecrire(`${phase} : réservation ${reservation(p.veille)} → ${reservation(p)}\n`);
155
+ }
156
+ }
157
+ ecrire(`table des consommations écrite : ${f}\n`);
158
+ return 0;
159
+ } catch (e) {
160
+ if (!(e instanceof AttenteDeLaMachine)) {
161
+ throw e;
35
162
  }
163
+ signaler(`${e.message}\n`);
164
+ return e.code;
36
165
  }
37
- return 0;
38
166
  }
39
167
 
40
168
  if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) {
41
- process.exitCode = consommation({
169
+ process.exitCode = await consommation({
42
170
  args: process.argv.slice(2),
43
171
  racine: process.cwd(),
44
172
  ecrire: t => process.stdout.write(t),
@@ -15,9 +15,9 @@
15
15
  // is left out too, and pruned: its owner has played its pass in it, so it loses what the tools
16
16
  // of its languages wrote there (`ignorer`), its install (`node_modules`) kept, as its next
17
17
  // preparation would (`git clean -x -e node_modules`). Its line names each output removed with
18
- // the place it held (« target retiré (2,9 Go) »). The copy of the integration and that of the
19
- // queue, kept that no lock holds, lose them the same way: a copy that lasts holds between its
20
- // passes none of the outputs its next pass would remove anyway, and at most one pass's.
18
+ // the place it held (« target retiré (2,9 Go) »). The queue's copy, kept, loses them the same
19
+ // way: a copy that lasts holds between its passes none of the outputs its next pass would remove
20
+ // anyway, and at most one pass's.
21
21
  // The night's copy named by no one is never touched: a night may play in it.
22
22
  // - First `git worktree prune`: a copy whose folder is gone leaves the list. Then each copy
23
23
  // `git worktree list` names, the main tree and the copies named on the command line (the
@@ -28,9 +28,7 @@
28
28
  // progress (the copy's folder bears the ticket's id, `.claude/worktrees/<ticket>`, as the
29
29
  // circuit and the launcher name it; read by `bd list --status in_progress`), the working
30
30
  // directory of its circuit (`<copie>.travail`, which lives as long as the ticket,
31
- // scripts/circuit.mjs), or, for the integration copy (`.claude/worktrees/integration`), its
32
- // lock in git's common directory (`integration.lock`, scripts/integration/integrer.mjs). The
33
- // queue copy (`.claude/worktrees/file`) always stays: the workflow of the queue plays in it
31
+ // scripts/circuit.mjs). The queue copy (`.claude/worktrees/file`) always stays: the workflow of the queue plays in it
34
32
  // without a lock, one entry at a time, and prepares it again before each replay. Tickets in
35
33
  // progress that do not read, or not within a minute, hold every copy: none is removed. They are
36
34
  // read only when a copy is left to judge: a repository with no copy but the night's calls no bd.
@@ -82,8 +80,6 @@ import { nettoyerLeJournal } from './journal-des-etats.mjs';
82
80
 
83
81
  const RETIRER = path.join(import.meta.dirname, 'retirer-copie.sh');
84
82
  const PRINCIPALE = 'main';
85
- // The copies of the integration and of the queue, each held while its lock stands.
86
- const VERROUS = { integration: 'integration.lock' };
87
83
  // The queue copy, which the workflow of the queue holds without a lock (src/temporal/file/).
88
84
  const DE_LA_FILE = 'file';
89
85
  // The install of a copy: a link to the main tree's, or its own directory.
@@ -93,9 +89,9 @@ const COPIES = path.join('.claude', 'worktrees');
93
89
  // The copy of the night, its own to prepare and to remove (scripts/nuit.sh).
94
90
  const NUIT = path.join(COPIES, 'nuit');
95
91
  // The frame's copies that last, each prepared again before its pass, every untracked file removed
96
- // (`git clean -x`, scripts/nuit.sh and scripts/integration/rejeu.mjs): the night's, the
97
- // integration's, the queue's. Their folder bears no ticket.
98
- const DURABLES = new Set(['nuit', DE_LA_FILE, ...Object.keys(VERROUS)]);
92
+ // (`git clean -x`, scripts/nuit.sh and scripts/integration/rejeu.mjs): the night's and the
93
+ // queue's. Their folder bears no ticket.
94
+ const DURABLES = new Set(['nuit', DE_LA_FILE]);
99
95
 
100
96
  const lancer = (dossier, cmd, args) =>
101
97
  spawnSync(cmd, args, { cwd: dossier, encoding: 'utf8', maxBuffer: 64 * 1024 * 1024 });
@@ -117,7 +113,7 @@ const lesCopies = racine => copiesDe(git(racine, 'worktree', 'list', '--porcelai
117
113
  // held by its `.travail` no more: no circuit will ever remove it, and the copy is judged as any
118
114
  // other. Its ticket open, it stays held, and its line names the place its tools' outputs
119
115
  // (<ignorer>) hold there.
120
- function tenue({ chemin, verrou: raison }, enCours, commun, ignorer, tenus, fermes) {
116
+ function tenue({ chemin, verrou: raison }, enCours, ignorer, tenus, fermes) {
121
117
  const nom = path.basename(chemin);
122
118
  const sansCircuit = Boolean(tenus) && !tenus.has(nom);
123
119
  if (existsSync(`${chemin}.travail`) && !(sansCircuit && fermes().has(nom))) {
@@ -133,14 +129,8 @@ function tenue({ chemin, verrou: raison }, enCours, commun, ignorer, tenus, ferm
133
129
  if (raison !== null) {
134
130
  return `elle est verrouillée${raison ? ` (${raison})` : ''}`;
135
131
  }
136
- const verrou = VERROUS[nom];
137
- if (path.dirname(chemin).endsWith(path.join('.claude', 'worktrees'))) {
138
- if (nom === DE_LA_FILE) {
139
- return 'la file y rejoue ses entrées';
140
- }
141
- if (verrou && existsSync(path.join(commun, verrou))) {
142
- return `le verrou ${verrou} est posé`;
143
- }
132
+ if (nom === DE_LA_FILE && path.dirname(chemin).endsWith(COPIES)) {
133
+ return 'la file y rejoue ses entrées';
144
134
  }
145
135
  return null;
146
136
  }
@@ -321,8 +311,7 @@ function elaguer(chemin, ignorer) {
321
311
  * that no circuit holds. A copy kept whose ticket is closed loses what the tools of its languages
322
312
  * wrote there (<ignorer>, the directories the module of the language names, and `node_modules`).
323
313
  * <elaguer> names copies left out too, whose owner has played its pass (the night's own): each
324
- * loses its tools' outputs, its install kept; so does a copy of the integration or of the queue
325
- * kept that no lock holds. <tenus> names the tickets whose circuit the Temporal server holds, as
314
+ * loses its tools' outputs, its install kept; so does the queue's copy, kept. <tenus> names the tickets whose circuit the Temporal server holds, as
326
315
  * it runs or waits an answer (null when its caller does not read them): a copy beside its
327
316
  * `.travail` whose ticket is out of them stays while its ticket is open, its line saying its
328
317
  * circuit no longer runs, with the place of its tools' outputs; its ticket closed, it is judged as
@@ -361,25 +350,16 @@ export function retirerLesCopiesFinies(
361
350
  ];
362
351
  }
363
352
  git(racine, 'worktree', 'prune');
364
- const commun = git(
365
- racine,
366
- 'rev-parse',
367
- '--path-format=absolute',
368
- '--git-common-dir'
369
- ).stdout.trim();
370
353
  const copies = lesCopies(racine).slice(1);
371
354
  let fermes;
372
355
  // The closed tickets, read once, none when they do not read (each copy then stays held).
373
356
  const lesFermes = () => (fermes ??= lireFermes() ?? new Set());
374
357
  // The line of the copy <chemin> kept for <raison>: what it lost when its ticket is closed, or,
375
- // for the copy of the integration or of the queue, its tools' outputs, which its next
376
- // preparation removes; then the place it holds.
358
+ // for the queue's copy, its tools' outputs, which its next preparation removes; then the place
359
+ // it holds.
377
360
  const gardee = (chemin, raison) => {
378
361
  const nom = path.basename(chemin);
379
- if (
380
- (Object.hasOwn(VERROUS, nom) || nom === DE_LA_FILE) &&
381
- path.dirname(chemin).endsWith(COPIES)
382
- ) {
362
+ if (nom === DE_LA_FILE && path.dirname(chemin).endsWith(COPIES)) {
383
363
  const retirees = elaguer(chemin, ignorer);
384
364
  const perte = retirees.length
385
365
  ? ` ; sa prochaine préparation l'efface : ${retirees.join(', ')}`
@@ -395,7 +375,7 @@ export function retirerLesCopiesFinies(
395
375
  if (ecartees.has(reel(chemin))) {
396
376
  continue;
397
377
  }
398
- const raison = tenue(copie, enCours, commun, ignorer, tenus, lesFermes);
378
+ const raison = tenue(copie, enCours, ignorer, tenus, lesFermes);
399
379
  if (raison) {
400
380
  lignes.push(`· copie gardée : ${vu(chemin)} (${place(chemin)}) : ${raison}.`);
401
381
  continue;
@@ -51,7 +51,6 @@ import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'nod
51
51
  import { createRequire } from 'node:module';
52
52
  import os from 'node:os';
53
53
  import path from 'node:path';
54
- import { garderLArbreJuge } from './arbres-juges.mjs';
55
54
  import { etatDuDepot, fichierSous, git, SHA, sortie } from './etat-du-depot.mjs';
56
55
  // The variable that names the file of the changes since the last green, which the runner of the
57
56
  // tests of the module of the language reads in each package.
@@ -123,11 +122,11 @@ function lireLaBase(etat, base) {
123
122
  return { commit, arbre, branche: null };
124
123
  }
125
124
 
126
- // Keeps <etat> (etatDuDepot) as the last green of its branch, of main when HEAD is detached; its
127
- // tree is judged too (scripts/arbres-juges.mjs): the complete verification of a lot of the direct
128
- // way is what lets its commit go to main.
125
+ // Keeps <etat> (etatDuDepot) as the last green of its branch, of main when HEAD is detached: the
126
+ // base of the next passes' measure. It judges no tree and never lets a lot enter main: the registry
127
+ // of the trees judged (scripts/arbres-juges.mjs) is written by the final pass of the queue, the
128
+ // rescue way (scripts/secours.mjs) and the rise (scripts/montee.mjs).
129
129
  export function garderLeVert(etat) {
130
- garderLArbreJuge(etat.racine, etat.arbre);
131
130
  const branche = etat.branche ?? etat.main;
132
131
  const f = branche ? fichierDuVert(etat.racine, branche) : null;
133
132
  if (!f) {
package/scripts/dette.mjs CHANGED
@@ -38,6 +38,7 @@ import { existsSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'no
38
38
  import { tmpdir } from 'node:os';
39
39
  import path from 'node:path';
40
40
  import { pathToFileURL } from 'node:url';
41
+ import { baseDuLot } from './etat-du-depot.mjs';
41
42
  import { paquetsDeLEnveloppe } from './enveloppe/paquets-du-plan.mjs';
42
43
  import { A_DEPLACER, A_ELAGUER, A_INSCRIRE, ecrireSarif } from './resultats.mjs';
43
44
 
@@ -274,7 +275,7 @@ export function scriptDeLaBase(racine, script, env = process.env) {
274
275
  return false;
275
276
  }
276
277
  return (
277
- spawnSync('git', ['-C', racine, 'cat-file', '-e', `HEAD:${rel.split(path.sep).join('/')}`], {
278
+ spawnSync('git', ['-C', racine, 'cat-file', '-e', `${baseDuLot(racine)}:${rel.split(path.sep).join('/')}`], {
278
279
  env,
279
280
  stdio: 'ignore',
280
281
  }).status === 0
@@ -324,10 +325,11 @@ export function renommesDuCommit(racine) {
324
325
  const env = { ...process.env, GIT_INDEX_FILE: path.join(dossier, 'index') };
325
326
  const git = (...a) =>
326
327
  spawnSync('git', ['-C', racine, ...a], { encoding: 'utf8', env, maxBuffer: 256 * 1024 * 1024 });
327
- if (git('read-tree', 'HEAD').status !== 0 || git('add', '-A').status !== 0) {
328
+ const base = baseDuLot(racine);
329
+ if (!base || git('read-tree', base).status !== 0 || git('add', '-A').status !== 0) {
328
330
  return {};
329
331
  }
330
- const r = git('diff', '--cached', '-M', '--name-status', '-z', 'HEAD');
332
+ const r = git('diff', '--cached', '-M', '--name-status', '-z', base);
331
333
  if (r.status !== 0) {
332
334
  return {};
333
335
  }
@@ -166,7 +166,7 @@ export const ROLES = {
166
166
  modules: [],
167
167
  metacadre: true,
168
168
  debogage: true,
169
- competences: ['mesure', 'redacteur', 'writing-for-agents'],
169
+ competences: ['mesure', 'redacteur', 'writing-for-agents', 'architecte'],
170
170
  ecrit: true,
171
171
  index: true,
172
172
  porteSonTicket: true,
@@ -177,7 +177,7 @@ export const ROLES = {
177
177
  direct: {
178
178
  modules: ['preuve', 'tests'],
179
179
  debogage: true,
180
- competences: ['mesure', 'redacteur', 'writing-for-agents'],
180
+ competences: ['mesure', 'redacteur', 'writing-for-agents', 'architecte'],
181
181
  ecrit: true,
182
182
  index: true,
183
183
  porteSonTicket: true,