@roomi-fields/grillhouse 0.24.15 → 0.25.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +1 -1
- package/bin/grillhouse.mjs +40 -12
- package/cadre/templates/cargo/.config/nextest.toml +8 -0
- package/cadre/templates/cargo/deny.toml +41 -0
- package/cadre/templates/cargo/package.json +15 -0
- package/cadre/templates/cargo/rust-toolchain.toml +6 -0
- package/cadre/templates/projet/package.json +5 -1
- package/cadre/templates/turbo/paquets.json +1 -1
- package/cadre/templates/turbo/sans-paquets.json +1 -1
- package/charte.md +16 -0
- package/docs/ARCHITECTURE.md +160 -56
- package/docs/CADRE.md +47 -0
- package/docs/INTERFACE.md +176 -0
- package/package.json +66 -13
- package/scripts/arbitrages.mjs +23 -0
- package/scripts/avancement.mjs +15 -29
- package/scripts/circuit.mjs +89 -97
- package/scripts/commande-du-langage.mjs +56 -0
- package/scripts/composants-affectes.mjs +47 -170
- package/scripts/conformite.d.ts +27 -0
- package/scripts/conformite.mjs +226 -0
- package/scripts/demon.mjs +1 -1
- package/scripts/dernier-vert.mjs +11 -9
- package/scripts/droits.mjs +27 -21
- package/scripts/enveloppe/enveloppe.mjs +206 -64
- package/scripts/enveloppe/lancer.sh +20 -91
- package/scripts/enveloppe/paquets-du-plan.mjs +24 -2
- package/scripts/etapes.mjs +2 -2
- package/scripts/gardes-du-cadre.mjs +12 -18
- package/scripts/grillhouse-maj.mjs +246 -389
- package/scripts/init.mjs +2 -1
- package/scripts/integration/file.mjs +3 -3
- package/scripts/integration/integrer.mjs +13 -10
- package/scripts/integration/rejeu.mjs +36 -7
- package/scripts/jointure.d.ts +304 -0
- package/scripts/langages/cargo/binaires.json +4 -0
- package/scripts/langages/cargo/binaires.mjs +60 -0
- package/scripts/langages/cargo/clippy.mjs +103 -0
- package/scripts/langages/cargo/commandes.mjs +378 -0
- package/scripts/langages/cargo/composants.mjs +191 -0
- package/scripts/langages/cargo/elements-du-lot.mjs +139 -0
- package/scripts/langages/cargo/exemples.mjs +357 -0
- package/scripts/langages/cargo/frontieres.mjs +84 -0
- package/scripts/langages/cargo/index-interfaces.mjs +138 -0
- package/scripts/langages/cargo/index.mjs +115 -0
- package/scripts/langages/cargo/mise-a-jour.mjs +93 -0
- package/scripts/langages/cargo/nextest.toml +5 -0
- package/scripts/langages/cargo/touches.mjs +93 -0
- package/scripts/langages/cargo/verdict.mjs +85 -0
- package/scripts/langages/typescript/chemins-des-tests.mjs +68 -0
- package/scripts/{code-mort.mjs → langages/typescript/code-mort.mjs} +5 -5
- package/scripts/langages/typescript/composants.mjs +64 -0
- package/scripts/{consommateurs-arbitres.mjs → langages/typescript/consommateurs-arbitres.mjs} +6 -24
- package/scripts/{consommateurs.mjs → langages/typescript/consommateurs.mjs} +13 -71
- package/scripts/langages/typescript/construire.mjs +176 -0
- package/scripts/{elements-du-lot.mjs → langages/typescript/elements-du-lot.mjs} +2 -2
- package/scripts/langages/typescript/exemples.mjs +289 -0
- package/scripts/{frontieres.mjs → langages/typescript/frontieres.mjs} +3 -5
- package/scripts/{index-interfaces.mjs → langages/typescript/index-interfaces.mjs} +3 -3
- package/scripts/langages/typescript/index.mjs +335 -0
- package/scripts/{interfaces-contre-code.mjs → langages/typescript/interfaces-contre-code.mjs} +2 -2
- package/scripts/langages/typescript/lecteurs.mjs +179 -0
- package/scripts/{migrations → langages/typescript/migrations}/0.23.0-config-vitest.mjs +14 -29
- package/scripts/{migrations → langages/typescript/migrations}/0.24.4-noms-declares-inutilises.mjs +2 -2
- package/scripts/{migrations → langages/typescript/migrations}/0.24.6-lignes-mal-formees.mjs +2 -2
- package/scripts/{migrations → langages/typescript/migrations}/0.24.7-matiere-dans-les-tests.mjs +2 -2
- package/scripts/langages/typescript/migrations/0.25.0-chemins-des-tests.mjs +27 -0
- package/scripts/langages/typescript/migrations/0.25.0-tailles-des-tests.mjs +31 -0
- package/scripts/langages/typescript/mise-a-jour.mjs +320 -0
- package/scripts/{references-par-les-types.mjs → langages/typescript/references-par-les-types.mjs} +3 -3
- package/scripts/langages/typescript/regle-des-tests.mjs +39 -0
- package/scripts/{resumes.mjs → langages/typescript/resumes.mjs} +4 -4
- package/scripts/langages/typescript/script-des-tests.mjs +6 -0
- package/scripts/langages/typescript/tailles-des-tests.mjs +219 -0
- package/scripts/langages/typescript/tests-de-nuit.mjs +57 -0
- package/scripts/{tests.mjs → langages/typescript/tests.mjs} +41 -32
- package/scripts/{turbo-des-paquets.mjs → langages/typescript/turbo-des-paquets.mjs} +49 -23
- package/scripts/langages/typescript/verdict.mjs +105 -0
- package/scripts/{verifier.mjs → langages/typescript/verifier.mjs} +53 -34
- package/scripts/{vitest-config → langages/typescript/vitest-config}/avancement.reporter.mjs +10 -2
- package/scripts/{vitest-config → langages/typescript/vitest-config}/base.mjs +63 -9
- package/scripts/{vitest-config → langages/typescript/vitest-config}/changements.mjs +18 -11
- package/scripts/{vitest-config → langages/typescript/vitest-config}/cibles.mjs +7 -6
- package/scripts/langages/typescript/vitest-config/duree.reporter.d.ts +10 -0
- package/scripts/{vitest-config → langages/typescript/vitest-config}/duree.reporter.mjs +10 -3
- package/scripts/langages/typescript/vitest-config/lances.mjs +473 -0
- package/scripts/{vitest-config → langages/typescript/vitest-config}/mesure.setup.mjs +1 -1
- package/scripts/{vitest-config → langages/typescript/vitest-config}/resultats.mjs +5 -5
- package/scripts/{vitest-config → langages/typescript/vitest-config}/resultats.setup.mjs +4 -3
- package/scripts/{vitest.nuit.config.mjs → langages/typescript/vitest.nuit.config.mjs} +2 -2
- package/scripts/langages.mjs +85 -0
- package/scripts/{vitest-config → mesure}/avancement.mjs +4 -13
- package/scripts/{vitest-config → mesure}/base-de-passe.mjs +70 -33
- package/scripts/{vitest-config → mesure}/pression.mjs +5 -6
- package/scripts/migrations/0.23.2-copies-du-cadre.mjs +29 -6
- package/scripts/migrations/0.24.0-circuit-simplifie.mjs +13 -6
- package/scripts/migrations/0.25.0-script-des-tests.mjs +92 -0
- package/scripts/migrations.mjs +17 -13
- package/scripts/nuit.sh +59 -63
- package/scripts/paquets.d.ts +5 -0
- package/scripts/paquets.mjs +24 -2
- package/scripts/resultats.mjs +8 -82
- package/scripts/services-du-noyau.mjs +30 -0
- package/scripts/session-start.sh +17 -9
- package/scripts/sources.mjs +35 -13
- package/scripts/sous-commandes.mjs +57 -17
- package/scripts/superviseur.mjs +1 -1
- package/scripts/tableau.mjs +1 -1
- package/scripts/un-commit-par-ticket.mjs +48 -14
- package/scripts/verrou-de-fichier.mjs +1 -1
- package/scripts/verrou-de-machine.mjs +4 -4
- package/scripts/verrous/verrou.mjs +28 -37
- package/skills/developpeur/SKILL.md +2 -2
- package/skills/explorateur/SKILL.md +13 -5
- package/skills/grill/SKILL.md +2 -2
- package/skills/pitmaster/references/cadre.md +1 -1
- package/skills/pitmaster/references/consigne-agent.md +10 -3
- package/skills/redacteur/references/documents-d-un-composant.md +4 -4
- package/skills/relecteur/SKILL.md +4 -1
- package/skills/testwriter/SKILL.md +20 -6
- /package/scripts/{consommateurs.d.ts → langages/typescript/consommateurs.d.ts} +0 -0
- /package/scripts/{vitest-config → langages/typescript/vitest-config}/base.d.ts +0 -0
- /package/scripts/{vitest-config → langages/typescript/vitest-config}/machine.setup.mjs +0 -0
- /package/scripts/{vitest-config → langages/typescript/vitest-config}/mesure.d.ts +0 -0
- /package/scripts/{vitest-config → langages/typescript/vitest-config}/mesure.mjs +0 -0
|
@@ -3,44 +3,43 @@
|
|
|
3
3
|
// command and the scripts import, so that no script imports the command, which is being evaluated
|
|
4
4
|
// when it runs one.
|
|
5
5
|
//
|
|
6
|
-
// - A subcommand is named after its script, without directory nor extension
|
|
7
|
-
// `circuit`, `tableau`); `maj` runs `grillhouse-maj.mjs`, whose name already says the frame's;
|
|
6
|
+
// - A subcommand of the core is named after its script, without directory nor extension
|
|
7
|
+
// (`circuit`, `tableau`); `maj` runs `grillhouse-maj.mjs`, whose name already says the frame's;
|
|
8
8
|
// `hooks` (`crochets.mjs`, which places the git hooks) and `hook` (`crochet.mjs`, which runs one)
|
|
9
9
|
// take Husky's names, which a project's `prepare` and its git hooks call.
|
|
10
|
+
// - `tests` and `verifier` run the commands the module of the project's language describes
|
|
11
|
+
// (`commandes`, scripts/jointure.d.ts: `tester` and `verifier`), the project being the working
|
|
12
|
+
// directory (scripts/langages.mjs); each other command it describes but `typer` is a subcommand
|
|
13
|
+
// by its name (`frontieres`, `index-interfaces`), as a backend of Pants brings its goals.
|
|
10
14
|
import path from 'node:path';
|
|
11
15
|
import { fileURLToPath } from 'node:url';
|
|
16
|
+
import { langageDe } from './langages.mjs';
|
|
12
17
|
|
|
13
18
|
const SCRIPTS = path.dirname(fileURLToPath(import.meta.url));
|
|
14
19
|
|
|
15
|
-
// Each subcommand and its script, under `scripts
|
|
20
|
+
// Each subcommand and its script, under `scripts/`, or the command of the module of the language
|
|
21
|
+
// that runs it (`{ langage }`, its name in `commandes`).
|
|
16
22
|
export const SOUS_COMMANDES = {
|
|
17
23
|
bilan: 'bilan.mjs',
|
|
18
24
|
circuit: 'circuit.mjs',
|
|
19
|
-
'code-mort': 'code-mort.mjs',
|
|
20
25
|
commande: 'verrous/commande.mjs',
|
|
21
26
|
'composants-affectes': 'composants-affectes.mjs',
|
|
22
|
-
consommateurs: 'consommateurs.mjs',
|
|
23
|
-
'consommateurs-arbitres': 'consommateurs-arbitres.mjs',
|
|
24
27
|
droits: 'droits.mjs',
|
|
25
28
|
enveloppe: 'enveloppe/enveloppe.mjs',
|
|
26
29
|
file: 'integration/file.mjs',
|
|
27
|
-
frontieres: 'frontieres.mjs',
|
|
28
30
|
'gardes-du-cadre': 'gardes-du-cadre.mjs',
|
|
29
31
|
greffons: 'greffons.mjs',
|
|
30
32
|
hook: 'crochet.mjs',
|
|
31
33
|
hooks: 'crochets.mjs',
|
|
32
|
-
'index-interfaces': 'index-interfaces.mjs',
|
|
33
34
|
init: 'init.mjs',
|
|
34
35
|
integrer: 'integration/integrer.mjs',
|
|
35
|
-
'interfaces-contre-code': 'interfaces-contre-code.mjs',
|
|
36
36
|
lancer: 'enveloppe/lancer.sh',
|
|
37
37
|
'ligne-etat': 'ligne-etat/ligne-etat.mjs',
|
|
38
38
|
maj: 'grillhouse-maj.mjs',
|
|
39
39
|
nuit: 'nuit.sh',
|
|
40
|
-
pression: '
|
|
40
|
+
pression: 'mesure/pression.mjs',
|
|
41
41
|
registre: 'registre.mjs',
|
|
42
42
|
resultats: 'resultats.mjs',
|
|
43
|
-
resumes: 'resumes.mjs',
|
|
44
43
|
'retirer-copie': 'retirer-copie.sh',
|
|
45
44
|
'session-start': 'session-start.sh',
|
|
46
45
|
sortie: 'sortie.mjs',
|
|
@@ -48,15 +47,56 @@ export const SOUS_COMMANDES = {
|
|
|
48
47
|
'structure-guard': 'structure-guard.sh',
|
|
49
48
|
superviseur: 'superviseur.mjs',
|
|
50
49
|
tableau: 'tableau.mjs',
|
|
51
|
-
tests: '
|
|
50
|
+
tests: { langage: 'tester' },
|
|
52
51
|
ticket: 'ticket.sh',
|
|
53
52
|
'ticket-du-sous-agent': 'verrous/ticket-du-sous-agent.mjs',
|
|
54
|
-
|
|
55
|
-
verifier: 'verifier.mjs',
|
|
53
|
+
verifier: { langage: 'verifier' },
|
|
56
54
|
verrou: 'verrous/verrou.mjs',
|
|
57
55
|
};
|
|
58
56
|
|
|
59
|
-
// The
|
|
60
|
-
|
|
61
|
-
|
|
57
|
+
// The commands of the module of the language that serve the project at <racine> and are no
|
|
58
|
+
// subcommand by their name: the ones `tests` and `verifier` run, and the typing.
|
|
59
|
+
const DU_NOYAU = new Set(['tester', 'verifier', 'typer']);
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* The subcommands in the project at <racine>, sorted: the core's (SOUS_COMMANDES), and the
|
|
63
|
+
* commands of the module of its language, each `{ langage }`, its name in `commandes`.
|
|
64
|
+
* @param {string} [racine] the root of the project, the working directory by default
|
|
65
|
+
* @returns {Record<string, string | { langage: string }>}
|
|
66
|
+
*/
|
|
67
|
+
export function sousCommandes(racine = process.cwd()) {
|
|
68
|
+
const du = Object.keys(langageDe(racine).commandes(racine)).filter(n => !DU_NOYAU.has(n));
|
|
69
|
+
return Object.fromEntries(
|
|
70
|
+
[...Object.entries(SOUS_COMMANDES), ...du.map(n => [n, { langage: n }])].sort(([a], [b]) =>
|
|
71
|
+
a.localeCompare(b, 'en')
|
|
72
|
+
)
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* The command of the subcommand <nom> in the project at <racine>, the script absolute; null for a
|
|
78
|
+
* name neither the core nor the module of its language has.
|
|
79
|
+
* @param {string} nom the subcommand
|
|
80
|
+
* @param {string} [racine] the root of the project, the working directory by default
|
|
81
|
+
* @returns {import('./jointure.js').Commande | null}
|
|
82
|
+
*/
|
|
83
|
+
export function commandeDe(nom, racine = process.cwd()) {
|
|
84
|
+
const s = Object.hasOwn(SOUS_COMMANDES, nom) ? SOUS_COMMANDES[nom] : null;
|
|
85
|
+
if (typeof s === 'string') return { script: path.join(SCRIPTS, s), args: [] };
|
|
86
|
+
const commandes = langageDe(racine).commandes(racine);
|
|
87
|
+
const n = s?.langage ?? (DU_NOYAU.has(nom) ? null : nom);
|
|
88
|
+
return n !== null && Object.hasOwn(commandes, n) ? commandes[n] : null;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// The script of each subcommand in the project at <racine>, where a former copy of the frame lay
|
|
92
|
+
// (`scripts/<script>`): what the migrations name, a former copy becoming its subcommand. A script
|
|
93
|
+
// of the core is named from `scripts/`, one of a module of language by its file's name, where the
|
|
94
|
+
// frame kept it before its module.
|
|
95
|
+
export function scriptsDesSousCommandes(racine) {
|
|
96
|
+
return Object.fromEntries(
|
|
97
|
+
Object.entries(sousCommandes(racine)).map(([n, s]) => [
|
|
98
|
+
n,
|
|
99
|
+
typeof s === 'string' ? s : path.basename(commandeDe(n, racine).script),
|
|
100
|
+
])
|
|
101
|
+
);
|
|
62
102
|
}
|
package/scripts/superviseur.mjs
CHANGED
|
@@ -23,7 +23,7 @@ import { readFileSync, statSync } from 'node:fs';
|
|
|
23
23
|
import path from 'node:path';
|
|
24
24
|
import { pathToFileURL } from 'node:url';
|
|
25
25
|
import { prendreVerrou } from './verrou-de-fichier.mjs';
|
|
26
|
-
import { vivant } from './
|
|
26
|
+
import { vivant } from './mesure/base-de-passe.mjs';
|
|
27
27
|
|
|
28
28
|
const VERROU_SUPERVISEUR = 'grillhouse-superviseur.lock';
|
|
29
29
|
const COQUILLES = new Set(['sh', 'bash', 'dash', 'zsh']);
|
package/scripts/tableau.mjs
CHANGED
|
@@ -100,7 +100,7 @@ import {
|
|
|
100
100
|
import { bilansGardes, enBref } from './bilan.mjs';
|
|
101
101
|
import { verdictDe } from './integration/verdict.mjs';
|
|
102
102
|
import { lireAvancement, lireLaMesure } from './avancement.mjs';
|
|
103
|
-
import { leMemeVivant } from './
|
|
103
|
+
import { leMemeVivant } from './mesure/base-de-passe.mjs';
|
|
104
104
|
|
|
105
105
|
const MINUTE = 60_000;
|
|
106
106
|
export const SILENCE = 10 * MINUTE;
|
|
@@ -12,8 +12,13 @@
|
|
|
12
12
|
// reference, a `Refs:` trailer) is not delivered.
|
|
13
13
|
// The title line of a message is its first line that is neither blank nor a comment (a line
|
|
14
14
|
// starting with `#`); in the history it is the first line of the commit message.
|
|
15
|
-
// - The tickets are the words `<prefix>-<id>` of the title line, the prefix read
|
|
16
|
-
// (`bd config get issue_prefix`)
|
|
15
|
+
// - The tickets are the words `<prefix>-<id>` of the title line that Beads knows, the prefix read
|
|
16
|
+
// from Beads (`bd config get issue_prefix`): as Jira's smart commits and GitHub's « fixes #12 »
|
|
17
|
+
// link a commit to an existing key alone, a word of that shape Beads does not know (a package
|
|
18
|
+
// `grillhouse-essais` in the frame's repository) is text. Beads knows an id when
|
|
19
|
+
// `bd show <id> --json` lists a ticket of that exact id, and does not when it answers a JSON
|
|
20
|
+
// error. When Beads does not answer, every word of the shape counts, and the hook says so in one
|
|
21
|
+
// line.
|
|
17
22
|
// - A message that names no ticket passes (the supervisor's commits of the frame).
|
|
18
23
|
// - A reverting commit delivers nothing and passes: it carries both marks git writes, a title line
|
|
19
24
|
// starting `Revert "` or `Reapply "` and a body line `This reverts commit <sha>` (the sha is the one
|
|
@@ -60,15 +65,16 @@ function revertedBy(message) {
|
|
|
60
65
|
}
|
|
61
66
|
|
|
62
67
|
// The refusal for this message, or null. `commitsOf(id)` gives the earlier commits delivering the id;
|
|
63
|
-
// `isOpen(id)` says whether the ticket is open (absent: not open)
|
|
64
|
-
//
|
|
65
|
-
|
|
68
|
+
// `isOpen(id)` says whether the ticket is open (absent: not open); `isKnown(id)` says whether Beads
|
|
69
|
+
// knows the id (absent: every word counts). A reverting message delivers nothing and passes; a
|
|
70
|
+
// ticket that is open takes a correction commit and passes; a word Beads does not know is no ticket.
|
|
71
|
+
export function refusal(message, prefix, commitsOf, isOpen = () => false, isKnown = () => true) {
|
|
66
72
|
if (revertedBy(message) !== null) {
|
|
67
73
|
return null;
|
|
68
74
|
}
|
|
69
75
|
for (const id of tickets(message, prefix)) {
|
|
70
76
|
const earlier = commitsOf(id);
|
|
71
|
-
if (earlier.length > 0 && !isOpen(id)) {
|
|
77
|
+
if (earlier.length > 0 && isKnown(id) && !isOpen(id)) {
|
|
72
78
|
return `Le ticket ${id} a déjà son commit (${earlier.join(', ')}) : un ticket fait une seule livraison. Ce qui reste devient un ticket neuf sous ${id} (bd create --parent ${id}).`;
|
|
73
79
|
}
|
|
74
80
|
}
|
|
@@ -87,20 +93,32 @@ function prefixe() {
|
|
|
87
93
|
}
|
|
88
94
|
}
|
|
89
95
|
|
|
90
|
-
//
|
|
91
|
-
//
|
|
92
|
-
|
|
96
|
+
// What Beads answers on the id (`bd show <id> --json`): `{ status }` when it knows the id (a ticket
|
|
97
|
+
// of that exact id in its array; `status` undefined when unreadable), `'unknown'` when it answers
|
|
98
|
+
// a JSON error (no such ticket), `null` when it does not answer (no `bd`, no database, an answer
|
|
99
|
+
// that is not JSON).
|
|
100
|
+
function beads(id) {
|
|
101
|
+
let out;
|
|
93
102
|
try {
|
|
94
|
-
|
|
103
|
+
out = execFileSync('bd', ['show', id, '--json'], {
|
|
95
104
|
encoding: 'utf8',
|
|
96
105
|
stdio: 'pipe',
|
|
97
106
|
maxBuffer: 256 * 1024 * 1024,
|
|
98
107
|
});
|
|
99
|
-
|
|
100
|
-
|
|
108
|
+
} catch (e) {
|
|
109
|
+
out = typeof e?.stdout === 'string' ? e.stdout : '';
|
|
110
|
+
}
|
|
111
|
+
let answer;
|
|
112
|
+
try {
|
|
113
|
+
answer = JSON.parse(out);
|
|
101
114
|
} catch {
|
|
102
|
-
return
|
|
115
|
+
return null;
|
|
116
|
+
}
|
|
117
|
+
if (Array.isArray(answer)) {
|
|
118
|
+
const ticket = answer.find(t => t?.id === id);
|
|
119
|
+
return ticket ? { status: ticket.status } : 'unknown';
|
|
103
120
|
}
|
|
121
|
+
return answer && typeof answer === 'object' && 'error' in answer ? 'unknown' : null;
|
|
104
122
|
}
|
|
105
123
|
|
|
106
124
|
// `git log` with these arguments, its output as text.
|
|
@@ -195,6 +213,13 @@ function commitsDelivering(id, prefix) {
|
|
|
195
213
|
|
|
196
214
|
if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) {
|
|
197
215
|
const prefix = prefixe();
|
|
216
|
+
const answers = new Map();
|
|
217
|
+
const answer = id => {
|
|
218
|
+
if (!answers.has(id)) {
|
|
219
|
+
answers.set(id, beads(id));
|
|
220
|
+
}
|
|
221
|
+
return answers.get(id);
|
|
222
|
+
};
|
|
198
223
|
// Without a prefix, or with one that is not yet filled in, every commit passes.
|
|
199
224
|
const reason =
|
|
200
225
|
prefix && !prefix.includes(' ')
|
|
@@ -202,9 +227,18 @@ if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) {
|
|
|
202
227
|
readFileSync(process.argv[2], 'utf8'),
|
|
203
228
|
prefix,
|
|
204
229
|
id => commitsDelivering(id, prefix),
|
|
205
|
-
|
|
230
|
+
id => {
|
|
231
|
+
const status = answer(id)?.status;
|
|
232
|
+
return typeof status === 'string' && status !== 'closed';
|
|
233
|
+
},
|
|
234
|
+
id => answer(id) !== 'unknown'
|
|
206
235
|
)
|
|
207
236
|
: null;
|
|
237
|
+
if ([...answers.values()].includes(null)) {
|
|
238
|
+
process.stderr.write(
|
|
239
|
+
`Beads injoignable : chaque mot ${prefix}-… du titre compte pour un ticket, connu ou non.\n`
|
|
240
|
+
);
|
|
241
|
+
}
|
|
208
242
|
if (reason) {
|
|
209
243
|
process.stderr.write(`⛔ ${reason}\n`);
|
|
210
244
|
process.exitCode = 1;
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
statSync,
|
|
27
27
|
writeFileSync,
|
|
28
28
|
} from 'node:fs';
|
|
29
|
-
import { vivant } from './
|
|
29
|
+
import { vivant } from './mesure/base-de-passe.mjs';
|
|
30
30
|
|
|
31
31
|
/** Blocks the process for `ms` milliseconds. */
|
|
32
32
|
export const attendreUnPeu = ms => Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// The lock of the machine for the heavy measure: one heavy measure at a time on the machine,
|
|
2
2
|
// whatever repository it plays in, as GNU make's job server shares its slots between every make of
|
|
3
3
|
// one build, and as Bazel holds a test that declares it wants the whole machine. Taken by every
|
|
4
|
-
// `npm run verifier` (scripts/verifier.mjs: the integration's, the queue's, the night's, a
|
|
4
|
+
// `npm run verifier` (scripts/langages/typescript/verifier.mjs: the integration's, the queue's, the night's, a
|
|
5
5
|
// supervisor's) and by the heavy passes of the circuit of a ticket (scripts/circuit.mjs: the proof
|
|
6
6
|
// of the red and the checks), so that a measure gives the result of the code, not that of another
|
|
7
7
|
// measure beside it.
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
// - The lock is one file of the user's cache, shared by every repository of the machine:
|
|
10
10
|
// `${XDG_CACHE_HOME:-~/.cache}/grillhouse/mesure-lourde.lock`; GRILLHOUSE_VERROU_MACHINE names
|
|
11
11
|
// another file (the base configuration of the tests gives each test file its own,
|
|
12
|
-
// scripts/vitest-config/machine.setup.mjs). It is taken through scripts/verrou-de-fichier.mjs,
|
|
12
|
+
// scripts/langages/typescript/vitest-config/machine.setup.mjs). It is taken through scripts/verrou-de-fichier.mjs,
|
|
13
13
|
// judged by its owner's process: a lock whose process is gone is taken over.
|
|
14
14
|
// - A second measure waits for the end of the first, then plays once it holds the lock. It says
|
|
15
15
|
// that it waits and whom for (the process that holds the lock, its working directory, its
|
|
@@ -62,8 +62,8 @@ import path from 'node:path';
|
|
|
62
62
|
import { paquetsDeLEnveloppe } from './enveloppe/paquets-du-plan.mjs';
|
|
63
63
|
import { paquets } from './paquets.mjs';
|
|
64
64
|
import { attendreUnPeu, lacherVerrou, prendreVerrou } from './verrou-de-fichier.mjs';
|
|
65
|
-
import { vivant } from './
|
|
66
|
-
import { A_REPASSER } from './
|
|
65
|
+
import { vivant } from './mesure/base-de-passe.mjs';
|
|
66
|
+
import { A_REPASSER } from './mesure/pression.mjs';
|
|
67
67
|
|
|
68
68
|
const VARIABLE_VERROU = 'GRILLHOUSE_VERROU_MACHINE';
|
|
69
69
|
const VARIABLE_TENUE = 'GRILLHOUSE_MESURE_TENUE';
|
|
@@ -4,15 +4,20 @@
|
|
|
4
4
|
// file write the role does not own, with exit code 2 and its reason on stderr.
|
|
5
5
|
//
|
|
6
6
|
// - A path under the system temp directory (the session scratchpad) is always writable.
|
|
7
|
-
// - testwriter writes the files it owns
|
|
8
|
-
//
|
|
7
|
+
// - testwriter writes the files it owns, those the rule of a test file of the module of the
|
|
8
|
+
// project's language classes (`estUnTest`, scripts/jointure.d.ts, scripts/langages.mjs): its test
|
|
9
|
+
// files, the helpers of its folders of tests, and every file of a package of the shared test
|
|
10
|
+
// material.
|
|
9
11
|
// - The repository root is that of the git repository holding the written file, whatever the
|
|
10
12
|
// agent's working directory; a file outside any repository is read against the working directory.
|
|
13
|
+
// A project that declares no language (`grillhouse.langages`) is refused, exit code 2, the
|
|
14
|
+
// update named: the lock cannot judge its writes, and a hook that throws would let them pass.
|
|
11
15
|
// - developpeur writes none of the testwriter's files, and no other file until its ticket's
|
|
12
16
|
// description holds a "## Architecture" section. The ticket is the "TON TICKET : <id>" line of the agent's
|
|
13
17
|
// launch prompt, read from its transcript.
|
|
14
18
|
// - In an envelope (`GRILLHOUSE_ENVELOPPE`, the packages of the plan, scripts/enveloppe/
|
|
15
|
-
// paquets-du-plan.mjs), a write in the copy out of the packages the plan writes (`ecritsDuPlan`
|
|
19
|
+
// paquets-du-plan.mjs), a write in the copy out of the packages the plan writes (`ecritsDuPlan`
|
|
20
|
+
// on the components of the module of the language, `paquetsDuLangage`, as the envelope reads them)
|
|
16
21
|
// and out of the shared test material, whose rule is the one above, stops the session, as the
|
|
17
22
|
// visibility of Bazel refuses a target the rule does not open: the hook answers Claude Code's
|
|
18
23
|
// `continue: false`, the tool refused (`permissionDecision: deny`), its reason naming the file's
|
|
@@ -24,38 +29,17 @@ import { existsSync, readFileSync, writeFileSync } from 'node:fs';
|
|
|
24
29
|
import { tmpdir } from 'node:os';
|
|
25
30
|
import path from 'node:path';
|
|
26
31
|
import { pathToFileURL } from 'node:url';
|
|
27
|
-
import { matieres, NOM_DE_TEST } from '../consommateurs.mjs';
|
|
28
32
|
import {
|
|
29
33
|
ecritsDuPlan,
|
|
30
34
|
MARQUE_HORS_PLAN,
|
|
31
35
|
paquetQuiTient,
|
|
32
36
|
paquetsDeLEnveloppe,
|
|
37
|
+
paquetsDuLangage,
|
|
33
38
|
} from '../enveloppe/paquets-du-plan.mjs';
|
|
34
|
-
import {
|
|
39
|
+
import { langageDe } from '../langages.mjs';
|
|
35
40
|
|
|
36
41
|
const WRITE_TOOLS = new Set(['Write', 'Edit', 'MultiEdit', 'NotebookEdit']);
|
|
37
42
|
|
|
38
|
-
export function isTestFile(file) {
|
|
39
|
-
const parts = file.split(/[\\/]/);
|
|
40
|
-
const base = parts[parts.length - 1];
|
|
41
|
-
return (
|
|
42
|
-
parts.slice(0, -1).some(d => d === 'test' || d === 'tests' || d === '__tests__') ||
|
|
43
|
-
NOM_DE_TEST.test(base)
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
// True when <file>, absolute or relative to the repository root <racine>, is written by the
|
|
48
|
-
// testwriter: a test file, or a file of a package of the shared test material (a component of
|
|
49
|
-
// <racine> whose package exports `./test-fixtures`, `matieres` of `scripts/consommateurs.mjs`).
|
|
50
|
-
// The one rule of ownership, read by the locks of both roles and by the integration's lots.
|
|
51
|
-
export function isTesterFile(file, racine) {
|
|
52
|
-
const abs = path.resolve(racine, file);
|
|
53
|
-
if (isTestFile(path.relative(path.resolve(racine), abs))) {
|
|
54
|
-
return true;
|
|
55
|
-
}
|
|
56
|
-
return matieres(racine).some(m => isInside(abs, m.dir));
|
|
57
|
-
}
|
|
58
|
-
|
|
59
43
|
// True when <file> lies strictly under the directory <dir>.
|
|
60
44
|
function isInside(file, dir) {
|
|
61
45
|
const rel = path.relative(path.resolve(dir), file);
|
|
@@ -95,11 +79,11 @@ function horsDuPlan(input, { tmp = tmpdir(), env = process.env } = {}) {
|
|
|
95
79
|
if (isScratch(file, tmp)) return null;
|
|
96
80
|
const copie = racineDe(file);
|
|
97
81
|
if (!copie) return null;
|
|
98
|
-
const liste =
|
|
82
|
+
const liste = paquetsDuLangage(langageDe(copie), copie);
|
|
99
83
|
const ecrits = ecritsDuPlan(plan, liste);
|
|
100
84
|
const rel = path.relative(copie, file);
|
|
101
85
|
if (ecrits.includes('.') || ecrits.some(d => rel.startsWith(`${d}/`))) return null;
|
|
102
|
-
if (
|
|
86
|
+
if (langageDe(copie).estUnTest(file, copie)?.matiere) return null;
|
|
103
87
|
const tenant = paquetQuiTient(rel, liste);
|
|
104
88
|
const paquet = tenant === '.' ? 'la racine du dépôt' : tenant;
|
|
105
89
|
return {
|
|
@@ -166,7 +150,8 @@ export function refusal(role, input, { tmp = tmpdir(), describe = ticketDescript
|
|
|
166
150
|
return null;
|
|
167
151
|
}
|
|
168
152
|
const racine = racineDe(file) ?? cwd;
|
|
169
|
-
const
|
|
153
|
+
const classe = langageDe(racine).estUnTest(file, racine);
|
|
154
|
+
const testwriter = classe !== null;
|
|
170
155
|
|
|
171
156
|
if (role === 'testwriter') {
|
|
172
157
|
return testwriter
|
|
@@ -175,7 +160,7 @@ export function refusal(role, input, { tmp = tmpdir(), describe = ticketDescript
|
|
|
175
160
|
}
|
|
176
161
|
if (role === 'developpeur') {
|
|
177
162
|
if (testwriter) {
|
|
178
|
-
return
|
|
163
|
+
return classe.test
|
|
179
164
|
? `Les tests appartiennent au testwriter : ${raw} est un fichier de test. Un test faux se signale au superviseur.`
|
|
180
165
|
: `La matière de test partagée appartient au testwriter : ${raw} en fait partie. Un besoin de matière se signale au superviseur.`;
|
|
181
166
|
}
|
|
@@ -197,7 +182,16 @@ export function refusal(role, input, { tmp = tmpdir(), describe = ticketDescript
|
|
|
197
182
|
|
|
198
183
|
if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) {
|
|
199
184
|
const input = JSON.parse(readFileSync(0, 'utf8'));
|
|
200
|
-
|
|
185
|
+
// A project the lock cannot judge (no language declared, scripts/langages.mjs) is refused, as a
|
|
186
|
+
// hook that throws exits 1, which Claude Code lets pass.
|
|
187
|
+
let stop = null;
|
|
188
|
+
let reason = null;
|
|
189
|
+
try {
|
|
190
|
+
stop = horsDuPlan(input);
|
|
191
|
+
if (!stop) reason = refusal(process.argv[2], input);
|
|
192
|
+
} catch (e) {
|
|
193
|
+
reason = e.message;
|
|
194
|
+
}
|
|
201
195
|
if (stop) {
|
|
202
196
|
// The mark for the circuit; the stop below is the hook's answer, mark or not.
|
|
203
197
|
try {
|
|
@@ -216,11 +210,8 @@ if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) {
|
|
|
216
210
|
},
|
|
217
211
|
})}\n`
|
|
218
212
|
);
|
|
219
|
-
} else {
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
process.stderr.write(reason + '\n');
|
|
223
|
-
process.exitCode = 2;
|
|
224
|
-
}
|
|
213
|
+
} else if (reason) {
|
|
214
|
+
process.stderr.write(reason + '\n');
|
|
215
|
+
process.exitCode = 2;
|
|
225
216
|
}
|
|
226
217
|
}
|
|
@@ -128,8 +128,8 @@ son adresse) : le circuit la consigne fermée sous ton ticket, et tu continues.
|
|
|
128
128
|
passe complète que joue l'intégration. Un rouge te relance avec sa sortie quand il est dans un
|
|
129
129
|
paquet du plan ; hors du plan, il attend la passe finale, où il monte au superviseur. Tu es lancé
|
|
130
130
|
sur un rouge (de la preuve, un `rouge existant` compris, ou des contrôles), sur un constat du
|
|
131
|
-
relecteur ouvert pour toi, ou directement sur un plan qui ne porte aucun test (aucun paquet
|
|
132
|
-
un script `test:
|
|
131
|
+
relecteur ouvert pour toi, ou directement sur un plan qui ne porte aucun test (aucun paquet qui
|
|
132
|
+
joue des tests, un script `test:unit` en typescript), sans testwriter ni preuve : une séance qui ne change aucun fichier du
|
|
133
133
|
plan n'a rien à livrer, et ses contrôles rouges arrêtent le circuit (`sans-livraison`) ; ta
|
|
134
134
|
passation dit pourquoi. Lancé après un refus de l'intégration, ton rapport porte ce refus : c'est
|
|
135
135
|
le rouge à lever, que les contrôles de ta copie, verts, ne voient pas ; une séance qui ne change
|
|
@@ -102,9 +102,16 @@ fois, et seules celles qui comptent attendent le responsable.
|
|
|
102
102
|
(`git log --oneline --grep <ticket>`, `git show <commit>`). Je rejoue sa preuve sur main, par
|
|
103
103
|
l'index ou une lecture du code. Avant de conclure sur une erreur de types de l'export d'un
|
|
104
104
|
paquet, je construis ce paquet (`npm run build -- --filter=<paquet>...`) : un export lu
|
|
105
|
-
d'avant sa construction ment. Je ne lance aucune passe, ni la suite des tests ni
|
|
106
|
-
vérificateur, et je n'écris rien. _Fini quand_ chaque découverte a sa preuve rejouée, ou ce
|
|
107
|
-
manque pour la rejouer.
|
|
105
|
+
d'avant sa construction ment. Je ne lance aucun test ni aucune passe, ni la suite des tests ni
|
|
106
|
+
le vérificateur, et je n'écris rien. _Fini quand_ chaque découverte a sa preuve rejouée, ou ce
|
|
107
|
+
qui manque pour la rejouer.
|
|
108
|
+
|
|
109
|
+
Ma consigne liste les commandes que mes droits permettent ; je les lance une par appel, sans
|
|
110
|
+
`cd` ni enchaînement, ma séance tournant déjà dans l'arbre principal (hors de lui,
|
|
111
|
+
`git -C <depot> show <commit>`, `git -C <depot> log --oneline --grep <ticket>`). Une commande
|
|
112
|
+
refusée, je la relance sous sa forme simple. Ainsi une découverte n'attend jamais le
|
|
113
|
+
responsable sur un refus de forme (BP 320.39 : trois `non-confirmee` sur une boucle refusée).
|
|
114
|
+
|
|
108
115
|
2. **Le verdict.** Ma fiche du tri porte une ligne par découverte de ma consigne, ni plus ni moins
|
|
109
116
|
(`verdicts`), chacune avec son `texte` :
|
|
110
117
|
- `traitee` : le lot ou un ticket existant la couvre, que je nomme ;
|
|
@@ -115,8 +122,9 @@ fois, et seules celles qui comptent attendent le responsable.
|
|
|
115
122
|
trancher.
|
|
116
123
|
|
|
117
124
|
Un `traitee` ou un `a-porter` porte sa `piece` : « $ commande » rejouée sur main et sa sortie,
|
|
118
|
-
ou fichier:ligne depuis la racine, que le circuit cherche dans l'arbre principal
|
|
119
|
-
|
|
125
|
+
ou fichier:ligne depuis la racine, que le circuit cherche dans l'arbre principal ; une pièce
|
|
126
|
+
fichier:ligne lue sur main suffit, sans test ni passe. Sans pièce, mon verdict est
|
|
127
|
+
`non-confirmee`. Une fiche sans une ligne par découverte me revient une fois, avec
|
|
120
128
|
ce qui manque. _Fini quand_ chaque découverte a sa ligne.
|
|
121
129
|
|
|
122
130
|
Le circuit écrit chaque verdict au ticket de sa découverte et y pose son étiquette ; il rouvre un
|
package/skills/grill/SKILL.md
CHANGED
|
@@ -168,7 +168,7 @@ remplace jamais le grill. Les branches de l'arbre :
|
|
|
168
168
|
généré depuis son `package.json` (`npx grillhouse turbo-des-paquets --ecrire`, que la mise à
|
|
169
169
|
jour lance) et `grillhouse:gardes` refuse un fichier absent ou périmé : une dépendance s'écrit
|
|
170
170
|
au `package.json` seul. Chaque paquet testé porte son script
|
|
171
|
-
`test:
|
|
171
|
+
`test:unit` et sa configuration Vitest, qui étend la configuration de base du cadre, le
|
|
172
172
|
`@roomi-fields/grillhouse/vitest-config`, que le paquet du cadre exporte (par `mergeConfig`) : les
|
|
173
173
|
exclusions du jour (tests de nuit, bancs de budget) et l'environnement commun y sont, sans
|
|
174
174
|
copie. Le paquet l'importe par son nom (`import base from '@roomi-fields/grillhouse/vitest-config'`) et le
|
|
@@ -190,7 +190,7 @@ remplace jamais le grill. Les branches de l'arbre :
|
|
|
190
190
|
intégration joue `npm run verifier` en entier (les gardes, le typage de chaque paquet et les
|
|
191
191
|
tests), Turborepo relisant de son cache ce qui n'a pas bougé.
|
|
192
192
|
Restent des choix selon la taille du projet, que le responsable tranche :
|
|
193
|
-
- **le contrôle de l'interface contre le code** (`packages/grillhouse/scripts/interfaces-contre-code.mjs`) : une
|
|
193
|
+
- **le contrôle de l'interface contre le code** (`packages/grillhouse/scripts/langages/typescript/interfaces-contre-code.mjs`) : une
|
|
194
194
|
seule passe avant les tests (petit projet), ou un banc par composant qui appelle
|
|
195
195
|
`verifierComposant`, rejoué seulement quand son composant l'est (grand projet).
|
|
196
196
|
- **les sous-modules partagés** : un sous-module qu'aucun ticket n'écrit (un moteur de
|
|
@@ -76,7 +76,7 @@ Le flux est celui de la charte, et toutes ses compétences s'appliquent. Ce que
|
|
|
76
76
|
responsable, à l'adoption du cadre ; l'élagage suit chaque correction.
|
|
77
77
|
- **Une vérification change par le responsable** : une vérification ajoutée, retirée ou élargie
|
|
78
78
|
part avec son accord, écrit au ticket. Ainsi ce qui refuse un commit reste sa décision.
|
|
79
|
-
- **Le code mort se refuse** : `packages/grillhouse/scripts/code-mort.mjs` (knip, configuré dans `knip.json`) refuse un
|
|
79
|
+
- **Le code mort se refuse** : `packages/grillhouse/scripts/langages/typescript/code-mort.mjs` (knip, configuré dans `knip.json`) refuse un
|
|
80
80
|
fichier, un export ou une dépendance que rien de vivant n'utilise ; un nom légitime sort par son
|
|
81
81
|
nom, avec sa raison. Ainsi le dépôt garde seulement ce qui sert.
|
|
82
82
|
- **Un plafond ne remonte jamais** : quand une vérification tolère des défauts jusqu'à un plafond,
|
|
@@ -14,7 +14,8 @@ cinquième pour le questionneur, qui lit le plan du ticket une seule fois ; le s
|
|
|
14
14
|
l'explorateur, qui écrit le plan ; le septième pour la reprise de sa séance, qui répond une seule
|
|
15
15
|
fois aux questions du plan ; le huitième pour l'explorateur au tri des découvertes, à l'étape 5.3,
|
|
16
16
|
une fois le lot entré sur main, qui rend un verdict par découverte du ticket (`traitee`, `doublon`,
|
|
17
|
-
`sans-suite`, `a-porter` ou `non-confirmee`)
|
|
17
|
+
`sans-suite`, `a-porter` ou `non-confirmee`) et porte les commandes que ses droits permettent
|
|
18
|
+
(`{{commandes}}`, tirées des droits du rôle, `packages/grillhouse/scripts/droits.mjs`) et leur forme.
|
|
18
19
|
La consigne du questionneur porte la proposition et le cadre qui l'oriente, jamais une liste de
|
|
19
20
|
questions. Le circuit lit
|
|
20
21
|
la description et les notes du ticket au lancement de chaque séance ; `{{notes}}` porte la section
|
|
@@ -237,7 +238,13 @@ SES DÉCOUVERTES, une par ligne (id — sujet), chacune un ticket fermé sous lu
|
|
|
237
238
|
|
|
238
239
|
{{decouvertes}}
|
|
239
240
|
|
|
240
|
-
Pour chacune : tu la lis, puis le ticket parent et ce qu'il est devenu (son commit sur main, l'historique qui le nomme) ; tu rejoues sa preuve sur main,
|
|
241
|
+
Pour chacune : tu la lis, puis le ticket parent et ce qu'il est devenu (son commit sur main, l'historique qui le nomme) ; tu rejoues sa preuve sur main, par l'index ou la lecture du code ; avant de juger une erreur de types de l'export d'un paquet, tu construis ce paquet. Tu ne lances aucun test ni aucune passe, ni la suite des tests ni le vérificateur.
|
|
242
|
+
|
|
243
|
+
LES COMMANDES QUE TES DROITS PERMETTENT, chacune sous cette forme, `…` ce que tu y mets :
|
|
244
|
+
|
|
245
|
+
{{commandes}}
|
|
246
|
+
|
|
247
|
+
Leur forme : une commande par appel, sans `cd` ni enchaînement (`;`, `&&`, `|`, une boucle) ; ta séance tourne déjà dans l'arbre principal. Une commande refusée se relance sous sa forme simple, une par appel.
|
|
241
248
|
|
|
242
249
|
Ta fiche, que le circuit lit seule, finit ta séance : ses `verdicts`, une ligne par découverte ci-dessus, ni plus ni moins, chacune avec sa `decouverte` (son id), son `verdict` et son `texte` :
|
|
243
250
|
- `traitee` : le lot ou un ticket existant la couvre, nommé ;
|
|
@@ -245,7 +252,7 @@ Ta fiche, que le circuit lit seule, finit ta séance : ses `verdicts`, une ligne
|
|
|
245
252
|
- `sans-suite` : hypothétique, hors de l'usage actuel, avec sa raison ;
|
|
246
253
|
- `a-porter` : un défaut de l'usage actuel ;
|
|
247
254
|
- `non-confirmee` : tu n'as pas pu rejouer de preuve ; ton `texte` dit ce qui manque pour trancher.
|
|
248
|
-
Un `traitee` ou un `a-porter` porte sa `piece` : « $ <commande> » rejouée sur main et sa sortie, ou fichier:ligne depuis la racine. Sans
|
|
255
|
+
Un `traitee` ou un `a-porter` porte sa `piece` : « $ <commande> » rejouée sur main et sa sortie, ou fichier:ligne depuis la racine ; une pièce fichier:ligne lue sur main suffit, sans test ni passe. Sans pièce, ton verdict est `non-confirmee`. Une fiche sans une ligne par découverte te revient une fois, avec ce qui manque.
|
|
249
256
|
|
|
250
257
|
Tu n'écris rien : ni fichier, ni ticket. Le circuit écrit chaque verdict au ticket de sa découverte et y pose son étiquette ; il rouvre un `a-porter` et un `non-confirmee` sous l'étiquette `a-valider`, pour le responsable ; les autres restent fermées.
|
|
251
258
|
```
|
|
@@ -30,14 +30,14 @@ frontière a une seule définition, tenue par son garde.
|
|
|
30
30
|
qu'il rend. L'étiquette `@faute` est déclarée dans la configuration TSDoc du cadre (`tsdoc.json`).
|
|
31
31
|
Ainsi le contrat change avec le code qu'il décrit.
|
|
32
32
|
**La première phrase du résumé tient en 80 caractères**, style télégraphique admis ; le détail va
|
|
33
|
-
dans les phrases suivantes. Le garde `packages/grillhouse/scripts/resumes.mjs` la mesure comme l'index la reprend.
|
|
33
|
+
dans les phrases suivantes. Le garde `packages/grillhouse/scripts/langages/typescript/resumes.mjs` la mesure comme l'index la reprend.
|
|
34
34
|
Ainsi l'index des interfaces et la consigne d'un agent restent courts.
|
|
35
35
|
**`INTERFACE.md` a deux parts** : la part écrite à la main porte la vue d'ensemble, les fautes et
|
|
36
36
|
les consommateurs ; la part générée, entre `<!-- généré: début -->` et `<!-- généré: fin -->`,
|
|
37
37
|
donne une entrée par export (son nom en code, sa signature, son résumé, ses paramètres, son retour,
|
|
38
38
|
ses fautes, et le résumé de ses membres), tirée des commentaires TSDoc. `npm run api` la refait,
|
|
39
39
|
avec le rapport de l'API qu'API Extractor tire du code construit (`docs/INTERFACE.api.md`), et ne
|
|
40
|
-
touche jamais la part écrite à la main. Le contrôle `packages/grillhouse/scripts/interfaces-contre-code.mjs` refuse une
|
|
40
|
+
touche jamais la part écrite à la main. Le contrôle `packages/grillhouse/scripts/langages/typescript/interfaces-contre-code.mjs` refuse une
|
|
41
41
|
part générée périmée ou sans ses marques, un export auquel une rubrique manque, une étiquette
|
|
42
42
|
inconnue ou mal formée, un `@faute` hors du catalogue, et un code du catalogue qu'aucun `@faute` ne
|
|
43
43
|
nomme. Un paquet qui n'exporte que des sous-chemins, sans entrée `.` (la matière de test partagée,
|
|
@@ -52,7 +52,7 @@ composant produit.
|
|
|
52
52
|
utilise l'interface, avec les éléments qu'il importe (``- `parser` : jeton, position``, `*` pour
|
|
53
53
|
un import entier) ; chaque puce de la section, hors partie générée, a cette seule forme, chaque
|
|
54
54
|
nom un identifiant JavaScript ou `*`, jamais une phrase ; un paragraphe hors puce (« Aucun paquet
|
|
55
|
-
de la v2. ») n'est pas un consommateur. Le garde `packages/grillhouse/scripts/consommateurs.mjs` refuse un import qu'elle ne déclare pas,
|
|
55
|
+
de la v2. ») n'est pas un consommateur. Le garde `packages/grillhouse/scripts/langages/typescript/consommateurs.mjs` refuse un import qu'elle ne déclare pas,
|
|
56
56
|
un nom déclaré qu'aucun code du consommateur n'emploie, et une puce d'une autre forme, avec ou
|
|
57
57
|
sans « : » ; il lit les noms d'un `import('x')` littéral déstructuré comme ceux d'un import statique, et
|
|
58
58
|
ne lit pas un chargeur dont le paquet se calcule : le consommateur écrit `import('x')` en clair. Il
|
|
@@ -60,7 +60,7 @@ lit le code de production de chaque consommateur, et aussi ses tests pour le paq
|
|
|
60
60
|
de test partagée, que seuls des tests lisent. Une ligne nouvelle entre avec son arbitrage
|
|
61
61
|
tranché au ticket, qui nomme le consommateur, ou avec le plan du ticket (son titre, sa section
|
|
62
62
|
« Architecture », sa section « Noms publiés »), qui nomme mot pour mot le consommateur et chaque élément que le lot ajoute à la
|
|
63
|
-
ligne, et le garde `packages/grillhouse/scripts/consommateurs-arbitres.mjs` refuse une ligne
|
|
63
|
+
ligne, et le garde `packages/grillhouse/scripts/langages/typescript/consommateurs-arbitres.mjs` refuse une ligne
|
|
64
64
|
changée sans l'un ni l'autre ; il lit la section hors de la part générée, dont les puces ne sont
|
|
65
65
|
pas des consommateurs.
|
|
66
66
|
Ainsi chaque dépendance entre composants est écrite et décidée.
|
|
@@ -96,7 +96,10 @@ cet ordre.
|
|
|
96
96
|
traitement. Pour l'étape des affirmations, le fichier d'affirmations est celui que ta consigne
|
|
97
97
|
nomme (« LE FICHIER D'AFFIRMATIONS »), la description du ticket que le circuit y a écrite.
|
|
98
98
|
2. **Les trous de vérification** (`references/verification-gap.md`) : chaque comportement changé
|
|
99
|
-
qu'un test ne protège pas réellement.
|
|
99
|
+
qu'un test ne protège pas réellement. Un test du lot plus grand que son critère ne l'exige se
|
|
100
|
+
rend au testwriter : un test grand là où un petit suffit (il monte un projet d'essai pour une
|
|
101
|
+
fonction qu'un appel direct prouve), ou un test moyen là où un petit suffit (charte, « La
|
|
102
|
+
taille d'un test suit la pyramide »).
|
|
100
103
|
3. **Le cadre** : chaque règle de la spécification que le ticket cite est tenue ; le code traite la classe de problèmes, à l'adresse que nomme la section
|
|
101
104
|
« Architecture », et non le seul cas signalé. Un lot rend aussi sur une forme recopiée, un mot
|
|
102
105
|
que le domaine ne connaît pas, un chemin que le plan écarte, un document du responsable
|