@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
@@ -52,7 +52,8 @@
52
52
  //
53
53
  // - Played by the greffon at each period: writes the line `{"reprise": <message>}` when the session
54
54
  // is to be compacted (`renouvellement`: the message of resumption at a milestone that is due,
55
- // empty after 55 minutes of idleness), nothing otherwise. `sans-reponse` says that <arretA> is
55
+ // after 15 minutes of silence of the owner and of the session, empty after 55 minutes of
56
+ // idleness), nothing otherwise. `sans-reponse` says that <arretA> is
56
57
  // the end of a turn with no answer, which serves idleness alone.
57
58
  //
58
59
  // npx grillhouse pre-compact
@@ -135,6 +136,9 @@ const DEMANDE_DE_NUIT = 'grillhouse-demande-de-nuit.json';
135
136
  // questions and the circuits come with the opening.
136
137
  const MESSAGE_DE_REPRISE =
137
138
  "Reprends la supervision : ta séance vient d'être compactée au jalon que tu as déclaré. L'ouverture te donne la note de reprise, les questions et les circuits : suis-la.";
139
+ // How long the owner and the session both stay silent before a declared milestone is played: an
140
+ // exchange with the owner is never compacted, as an update waits for the inactivity of the user.
141
+ const SILENCE_DU_JALON_MS = 15 * 60_000;
138
142
  // How long a session without a turn stays before it is compacted: its prompt cache lasts one hour.
139
143
  const INACTIVITE_MS = 55 * 60_000;
140
144
  // One renewal at a milestone per period, as the intensity and the period of an OTP supervisor
