@roomi-fields/grillhouse 0.50.3 → 0.51.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 (131) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/CHANGELOG.md +48 -0
  3. package/agents/developpeur.md +1 -1
  4. package/agents/direct.md +1 -1
  5. package/agents/explorateur.md +1 -1
  6. package/agents/questionneur.md +1 -1
  7. package/agents/relecteur.md +1 -1
  8. package/agents/testwriter.md +1 -1
  9. package/cadre/templates/c/package.json +1 -0
  10. package/cadre/templates/cargo/package.json +1 -0
  11. package/cadre/templates/python/package.json +1 -0
  12. package/charte.md +17 -12
  13. package/dist/machine/part-par-sorte.d.ts +16 -0
  14. package/dist/machine/part-par-sorte.js +36 -0
  15. package/dist/machine/part-par-sorte.js.map +1 -0
  16. package/dist/temporal/circuit/appel.js +1 -1
  17. package/dist/temporal/circuit/appel.js.map +1 -1
  18. package/dist/temporal/circuit/client.d.ts +5 -4
  19. package/dist/temporal/circuit/client.js +39 -16
  20. package/dist/temporal/circuit/client.js.map +1 -1
  21. package/dist/temporal/circuit/contrat.d.ts +11 -7
  22. package/dist/temporal/circuit/contrat.js +5 -9
  23. package/dist/temporal/circuit/contrat.js.map +1 -1
  24. package/dist/temporal/circuit/deroule.js +18 -6
  25. package/dist/temporal/circuit/deroule.js.map +1 -1
  26. package/dist/temporal/commande.js +12 -3
  27. package/dist/temporal/commande.js.map +1 -1
  28. package/dist/temporal/installation.d.ts +54 -3
  29. package/dist/temporal/installation.js +187 -17
  30. package/dist/temporal/installation.js.map +1 -1
  31. package/dist/temporal/places/client.d.ts +5 -1
  32. package/dist/temporal/places/client.js +23 -11
  33. package/dist/temporal/places/client.js.map +1 -1
  34. package/docs/ARCHITECTURE.md +23 -2700
  35. package/docs/INTERFACE.md +23 -8
  36. package/docs/architecture/circuit.md +59 -12
  37. package/docs/architecture/entree.md +20 -7
  38. package/docs/architecture/greffon.md +6 -2
  39. package/docs/architecture/installation.md +30 -11
  40. package/docs/architecture/machine.md +50 -37
  41. package/docs/architecture/tests.md +52 -14
  42. package/docs/lexique.md +154 -0
  43. package/hooks/register.tsx +1 -1
  44. package/package.json +1 -1
  45. package/scripts/activites.mjs +85 -60
  46. package/scripts/aiguillage.mjs +15 -7
  47. package/scripts/attente-de-la-machine.mjs +4 -8
  48. package/scripts/avancement.mjs +12 -8
  49. package/scripts/bilan.mjs +10 -7
  50. package/scripts/branche-de-nuit.mjs +2 -2
  51. package/scripts/ci-de-main.mjs +18 -21
  52. package/scripts/circuit.mjs +86 -43
  53. package/scripts/circuits-du-serveur.mjs +5 -5
  54. package/scripts/composants-affectes.mjs +30 -12
  55. package/scripts/composition-des-langages.mjs +5 -3
  56. package/scripts/conformite.mjs +1 -1
  57. package/scripts/consommation-des-passes.mjs +8 -6
  58. package/scripts/copies-finies.mjs +3 -14
  59. package/scripts/depart-du-ticket.d.mts +8 -2
  60. package/scripts/depart-du-ticket.mjs +26 -8
  61. package/scripts/direct.mjs +158 -72
  62. package/scripts/droits.mjs +63 -185
  63. package/scripts/engendres.mjs +3 -14
  64. package/scripts/enveloppe/enveloppe.mjs +75 -30
  65. package/scripts/enveloppe/lancer.sh +59 -45
  66. package/scripts/enveloppe/paquets-du-plan.mjs +38 -11
  67. package/scripts/enveloppe/travail-de-la-copie.mjs +115 -3
  68. package/scripts/etapes.mjs +84 -22
  69. package/scripts/faits-du-circuit.mjs +8 -2
  70. package/scripts/grillhouse-maj.mjs +43 -18
  71. package/scripts/groupe-cles.d.mts +15 -0
  72. package/scripts/groupe-cles.mjs +77 -2
  73. package/scripts/init.mjs +9 -2
  74. package/scripts/integration/rejeu.mjs +8 -1
  75. package/scripts/jointure.d.ts +22 -3
  76. package/scripts/langages/c/index.mjs +5 -2
  77. package/scripts/langages/cargo/commandes.mjs +35 -15
  78. package/scripts/langages/cargo/composants.mjs +45 -3
  79. package/scripts/langages/cargo/index.mjs +6 -3
  80. package/scripts/langages/python/index.mjs +5 -2
  81. package/scripts/langages/typescript/chemins-des-tests.mjs +1 -1
  82. package/scripts/langages/typescript/index.mjs +4 -2
  83. package/scripts/langages/typescript/mise-a-jour.mjs +1 -1
  84. package/scripts/langages/typescript/rapports-aux-lignes.mjs +74 -0
  85. package/scripts/langages/typescript/turbo-des-paquets.mjs +99 -36
  86. package/scripts/langages/typescript/verdict.mjs +29 -3
  87. package/scripts/langages/typescript/verifier.mjs +1 -1
  88. package/scripts/langages/typescript/vitest-config/changements.mjs +8 -6
  89. package/scripts/langages/typescript/vitest-config/lances.mjs +15 -32
  90. package/scripts/langages.mjs +54 -4
  91. package/scripts/matieres-lues.mjs +1 -1
  92. package/scripts/mesure/base-de-passe.mjs +32 -90
  93. package/scripts/migrations/serveurs-de-l-index.mjs +79 -0
  94. package/scripts/migrations.mjs +21 -7
  95. package/scripts/paquets.d.ts +3 -0
  96. package/scripts/paquets.mjs +88 -1
  97. package/scripts/passe-de-la-machine.mjs +109 -36
  98. package/scripts/places-de-la-machine.mjs +81 -29
  99. package/scripts/plafond-de-la-machine.d.mts +2 -5
  100. package/scripts/plafond-de-la-machine.mjs +9 -9
  101. package/scripts/reprise.mjs +42 -13
  102. package/scripts/resultats.mjs +76 -54
  103. package/scripts/retirer-les-copies-finies.mjs +1 -1
  104. package/scripts/seances.mjs +426 -115
  105. package/scripts/services-du-noyau.mjs +9 -1
  106. package/scripts/session-start.sh +14 -1
  107. package/scripts/sortie.mjs +37 -6
  108. package/scripts/sous-commandes.mjs +0 -2
  109. package/scripts/superviseur.mjs +33 -13
  110. package/scripts/tableau.mjs +61 -16
  111. package/scripts/transitions.d.mts +25 -2
  112. package/scripts/transitions.mjs +137 -29
  113. package/scripts/verrous/ecriture-hors-enveloppe.mjs +31 -9
  114. package/skills/codebase-design/DESIGN-IT-TWICE.md +1 -1
  115. package/skills/developpeur/SKILL.md +38 -15
  116. package/skills/direct/SKILL.md +29 -9
  117. package/skills/domain-modeling/GLOSSARY-FORMAT.md +9 -9
  118. package/skills/domain-modeling/SKILL.md +14 -12
  119. package/skills/explorateur/SKILL.md +30 -6
  120. package/skills/pitmaster/SKILL.md +12 -16
  121. package/skills/pitmaster/references/consigne-agent.md +12 -11
  122. package/skills/relecteur/SKILL.md +12 -5
  123. package/skills/systematic-debugging/SKILL.md +281 -0
  124. package/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
  125. package/skills/systematic-debugging/condition-based-waiting.md +115 -0
  126. package/skills/systematic-debugging/defense-in-depth.md +122 -0
  127. package/skills/systematic-debugging/find-polluter.sh +72 -0
  128. package/skills/systematic-debugging/root-cause-tracing.md +169 -0
  129. package/skills/testwriter/SKILL.md +35 -29
  130. package/scripts/verrous/commande.mjs +0 -214
  131. package/scripts/verrous/verrou.mjs +0 -311
