@roomi-fields/grillhouse 0.45.1 → 0.47.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/CHANGELOG.md +52 -0
  3. package/cadre/templates/c/package.json +19 -0
  4. package/cadre/templates/projet/.github/workflows/ci.yml +34 -49
  5. package/cadre/templates/projet/.github/workflows/machine-vierge.yml +101 -0
  6. package/cadre/templates/projet/CLAUDE.md +28 -5
  7. package/cadre/templates/projet/docs/agents/issue-tracker.md +1 -1
  8. package/charte.md +61 -23
  9. package/dist/temporal/circuit/appel.d.ts +7 -0
  10. package/dist/temporal/circuit/appel.js +17 -0
  11. package/dist/temporal/circuit/appel.js.map +1 -1
  12. package/dist/temporal/circuit/client.d.ts +28 -5
  13. package/dist/temporal/circuit/client.js +56 -13
  14. package/dist/temporal/circuit/client.js.map +1 -1
  15. package/dist/temporal/circuit/commande.js +16 -4
  16. package/dist/temporal/circuit/commande.js.map +1 -1
  17. package/dist/temporal/circuit/contrat.d.ts +22 -2
  18. package/dist/temporal/circuit/contrat.js +76 -0
  19. package/dist/temporal/circuit/contrat.js.map +1 -1
  20. package/dist/temporal/circuit/deroule.js +68 -11
  21. package/dist/temporal/circuit/deroule.js.map +1 -1
  22. package/dist/temporal/file/activites.d.ts +2 -0
  23. package/dist/temporal/file/activites.js +7 -0
  24. package/dist/temporal/file/activites.js.map +1 -1
  25. package/dist/temporal/file/contrat.d.ts +28 -18
  26. package/dist/temporal/file/contrat.js +8 -5
  27. package/dist/temporal/file/contrat.js.map +1 -1
  28. package/dist/temporal/file/deroule.d.ts +1 -1
  29. package/dist/temporal/file/deroule.js +91 -42
  30. package/dist/temporal/file/deroule.js.map +1 -1
  31. package/dist/temporal/tickets/activites.d.ts +1 -0
  32. package/dist/temporal/tickets/activites.js +37 -11
  33. package/dist/temporal/tickets/activites.js.map +1 -1
  34. package/dist/temporal/tickets/contrat.d.ts +14 -0
  35. package/dist/temporal/tickets/deroule.js +16 -3
  36. package/dist/temporal/tickets/deroule.js.map +1 -1
  37. package/docs/ARCHITECTURE.md +309 -128
  38. package/docs/INTERFACE.md +42 -22
  39. package/hooks/register.tsx +30 -0
  40. package/package.json +1 -1
  41. package/scripts/activites.mjs +60 -21
  42. package/scripts/arbres-juges.mjs +59 -0
  43. package/scripts/attente-a-l-arret.mjs +29 -52
  44. package/scripts/attente-au-tour.mjs +8 -26
  45. package/scripts/avancement.mjs +2 -38
  46. package/scripts/branche-de-nuit.mjs +14 -45
  47. package/scripts/ci-de-main.mjs +273 -0
  48. package/scripts/circuit.mjs +204 -64
  49. package/scripts/circuits-cles.d.mts +9 -0
  50. package/scripts/circuits-cles.mjs +38 -0
  51. package/scripts/coeurs-dedies.mjs +4 -3
  52. package/scripts/dernier-vert.mjs +78 -10
  53. package/scripts/enveloppe/travail-de-la-copie.mjs +5 -2
  54. package/scripts/etapes.mjs +7 -2
  55. package/scripts/faits-du-circuit.mjs +63 -28
  56. package/scripts/fichiers-nommes.mjs +55 -0
  57. package/scripts/file-des-tickets.d.mts +17 -0
  58. package/scripts/file-des-tickets.mjs +39 -0
  59. package/scripts/grillhouse-maj.mjs +20 -1
  60. package/scripts/integration/file.mjs +137 -592
  61. package/scripts/integration/integrer.mjs +10 -7
  62. package/scripts/langages/c/binaires.json +4 -0
  63. package/scripts/langages/c/binaires.mjs +83 -0
  64. package/scripts/langages/c/clang-format.mjs +62 -0
  65. package/scripts/langages/c/clang-tidy.mjs +93 -0
  66. package/scripts/langages/c/clang.mjs +42 -0
  67. package/scripts/langages/c/commandes.mjs +530 -0
  68. package/scripts/langages/c/composants.mjs +209 -0
  69. package/scripts/langages/c/exemples.mjs +250 -0
  70. package/scripts/langages/c/index-interfaces.mjs +77 -0
  71. package/scripts/langages/c/index.mjs +120 -0
  72. package/scripts/langages/c/lot.mjs +41 -0
  73. package/scripts/langages/c/mise-a-jour.mjs +70 -0
  74. package/scripts/langages/c/squelette.mjs +61 -0
  75. package/scripts/langages/c/verdict.mjs +99 -0
  76. package/scripts/langages/cargo/clippy.mjs +16 -9
  77. package/scripts/langages/cargo/commandes.mjs +7 -2
  78. package/scripts/langages/cargo/sccache.mjs +19 -6
  79. package/scripts/langages/typescript/tests.mjs +31 -5
  80. package/scripts/langages/typescript/turbo-des-paquets.mjs +67 -8
  81. package/scripts/langages/typescript/vitest-config/changements.mjs +32 -3
  82. package/scripts/langages/typescript/vitest-config/lances.mjs +16 -0
  83. package/scripts/langages-des-paquets.mjs +30 -2
  84. package/scripts/langages.mjs +1 -0
  85. package/scripts/limite-d-usage.mjs +88 -0
  86. package/scripts/mesure/avancement.mjs +1 -1
  87. package/scripts/migrations/0.47.0-ci-de-main.mjs +48 -0
  88. package/scripts/migrations.mjs +2 -2
  89. package/scripts/outils-cles.d.mts +13 -5
  90. package/scripts/outils-cles.mjs +157 -17
  91. package/scripts/passe-de-la-machine.mjs +26 -2
  92. package/scripts/places-de-la-machine.mjs +52 -6
  93. package/scripts/plafond-de-la-machine.d.mts +10 -2
  94. package/scripts/plafond-de-la-machine.mjs +39 -13
  95. package/scripts/reponses-du-circuit.d.mts +16 -0
  96. package/scripts/reponses-du-circuit.mjs +39 -3
  97. package/scripts/resultats.mjs +32 -11
  98. package/scripts/seances.mjs +211 -59
  99. package/scripts/session-start.sh +2 -11
  100. package/scripts/sortie.mjs +1 -1
  101. package/scripts/sous-commandes.mjs +5 -2
  102. package/scripts/superviseur.mjs +305 -295
  103. package/scripts/tableau.mjs +73 -45
  104. package/scripts/transitions.d.mts +22 -1
  105. package/scripts/transitions.mjs +111 -13
  106. package/scripts/workflows-du-cadre.mjs +21 -1
  107. package/skills/explorateur/SKILL.md +34 -13
  108. package/skills/grill/SKILL.md +6 -5
  109. package/skills/pitmaster/SKILL.md +33 -27
  110. package/skills/redacteur/references/documents-d-un-composant.md +1 -1
  111. package/skills/relecteur/SKILL.md +6 -0
  112. package/skills/testwriter/SKILL.md +4 -0
  113. package/scripts/ci-des-branches.mjs +0 -93
  114. package/scripts/migrations/0.33.0-ci-des-branches-de-ticket.mjs +0 -31
