@roomi-fields/grillhouse 0.43.2 → 0.45.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 (72) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/CHANGELOG.md +32 -0
  3. package/cadre/templates/projet/.claude/settings.json +5 -0
  4. package/cadre/templates/projet/.github/workflows/ci.yml +11 -17
  5. package/cadre/templates/projet/.github/workflows/nuit.yml +3 -3
  6. package/cadre/templates/projet/CLAUDE.md +15 -2
  7. package/cadre/templates/projet/docs/agents/issue-tracker.md +1 -1
  8. package/cadre/templates/projet/package.json +1 -1
  9. package/charte.md +3 -2
  10. package/dist/temporal/circuit/client.d.ts +7 -0
  11. package/dist/temporal/circuit/client.js +12 -2
  12. package/dist/temporal/circuit/client.js.map +1 -1
  13. package/dist/temporal/commande.js +5 -1
  14. package/dist/temporal/commande.js.map +1 -1
  15. package/dist/temporal/installation.d.ts +21 -1
  16. package/dist/temporal/installation.js +207 -16
  17. package/dist/temporal/installation.js.map +1 -1
  18. package/dist/temporal/tickets/activites.js +3 -1
  19. package/dist/temporal/tickets/activites.js.map +1 -1
  20. package/docs/ARCHITECTURE.md +238 -77
  21. package/docs/INTERFACE.md +30 -15
  22. package/package.json +2 -2
  23. package/scripts/activites.mjs +59 -43
  24. package/scripts/aiguillage.mjs +1 -0
  25. package/scripts/attente-de-la-machine.mjs +312 -0
  26. package/scripts/avancement.mjs +38 -31
  27. package/scripts/bilan.mjs +30 -5
  28. package/scripts/circuit.mjs +10 -7
  29. package/scripts/codes-de-sortie.mjs +1 -1
  30. package/scripts/coeurs-dedies.mjs +427 -0
  31. package/scripts/composants-affectes.mjs +3 -1
  32. package/scripts/consommation-des-passes.mjs +382 -0
  33. package/scripts/consommation.mjs +45 -0
  34. package/scripts/copies-finies.mjs +2 -2
  35. package/scripts/depart-du-ticket.mjs +7 -5
  36. package/scripts/disque-des-copies.mjs +1 -1
  37. package/scripts/echantillonneur-de-la-passe.mjs +103 -0
  38. package/scripts/enveloppe/enveloppe.mjs +3 -13
  39. package/scripts/enveloppe/lancer.sh +1 -1
  40. package/scripts/enveloppe/travail-de-la-copie.mjs +3 -2
  41. package/scripts/grillhouse-maj.mjs +8 -4
  42. package/scripts/integration/file.mjs +10 -4
  43. package/scripts/jointure.d.ts +20 -9
  44. package/scripts/langages/cargo/commandes.mjs +8 -8
  45. package/scripts/langages/python/commandes.mjs +7 -6
  46. package/scripts/langages/typescript/tests-de-nuit.mjs +17 -4
  47. package/scripts/langages/typescript/tests.mjs +15 -6
  48. package/scripts/langages/typescript/verifier.mjs +23 -17
  49. package/scripts/langages/typescript/vitest-config/base.mjs +3 -3
  50. package/scripts/langages/typescript/vitest-config/machine.setup.mjs +7 -7
  51. package/scripts/langages.d.mts +2 -0
  52. package/scripts/langages.mjs +79 -0
  53. package/scripts/mesure/base-de-passe.mjs +1 -1
  54. package/scripts/migrations/0.44.0-node-26-seul.mjs +47 -0
  55. package/scripts/migrations/0.44.0-seuil-des-codes-de-tickets.mjs +47 -0
  56. package/scripts/migrations.mjs +4 -0
  57. package/scripts/passe-de-la-machine.mjs +456 -31
  58. package/scripts/places-de-la-machine.mjs +508 -61
  59. package/scripts/plafond-de-la-machine.d.mts +47 -2
  60. package/scripts/plafond-de-la-machine.mjs +197 -5
  61. package/scripts/preparation.mjs +1 -0
  62. package/scripts/regles-des-places.d.mts +40 -0
  63. package/scripts/regles-des-places.mjs +91 -0
  64. package/scripts/retirer-les-copies-finies.mjs +1 -1
  65. package/scripts/seances.mjs +4 -3
  66. package/scripts/services-du-noyau.mjs +3 -3
  67. package/scripts/sortie.mjs +3 -2
  68. package/scripts/sous-commandes.mjs +6 -7
  69. package/scripts/tableau.mjs +121 -112
  70. package/scripts/ticket-du-circuit.mjs +5 -1
  71. package/scripts/verrous/verrou.mjs +3 -3
  72. package/scripts/verrou-de-machine.mjs +0 -829