@@ -1,9 +1,9 @@
1
- #!/usr/bin/env node
2
1
  // The rights and the context of each role session the circuit launches, from one source (ROLES):
3
2
  // the testwriter and the developpeur in the envelope of their plan (scripts/enveloppe/lancer.sh),
4
3
  // the explorateur, the questionneur and the reviewer out of it (scripts/circuit.mjs). A session
5
- // receives the rights the commands of its skill name, and the context its work reads.
6
- // Architecture: docs/architecture/machine.md (§3.2, §2.5).
4
+ // has every tool its work uses and runs every command: what it writes is bounded by the mounts of
5
+ // its envelope and judged on its lot (scripts/seances.mjs), never by a rule on its commands.
6
+ // Architecture: docs/architecture/machine.md (§3.2, §5.5).
7
7
  //
8
8
  // npx grillhouse droits <rôle> --racine <arbre principal> --copie <copie> --ticket <ticket>
9
9
  //
@@ -16,13 +16,14 @@
16
16
  // settings of the role exclude it by its path (`claudeMdExcludes`), and the envelope does not
17
17
  // mount it.
18
18
  // - `--settings <json>` (the settings of the role, on the command line: no file the session could
19
- // change): its permissions (`allow`, the commands its skill names, and the reading of its
20
- // skill's files, references included, and of the METACADRE.md its skill names, in the frame's
21
- // plugin as installed for the copy, else for the project, by `Read` and `ls` and with no writing; `deny`, the change of its
22
- // author at the ticket, AUTEUR_FIXE, for a role that writes the editing by script, the test
23
- // tool run directly and the reading again of the ticket its instruction carries, and for a role
24
- // that writes nothing at the ticket, the explorateur and the questionneur, every write of bd,
25
- // ECRIRE_AU_TICKET); the
19
+ // change): its permissions (`allow`, every command of `Bash`, the tools of the index for a role
20
+ // that uses it, and the reading of its skill's files, references included, of those of the
21
+ // debugging skill for a role whose skill loads it (`debogage`), and of the METACADRE.md its
22
+ // skill names, in the frame's plugin as installed for the copy, else for the project, by `Read`
23
+ // and `ls` and with no writing; `deny`, the change of its author at the ticket, AUTEUR_FIXE,
24
+ // for a role whose instruction carries its ticket the reading of it again, for a role that
25
+ // writes the test tool run directly, and for a role that writes nothing at the ticket every write
26
+ // of bd, ECRIRE_AU_TICKET); no hook; the
26
27
  // automatic memory off; the skills of Claude Code off (`disableBundledSkills`, and the few it keeps,