@@ -858,11 +862,12 @@ export async function ajouterLaQuestion(dossier, fichier, { env = process.env }
858
862
  /**
859
863
  * Whether the session of supervision of <dossier> is to be compacted (`superviseur --renouveler`),
860
864
  * the session holding the lock: at a milestone it declared, once a quiet Stop (<arretA>, ms, 0
861
- * without one) is later than it, with the message of resumption; else once that Stop is 55 minutes
862
- * old, with an empty message, a note or a milestone or not. With <sansReponse>, <arretA> is the end
863
- * of a turn that gave no answer, not a Stop: it serves idleness alone and plays no milestone. A message of the owner (<messageA>, ms,
864
- * 0 without one) later than the declaration cancels the milestone. The reading keeps a milestone
865
- * that is due, and records that its message was given: the opening that follows the compaction
865
+ * without one) is later than it and both that Stop and the last message of the owner (<messageA>,
866
+ * ms, 0 without one) are 15 minutes old, with the message of resumption; else once that Stop is 55
867
+ * minutes old, with an empty message, a note or a milestone or not. With <sansReponse>, <arretA> is
868
+ * the end of a turn that gave no answer, not a Stop: it serves idleness alone and plays no
869
+ * milestone. A message of the owner later than the declaration cancels the milestone. The reading
870
+ * keeps a milestone that is due, and records that its message was given: the opening that follows the compaction
866
871
  * removes it.
867
872
  * @param {string} dossier
868
873
  * @param {{ arretA: number, messageA: number, sansReponse?: boolean,
@@ -882,7 +887,11 @@ export async function renouvellement(
882
887
  if (jalon && jalon.tenant === session.tenant) {
883
888
  if (messageA > jalon.declareA) {
884
889
  rmSync(f, { force: true });
885
- } else if (!sansReponse && arretA > jalon.declareA) {
890
+ } else if (
891
+ !sansReponse &&
892
+ arretA > jalon.declareA &&
893
+ Date.now() - Math.max(arretA, messageA) >= SILENCE_DU_JALON_MS
894
+ ) {
886
895
  ecrireEntier(
887
896
  path.join(session.commun, RENOUVELLEMENT),
888
897
  `${JSON.stringify({ tenant: session.tenant, rendu: jalon.declareA })}\n`
@@ -0,0 +1,9 @@
1
+ // The types of ./table-des-consommations.mjs, for the frame's TypeScript
2
+ // (src/temporal/consommation/actualisation.ts).
3
+
4
+ /** The file of the table of the project at `racine`; null out of git. */
5
+ export function fichierDeLaTable(racine: string): string | null;
6
+ /** The table written for the project at `racine`; null without one that reads. */
7
+ export function lireLaTable(
8
+ racine: string
9
+ ): { actualisee: string; phases?: Record<string, unknown> } | null;
@@ -0,0 +1,35 @@
1
+ // The file of the table of the consumptions of a project,
2
+ // `<git common dir>/grillhouse/table-des-consommations.json`, beside the register it is drawn from
3
+ // (./consommation-des-passes.mjs): its path and its reading. Its computation is
4
+ // src/machine/table-des-consommations.ts, its command ./consommation.mjs. Architecture:
5
+ // docs/architecture/machine.md (§4.2).
6
+ import { readFileSync } from 'node:fs';
7
+ import path from 'node:path';
8
+ import { fichierDeConsommation } from './consommation-des-passes.mjs';
9
+
10
+ /**
11
+ * The file of the table of the project at <racine>, the same from each of its copies; null out of
12
+ * git.
13
+ * @param {string} racine
14
+ * @returns {string | null}
15
+ */
16
+ export function fichierDeLaTable(racine) {
17
+ const registre = fichierDeConsommation(racine);
18
+ return registre === null
19
+ ? null
20
+ : path.join(path.dirname(registre), 'table-des-consommations.json');
21
+ }
22
+
23
+ /**
24
+ * The table written for the project at <racine>; null without one that reads.
25
+ * @param {string} racine
26
+ * @returns {{ actualisee: string, phases?: Record<string, any> } | null}
27
+ */
28
+ export function lireLaTable(racine) {
29
+ try {
30
+ const t = JSON.parse(readFileSync(fichierDeLaTable(racine) ?? '', 'utf8'));
31
+ return typeof t?.actualisee === 'string' ? t : null;
32
+ } catch {
33
+ return null;
34
+ }
35
+ }
@@ -65,8 +65,9 @@
65
65
  // <durée> » read in the progress directory its state names (scripts/avancement.mjs), as Bazel's
66
66
  // counter of actions; the subject is cut when room lacks, never the figures nor the number.
67
67
  // Past FIGEE without a sign: « figée <durée> · faits/prévus », signed ⛔.
68
- // - Parts (scripts/places-de-la-machine.mjs, read by `lireLaMesure`), as Slurm's `squeue` names
69
- // who holds what: a part held or waited for stands on the ticket's line, « 🔒 » (holds) or « ⏳ »
68
+ // - Passes (the view of the arbiter, scripts/places-de-la-machine.mjs, read by `lireLaMesure`),
69
+ // as Slurm's `squeue` names who holds
70
+ // what: a reservation held or awaited stands on the ticket's line, « 🔒 » (holds) or « ⏳ »
70
71
  // (waits) after the head, before the subject: « · <sorte> · 2 cœurs · 4 Go, limite 8 Go ·
71
72
  // <durée> » (the memory reserved and where the group is cut, « sans limite » for a session), with
72
73
  // « ⚠ » when it consumes beyond its part, « · <sorte> figée <durée> » past FIGEE, « · attend 2
@@ -142,7 +143,7 @@ import {
142
143
  circuitsDuServeur,
143
144
  nuitDuServeur,
144
145
  } from './circuits-du-serveur.mjs';
145
- import { lireLeVerdict } from './verdict-de-la-nuit.mjs';
146
+ import { lireLeVerdict, lireLesRaisonsAPasser } from './verdict-de-la-nuit.mjs';
146
147
  import {
147
148
  aSonArchitecture,
148
149
  attendDeLAutreProjet,
@@ -251,6 +252,7 @@ export const TONS = Object.freeze({
251
252
  sansIssue: 'alerte',
252
253
  panne: 'alerte',
253
254
  nuitRouge: 'alerte',
255
+ nuitARepasser: 'attention',
254
256
  plafondRefuse: 'alerte',
255
257
  // The layout.
256
258
  titre: 'titre',
@@ -1227,7 +1229,7 @@ const limiteDite = p =>
1227
1229
  : `, limite ${goDe(p.limite)} Go`;
1228
1230
  // What a pass that waits asks of the memory, its reservation and its limit.
1229
1231
  const demandeDite = p =>
1230
- p.limite === undefined ? '' : ` · ${goDe(p.memoire ?? 0)} Go réservés${limiteDite(p)}`;
1232
+ p.memoire === undefined ? '' : ` · ${goDe(p.memoire)} Go réservés${limiteDite(p)}`;
1231
1233
 
1232
1234
  /**
1233
1235
  * The parts of the machine as the board says them, in lines: first the budget taken, « Parts · 2
@@ -1283,6 +1285,7 @@ export function lignesDesParts({
1283
1285
  * failed, the time of the last one that succeeded, whose circuits `circuits` holds and whose age
1284
1286
  * the alert says; `fauteTickets`, the fault of the reading of the tickets, said in an alert, and
1285
1287
  * `ticketsLusA`, the time of the last one that succeeded, whose tickets `tous` holds;
1288
+ * `raisonsDeLaNuit`, the reasons the part of PC2 of the last night is « à repasser » (`lireLesRaisonsAPasser`), one alert each;
1286
1289
  * `echecPrefixe`, the cause of a ticket prefix that did not read, named in an alert; `voies`, the
1287
1290
  * way of each circuit done (`voiesDesCircuits`), whose sign FAITS AUJOURD'HUI shows; `bilans`,
1288
1291
  * the kept bilan of each ticket (`bilansGardes`), whose status says whether the engine led it.
@@ -1297,7 +1300,7 @@ export function lignesDesParts({
1297
1300
  * depuis: number, disque?: string | null }[],
1298
1301
  * fermeture?: { auteur: 'superviseur', depuis: number, phase: string } | null } | null,
1299
1302
  * nuit?: { racine: string, depuis: number | null } | null, muet?: boolean, faute?: string | null,
1300
- * echecPrefixe?: string | null, voies?: Record<string, 'complet' | 'court'>,
1303
+ * raisonsDeLaNuit?: string[], echecPrefixe?: string | null, voies?: Record<string, 'complet' | 'court'>,
1301
1304
  * bilans?: Record<string, { statut?: string }> }} lu
1302
1305
  */
1303
1306
  export function assembler({
@@ -1315,6 +1318,7 @@ export function assembler({
1315
1318
  places: placesDeLaMachine = null,
1316
1319
  nuit: nuitEnCours = null,
1317
1320
  verdictDeLaNuit = null,
1321
+ raisonsDeLaNuit = [],
1318
1322
  muet = false,
1319
1323
  faute = null,
1320
1324
  circuitsLusA = null,
@@ -1780,6 +1784,11 @@ export function assembler({
1780
1784
  id: t.id,
1781
1785
  });
1782
1786
  }
1787
+ // The part of PC2 of the last night is « à repasser »: each reason (a tranche or the measures,
1788
+ // with its cause, « aucun passage créé » included) stands on its line, whatever the verdict.
1789
+ for (const raison of raisonsDeLaNuit) {
1790
+ alerter('nuitARepasser', { signe: '🌙', texte: `PC2 · ${raison}` });
1791
+ }
1783
1792
  // The published version that leads the repository cannot be installed: the orchestration runs on
1784
1793
  // the code of the repository (scripts/aiguillage.mjs).
1785
1794
  if (outil) {
@@ -2002,11 +2011,20 @@ export const k = n =>
2002
2011
  : n >= 1e3
2003
2012
  ? `${Math.round(n / 1e3)} k`
2004
2013
  : `${n}`;
2005
- // A cost in whole dollars, its thousands apart; a partial one, « ≥ » before the known cost.
2014
+ // A cost as the measures line says it, the unit glued: whole dollars, « 73$ », then from 1 000 $
2015
+ // thousands to two decimals, « 9.24K$ ». A partial cost is a floor, never rounded up; the line does
2016
+ // not mark it.
2006
2017
  const dollars = (cout, partiel) => {
2007
- // A known cost marked partial is a floor: never rounded up.
2008
2018
  const entiers = partiel ? Math.floor(cout + 1e-6) : Math.round(cout);
2009
- return `${partiel ? '≥ ' : ''}${String(entiers).replace(/\B(?=(\d{3})+$)/g, ' ')} $`;
2019
+ return entiers >= 1000
2020
+ ? `${(partiel ? Math.floor(entiers / 10) / 100 : Math.round(entiers / 10) / 100).toFixed(2)}K$`
2021
+ : `${entiers}$`;
2022
+ };
2023
+ // A working time in whole hours, « 733h », from 1 000 h in thousands to two decimals, « 1.23Kh »;
2024
+ // under an hour as `duree`.
2025
+ const heures = ms => {
2026
+ const h = Math.round(ms / (60 * MINUTE));
2027
+ return h >= 1000 ? `${(Math.round(h / 10) / 100).toFixed(2)}Kh` : h >= 1 ? `${h}h` : duree(ms);
2010
2028
  };
2011
2029
  export const duree = ms => {
2012
2030
  const min = Math.round(ms / MINUTE);
@@ -2241,7 +2259,7 @@ export function etatsDAgents(t) {
2241
2259
  icone: '🔒',
2242
2260
  texte: fige
2243
2261
  ? ` · ${sorte} figée ${ilYa(age)}${compte ? ` · ${compte}` : ''}`
2244
- : ` · ${sorte}${compte ? ` ${compte}` : ''}${tenu.coeurs ? ` · ${tenu.coeurs} cœurs` : ''}${tenu.limite === undefined ? '' : ` · ${goDe(tenu.memoire ?? 0)} Go${limiteDite(tenu)}`} · ${ilYa(maintenant - (tenu.depuis ?? maintenant))}${tenu.depasse ? ` · ⚠ ${tenu.depasse}` : ''}`,
2262
+ : ` · ${sorte}${compte ? ` ${compte}` : ''}${tenu.coeurs ? ` · ${tenu.coeurs} cœurs` : ''}${tenu.memoire === undefined ? '' : ` · ${goDe(tenu.memoire)} Go${limiteDite(tenu)}`} · ${ilYa(maintenant - (tenu.depuis ?? maintenant))}${tenu.depasse ? ` · ⚠ ${tenu.depasse}` : ''}`,
2245
2263
  });
2246
2264
  }
2247
2265
  const reserves = (t.machine?.prises ?? []).reduce((n, x) => n + (x.coeurs ?? 0), 0);
@@ -2431,17 +2449,12 @@ export function lignes(t, nom, largeur = LARGEUR, groupes = {}) {
2431
2449
  // The day's and the cumul's lines of <m> (`{ jour, cumul }`), each its working time, its billed
2432
2450
  // tokens and its cost.
2433
2451
  const lignesDesMesures = m => {
2434
- for (const tete of ['jour', 'cumul']) {
2452
+ const dit = (tete, cumul) => {
2435
2453
  const x = { travail: 0, jetons: 0, cout: 0, partiel: false, ...m[tete] };
2436
- L(
2437
- cadre(
2438
- `${tete} ${duree(x.travail)} · ${k(x.jetons)} · ${dollars(x.cout, x.partiel)}`,
2439
- '',
2440
- largeur
2441
- ),
2442
- TONS.mesure
2443
- );
2444
- }
2454
+ const temps = cumul ? heures(x.travail) : duree(x.travail);
2455
+ return `${tete === 'jour' ? 'Jour' : 'Cumul'} ${temps} ${k(x.jetons).replace(' ', '')} ${dollars(x.cout, x.partiel)}`;
2456
+ };
2457
+ L(cadre(`${dit('jour', false)} · ${dit('cumul', true)}`, '', largeur), TONS.mesure);
2445
2458
  };
2446
2459
  if (plusieurs) {
2447
2460
  // The lines of each project, as one project's board says them: « toi » under its label, its
@@ -3423,6 +3436,7 @@ function lire(
3423
3436
  places,
3424
3437
  nuit,
3425
3438
  verdictDeLaNuit: lireLeVerdict(commun),
3439
+ raisonsDeLaNuit: lireLesRaisonsAPasser(commun),
3426
3440
  muet,
3427
3441
  faute,
3428
3442
  circuitsLusA: lesCircuitsLus.lu,
@@ -14,6 +14,11 @@
14
14
  // `test:unit` names: it enters that task's hash alone, so a run by path of a package unchanged
15
15
  // replays from the cache, and another path moves the hash. `rejouer`, the moment of the run, is a
16
16
  // value no cached run holds: the task plays for real. The variable of the caller never passes on.
17
+ // - `lancerLesTests` is the run of the task of the tests of packages, the one code of every module of
18
+ // language (`cibles` of typescript, `tester` of cargo): out of an envelope, one run of the tests; in
19
+ // an envelope, the build `--only` of the packages it shows in writing, then the tests `--only`, a
20
+ // package it shows read-only arriving built. `construirePourLesGardes` leaves the build tasks of such
21
+ // a package out of its run as well.
17
22
  // - `construireDuPlan` is the command `construire --echec <fichier> <plan>` of every module, which
18
23
  // the launcher (scripts/enveloppe/lancer.sh) runs in the prepared copy: the session finds built
19
24
  // what it reads out of its plan. As Bazel builds the dependencies of a target before the target:
@@ -47,10 +52,10 @@
47
52
  // The mechanism: docs/architecture/tests.md §3.1 (the launcher of the tasks of the graph), §5.1
48
53
  // and §5.4.
49
54
  import { spawnSync } from 'node:child_process';
50
- import { closeSync, openSync, readFileSync, writeFileSync } from 'node:fs';
55
+ import { accessSync, closeSync, constants, openSync, readFileSync, writeFileSync } from 'node:fs';
51
56
  import { availableParallelism } from 'node:os';
52
57
  import path from 'node:path';
53
- import { lireLaListe } from './enveloppe/paquets-du-plan.mjs';
58
+ import { lireLaListe, paquetsDeLEnveloppe } from './enveloppe/paquets-du-plan.mjs';
54
59
  import { paquets } from './paquets.mjs';
55
60
  import { langage } from './langages.mjs';
56
61
  import { travailleursDeLaSeance } from './places-de-la-machine.mjs';
@@ -181,6 +186,82 @@ export function lancerLesTaches({
181
186
  return r.status ?? 1;
182
187
  }
183
188
 
189
+ /**
190
+ * True when this process may write the directory <dir>: false under a read-only mount.
191
+ * @param {string} dir
192
+ */
193
+ const inscriptible = dir => {
194
+ try {
195
+ accessSync(dir, constants.W_OK);
196
+ return true;
197
+ } catch {
198
+ return false;
199
+ }
200
+ };
201
+
202
+ /**
203
+ * The directory of each package of the frame at <racine>, by its name.
204
+ * @param {string} racine
205
+ * @returns {Map<string, string>}
206
+ */
207
+ const dossiersDesPaquets = racine =>
208
+ new Map(paquets(racine).map(p => [p.pkg.name, path.join(racine, p.dossier)]));
209
+
210
+ /**
211
+ * The run of the task of the tests of the packages <filtres> (`--filter=<nom>`, none for the whole
212
+ * graph), the one code of every module of language. Out of an envelope, one run of the tests with
213
+ * what they depend on. In the envelope of an agent, a package it shows read-only arrives built: only
214
+ * the packages it shows in writing build (`run build <traces> --only --filter=…`, `inscriptible`),
215
+ * then the tests alone (`run test:unit --only --filter=…`), <tests> in the variable of the tests.
216
+ * <lancer>(args, tests) runs one `run <args>` of the module and gives its exit code; <traces>
217
+ * (optional) gives, from the filters and the names of the packages to build, the task ids of the
218
+ * traces their tests wait for, `{ ids }`, or `{ code }` for a plan that fails. The exit code: the
219
+ * first that is not 0, else the tests'.
220
+ * @param {{ racine: string, filtres: string[], tests?: object, env?: NodeJS.ProcessEnv,
221
+ * lancer: (args: string[], tests?: object) => number,
222
+ * traces?: (filtres: string[], noms: Set<string>) => { ids?: string[], code?: number } }} o
223
+ * @returns {number}
224
+ */
225
+ export function lancerLesTests({
226
+ racine,
227
+ filtres,
228
+ tests,
229
+ env = process.env,
230
+ lancer,
231
+ traces = () => ({ ids: [] }),
232
+ }) {
233
+ if (paquetsDeLEnveloppe(env) === null) {
234
+ return lancer([SCRIPT_DES_TESTS, ...filtres], tests);
235
+ }
236
+ const dossiers = dossiersDesPaquets(racine);
237
+ const nom = f => f.slice('--filter='.length);
238
+ const construits = filtres.filter(f => inscriptible(dossiers.get(nom(f))));
239
+ if (filtres.length === 0 || construits.length > 0) {
240
+ const propres = construits.length
241
+ ? traces(construits, new Set(construits.map(nom)))
242
+ : { ids: [] };
243
+ if (propres.code !== undefined) {
244
+ return propres.code;
245
+ }
246
+ const construction = lancer(['build', ...(propres.ids ?? []), '--only', ...construits]);
247
+ if (construction !== 0) {
248
+ return construction;
249
+ }
250
+ }
251
+ return lancer([SCRIPT_DES_TESTS, '--only', ...filtres], tests);
252
+ }
253
+
254
+ /**
255
+ * Whether the pass is complete: `--tout` or `--force` (the night) among the raw arguments of
256
+ * `verifier`. The one answer the modules of language read; a complete pass plays every task of
257
+ * tests for real, as `turbo run --force` and `bazel test --nocache_test_results`.
258
+ * @param {string[]} args
259
+ * @returns {boolean}
260
+ */
261
+ export function passeComplete(args) {
262
+ return args.includes('--tout') || args.includes('--force');
263
+ }
264
+
184
265
  /**
185
266
  * The content of the variable `TESTS_CIBLES` for a targeted run: the paths and options
186
267
  * <arguments> it names, and the moment of the run when <force> (the task plays for real); undefined
@@ -195,6 +276,43 @@ export function testsCibles({ arguments: donnes, force = false }) {
195
276
  return { arguments: donnes, ...(force ? { rejouer: new Date().toISOString() } : {}) };
196
277
  }
197
278
 
279
+ /**
280
+ * The runs of a targeted pass, as the module of TypeScript plays them: the packages named whole
281
+ * (the exact folder of a package of <dossiers>) play in a run of their own whose variable
282
+ * `TESTS_CIBLES` carries no path (the options and the moment of `--force` alone), so their tasks
283
+ * hash as the complete pass's, as Bazel's `//pkg/...` shares the cache of `//...`; the other paths
284
+ * play in a run of theirs, their paths in the variable. Without a path, one run, no path.
285
+ * Each run is played by <lancer>, which receives its `chemins` and its `tests` (the content of the
286
+ * variable); the code is the first that is not 0.
287
+ * @param {{ chemins: string[], dossiers: string[], options?: string[], force?: boolean,
288
+ * lancer: (lot: { chemins: string[], tests: ReturnType<typeof testsCibles> }) => number }} o
289
+ * @returns {number}
290
+ */
291
+ export function lancerEntiersEtFichiers({
292
+ chemins,
293
+ dossiers,
294
+ options = [],
295
+ force = false,
296
+ lancer,
297
+ }) {
298
+ const sep = s => path.resolve(s);
299
+ const connus = new Set(dossiers.map(sep));
300
+ const entiers = chemins.filter(c => connus.has(sep(c)));
301
+ const fichiers = chemins.filter(c => !connus.has(sep(c)));
302
+ const lots = [];
303
+ if (chemins.length === 0 || entiers.length) {
304
+ lots.push({ chemins: entiers, tests: testsCibles({ arguments: options, force }) });
305
+ }
306
+ if (fichiers.length) {
307
+ lots.push({
308
+ chemins: fichiers,
309
+ tests: testsCibles({ arguments: [...fichiers, ...options], force }),
310
+ });
311
+ }
312
+ const codes = lots.map(lancer);
313
+ return codes.find(c => c !== 0) ?? 0;
314
+ }
315
+
198
316
  /**
199
317
  * The paths and the options of a task of the tests of a package, run by its script: the paths
200
318
  * <donnes> its script names (its own folder), each replaced by the paths of the variable
@@ -448,8 +566,12 @@ function construirePourLesGardes(outil, racine, env = process.env) {
448
566
  process.stderr.write(`⛔ ${e.message} échoue.\n`);
449
567
  return 1;
450
568
  }
569
+ // A package the envelope shows read-only arrives built: its build is not run (a runner would
570
+ // write its log in its folder), as with the tests (`lancerLesTests`).
571
+ const dossiers = paquetsDeLEnveloppe(env) === null ? null : dossiersDesPaquets(racine);
451
572
  const attendues = (graphe.tasks ?? [])
452
573
  .filter(t => !gardes.includes(t.task))
574
+ .filter(t => !dossiers?.has(t.package) || inscriptible(dossiers.get(t.package)))
453
575
  .map(t => t.taskId)
454
576
  .sort();
455
577
  if (attendues.length === 0) {
@@ -1,6 +1,16 @@
1
1
  // The types of the decisions of the circuit (./transitions.mjs), which the workflow of a ticket
2
2
  // under Temporal (src/temporal/circuit/) imports.
3
3
 
4
+ import type { IndexDesRouges } from './index-des-rouges.mjs';
5
+
6
+ /** The mark of the reds a memory keeps: their index, the fingerprint of their whole text and the address of their detail. */
7
+ export interface MarqueDesRouges {
8
+ forme: 'index';
9
+ index: IndexDesRouges;
10
+ empreinte: string;
11
+ detail: string;
12
+ }
13
+
4
14
  /** The run at its step. */
5
15
  export interface EtatDeLaTransition {
6
16
  etape: string;
@@ -44,13 +54,19 @@ export function circuitSuivant(
44
54
  /** What the circuit keeps between steps, which the decisions read and change. */
45
55
  export const MEMOIRE: string[];
46
56
 
57
+ /** Whether a lot out of the rule holds a file the circuit did not give back. */
58
+ export function resteAuLot(hors: { fichiers: string[]; rendus?: string[] }): boolean;
59
+
47
60
  /** The steps `--depuis` names. */
48
61
  export const ETAPES_DE_REPRISE: (
49
62
  'testwriter' | 'preuve' | 'developpeur' | 'direct' | 'controles' | 'passe-finale'
50
63
  )[];
51
64
 
52
65
  /** The refusal of `--depuis <depuis>` in the circuit <circuit>, naming the resumptions it accepts, or null. */
53
- export function refusDeLaReprise(entree: { depuis: string; circuit?: string | null }): string | null;
66
+ export function refusDeLaReprise(entree: {
67
+ depuis: string;
68
+ circuit?: string | null;
69
+ }): string | null;
54
70
 
55
71
  /** The decision of the step of <entree>, or the next fact it needs. */
56
72
  export function transition(entree: EntreeDeLaTransition): Transition;
@@ -70,12 +86,12 @@ export function depart(entree: {
70
86
  export function renvoiDe(entree: {
71
87
  fiche: { renvoi?: { role: string } | null; raison?: string };
72
88
  passation: string | null;
73
- controlesRouges: string | null;
89
+ controlesRouges: MarqueDesRouges | string | null;
74
90
  fichiersRouges?: string[];
75
91
  }): string | null;
76
92
 
77
93
  /** The test files the red output of checks names, each once. */
78
- export function fichiersDeTestRouges(controlesRouges: string | null): string[];
94
+ export function fichiersDeTestRouges(controlesRouges: MarqueDesRouges | string | null): string[];
79
95
 
80
96
  /** The context `--etendre` gives the sessions of the run it resumes. */
81
97
  export function contexteDeLExtension(entree: {
@@ -107,6 +123,14 @@ export interface EtatDuPlan {
107
123
  /** The step of the plan that follows <e>. */
108
124
  export function pasDuPlan(e: EtatDuPlan): 'explorateur' | 'questionneur' | 'reponse' | 'conclure';
109
125
 
126
+ /** The phase of the session the step <pas> of the plan launches; null for the conclusion. */
127
+ export function phaseDuPasDuPlan(
128
+ pas: 'explorateur' | 'questionneur' | 'reponse' | 'conclure'
129
+ ): string | null;
130
+
131
+ /** The phase of the session the fact <fait> launches, with its <parametres>; null for a fact that launches none. */
132
+ export function phaseDuFait(fait: string, parametres: Record<string, unknown>): string | null;
133
+
110
134
  /** The questions the explorateur answers in the questionneur's sheet <lu>. */
111
135
  export function questionsPosees(lu: {
112
136
  issue: string;
@@ -190,8 +214,6 @@ export const TRI: string;
190
214
  export const RELANCES_TESTWRITER: number;
191
215
  export const SEANCES_DEVELOPPEUR: number;
192
216
  export const RELECTURES: number;
193
- /** The bound of the ACCEPTÉ ↔ final pass cycle before the circuit goes up to the supervisor. */
194
- export const TOURS_DE_LA_PASSE_FINALE: number;
195
217
 
196
218
  /** What changed for a developpeur relaunched on the integration's refusal of his lot unchanged. */
197
219
  export const CHANGE_DU_REFUS: string;