@@ -31,7 +31,7 @@
31
31
  // every step one for the whole ticket, a running one with no known state at the step of its
32
32
  // stop, else at the plan (1); while the explorateur or the questionneur works on its plan
33
33
  // (`questionnement`, of the plan), it stands at the plan (1); waiting for the supervisor
34
- // (`attendLeSuperviseur`, the one rule the opening and the wait of the questions read too:
34
+ // (`attendLeSuperviseur`, the one rule the opening and the greffon's reading read too:
35
35
  // stopped, « à repasser » included, but by the supervisor's « arrete », or ended without its
36
36
  // issue), it stands under the stopped step after a line « ⤷ Question · <qui> », who must answer
37
37
  // it, the supervisor or the owner, the supervisor when it names no question; its card opens on
@@ -74,7 +74,7 @@
74
74
  // its pass, read in the progress directory its state names (scripts/avancement.mjs), in
75
75
  // figures, as Bazel's counter of actions: « faits/prévus · <durée> » since the start of the
76
76
  // pass, after the counters of its loops, or in their place when room lacks (the subject is cut,
77
- // never the figures nor the ticket's number); the queue (5.2), the steps of its CI. Past FIGEE
77
+ // never the figures nor the ticket's number); the queue (5.2) shows no wait for a CI. Past FIGEE
78
78
  // without a sign, « figée <durée> · faits/prévus », the time since its last sign, signed ⛔ in
79
79
  // the tone of an alert.
80
80
  // - The parts of the machine (scripts/places-de-la-machine.mjs, read by `lireLaMesure`), as Slurm's
@@ -92,7 +92,7 @@
92
92
  // - Signs: each sign keeps one sense (the owner's decisions of 2026-11-01 and 2026-11-12). A
93
93
  // ticket's line in AGENTS takes one of three, by the tone of its state: ▶ its step works (cyan),
94
94
  // a ticket led in direct included; ⏸ it waits, under the step about to be launched, the reason
95
- // on its right (« attend une place », « verrou », « CI », « disque », « démarre » in grey, the
95
+ // on its right (« attend une place », « verrou », « disque », « démarre » in grey, the
96
96
  // circuit waiting for the machine; « question au superviseur », « question au responsable »,
97
97
  // « arrêté » in yellow, the circuit waiting for someone); ⛔ it stopped on a fault or its pass is
98
98
  // frozen, to correct (red). The head of AGENTS, the machine's lines: 🔒 a pass that holds a part,
@@ -136,9 +136,11 @@ import {
136
136
  SUPERVISEUR,
137
137
  } from './etapes.mjs';
138
138
  import { echecDeLOutil } from './aiguillage.mjs';
139
+ import { maxDuProjet } from './circuits-cles.mjs';
139
140
  import { bilansGardes, enBref } from './bilan.mjs';
140
141
  import { REGISTRE } from './adresse-du-registre.mjs';
141
142
  import { lireLaMesure } from './avancement.mjs';