27
28
  // INTEGREES), and the project's own skills (`.claude/skills/` of the copy) off
28
29
  // (`skillOverrides`); every plugin the project enables off (`enabledPlugins`: their skills,
@@ -31,18 +32,14 @@
31
32
  // skills of a plugin, and the role's agent preloads its own (`skills` of its definition);
32
33
  // the background tasks off and Code Mode on (`env`, ENV_DES_SEANCES: a role waits in the
33
34
  // foreground for what it launches, and its session ends with its sheet; `claude -p` gets Code
34
- // Mode, the REPL, only from this block); for a role that writes, its locks as hooks (PreToolUse: verrous/verrou.mjs on the tools of
35
- // writing, verrous/commande.mjs on Bash), since the hooks of an agent's definition do not run in
36
- // a folder Claude Code has not trusted, as the copy of a ticket.
35
+ // Mode, the REPL, only from this block).
37
36
  // - `--tools <list>`: the tools its work uses; Edit and Write for a role that writes alone, the
38
37
  // tool search for a role whose index Claude Code defers.
39
38
  // - `--strict-mcp-config --mcp-config <json>`: the servers of the index (codegraph, rtfm) for a
40
39
  // role that uses it, read in the project's `.mcp.json` and in the manifests of the plugins it
41
40
  // enables, at their installed path (`~/.claude/plugins/installed_plugins.json`, the project's
