@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.
- package/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +48 -0
- package/agents/developpeur.md +1 -1
- package/agents/direct.md +1 -1
- package/agents/explorateur.md +1 -1
- package/agents/questionneur.md +1 -1
- package/agents/relecteur.md +1 -1
- package/agents/testwriter.md +1 -1
- package/cadre/templates/c/package.json +1 -0
- package/cadre/templates/cargo/package.json +1 -0
- package/cadre/templates/python/package.json +1 -0
- package/charte.md +17 -12
- package/dist/machine/part-par-sorte.d.ts +16 -0
- package/dist/machine/part-par-sorte.js +36 -0
- package/dist/machine/part-par-sorte.js.map +1 -0
- package/dist/temporal/circuit/appel.js +1 -1
- package/dist/temporal/circuit/appel.js.map +1 -1
- package/dist/temporal/circuit/client.d.ts +5 -4
- package/dist/temporal/circuit/client.js +39 -16
- package/dist/temporal/circuit/client.js.map +1 -1
- package/dist/temporal/circuit/contrat.d.ts +11 -7
- package/dist/temporal/circuit/contrat.js +5 -9
- package/dist/temporal/circuit/contrat.js.map +1 -1
- package/dist/temporal/circuit/deroule.js +18 -6
- package/dist/temporal/circuit/deroule.js.map +1 -1
- package/dist/temporal/commande.js +12 -3
- package/dist/temporal/commande.js.map +1 -1
- package/dist/temporal/installation.d.ts +54 -3
- package/dist/temporal/installation.js +187 -17
- package/dist/temporal/installation.js.map +1 -1
- package/dist/temporal/places/client.d.ts +5 -1
- package/dist/temporal/places/client.js +23 -11
- package/dist/temporal/places/client.js.map +1 -1
- package/docs/ARCHITECTURE.md +23 -2700
- package/docs/INTERFACE.md +23 -8
- package/docs/architecture/circuit.md +59 -12
- package/docs/architecture/entree.md +20 -7
- package/docs/architecture/greffon.md +6 -2
- package/docs/architecture/installation.md +30 -11
- package/docs/architecture/machine.md +50 -37
- package/docs/architecture/tests.md +52 -14
- package/docs/lexique.md +154 -0
- package/hooks/register.tsx +1 -1
- package/package.json +1 -1
- package/scripts/activites.mjs +85 -60
- package/scripts/aiguillage.mjs +15 -7
- package/scripts/attente-de-la-machine.mjs +4 -8
- package/scripts/avancement.mjs +12 -8
- package/scripts/bilan.mjs +10 -7
- package/scripts/branche-de-nuit.mjs +2 -2
- package/scripts/ci-de-main.mjs +18 -21
- package/scripts/circuit.mjs +86 -43
- package/scripts/circuits-du-serveur.mjs +5 -5
- package/scripts/composants-affectes.mjs +30 -12
- package/scripts/composition-des-langages.mjs +5 -3
- package/scripts/conformite.mjs +1 -1
- package/scripts/consommation-des-passes.mjs +8 -6
- package/scripts/copies-finies.mjs +3 -14
- package/scripts/depart-du-ticket.d.mts +8 -2
- package/scripts/depart-du-ticket.mjs +26 -8
- package/scripts/direct.mjs +158 -72
- package/scripts/droits.mjs +63 -185
- package/scripts/engendres.mjs +3 -14
- package/scripts/enveloppe/enveloppe.mjs +75 -30
- package/scripts/enveloppe/lancer.sh +59 -45
- package/scripts/enveloppe/paquets-du-plan.mjs +38 -11
- package/scripts/enveloppe/travail-de-la-copie.mjs +115 -3
- package/scripts/etapes.mjs +84 -22
- package/scripts/faits-du-circuit.mjs +8 -2
- package/scripts/grillhouse-maj.mjs +43 -18
- package/scripts/groupe-cles.d.mts +15 -0
- package/scripts/groupe-cles.mjs +77 -2
- package/scripts/init.mjs +9 -2
- package/scripts/integration/rejeu.mjs +8 -1
- package/scripts/jointure.d.ts +22 -3
- package/scripts/langages/c/index.mjs +5 -2
- package/scripts/langages/cargo/commandes.mjs +35 -15
- package/scripts/langages/cargo/composants.mjs +45 -3
- package/scripts/langages/cargo/index.mjs +6 -3
- package/scripts/langages/python/index.mjs +5 -2
- package/scripts/langages/typescript/chemins-des-tests.mjs +1 -1
- package/scripts/langages/typescript/index.mjs +4 -2
- package/scripts/langages/typescript/mise-a-jour.mjs +1 -1
- package/scripts/langages/typescript/rapports-aux-lignes.mjs +74 -0
- package/scripts/langages/typescript/turbo-des-paquets.mjs +99 -36
- package/scripts/langages/typescript/verdict.mjs +29 -3
- package/scripts/langages/typescript/verifier.mjs +1 -1
- package/scripts/langages/typescript/vitest-config/changements.mjs +8 -6
- package/scripts/langages/typescript/vitest-config/lances.mjs +15 -32
- package/scripts/langages.mjs +54 -4
- package/scripts/matieres-lues.mjs +1 -1
- package/scripts/mesure/base-de-passe.mjs +32 -90
- package/scripts/migrations/serveurs-de-l-index.mjs +79 -0
- package/scripts/migrations.mjs +21 -7
- package/scripts/paquets.d.ts +3 -0
- package/scripts/paquets.mjs +88 -1
- package/scripts/passe-de-la-machine.mjs +109 -36
- package/scripts/places-de-la-machine.mjs +81 -29
- package/scripts/plafond-de-la-machine.d.mts +2 -5
- package/scripts/plafond-de-la-machine.mjs +9 -9
- package/scripts/reprise.mjs +42 -13
- package/scripts/resultats.mjs +76 -54
- package/scripts/retirer-les-copies-finies.mjs +1 -1
- package/scripts/seances.mjs +426 -115
- package/scripts/services-du-noyau.mjs +9 -1
- package/scripts/session-start.sh +14 -1
- package/scripts/sortie.mjs +37 -6
- package/scripts/sous-commandes.mjs +0 -2
- package/scripts/superviseur.mjs +33 -13
- package/scripts/tableau.mjs +61 -16
- package/scripts/transitions.d.mts +25 -2
- package/scripts/transitions.mjs +137 -29
- package/scripts/verrous/ecriture-hors-enveloppe.mjs +31 -9
- package/skills/codebase-design/DESIGN-IT-TWICE.md +1 -1
- package/skills/developpeur/SKILL.md +38 -15
- package/skills/direct/SKILL.md +29 -9
- package/skills/domain-modeling/GLOSSARY-FORMAT.md +9 -9
- package/skills/domain-modeling/SKILL.md +14 -12
- package/skills/explorateur/SKILL.md +30 -6
- package/skills/pitmaster/SKILL.md +12 -16
- package/skills/pitmaster/references/consigne-agent.md +12 -11
- package/skills/relecteur/SKILL.md +12 -5
- package/skills/systematic-debugging/SKILL.md +281 -0
- package/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
- package/skills/systematic-debugging/condition-based-waiting.md +115 -0
- package/skills/systematic-debugging/defense-in-depth.md +122 -0
- package/skills/systematic-debugging/find-polluter.sh +72 -0
- package/skills/systematic-debugging/root-cause-tracing.md +169 -0
- package/skills/testwriter/SKILL.md +35 -29
- package/scripts/verrous/commande.mjs +0 -214
- package/scripts/verrous/verrou.mjs +0 -311
package/scripts/droits.mjs
CHANGED
|
@@ -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
|
-
//
|
|
6
|
-
//
|
|
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`,
|
|
20
|
-
// skill's files, references included,
|
|
21
|
-
//
|
|
22
|
-
//
|
|
23
|
-
//
|
|
24
|
-
//
|
|
25
|
-
//
|
|
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)
|
|
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);
|
|
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
|
|
125
|
-
//
|
|
126
|
-
|
|
127
|
-
|
|
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
|
|
137
|
-
//
|
|
138
|
-
//
|
|
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.
|
|
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:
|
|
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
|
|
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
|
-
|
|
171
|
-
|
|
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
|
|
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
|
-
|
|
188
|
-
|
|
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
|
|
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
|
-
|
|
206
|
-
|
|
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
|
-
|
|
221
|
-
|
|
222
|
-
|
|
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,
|
|
294
|
-
//
|
|
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',
|
|
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 (
|
|
233
|
+
if (!serveurs[n]) {
|
|
330
234
|
continue;
|
|
331
235
|
}
|
|
332
|
-
|
|
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(...
|
|
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
|
-
|
|
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
|
package/scripts/engendres.mjs
CHANGED
|
@@ -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
|
|