@roomi-fields/grillhouse 0.50.1 → 0.50.3
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 +12 -0
- package/docs/ARCHITECTURE.md +9 -3
- package/docs/architecture/circuit.md +1 -0
- package/docs/architecture/entree.md +1 -1
- package/package.json +1 -1
- package/scripts/activites.mjs +18 -8
- package/scripts/circuit.mjs +28 -4
- package/scripts/commande-du-plan.mjs +15 -0
- package/scripts/dette.mjs +84 -7
- package/scripts/engendres.mjs +32 -0
- package/scripts/etapes.mjs +8 -0
- package/scripts/integration/file.mjs +25 -24
- package/scripts/integration/integrer.mjs +31 -30
- package/scripts/integration/rejeu.mjs +4 -4
- package/scripts/langages/cargo/sccache.mjs +49 -6
- package/scripts/langages/typescript/titres-de-tests.mjs +27 -10
- package/scripts/reponses-du-circuit.mjs +5 -0
- package/scripts/resultats.mjs +11 -2
- package/skills/explorateur/SKILL.md +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,18 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.50.3] - 2026-11-25
|
|
10
|
+
|
|
11
|
+
- **An integration test that reads `env!("CARGO_BIN_EXE_<bin>")` compiles again** (grillhouse-3uv.251): the short wrapper of sccache of 0.50.2 ran under `sh`, which drops a variable whose name holds a hyphen, so a binary named like `osd-reference` failed to compile (seen by OSD). The wrapper runs under bash, in a new file of the cache (`sccache-court-bash`). **Action for projects**: none.
|
|
12
|
+
|
|
13
|
+
## [0.50.2] - 2026-11-25
|
|
14
|
+
|
|
15
|
+
- **A generated file the lot feeds is played again before the tests that read it** (grillhouse-3uv.245): before the proof of the red, the checks and the final pass, the circuit plays in the copy the command of each entry of `grillhouse.engendres` whose `lit` covers a file the lot changes, its files entering the lot as those of 4.2, so a ticket that adds cases no longer turns red on the test that reads their sums. **Action for projects**: none.
|
|
16
|
+
- **The circuit's regeneration of the debt no longer inscribes new findings, and carries the debt of a moved file** (grillhouse-3uv.223): at 4.2 the circuit inscribed as the debt of a guard the lot adds the new findings of a guard the project already had (synthhub, `constructeur-appele`), and a lot that moved a test file entered main with its debt still under the former path, which the CI of main then found red (BPScript). The regeneration now only lowers the debt and moves the key of a file the lot renames. **Action for projects**: none.
|
|
17
|
+
- **A lot that adds or renames a dependency enters main** (grillhouse-3uv.248): the integration installed its copy with main's lock file before writing it again from the lot's manifests, so `npm ci` refused every such lot (« Missing: … from lock file », seen by SynthHub). The integration and the queue now play the command that writes `package-lock.json` before the install, the other generated files after it. **Action for projects**: none.
|
|
18
|
+
- **A plan whose command calls git is refused at the plan** (grillhouse-3uv.240): the command of a mechanical ticket runs at 1.1 in the envelope, which mounts the git directory of the copy read-only, so `git mv` failed on `index.lock` (BPScript). The sheet of the plan and the answer `--mecanique` now refuse a command that calls git, naming the equivalent (`mv` for `git mv`, `rm` for `git rm`; the commit of the circuit records the tree, where git detects the rename), and the explorer's skill says so. **Action for projects**: none.
|
|
19
|
+
- **The sccache server starts in the envelope of a copy with a long path** (grillhouse-3uv.239): cargo's sccache client now runs under a short temporary directory, so a server it starts binds its socket under the 108 bytes of a socket's path (« path must be shorter than SUN_LEN », seen by OSD in its agents' checks). **Action for projects**: none.
|
|
20
|
+
|
|
9
21
|
## [0.50.1] - 2026-11-24
|
|
10
22
|
|
|
11
23
|
- **The copy of the plugin into the package leaves out what git ignores** (grillhouse-3uv.243): an entry of `mods/grillhouse` that git ignores (a cache a tool of the plugin's package writes, `.cache-outils/`) no longer enters the published package nor the list its tests check. **Action for projects**: none.
|
package/docs/ARCHITECTURE.md
CHANGED
|
@@ -380,7 +380,11 @@ finale, qui mesure le dépôt entier, hors de toute enveloppe) et régénèrent
|
|
|
380
380
|
ajoute, absente des gardes de main (le circuit les nomme à la passe par `GRILLHOUSE_GARDES_DE_LA_BASE`) :
|
|
381
381
|
chaque fichier et règle de ses constats est une note `a-inscrire`, au compte trouvé, que la
|
|
382
382
|
régénération inscrit en section entière et écrit au ticket (garde, fichier, règle, compte). Une garde
|
|
383
|
-
de main n'en émet jamais
|
|
383
|
+
de main n'en émet jamais : elle l'est par son nom dans cette liste, ou, pour la garde d'un projet que
|
|
384
|
+
la liste ne nomme pas, par son script que HEAD détient. La même régénération porte la dette d'un
|
|
385
|
+
fichier que le lot déplace sous son nouveau chemin (les renommages que git détecte sur le lot tel que
|
|
386
|
+
le circuit le commite) ; la garde des titres de tests refuse, par une note `a-deplacer`, une dette
|
|
387
|
+
restée sous l'ancien chemin. Un plafond ne monte jamais : un lot qui dépasse celui d'une garde de main
|
|
384
388
|
reste rouge. Ainsi aucun fichier engendré n'attend une main (BP 320.9 : 292 min autour des
|
|
385
389
|
références, dont 163 d'attente).
|
|
386
390
|
|
|
@@ -410,8 +414,10 @@ un arrêt `references` sur « le plafond ne monte pas »).
|
|
|
410
414
|
sur l'arbre fusionné, et `npm install` le `package-lock.json` après une fusion, l'intégration
|
|
411
415
|
n'applique pas du lot un fichier qu'une référence écrit en entier (`entiers` : l'index des
|
|
412
416
|
interfaces, les `turbo.json` des paquets) ; elle rejoue la référence qui l'écrit dans la copie
|
|
413
|
-
d'intégration, sur main à jour,
|
|
414
|
-
|
|
417
|
+
d'intégration, sur main à jour, avant la vérification, et ce qu'elle écrit entre dans le commit ;
|
|
418
|
+
la référence du verrou des dépendances (`package-lock.json`) se joue avant l'installation, qui suit
|
|
419
|
+
le verrou régénéré des manifestes du lot (Renovate, la file de fusion), les autres après
|
|
420
|
+
l'installation. Le circuit lui passe les références du cadre (`--references`), tirées de
|
|
415
421
|
sa seule liste. L'avance d'une copie sur main suit la même règle pour ces références, sans clé du
|
|
416
422
|
projet : la version de main, puis le générateur du cadre sur le travail appliqué
|
|
417
423
|
(`scripts/enveloppe/travail-de-la-copie.mjs` ; BPScript, 2026-11-22, l'index des interfaces en
|
|
@@ -354,6 +354,7 @@ Un geste est ce que le circuit fait seul sur un cas qu'une règle tranche ; chac
|
|
|
354
354
|
| renvoi après `RENDU` | un constat bloquant va au rôle qu'il nomme | la boucle des relectures |
|
|
355
355
|
| rien à livrer | un auteur qui ne change rien quand les contrôles sont verts passe aux contrôles | l'arrêt `sans-livraison` quand un rouge reste |
|
|
356
356
|
| régénération | un rouge qui est celui d'une référence déclarée ou engendrée va à 4.2 | une fois par arbre |
|
|
357
|
+
| rejeu des engendrés | avant la preuve du rouge, les contrôles et la passe finale, la commande de chaque fichier engendré (`grillhouse.engendres`) dont un motif `lit` couvre un fichier que le lot change se joue dans la copie, comme 4.2 : ses fichiers entrent au lot (Bazel, Nx, Turborepo : une sortie se construit avant les tests qui la lisent) | à chaque passe ; une commande qui échoue arrête à `references` |
|
|
357
358
|
| conflit de l'avance | l'avance de la copie sur main laisse des fichiers en conflit : ils vont au rôle qui les écrit | une séance par rôle, puis `lancement` |
|
|
358
359
|
| extension du plan | une écriture dans un fichier que le ticket nomme, un composant écarté qui rougit, les tests d'un paquet lecteur que le lot fait rougir : le plan s'étend, la pièce écrite au ticket | les paquets que le ticket ou le relevé du plan nomment |
|
|
359
360
|
| arrêt d'un ticket fermé hors de son circuit | la file des tickets arrête le circuit d'un ticket que Beads dit fermé | une fois |
|
|
@@ -185,7 +185,7 @@ sequenceDiagram
|
|
|
185
185
|
F->>F: déclenche puis lit la CI de main
|
|
186
186
|
```
|
|
187
187
|
|
|
188
|
-
Le circuit porte les étapes qui mènent un lot jusqu'à la file, et leur ordre (document du circuit, §5.3) ; la file porte ce qui suit. Une branche qui ne se repose pas (des fichiers en conflit hors des fichiers engendrés) sort de la file, son ticket rouvert, les fichiers nommés, l'issue portant `conflit` ; une branche sans rien en avance sur main sort sans être rouverte ; une copie qui ne se prépare pas garde la branche en file, l'issue `en-file`. Un fichier engendré que le projet déclare (`grillhouse.engendres`) ne se fusionne jamais : en conflit, la version de main est prise, puis sa commande le réécrit sur la branche reposée, et le rejugement couvre ce qu'elle écrit. Un acte qui échoue rend l'issue `echec` et sa raison, et la file passe à l'entrée suivante ; quand l'échec suit l'avance de main, la raison dit que le main local porte le lot, non poussé, et que la reprise du circuit le repasse par la file, qui le ferme et le pousse. Une fermeture que Beads refuse laisse le lot sur main, le ticket ouvert et l'issue `echec` ; la file des tickets ne relance jamais un ticket dont le lot est sur main.
|
|
188
|
+
Le circuit porte les étapes qui mènent un lot jusqu'à la file, et leur ordre (document du circuit, §5.3) ; la file porte ce qui suit. Une branche qui ne se repose pas (des fichiers en conflit hors des fichiers engendrés) sort de la file, son ticket rouvert, les fichiers nommés, l'issue portant `conflit` ; une branche sans rien en avance sur main sort sans être rouverte ; une copie qui ne se prépare pas garde la branche en file, l'issue `en-file`. Un fichier engendré que le projet déclare (`grillhouse.engendres`) ne se fusionne jamais : en conflit, la version de main est prise, puis sa commande le réécrit sur la branche reposée, et le rejugement couvre ce qu'elle écrit. À l'acte du commit comme dans la file, la commande d'un fichier engendré qui écrit `package-lock.json` se joue depuis les manifestes du lot posé sur main avant l'installation de la copie (`npm ci`), les autres après elle : un lot qui ajoute ou renomme une dépendance s'installe, et une commande lit ce que l'installation a posé. Un acte qui échoue rend l'issue `echec` et sa raison, et la file passe à l'entrée suivante ; quand l'échec suit l'avance de main, la raison dit que le main local porte le lot, non poussé, et que la reprise du circuit le repasse par la file, qui le ferme et le pousse. Une fermeture que Beads refuse laisse le lot sur main, le ticket ouvert et l'issue `echec` ; la file des tickets ne relance jamais un ticket dont le lot est sur main.
|
|
189
189
|
|
|
190
190
|
Une poussée que `origin` refuse est écrite au ticket et n'arrête pas la file. Un lot que la voie de secours mène passe par la même garde : sa vérification a inscrit l'arbre (document du circuit, §5.8).
|
|
191
191
|
|
package/package.json
CHANGED
package/scripts/activites.mjs
CHANGED
|
@@ -337,7 +337,8 @@ export async function relire(
|
|
|
337
337
|
valider: f =>
|
|
338
338
|
[
|
|
339
339
|
conformiteDuLot(f, { ...liste, references: differences.map(d => d.fichier) }),
|
|
340
|
-
suiviDesConstats(f, ouvertsALaRelecture)
|
|
340
|
+
suiviDesConstats(f, ouvertsALaRelecture),
|
|
341
|
+
]
|
|
341
342
|
.filter(Boolean)
|
|
342
343
|
.join(' ; ') || null,
|
|
343
344
|
});
|
|
@@ -843,6 +844,20 @@ export function regenerer(
|
|
|
843
844
|
};
|
|
844
845
|
}
|
|
845
846
|
|
|
847
|
+
// The generated files the project declares that the lot reads through (`lit`) a file it changes,
|
|
848
|
+
// played again in the copy before any pass that plays the lot's tests (the proof, the checks, the
|
|
849
|
+
// final pass), as a build graph (Bazel, Nx, Turborepo) builds an output before the tests that read
|
|
850
|
+
// it: the regeneration of 4.2 (`regenerer`) on those references alone, their files entering the
|
|
851
|
+
// lot as its. Null when the lot changes nothing they read; else the regeneration's outcome. It
|
|
852
|
+
// throws the stop « references » of `regenerer` when a command fails.
|
|
853
|
+
export function rejouerLesEngendres(ctx) {
|
|
854
|
+
const changes = changements(ctx).map(c => c.fichier);
|
|
855
|
+
const noms = (ctx.engendres ?? [])
|
|
856
|
+
.filter(e => changes.some(f => couvertPar(e.lit, f)))
|
|
857
|
+
.map(e => e.nom);
|
|
858
|
+
return noms.length ? regenerer(ctx, { noms, avant: leLotGarde(ctx).lot }) : null;
|
|
859
|
+
}
|
|
860
|
+
|
|
846
861
|
// The copy of <ctx> restored to the commit <commit> of a lot kept: each file that differs between
|
|
847
862
|
// that commit and the copy as it stands (`arbreDeLaCopie`, its files git does not track included)
|
|
848
863
|
// takes its version there, or goes when the commit does not hold it. A copy that is that lot changes
|
|
@@ -1873,10 +1888,7 @@ export function preuve(ctx, { mesure: derniere = null, fichiers: duRouge = null
|
|
|
1873
1888
|
: fichiers.length || rouges.length || misDeCote.length
|
|
1874
1889
|
? []
|
|
1875
1890
|
: inchange
|
|
1876
|
-
? [
|
|
1877
|
-
'Aucun fichier de test du lot : le plan dit « tests-adaptés », rien à prouver.',
|
|
1878
|
-
'',
|
|
1879
|
-
]
|
|
1891
|
+
? ['Aucun fichier de test du lot : le plan dit « tests-adaptés », rien à prouver.', '']
|
|
1880
1892
|
: ['Aucun fichier de test du lot dans le plan : rien ne prouve le rouge.', '']),
|
|
1881
1893
|
...section('Rouges', rouges),
|
|
1882
1894
|
...sections,
|
|
@@ -2250,9 +2262,7 @@ export function controles(ctx, finale, restreinte = null, reportes = null, fichi
|
|
|
2250
2262
|
// red lies in a test file (not yet extended to its tests): the plan extends to those test files
|
|
2251
2263
|
// alone, and its reds go on as the plan's. One red in its code, or in a task of the package (a
|
|
2252
2264
|
// build, a typing), keeps the package out of the plan: the circuit does not guess the repair.
|
|
2253
|
-
const testsLecteurs = [
|
|
2254
|
-
...new Set(lus.filter(r => r.lecteur && r.test).map(r => r.lecteur)),
|
|
2255
|
-
]
|
|
2265
|
+
const testsLecteurs = [...new Set(lus.filter(r => r.lecteur && r.test).map(r => r.lecteur))]
|
|
2256
2266
|
.filter(d => lus.filter(r => r.lecteur === d).every(r => r.test))
|
|
2257
2267
|
.sort();
|
|
2258
2268
|
const tous = lus.map(r =>
|
package/scripts/circuit.mjs
CHANGED
|
@@ -132,6 +132,7 @@ import {
|
|
|
132
132
|
} from './etapes.mjs';
|
|
133
133
|
import {
|
|
134
134
|
CONTROLES,
|
|
135
|
+
PREUVE,
|
|
135
136
|
correctionsDuPlan,
|
|
136
137
|
ouvertesDuPlan,
|
|
137
138
|
pasDuPlan,
|
|
@@ -160,6 +161,7 @@ import {
|
|
|
160
161
|
preuve,
|
|
161
162
|
referencesDesRouges,
|
|
162
163
|
regenerer,
|
|
164
|
+
rejouerLesEngendres,
|
|
163
165
|
relire,
|
|
164
166
|
sansTests,
|
|
165
167
|
testsDuLot,
|
|
@@ -416,7 +418,7 @@ const fichiersRougesDe = (rouges, dossier) => [
|
|
|
416
418
|
rouges
|
|
417
419
|
.flatMap(r => [r.fichier, ...String(r.texte ?? '').split(' ')])
|
|
418
420
|
.filter(t => typeof t === 'string' && t.startsWith(`${dossier}/`))
|
|
419
|
-
.map(t => t.split(':')[0])
|
|
421
|
+
.map(t => t.split(':')[0])
|
|
420
422
|
),
|
|
421
423
|
];
|
|
422
424
|
|
|
@@ -592,6 +594,22 @@ function inscrireEtape(ctx, { etape, debut }) {
|
|
|
592
594
|
// prepared on the tip of main before each of them.
|
|
593
595
|
export const SUR_LA_POINTE = new Set([CONTROLES]);
|
|
594
596
|
|
|
597
|
+
// The generated files the lot feeds, played again before a pass that plays its tests
|
|
598
|
+
// (`rejouerLesEngendres`): `{}`, or `{ arret }`, the stop « references » of a command that fails.
|
|
599
|
+
function rejeuDesEngendres(ctx) {
|
|
600
|
+
try {
|
|
601
|
+
if (rejouerLesEngendres(ctx)) {
|
|
602
|
+
geste(ctx, 'rejeu-des-engendres');
|
|
603
|
+
}
|
|
604
|
+
return {};
|
|
605
|
+
} catch (e) {
|
|
606
|
+
if (!(e instanceof Arret)) {
|
|
607
|
+
throw e;
|
|
608
|
+
}
|
|
609
|
+
return { arret: { nom: e.nom, rapport: e.rapport, piece: e.piece, question: e.question } };
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
|
|
595
613
|
// What the circuit does before the step <etape>, whose regeneration before it is <regeneration>
|
|
596
614
|
// (`ctx.regeneration`), as a merge queue plays its checks on the branch set on the tip of main: at a
|
|
597
615
|
// step of SUR_LA_POINTE, the copy prepared by the launcher's own preparation
|
|
@@ -610,7 +628,9 @@ export function avantLaPasse(
|
|
|
610
628
|
{ estUnTest = rouleDeTest(ctx) } = {}
|
|
611
629
|
) {
|
|
612
630
|
if (!SUR_LA_POINTE.has(etape)) {
|
|
613
|
-
return
|
|
631
|
+
return etape === PREUVE
|
|
632
|
+
? { avancee: false, regeneration, ...rejeuDesEngendres(ctx) }
|
|
633
|
+
: { avancee: false, regeneration };
|
|
614
634
|
}
|
|
615
635
|
const tete = dossier =>
|
|
616
636
|
spawnSync('git', ['-C', dossier, 'rev-parse', 'HEAD'], { encoding: 'utf8' });
|
|
@@ -638,7 +658,9 @@ export function avantLaPasse(
|
|
|
638
658
|
}
|
|
639
659
|
if (r.ok) {
|
|
640
660
|
const avancee = tete(ctx.copie).stdout.trim() !== avant.stdout.trim();
|
|
641
|
-
|
|
661
|
+
// The generated files the lot's files feed play again on the copy as prepared.
|
|
662
|
+
const rejeu = rejeuDesEngendres(ctx);
|
|
663
|
+
return { avancee, regeneration: avancee ? null : regeneration, ...rejeu };
|
|
642
664
|
}
|
|
643
665
|
const fichiers = [...(r.conflits ?? []), ...(r.enAttente ?? [])];
|
|
644
666
|
if (fichiers.length) {
|
|
@@ -1566,7 +1588,9 @@ export function testsEtendusDuPlan(ctx, paquets) {
|
|
|
1566
1588
|
const dedans = d => paquets.some(p => p === '.' || d === p || d.startsWith(`${p}/`));
|
|
1567
1589
|
return [
|
|
1568
1590
|
...new Set(
|
|
1569
|
-
lesFiches(ctx).flatMap(e =>
|
|
1591
|
+
lesFiches(ctx).flatMap(e =>
|
|
1592
|
+
e.role === AUTEUR_DU_CIRCUIT ? (e.plan?.testsEtendus ?? []) : []
|
|
1593
|
+
)
|
|
1570
1594
|
),
|
|
1571
1595
|
].filter(d => !dedans(d));
|
|
1572
1596
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// The command of the plan of a mechanical ticket: whether it calls git, and the refusal that says so.
|
|
2
|
+
// No import, so the code of a workflow may bring it in (no node module there).
|
|
3
|
+
|
|
4
|
+
// Whether the command of a plan calls git: a word `git` that starts the command or follows a
|
|
5
|
+
// separator (space-less operators included), as in `git mv a b` or `x && git add .`. The envelope
|
|
6
|
+
// mounts the git directory of the copy read-only (machine.md), so git cannot write its index there;
|
|
7
|
+
// the commit of the circuit records the tree after 1.1.
|
|
8
|
+
export const appelleGit = commande => /(^|[\s;&|(`])git(\s|$)/.test(String(commande ?? ''));
|
|
9
|
+
|
|
10
|
+
// The refusal of a command that calls git, naming the equivalent; null for any other command.
|
|
11
|
+
export function refusDeLaCommande(commande) {
|
|
12
|
+
return appelleGit(commande)
|
|
13
|
+
? `la commande du plan appelle git (« ${String(commande).trim()} ») : l'enveloppe monte le dossier git de la copie en lecture seule, git n'y écrit pas son index ; la commande joue sur l'arbre de travail (mv au lieu de git mv, rm au lieu de git rm), et le commit du circuit enregistre l'arbre, git y détecte le renommage`
|
|
14
|
+
: null;
|
|
15
|
+
}
|
package/scripts/dette.mjs
CHANGED
|
@@ -33,11 +33,13 @@
|
|
|
33
33
|
// its types in ./dette.d.ts (docs/ARCHITECTURE.md, the package's named entries).
|
|
34
34
|
//
|
|
35
35
|
// The mechanism: docs/architecture/tests.md §2.6, §4.1 and §5.5.
|
|
36
|
-
import {
|
|
36
|
+
import { spawnSync } from 'node:child_process';
|
|
37
|
+
import { existsSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
|
|
38
|
+
import { tmpdir } from 'node:os';
|
|
37
39
|
import path from 'node:path';
|
|
38
40
|
import { pathToFileURL } from 'node:url';
|
|
39
41
|
import { paquetsDeLEnveloppe } from './enveloppe/paquets-du-plan.mjs';
|
|
40
|
-
import { A_ELAGUER, A_INSCRIRE, ecrireSarif } from './resultats.mjs';
|
|
42
|
+
import { A_DEPLACER, A_ELAGUER, A_INSCRIRE, ecrireSarif } from './resultats.mjs';
|
|
41
43
|
|
|
42
44
|
// The environment variable that names the guards of the lot's base (main), a JSON list.
|
|
43
45
|
export const BASE = 'GRILLHOUSE_GARDES_DE_LA_BASE';
|
|
@@ -241,7 +243,7 @@ export function trancher(
|
|
|
241
243
|
}));
|
|
242
244
|
ecrireSarif({
|
|
243
245
|
garde,
|
|
244
|
-
constats: [...refus, ...notes, ...aInscrire(garde, refus, lEnv)],
|
|
246
|
+
constats: [...refus, ...notes, ...aInscrire(racine, garde, refus, lEnv)],
|
|
245
247
|
racine,
|
|
246
248
|
env: lEnv,
|
|
247
249
|
});
|
|
@@ -259,11 +261,32 @@ function gardesDeLaBase(env) {
|
|
|
259
261
|
}
|
|
260
262
|
}
|
|
261
263
|
|
|
264
|
+
// Whether <script>, the one that runs a guard (`argv[1]`), is a file of the project that HEAD holds: a
|
|
265
|
+
// guard of the project (its script `gardes`, which imports `trancher`) is a guard of main though
|
|
266
|
+
// the circuit's list of names, read from the frame's guards, never names it. A script out of the
|
|
267
|
+
// project, or one HEAD does not hold, says nothing.
|
|
268
|
+
export function scriptDeLaBase(racine, script, env = process.env) {
|
|
269
|
+
if (!script) {
|
|
270
|
+
return false;
|
|
271
|
+
}
|
|
272
|
+
const rel = path.relative(path.resolve(racine), path.resolve(script));
|
|
273
|
+
if (rel.startsWith('..') || path.isAbsolute(rel) || rel.split(path.sep).includes('node_modules')) {
|
|
274
|
+
return false;
|
|
275
|
+
}
|
|
276
|
+
return (
|
|
277
|
+
spawnSync('git', ['-C', racine, 'cat-file', '-e', `HEAD:${rel.split(path.sep).join('/')}`], {
|
|
278
|
+
env,
|
|
279
|
+
stdio: 'ignore',
|
|
280
|
+
}).status === 0
|
|
281
|
+
);
|
|
282
|
+
}
|
|
283
|
+
|
|
262
284
|
// The notes « to inscribe » of <garde> when the base does not hold it: one per file and rule of
|
|
263
|
-
// its refusals, with its count. None for a guard of main
|
|
264
|
-
|
|
285
|
+
// its refusals, with its count. None for a guard of main (its name in the base's list, or its
|
|
286
|
+
// script in HEAD), nor without a base to compare with.
|
|
287
|
+
function aInscrire(racine, garde, refus, env) {
|
|
265
288
|
const base = gardesDeLaBase(env);
|
|
266
|
-
if (!base || base.includes(garde)) {
|
|
289
|
+
if (!base || base.includes(garde) || scriptDeLaBase(racine, process.argv[1], env)) {
|
|
267
290
|
return [];
|
|
268
291
|
}
|
|
269
292
|
const out = [];
|
|
@@ -292,14 +315,68 @@ function ecrire(racine, dette) {
|
|
|
292
315
|
writeFileSync(path.join(racine, FICHIER), `${JSON.stringify(triee, null, 2)}\n`);
|
|
293
316
|
}
|
|
294
317
|
|
|
318
|
+
// The files the working copy at <racine> renames or moves against HEAD, `{ nouveau: ancien }`, as
|
|
319
|
+
// git detects them (`-M`, half the content kept) on a throwaway index that holds the new files too:
|
|
320
|
+
// the lot as the circuit commits it. `{}` when git fails (not a repository, no commit).
|
|
321
|
+
export function renommesDuCommit(racine) {
|
|
322
|
+
const dossier = mkdtempSync(path.join(tmpdir(), 'dette-index-'));
|
|
323
|
+
try {
|
|
324
|
+
const env = { ...process.env, GIT_INDEX_FILE: path.join(dossier, 'index') };
|
|
325
|
+
const git = (...a) =>
|
|
326
|
+
spawnSync('git', ['-C', racine, ...a], { encoding: 'utf8', env, maxBuffer: 256 * 1024 * 1024 });
|
|
327
|
+
if (git('read-tree', 'HEAD').status !== 0 || git('add', '-A').status !== 0) {
|
|
328
|
+
return {};
|
|
329
|
+
}
|
|
330
|
+
const r = git('diff', '--cached', '-M', '--name-status', '-z', 'HEAD');
|
|
331
|
+
if (r.status !== 0) {
|
|
332
|
+
return {};
|
|
333
|
+
}
|
|
334
|
+
const out = {};
|
|
335
|
+
const t = r.stdout.split('\0');
|
|
336
|
+
for (let i = 0; i < t.length; i++) {
|
|
337
|
+
if (t[i].startsWith('R')) {
|
|
338
|
+
out[t[i + 2]] = t[i + 1];
|
|
339
|
+
i += 2;
|
|
340
|
+
} else if (t[i]) {
|
|
341
|
+
i += 1;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
return out;
|
|
345
|
+
} finally {
|
|
346
|
+
rmSync(dossier, { recursive: true, force: true });
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
// <dette> with the keys of each moved file (`{ nouveau: ancien }`) carried to its new path, in every
|
|
351
|
+
// guard: the debt of the former name is the new one's, added to what it already holds.
|
|
352
|
+
export function deplacer(dette, renommes) {
|
|
353
|
+
for (const section of Object.values(dette)) {
|
|
354
|
+
for (const [nouveau, ancien] of Object.entries(renommes)) {
|
|
355
|
+
if (!section[ancien]) {
|
|
356
|
+
continue;
|
|
357
|
+
}
|
|
358
|
+
const cible = (section[nouveau] ??= {});
|
|
359
|
+
for (const [regle, { count }] of Object.entries(section[ancien])) {
|
|
360
|
+
cible[regle] = { count: count + (cible[regle]?.count ?? 0) };
|
|
361
|
+
}
|
|
362
|
+
delete section[ancien];
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
return dette;
|
|
366
|
+
}
|
|
367
|
+
|
|
295
368
|
// The debt at <racine> lowered by <notes>, each `{ garde, fichier, regle, trouve }` (the notes
|
|
296
369
|
// `a-elaguer` of a pass, scripts/resultats.mjs): each key named comes down to what its guard
|
|
297
370
|
// found, and leaves at zero; a count never rises, no key is added. Written when it changes;
|
|
298
371
|
// returns whether it did.
|
|
299
372
|
export function abaisser(racine, notes) {
|
|
300
373
|
const avant = lire(racine);
|
|
301
|
-
|
|
374
|
+
// The keys of the files the lot moves come first, so that the notes find them at their new path.
|
|
375
|
+
const dette = deplacer(JSON.parse(JSON.stringify(avant)), renommesDuCommit(racine));
|
|
302
376
|
for (const { garde, fichier, regle, trouve, genre } of notes) {
|
|
377
|
+
if (genre === A_DEPLACER) {
|
|
378
|
+
continue;
|
|
379
|
+
}
|
|
303
380
|
if (genre === A_INSCRIRE) {
|
|
304
381
|
if (fichier && regle && Number.isInteger(trouve) && trouve > 0) {
|
|
305
382
|
dette[garde] ??= {};
|
package/scripts/engendres.mjs
CHANGED
|
@@ -22,6 +22,11 @@
|
|
|
22
22
|
// (scripts/integration/file.mjs) and the move of a copy onto main
|
|
23
23
|
// (scripts/enveloppe/travail-de-la-copie.mjs) call it on the tree where they applied the lot,
|
|
24
24
|
// main's version of each file taken.
|
|
25
|
+
// - `installerEtRegenerer` orders that play around the install of the copy, as Bazel builds an
|
|
26
|
+
// output before what reads it: first the references that write `package-lock.json`, from the
|
|
27
|
+
// manifests of the lot (`npm install --package-lock-only`, as Renovate writes a lock again),
|
|
28
|
+
// then the install, which reads that file, then the other references, which may need what it
|
|
29
|
+
// installed. The integration and the queue play it.
|
|
25
30
|
// - `encoreDeclares` keeps the generated files the tree where the lot is applied still declares, by
|
|
26
31
|
// their names: as a genrule of Bazel removed with its output in one change plays no more, the
|
|
27
32
|
// one a lot removes from the key is not played, and its files follow the lot, their deletion
|
|
@@ -30,6 +35,9 @@ import { existsSync, readFileSync } from 'node:fs';
|
|
|
30
35
|
import path from 'node:path';
|
|
31
36
|
import { arbrePrincipal } from './outils-cles.mjs';
|
|
32
37
|
|
|
38
|
+
// The lock file `npm ci` installs from, at the root of the tree.
|
|
39
|
+
const VERROU = 'package-lock.json';
|
|
40
|
+
|
|
33
41
|
/**
|
|
34
42
|
* Whether one of <motifs> covers the file <fichier>, both from the root of the copy, as the inputs
|
|
35
43
|
* of Turborepo read them: a path names that file, a directory every file under it, a glob pattern
|
|
@@ -311,3 +319,27 @@ export function regenerer({ refs, lancer, dansCopie, ecrire = s => process.stdou
|
|
|
311
319
|
}
|
|
312
320
|
return null;
|
|
313
321
|
}
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* The install of a tree where a lot is applied, between the regenerations of <refs>: those that
|
|
325
|
+
* write the lock file `npm ci` reads play before <installer> (main's version of the lock file does
|
|
326
|
+
* not know the manifests of the lot), the others after it (see the header). `{}`, or
|
|
327
|
+
* `{ installation }`, the refusal of <installer>, or `{ refus }`, the one of a regeneration.
|
|
328
|
+
* @param {Parameters<typeof regenerer>[0] & { installer: () => string | null }} o
|
|
329
|
+
* @returns {{ installation?: string, refus?: string }}
|
|
330
|
+
*/
|
|
331
|
+
export function installerEtRegenerer({ installer, refs, ...o }) {
|
|
332
|
+
const avant = refs.filter(r => couvertPar(r.fichiers, VERROU));
|
|
333
|
+
const apres = refs.filter(r => !avant.includes(r));
|
|
334
|
+
const jouer = les => (les.length ? regenerer({ ...o, refs: les }) : null);
|
|
335
|
+
const refusAvant = jouer(avant);
|
|
336
|
+
if (refusAvant) {
|
|
337
|
+
return { refus: refusAvant };
|
|
338
|
+
}
|
|
339
|
+
const installation = installer();
|
|
340
|
+
if (installation) {
|
|
341
|
+
return { installation };
|
|
342
|
+
}
|
|
343
|
+
const refus = jouer(apres);
|
|
344
|
+
return refus ? { refus } : {};
|
|
345
|
+
}
|
package/scripts/etapes.mjs
CHANGED
|
@@ -224,6 +224,14 @@ export const GESTES = [
|
|
|
224
224
|
'un rouge des contrôles du plan ou de la passe finale est celui d’une référence, même mêlé à d’autres : une que le projet déclare (`grillhouse.references`), ou un fichier que le cadre engendre (l’index des interfaces, les fichiers que le module du langage engendre) ; ou la passe abaisse la dette des gardes (`dette.mjs --abaisser`, depuis ses notes)',
|
|
225
225
|
cas: 'BP 320.9 : 292 min autour des références, dont 163 min d’attente pour régénérer à la main l’index des interfaces, le plafond et l’empreinte, des rouges de références mêlés à d’autres ; BP 320.3.9 : le plafond rouge aux contrôles, laissé à une passe finale qui rejoue les mêmes tests sur le même arbre (6,1 min) ; BP 320.6.5 : un test qui lit les références des paquets, rouge à côté de leur garde, envoyé au développeur, qui n’a rien à livrer puis ne peut pas les écrire',
|
|
226
226
|
},
|
|
227
|
+
{
|
|
228
|
+
genre: 'rejeu-des-engendres',
|
|
229
|
+
geste:
|
|
230
|
+
'avant la preuve du rouge, les contrôles et la passe finale, la commande de chaque fichier engendré (`grillhouse.engendres`) dont un motif `lit` couvre un fichier que le lot change, jouée dans la copie ; ses fichiers entrent au lot comme ceux de 4.2',
|
|
231
|
+
regle:
|
|
232
|
+
'un fichier engendré se construit avant les tests qui le lisent, et le graphe le rejoue quand ses entrées changent (Bazel, Nx, Turborepo) : aucun test du lot ne lit un fichier engendré périmé',
|
|
233
|
+
cas: 'OSD-sf1.25.8 : un ticket qui ajoute des cas de conformité rougit au test qui lit les sommes engendrées, sans-livraison ; OSD-sf1.25.13 : la commande jouée à la main deux fois',
|
|
234
|
+
},
|
|
227
235
|
{
|
|
228
236
|
genre: 'rien-a-livrer',
|
|
229
237
|
geste: 'aux contrôles, qui jugent le lot',
|
|
@@ -18,11 +18,12 @@
|
|
|
18
18
|
// the replaced commit, the candidate. A generated file the project declares
|
|
19
19
|
// (`grillhouse.engendres`, scripts/engendres.mjs, read from the main tree, a faulty key keeping
|
|
20
20
|
// the branch in the queue, named) is never merged, as npm writes package-lock.json again after
|
|
21
|
-
// a merge: a conflict on such files only takes main's version, and once the branch is replaced
|
|
22
|
-
//
|
|
23
|
-
//
|
|
24
|
-
//
|
|
25
|
-
//
|
|
21
|
+
// a merge: a conflict on such files only takes main's version, and once the branch is replaced,
|
|
22
|
+
// the command of each one whose files, or the files it reads, the branch touches writes it
|
|
23
|
+
// again, one that writes package-lock.json before the install and the others after it
|
|
24
|
+
// (`installerEtRegenerer`), with the tools of the project, and what it writes enters the
|
|
25
|
+
// branch's commit; a command that fails makes the branch leave the queue, the command and its
|
|
26
|
+
// output named;
|
|
26
27
|
// - a branch with nothing ahead of main does not enter: it leaves the queue, its ticket loses
|
|
27
28
|
// `en-file` and takes a comment, and stays as it is;
|
|
28
29
|
// - a branch that does not replace (the files in conflict) leaves the queue: its ticket loses
|
|
@@ -80,7 +81,7 @@ import {
|
|
|
80
81
|
encoreDeclares,
|
|
81
82
|
engendresDe,
|
|
82
83
|
prendreLesEngendres,
|
|
83
|
-
|
|
84
|
+
installerEtRegenerer,
|
|
84
85
|
} from '../engendres.mjs';
|
|
85
86
|
import { arbreEstJuge, garderLArbreJuge } from '../arbres-juges.mjs';
|
|
86
87
|
import { A_REPASSER } from '../codes-de-sortie.mjs';
|
|
@@ -296,10 +297,6 @@ function remplacer(o, tip, tete) {
|
|
|
296
297
|
}
|
|
297
298
|
rebase = dansCopie('-c', 'core.editor=true', 'rebase', '--continue');
|
|
298
299
|
}
|
|
299
|
-
const installation = installer();
|
|
300
|
-
if (installation) {
|
|
301
|
-
return { sortie: [installation, "Le verrou de la branche replacée ne s'installe pas."] };
|
|
302
|
-
}
|
|
303
300
|
const touches = aRejouer(
|
|
304
301
|
engendres,
|
|
305
302
|
copie,
|
|
@@ -307,21 +304,25 @@ function remplacer(o, tip, tete) {
|
|
|
307
304
|
.stdout.split('\0')
|
|
308
305
|
.filter(Boolean)
|
|
309
306
|
);
|
|
307
|
+
const { installation, refus } = installerEtRegenerer({
|
|
308
|
+
refs: touches.map(e => ({ ...e, cadre: false })),
|
|
309
|
+
installer,
|
|
310
|
+
dansCopie,
|
|
311
|
+
lancer: commande =>
|
|
312
|
+
spawnSync('bash', monter('sh', '-c', commande), {
|
|
313
|
+
cwd: copie,
|
|
314
|
+
encoding: 'utf8',
|
|
315
|
+
maxBuffer: 256 * 1024 * 1024,
|
|
316
|
+
env,
|
|
317
|
+
}),
|
|
318
|
+
});
|
|
319
|
+
if (installation) {
|
|
320
|
+
return { sortie: [installation, "Le verrou de la branche replacée ne s'installe pas."] };
|
|
321
|
+
}
|
|
322
|
+
if (refus) {
|
|
323
|
+
return { sortie: ['ses fichiers engendrés ne se régénèrent pas sur main.', refus] };
|
|
324
|
+
}
|
|
310
325
|
if (touches.length) {
|
|
311
|
-
const refus = regenerer({
|
|
312
|
-
refs: touches.map(e => ({ ...e, cadre: false })),
|
|
313
|
-
dansCopie,
|
|
314
|
-
lancer: commande =>
|
|
315
|
-
spawnSync('bash', monter('sh', '-c', commande), {
|
|
316
|
-
cwd: copie,
|
|
317
|
-
encoding: 'utf8',
|
|
318
|
-
maxBuffer: 256 * 1024 * 1024,
|
|
319
|
-
env,
|
|
320
|
-
}),
|
|
321
|
-
});
|
|
322
|
-
if (refus) {
|
|
323
|
-
return { sortie: ['ses fichiers engendrés ne se régénèrent pas sur main.', refus] };
|
|
324
|
-
}
|
|
325
326
|
if (dansCopie('diff', '--cached', '--quiet').status !== 0) {
|
|
326
327
|
const corrige = dansCopie('commit', '-q', '--amend', '--no-edit', '--no-verify');
|
|
327
328
|
if (corrige.status !== 0) {
|
|
@@ -35,10 +35,11 @@
|
|
|
35
35
|
// 5. the lots, applied in three ways in the copy, tests first, without the files a reference
|
|
36
36
|
// writes in full; the files of the lot in the
|
|
37
37
|
// ticket's copy are compared with the copy's own base plus the lot, not with the integration
|
|
38
|
-
// copy. Once the lots are in the copy, the
|
|
39
|
-
//
|
|
40
|
-
//
|
|
41
|
-
// then the references
|
|
38
|
+
// copy. Once the lots are in the copy, the references that write package-lock.json regenerate
|
|
39
|
+
// (below), then the replay makes the dependencies agree with the lock file and the manifests
|
|
40
|
+
// of the copy (`npm ci`, as the continuous integration runs it); an install that fails refuses
|
|
41
|
+
// the lot, « Les dépendances de la copie ne s'installent pas. »; then the other references
|
|
42
|
+
// regenerate (`installerEtRegenerer` of scripts/engendres.mjs);
|
|
42
43
|
// 6. the commit in the copy, its hooks included, under GRILLHOUSE_INTEGRATION=1: a pre-commit
|
|
43
44
|
// hook that plays the guards skips them, as the final pass plays them; nothing is verified
|
|
44
45
|
// here: the queue lays the branch on the tip of main, and its final pass judges the lot before
|
|
@@ -59,9 +60,10 @@
|
|
|
59
60
|
// scripts/engendres.mjs reads them). As a genrule of Bazel writes its output again on the merged
|
|
60
61
|
// tree, and npm install writes package-lock.json again after a merge, a file of the lot a reference
|
|
61
62
|
// writes in full is not applied: main's version stays, and each reference whose files or reads the
|
|
62
|
-
// lot touches plays in the copy, on main of the moment,
|
|
63
|
-
//
|
|
64
|
-
//
|
|
63
|
+
// lot touches plays in the copy, on main of the moment, before the commit, through the mounts, with
|
|
64
|
+
// the tools of the project, and what it writes enters the commit (`regenerer` of
|
|
65
|
+
// scripts/engendres.mjs): one that writes package-lock.json before the install, the others after it
|
|
66
|
+
// (`installerEtRegenerer`). A command of the project at another code than 0, one of
|
|
65
67
|
// the frame on a real failure (126, 127, a signal), or a file it changes that its `fichiers` do not
|
|
66
68
|
// cover, refuses the lot, the command, its code and its output named. A conflict on any other file
|
|
67
69
|
// refuses it, as the three-way application says. A generated file of the project the lot removes
|
|
@@ -89,9 +91,9 @@ import { arbitrageTranche, estArbitrage } from '../arbitrages.mjs';
|
|
|
89
91
|
import {
|
|
90
92
|
couvertPar,
|
|
91
93
|
engendresDe,
|
|
94
|
+
installerEtRegenerer,
|
|
92
95
|
partDesLots,
|
|
93
96
|
poserLesRetires,
|
|
94
|
-
regenerer,
|
|
95
97
|
touchesPar,
|
|
96
98
|
} from '../engendres.mjs';
|
|
97
99
|
import { langageDe } from '../langages.mjs';
|
|
@@ -320,7 +322,7 @@ function differents(copieTicket, lots, fichiers, tmp) {
|
|
|
320
322
|
return r.stdout.split('\0').filter(Boolean);
|
|
321
323
|
}
|
|
322
324
|
|
|
323
|
-
function main(argv) {
|
|
325
|
+
export function main(argv, ou = process.cwd()) {
|
|
324
326
|
const o = lire(argv);
|
|
325
327
|
if ('faute' in o) {
|
|
326
328
|
process.stderr.write(
|
|
@@ -331,6 +333,7 @@ function main(argv) {
|
|
|
331
333
|
}
|
|
332
334
|
// The main tree, from git's common directory: run from a copy, the integration still works on it.
|
|
333
335
|
const commun = spawnSync('git', ['rev-parse', '--path-format=absolute', '--git-common-dir'], {
|
|
336
|
+
cwd: ou,
|
|
334
337
|
encoding: 'utf8',
|
|
335
338
|
}).stdout.trim();
|
|
336
339
|
const racine = path.dirname(commun);
|
|
@@ -484,8 +487,9 @@ function main(argv) {
|
|
|
484
487
|
}
|
|
485
488
|
const { dansCopie, monter, installer } = ouverte;
|
|
486
489
|
|
|
487
|
-
// 5. The lots, applied in the copy without the files a reference writes in full
|
|
488
|
-
//
|
|
490
|
+
// 5. The lots, applied in the copy without the files a reference writes in full; then the
|
|
491
|
+
// references that write the lock file (regenerated from the lots' manifests), then the
|
|
492
|
+
// installation that follows that lock file, then the other references regenerated.
|
|
489
493
|
const sansEntiers = entiers.map(f => `--exclude=${f}`);
|
|
490
494
|
for (const p of lots) {
|
|
491
495
|
const r = dansCopie('apply', '--3way', '--index', ...sansEntiers, p);
|
|
@@ -512,27 +516,24 @@ function main(argv) {
|
|
|
512
516
|
);
|
|
513
517
|
}
|
|
514
518
|
dire('✓ lots appliqués');
|
|
515
|
-
const installation = installer();
|
|
516
|
-
if (installation) {
|
|
517
|
-
return refuser(installation);
|
|
518
|
-
}
|
|
519
519
|
const aRejouer = part.rejouees;
|
|
520
|
+
const env = avecLesDonnees(donnees, avecLesOutils(outils, process.env, empreintes));
|
|
521
|
+
const { installation, refus } = installerEtRegenerer({
|
|
522
|
+
refs: aRejouer,
|
|
523
|
+
installer,
|
|
524
|
+
dansCopie,
|
|
525
|
+
lancer: commande =>
|
|
526
|
+
spawnSync('bash', monter('sh', '-c', commande), {
|
|
527
|
+
cwd: copie,
|
|
528
|
+
encoding: 'utf8',
|
|
529
|
+
maxBuffer: 256 * 1024 * 1024,
|
|
530
|
+
env,
|
|
531
|
+
}),
|
|
532
|
+
});
|
|
533
|
+
if (installation || refus) {
|
|
534
|
+
return refuser(installation ?? refus);
|
|
535
|
+
}
|
|
520
536
|
if (aRejouer.length) {
|
|
521
|
-
const env = avecLesDonnees(donnees, avecLesOutils(outils, process.env, empreintes));
|
|
522
|
-
const refus = regenerer({
|
|
523
|
-
refs: aRejouer,
|
|
524
|
-
dansCopie,
|
|
525
|
-
lancer: commande =>
|
|
526
|
-
spawnSync('bash', monter('sh', '-c', commande), {
|
|
527
|
-
cwd: copie,
|
|
528
|
-
encoding: 'utf8',
|
|
529
|
-
maxBuffer: 256 * 1024 * 1024,
|
|
530
|
-
env,
|
|
531
|
-
}),
|
|
532
|
-
});
|
|
533
|
-
if (refus) {
|
|
534
|
-
return refuser(refus);
|
|
535
|
-
}
|
|
536
537
|
dire(`✓ références régénérées sur main à jour : ${aRejouer.map(r => r.nom).join(', ')}`);
|
|
537
538
|
}
|
|
538
539
|
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
// the manifests (every `package.json` git tracks) with the key
|
|
21
21
|
// `node_modules/.integration-lock`, runs `npm ci` when they differ and writes the key again; a
|
|
22
22
|
// failing install gives `DEPENDANCES_REFUSEES`, the one form of that refusal. It runs at the
|
|
23
|
-
// opening, and the consumer calls `installer` once the lot is in the copy
|
|
24
|
-
//
|
|
25
|
-
//
|
|
26
|
-
// manifest).
|
|
23
|
+
// opening, and the consumer calls `installer` once the lot is in the copy and the commands that
|
|
24
|
+
// write the lock file have played (`installerEtRegenerer` of scripts/engendres.mjs): a lot that
|
|
25
|
+
// changes the lock file or a manifest is installed as the continuous integration installs it
|
|
26
|
+
// (`npm ci` refuses a lock file in disagreement with its manifest).
|
|
27
27
|
// - Every command of the project run in the copy (`lancer`: the install) leaves the
|
|
28
28
|
// index of its copy up to date, green or red: the consumers that apply a lot with `--index` (the
|
|
29
29
|
// integration, the queue) read an index that matches the files the command touched, and none
|
|
@@ -40,9 +40,16 @@
|
|
|
40
40
|
// (`demarrerLeServeur`): sccache 0.19.0 starts its server by binding a socket of a path under
|
|
41
41
|
// TMPDIR (`<TMPDIR>/sccacheXXXXXX/sock`, src/commands.rs, `run_server_process`), which fails
|
|
42
42
|
// past the 108 bytes of a socket's path (« path must be shorter than SUN_LEN »), and the
|
|
43
|
-
// temporary directory of a pass of tests under the working directory of a session passes them
|
|
44
|
-
// Cargo then finds the server running and starts none; it
|
|
45
|
-
// keeps its own temporary directory, the pass's.
|
|
43
|
+
// temporary directory of a pass of tests under the working directory of a session passes them
|
|
44
|
+
// (grillhouse-qmk, OSC Bridge OB-p58). Cargo then finds the server running and starts none; it
|
|
45
|
+
// keeps its own temporary directory, the pass's. Its wrapper still runs the client under `/tmp`
|
|
46
|
+
// (`lanceurCourt`): a client that must start the server itself, which cargo's long TMPDIR
|
|
47
|
+
// would break, binds its socket there (grillhouse-3uv.239, OSD-sf1.25.1). The two ends of the
|
|
48
|
+
// start are so short whoever begins it, rather than one more rescue of the first.
|
|
49
|
+
// - That wrapper changes nothing else of what rustc sees: it is run by bash, which hands on every
|
|
50
|
+
// variable of its environment; a POSIX shell such as dash (`/bin/sh` of Debian and Ubuntu)
|
|
51
|
+
// drops those whose name is no shell identifier, `CARGO_BIN_EXE_<bin>` of a binary whose name
|
|
52
|
+
// holds a hyphen among them, and `env!` then fails to compile (grillhouse-3uv.251).
|
|
46
53
|
// - A wrapper the project sets already is its own: the run keeps it, without sccache. It is read
|
|
47
54
|
// as cargo reads it: the environment (`RUSTC_WRAPPER`, `CARGO_BUILD_RUSTC_WRAPPER`), then
|
|
48
55
|
// `build.rustc-wrapper` of each `.cargo/config.toml` (or `.cargo/config`) from the project up to
|
|
@@ -57,7 +64,15 @@
|
|
|
57
64
|
// installation.md §4.2 nor of the post's files of §4.3.
|
|
58
65
|
import { spawnSync } from 'node:child_process';
|
|
59
66
|
import { createHash } from 'node:crypto';
|
|
60
|
-
import {
|
|
67
|
+
import {
|
|
68
|
+
mkdirSync,
|
|
69
|
+
readFileSync,
|
|
70
|
+
readlinkSync,
|
|
71
|
+
realpathSync,
|
|
72
|
+
renameSync,
|
|
73
|
+
statSync,
|
|
74
|
+
writeFileSync,
|
|
75
|
+
} from 'node:fs';
|
|
61
76
|
import { createRequire } from 'node:module';
|
|
62
77
|
import { homedir, tmpdir } from 'node:os';
|
|
63
78
|
import path from 'node:path';
|
|
@@ -118,6 +133,33 @@ function lanceurDuProjet(racine, env) {
|
|
|
118
133
|
return null;
|
|
119
134
|
}
|
|
120
135
|
|
|
136
|
+
// `-p`: bash reads no startup file of the caller (`BASH_ENV`) and imports none of its functions.
|
|
137
|
+
const LANCEUR = '#!/bin/bash -p\nTMPDIR=/tmp exec sccache "$@"\n';
|
|
138
|
+
|
|
139
|
+
// The wrapper of rustc of the run: a script of the cache directory <cache> that runs sccache under
|
|
140
|
+
// the machine's `COURT` temporary directory. Cargo hands its wrapper its own TMPDIR, which a
|
|
141
|
+
// client that has to start the server (a server stopped by its idle time, killed, or born in
|
|
142
|
+
// another envelope) binds a socket under, refused past 108 bytes of a path (« path must be
|
|
143
|
+
// shorter than SUN_LEN », OSD-sf1.25.1); the compilations keep cargo's TMPDIR. Written once, then
|
|
144
|
+
// read: a file cannot carry an executable bit in a package, so the script is made here. Its name
|
|
145
|
+
// is its own, apart from `sccache-court`: the cache is common to every copy of the machine, and a
|
|
146
|
+
// copy on the 0.50.2 writes there its script for `sh`.
|
|
147
|
+
function lanceurCourt(cache) {
|
|
148
|
+
const fichier = path.join(cache, 'sccache-court-bash');
|
|
149
|
+
try {
|
|
150
|
+
if (readFileSync(fichier, 'utf8') === LANCEUR && (statSync(fichier).mode & 0o111) !== 0) {
|
|
151
|
+
return fichier;
|
|
152
|
+
}
|
|
153
|
+
} catch {
|
|
154
|
+
// Absent: written below.
|
|
155
|
+
}
|
|
156
|
+
mkdirSync(cache, { recursive: true });
|
|
157
|
+
const temporaire = `${fichier}.${process.pid}`;
|
|
158
|
+
writeFileSync(temporaire, LANCEUR, { mode: 0o755 });
|
|
159
|
+
renameSync(temporaire, fichier);
|
|
160
|
+
return fichier;
|
|
161
|
+
}
|
|
162
|
+
|
|
121
163
|
/** The namespace of processes this process runs in, `pid:[<inode>]`. */
|
|
122
164
|
export const espaceDesProcessus = () => readlinkSync('/proc/self/ns/pid');
|
|
123
165
|
|
|
@@ -262,11 +304,12 @@ export function avecSccache(racine, env) {
|
|
|
262
304
|
if (lanceurDuProjet(racine, env)) {
|
|
263
305
|
return { ...env, ...cible };
|
|
264
306
|
}
|
|
307
|
+
const cache = cacheDeCompilation('sccache', env);
|
|
265
308
|
return {
|
|
266
309
|
...env,
|
|
267
310
|
...cible,
|
|
268
|
-
RUSTC_WRAPPER:
|
|
269
|
-
SCCACHE_DIR:
|
|
311
|
+
RUSTC_WRAPPER: lanceurCourt(cache),
|
|
312
|
+
SCCACHE_DIR: cache,
|
|
270
313
|
SCCACHE_SERVER_UDS: socketDuServeur(racine, env.TMPDIR || tmpdir()),
|
|
271
314
|
};
|
|
272
315
|
}
|
|
@@ -29,8 +29,8 @@ import { spawnSync } from 'node:child_process';
|
|
|
29
29
|
import { readFileSync, writeFileSync } from 'node:fs';
|
|
30
30
|
import path from 'node:path';
|
|
31
31
|
import { pathToFileURL } from 'node:url';
|
|
32
|
-
import { FICHIER, lire as lireDette, mesureDuPlan, trancher } from '../../dette.mjs';
|
|
33
|
-
import { A_ELAGUER, ecrireSarif } from '../../resultats.mjs';
|
|
32
|
+
import { deplacer, FICHIER, lire as lireDette, mesureDuPlan, trancher } from '../../dette.mjs';
|
|
33
|
+
import { A_DEPLACER, A_ELAGUER, ecrireSarif } from '../../resultats.mjs';
|
|
34
34
|
import { prefixe } from '../../services-du-noyau.mjs';
|
|
35
35
|
import { testsDuDepot } from './tailles-des-tests.mjs';
|
|
36
36
|
import { TEST } from './vitest-config/lances.mjs';
|
|
@@ -251,6 +251,19 @@ export function jugerLesTitres(dette, constats, renommes = {}, mesure = () => tr
|
|
|
251
251
|
message: `${fichier} : aucun titre ne nomme plus un ticket ou un « critère N », pour ${permis(fichier)} inscrit(s) dans ${FICHIER} : la dette s'abaisse (npm run grillhouse:dette:elaguer), jamais à la main. ${MESSAGE_FIN}`,
|
|
252
252
|
});
|
|
253
253
|
}
|
|
254
|
+
// A debt that stands under the former path of a moved file is red: the commit drops the rename,
|
|
255
|
+
// and the key stays under a path that no longer exists. The regeneration carries it (`a-deplacer`).
|
|
256
|
+
for (const [fichier, ancien] of Object.entries(renommes)) {
|
|
257
|
+
if (permis(ancien) > 0) {
|
|
258
|
+
refus.push({
|
|
259
|
+
fichier,
|
|
260
|
+
regle: REGLE,
|
|
261
|
+
aDeplacer: true,
|
|
262
|
+
trouve: comptes.get(fichier) ?? 0,
|
|
263
|
+
message: `${fichier} : ${permis(ancien)} titre(s) inscrit(s) dans ${FICHIER} sous l'ancien chemin ${ancien} : la dette se déplace (npm run grillhouse:dette:elaguer), jamais à la main.`,
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
}
|
|
254
267
|
return refus.sort((a, b) => (a.fichier < b.fichier ? -1 : a.fichier > b.fichier ? 1 : 0));
|
|
255
268
|
}
|
|
256
269
|
|
|
@@ -272,14 +285,8 @@ function main() {
|
|
|
272
285
|
// A write of the debt (`inscrire`, `elaguer`): a file moved takes the debt of its former name
|
|
273
286
|
// first, so that the write keeps it.
|
|
274
287
|
const dette = lireDette(racine);
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
for (const [nouveau, ancien] of Object.entries(renommes)) {
|
|
278
|
-
if (section[ancien] && !section[nouveau]) {
|
|
279
|
-
section[nouveau] = section[ancien];
|
|
280
|
-
}
|
|
281
|
-
delete section[ancien];
|
|
282
|
-
}
|
|
288
|
+
if (dette[GARDE]) {
|
|
289
|
+
deplacer({ [GARDE]: dette[GARDE] }, renommes);
|
|
283
290
|
writeFileSync(path.join(racine, FICHIER), `${JSON.stringify(dette, null, 2)}\n`);
|
|
284
291
|
}
|
|
285
292
|
const r = trancher(racine, GARDE, constats);
|
|
@@ -304,6 +311,16 @@ function main() {
|
|
|
304
311
|
trouve: r.trouve,
|
|
305
312
|
message: `${r.trouve} constat(s) pour une dette plus haute : la dette s'abaisse.`,
|
|
306
313
|
})),
|
|
314
|
+
...refus
|
|
315
|
+
.filter(r => r.aDeplacer)
|
|
316
|
+
.map(r => ({
|
|
317
|
+
fichier: r.fichier,
|
|
318
|
+
regle: r.regle,
|
|
319
|
+
niveau: 'note',
|
|
320
|
+
genre: A_DEPLACER,
|
|
321
|
+
trouve: r.trouve,
|
|
322
|
+
message: `la dette de l'ancien chemin se déplace sous ${r.fichier}.`,
|
|
323
|
+
})),
|
|
307
324
|
],
|
|
308
325
|
});
|
|
309
326
|
}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
// circuits it reads), the opening, the wait, the board and the line of a stop name; and the
|
|
5
5
|
// answer `--mecanique`, which turns the sort of a ticket stopped on the testwriter or on the proof
|
|
6
6
|
// of the red.
|
|
7
|
+
import { refusDeLaCommande } from './commande-du-plan.mjs';
|
|
7
8
|
import { CODE, GESTE, PREUVE, TESTS } from './transitions.mjs';
|
|
8
9
|
|
|
9
10
|
/** The statuses of a workflow ended without its issue. */
|
|
@@ -94,6 +95,10 @@ export function reponseMecanique({ etat, sorte, commande, contexte }) {
|
|
|
94
95
|
return { refus: 'le ticket est déjà mécanique : sa commande est celle de son plan.' };
|
|
95
96
|
}
|
|
96
97
|
const geste = String(commande ?? '').trim();
|
|
98
|
+
const refusGit = refusDeLaCommande(geste);
|
|
99
|
+
if (refusGit) {
|
|
100
|
+
return { refus: refusGit };
|
|
101
|
+
}
|
|
97
102
|
return geste
|
|
98
103
|
? { sorte: { genre: 'mécanique', raison, commande: geste }, suivant: { etape: GESTE } }
|
|
99
104
|
: { sorte: { genre: 'comportement', raison, comportement: 'inchangé' }, suivant: { etape: CODE } };
|
package/scripts/resultats.mjs
CHANGED
|
@@ -117,6 +117,7 @@
|
|
|
117
117
|
import { existsSync, mkdirSync, readdirSync, readFileSync, statSync, writeFileSync } from 'node:fs';
|
|
118
118
|
import path from 'node:path';
|
|
119
119
|
import { pathToFileURL } from 'node:url';
|
|
120
|
+
import { refusDeLaCommande } from './commande-du-plan.mjs';
|
|
120
121
|
import { paquets } from './paquets.mjs';
|
|
121
122
|
import { AUTEUR_DU_CIRCUIT, EXPLORATEUR } from './etapes.mjs';
|
|
122
123
|
|
|
@@ -128,12 +129,16 @@ const SARIF = 'sarif';
|
|
|
128
129
|
export const A_ELAGUER = 'a-elaguer';
|
|
129
130
|
// The kinds of a guard's finding: to fix (a developpeur's work), to settle (a person's decision),
|
|
130
131
|
// to lower (a note).
|
|
131
|
-
const GENRES = ['a-corriger', 'a-arbitrer', A_ELAGUER, 'a-inscrire'];
|
|
132
|
+
const GENRES = ['a-corriger', 'a-arbitrer', A_ELAGUER, 'a-inscrire', 'a-deplacer'];
|
|
133
|
+
// The kind of a note of a guard whose debt stands under the former path of a file the lot moves:
|
|
134
|
+
// the regeneration carries the key to the new path (scripts/dette.mjs, `abaisser`).
|
|
135
|
+
export const A_DEPLACER = 'a-deplacer';
|
|
132
136
|
// The kind of a note of a guard the lot adds (absent from the guards of main): the findings of a
|
|
133
137
|
// key, which the circuit inscribes as its debt (scripts/dette.mjs, scripts/circuit.mjs).
|
|
134
138
|
export const A_INSCRIRE = 'a-inscrire';
|
|
135
139
|
// Whether a finding is a note of the debt, lowered or inscribed by the circuit: no red.
|
|
136
|
-
export const estNoteDeDette = k =>
|
|
140
|
+
export const estNoteDeDette = k =>
|
|
141
|
+
k.genre === A_ELAGUER || k.genre === A_INSCRIRE || k.genre === A_DEPLACER;
|
|
137
142
|
const texte = description => ({ type: 'string', description });
|
|
138
143
|
const liste = (items, description) => ({ type: 'array', description, items });
|
|
139
144
|
const objet = (properties, required = [], description) => ({
|
|
@@ -956,6 +961,10 @@ function manques(role, f) {
|
|
|
956
961
|
if (!(f.paquets ?? []).length) {
|
|
957
962
|
out.push('paquets : manque, pour un plan');
|
|
958
963
|
}
|
|
964
|
+
const refus = refusDeLaCommande(f.sorte?.commande);
|
|
965
|
+
if (refus) {
|
|
966
|
+
out.push(`sorte.commande : ${refus}`);
|
|
967
|
+
}
|
|
959
968
|
for (const [i, e] of (f.ecartes ?? []).entries()) {
|
|
960
969
|
if (!(typeof e.raison === 'string' && e.raison.trim())) {
|
|
961
970
|
out.push(`ecartes[${i}].raison : manque, pour un composant écarté`);
|
|
@@ -78,7 +78,11 @@ change, et ceux qu'il peut casser.
|
|
|
78
78
|
- `sorte` : la sorte du ticket, et sa `raison`. `mécanique` pour un geste sans comportement
|
|
79
79
|
neuf (montée du cadre, documents seuls, renommage ou déplacement, montée de dépendance,
|
|
80
80
|
configuration seule, correction de style, seuil relevé), avec sa `commande`, la commande ou
|
|
81
|
-
l'outil qui fait le geste, telle qu'elle se lance à la racine de la copie,
|
|
81
|
+
l'outil qui fait le geste, telle qu'elle se lance à la racine de la copie, sans appeler git :
|
|
82
|
+
l'enveloppe monte le dossier git de la copie en lecture seule, et le circuit refuse au plan
|
|
83
|
+
une commande qui l'appelle ; le geste joue sur l'arbre de travail (`mv` au lieu de git mv,
|
|
84
|
+
`rm` au lieu de git rm), et le commit du circuit enregistre l'arbre, où git détecte le
|
|
85
|
+
renommage, comme Rosie et
|
|
82
86
|
ClangMR font un grand changement chez Google, Renovate une montée de dépendance, `nx migrate`
|
|
83
87
|
une montée du cadre, `eslint --fix` une correction de style : le circuit saute alors le
|
|
84
88
|
testwriter, la preuve du rouge et le développeur. Le critère : je dis mécanique un ticket
|