@@ -77,29 +77,26 @@
77
77
  // never the figures nor the ticket's number); the queue (5.2), the steps of its 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
- // - The lock of the machine (scripts/verrou-de-machine.mjs, read by `lireLaMesure`), as lslocks
81
- // names who holds a lock and cargo says what its wait waits for. A holder or a wait of a circuit
80
+ // - The parts of the machine (scripts/places-de-la-machine.mjs, read by `lireLaMesure`), as Slurm's
81
+ // `squeue` names who holds what and what a job waits for. A part held or waited for by a circuit
82
82
  // AGENTS shows stands on that circuit's line, one line per ticket, in place of the progress of
83
- // its pass: « · <sorte> faits/prévus · <durée> » since it took the lock, « · <sorte> figée
84
- // <durée> · faits/prévus » past FIGEE without a sign, « · verrou <sorte> · <durée> » for a
85
- // wait, the kind in lower case. Any other stands at the head of AGENTS, with the machine: its
86
- // holder, whoever it is (a pass out of a ticket, the circuit of a ticket of any project of the
87
- // machine), « 🔒 <sorte> · <projet> · <qui> · faits/prévus · <durée> », « ⚠ <sorte> figée
88
- // <durée> · <projet> · <qui> · faits/prévus »; then each pass that waits for the lock or for
89
- // room under /tmp, the oldest first, « ⏳ <sorte> · <projet> · <qui> · attend · <durée> ». <qui>
90
- // is its ticket without its prefix (`courtDuTicket`), else the folder of its copy (`copie`,
91
- // under .claude/worktrees/, or the main tree when the project is not named); <projet> is left
92
- // out for the project of the board (`ici`). The width cuts the project first, then leaves out
93
- // « attend », then cuts <qui>, never the kind, the figures nor the time. Such a line is marked
94
- // `avancement`, which the pane measures again more often.
83
+ // its pass: « · <sorte> faits/prévus · <durée> » since it took its part, « · <sorte> figée
84
+ // <durée> · faits/prévus » past FIGEE without a sign, « · part <sorte> · <durée> » for a wait,
85
+ // the kind in lower case. The others stand at the head of AGENTS (`lignesDesParts`): the budget
86
+ // taken, « Parts · 2 passes · 6 sur 8 cœurs · 11 sur 16 Go »; each pass that holds a part,
87
+ // « 🔒 <sorte> · <projet> · <qui> · 4 cœurs · 8 Go », with « ⚠ » and what it consumes beyond its
88
+ // part when it does; each pass that waits, in the order of its rank, « ⏳ <sorte> · <projet> ·
89
+ // <qui> · attend <raison> » (cores, memory, load, with the figures). <qui> is its ticket without
90
+ // its prefix (`courtDuTicket`). Such a line is marked `avancement`, which the pane measures
91
+ // again more often.
95
92
  // - Signs: each sign keeps one sense (the owner's decisions of 2026-11-01 and 2026-11-12). A
96
93
  // ticket's line in AGENTS takes one of three, by the tone of its state: ▶ its step works (cyan),
97
94
  // a ticket led in direct included; ⏸ it waits, under the step about to be launched, the reason
98
95
  // on its right (« attend une place », « verrou », « CI », « disque », « démarre » in grey, the
99
96
  // circuit waiting for the machine; « question au superviseur », « question au responsable »,
100
97
  // « arrêté » in yellow, the circuit waiting for someone); ⛔ it stopped on a fault or its pass is
101
- // frozen, to correct (red). The head of AGENTS, the machine's lines: 🔒 the holder of the lock,
102
- // ⏳ a pass that waits for it or for room, 🌙 the night under way. The alerts: 💤 a ticket
98
+ // frozen, to correct (red). The head of AGENTS, the machine's lines: 🔒 a pass that holds a part,
99
+ // ⏳ a pass that waits for one or for room, 🌙 the night under way. The alerts: 💤 a ticket
103
100
  // claimed with nothing running, 🌙 a red night, ⚠ the alerts without a kind of their own. A
104
101
  // sign two columns wide stands as the others, a sign then a space; the width of a line counts
105
102
  // its columns (`colonnes`), ⏳ and ⛔ two.
@@ -110,7 +107,7 @@
110
107
  // every alert takes, whatever its duration or the line that shows it: red for what asks for a
