@roomi-fields/grillhouse 0.47.1 → 0.49.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 +116 -0
- package/agents/direct.md +9 -0
- package/cadre/templates/projet/.github/workflows/ci.yml +24 -38
- package/cadre/templates/projet/.github/workflows/machine-vierge.yml +5 -0
- package/cadre/templates/projet/.github/workflows/nuit.yml +14 -2
- package/cadre/templates/projet/CLAUDE.md +31 -10
- package/cadre/templates/projet/docs/agents/issue-tracker.md +1 -1
- package/cadre/templates/turbo/paquets.json +3 -1
- package/cadre/templates/turbo/sans-paquets.json +3 -1
- package/charte.md +46 -13
- package/dist/temporal/circuit/appel.d.ts +4 -1
- package/dist/temporal/circuit/appel.js +15 -1
- package/dist/temporal/circuit/appel.js.map +1 -1
- package/dist/temporal/circuit/client.d.ts +7 -1
- package/dist/temporal/circuit/client.js +54 -1
- package/dist/temporal/circuit/client.js.map +1 -1
- package/dist/temporal/circuit/commande.js +35 -60
- package/dist/temporal/circuit/commande.js.map +1 -1
- package/dist/temporal/circuit/contrat.d.ts +2 -1
- package/dist/temporal/circuit/contrat.js +2 -1
- package/dist/temporal/circuit/contrat.js.map +1 -1
- package/dist/temporal/circuit/deroule.js +9 -2
- package/dist/temporal/circuit/deroule.js.map +1 -1
- package/dist/temporal/commande.js +2 -13
- package/dist/temporal/commande.js.map +1 -1
- package/dist/temporal/deroules.d.ts +1 -1
- package/dist/temporal/deroules.js +2 -2
- package/dist/temporal/deroules.js.map +1 -1
- package/dist/temporal/file/activites.d.ts +1 -4
- package/dist/temporal/file/activites.js +13 -14
- package/dist/temporal/file/activites.js.map +1 -1
- package/dist/temporal/file/contrat.d.ts +34 -91
- package/dist/temporal/file/contrat.js +33 -5
- package/dist/temporal/file/contrat.js.map +1 -1
- package/dist/temporal/file/deroule.d.ts +1 -9
- package/dist/temporal/file/deroule.js +57 -166
- package/dist/temporal/file/deroule.js.map +1 -1
- package/dist/temporal/installation.d.ts +26 -1
- package/dist/temporal/installation.js +111 -2
- package/dist/temporal/installation.js.map +1 -1
- package/dist/temporal/nuits/activites.d.ts +5 -10
- package/dist/temporal/nuits/activites.js +9 -57
- package/dist/temporal/nuits/activites.js.map +1 -1
- package/dist/temporal/nuits/choix.d.ts +15 -0
- package/dist/temporal/nuits/choix.js +20 -0
- package/dist/temporal/nuits/choix.js.map +1 -1
- package/dist/temporal/nuits/contrat.d.ts +11 -16
- package/dist/temporal/nuits/deroule.js +38 -67
- package/dist/temporal/nuits/deroule.js.map +1 -1
- package/dist/temporal/places/client.d.ts +9 -11
- package/dist/temporal/places/client.js +11 -19
- package/dist/temporal/places/client.js.map +1 -1
- package/dist/temporal/places/contrat.d.ts +25 -24
- package/dist/temporal/places/contrat.js +5 -7
- package/dist/temporal/places/contrat.js.map +1 -1
- package/dist/temporal/places/deroule.js +26 -36
- package/dist/temporal/places/deroule.js.map +1 -1
- package/dist/temporal/tickets/activites.js +4 -2
- package/dist/temporal/tickets/activites.js.map +1 -1
- package/dist/temporal/tickets/contrat.d.ts +2 -1
- package/docs/ARCHITECTURE.md +453 -133
- package/docs/CADRE.md +16 -13
- package/docs/INTERFACE.md +100 -25
- package/hooks/hooks.json +9 -0
- package/hooks/register.tsx +59 -5
- package/package.json +1 -1
- package/scripts/activites.mjs +319 -52
- package/scripts/aiguillage.mjs +5 -1
- package/scripts/attente-a-l-arret.mjs +2 -5
- package/scripts/attente-au-tour.mjs +2 -5
- package/scripts/bilan.mjs +125 -2
- package/scripts/branche-de-nuit.mjs +32 -44
- package/scripts/ci-de-main.mjs +215 -16
- package/scripts/circuit.mjs +275 -189
- package/scripts/circuits-cles.d.mts +3 -3
- package/scripts/circuits-cles.mjs +6 -5
- package/scripts/coeurs-dedies.mjs +4 -4
- package/scripts/commandes-composees.mjs +12 -5
- package/scripts/composition-des-langages.mjs +2 -0
- package/scripts/crochets.mjs +2 -2
- package/scripts/dette.d.ts +2 -1
- package/scripts/dette.mjs +49 -6
- package/scripts/direct.mjs +343 -0
- package/scripts/droits.mjs +19 -0
- package/scripts/effets.mjs +6 -5
- package/scripts/engendres.mjs +2 -1
- package/scripts/enveloppe/enveloppe.mjs +127 -18
- package/scripts/enveloppe/lancer.sh +14 -3
- package/scripts/enveloppe/paquets-du-plan.mjs +9 -0
- package/scripts/enveloppe/travail-de-la-copie.mjs +121 -21
- package/scripts/etapes.mjs +14 -4
- package/scripts/etat-du-depot.mjs +23 -0
- package/scripts/faits-du-circuit.mjs +24 -34
- package/scripts/fermeture-de-la-machine.d.mts +27 -0
- package/scripts/fermeture-de-la-machine.mjs +98 -0
- package/scripts/fichiers-nommes.mjs +27 -1
- package/scripts/file-des-tickets.d.mts +18 -1
- package/scripts/file-des-tickets.mjs +63 -15
- package/scripts/greffons.mjs +1 -1
- package/scripts/grillhouse-maj.mjs +13 -25
- package/scripts/groupe-cles.d.mts +6 -0
- package/scripts/groupe-cles.mjs +29 -1
- package/scripts/integration/file.mjs +162 -48
- package/scripts/integration/integrer.mjs +2 -0
- package/scripts/jointure.d.ts +22 -3
- package/scripts/journal-des-etats.d.mts +16 -0
- package/scripts/journal-des-etats.mjs +44 -2
- package/scripts/journal.mjs +3 -0
- package/scripts/langages/c/commandes.mjs +5 -5
- package/scripts/langages/c/composants.mjs +13 -5
- package/scripts/langages/c/index.mjs +2 -0
- package/scripts/langages/c/squelette.mjs +1 -1
- package/scripts/langages/cargo/commandes.mjs +5 -6
- package/scripts/langages/cargo/index.mjs +2 -0
- package/scripts/langages/python/commandes.mjs +5 -5
- package/scripts/langages/python/composants.mjs +10 -2
- package/scripts/langages/python/index.mjs +2 -0
- package/scripts/langages/typescript/composants.mjs +10 -3
- package/scripts/langages/typescript/construire.mjs +2 -0
- package/scripts/langages/typescript/exemples.mjs +33 -1
- package/scripts/langages/typescript/index.mjs +22 -0
- package/scripts/langages/typescript/migrations/0.49.0-tests-equipes.mjs +32 -0
- package/scripts/langages/typescript/module-absent.mjs +24 -0
- package/scripts/langages/typescript/tests-de-nuit.mjs +152 -32
- package/scripts/langages/typescript/tests-du-poste.mjs +65 -23
- package/scripts/langages/typescript/titres-de-tests.mjs +11 -7
- package/scripts/langages/typescript/turbo-des-paquets.mjs +40 -5
- package/scripts/langages/typescript/verifier.mjs +3 -5
- package/scripts/langages/typescript/verrou-des-dependances.mjs +161 -0
- package/scripts/langages/typescript/vitest-config/cibles.mjs +57 -6
- package/scripts/langages/typescript/vitest-config/lances.mjs +3 -1
- package/scripts/langages/typescript/vitest-config/machine.setup.mjs +11 -5
- package/scripts/langages/typescript/vitest.nuit.config.mjs +53 -5
- package/scripts/langages.mjs +25 -3
- package/scripts/machine.mjs +103 -0
- package/scripts/matieres-cles.mjs +17 -0
- package/scripts/matieres-lues.mjs +104 -0
- package/scripts/mesure/base-de-passe.mjs +2 -1
- package/scripts/migrations/0.48.0-ci-declenchee-par-la-file.mjs +32 -0
- package/scripts/migrations/0.48.0-poussee-retiree.mjs +31 -0
- package/scripts/migrations/0.49.0-reservation-de-trois-coeurs.mjs +30 -0
- package/scripts/migrations.mjs +6 -0
- package/scripts/nuit.sh +113 -46
- package/scripts/paquet.mjs +16 -5
- package/scripts/paquets.d.ts +4 -0
- package/scripts/paquets.mjs +57 -0
- package/scripts/passe-de-la-machine.mjs +13 -14
- package/scripts/places-de-la-machine.mjs +120 -44
- package/scripts/places-du-serveur.mjs +29 -8
- package/scripts/plafond-de-la-machine.d.mts +7 -13
- package/scripts/plafond-de-la-machine.mjs +19 -35
- package/scripts/poussee-retiree.mjs +18 -0
- package/scripts/prefixe-des-tickets.mjs +1 -1
- package/scripts/references-changees.mjs +159 -0
- package/scripts/registre.d.mts +2 -2
- package/scripts/regles-des-places.d.mts +20 -12
- package/scripts/regles-des-places.mjs +27 -30
- package/scripts/repli-de-la-nuit.mjs +112 -0
- package/scripts/reponses-du-circuit.d.mts +4 -2
- package/scripts/reponses-du-circuit.mjs +44 -9
- package/scripts/reprise.mjs +27 -8
- package/scripts/resultats.mjs +61 -9
- package/scripts/seances.mjs +258 -40
- package/scripts/services-du-noyau.mjs +3 -0
- package/scripts/sous-commandes.mjs +37 -7
- package/scripts/superviseur.mjs +241 -88
- package/scripts/tableau.mjs +327 -131
- package/scripts/taches-du-graphe.mjs +84 -4
- package/scripts/ticket.mjs +345 -0
- package/scripts/transitions.d.mts +52 -0
- package/scripts/transitions.mjs +194 -16
- package/scripts/un-commit-par-ticket.mjs +4 -3
- package/scripts/verdict-de-la-nuit.mjs +47 -20
- package/scripts/verrou-de-fichier.mjs +2 -2
- package/scripts/verrous/ecriture-hors-enveloppe.mjs +86 -0
- package/scripts/verrous/verrou.mjs +17 -1
- package/skills/developpeur/SKILL.md +1 -1
- package/skills/direct/SKILL.md +57 -0
- package/skills/explorateur/SKILL.md +10 -6
- package/skills/pitmaster/SKILL.md +37 -14
- package/skills/pitmaster/references/consigne-agent.md +7 -1
- package/skills/relecteur/SKILL.md +11 -1
- package/skills/testwriter/SKILL.md +10 -0
- package/scripts/poussee-cles.mjs +0 -46
- package/scripts/ticket.sh +0 -25
package/scripts/transitions.mjs
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// reads no file, launches no process and imports no module that does (a guard holds it:
|
|
6
6
|
// tests/unit/transitions.spec.ts).
|
|
7
7
|
//
|
|
8
|
-
// `transition({ etat, memoire, ticket, reprend, faits })`:
|
|
8
|
+
// `transition({ etat, memoire, ticket, reprend, faits, marqueurs })`:
|
|
9
9
|
//
|
|
10
10
|
// - `etat`, the run at its step: `{ etape, tentative, rapport, finale, relanceSurLeRefus }`;
|
|
11
11
|
// - `memoire`, what the circuit keeps between steps (`controlesRouges`, `renvoiAuTestwriter`,
|
|
@@ -13,7 +13,10 @@
|
|
|
13
13
|
// `toursDeLaPasseFinale`, `constats`);
|
|
14
14
|
// - `ticket`, `{ id, paquets, sorte, copie }`;
|
|
15
15
|
// - `reprend`, whether this step is the first of a `--reprendre`;
|
|
16
|
-
// - `faits`, the facts read for this step, by their name
|
|
16
|
+
// - `faits`, the facts read for this step, by their name;
|
|
17
|
+
// - `marqueurs`, the markers of the workflow of a ticket (`patched`), each true when the run
|
|
18
|
+
// carries it: `attributionAvantSansLivraison`, without which red checks after a developpeur who
|
|
19
|
+
// had nothing to deliver stop before any attribution, as a run recorded before it replays.
|
|
17
20
|
//
|
|
18
21
|
// It returns either the next fact to read, `{ besoin: { fait, ...parametres }, effets, memoire }` (a
|
|
19
22
|
// session, a pass, a reading of the copy), which the circuit reads and gives back in `faits` with
|
|
@@ -30,7 +33,7 @@
|
|
|
30
33
|
// the facts read so far, as Temporal replays a workflow on its history: the same facts give the
|
|
31
34
|
// same decision.
|
|
32
35
|
import { ARRETS, boucle, RESPONSABLE, SUITE } from './etapes.mjs';
|
|
33
|
-
import { attribuerLeRouge } from './reprise.mjs';
|
|
36
|
+
import { attribuerLeRouge, departDepuis } from './reprise.mjs';
|
|
34
37
|
|
|
35
38
|
// What the circuit keeps between steps, which the decisions read and change: the one list the
|
|
36
39
|
// opening reads back (scripts/faits-du-circuit.mjs `GARDEE`) and the memo of a circuit keeps
|
|
@@ -52,8 +55,16 @@ export const MEMOIRE = [
|
|
|
52
55
|
'conflitsRelances',
|
|
53
56
|
'fichiersDuConflit',
|
|
54
57
|
'retourDuConflit',
|
|
58
|
+
'testwriterDemande',
|
|
55
59
|
];
|
|
56
60
|
|
|
61
|
+
// The mark « the supervisor asked the testwriter » after a start: set by `--depuis testwriter`, kept
|
|
62
|
+
// by a `--reprendre` without `--depuis`, dropped by any other start (a new plan, no `--depuis`, a
|
|
63
|
+
// `--depuis` of another step). As an operator replays a named step whatever the automatic rule
|
|
64
|
+
// would have chosen.
|
|
65
|
+
export const testwriterDemande = ({ depuis, reprendre, marque }) =>
|
|
66
|
+
depuis === 'testwriter' || Boolean(!depuis && reprendre && marque);
|
|
67
|
+
|
|
57
68
|
// The steps of the circuit's state, read from the list of the steps.
|
|
58
69
|
const etatDe = n => SUITE.find(e => e.numero === n).etat;
|
|
59
70
|
export const [
|
|
@@ -91,7 +102,7 @@ export const rapportDuRefus = refus =>
|
|
|
91
102
|
`L’intégration refuse ce lot : son refus, ci-dessous, est le rouge à lever ; les contrôles de ta copie, verts, ne le voient pas, et le lot ne repasse à l’intégration qu’avec un changement.\n\n${refus.rapport}`;
|
|
92
103
|
|
|
93
104
|
// The stop of a ticket the queue reopens on its issue `{ raison, conflit }`, as it gives the circuit
|
|
94
|
-
// (`direLIssue
|
|
105
|
+
// (`direLIssue` of scripts/integration/file.mjs): `motif`, whose first line, the
|
|
95
106
|
// fact of the question gone up, says why (the first line of the reason that is not a title), the
|
|
96
107
|
// whole reason after it; `question`, for a branch that does not replay on main (its conflict), the
|
|
97
108
|
// answer that serves, null for any other reason.
|
|
@@ -111,10 +122,11 @@ export function refusDeLaFile({ raison, conflit = false } = {}) {
|
|
|
111
122
|
// developpeur of a plan without tests (<sansTests>) or of a plan whose `comportement` is inchangé
|
|
112
123
|
// (a gesture written by hand: no test can turn red, the existing suite proves it); else the
|
|
113
124
|
// testwriter, for changé and tests-adaptés alike.
|
|
114
|
-
|
|
125
|
+
// The supervisor's `--depuis testwriter` (<demande>) wins over `inchangé`: the testwriter plays.
|
|
126
|
+
export const etapeApresLePlan = ({ sorte, sansTests, demande = false }) =>
|
|
115
127
|
sorte?.genre === 'mécanique'
|
|
116
128
|
? GESTE
|
|
117
|
-
: sansTests || sorte?.comportement === 'inchangé'
|
|
129
|
+
: sansTests || (sorte?.comportement === 'inchangé' && !demande)
|
|
118
130
|
? CODE
|
|
119
131
|
: TESTS;
|
|
120
132
|
|
|
@@ -367,6 +379,136 @@ export const etatDeReprise = etat =>
|
|
|
367
379
|
}
|
|
368
380
|
: etat;
|
|
369
381
|
|
|
382
|
+
// Where the run starts, from the command's options and the state of the stop: `{ suivant, memoire }`
|
|
383
|
+
// (the state the run starts at, the memory it changes), or `{ usage }`, a refusal. After a stop
|
|
384
|
+
// « integration », on --depuis developpeur, the developpeur, the refusal (`refus`) as his report,
|
|
385
|
+
// the session so launched marked (`lance`), as a merge queue sends the lot back to its author with
|
|
386
|
+
// the log of its check; else the step a --depuis names (the testwriter's, which makes the lot
|
|
387
|
+
// again, the refusal dropped, or the developpeur's), the step of the state `etat` (null without
|
|
388
|
+
// one) on --reprendre, the integration or the queue played again on the same lot after their stop,
|
|
389
|
+
// as bors retries, else the testwriter, the run starting over.
|
|
390
|
+
export function depart({ depuis = null, reprendre = false, marque = false, etat, refus, ticket }) {
|
|
391
|
+
// The supervisor's command wins over the sort of the plan: the mark of his `--depuis testwriter`.
|
|
392
|
+
const memoire = {
|
|
393
|
+
testwriterDemande: testwriterDemande({ depuis, reprendre: Boolean(reprendre), marque }),
|
|
394
|
+
};
|
|
395
|
+
// A --depuis plays its step and the ones after it, no result read back: no fingerprint kept, no
|
|
396
|
+
// resumption at a red, no attribution counted.
|
|
397
|
+
if (depuis) {
|
|
398
|
+
Object.assign(memoire, { verts: {}, reprise: null, relancesTestwriter: null });
|
|
399
|
+
}
|
|
400
|
+
if (depuis === 'developpeur' && etat?.raison === 'integration' && refus) {
|
|
401
|
+
memoire.refus = { ...refus, lance: true, relance: false };
|
|
402
|
+
return {
|
|
403
|
+
suivant: { etape: CODE, tentative: 1, rapport: rapportDuRefus(memoire.refus), finale: false },
|
|
404
|
+
memoire,
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
if (depuis === 'testwriter') {
|
|
408
|
+
memoire.refus = null;
|
|
409
|
+
}
|
|
410
|
+
if (depuis) {
|
|
411
|
+
const { etape, tentative, rapport, finale } = departDepuis(depuis);
|
|
412
|
+
return { suivant: { etape, tentative, rapport, finale }, memoire };
|
|
413
|
+
}
|
|
414
|
+
if (!reprendre) {
|
|
415
|
+
// The run starts over: no lot verified, no finding of a review open, no refusal, no checks played.
|
|
416
|
+
Object.assign(memoire, {
|
|
417
|
+
verts: null,
|
|
418
|
+
reprise: null,
|
|
419
|
+
relancesTestwriter: null,
|
|
420
|
+
verifie: null,
|
|
421
|
+
toursDeLaPasseFinale: null,
|
|
422
|
+
constats: [],
|
|
423
|
+
refus: null,
|
|
424
|
+
controlesRouges: null,
|
|
425
|
+
});
|
|
426
|
+
return { suivant: { etape: TESTS, tentative: 1, rapport: null, finale: false }, memoire };
|
|
427
|
+
}
|
|
428
|
+
if (!etat) {
|
|
429
|
+
return { usage: `rien à reprendre : le circuit de ${ticket} n'a aucun état d'arrêt.` };
|
|
430
|
+
}
|
|
431
|
+
if (etat.etape === 'integre') {
|
|
432
|
+
return { usage: `rien à reprendre : le lot de ${ticket} est intégré.` };
|
|
433
|
+
}
|
|
434
|
+
return {
|
|
435
|
+
suivant: {
|
|
436
|
+
etape: etat.etape,
|
|
437
|
+
tentative: etat.etape === CONTROLES ? 0 : 1,
|
|
438
|
+
rapport: etat.rapport,
|
|
439
|
+
finale: etat.finale === true,
|
|
440
|
+
},
|
|
441
|
+
memoire,
|
|
442
|
+
};
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
// The sending to the testwriter in the developpeur's sheet <fiche> (its `renvoi`): what the
|
|
446
|
+
// testwriter receives, the sending, the developpeur's handover <passation> (null: « aucune »), then
|
|
447
|
+
// the red output of the last checks <controlesRouges> when checks ran since the testwriter's
|
|
448
|
+
// session; null without a sending. <fichiersRouges> lists, in one go, every test file the lot
|
|
449
|
+
// breaks, the plan's and the extended readers' (`fichiersDeTestRouges`).
|
|
450
|
+
export function renvoiDe({ fiche, passation, controlesRouges, fichiersRouges = [] }) {
|
|
451
|
+
if (!fiche.renvoi) {
|
|
452
|
+
return null;
|
|
453
|
+
}
|
|
454
|
+
const raison = fiche.raison ? ` : ${fiche.raison}` : '';
|
|
455
|
+
const fichiers = fichiersRouges.length
|
|
456
|
+
? `\n\nLes fichiers de test rouges, tous à lever en une séance : ${fichiersRouges.join(', ')}.`
|
|
457
|
+
: '';
|
|
458
|
+
const controles = controlesRouges
|
|
459
|
+
? `\n\nLa sortie rouge des derniers contrôles :\n\n${controlesRouges}`
|
|
460
|
+
: '';
|
|
461
|
+
return `Le développeur renvoie le rouge qui reste aux tests du lot${raison}.${fichiers}\n\nSa passation :\n\n${passation ?? 'aucune'}${controles}`;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
// The test files the red output <controlesRouges> of checks names (its lines `- test <fichier> › …`
|
|
465
|
+
// and `- test <fichier> — …`), each once, in order.
|
|
466
|
+
export function fichiersDeTestRouges(controlesRouges) {
|
|
467
|
+
const vus = new Set();
|
|
468
|
+
for (const ligne of String(controlesRouges ?? '').split('\n')) {
|
|
469
|
+
if (!ligne.startsWith('- test ')) {
|
|
470
|
+
continue;
|
|
471
|
+
}
|
|
472
|
+
const mot = ligne.slice('- test '.length).split(' ')[0];
|
|
473
|
+
const suite = ligne.slice('- test '.length + mot.length).trimStart();
|
|
474
|
+
if (mot && (suite.startsWith('›') || suite.startsWith('—'))) {
|
|
475
|
+
vus.add(mot);
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
return [...vus];
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
// The context `--etendre` gives the sessions of the run it resumes on the stop <question>: the
|
|
482
|
+
// supervisor's answer (the packages <etendus> the plan gains, the plan <plan> as it is now), then his own text <contexte>. The stop's fact
|
|
483
|
+
// and piece stay out of it: they say the plan as it was and tell a session to stop (a lock's
|
|
484
|
+
// message), and a session reads its context as the supervisor's word. Without a question, his
|
|
485
|
+
// text alone, or null.
|
|
486
|
+
export function contexteDeLExtension({ question, etendus, plan, contexte }) {
|
|
487
|
+
const reponse = question
|
|
488
|
+
? `Le superviseur a étendu le plan à ${etendus.join(', ')} ; le plan du ticket est maintenant : ${plan}.`
|
|
489
|
+
: null;
|
|
490
|
+
return [reponse, contexte].filter(Boolean).join('\n\n') || null;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
// Where the circuit resumes when the supervisor extends the plan: without a state <etat>, it starts
|
|
494
|
+
// on the plan extended (`suivant` null); else it resumes the step under way, as `--reprendre`
|
|
495
|
+
// does, the supervisor's answer to the stop as the context of its sessions; a stop
|
|
496
|
+
// « sans-livraison » whose developpeur's last sheet sends the red to the testwriter (<renvoi>)
|
|
497
|
+
// resumes at the step of the testwriter, as a retry plays the job that failed.
|
|
498
|
+
export function etendre({ etat, etendus, plan, contexte, renvoi }) {
|
|
499
|
+
if (!etat) {
|
|
500
|
+
return { suivant: null };
|
|
501
|
+
}
|
|
502
|
+
const suite = contexteDeLExtension({ question: etat.question, etendus, plan, contexte });
|
|
503
|
+
const auTestwriter =
|
|
504
|
+
etat.etape === CODE && etat.raison === 'sans-livraison' && renvoi?.role === 'testwriter';
|
|
505
|
+
return {
|
|
506
|
+
suivant: auTestwriter ? { ...etat, etape: TESTS } : etat,
|
|
507
|
+
contexte: suite,
|
|
508
|
+
reprend: true,
|
|
509
|
+
};
|
|
510
|
+
}
|
|
511
|
+
|
|
370
512
|
// The decision of the step of <entree> (see the header), or the next fact it needs.
|
|
371
513
|
export function transition(entree) {
|
|
372
514
|
const faits = entree.faits ?? {};
|
|
@@ -392,7 +534,7 @@ export function transition(entree) {
|
|
|
392
534
|
}
|
|
393
535
|
}
|
|
394
536
|
|
|
395
|
-
function decider({ etat, memoire = {}, ticket, reprend = false }, lire, partiel) {
|
|
537
|
+
function decider({ etat, memoire = {}, ticket, reprend = false, marqueurs = {} }, lire, partiel) {
|
|
396
538
|
let { etape, tentative, rapport, finale } = etat;
|
|
397
539
|
let relanceSurLeRefus = Boolean(etat.relanceSurLeRefus);
|
|
398
540
|
const maj = {};
|
|
@@ -463,8 +605,17 @@ function decider({ etat, memoire = {}, ticket, reprend = false }, lire, partiel)
|
|
|
463
605
|
sorte:
|
|
464
606
|
lire('mecanique') || ticket.sorte?.comportement === 'inchangé' ? ticket.sorte : null,
|
|
465
607
|
sansTests: lire('sansTests'),
|
|
608
|
+
demande: Boolean(m('testwriterDemande')),
|
|
466
609
|
})
|
|
467
610
|
: null;
|
|
611
|
+
const demandeDuSuperviseur =
|
|
612
|
+
Boolean(m('testwriterDemande')) && ticket.sorte?.comportement === 'inchangé';
|
|
613
|
+
if (etape === TESTS && route === TESTS && demandeDuSuperviseur) {
|
|
614
|
+
commenter(
|
|
615
|
+
'testwriter',
|
|
616
|
+
'plan « comportement inchangé » : le superviseur a demandé la séance du testwriter (`--depuis testwriter`), qui l’emporte sur la sorte du plan.'
|
|
617
|
+
);
|
|
618
|
+
}
|
|
468
619
|
if (route === GESTE) {
|
|
469
620
|
geste('mecanique');
|
|
470
621
|
etape = GESTE;
|
|
@@ -576,6 +727,13 @@ function decider({ etat, memoire = {}, ticket, reprend = false }, lire, partiel)
|
|
|
576
727
|
}
|
|
577
728
|
const p = lire('preuve', reprise ? { fichiers: reprise.fichiers } : {});
|
|
578
729
|
rapport = p.texte;
|
|
730
|
+
if (p.aRepasser) {
|
|
731
|
+
// A proof whose pass is at 75 proved nothing, neither a red nor a refusal: « à repasser »,
|
|
732
|
+
// as the checks, with no testwriter relaunched; a wait of the machine at its bound plays
|
|
733
|
+
// again without limit.
|
|
734
|
+
garderLeVert('preuve', null);
|
|
735
|
+
return arreter('a-repasser', p.texte, p.attente ? { attente: true } : {});
|
|
736
|
+
}
|
|
579
737
|
if (p.ok) {
|
|
580
738
|
// Resumed at a red, a proof restricted to the file the red names goes to the checks.
|
|
581
739
|
const auDeveloppeur = reprise
|
|
@@ -990,6 +1148,12 @@ function decider({ etat, memoire = {}, ticket, reprend = false }, lire, partiel)
|
|
|
990
1148
|
if (k.rouge && k.ecartesRouges?.length) {
|
|
991
1149
|
lire('etendreAuxEcartes', { composants: k.ecartesRouges, rouges: k.tous });
|
|
992
1150
|
}
|
|
1151
|
+
// The reds of a reader package out of the plan that all lie in test files: the plan extends to
|
|
1152
|
+
// those tests alone, without a stop, and the testwriter, who alone writes them, is relaunched
|
|
1153
|
+
// by the attribution below (the circuit writes the extension, with its piece, at the ticket).
|
|
1154
|
+
if (k.rouge && k.testsLecteurs?.length) {
|
|
1155
|
+
lire('etendreAuxTests', { composants: k.testsLecteurs, rouges: k.tous });
|
|
1156
|
+
}
|
|
993
1157
|
if (k.rouge && passeFinale && k.horsTitre.length) {
|
|
994
1158
|
return arret(
|
|
995
1159
|
'controles',
|
|
@@ -1015,14 +1179,24 @@ function decider({ etat, memoire = {}, ticket, reprend = false }, lire, partiel)
|
|
|
1015
1179
|
`Le ticket est mécanique (${ticket.sorte.raison}) : ni testwriter ni développeur ne lève ce rouge du lot de sa commande. Le superviseur fait corriger le lot (\`--depuis developpeur\`, le rouge en \`--contexte\`), corrige le geste dans la copie puis \`--reprendre\`, ou arrête le circuit (\`--arreter\`).`
|
|
1016
1180
|
);
|
|
1017
1181
|
}
|
|
1018
|
-
//
|
|
1019
|
-
|
|
1182
|
+
// A run recorded before the marker `attribution-avant-sans-livraison` of the workflow of a
|
|
1183
|
+
// ticket (src/temporal/circuit/deroule.ts) keeps the former order: the stop of a developpeur
|
|
1184
|
+
// who had nothing to deliver before any attribution, the fact « portes » not read, as its
|
|
1185
|
+
// history replays. This path leaves once those runs have ended (grillhouse-3uv.177).
|
|
1186
|
+
if (k.rouge && rien && !marqueurs.attributionAvantSansLivraison) {
|
|
1187
|
+
return arret('sans-livraison', rien, CODE);
|
|
1188
|
+
}
|
|
1189
|
+
// The red goes back to the step that carries it, by the files it names (scripts/reprise.mjs).
|
|
1190
|
+
const portes =
|
|
1191
|
+
k.rouge && suivante <= SEANCES_DEVELOPPEUR ? lire('portes', { lieux: k.lieux }) : null;
|
|
1192
|
+
const a = portes ? attribuerLeRouge({ lieux: k.lieux, portes }) : null;
|
|
1193
|
+
// A developpeur who had nothing to deliver stops the circuit on a red that is his: the stop
|
|
1194
|
+
// stands at his step, which a resumption plays again. A red that names a test file of the lot
|
|
1195
|
+
// is the testwriter's, who is relaunched: the developpeur had nothing to write for it.
|
|
1196
|
+
if (k.rouge && rien && a?.etape !== 'testwriter') {
|
|
1020
1197
|
return arret('sans-livraison', rien, CODE);
|
|
1021
1198
|
}
|
|
1022
|
-
if (
|
|
1023
|
-
// The red goes back to the step that carries it, by the files it names (scripts/reprise.mjs).
|
|
1024
|
-
const portes = lire('portes', { lieux: k.lieux });
|
|
1025
|
-
const a = attribuerLeRouge({ lieux: k.lieux, portes });
|
|
1199
|
+
if (a) {
|
|
1026
1200
|
if (!a.etape) {
|
|
1027
1201
|
return arret('controles', `Le rouge n'est attribué à aucune étape : ${a.motif}.`);
|
|
1028
1202
|
}
|
|
@@ -1069,7 +1243,6 @@ function decider({ etat, memoire = {}, ticket, reprend = false }, lire, partiel)
|
|
|
1069
1243
|
ecrireRapport('controles', `${k.resume}.`, resultat('vert'), `${k.resume}.${k.avertissements}`);
|
|
1070
1244
|
// Green checks: a sending of the developpeur to the testwriter may come again.
|
|
1071
1245
|
maj.renvoiAuTestwriter = null;
|
|
1072
|
-
maj.relancesTestwriter = 0;
|
|
1073
1246
|
const entierement = !reprise && !regeneration;
|
|
1074
1247
|
if (!passeFinale) {
|
|
1075
1248
|
if (entierement && k.empreinte) {
|
|
@@ -1081,8 +1254,13 @@ function decider({ etat, memoire = {}, ticket, reprend = false }, lire, partiel)
|
|
|
1081
1254
|
finale = true;
|
|
1082
1255
|
return decision();
|
|
1083
1256
|
}
|
|
1084
|
-
// The whole pass green on this lot
|
|
1085
|
-
//
|
|
1257
|
+
// The whole pass green on this lot: the relaunches of the testwriter count again from none.
|
|
1258
|
+
// Green checks of the plan keep the count. The test file of a reader package extended to its
|
|
1259
|
+
// tests is red at the final pass and at the checks restricted to that file, each of which
|
|
1260
|
+
// sends the testwriter back; the checks of the whole plan, which play its packages and not
|
|
1261
|
+
// the reader, are green in between, and would else start the count again without end.
|
|
1262
|
+
maj.relancesTestwriter = 0;
|
|
1263
|
+
// The lot the last review accepted goes to the integration, any other to the review.
|
|
1086
1264
|
// A final pass green on the band of the lot (after a regeneration, on what it changed, or not
|
|
1087
1265
|
// played when it changed nothing) verifies its tree: the lot accepted on it goes to the
|
|
1088
1266
|
// integration.
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// A closed ticket keeps its one delivery: refuses a commit message whose title line names a ticket
|
|
3
3
|
// an earlier commit already delivers, unless that ticket is open in Beads. An open ticket that
|
|
4
|
-
// already has its delivery is a ticket reopened for a fix
|
|
5
|
-
//
|
|
6
|
-
//
|
|
4
|
+
// already has its delivery is a ticket reopened for a fix led by hand: the commit is a correction
|
|
5
|
+
// and passes. The queue of the tickets never starts such a ticket again (its lot is on main,
|
|
6
|
+
// scripts/file-des-tickets.mjs). A closed ticket is finished: new work opens a new ticket, created
|
|
7
|
+
// under it (`--parent`). Run by the commit-msg hook (`grillhouse hook commit-msg`, scripts/crochets.mjs), with
|
|
7
8
|
// the message file as argument.
|
|
8
9
|
//
|
|
9
10
|
// - A ticket is open when its Beads status (`bd show <id> --json`) is anything but `closed`; a
|
|
@@ -1,47 +1,74 @@
|
|
|
1
|
-
// The durable verdict of a project's night: the night
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
1
|
+
// The durable verdict of a project's night, in two parts: the night plays on two machines, the part
|
|
2
|
+
// of PC2 (the tranches of the Nuit flow, which PC3 reads by `gh`) and the part of PC3 (the tests of
|
|
3
|
+
// the poste, scripts/nuit.sh). Each part is noted at its end in `<git common dir>/nuit/verdict` (PC3)
|
|
4
|
+
// and `<git common dir>/nuit/verdict-pc2` (PC2), and the board reads them without a server. A part is
|
|
5
|
+
// `vert` when it exits 0, `rouge` for any other code but 75 (a missing code included); 75 (« à
|
|
6
|
+
// repasser ») writes nothing and leaves the previous verdict of that part, the other untouched. The
|
|
7
|
+
// night is `rouge` when a part is, else `vert` when a part is, else none. A read that fails gives
|
|
8
|
+
// no verdict for that part.
|
|
5
9
|
import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
6
10
|
import path from 'node:path';
|
|
7
11
|
import { fileURLToPath } from 'node:url';
|
|
8
12
|
|
|
9
13
|
const CODE_A_REPASSER = 75;
|
|
10
|
-
const
|
|
14
|
+
const FICHIERS = { pc2: 'verdict-pc2', pc3: 'verdict' };
|
|
15
|
+
const fichierDuVerdict = (commun, part) => path.join(commun, 'nuit', FICHIERS[part]);
|
|
11
16
|
|
|
12
17
|
/**
|
|
13
18
|
* @param {string} commun the git common dir of the project
|
|
14
|
-
* @param {number} code the exit code of the
|
|
15
|
-
* @
|
|
19
|
+
* @param {number} code the exit code of the part's pass
|
|
20
|
+
* @param {'pc2' | 'pc3'} [part] the part noted: that of the machine that plays, PC3 by default
|
|
21
|
+
* @returns {'vert' | 'rouge' | null} the verdict written, null when the part is to be replayed
|
|
16
22
|
*/
|
|
17
|
-
export function noterLeVerdict(commun, code) {
|
|
23
|
+
export function noterLeVerdict(commun, code, part = 'pc3') {
|
|
18
24
|
if (code === CODE_A_REPASSER) {
|
|
19
25
|
return null;
|
|
20
26
|
}
|
|
21
27
|
const verdict = code === 0 ? 'vert' : 'rouge';
|
|
22
28
|
mkdirSync(path.join(commun, 'nuit'), { recursive: true });
|
|
23
|
-
writeFileSync(fichierDuVerdict(commun), `${verdict}\n`);
|
|
29
|
+
writeFileSync(fichierDuVerdict(commun, part), `${verdict}\n`);
|
|
24
30
|
return verdict;
|
|
25
31
|
}
|
|
26
32
|
|
|
33
|
+
function lireLaPart(commun, part) {
|
|
34
|
+
try {
|
|
35
|
+
const v = readFileSync(fichierDuVerdict(commun, part), 'utf8').trim();
|
|
36
|
+
return v === 'vert' || v === 'rouge' ? v : null;
|
|
37
|
+
} catch {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
27
42
|
/**
|
|
28
43
|
* @param {string | null} commun the git common dir of the project
|
|
29
|
-
* @returns {'vert' | 'rouge' | null
|
|
44
|
+
* @returns {{ pc2: 'vert' | 'rouge' | null, pc3: 'vert' | 'rouge' | null }} each part's last verdict,
|
|
45
|
+
* null when it has none or it does not read
|
|
30
46
|
*/
|
|
31
|
-
export function
|
|
47
|
+
export function lireLesParts(commun) {
|
|
32
48
|
if (!commun) {
|
|
33
|
-
return null;
|
|
49
|
+
return { pc2: null, pc3: null };
|
|
34
50
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
51
|
+
return { pc2: lireLaPart(commun, 'pc2'), pc3: lireLaPart(commun, 'pc3') };
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* @param {string | null} commun the git common dir of the project
|
|
56
|
+
* @returns {'vert' | 'rouge' | null} the last night's verdict over its two parts, null when none is known
|
|
57
|
+
*/
|
|
58
|
+
export function lireLeVerdict(commun) {
|
|
59
|
+
const parts = Object.values(lireLesParts(commun));
|
|
60
|
+
if (parts.includes('rouge')) {
|
|
61
|
+
return 'rouge';
|
|
40
62
|
}
|
|
63
|
+
return parts.includes('vert') ? 'vert' : null;
|
|
41
64
|
}
|
|
42
65
|
|
|
43
|
-
// `node verdict-de-la-nuit.mjs <commun> <code
|
|
66
|
+
// `node verdict-de-la-nuit.mjs <commun> <code> [pc2|pc3]`: what nuit.sh calls at the end of the night.
|
|
44
67
|
if (process.argv[1] && fileURLToPath(import.meta.url) === path.resolve(process.argv[1])) {
|
|
45
|
-
const [commun, code] = process.argv.slice(2);
|
|
46
|
-
noterLeVerdict(
|
|
68
|
+
const [commun, code, part] = process.argv.slice(2);
|
|
69
|
+
noterLeVerdict(
|
|
70
|
+
commun,
|
|
71
|
+
code === undefined || code === '' ? NaN : Number(code),
|
|
72
|
+
part === 'pc2' ? 'pc2' : 'pc3'
|
|
73
|
+
);
|
|
47
74
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// The lock of a file shared between processes: the file `<verrou>` stands while someone holds it.
|
|
2
|
-
// Taken by the integration (`.git/integration.lock`)
|
|
3
|
-
// (
|
|
2
|
+
// Taken by the integration (`.git/integration.lock`), by the register (`registre.jsonl.verrou`)
|
|
3
|
+
// and by the creation of a ticket (`.beads/grillhouse-ticket.lock`, scripts/ticket.mjs).
|
|
4
4
|
//
|
|
5
5
|
// - A lock is created whole and exclusively: its mark (the owner's process number, then a token
|
|
6
6
|
// unique to the taking) is written to a private file that is linked to `<verrou>`; the link
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// The write lock of a session out of the envelope: a PreToolUse hook of the frame's plugin
|
|
3
|
+
// (hooks/hooks.json, `npx grillhouse verrou-hors-enveloppe`), which runs in every session of a
|
|
4
|
+
// project that installs the frame. It reads the hook's JSON on stdin and refuses, exit code 2 and
|
|
5
|
+
// its reason on stderr, the write of the code or the tests of a package by a session that is no
|
|
6
|
+
// agent of the frame under its envelope: the supervisor, the person who starts Claude Code by hand,
|
|
7
|
+
// a session that lost its variable of envelope (`GRILLHOUSE_ENVELOPPE`, refusal by default).
|
|
8
|
+
//
|
|
9
|
+
// - A write of a document (a `.md` file) passes: the documents of a package (CADRE.md,
|
|
10
|
+
// INTERFACE.md, ARCHITECTURE.md, CHANGELOG, the skills and the charter of `mods/grillhouse`) and
|
|
11
|
+
// those of the root (CLAUDE.md, docs/, the configuration) stay the supervisor's.
|
|
12
|
+
// - What a package holds is read as its lock reads it (`paquetQuiTient`, the components of the
|
|
13
|
+
// module of the language); `mods/grillhouse`, the frame's plugin, is one too. A file of the root
|
|
14
|
+
// of the repository passes.
|
|
15
|
+
// - A path under the temporary directory of the session passes, and so does any tool that writes
|
|
16
|
+
// nothing. A session under its envelope is judged by its role's lock (verrou.mjs).
|
|
17
|
+
// - The reason names `npx grillhouse direct <ticket>`: the agent of a direct writes the tests and
|
|
18
|
+
// the code in a copy of its own, a reviewer reads its lot, and the supervisor verifies and
|
|
19
|
+
// commits it.
|
|
20
|
+
import { readFileSync } from 'node:fs';
|
|
21
|
+
import { tmpdir } from 'node:os';
|
|
22
|
+
import path from 'node:path';
|
|
23
|
+
import { pathToFileURL } from 'node:url';
|
|
24
|
+
import { paquetQuiTient, paquetsDuLangage, paquetsDeLEnveloppe } from '../enveloppe/paquets-du-plan.mjs';
|
|
25
|
+
import { langageDeLaCopie } from '../langages.mjs';
|
|
26
|
+
import { racineDe } from './verrou.mjs';
|
|
27
|
+
|
|
28
|
+
const OUTILS_D_ECRITURE = new Set(['Write', 'Edit', 'MultiEdit', 'NotebookEdit']);
|
|
29
|
+
// The frame's own code, a package though no table of components lists it.
|
|
30
|
+
const CADRE = 'mods/grillhouse';
|
|
31
|
+
|
|
32
|
+
const sous = (rel, dossier) => rel === dossier || rel.startsWith(`${dossier}/`);
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* The refusal of the write <input> of a session out of the envelope, or null when it passes.
|
|
36
|
+
* @param {{ tool_name?: string, tool_input?: Record<string, string>, cwd?: string }} input
|
|
37
|
+
* @param {{ env?: Record<string, string | undefined>, tmp?: string }} [options]
|
|
38
|
+
* @returns {string | null}
|
|
39
|
+
*/
|
|
40
|
+
export function refusDeLEcritureHorsEnveloppe(
|
|
41
|
+
input,
|
|
42
|
+
{ env = process.env, tmp = tmpdir() } = {}
|
|
43
|
+
) {
|
|
44
|
+
if (!OUTILS_D_ECRITURE.has(input.tool_name ?? '') || paquetsDeLEnveloppe(env)) {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
const brut = input.tool_input?.file_path ?? input.tool_input?.notebook_path;
|
|
48
|
+
if (!brut) {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
const fichier = path.resolve(input.cwd ?? process.cwd(), brut);
|
|
52
|
+
const dansTmp = path.relative(path.resolve(tmp), fichier);
|
|
53
|
+
if (dansTmp !== '' && !dansTmp.startsWith('..') && !path.isAbsolute(dansTmp)) {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
if (fichier.endsWith('.md')) {
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
const copie = racineDe(fichier);
|
|
60
|
+
if (!copie) {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
const rel = path.relative(copie, fichier);
|
|
64
|
+
const tenant = sous(rel, CADRE)
|
|
65
|
+
? CADRE
|
|
66
|
+
: paquetQuiTient(rel, paquetsDuLangage(langageDeLaCopie(copie), copie));
|
|
67
|
+
if (tenant === '.') {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
return `⛔ ${rel} est du code ou un test du paquet ${tenant} : une séance hors enveloppe (le superviseur, une séance lancée à la main, une séance qui a perdu sa variable d'enveloppe) n'écrit ni le code ni les tests d'un paquet. Un ticket direct se mène par \`npx grillhouse direct <ticket>\` : un agent l'écrit dans une copie à lui, un relecteur le relit, puis le superviseur le vérifie et le commite. Les documents restent écrits ici.`;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) {
|
|
74
|
+
// A hook that throws exits 1, which Claude Code lets pass: an input or a project the lock cannot
|
|
75
|
+
// judge is refused (a firewall's rule), its reason said.
|
|
76
|
+
try {
|
|
77
|
+
const raison = refusDeLEcritureHorsEnveloppe(JSON.parse(readFileSync(0, 'utf8')));
|
|
78
|
+
if (raison) {
|
|
79
|
+
process.stderr.write(`${raison}\n`);
|
|
80
|
+
process.exitCode = 2;
|
|
81
|
+
}
|
|
82
|
+
} catch (e) {
|
|
83
|
+
process.stderr.write(`⛔ verrou hors enveloppe : ${e.message} (écriture refusée)\n`);
|
|
84
|
+
process.exitCode = 2;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
// description holds a "## Architecture" section (`sansArchitecture`, which the start of the
|
|
23
23
|
// circuit reads too). The ticket is the "TON TICKET : <id>" line of the agent's
|
|
24
24
|
// launch prompt, read from its transcript.
|
|
25
|
+
// - direct writes tests and code of its plan together (a ticket led by `npx grillhouse direct`).
|
|
25
26
|
// - In an envelope (`GRILLHOUSE_ENVELOPPE`, the packages of the plan, scripts/enveloppe/
|
|
26
27
|
// paquets-du-plan.mjs), a write in the copy out of the packages the plan writes (`ecritsDuPlan`
|
|
27
28
|
// on the components of the module of the language, `paquetsDuLangage`, as the envelope reads them)
|
|
@@ -44,6 +45,7 @@ import {
|
|
|
44
45
|
paquetQuiTient,
|
|
45
46
|
paquetsDeLEnveloppe,
|
|
46
47
|
paquetsDuLangage,
|
|
48
|
+
testsEtendusDeLEnveloppe,
|
|
47
49
|
} from '../enveloppe/paquets-du-plan.mjs';
|
|
48
50
|
import { langageDeLaCopie } from '../langages.mjs';
|
|
49
51
|
|
|
@@ -67,7 +69,7 @@ const isScratch = (file, tmp = tmpdir()) => isInside(file, tmp);
|
|
|
67
69
|
|
|
68
70
|
// The root of the git repository (or worktree) that holds the absolute path <file>, read from its
|
|
69
71
|
// nearest existing directory; null when no repository holds it.
|
|
70
|
-
function racineDe(file) {
|
|
72
|
+
export function racineDe(file) {
|
|
71
73
|
let dir = path.dirname(file);
|
|
72
74
|
while (!existsSync(dir)) {
|
|
73
75
|
const parent = path.dirname(dir);
|
|
@@ -122,6 +124,15 @@ export function horsDuPlan(input, { tmp = tmpdir(), env = process.env, role = nu
|
|
|
122
124
|
if (role === TESTWRITER && langage.manifestes.verrous.includes(rel)) {
|
|
123
125
|
return null;
|
|
124
126
|
}
|
|
127
|
+
// The test files of a reader package the circuit extended the plan to (`testsEtendus`, given to
|
|
128
|
+
// the testwriter's envelope alone): never its code nor its manifest.
|
|
129
|
+
if (
|
|
130
|
+
role === TESTWRITER &&
|
|
131
|
+
testsEtendusDeLEnveloppe(env).some(d => rel.startsWith(`${d}/`)) &&
|
|
132
|
+
langage.estUnTest(file, copie)?.test
|
|
133
|
+
) {
|
|
134
|
+
return null;
|
|
135
|
+
}
|
|
125
136
|
const tenant = paquetQuiTient(rel, liste);
|
|
126
137
|
const paquet = tenant === '.' ? 'la racine du dépôt' : tenant;
|
|
127
138
|
return {
|
|
@@ -249,6 +260,11 @@ export function refusal(role, input, { tmp = tmpdir(), describe = ticketDescript
|
|
|
249
260
|
}
|
|
250
261
|
return sansArchitecture(id, description);
|
|
251
262
|
}
|
|
263
|
+
if (role === 'direct') {
|
|
264
|
+
// The agent of a direct writes tests and code together; the envelope of its plan (`horsDuPlan`)
|
|
265
|
+
// bounds its writes, and its ticket needs no « ## Architecture » section.
|
|
266
|
+
return null;
|
|
267
|
+
}
|
|
252
268
|
return `Rôle inconnu du verrou : ${role}.`;
|
|
253
269
|
}
|
|
254
270
|
|
|
@@ -142,7 +142,7 @@ son adresse) : le circuit la consigne fermée sous ton ticket, et tu continues.
|
|
|
142
142
|
sur un rouge (de la preuve, un `rouge existant` compris, ou des contrôles), sur un constat du
|
|
143
143
|
relecteur ouvert pour toi, ou directement sur un plan qui ne porte aucun test (aucun paquet qui
|
|
144
144
|
joue des tests, un script `test:unit` en typescript), sans testwriter ni preuve : une séance qui ne change aucun fichier du
|
|
145
|
-
plan n'a rien à livrer, et ses contrôles rouges arrêtent le circuit (`sans-livraison`) ; ta
|
|
145
|
+
plan n'a rien à livrer, et ses contrôles rouges arrêtent le circuit (`sans-livraison`), sauf un rouge qui nomme un fichier de test du lot, qui va au testwriter ; ta
|
|
146
146
|
passation dit pourquoi. Lancé après un refus de l'intégration, ton rapport porte ce refus : c'est
|
|
147
147
|
le rouge à lever, que les contrôles de ta copie, verts, ne voient pas ; une séance qui ne change
|
|
148
148
|
rien au lot refusé est relancée une fois avec lui, puis le circuit s'arrête (`sans-livraison`). Tes propres lancements pendant le travail restent les tiens. Ainsi ton
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: direct
|
|
3
|
+
description: "Travailler un ticket étiqueté direct, mené hors du circuit : tests et code ensemble, dans la copie du ticket. À charger au démarrage d'une séance de la commande du direct, avant de lire le ticket."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Direct — écrire un ticket hors du circuit
|
|
7
|
+
|
|
8
|
+
Un ticket direct est un défaut du circuit lui-même, une correction triviale, un ticket de données
|
|
9
|
+
ou le squelette d'un paquet. Il n'a ni plan, ni testwriter, ni preuve du rouge, ni contrôles du
|
|
10
|
+
circuit : tu écris ses tests et son code ensemble, un relecteur juge ton lot, puis le superviseur le
|
|
11
|
+
vérifie et l'entre sur main. Tu n'es ni le relecteur ni le superviseur. La charte du projet, déjà
|
|
12
|
+
dans ton contexte, prime sur tout le reste.
|
|
13
|
+
|
|
14
|
+
## Au démarrage
|
|
15
|
+
|
|
16
|
+
1. Ta consigne porte ton ticket, lu au lancement de ta séance : sa description et ses critères, ses
|
|
17
|
+
notes, la tâche du superviseur et les constats du relecteur qui restent ouverts pour toi. Tu ne
|
|
18
|
+
le relis pas par bd, qui le refuse à ta séance. Puis `bd update <id> --claim`. Des constats
|
|
19
|
+
ouverts disent que ton lot a été rendu : tu reprends sur l'état de ta copie
|
|
20
|
+
(`git -C <copie> status`, `git -C <copie> diff`) et tu lèves chacun.
|
|
21
|
+
2. Lis les documents des paquets du plan (`CADRE.md`, `INTERFACE.md`, `ARCHITECTURE.md`, dans
|
|
22
|
+
`docs/` ou `packages/<x>/docs/`) et le lexique `CONTEXT.md`, puis ce que publient leurs
|
|
23
|
+
fournisseurs (`docs/agents/index-des-interfaces.md`). Ainsi ton code part de l'architecture
|
|
24
|
+
écrite.
|
|
25
|
+
|
|
26
|
+
## Le travail
|
|
27
|
+
|
|
28
|
+
- **Un défaut corrigé porte un test qui le reproduit** : tu écris le test d'abord, tu le vois rouge
|
|
29
|
+
par `npm test -- <fichiers>` (chemins depuis la racine du dépôt), puis tu corriges et tu le vois
|
|
30
|
+
vert. Aucune preuve du rouge ne le rejoue : le relecteur et la vérification complète du
|
|
31
|
+
superviseur la tiennent, et un défaut corrigé sans test qui le reproduit est rendu.
|
|
32
|
+
- **L'index d'abord** : toute recherche commence par `rtfm_search` (mode `hybrid`) pour le quoi,
|
|
33
|
+
`rtfm_expand` lit en entier un résultat, et `codegraph explore <symboles>` donne l'appel ; le
|
|
34
|
+
shell lit un fichier déjà nommé.
|
|
35
|
+
- **L'existant d'abord** : avant d'écrire un calcul ou d'inventer un nom, tu cherches celui qui
|
|
36
|
+
existe et tu vérifies ce qu'il fait.
|
|
37
|
+
- **Tu écris les paquets du plan seuls** (les composants du titre du ticket, plus ceux que la
|
|
38
|
+
commande a reçus) ; une écriture hors d'eux arrête ta séance. Un fichier s'écrit par l'outil Write
|
|
39
|
+
ou Edit, jamais par un script ni une redirection du shell ; un fichier temporaire va dans
|
|
40
|
+
`$TMPDIR`, et le retrait d'un fichier par un script `node $TMPDIR/retire.mjs` (`rmSync` de
|
|
41
|
+
`node:fs`).
|
|
42
|
+
- **Les tests se lancent par `npm test -- <fichiers>`**, jamais par l'outil de test directement ;
|
|
43
|
+
`npm run api`, après lui, écrit le rapport d'API des paquets du plan.
|
|
44
|
+
- **Tu attends au premier plan ce que tu lances** : ta séance n'a aucune tâche de fond.
|
|
45
|
+
- **Tu ne commites pas** : ton lot est ton travail dans la copie.
|
|
46
|
+
|
|
47
|
+
## Ce qui t'arrête
|
|
48
|
+
|
|
49
|
+
Une décision qui revient au responsable, un fait qu'un fournisseur ne publie pas, un fichier hors de
|
|
50
|
+
ton plan : ta fiche finit sur BLOQUÉ ou BESOIN, avec sa pièce, et le superviseur tranche. Une
|
|
51
|
+
découverte hors du ticket entre dans `decouvertes` de ta fiche.
|
|
52
|
+
|
|
53
|
+
## La fin
|
|
54
|
+
|
|
55
|
+
Ta passation au ticket (`bd comments add`), en mots simples : la cause, ce qui est juste, le test
|
|
56
|
+
et sa morsure, ce qui n'est pas fait. Ta séance finit sur ta fiche, la même que celle du
|
|
57
|
+
développeur. Ainsi le circuit du direct lit ta fiche, l'humain et ta séance suivante ta passation.
|