143
+ import { ciDeMainGardee, ligneDeLaCiDeMain } from './ci-de-main.mjs';
142
144
  import {
143
145
  SANS_REPONSE_EN,
144
146
  ServeurMuet,
@@ -155,7 +157,6 @@ import {
155
157
  import { etatDesPlaces } from './places-de-la-machine.mjs';
156
158
  import { prefixe as prefixeDeLaRacine } from './prefixe-des-tickets.mjs';
157
159
  import { sigleDuProjet } from './sigle-du-projet.mjs';
158
- import { vivant } from './mesure/base-de-passe.mjs';
159
160
 
160
161
  const MINUTE = 60_000;
161
162
  export const SILENCE = 10 * MINUTE;
@@ -214,9 +215,9 @@ export const TONS = Object.freeze({
214
215
  fermes: 'discret',
215
216
  // A circuit, a pass, a wait.
216
217
  attendUnePlace: 'discret',
218
+ reporteLimite: 'discret',
217
219
  attendUnePart: 'discret',
218
220
  attendLeDisque: 'discret',
219
- attendLaCI: 'discret',
220
221
  sansEtape: 'discret',
221
222
  enDirect: 'actif',
222
223
  nuitEnCours: 'actif',
@@ -232,7 +233,6 @@ export const TONS = Object.freeze({
232
233
  sansIssue: 'alerte',
233
234
  panne: 'alerte',
234
235
  nuitRouge: 'alerte',
235
- sansAttente: 'alerte',
236
236
  plafondRefuse: 'alerte',
237
237
  // The layout.
238
238
  titre: 'titre',
@@ -729,7 +729,7 @@ export function lireVivant({ racine, home, prefix, maintenant, ps, cache = {} })
729
729
  * is free). The
730
730
  * one rule of the questions that wait for the supervisor (grillhouse-pq6), which the board reads,
731
731
  * and `questionsEnAttente` of scripts/superviseur.mjs, the one source of the opening and of the
732
- * wait of the questions.
732
+ * greffon's reading of the questions.
733
733
  * @param {{ vivant: boolean, integre?: boolean, interrompu: boolean, question: string | null, arret: string | null }} c
734
734
  * @returns {boolean}
735
735
  */
@@ -780,28 +780,6 @@ export function lireLesRemontees(racine, maintenant) {
780
780
  }
781
781
  }
782
782
 
783
- /** The lock of the one wait of the questions of the repository at <racine>. */
784
- export const verrouDeLAttente = racine =>
785
- path.join(racine, '.claude', 'worktrees', 'attente-des-questions.lock');
786
-
787
- /**
788
- * Whether a wait of the questions lives for the repository at <racine>: its lock names a process
789
- * that lives (the pid is read again; a lock left by a dead process does not count).
790
- * @param {string} racine
791
- * @returns {boolean}
792
- */
793
- export function attenteVivante(racine) {
794
- try {
795
- const pid = Number(/^(\d+)/.exec(readFileSync(verrouDeLAttente(racine), 'utf8'))?.[1]);
796
- return Number.isInteger(pid) && pid > 0 && vivant(pid);
797
- } catch {
798
- return false;
799
- }
800
- }
801
-
802
- // The minutes between two presentations of a question not answered, by default.
803
- export const RAPPEL_PAR_DEFAUT = 5;
804
-
805
783
  // A ticket's number, subject and component: its title « number — subject — component » when
806
784
  // the number ends its id, else its id without the prefix and its whole title.
807
785
  export function lecture(t, prefix) {
@@ -924,10 +902,10 @@ export function assembler({
924
902
  ticketsLusA = null,
925
903
  echecPrefixe = null,
926
904
  remontees = [],
927
- attenteVivante: attenteQuiVit = true,
928
905
  voies = {},
929
906
  superviseur = {},
930
907
  externes,
908
+ limite = null,
931
909
  }) {
932
910
  // A circuit's lines are its steps, no agent's passage.
933
911
  const etapesFinies = lignesDuRegistre.filter(r => r.role === ROLE_DU_CIRCUIT);
@@ -1388,8 +1366,7 @@ export function assembler({
1388
1366
  }
1389
1367
  // A circuit stopped on a question to the supervisor: the tone of that wait, whatever its length,
1390
1368
  // and how long it has waited (from the `depuis` of its stop in the file of the stops gone up);
1391
- // it falls when the circuit leaves the stop. One alert « à corriger » when some wait and no wait
1392
- // lives.
1369
+ // it falls when the circuit leaves the stop.
1393
1370
  const depuisDe = new Map(remontees.map(r => [r.cle, r.depuis]));
1394
1371
  const enAttenteDuSuperviseur = [...parCircuit.values()]
1395
1372
  .filter(attendLeSuperviseur)
@@ -1405,13 +1382,6 @@ export function assembler({
1405
1382
  texte: `${numero(c.ticket)} attend le superviseur depuis ${Math.floor(attendu / MINUTE)} min`,
1406
1383
  });
1407
1384
  }
1408
- if (enAttenteDuSuperviseur.length && !attenteQuiVit) {
1409
- alerter('sansAttente', {
1410
- signe: '🔕',
1411
- texte:
1412
- 'À corriger : une question au superviseur reste sans réponse, aucune attente ne tourne',
1413
- });
1414
- }
1415
1385
  // The tickets of the queue without their section « ## Architecture », which the queue never
1416
1386
  // starts (scripts/file-des-tickets.mjs): one line names them all, for the supervisor to write it.
1417
1387
  const sansArchitecture = enFileSansArchitecture(tous, { enCours: new Set(parCircuit.keys()) });
@@ -1506,9 +1476,30 @@ export function assembler({
1506
1476
  numero: numero(c.ticket),
1507
1477
  sujet: titre(parId.get(c.ticket)).sujet,
1508
1478
  }));
1479
+ // The limit of circuits of the project (`limite`, its `grillhouse.circuits`): when it is held,
1480
+ // the circuits that hold it waiting for the supervisor (a question to no one, or to the
1481
+ // supervisor; the owner's releases the place, as does a ticket deferred), by id.
1482
+ const tenantsDeLaLimite = [...parCircuit.values()].filter(
1483
+ c =>
1484
+ parId.get(c.ticket).status !== 'deferred' &&
1485
+ (c.vivant || (attendLeSuperviseur(c) && (c.qui ?? SUPERVISEUR) !== 'responsable'))
1486
+ );
1487
+ const tenueLaLimite = limite !== null && tenantsDeLaLimite.length >= limite;
1488
+ const limiteTenue = tenueLaLimite
1489
+ ? {
1490
+ max: limite,
1491
+ tenus: tenantsDeLaLimite.length,
1492
+ superviseur: tenantsDeLaLimite
1493
+ .filter(c => !c.vivant)
1494
+ .map(c => c.ticket)
1495
+ .sort((a, b) => ordre({ id: a }, { id: b }))
1496
+ .map(numero),
1497
+ }
1498
+ : null;
1509
1499
  return {
1510
1500
  global,
1511
1501
  alertes,
1502
+ limite: limiteTenue,
1512
1503
  circuits: lesCircuits,
1513
1504
  horsCircuit,
1514
1505
  chantiers,
@@ -1702,8 +1693,8 @@ const enQuestion = c => (attendLeSuperviseur(c) ? (c.qui ?? SUPERVISEUR) : null)
1702
1693
  * and its witness (`temoin`: the part it holds or waits for, « · <sorte> faits/prévus · <durée> »,
1703
1694
  * « · part <sorte> · <durée> », else the progress of its automatic pass, `temoinDe`), in this
1704
1695
  * order: frozen; ended without its issue; its question (to the supervisor or to another); stopped;
1705
- * its wait for the disk, a place (« nuit » while the night holds the machine), a part, the CI of
1706
- * its queue (5.2, no part held) or its first state; else it runs. `lignes`: one entry per
1696
+ * its wait for the disk, a place (« nuit » while the night holds the machine), a part or its first
1697
+ * state; else it runs. `lignes`: one entry per
1707
1698
  * ticket's line of AGENTS, its id, its project on a board of several and its sign: each circuit,
1708
1699
  * each ticket led in direct (▶) and each agent shown out of a circuit (▶).
1709
1700
  */
@@ -1746,6 +1737,16 @@ export function etatsDAgents(t) {
1746
1737
  if (temoin?.fige) {
1747
1738
  return ['fige', ''];
1748
1739
  }
1740
+ // A circuit that waits for the usage limit to lift (its kept report): its reason and the hour
1741
+ // the usage returns, local time, apart from a ticket a person deferred.
1742
+ if (c.report?.raison === 'limite-d-usage') {
1743
+ const heure = new Date(c.report.reprise).toLocaleTimeString('fr-FR', {
1744
+ hour: '2-digit',
1745
+ minute: '2-digit',
1746
+ hourCycle: 'h23',
1747
+ });
1748
+ return ['reporteLimite', `limite d'usage · reprise ${heure}`];
1749
+ }
1749
1750
  if (!c.vivant) {
1750
1751
  const qui = enQuestion(c);
1751
1752
  return c.sansIssue
@@ -1765,9 +1766,7 @@ export function etatsDAgents(t) {
1765
1766
  ? ['attendUnePart', '']
1766
1767
  : !etape
1767
1768
  ? ['sansEtape', 'démarre']
1768
- : etape.etat === 'file' && !tientUnePart.has(c.id)
1769
- ? ['attendLaCI', 'CI']
1770
- : ['enCours', ''];
1769
+ : ['enCours', ''];
1771
1770
  };
1772
1771
  const circuits = new Map();
1773
1772
  for (const c of t.circuits ?? []) {
@@ -1924,6 +1923,9 @@ export function lignes(t, nom, largeur = LARGEUR, groupes = {}) {
1924
1923
  a.ton
1925
1924
  );
1926
1925
  }
1926
+ if (t.ciDeMain) {
1927
+ L(cadre(t.ciDeMain.texte, '', largeur), t.ciDeMain.ton);
1928
+ }
1927
1929
 
1928
1930
  L('', undefined);
1929
1931
  L('AGENTS ▶ en cours · en attente', TONS.titre);
@@ -1978,6 +1980,18 @@ export function lignes(t, nom, largeur = LARGEUR, groupes = {}) {
1978
1980
  });
1979
1981
  }
1980
1982
  }
1983
+ // A project at its limit of circuits (`grillhouse.circuits`) names the circuits that hold it
1984
+ // waiting for the supervisor: « Limite 2/2 · en attente du superviseur : 11, 12 ».
1985
+ if (t.limite?.superviseur?.length) {
1986
+ poser({
1987
+ texte: cadre(
1988
+ `Limite ${t.limite.tenus}/${t.limite.max} · en attente du ${SUPERVISEUR} : ${t.limite.superviseur.join(', ')}`,
1989
+ '',
1990
+ largeur
1991
+ ),
1992
+ ton: TONS.attendLeDisque,
1993
+ });
1994
+ }
1981
1995
  // The night under way on the machine, under the places: « 🌙 nuit · <projet> · depuis <durée> »,
1982
1996
  // its project by its folder's name, the time since it started when the server gives it.
1983
1997
  if (t.nuit) {
@@ -2755,9 +2769,9 @@ function lire(
2755
2769
  echecPrefixe,
2756
2770
  outil: echecDeLOutil(racine),
2757
2771
  remontees: lireLesRemontees(racine, maintenant),
2758
- attenteVivante: attenteVivante(racine),
2759
2772
  superviseur,
2760
2773
  externes: lireLesExternes(racine, tous),
2774
+ limite: maxDuProjet(commun ? path.dirname(commun) : racine) ?? null,
2761
2775
  });
2762
2776
  return { t, prefix, tous, vivants, commun };
2763
2777
  }
@@ -2802,6 +2816,7 @@ export function ensemble(lus) {
2802
2816
  : { etiquette: l.etiquette, erreur: l.erreur }
2803
2817
  ),
2804
2818
  alertes: tous('alertes'),
2819
+ ciDeMain: premier.t.ciDeMain,
2805
2820
  circuits: tous('circuits'),
2806
2821
  horsCircuit: tous('horsCircuit'),
2807
2822
  chantiers: lisibles.flatMap(l => l.t.chantiers.map(noeud(l.etiquette))),
@@ -2919,6 +2934,7 @@ export async function tableau(
2919
2934
  projets = [],
2920
2935
  circuitsDe = circuitsDuServeur,
2921
2936
  nuitDe = () => nuitDuServeur(),
2937
+ ciDeMainDe = () => ciDeMainGardee(racine, { maintenant }),
2922
2938
  } = {}
2923
2939
  ) {
2924
2940
  const [nuit, { circuits, muet, faute }, ...autres] = await Promise.all([
@@ -2942,6 +2958,18 @@ export async function tableau(
2942
2958
  }),
2943
2959
  };
2944
2960
  const lus = [ici, ...autres];
2961
+ // The CI of main (scripts/ci-de-main.mjs), read after the lots entered: a red, or a CI not read,
2962
+ // is an alert; a green is a line with its last green. A project with no CI to read shows nothing.
2963
+ const ci = await Promise.resolve()
2964
+ .then(ciDeMainDe)
2965
+ .catch(() => null);
2966
+ if (ci && ici.t) {
2967
+ if (ci.etat === 'verte') {
2968
+ ici.t.ciDeMain = { texte: ligneDeLaCiDeMain(ci), ton: TONS.fermes };
2969
+ } else {
2970
+ ici.t.alertes.push({ etat: 'panne', ton: TONS.panne, texte: ligneDeLaCiDeMain(ci) });
2971
+ }
2972
+ }
2945
2973
  // A project is labelled by its sigle (scripts/sigle-du-projet.mjs: the key `grillhouse.sigle`, else
2946
2974
  // its ticket prefix), as the line of the places names it; a project with neither keeps its
2947
2975
  // folder's name. A faulty key is said in an alert, the prefix staying the sigle; two projects of
@@ -30,6 +30,9 @@ export interface Transition {
30
30
  usage?: string;
31
31
  }
32
32
 
33
+ /** What the circuit keeps between steps, which the decisions read and change. */
34
+ export const MEMOIRE: string[];
35
+
33
36
  /** The decision of the step of <entree>, or the next fact it needs. */
34
37
  export function transition(entree: EntreeDeLaTransition): Transition;
35
38
 
@@ -94,6 +97,18 @@ export function arretSansActe(
94
97
  etat: EtatDeLaTransition & { raison: string };
95
98
  };
96
99
 
100
+ /** The stop « limite-d-usage » at <etat> of a session the usage limit cuts: no question, the comment of the report. */
101
+ export function arretDeLaLimiteDUsage(
102
+ etat: EtatDeLaTransition,
103
+ limite: { reprise: number; lisible: boolean }
104
+ ): {
105
+ code: number;
106
+ nom: 'limite-d-usage';
107
+ question: null;
108
+ etat: EtatDeLaTransition & { raison: string };
109
+ commentaire: string;
110
+ };
111
+
97
112
  /** The step of a run of the workflow from its opening to its plan passed: no step of the table. */
98
113
  export const AU_PLAN: string;
99
114
 
@@ -141,9 +156,15 @@ interface Constat {
141
156
  /** The developpeur's report on the integration's refusal <refus>. */
142
157
  export function rapportDuRefus(refus: { rapport: string }): string;
143
158
 
159
+ /** The stop of a ticket the queue reopens on its issue: its motive and its own question, or null. */
160
+ export function refusDeLaFile(issue?: { raison?: string | null; conflit?: boolean }): {
161
+ motif: string;
162
+ question: string | null;
163
+ };
164
+
144
165
  /** The step after the plan of sort <sorte>: the gesture, the developpeur, or the testwriter. */
145
166
  export function etapeApresLePlan(e: {
146
- sorte?: { genre?: string } | null;
167
+ sorte?: { genre?: string; comportement?: string } | null;
147
168
  sansTests?: boolean;
148
169
  }): string;
149
170
 
@@ -32,6 +32,28 @@
32
32
  import { ARRETS, boucle, RESPONSABLE, SUITE } from './etapes.mjs';
33
33
  import { attribuerLeRouge } from './reprise.mjs';
34
34
 
35
+ // What the circuit keeps between steps, which the decisions read and change: the one list the
36
+ // opening reads back (scripts/faits-du-circuit.mjs `GARDEE`) and the memo of a circuit keeps
37
+ // (src/temporal/circuit/contrat.ts `etatPourLeMemo`).
38
+ export const MEMOIRE = [
39
+ 'controlesRouges',
40
+ 'renvoiAuTestwriter',
41
+ 'refus',
42
+ 'rienALivrer',
43
+ 'regeneration',
44
+ 'regenereSur',
45
+ 'aRegenerer',
46
+ 'verifie',
47
+ 'toursDeLaPasseFinale',
48
+ 'constats',
49
+ 'verts',
50
+ 'reprise',
51
+ 'relancesTestwriter',
52
+ 'conflitsRelances',
53
+ 'fichiersDuConflit',
54
+ 'retourDuConflit',
55
+ ];
56
+
35
57
  // The steps of the circuit's state, read from the list of the steps.
36
58
  const etatDe = n => SUITE.find(e => e.numero === n).etat;
37
59
  export const [
@@ -68,15 +90,37 @@ export const CHANGE_DU_REFUS =
68
90
  export const rapportDuRefus = refus =>
69
91
  `L’intégration refuse ce lot : son refus, ci-dessous, est le rouge à lever ; les contrôles de ta copie, verts, ne le voient pas, et le lot ne repasse à l’intégration qu’avec un changement.\n\n${refus.rapport}`;
70
92
 
93
+ // The stop of a ticket the queue reopens on its issue `{ raison, conflit }`, as it gives the circuit
94
+ // (`direLIssue`, `conclureLaCI` of scripts/integration/file.mjs): `motif`, whose first line, the
95
+ // fact of the question gone up, says why (the first line of the reason that is not a title), the
96
+ // whole reason after it; `question`, for a branch that does not replay on main (its conflict), the
97
+ // answer that serves, null for any other reason.
98
+ export function refusDeLaFile({ raison, conflit = false } = {}) {
99
+ const texte = String(raison ?? '').trim();
100
+ const pourquoi = texte.split('\n').find(l => l.trim() && !l.startsWith('#'));
101
+ return {
102
+ motif: `La file rouvre le ticket${pourquoi ? ` : ${pourquoi.trim()}` : '.'}\n\n${texte}`,
103
+ question: conflit
104
+ ? 'La branche ne se replace pas sur main : `--depuis developpeur` remet son lot en travail local sur main, où le développeur le replace ; `--reprendre` renverrait la même branche.'
105
+ : null,
106
+ };
107
+ }
108
+
71
109
  // The step after the plan of sort <sorte> (null when the path is not mechanical): the gesture of
72
110
  // a mechanical ticket (1.1), in place of the testwriter, the proof and the developpeur; the
73
- // developpeur of a plan without tests (<sansTests>); else the testwriter.
111
+ // developpeur of a plan without tests (<sansTests>) or of a plan whose `comportement` is inchangé
112
+ // (a gesture written by hand: no test can turn red, the existing suite proves it); else the
113
+ // testwriter, for changé and tests-adaptés alike.
74
114
  export const etapeApresLePlan = ({ sorte, sansTests }) =>
75
- sorte?.genre === 'mécanique' ? GESTE : sansTests ? CODE : TESTS;
115
+ sorte?.genre === 'mécanique'
116
+ ? GESTE
117
+ : sansTests || sorte?.comportement === 'inchangé'
118
+ ? CODE
119
+ : TESTS;
76
120
 
77
121
  // The step after a proof that passes: the developpeur on a red (<rouges>), on a finding of the
78
- // reviewer still open for him (<pourLeDeveloppeur>), or under a plan « comportement inchangé »
79
- // (<inchange>), whose lot has code to write though nothing turns red, as a reorganisation does
122
+ // reviewer still open for him (<pourLeDeveloppeur>), or under a plan « comportement
123
+ // tests-adaptés » (<inchange>), whose lot has code to write though nothing turns red, as a reorganisation does
80
124
  // (decision 3, amended by the owner on 2026-11-01); else the checks, a lot of tests alone, with
81
125
  // no session of the developpeur.
82
126
  export const apresLaPreuve = ({ rouges, pourLeDeveloppeur, inchange }) =>
@@ -130,6 +174,13 @@ export function arretDuGesteMecanique({ constats, mecanique, sorte }, texte) {
130
174
  };
131
175
  }
132
176
 
177
+ // Whether the reviewer's sheet <fiche> sends the lot of the short circuit back to 2 Tests: its
178
+ // motif « comportement-change », on a ticket mechanical or written by hand under a plan
179
+ // « comportement inchangé » (<sorte>).
180
+ const basculeDuCircuitCourt = ({ fiche, sorte }) =>
181
+ fiche?.motif === 'comportement-change' &&
182
+ (sorte?.genre === 'mécanique' || sorte?.comportement === 'inchangé');
183
+
133
184
  // The last <n> lines of <t>, a text the circuit gives without its colours.
134
185
  const fin = (t, n) =>
135
186
  String(t ?? '')
@@ -284,6 +335,18 @@ export const arretSansActe = (etat, message, ou) => ({
284
335
  etat: { ...etat, raison: 'inattendu' },
285
336
  });
286
337
 
338
+ // The stop « limite-d-usage » of a session the usage limit cuts, at the step <etat>: no question
339
+ // (the circuit reports itself to <limite>.reprise, the hour the usage returns, or one hour on when
340
+ // <limite>.lisible is false), the comment the act writes at the ticket, and the state of the step
341
+ // with its reason, which the memo of the circuit keeps for the board.
342
+ export const arretDeLaLimiteDUsage = (etat, { reprise, lisible }) => ({
343
+ code: ARRETS['limite-d-usage'],
344
+ nom: 'limite-d-usage',
345
+ question: null,
346
+ etat: { ...etat, raison: 'limite-d-usage' },
347
+ commentaire: `reporté pour la limite d'usage : reprise de l'étape à ${new Date(reprise).toISOString()}${lisible ? '' : " (aucune heure lisible : une heure d'attente)"}.`,
348
+ });
349
+
287
350
  // The step of a run of the workflow of a ticket from its opening to its plan passed
288
351
  // (src/temporal/circuit/deroule.ts): no step of the table of transitions.
289
352
  export const AU_PLAN = 'plan';
@@ -397,7 +460,8 @@ function decider({ etat, memoire = {}, ticket, reprend = false }, lire, partiel)
397
460
  const route =
398
461
  etape === TESTS
399
462
  ? etapeApresLePlan({
400
- sorte: lire('mecanique') ? ticket.sorte : null,
463
+ sorte:
464
+ lire('mecanique') || ticket.sorte?.comportement === 'inchangé' ? ticket.sorte : null,
401
465
  sansTests: lire('sansTests'),
402
466
  })
403
467
  : null;
@@ -435,12 +499,17 @@ function decider({ etat, memoire = {}, ticket, reprend = false }, lire, partiel)
435
499
  return decision();
436
500
  }
437
501
  if (route === CODE) {
502
+ const ecritALaMain = ticket.sorte?.comportement === 'inchangé';
438
503
  commenter(
439
504
  'testwriter',
440
- 'aucun test dans le plan (aucun paquet qui joue des tests ne le tient) : ni testwriter ni preuve, le développeur directement.'
505
+ ecritALaMain
506
+ ? 'plan « comportement inchangé » (geste écrit à la main) : aucun test honnête ne peut rougir, ni testwriter ni preuve, le développeur directement.'
507
+ : 'aucun test dans le plan (aucun paquet qui joue des tests ne le tient) : ni testwriter ni preuve, le développeur directement.'
441
508
  );
442
509
  rapport = [
443
- `Le plan (${plan}) ne porte aucun test (aucun paquet qui joue des tests ne le tient) : le circuit te lance sans testwriter ni preuve. Tu écris le ticket d'après ses critères ; les contrôles suivent ta séance.`,
510
+ ecritALaMain
511
+ ? `Le plan (${plan}) dit « comportement inchangé » : le circuit te lance sans testwriter ni preuve. Tu écris le geste d'après les critères du ticket ; la suite existante, qui reste verte, et la relecture font la preuve.`
512
+ : `Le plan (${plan}) ne porte aucun test (aucun paquet qui joue des tests ne le tient) : le circuit te lance sans testwriter ni preuve. Tu écris le ticket d'après ses critères ; les contrôles suivent ta séance.`,
444
513
  rapport,
445
514
  ]
446
515
  .filter(Boolean)
@@ -493,7 +562,7 @@ function decider({ etat, memoire = {}, ticket, reprend = false }, lire, partiel)
493
562
  const reprise = m('reprise');
494
563
  // A finding of the reviewer still open for the developpeur launches him, red or not.
495
564
  const pourLui = ouverts(m('constats'), 'developpeur').length > 0;
496
- const inchange = Boolean(ticket.sorte?.inchange);
565
+ const inchange = ticket.sorte?.comportement === 'tests-adaptés';
497
566
  const vert = m('verts')?.preuve;
498
567
  if (vert && !reprise && lire('empreinteEtape', { etape: 'preuve' }) === vert.empreinte) {
499
568
  // The proof's inputs are those of its last green: its result is read back, not played.
@@ -519,7 +588,7 @@ function decider({ etat, memoire = {}, ticket, reprend = false }, lire, partiel)
519
588
  : pourLui
520
589
  ? 'aucun rouge ; au développeur, que nomme un constat du relecteur'
521
590
  : inchange
522
- ? 'aucun rouge : le plan dit « comportement inchangé », au développeur'
591
+ ? 'aucun rouge : le plan dit « tests-adaptés », au développeur'
523
592
  : 'aucun rouge : un lot de tests seul, aux contrôles';
524
593
  ecrireRapport('preuve', `${p.resume} ; ${suite}.\n\n${p.texte}`, p.resultat);
525
594
  if (!reprise && p.empreinte) {
@@ -602,7 +671,8 @@ function decider({ etat, memoire = {}, ticket, reprend = false }, lire, partiel)
602
671
  if (f.etat === 'en-file') {
603
672
  return arreter('a-repasser', f.raison);
604
673
  }
605
- return refuser(`La file rouvre le ticket.\n\n${f.raison}`, f.raison);
674
+ const refus = refusDeLaFile(f);
675
+ return refuser(refus.motif, f.raison, refus.question);
606
676
  }
607
677
  if (etape === TRI) {
608
678
  // The lot is on main: the tri of its discoveries, which neither stops nor undoes it.
@@ -615,8 +685,8 @@ function decider({ etat, memoire = {}, ticket, reprend = false }, lire, partiel)
615
685
  // kept in the memory (`refus`: `{ rapport, piece, empreinte, lance, relance }`, the fingerprint
616
686
  // of the plan refused, whether a --depuis developpeur launched the developpeur on it, and whether
617
687
  // a session so launched already left it unchanged once), which --depuis developpeur gives the
618
- // developpeur.
619
- function refuser(motif, piece) {
688
+ // developpeur; <question>, the stop's own, before the one of its kind.
689
+ function refuser(motif, piece, question = null) {
620
690
  maj.refus = {
621
691
  rapport: motif,
622
692
  piece,
@@ -624,7 +694,7 @@ function decider({ etat, memoire = {}, ticket, reprend = false }, lire, partiel)
624
694
  lance: false,
625
695
  relance: false,
626
696
  };
627
- return arreter('integration', motif, { piece });
697
+ return arreter('integration', motif, question ? { piece, question } : { piece });
628
698
  }
629
699
 
630
700
  function code() {
@@ -914,6 +984,12 @@ function decider({ etat, memoire = {}, ticket, reprend = false }, lire, partiel)
914
984
  finale = true;
915
985
  return decision();
916
986
  }
987
+ // A red in a component the plan set apart from the survey: the plan extends to it, without a
988
+ // stop, and the red goes on as the plan's (the circuit writes the extension, with its piece, at
989
+ // the ticket).
990
+ if (k.rouge && k.ecartesRouges?.length) {
991
+ lire('etendreAuxEcartes', { composants: k.ecartesRouges, rouges: k.tous });
992
+ }
917
993
  if (k.rouge && passeFinale && k.horsTitre.length) {
918
994
  return arret(
919
995
  'controles',
@@ -1158,6 +1234,28 @@ function decider({ etat, memoire = {}, ticket, reprend = false }, lire, partiel)
1158
1234
  return decision({ arret: lus.arret });
1159
1235
  }
1160
1236
  maj.constats = lus.constats;
1237
+ // A lot of the short circuit (mechanical, or written by hand under a plan « comportement
1238
+ // inchangé ») that the reviewer renders for a changed behaviour (`comportement-change`) goes
1239
+ // back to 2 Tests on the same plan, its sort turned to comportement with the verdict as its
1240
+ // reason: a test now can turn red. It counts among the RENDU above, so the third stops the
1241
+ // circuit and a ticket turned both ways does not loop.
1242
+ if (basculeDuCircuitCourt({ fiche: v.fiche, sorte: ticket.sorte })) {
1243
+ effets.push({
1244
+ genre: 'sorte',
1245
+ sorte: { genre: 'comportement', raison: v.texte, comportement: 'changé' },
1246
+ });
1247
+ etape = TESTS;
1248
+ tentative = 1;
1249
+ rapport = null;
1250
+ finale = false;
1251
+ maj.verifie = null;
1252
+ maj.toursDeLaPasseFinale = null;
1253
+ commenter(
1254
+ 'relecture',
1255
+ `RENDU (relecture ${rendus}) : le lot du circuit court change un comportement ; la sorte du ticket devient comportement, le plan reste, et le circuit reprend à 2 Tests.`
1256
+ );
1257
+ return decision();
1258
+ }
1161
1259
  const saute =
1162
1260
  arretDuTestwriterSaute(
1163
1261
  {
@@ -44,6 +44,27 @@ export function aLaCiDuCadre(projet) {
44
44
  return workflowsDe(dossier).some(f => estDuCadre(readFileSync(path.join(dossier, f), 'utf8')));
45
45
  }
46
46
 
47
+ /** The name of the workflow of the clean machine, in the template as in a project. */
48
+ export const NOM_MACHINE_VIERGE = 'machine-vierge.yml';
49
+
50
+ /**
51
+ * Whether the update poses or keeps the frame's workflow of the clean machine in the project at
52
+ * <projet>: the project holds a workflow of the frame, the template of <source> holds it, and the
53
+ * project's file is absent or bears the frame's mark (one without it is the project's own).
54
+ * @param {string} projet
55
+ * @param {string} source
56
+ */
57
+ export function poseraLaMachineVierge(projet, source) {
58
+ if (
59
+ !aLaCiDuCadre(projet) ||
60
+ !existsSync(path.join(source, GABARIT_DES_WORKFLOWS, NOM_MACHINE_VIERGE))
61
+ ) {
62
+ return false;
63
+ }
64
+ const f = path.join(projet, WORKFLOWS, NOM_MACHINE_VIERGE);
65
+ return !existsSync(f) || estDuCadre(readFileSync(f, 'utf8'));
66
+ }
67
+
47
68
  /**
48
69
  * Brings the frame's workflows of the project at <projet> to the template of the frame's files at
49
70
  * <source> (see the header). Returns the names of the workflows written, from the project's root,
@@ -72,4 +93,3 @@ export function poserLesWorkflows(projet, source) {
72
93
  }
73
94
  return ecrits;
74
95
  }
75
-
@@ -79,23 +79,44 @@ change, et ceux qu'il peut casser.
79
79
  l'outil qui fait le geste, telle qu'elle se lance à la racine de la copie, comme Rosie et
80
80
  ClangMR font un grand changement chez Google, Renovate une montée de dépendance, `nx migrate`
81
81
  une montée du cadre, `eslint --fix` une correction de style : le circuit saute alors le
82
- testwriter, la preuve du rouge et le développeur. Une configuration dont une garde mesure
82
+ testwriter, la preuve du rouge et le développeur. Le critère : je dis mécanique un ticket
83
+ quand aucun test honnête ne peut rougir avant son lot, le produit se comportant pareil avant
84
+ et après ; la liste ci-dessus n'en est que les exemples, auxquels s'ajoutent les commentaires
85
+ de code seuls, la suppression de code sans appelant vivant, les fichiers engendrés
86
+ régénérés, les textes de messages qu'aucun test ni aucun autre paquet ne lit et le typage
87
+ resserré sans changement à l'exécution. Un test honnête échoue avant le lot et passe après,
88
+ sur un comportement qu'un test, un autre paquet ou une interface publiée observe. Un geste
89
+ écrit à la main (sans outil qui le joue) est de ce critère, sous sa seconde forme : ma
90
+ sorte est `comportement` `inchangé`, ma raison dit le geste et ce que j'ai cherché ; le
91
+ circuit saute le testwriter et la preuve du rouge pour une séance du développeur, la suite
92
+ existante faisant la preuve ; je n'écris rien moi-même. Avant de dire mécanique un lot de
93
+ textes de messages, de typage resserré ou de code supprimé, je cherche par l'index leurs
94
+ lecteurs (tests qui lisent le texte, paquets lecteurs du relevé, INTERFACE, codes de
95
+ retour) ; la raison de ma fiche dit ce qu'il a cherché, lui, l'explorateur ; un lecteur trouvé, ou un doute, va au
96
+ circuit complet. L'arrêt du testwriter est le filet quand ma recherche a manqué. Une configuration dont une garde mesure
83
97
  l'effet, et le texte qui accompagne un changement de comportement, restent au circuit ;
84
- un doute va au circuit : `comportement`. Un ticket de comportement dont le lot ne change
85
- aucun comportement que ses tests mesurent (un test adapté, un seuil relevé dans un test)
86
- porte `comportement` `inchangé`, le plan « comportement inchangé » : sa preuve accepte chaque
87
- vert de son lot, puis le développeur écrit le code (une réorganisation en a), les contrôles
88
- et la relecture. Un ticket dont le lot vit entièrement dans la matière de test (le produit ne
89
- change pas : l'isolation des tests, une aide partagée, la couverture neuve d'un comportement
90
- existant) porte aussi `comportement` `inchangé`, mais sans développeur : le testwriter livre
91
- les tests et les aides, puis les contrôles et la relecture ; aucun rouge-d'abord n'est attendu,
92
- car aucun comportement produit n'est neuf. Je le reconnais dès l'étape 1 et ne le classe pas
93
- `comportement`. Une sorte absente, ou sans sa raison, ou mécanique sans sa commande, vaut
94
- `comportement` : le circuit entier ;
98
+ un doute va au circuit : `comportement`. Le champ `comportement` d'un plan de sorte
99
+ comportement a trois valeurs, et je choisis celle du lot :
100
+ - `changé` : un test honnête peut rougir avant le lot ; le testwriter écrit, la preuve exige
101
+ un rouge. C'est la valeur du doute ;
102
+ - `tests-adaptés` : le lot ne change aucun comportement que ses tests mesurent (un test
103
+ adapté, un seuil relevé dans un test, un lot entièrement dans la matière de test : l'isolation
104
+ des tests, une aide partagée, la couverture neuve d'un comportement existant) ; le
105
+ testwriter écrit, la preuve accepte chaque vert, puis le développeur écrit le code (une
106
+ réorganisation en a), les contrôles et la relecture ;
107
+ - `inchangé`, le plan « comportement inchangé » : le geste écrit à la main décrit ci-dessus
108
+ (aucun test honnête, aucun outil) ; le développeur seul, sans testwriter ni preuve, la suite existante faisant la preuve.
109
+
110
+ Je le reconnais dès l'étape 1. Une sorte absente, ou sans sa raison, ou mécanique sans sa
111
+ commande, vaut `comportement` `changé` : le circuit entier ;
95
112
  - `ecartes` : chaque composant du relevé que le plan ne touche pas, avec sa raison (il n'a
96
113
  rien à changer, par exemple) ; le circuit l'écrit au ticket. Le circuit rejoue le relevé sur
97
114
  mon plan : un composant qui n'est ni dans `paquets` ni dans `ecartes` rend ma fiche non
98
- conforme ;
115
+ conforme. Écarter un lecteur est une prévision, pas un verdict : les contrôles jouent la
116
+ construction et les tests de chaque écarté, et s'il rougit, le circuit l'ajoute au plan sans
117
+ arrêt et le rouge va au développeur, ma raison écrite au ticket comme pièce qu'il dément.
118
+ J'écarte donc avec une raison que je peux étayer (« ne lit pas ce que le ticket change »),
119
+ jamais pour alléger le plan ;
99
120
  - `noms_publies` : quand le lot ajoute un nom à une ligne « Consommateurs » de l'INTERFACE d'un
100
121
  fournisseur (un composant publie un nom neuf à un autre, ou un consommateur lit un nom de
101
122
  plus), une entrée par consommateur : le `fournisseur`, le `consommateur` comme sa ligne le