111
108
  // correction (frozen, a fault, a question with no live wait, a ceiling refused), yellow for what
112
109
  // waits for someone (the supervisor, the owner), grey for what waits for the machine (a place,
113
- // the lock, the disk, the CI), cyan for what runs.
110
+ // a part, the disk, the CI), cyan for what runs.
114
111
  import { execFileSync } from 'node:child_process';
115
112
  import {
116
113
  closeSync,
@@ -202,7 +199,7 @@ export const ETATS = [
202
199
  // shows it; the duration stays in the text. Every line and every alert takes its tone here:
203
200
  // `alerte` (red), what asks for a correction; `attention` (yellow), what waits for someone, an
204
201
  // answer or a look; `actif` (cyan), what runs; `discret` (grey), what waits for the machine (a
205
- // place, the lock, the disk, the CI), what is done, empty or a measure; `titre`, a heading; none,
202
+ // place, a part, the disk, the CI), what is done, empty or a measure; `titre`, a heading; none,
206
203
  // a ticket at rest. The pane turns each tone into its colour (mods/grillhouse `couleur`).
207
204
  export const TONS = Object.freeze({
208
205
  // A ticket's state (ETATS).
@@ -217,7 +214,7 @@ export const TONS = Object.freeze({
217
214
  fermes: 'discret',
218
215
  // A circuit, a pass, a wait.
219
216
  attendUnePlace: 'discret',
220
- attendLeVerrou: 'discret',
217
+ attendUnePart: 'discret',
221
218
  attendLeDisque: 'discret',
222
219
  attendLaCI: 'discret',
223
220
  sansEtape: 'discret',
@@ -826,18 +823,63 @@ export function lecture(t, prefix) {
826
823
  }
827
824
 
828
825
  /**
829
- * Who holds the lock of the machine, or waits for it, as the board shows it (`lireLaMesure` of
826
+ * Who holds a part of the machine, or waits for one, as the board shows it (`lireLaMesure` of
830
827
  * scripts/avancement.mjs, its project named as the board names it, `nommerLesProjets`; `copie`,
831
- * its working tree; `ici`, it is of the board's project).
832
- * @typedef {{ depot?: string | null, copie?: string | null, ici?: boolean, projet: string,
833
- * ticket: string | null, sorte: string, depuis: number | null, quoi?: string,
834
- * avancement?: { faits: number, prevus: number, debut?: number, dernier: number } | null }} DuVerrou
835
- * @typedef {{ detenteur: DuVerrou | null, attentes: DuVerrou[] }} Machine
828
+ * its working tree; `ici`, it is of the board's project; `coeurs` and `memoire` (bytes) its part;
829
+ * `depasse`, what it consumes beyond it; `raison`, what a wait waits for).
830
+ * @typedef {{ id?: string, depot?: string | null, copie?: string | null, ici?: boolean,
831
+ * projet: string, ticket: string | null, sorte: string, depuis?: number | null, coeurs?: number,
832
+ * memoire?: number, depasse?: string | null, raison?: string, rang?: number,
833
+ * avancement?: { faits: number, prevus: number, debut?: number, dernier: number } | null }} DUnePart
834
+ * @typedef {{ budget: { coeurs: number, memoire: number } | null, faute?: string | null,
835
+ * prises: DUnePart[], attentes: DUnePart[] }} Machine
836
836
  */
837
837
 
838
+ // A number of the parts line: whole, else with one decimal and a comma.
839
+ const chiffre = n => (Number.isInteger(n) ? String(n) : n.toFixed(1).replace('.', ','));
840
+ // Bytes as GB, to a tenth.
841
+ const goDe = octets => chiffre(Math.round((octets / 1024 ** 3) * 10) / 10);
842
+
843
+ /**
844
+ * The parts of the machine as the board says them, in lines: first the budget taken, « Parts · 2
845
+ * passes · 6 sur 8 cœurs · 11 sur 16 Go » (the passes that hold a part, the cores and the memory
846
+ * they reserve of the total: the passes that wait reserve nothing), then each pass that holds a
847
+ * part, « 🔒 <sorte> · <projet> · <qui> · 4 cœurs · 8 Go » (with « ⚠ » and what it consumes beyond
848
+ * its part, when it does), then each pass that waits, in the order of its rank, « ⏳ <sorte> ·
849
+ * <projet> · <qui> · attend <raison> », what it waits for (cores, memory, load) with its figures.
850
+ * <masquer> leaves out the lines of the passes it names (those of a circuit's ticket, shown on its
851
+ * line), <court> gives the ticket as the board names it.
852
+ * @param {{ budget: { coeurs: number, memoire: number }, prises: DUnePart[], attentes: DUnePart[],
853
+ * masquer?: (p: DUnePart) => boolean, court?: (ticket: string) => string }} o
854
+ * @returns {string[]}
855
+ */
856
+ export function lignesDesParts({
857
+ budget,
858
+ prises,
859
+ attentes,
860
+ masquer = () => false,
861
+ court = ticket => ticket,
862
+ }) {
863
+ const coeurs = prises.reduce((n, p) => n + (p.coeurs ?? 0), 0);
864
+ const memoire = prises.reduce((n, p) => n + (p.memoire ?? 0), 0);
865
+ const qui = p => (p.ticket ? `${court(p.ticket)} · ` : '');
866
+ return [
867
+ `Parts · ${prises.length} ${prises.length > 1 ? 'passes' : 'passe'} · ${chiffre(coeurs)} sur ${budget.coeurs} cœurs · ${goDe(memoire)} sur ${goDe(budget.memoire)} Go`,
868
+ ...prises
869
+ .filter(p => !masquer(p))
870
+ .map(
871
+ p =>
872
+ `🔒 ${p.sorte} · ${p.projet} · ${qui(p)}${p.coeurs} cœurs · ${goDe(p.memoire ?? 0)} Go${p.depasse ? ` · ⚠ ${p.depasse}` : ''}`
873
+ ),
874
+ ...attentes
875
+ .filter(p => !masquer(p))
876
+ .map(p => `⏳ ${p.sorte} · ${p.projet} · ${qui(p)}attend ${p.raison ?? ''}`.trimEnd()),
877
+ ];
878
+ }
879
+
838
880
  /**
839
881
  * The board, from what was read. Pure: every source comes in, the time included; `machine`, the
840
- * lock of the machine; `outil`, the failed installation of the published version that leads the
882
+ * parts of the machine; `outil`, the failed installation of the published version that leads the
841
883
  * repository (scripts/aiguillage.mjs `echecDeLOutil`); `places`, the places of the machine
842
884
  * (scripts/places-de-la-machine.mjs `etatDesPlaces`), whose line heads AGENTS; `nuit`, the night
843
885
  * under way on the machine (scripts/circuits-du-serveur.mjs `nuitDuServeur`), its line under the
@@ -1616,7 +1658,7 @@ const couperAvant = (gauche, suite, droite, largeur) => {
1616
1658
  // The sign of the alert <a>: its kind's (`signe`: 🌙 a red night, 💤 a ticket claimed with
1617
1659
  // nothing running), ⚠ for the others.
1618
1660
  const signeDe = a => a.signe ?? '⚠';
1619
- // A ticket's short name on the line of the lock, whatever its project: its id without the
1661
+ // A ticket's short name on the line of a part, whatever its project: its id without the
1620
1662
  // project's prefix, which the line already names, « bp-mono-vbwf.320.11 » → « vbwf.320.11 »,
1621
1663
  // « SH-ae6.5 » → « ae6.5 ».
1622
1664
  const courtDuTicket = id => id.slice(id.lastIndexOf('-') + 1);
@@ -1657,11 +1699,11 @@ const enQuestion = c => (attendLeSuperviseur(c) ? (c.qui ?? SUPERVISEUR) : null)
1657
1699
  * The state of each ticket's line of AGENTS on the board <t>, the one source of its signs, which
1658
1700
  * AGENTS draws and the head and the status line count. Each circuit (`circuits`, by its ticket):
1659
1701
  * its state (`etat`, whose tone TONS gives), the reason of its wait (`raison`), its tone, its sign
1660
- * and its witness (`temoin`: the lock it holds or waits for, « · <sorte> faits/prévus · <durée> »,
1661
- * « · verrou <sorte> · <durée> », else the progress of its automatic pass, `temoinDe`), in this
1702
+ * and its witness (`temoin`: the part it holds or waits for, « · <sorte> faits/prévus · <durée> »,
1703
+ * « · part <sorte> · <durée> », else the progress of its automatic pass, `temoinDe`), in this
1662
1704
  * order: frozen; ended without its issue; its question (to the supervisor or to another); stopped;
1663
- * its wait for the disk, a place (« nuit » while the night holds the machine), the lock, the CI of
1664
- * its queue (5.2, the lock not held) or its first state; else it runs. `lignes`: one entry per
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
1665
1707
  * ticket's line of AGENTS, its id, its project on a board of several and its sign: each circuit,
1666
1708
  * each ticket led in direct (▶) and each agent shown out of a circuit (▶).
1667
1709
  */
@@ -1670,33 +1712,36 @@ export function etatsDAgents(t) {
1670
1712
  const p = t.places;
1671
1713
  const enCircuit = new Set((t.circuits ?? []).map(c => c.id));
1672
1714
  const duCircuit = x => Boolean(x.ticket && enCircuit.has(x.ticket));
1673
- const verrouDe = new Map();
1674
- const tenu = t.machine?.detenteur;
1675
- if (tenu && duCircuit(tenu)) {
1715
+ const partDe = new Map();
1716
+ const tientUnePart = new Set();
1717
+ for (const tenu of t.machine?.prises ?? []) {
1718
+ if (!duCircuit(tenu) || partDe.has(tenu.ticket)) {
1719
+ continue;
1720
+ }
1721
+ tientUnePart.add(tenu.ticket);
1676
1722
  const a = tenu.avancement;
1677
1723
  const age = a ? maintenant - a.dernier : 0;
1678
1724
  const compte = a && (a.faits || a.prevus) ? `${a.faits}/${a.prevus}` : '';
1679
1725
  const fige = age > FIGEE;
1680
1726
  const sorte = tenu.sorte.toLocaleLowerCase('fr');
1681
- verrouDe.set(tenu.ticket, {
1727
+ partDe.set(tenu.ticket, {
1682
1728
  fige,
1683
1729
  texte: fige
1684
1730
  ? ` · ${sorte} figée ${ilYa(age)}${compte ? ` · ${compte}` : ''}`
1685
- : ` · ${sorte}${compte ? ` ${compte}` : ''} · ${ilYa(maintenant - (tenu.depuis ?? maintenant))}`,
1731
+ : ` · ${sorte}${compte ? ` ${compte}` : ''} · ${ilYa(maintenant - (tenu.depuis ?? maintenant))}${tenu.depasse ? ` · ⚠ ${tenu.depasse}` : ''}`,
1686
1732
  });
1687
1733
  }
1688
- for (const w of [...(t.machine?.attentes ?? [])].sort((x, y) => x.depuis - y.depuis)) {
1689
- if (duCircuit(w) && !verrouDe.has(w.ticket)) {
1690
- verrouDe.set(w.ticket, {
1734
+ for (const w of t.machine?.attentes ?? []) {
1735
+ if (duCircuit(w) && !partDe.has(w.ticket)) {
1736
+ partDe.set(w.ticket, {
1691
1737
  fige: false,
1692
- texte: ` · verrou ${w.sorte.toLocaleLowerCase('fr')} · ${ilYa(maintenant - w.depuis)}`,
1738
+ texte: ` · part ${w.sorte.toLocaleLowerCase('fr')} · ${ilYa(maintenant - w.depuis)}`,
1693
1739
  });
1694
1740
  }
1695
1741
  }
1696
- const attendLeVerrou = new Set((t.machine?.attentes ?? []).map(w => w.ticket).filter(Boolean));
1742
+ const attendUnePart = new Set((t.machine?.attentes ?? []).map(w => w.ticket).filter(Boolean));
1697
1743
  const attendUnePlace = new Set((p?.attentes ?? []).map(w => w.ticket).filter(Boolean));
1698
1744
  const attendLeDisque = new Set((p?.attentes ?? []).filter(w => w.disque).map(w => w.ticket));
1699
- const tientLeVerrou = tenu && duCircuit(tenu) ? tenu.ticket : null;
1700
1745
  const etatDuCircuit = (c, temoin) => {
1701
1746
  if (temoin?.fige) {
1702
1747
  return ['fige', ''];
@@ -1716,11 +1761,11 @@ export function etatsDAgents(t) {
1716
1761
  ? ['attendLeDisque', 'disque']
1717
1762
  : attendUnePlace.has(c.id)
1718
1763
  ? ['attendUnePlace', p?.nuit ? 'nuit' : 'attend une place']
1719
- : attendLeVerrou.has(c.id)
1720
- ? ['attendLeVerrou', '']
1764
+ : attendUnePart.has(c.id)
1765
+ ? ['attendUnePart', '']
1721
1766
  : !etape
1722
1767
  ? ['sansEtape', 'démarre']
1723
- : etape.etat === 'file' && tientLeVerrou !== c.id
1768
+ : etape.etat === 'file' && !tientUnePart.has(c.id)
1724
1769
  ? ['attendLaCI', 'CI']
1725
1770
  : ['enCours', ''];
1726
1771
  };
@@ -1728,7 +1773,7 @@ export function etatsDAgents(t) {
1728
1773
  for (const c of t.circuits ?? []) {
1729
1774
  const etape = etapeDuCircuitLu(c);
1730
1775
  const temoin =
1731
- verrouDe.get(c.id) ??
1776
+ partDe.get(c.id) ??
1732
1777
  (c.vivant && etape?.qui.includes(AUTO) ? temoinDe(c, maintenant) : null);
1733
1778
  const [etat, raison] = etatDuCircuit(c, temoin);
1734
1779
  circuits.set(c.id, { etat, raison, ton: TONS[etat], signe: signeDuTon(TONS[etat]), temoin });
@@ -1882,12 +1927,6 @@ export function lignes(t, nom, largeur = LARGEUR, groupes = {}) {
1882
1927
 
1883
1928
  L('', undefined);
1884
1929
  L('AGENTS ▶ en cours · en attente', TONS.titre);
1885
- // The lock of the machine (scripts/avancement.mjs `lireLaMesure`): a holder or a wait of a
1886
- // circuit shown stands on its line (`verrouDe`); any other at the head: its holder, whoever it
1887
- // is, « 🔒 <sorte> · <projet> · <qui> · faits/prévus · <durée> », the time since it took the
1888
- // lock, the figures when it has them; past FIGEE without a sign of its progress « ⚠ <sorte>
1889
- // figée <durée> · <projet> · <qui> · faits/prévus », in the tone of an alert. Then each wait,
1890
- // the oldest first, « ⏳ <sorte> · <projet> · <qui> · attend · <durée> ».
1891
1930
  const maintenant = t.maintenant ?? Date.now();
1892
1931
  // The places of the machine (scripts/places-de-la-machine.mjs), the first line of AGENTS:
1893
1932
  // « Places 3/3 · charge 11,2/12 · mémoire 9/30 Go », the places taken of the ceiling, the load
@@ -1951,61 +1990,30 @@ export function lignes(t, nom, largeur = LARGEUR, groupes = {}) {
1951
1990
  }
1952
1991
  const enCircuit = new Set((t.circuits ?? []).map(c => c.id));
1953
1992
  const duCircuit = x => Boolean(x.ticket && enCircuit.has(x.ticket));
1954
- // The project of a holder or a wait, none for the board's project on one project's board.
1955
- const projetDe = x => (x.ici && !plusieurs ? null : x.projet);
1956
- // What names a holder or a wait: its ticket, else the folder of its copy, the main tree's only
1957
- // when the project is not named (it would say the project twice).
1958
- const quiDuVerrou = x =>
1959
- x.ticket
1960
- ? courtDuTicket(x.ticket)
1961
- : x.copie && (x.copie !== x.depot || !projetDe(x))
1962
- ? path.basename(x.copie)
1963
- : null;
1964
- // A line of the lock « <tete> · <projet> · <qui><fin> », <fin> the first of <fins> that holds
1965
- // (« · attend · <durée> », else « · <durée> »: ⏳ already says the wait); the project is cut
1966
- // first, then left out, then <qui> is cut, never <tete> nor <fin>.
1967
- const ligneDuVerrou = (tete, x, ...fins) => {
1968
- const qui = quiDuVerrou(x);
1969
- const avecQui = `${tete}${qui ? ` · ${qui}` : ''}`;
1970
- const fin = fins.find(f => colonnes(`${avecQui}${f}`) <= largeur) ?? fins[fins.length - 1];
1971
- const projet = projetDe(x);
1972
- const place = largeur - colonnes(`${avecQui}${fin}`) - 3;
1973
- if (projet && place >= 2) {
1974
- const p = colonnes(projet) > place ? `${debutDe(projet, place - 1)}…` : projet;
1975
- return `${tete} · ${p}${qui ? ` · ${qui}` : ''}${fin}`;
1976
- }
1977
- return couperAvant(avecQui, fin, '', largeur);
1978
- };
1979
- // The lock of each circuit shown stands on its line (`etatsDAgents`); any other, here.
1980
- const tenu = t.machine?.detenteur;
1981
- if (tenu && !duCircuit(tenu)) {
1982
- const a = tenu.avancement;
1983
- const age = a ? maintenant - a.dernier : 0;
1984
- const compte = a && (a.faits || a.prevus) ? `${a.faits}/${a.prevus}` : '';
1985
- const fige = age > FIGEE;
1986
- const depuis = ilYa(maintenant - (tenu.depuis ?? maintenant));
1993
+ // The parts of the machine (`lireLaMesure`, `lignesDesParts`): the budget taken, then who holds
1994
+ // a part and who waits for what; the part of each circuit shown stands on its line
1995
+ // (`etatsDAgents`), any other here. A reserve of the user that is faulty is said by its name.
1996
+ const m = t.machine;
1997
+ if (m?.faute) {
1987
1998
  poser({
1988
- texte: fige
1989
- ? ligneDuVerrou(`⚠ ${tenu.sorte} figée ${ilYa(age)}`, tenu, compte ? ` · ${compte}` : '')
1990
- : ligneDuVerrou(`🔒 ${tenu.sorte}`, tenu, ` · ${compte ? `${compte} · ` : ''}${depuis}`),
1991
- ton: fige ? TONS.fige : TONS.enCours,
1992
- avancement: true,
1999
+ texte: cadre(`réserve de la machine refusée : ${m.faute}`, '', largeur),
2000
+ ton: TONS.plafondRefuse,
1993
2001
  });
1994
2002
  }
1995
- for (const w of [...(t.machine?.attentes ?? [])].sort((x, y) => x.depuis - y.depuis)) {
1996
- if (duCircuit(w)) {
1997
- continue;
2003
+ if (m?.budget) {
2004
+ for (const l of lignesDesParts({
2005
+ budget: m.budget,
2006
+ prises: m.prises,
2007
+ attentes: m.attentes,
2008
+ masquer: duCircuit,
2009
+ court: courtDuTicket,
2010
+ })) {
2011
+ poser({
2012
+ texte: cadre(l, '', largeur),
2013
+ ton: l.startsWith('⏳') ? TONS.attendUnePart : l.startsWith('Parts') ? TONS.mesure : TONS.enCours,
2014
+ ...(l.startsWith('Parts') ? {} : { avancement: true }),
2015
+ });
1998
2016
  }
1999
- poser({
2000
- texte: ligneDuVerrou(
2001
- `⏳ ${w.sorte}`,
2002
- w,
2003
- ` · attend · ${ilYa(maintenant - w.depuis)}`,
2004
- ` · ${ilYa(maintenant - w.depuis)}`
2005
- ),
2006
- ton: TONS.attendLeVerrou,
2007
- avancement: true,
2008
- });
2009
2017
  }
2010
2018
  // The tickets that wait for a place of a circuit, not started, whose line in their chantier says
2011
2019
  // « attend une place ».
@@ -2486,18 +2494,18 @@ export function dernierBouge(tous, lignesDuTableau, vivants = [], maintenant = D
2486
2494
  }
2487
2495
 
2488
2496
  // The status line: the chantier in progress; first the alerts, counted by their signs as the board
2489
- // shows them (🌙, 💤, ⚠), then the holder of the lock of the machine, « 🔒 <sorte> · <projet> »,
2490
- // and the count of its waits, « ⏳ <n> »; then the signs of AGENTS counted as the head counts them
2497
+ // shows them (🌙, 💤, ⚠), then the passes that hold a part of the machine, « 🔒 <n> », and the
2498
+ // count of those that wait for one, « ⏳ <n> »; then the signs of AGENTS counted as the head counts them
2491
2499
  // (`comptesDAgents`), « ▶ N · ⏸ N · ⛔ N ». The alerts of the other projects of a board of several
2492
2500
  // (<voisins>, their boards) count beside the session's, as a multi-root status bar counts the problems
2493
2501
  // of every root; the counters and the chantier stay the session's.
2494
2502
  export function ligneEtat(t, voisins = []) {
2495
2503
  const signes = [t, ...voisins].flatMap(b => b.alertes ?? []).map(signeDe);
2496
- const tenu = t.machine?.detenteur;
2504
+ const tenues = t.machine?.prises?.length ?? 0;
2497
2505
  const attentes = t.machine?.attentes?.length ?? 0;
2498
2506
  const alerte = [
2499
2507
  ...[...new Set(signes)].map(s => `${s} ${signes.filter(x => x === s).length}`),
2500
- ...(tenu ? [`🔒 ${tenu.sorte} · ${tenu.projet}`] : []),
2508
+ ...(tenues ? [`🔒 ${tenues}`] : []),
2501
2509
  ...(attentes ? [`⏳ ${attentes}`] : []),
2502
2510
  ]
2503
2511
  .map(x => `${x} · `)
@@ -2866,10 +2874,10 @@ async function lesCircuits(circuitsDe, racine) {
2866
2874
  }
2867
2875
 
2868
2876
  /**
2869
- * The lock of the machine <machine> with each project named as the board names it: <noms> gives
2877
+ * The parts of the machine <machine> with each project named as the board names it: <noms> gives
2870
2878
  * the name of each project of the board by the root of its main tree (`depot`); a project out of
2871
- * the board keeps its folder's name. A holder or a wait of the repository whose main tree is <ici>
2872
- * is marked `ici`, the board's project.
2879
+ * the board keeps its folder's name. A part held or waited for by the repository whose main tree
2880
+ * is <ici> is marked `ici`, the board's project.
2873
2881
  * @param {Machine | null} machine
2874
2882
  * @param {Map<string, string>} noms
2875
2883
  * @param {string | null} [ici]
@@ -2885,7 +2893,8 @@ export function nommerLesProjets(machine, noms, ici = null) {
2885
2893
  ici: Boolean(ici && x.depot === ici),
2886
2894
  });
2887
2895
  return {
2888
- detenteur: machine.detenteur && nommer(machine.detenteur),
2896
+ ...machine,
2897
+ prises: machine.prises.map(nommer),
2889
2898
  attentes: machine.attentes.map(nommer),
2890
2899
  };
2891
2900
  }
@@ -2959,7 +2968,7 @@ export async function tableau(
2959
2968
  );
2960
2969
  }
2961
2970
  }
2962
- // The lock of the machine names each project of the board as the board does: the session's by
2971
+ // The parts of the machine name each project of the board as the board does: the session's by
2963
2972
  // its folder, another by its label; the root of its main tree, its common git directory's parent.
2964
2973
  ici.t.machine = nommerLesProjets(
2965
2974
  ici.t.machine,
@@ -10,7 +10,7 @@ import { spawnSync } from 'node:child_process';
10
10
  import { appendFileSync, existsSync, readFileSync } from 'node:fs';
11
11
  import { gesteDe } from './etapes.mjs';
12
12
  import { paquetsDuLangage } from './enveloppe/paquets-du-plan.mjs';
13
- import { langageDe } from './langages.mjs';
13
+ import { langageDe, langageDeLaCopie } from './langages.mjs';
14
14
  import { AUTEUR_DU_CIRCUIT, PREFIXE, emettre, rendusDe, sansCouleurs } from './effets.mjs';
15
15
 
16
16
  // The author of a comment, the circuit's, and the start of its lines: those of its one writer.
@@ -65,6 +65,10 @@ export const enUneLigne = t =>
65
65
  // root (a crate whose workspace is its own, as OSC Bridge's).
66
66
  export const composantsDe = racine => paquetsDuLangage(langageDe(racine), racine);
67
67
 
68
+ // The same components, still read in a copy its tool no longer loads (`langageDeLaCopie`): what
69
+ // an act of the circuit reads to open on its ticket, so that it writes its stop and resumes.
70
+ export const composantsLisibles = racine => paquetsDuLangage(langageDeLaCopie(racine), racine);
71
+
68
72
  // Every comment at the ticket, in their order, `{ author, text }` as Beads gives them, then those
69
73
  // emitted and not yet played; a failed read throws.
70
74
  export function lesCommentaires(ctx) {
@@ -45,7 +45,7 @@ import {
45
45
  paquetsDeLEnveloppe,
46
46
  paquetsDuLangage,
47
47
  } from '../enveloppe/paquets-du-plan.mjs';
48
- import { langageDe } from '../langages.mjs';
48
+ import { langageDeLaCopie } from '../langages.mjs';
49
49
 
50
50
  const WRITE_TOOLS = new Set(['Write', 'Edit', 'MultiEdit', 'NotebookEdit']);
51
51
 
@@ -109,7 +109,7 @@ export function horsDuPlan(input, { tmp = tmpdir(), env = process.env, role = nu
109
109
  if (!copie) {
110
110
  return null;
111
111
  }
112
- const langage = langageDe(copie);
112
+ const langage = langageDeLaCopie(copie);
113
113
  const liste = paquetsDuLangage(langage, copie);
114
114
  const ecrits = ecritsDuPlan(plan, liste);
115
115
  const rel = path.relative(copie, file);
@@ -213,7 +213,7 @@ export function refusal(role, input, { tmp = tmpdir(), describe = ticketDescript
213
213
  return null;
214
214
  }
215
215
  const racine = racineDe(file) ?? cwd;
216
- const langage = langageDe(racine);
216
+ const langage = langageDeLaCopie(racine);
217
217
  const classe = langage.estUnTest(file, racine);
218
218
  const testwriter = classe !== null;
219
219