42
- // entry first, else the user's); none for the others.
43
- //
44
- // The skills' commands and the permissions answer one another: tests/unit/droits.spec.ts fails on a
45
- // command a skill names that no permission covers, and on a permission no command names.
41
+ // entry first, else the user's); a project's entry whose command is the bare name of the program
42
+ // a plugin ships runs that program; none for the others.
46
43
  import { existsSync, readdirSync, readFileSync } from 'node:fs';
47
44
  import os from 'node:os';
48
45
  import path from 'node:path';
@@ -60,18 +57,6 @@ export const AUTEUR_FIXE = [
60
57
  'Bash(bd * -a*)',
61
58
  `Bash(*${ACTEUR}*)`,
62
59
  ];
63
- // What a role that writes may not run: a file is edited by its tools of writing, which its lock
64
- // judges, and the tests run by `npm test` (charter, « Les tests se lancent par npm test »).
65
- const ECRIRE_PAR_SCRIPT = [
66
- 'Bash(python *)',
67
- 'Bash(python3 *)',
68
- 'Bash(sed -i*)',
69
- 'Bash(sed * -i*)',
70
- 'Bash(perl -i*)',
71
- 'Bash(perl -pi*)',
72
- 'Bash(perl * -i*)',
73
- 'Bash(perl * -pi*)',
74
- ];
75
60
  // What a role that writes nothing at the ticket may not run: the circuit writes its exchange there,
76
61
  // from its sheet.
77
62
  const ECRIRE_AU_TICKET = [
@@ -93,24 +78,14 @@ const ENV_DES_SEANCES = {
93
78
  CLAUDE_CODE_EXPERIMENTAL_CODE_MODE: '1',
94
79
  };
95
80
 
96
- // The reads of git in the copy, by its path (`git -C <copie> …`), which Claude Code does not let
97
- // through without a rule, as it does `git status` in the working directory.
98
- const LIRE_GIT = [
99
- 'Bash(git -C * status*)',
100
- 'Bash(git -C * diff*)',
101
- 'Bash(git -C * log*)',
102
- 'Bash(git -C * ls-files*)',
103
- 'Bash(git -C * grep*)',
104
- ];
105
81
  // The skills Claude Code keeps listed when its own are off (`disableBundledSkills`), measured on
106
82
  // Claude Code 2.1.305.
107
83
  const INTEGREES = ['design', 'doctor', 'plugin-authoring'];
108
84
  // The frame's plugin, by the start of its identifier (`grillhouse@<place de marché>`).
109
85
  const GREFFON_DU_CADRE = 'grillhouse@';
110
- // The servers of the index (charter, « L'index d'abord »).
86
+ // The servers of the index (charter, « L'index d'abord »), and their tools of reading: codegraph
87
+ // for the calls, rtfm for the search and the reading of a result whole.
111
88
  const INDEX = ['codegraph', 'rtfm'];
112
- // The reads of the index by a role that writes: codegraph for the calls, rtfm for the search and
113
- // the reading of a result whole.
114
89
  const LIRE_L_INDEX = [
115
90
  'Bash(codegraph explore *)',
116
91
  'mcp__codegraph__codegraph_explore',
@@ -121,140 +96,64 @@ const LIRE_L_INDEX = [
121
96
  const LIRE = ['Bash', 'Read', 'Skill'];
122
97
  const ECRIRE = ['Edit', 'Write'];
123
98
 
124
- // The charter prescribes `env -C <dossier>` in place of `cd`: a command run in the copy carries
125
- // that prefix, which a bare rule does not match. Each rule of command, out of bd, git and env -C,
126
- // gets its twin `Bash(env -C * <commande>)`, as git has `git show` and `git -C * show`.
127
- /** @param {string[]} regles @returns {string[]} */
128
- function avecJumelles(regles) {
129
- return regles.flatMap(r => {
130
- const bash = /^Bash\((.*)\)$/.exec(r);
131
- return bash && !/^(bd|git|env -C) /.test(bash[1]) ? [r, `Bash(env -C * ${bash[1]})`] : [r];
132
- });
133
- }
99
+ // The rules that permit a role its commands, every one, and the tools of the index for a role that
100
+ // uses it.
101
+ const TOUTE_COMMANDE = ['Bash'];
102
+ const TOUTE_COMMANDE_ET_L_INDEX = [...TOUTE_COMMANDE, ...LIRE_L_INDEX];
134
103
 
135
104
  // Each role the circuit launches: whether it writes (files, `ecrit`; the ticket, unless
136
- // `ecritAuTicket` is false), whether it uses the index, whether its skill names the frame's
137
- // METACADRE.md (`metacadre`, read at the root of the plugin installed), and the commands its skill
138
- // names (the frame's plugin, `mods/grillhouse/skills/<rôle>/`), as permission rules.
105
+ // `ecritAuTicket` is false), whether its instruction carries its ticket (`porteSonTicket`),
106
+ // whether it uses the index, the rules of its commands (`commandes`), whether its skill names the frame's METACADRE.md (`metacadre`, read
107
+ // at the root of the plugin installed), and whether its skill loads the debugging skill of the
108
+ // plugin (`debogage`, read with its neighbouring files).
139
109
  export const ROLES = {
140
110
  // It writes no file and nothing at the ticket: it surveys the components and reads the code by
141
- // the index, and ends on the plan in its sheet, which the circuit writes at the ticket. At the
142
- // tri of the discoveries, it reads each one and its parent, the commit of main and its history
143
- // (`git show`, `git log`, in its working directory, the main tree, or by `git -C`), and builds
144
- // a package before it judges an error of types of its export; it has no pass. Its
145
- // instruction of the tri lists these commands (`commandesPermises`).
111
+ // the index, and ends on the plan in its sheet, which the circuit writes at the ticket.
146
112
  explorateur: {
147
113
  metacadre: true,
114
+ debogage: true,
148
115
  index: true,
149
116
  ecritAuTicket: false,
150
- commandes: avecJumelles([
151
- 'Bash(bd show *)',
152
- 'Bash(bd comments *)',
153
- 'Bash(git show *)',
154
- 'Bash(git log *)',
155
- 'Bash(git -C * show *)',
156
- 'Bash(git -C * log *)',
157
- 'Bash(npx grillhouse composants-affectes *)',
158
- 'Bash(npm run build -- --filter=*)',
159
- 'Bash(codegraph explore *)',
160
- 'mcp__codegraph__codegraph_explore',
161
- 'mcp__rtfm__rtfm_search',
162
- ]),
117
+ commandes: TOUTE_COMMANDE_ET_L_INDEX,
163
118
  },
164
- // It writes the tests of the whole ticket, in the envelope of its plan, and reads the whole copy
165
- // by the index (charter, « L'index d'abord »).
119
+ // It writes the tests of the whole ticket, in the envelope of its plan.
166
120
  testwriter: {
167
121
  metacadre: true,
168
122
  ecrit: true,
169
123
  index: true,
170
- commandes: avecJumelles([
171
- 'Bash(bd update * --claim)',
172
- 'Bash(bd comments add *)',
173
- 'Bash(npm test *)',
174
- // The removal of a file of its tests, by a script of its temporary directory.
175
- 'Bash(node $TMPDIR/*)',
176
- // The size guard on its batch before it hands back its sheet: no argument, the whole repository.
177
- 'Bash(npx grillhouse tailles-des-tests)',
178
- ...LIRE_L_INDEX,
179
- ]),
124
+ porteSonTicket: true,
125
+ commandes: TOUTE_COMMANDE_ET_L_INDEX,
180
126
  },
181
- // It writes the code of the whole ticket, in the envelope of its plan, and reads the whole copy
182
- // by the index.
127
+ // It writes the code of the whole ticket, in the envelope of its plan.
183
128
  developpeur: {
184
129
  metacadre: true,
130
+ debogage: true,
185
131
  ecrit: true,
186
132
  index: true,
187
- commandes: avecJumelles([
188
- 'Bash(bd update * --claim)',
189
- 'Bash(bd update * --notes*)',
190
- 'Bash(bd comments add *)',
191
- 'Bash(git -C * status*)',
192
- 'Bash(git -C * diff*)',
193
- 'Bash(npm test *)',
194
- 'Bash(npm run api*)',
195
- ...LIRE_L_INDEX,
196
- ]),
133
+ porteSonTicket: true,
134
+ commandes: TOUTE_COMMANDE_ET_L_INDEX,
197
135
  },
198
136
  // The agent of a ticket led out of the circuit (`npx grillhouse direct`, scripts/direct.mjs): it
199
- // writes the tests and the code of the whole ticket together, in the envelope of its plan, and
200
- // reads the whole copy by the index. A role of its own: the developpeur keeps the rights of the
201
- // circuit (no test file).
137
+ // writes the tests and the code of the whole ticket together, in the envelope of its plan.
202
138
  direct: {
139
+ debogage: true,
203
140
  ecrit: true,
204
141
  index: true,
205
- commandes: avecJumelles([
206
- 'Bash(bd update * --claim)',
207
- 'Bash(bd comments add *)',
208
- 'Bash(git -C * status*)',
209
- 'Bash(git -C * diff*)',
210
- 'Bash(npm test *)',
211
- 'Bash(npm run api*)',
212
- // The removal of a file, by a script of its temporary directory.
213
- 'Bash(node $TMPDIR/*)',
214
- ...LIRE_L_INDEX,
215
- ]),
142
+ porteSonTicket: true,
143
+ commandes: TOUTE_COMMANDE_ET_L_INDEX,
216
144
  },
217
145
  relecteur: {
218
146
  metacadre: true,
219
147
  index: true,
220
- commandes: avecJumelles([
221
- ...LIRE_GIT,
222
- 'Bash(npx grillhouse index-interfaces --publie *)',
223
- 'Bash(npm test *)',
224
- 'Bash(npm run verifier -- --gardes*)',
225
- 'Bash(codegraph explore *)',
226
- 'mcp__codegraph__codegraph_explore',
227
- 'mcp__rtfm__rtfm_search',
228
- ]),
148
+ ecritAuTicket: false,
149
+ porteSonTicket: true,
150
+ commandes: TOUTE_COMMANDE_ET_L_INDEX,
229
151
  },
230
152
  // It asks, and decides nothing: it reads the proposal its instruction carries and the code by
231
153
  // the index; the circuit writes its questions at the ticket.
232
- questionneur: {
233
- index: true,
234
- ecritAuTicket: false,
235
- commandes: avecJumelles([
236
- 'Bash(codegraph explore *)',
237
- 'mcp__codegraph__codegraph_explore',
238
- 'mcp__rtfm__rtfm_search',
239
- ]),
240
- },
154
+ questionneur: { index: true, ecritAuTicket: false, commandes: TOUTE_COMMANDE_ET_L_INDEX },
241
155
  };
242
156
 
243
- // The commands the rights of <role> permit (ROLES.<role>.commandes), one line each, in Markdown, as
244
- // the help of a tool lists its commands: a rule of Bash as its command, `…` for its wildcard; a
245
- // tool by its name. Its instruction carries them, so that it names no command its rights refuse.
246
- /** @param {keyof typeof ROLES} role @returns {string} */
247
- export function commandesPermises(role) {
248
- return ROLES[role].commandes
249
- .map(r => {
250
- const bash = /^Bash\((.*)\)$/.exec(r);
251
- return bash
252
- ? `- \`${bash[1].replaceAll('*', '…')}\``
253
- : `- l'outil \`${r.split('__').at(-1)}\``;
254
- })
255
- .join('\n');
256
- }
257
-
258
157
  const lireJson = f => {
259
158
  try {
260
159
  return JSON.parse(readFileSync(f, 'utf8'));
@@ -290,8 +189,9 @@ function cheminDuGreffon(nom, projets, home) {
290
189
  }
291
190
 
292
191
  // The reading of the skill of <role> (SKILL.md and its references/) in the frame's plugin, as
293
- // installed for the copy where the session runs, else for the project, and of the plugin's
294
- // METACADRE.md alone for a role whose skill names it: rules `Read(//…)`, which let through the
192
+ // installed for the copy where the session runs, else for the project, of the debugging skill for a
193
+ // role whose skill loads it (`debogage`), whose neighbouring files the tool Skill does not give,
194
+ // and of the plugin's METACADRE.md alone for a role whose skill names it: rules `Read(//…)`, which let through the
295
195
  // tool Read and `ls` of those folders, and write nothing (measured on Claude Code in `dontAsk`).
296
196
  // Narrower than a folder of work (`--add-dir`), which would open the whole plugin; none when the
297
197
  // plugin is not installed.
@@ -301,13 +201,17 @@ function lireSaCompetence(role, { racine, copie, home }) {
301
201
  if (!dossier) {
302
202
  return [];
303
203
  }
204
+ const competences = [role, ...(ROLES[role].debogage ? ['systematic-debugging'] : [])];
304
205
  return [
305
- `Read(/${path.join(dossier, 'skills', role)}/**)`,
206
+ ...competences.map(c => `Read(/${path.join(dossier, 'skills', c)}/**)`),
306
207
  ...(ROLES[role].metacadre ? [`Read(/${path.join(dossier, 'METACADRE.md')})`] : []),
307
208
  ];
308
209
  }
309
210
 
310
211
  // The servers of the index: the project's `.mcp.json`, then the manifests of the plugins it enables.
212
+ // An entry of the project whose command is the bare name of the program a plugin ships runs that
213
+ // program, with the rest of the project's entry: the envelope mounts the plugin, and the PATH of a
214
+ // session does not hold its `bin/`.
311
215
  function serveursDeLIndex(racine, home) {
312
216
  const out = {};
313
217
  const projet = lireJson(path.join(racine, '.mcp.json'))?.mcpServers ?? {};
@@ -326,10 +230,17 @@ function serveursDeLIndex(racine, home) {
326
230
  lireJson(path.join(dossier, '.mcp.json'))?.mcpServers ??
327
231
  {};
328
232
  for (const n of INDEX) {
329
- if (out[n] || !serveurs[n]) {
233
+ if (!serveurs[n]) {
330
234
  continue;
331
235
  }
332
- out[n] = JSON.parse(JSON.stringify(serveurs[n]).replaceAll('${CLAUDE_PLUGIN_ROOT}', dossier));
236
+ const porte = JSON.parse(
237
+ JSON.stringify(serveurs[n]).replaceAll('${CLAUDE_PLUGIN_ROOT}', dossier)
238
+ );
239
+ if (!out[n]) {
240
+ out[n] = porte;
241
+ } else if (out[n].command === path.basename(porte.command ?? '')) {
242
+ out[n] = { ...out[n], command: porte.command };
243
+ }
333
244
  }
334
245
  }
335
246
  return out;
@@ -346,7 +257,9 @@ function reglagesDuRole(role, { racine, copie = racine, ticket, home }) {
346
257
  if (r.ecrit) {
347
258
  // The test tool run directly (charter, « Aucun agent ne lance l'outil de test directement »),
348
259
  // as the module of the copy's language names it: `npm test` and `npm run verifier` play it.
349
- deny.push(...ECRIRE_PAR_SCRIPT, ...langageDe(copie).droits);
260
+ deny.push(...langageDe(copie).droits);
261
+ }
262
+ if (r.porteSonTicket) {
350
263
  // The ticket its instruction carries, its description, notes and last handover.
351
264
  for (const lecture of ['show', 'comments']) {
352
265
  deny.push(`Bash(bd ${lecture} ${ticket})`, `Bash(bd ${lecture} ${ticket} *)`);
@@ -361,7 +274,7 @@ function reglagesDuRole(role, { racine, copie = racine, ticket, home }) {
361
274
  .map(d => d.name)
362
275
  : []),
363
276
  ];
364
- const reglages = {
277
+ return {
365
278
  permissions: {
366
279
  allow: [...r.commandes, ...lireSaCompetence(role, { racine, copie, home })],
367
280
  deny,
@@ -377,41 +290,6 @@ function reglagesDuRole(role, { racine, copie = racine, ticket, home }) {
377
290
  ),
378
291
  env: ENV_DES_SEANCES,
379
292
  };
380
- // The write lock runs the frame of the main tree, never the copy's; a copy that is the root keeps
381
- // the project's own command.
382
- const distincte = path.resolve(copie) !== path.resolve(racine);
383
- const cadre = distincte ? racine : '$CLAUDE_PROJECT_DIR';
384
- const commande = `"${cadre}/node_modules/.bin/grillhouse"`;
385
- // Fails closed (a firewall's rule): a missing command makes the shell exit 127, which Claude Code
386
- // reads as an error that does not block, so a copy with a main tree lacking the frame refuses (2).
387
- const verrou = distincte
388
- ? `[ -x ${commande} ] || { echo "⛔ verrou : le cadre de l'arbre principal manque ou n'est pas exécutable : ${cadre}/node_modules/.bin/grillhouse (écriture refusée)" >&2; exit 2; }; exec ${commande} verrou ${role}`
389
- : `${commande} verrou ${role}`;
390
- if (r.ecrit) {
391
- reglages.hooks = {
392
- PreToolUse: [
393
- {
394
- matcher: 'Write|Edit|MultiEdit|NotebookEdit',
395
- hooks: [
396
- {
397
- type: 'command',
398
- command: verrou,
399
- },
400
- ],
401
- },
402
- {
403
- matcher: 'Bash',
404
- hooks: [
405
- {
406
- type: 'command',
407
- command: '"$CLAUDE_PROJECT_DIR/node_modules/.bin/grillhouse" commande',
408
- },
409
- ],
410
- },
411
- ],
412
- };
413
- }
414
- return reglages;
415
293
  }
416
294
 
417
295
  // The options of claude for the session of <role> (the header's list); <home> holds the plugins
@@ -34,24 +34,13 @@
34
34
  import { existsSync, readFileSync } from 'node:fs';
35
35
  import path from 'node:path';
36
36
  import { arbrePrincipal } from './outils-cles.mjs';
37
+ import { couvertPar } from './paquets.mjs';
38
+
39
+ export { couvertPar };
37
40
 
38
41
  // The lock file `npm ci` installs from, at the root of the tree.
39
42
  const VERROU = 'package-lock.json';
40
43
 
41
- /**
42
- * Whether one of <motifs> covers the file <fichier>, both from the root of the copy, as the inputs
43
- * of Turborepo read them: a path names that file, a directory every file under it, a glob pattern
44
- * (`*`, `**`) the files it matches (`path.matchesGlob` of Node).
45
- * @param {string[]} motifs
46
- * @param {string} fichier
47
- */
48
- export function couvertPar(motifs, fichier) {
49
- return motifs.some(m => {
50
- const dossier = m.replace(/\/+$/, '');
51
- return fichier === dossier || fichier.startsWith(`${dossier}/`) || path.matchesGlob(fichier, m);
52
- });
53
- }
54
-
55
44
  // Whether the pattern <m> leaves the repository: absolute, or climbing above the root.
56
45
  const horsDuDepot = m => path.isAbsolute(m) || path.posix.normalize(m).split('/')[0] === '..';
57
46