@roomi-fields/grillhouse 0.46.0 → 0.47.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/CHANGELOG.md +14 -0
  3. package/cadre/templates/c/package.json +19 -0
  4. package/cadre/templates/projet/.github/workflows/ci.yml +34 -49
  5. package/cadre/templates/projet/CLAUDE.md +6 -0
  6. package/cadre/templates/projet/docs/agents/issue-tracker.md +1 -1
  7. package/charte.md +17 -9
  8. package/dist/temporal/circuit/client.d.ts +14 -5
  9. package/dist/temporal/circuit/client.js +39 -9
  10. package/dist/temporal/circuit/client.js.map +1 -1
  11. package/dist/temporal/file/activites.d.ts +2 -0
  12. package/dist/temporal/file/activites.js +7 -0
  13. package/dist/temporal/file/activites.js.map +1 -1
  14. package/dist/temporal/file/contrat.d.ts +26 -18
  15. package/dist/temporal/file/contrat.js +8 -5
  16. package/dist/temporal/file/contrat.js.map +1 -1
  17. package/dist/temporal/file/deroule.d.ts +1 -1
  18. package/dist/temporal/file/deroule.js +91 -42
  19. package/dist/temporal/file/deroule.js.map +1 -1
  20. package/dist/temporal/tickets/activites.js +4 -13
  21. package/dist/temporal/tickets/activites.js.map +1 -1
  22. package/docs/ARCHITECTURE.md +117 -82
  23. package/docs/INTERFACE.md +36 -19
  24. package/hooks/register.tsx +1 -1
  25. package/package.json +1 -1
  26. package/scripts/activites.mjs +5 -11
  27. package/scripts/arbres-juges.mjs +59 -0
  28. package/scripts/avancement.mjs +2 -38
  29. package/scripts/branche-de-nuit.mjs +14 -45
  30. package/scripts/ci-de-main.mjs +273 -0
  31. package/scripts/dernier-vert.mjs +12 -8
  32. package/scripts/etapes.mjs +1 -1
  33. package/scripts/faits-du-circuit.mjs +41 -25
  34. package/scripts/integration/file.mjs +126 -587
  35. package/scripts/integration/integrer.mjs +6 -5
  36. package/scripts/langages/c/binaires.json +4 -0
  37. package/scripts/langages/c/binaires.mjs +83 -0
  38. package/scripts/langages/c/clang-format.mjs +62 -0
  39. package/scripts/langages/c/clang-tidy.mjs +93 -0
  40. package/scripts/langages/c/clang.mjs +42 -0
  41. package/scripts/langages/c/commandes.mjs +530 -0
  42. package/scripts/langages/c/composants.mjs +209 -0
  43. package/scripts/langages/c/exemples.mjs +250 -0
  44. package/scripts/langages/c/index-interfaces.mjs +77 -0
  45. package/scripts/langages/c/index.mjs +120 -0
  46. package/scripts/langages/c/lot.mjs +41 -0
  47. package/scripts/langages/c/mise-a-jour.mjs +70 -0
  48. package/scripts/langages/c/squelette.mjs +61 -0
  49. package/scripts/langages/c/verdict.mjs +99 -0
  50. package/scripts/langages/typescript/turbo-des-paquets.mjs +16 -5
  51. package/scripts/langages-des-paquets.mjs +30 -2
  52. package/scripts/langages.mjs +1 -0
  53. package/scripts/mesure/avancement.mjs +1 -1
  54. package/scripts/migrations/0.47.0-ci-de-main.mjs +48 -0
  55. package/scripts/migrations.mjs +2 -2
  56. package/scripts/session-start.sh +0 -9
  57. package/scripts/sortie.mjs +1 -1
  58. package/scripts/superviseur.mjs +146 -88
  59. package/scripts/tableau.mjs +23 -8
  60. package/skills/grill/SKILL.md +6 -5
  61. package/skills/pitmaster/SKILL.md +9 -7
  62. package/skills/redacteur/references/documents-d-un-composant.md +1 -1
  63. package/scripts/ci-des-branches.mjs +0 -93
  64. package/scripts/migrations/0.33.0-ci-des-branches-de-ticket.mjs +0 -31
@@ -0,0 +1,41 @@
1
+ // The changes of a project of C read by git: the elements of a lot (`elementsDuLot`).
2
+ //
3
+ // - The lot between two commits (`git diff --name-only --no-renames <avant> <apres>`): every file
4
+ // it changes in `fichiers`; the module reads no element of a source of C, so each `.c` and `.h`
5
+ // is named in `horsDuService`, which the reviewer surveys himself.
6
+ import { spawnSync } from 'node:child_process';
7
+
8
+ const lignesDeGit = (racine, args) => {
9
+ const r = spawnSync('git', ['-C', racine, ...args, '-z'], {
10
+ encoding: 'utf8',
11
+ maxBuffer: 256 * 1024 * 1024,
12
+ });
13
+ if (r.status !== 0) {
14
+ throw new Error(`⛔ git ${args.join(' ')} : ${r.stderr.trim()}`);
15
+ }
16
+ return r.stdout.split('\0').filter(Boolean);
17
+ };
18
+
19
+ /** The elements of the lot of <racine> between <avant> and <apres>. */
20
+ export function elementsDuLot(racine, { avant, apres }) {
21
+ try {
22
+ const fichiers = [
23
+ ...new Set(lignesDeGit(racine, ['diff', '--name-only', '--no-renames', avant, apres])),
24
+ ].sort();
25
+ return {
26
+ etat: 'fait',
27
+ raison: null,
28
+ elements: [],
29
+ horsDuService: fichiers.filter(f => /\.[ch]$/.test(f)),
30
+ fichiers,
31
+ };
32
+ } catch (e) {
33
+ return {
34
+ etat: 'impossible',
35
+ raison: `erreur : ${String(e.message).split('\n')[0]}`,
36
+ elements: [],
37
+ horsDuService: [],
38
+ fichiers: [],
39
+ };
40
+ }
41
+ }
@@ -0,0 +1,70 @@
1
+ // What the module c brings to the update of a project (`grillhouse maj`,
2
+ // scripts/grillhouse-maj.mjs), the demand `miseAJour` of the join (scripts/jointure.d.ts).
3
+ //
4
+ // - The template: `templates/c/` of the frame's files. Its package.json gives the frame's
5
+ // scripts, which run the frame's commands, and Turborepo, which plays the tasks of the projects.
6
+ // - `turbo.json`, which a project lacks, from the frame's template of its form (`TURBO`).
7
+ // - The root scripts `test`, `test:forcer` and `verifier` a project lacks become the template's;
8
+ // a project's own script stays.
9
+ // - The generator: the index of the interfaces (./index-interfaces.mjs), run where the project
10
+ // holds it, as the module python's.
11
+ // - The installation of uv and the clang tools (./binaires.json) by the commands of ./binaires.mjs,
12
+ // which the core runs; cmake and ctest are the poste's, required of it (`executables`).
13
+ import path from 'node:path';
14
+ import { fileURLToPath } from 'node:url';
15
+ import { poserLeGabaritAbsent } from '../../services-du-noyau.mjs';
16
+ import { SORTIE } from './index-interfaces.mjs';
17
+
18
+ const BINAIRES = path.join(path.dirname(fileURLToPath(import.meta.url)), 'binaires.mjs');
19
+ const GABARIT = 'templates/c';
20
+ const SCRIPTS_DES_TESTS = ['test', 'test:forcer', 'verifier'];
21
+ // The frame's templates of `turbo.json`, one per form of repository.
22
+ const TURBO = {
23
+ fichier: 'turbo.json',
24
+ avecEspaces: 'templates/turbo/paquets.json',
25
+ sansEspaces: 'templates/turbo/sans-paquets.json',
26
+ };
27
+
28
+ /** @type {import('../../jointure.js').MiseAJour['appliquer']} */
29
+ function appliquer(projet, { p, modele, source }) {
30
+ const turbo = poserLeGabaritAbsent(projet, source, p, TURBO);
31
+ p.scripts ??= {};
32
+ const scripts = [];
33
+ for (const nom of SCRIPTS_DES_TESTS) {
34
+ const script = modele.scripts?.[nom];
35
+ if (typeof script !== 'string' || typeof p.scripts[nom] === 'string') {
36
+ continue;
37
+ }
38
+ p.scripts[nom] = script;
39
+ scripts.push(nom);
40
+ }
41
+ return {
42
+ bilan: { scripts: scripts.length > 0 ? scripts : null, turbo },
43
+ lignes: [
44
+ ...(turbo
45
+ ? [
46
+ `turbo.json écrit depuis le gabarit du cadre ${turbo} ; il est au projet, la mise à jour n'y touche plus.`,
47
+ ]
48
+ : []),
49
+ ...(scripts.length > 0
50
+ ? [
51
+ `Scripts des tests : ${scripts.map(n => `${n} (\`${p.scripts[n]}\`)`).join(', ')} écrits ; les agents lancent \`npm test\`, l'intégration et la nuit \`npm run verifier\`.`,
52
+ ]
53
+ : []),
54
+ ],
55
+ aFaire: [],
56
+ installer: false,
57
+ sansVerifier: null,
58
+ };
59
+ }
60
+
61
+ /** The share of the module c in the update. */
62
+ export const miseAJour = {
63
+ gabarit: GABARIT,
64
+ appliquer,
65
+ generateurs: [{ commande: 'index-interfaces', args: [], sortie: SORTIE }],
66
+ installation: {
67
+ liste: { script: BINAIRES, args: ['liste'] },
68
+ installer: (nom, version) => ({ script: BINAIRES, args: ['installer', `${nom}@${version}`] }),
69
+ },
70
+ };
@@ -0,0 +1,61 @@
1
+ // The skeleton of a new package of the module c, the demand `squelette` of the join
2
+ // (scripts/jointure.d.ts), which `grillhouse paquet` writes (scripts/paquet.mjs), as `cmake`
3
+ // projects and `cargo new --lib` write one: no behaviour, no test.
4
+ //
5
+ // - Its name: the folder's, the name of its `project()`; its files of source are
6
+ // `src/<nom>.h` and `src/<nom>.c`, the name with `-` and `.` read `_`.
7
+ // - Its CMakeLists.txt: C99 strict (`CMAKE_C_STANDARD 99`, required, extensions off), the warnings
8
+ // `-Wall -Wextra -Wpedantic -Werror`, a static library of its one source, `enable_testing()` and
9
+ // `add_subdirectory(tests)`.
10
+ // - Its `tests/CMakeLists.txt`, written once: it takes every `tests/test_*.c` present
11
+ // (`file(GLOB … CONFIGURE_DEPENDS)`), one executable and one CTest test each, named as the file
12
+ // without its extension; the testwriter adds a file, never edits it.
13
+ // - The workspace and the lock: none, CMake has neither; the entry of the package in the
14
+ // `workspaces` of the root package.json is the core's (scripts/paquet-npm.mjs).
15
+ import path from 'node:path';
16
+
17
+ /** @type {import('../../jointure.js').Langage['squelette']} */
18
+ export function squelette(_racine, { chemin }) {
19
+ const nom = path.posix.basename(chemin);
20
+ const fichier = nom.replace(/[-.]/g, '_');
21
+ const garde = `${fichier.toUpperCase()}_H`;
22
+ const cmake = [
23
+ 'cmake_minimum_required(VERSION 3.16)',
24
+ `project(${nom} C)`,
25
+ '',
26
+ 'set(CMAKE_C_STANDARD 99)',
27
+ 'set(CMAKE_C_STANDARD_REQUIRED ON)',
28
+ 'set(CMAKE_C_EXTENSIONS OFF)',
29
+ 'add_compile_options(-Wall -Wextra -Wpedantic -Werror)',
30
+ '',
31
+ `add_library(${nom} STATIC src/${fichier}.c)`,
32
+ `target_include_directories(${nom} PUBLIC src)`,
33
+ '',
34
+ 'enable_testing()',
35
+ 'add_subdirectory(tests)',
36
+ '',
37
+ ].join('\n');
38
+ const tests = [
39
+ '# Every test_*.c of this folder is one executable and one CTest test of the same name.',
40
+ 'file(GLOB TEST_SOURCES CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/test_*.c")',
41
+ 'foreach(source IN LISTS TEST_SOURCES)',
42
+ ' get_filename_component(test_name "${source}" NAME_WE)',
43
+ ' add_executable(${test_name} "${source}")',
44
+ ` target_link_libraries(\${test_name} PRIVATE ${nom})`,
45
+ ' add_test(NAME ${test_name} COMMAND ${test_name})',
46
+ 'endforeach()',
47
+ '',
48
+ ].join('\n');
49
+ return {
50
+ fichiers: {
51
+ [`${chemin}/CMakeLists.txt`]: cmake,
52
+ [`${chemin}/src/${fichier}.h`]: `#ifndef ${garde}\n#define ${garde}\n\n#endif\n`,
53
+ [`${chemin}/src/${fichier}.c`]: `#include "${fichier}.h"\n\n/* A translation unit holds one declaration (ISO C): the first function of the package replaces it. */\ntypedef int ${fichier}_sans_code;\n`,
54
+ [`${chemin}/tests/CMakeLists.txt`]: tests,
55
+ [`${chemin}/.clang-format`]: 'BasedOnStyle: LLVM\nColumnLimit: 100\n',
56
+ [`${chemin}/.clang-tidy`]: "Checks: '-*,bugprone-*,cert-*,clang-analyzer-*,misc-*'\nWarningsAsErrors: '*'\n",
57
+ },
58
+ espace: null,
59
+ verrouiller: [],
60
+ };
61
+ }
@@ -0,0 +1,99 @@
1
+ // The verdict of a run of the module c, the demand `verdict` of the join (scripts/jointure.d.ts):
2
+ // what ./commandes.mjs left in the results directory of a pass (`GRILLHOUSE_RESULTATS`,
3
+ // scripts/resultats.mjs).
4
+ //
5
+ // - The tasks are those of the summary of the task runner (`tachesDuVerdict`,
6
+ // scripts/taches-du-graphe.mjs), a package the cache replayed included (`code` 0, no report); a
7
+ // task below that the summary lacks is added.
8
+ // - `<dossier>/c/<run>.json`, one per run: `{ taches, rapports }`, each task as the join types it
9
+ // (`code` null for a task planned that did not run; `tests` true for a run of CTest), and the
10
+ // folder of the package of each JUnit report by its file's name.
11
+ // - `<dossier>/ctest/<run>-<paquet>.xml`, the JUnit report CTest wrote (`--output-junit`), kept as
12
+ // it is: a `testcase` by CTest test, `test_<nom>` the test of the file `tests/test_<nom>.c` of
13
+ // the package; each file gives a report, each case a test, failed when it holds a `failure`,
14
+ // skipped when it holds `skipped`; its message the output of the test (`system-out`), else the
15
+ // failure's.
16
+ import { existsSync, readdirSync, readFileSync } from 'node:fs';
17
+ import path from 'node:path';
18
+ import { tachesDuVerdict } from '../../services-du-noyau.mjs';
19
+
20
+ export const TACHES = 'c';
21
+ export const JUNIT = 'ctest';
22
+
23
+ const fichiers = (dossier, extension) =>
24
+ existsSync(dossier)
25
+ ? readdirSync(dossier)
26
+ .filter(f => f.endsWith(extension))
27
+ .sort()
28
+ : [];
29
+ const lireJson = f => {
30
+ try {
31
+ return JSON.parse(readFileSync(f, 'utf8'));
32
+ } catch {
33
+ return null;
34
+ }
35
+ };
36
+
37
+ const ENTITES = { lt: '<', gt: '>', amp: '&', quot: '"', apos: "'" };
38
+ // The text <t> of XML, its entities read.
39
+ const texte = t =>
40
+ t.replace(/&(#x[0-9a-f]+|#\d+|\w+);/gi, (m, e) => {
41
+ if (e[0] === '#') {
42
+ return String.fromCodePoint(e[1] === 'x' ? parseInt(e.slice(2), 16) : Number(e.slice(1)));
43
+ }
44
+ return ENTITES[e] ?? m;
45
+ });
46
+ // The attribute <nom> of the opening tag <balise>, its text, or null.
47
+ const attribut = (balise, nom) => {
48
+ const m = new RegExp(`\\s${nom}="([^"]*)"`).exec(balise);
49
+ return m ? texte(m[1]) : null;
50
+ };
51
+
52
+ /**
53
+ * The cases of the JUnit report <xml> of CTest: `{ nom, etat, message }` each.
54
+ * @param {string} xml
55
+ */
56
+ export function casDuRapport(xml) {
57
+ const cas = [];
58
+ for (const c of xml.matchAll(/<testcase\b([^>]*?)(?:\/>|>([\s\S]*?)<\/testcase>)/g)) {
59
+ const corps = c[2] ?? '';
60
+ const echec = /<(failure|error)\b([^>]*?)(?:\/>|>([\s\S]*?)<\/\1>)/.exec(corps);
61
+ const etat = echec ? 'failed' : /<skipped\b/.test(corps) ? 'skipped' : 'passed';
62
+ const sortie = /<system-out>([\s\S]*?)<\/system-out>/.exec(corps);
63
+ const message = echec
64
+ ? texte(sortie?.[1] ?? '').trim() || (attribut(echec[2], 'message') ?? '')
65
+ : '';
66
+ cas.push({ nom: attribut(c[1], 'name') ?? '', etat, message });
67
+ }
68
+ return cas;
69
+ }
70
+
71
+ // The reports of the JUnit report <xml> of the package at <dossier>, one per file of test.
72
+ function rapportsDe(xml, dossier) {
73
+ return casDuRapport(xml).map(({ nom, etat, message }) => ({
74
+ fichier: path.join(dossier, 'tests', `${nom}.c`),
75
+ etat: etat === 'failed' ? 'failed' : 'passed',
76
+ message: '',
77
+ tests: [{ titre: nom, nom, etat, message }],
78
+ }));
79
+ }
80
+
81
+ /**
82
+ * The verdict the results directory <dossier> holds: `{ rapports, taches }`.
83
+ * @param {string} dossier the results directory of a pass
84
+ */
85
+ export function verdict(dossier) {
86
+ const runs = fichiers(path.join(dossier, TACHES), '.json')
87
+ .map(f => lireJson(path.join(dossier, TACHES, f)))
88
+ .filter(Boolean);
89
+ const dossiers = Object.assign({}, ...runs.map(r => r.rapports ?? {}));
90
+ return {
91
+ rapports: fichiers(path.join(dossier, JUNIT), '.xml')
92
+ .filter(f => dossiers[f])
93
+ .flatMap(f => rapportsDe(readFileSync(path.join(dossier, JUNIT, f), 'utf8'), dossiers[f])),
94
+ taches: tachesDuVerdict(
95
+ dossier,
96
+ runs.flatMap(r => r.taches ?? [])
97
+ ),
98
+ };
99
+ }
@@ -670,16 +670,27 @@ function entreesBuild(racine, dossier, pkg, sm) {
670
670
  // example of Rust names them (rust.mdx § Caching behavior), none of TypeScript's. A crate: its
671
671
  // folder (Turborepo's default), then the Cargo.lock and the Cargo.toml of the root, the lock and
672
672
  // the manifest of its workspace. A project of Python: its folder, which holds its own uv.lock and
673
- // pyproject.toml, then the ones of the root when it has them (a workspace of uv).
673
+ // pyproject.toml, then the ones of the root when it has them (a workspace of uv). A package of C:
674
+ // its folder alone. An unknown language is a fault, named.
674
675
  function entreesDeBuildHorsJs(racine, langageNom) {
675
676
  const racineDe = f => `$TURBO_ROOT$/${f}`;
676
677
  if (langageNom === 'cargo') {
677
678
  return ['$TURBO_DEFAULT$', racineDe('Cargo.lock'), racineDe('Cargo.toml')];
678
679
  }
679
- return [
680
- '$TURBO_DEFAULT$',
681
- ...['pyproject.toml', 'uv.lock'].filter(f => existsSync(path.join(racine, f))).map(racineDe),
682
- ];
680
+ if (langageNom === 'python') {
681
+ return [
682
+ '$TURBO_DEFAULT$',
683
+ ...['pyproject.toml', 'uv.lock'].filter(f => existsSync(path.join(racine, f))).map(racineDe),
684
+ ];
685
+ }
686
+ // A package of C: its folder alone, which holds its CMakeLists.txt; it has no lock and no root
687
+ // manifest.
688
+ if (langageNom === 'c') {
689
+ return ['$TURBO_DEFAULT$'];
690
+ }
691
+ throw new Error(
692
+ `⛔ entrées de build : langage inconnu du générateur de turbo.json, ${langageNom}`
693
+ );
683
694
  }
684
695
 
685
696
  // The data and traces each package of the frame declares in its package.json:
@@ -78,13 +78,22 @@ export function constats(racine) {
78
78
  // The rows that declare a package, each table read by its own column of the names.
79
79
  const declarees = tableauxDesComposants(racine).flatMap(t => {
80
80
  const lignes = t.lignes.filter(l => langageDeLaCellule(l.cellules[t.colonne]));
81
+ // Without a component the table names, the column of the names is the first where a cell names
82
+ // a folder of the project: a table of packages whose manifests all lack is still read.
81
83
  const colonne = colonneDesNoms(lignes, tous, racine, t.colonne);
82
- return colonne < 0
84
+ const estUnDossier = n =>
85
+ n !== '.' && existsSync(path.join(racine, n)) && statSync(path.join(racine, n)).isDirectory();
86
+ const largeur = Math.max(0, ...lignes.map(l => l.cellules.length));
87
+ const colonneDesDossiers = Array.from({ length: largeur }, (_, i) => i).find(
88
+ i => i !== t.colonne && lignes.some(l => nomsDe(l.cellules[i]).some(estUnDossier))
89
+ );
90
+ const colonneRetenue = colonne < 0 ? (colonneDesDossiers ?? -1) : colonne;
91
+ return colonneRetenue < 0
83
92
  ? []
84
93
  : lignes.map(l => ({
85
94
  index: l.index,
86
95
  langage: langageDeLaCellule(l.cellules[t.colonne]),
87
- noms: nomsDe(l.cellules[colonne]),
96
+ noms: nomsDe(l.cellules[colonneRetenue]),
88
97
  }));
89
98
  });
90
99
  const ligneDe = composants =>
@@ -116,7 +125,26 @@ export function constats(racine) {
116
125
  continue;
117
126
  }
118
127
  vus.add(l);
128
+ // A package has one language: two manifests of two modules (package.json, the graph's entry
129
+ // of a package of another language, apart) are refused, both named.
130
+ const propres = avec.filter(m => m.manifeste !== 'package.json');
131
+ if (propres.length > 1) {
132
+ out.push({
133
+ fichier: ARCHITECTURE,
134
+ ligne: l.index + 1,
135
+ message: `${rel(dossier)} : porte ${propres.map(m => m.manifeste).join(' et ')} (${propres.map(m => m.nom).join(' et ')}) ; un paquet n'a qu'un langage, ${ou(l)} déclare ${l.langage}.`,
136
+ });
137
+ }
119
138
  const declare = langage(l.langage);
139
+ // The name of the `project()` of a package c is the name its row declares.
140
+ const deC = declare.nom === 'c' ? composants[modules.indexOf(declare)] : undefined;
141
+ if (deC && !l.noms.some(n => n === deC.nom || path.posix.basename(n) === deC.nom)) {
142
+ out.push({
143
+ fichier: ARCHITECTURE,
144
+ ligne: l.index + 1,
145
+ message: `${rel(dossier)} : son CMakeLists.txt appelle project(${deC.nom}), quand ${ou(l)} déclare ${l.noms.join(', ')} ; le nom de project() est celui de la ligne.`,
146
+ });
147
+ }
120
148
  const autre = avec.find(m => m !== declare);
121
149
  if (modules.includes(declare) && existsSync(path.join(dossier, declare.manifeste))) {
122
150
  // The package follows its row.
@@ -42,6 +42,7 @@ export const LANGAGES = {
42
42
  typescript: './langages/typescript/index.mjs',
43
43
  cargo: './langages/cargo/index.mjs',
44
44
  python: './langages/python/index.mjs',
45
+ c: './langages/c/index.mjs',
45
46
  };
46
47
 
47
48
  const requis = createRequire(import.meta.url);
@@ -1,7 +1,7 @@
1
1
  // The progress of a pass, as Bazel counts its actions « [1 234 / 2 000] »: the variable that names
2
2
  // the progress directory of a pass, `GRILLHOUSE_AVANCEMENT`, and the writing of a record, which
3
3
  // the reporter of the module of the language writes while it is set (for typescript,
4
- // scripts/langages/typescript/vitest-config/avancement.reporter.mjs) and the queue for the steps of its CI. The
4
+ // scripts/langages/typescript/vitest-config/avancement.reporter.mjs). The
5
5
  // reading, the plan and the totals kept are scripts/avancement.mjs.
6
6
  //
7
7
  // - Each task of a pass writes its own record to `<dossier>/taches/<nom>.json`: `{ hash, faits,
@@ -0,0 +1,48 @@
1
+ // From 0.47.0 a lot enters main on its final pass and the CI plays on main afterwards, by batches
2
+ // (grillhouse-3uv.121): no CI judges a ticket's branch, which the queue no longer pushes.
3
+ //
4
+ // - A workflow of the project that lists `agent/**` among the branches of its push has it taken out,
5
+ // its comments, its layout and its other branches kept (the library yaml's document); one that
6
+ // does not list it is left, and a second pass changes nothing and says nothing.
7
+ // - A workflow of the frame is the update's (scripts/workflows-du-cadre.mjs), which writes the
8
+ // frame's new CI, on the hourly schedule: the migration leaves it.
9
+ import { existsSync, readdirSync, readFileSync, writeFileSync } from 'node:fs';
10
+ import path from 'node:path';
11
+ import { parseDocument } from 'yaml';
12
+ import { estDuCadre, WORKFLOWS } from '../workflows-du-cadre.mjs';
13
+
14
+ export const version = '0.47.0';
15
+ export const nom = 'ci de main';
16
+
17
+ const BRANCHES_DE_TICKET = 'agent/**';
18
+
19
+ /** `agent/**` taken out of the push of each workflow of the project; returns what it did. */
20
+ export function migrer(projet) {
21
+ const dossier = path.join(projet, WORKFLOWS);
22
+ if (!existsSync(dossier)) {
23
+ return [];
24
+ }
25
+ const lignes = [];
26
+ for (const n of readdirSync(dossier).filter(f => /\.ya?ml$/.test(f)).sort()) {
27
+ const fichier = path.join(dossier, n);
28
+ const texte = readFileSync(fichier, 'utf8');
29
+ if (estDuCadre(texte)) {
30
+ continue;
31
+ }
32
+ const doc = parseDocument(texte);
33
+ const branches = doc.getIn(['on', 'push', 'branches'], true);
34
+ if (!branches || !Array.isArray(branches.items)) {
35
+ continue;
36
+ }
37
+ const restantes = branches.items.filter(i => (i?.value ?? i) !== BRANCHES_DE_TICKET);
38
+ if (restantes.length === branches.items.length || restantes.length === 0) {
39
+ continue;
40
+ }
41
+ branches.items = restantes;
42
+ writeFileSync(fichier, doc.toString());
43
+ lignes.push(
44
+ `${WORKFLOWS}/${n} : '${BRANCHES_DE_TICKET}' retirée du push, la file n'envoie plus de branche de ticket ; la CI joue sur main`
45
+ );
46
+ }
47
+ return lignes;
48
+ }
@@ -35,13 +35,13 @@ import * as langagesDansLArchitecture from './migrations/0.27.0-langages-dans-l-
35
35
 
36
36
  import * as ciAppelleLaVerification from './migrations/0.30.0-ci-appelle-la-verification.mjs';
37
37
  import * as paquetsDansLeGraphe from './migrations/0.31.0-paquets-dans-le-graphe.mjs';
38
- import * as ciDesBranchesDeTicket from './migrations/0.33.0-ci-des-branches-de-ticket.mjs';
39
38
  import * as node26 from './migrations/0.33.0-node-26.mjs';
40
39
  import * as ciDuCadre from './migrations/0.33.0-ci-du-cadre.mjs';
41
40
  import * as cacheDistant from './migrations/0.33.0-cache-distant.mjs';
42
41
  import * as greffonMattpocockRetire from './migrations/0.35.0-greffon-mattpocock-retire.mjs';
43
42
  import * as node26Seul from './migrations/0.44.0-node-26-seul.mjs';
44
43
  import * as seuilDesCodesDeTickets from './migrations/0.44.0-seuil-des-codes-de-tickets.mjs';
44
+ import * as ciDeMain from './migrations/0.47.0-ci-de-main.mjs';
45
45
 
46
46
  /** The migrations of the core. */
47
47
  export const MIGRATIONS = [
@@ -56,13 +56,13 @@ export const MIGRATIONS = [
56
56
  langagesDansLArchitecture,
57
57
  ciAppelleLaVerification,
58
58
  paquetsDansLeGraphe,
59
- ciDesBranchesDeTicket,
60
59
  node26,
61
60
  ciDuCadre,
62
61
  cacheDistant,
63
62
  greffonMattpocockRetire,
64
63
  node26Seul,
65
64
  seuilDesCodesDeTickets,
65
+ ciDeMain,
66
66
  ];
67
67
 
68
68
  /**
@@ -35,9 +35,6 @@
35
35
  # detection `grillhouse temporal perime`): joins « Manque » with `npx grillhouse temporal installer`.
36
36
  # An agent's copy does not read it.
37
37
  #
38
- # The CI of the ticket branches: a project none of whose workflows runs on a push to `agent/**`
39
- # (scripts/ci-des-branches.mjs) joins « Manque », with `npx grillhouse maj`, which adds it.
40
- #
41
38
  # One supervisor per project (scripts/superviseur.mjs): the session takes the lock of its
42
39
  # repository, and, when its opening takes the lock (not when it keeps it, after a compaction or a
43
40
  # /clear), receives the section « Les questions des circuits » (the greffon pushes the questions, the answer
@@ -143,12 +140,6 @@ fi
143
140
  while IFS= read -r crochet; do
144
141
  [ -n "$crochet" ] && missing+=("le crochet git $crochet du cadre")
145
142
  done < <(node "$ici/crochets.mjs" --absents "$root" 2>/dev/null)
146
- # The CI of the ticket branches (scripts/ci-des-branches.mjs): the queue enters a lot on main only
147
- # once the CI of `agent/<ticket>` judged it green, so a project none of whose workflows runs on a
148
- # push to `agent/**` lacks it. An agent's copy does not read it.
149
- if [ -z "$copie_agent" ] && [ -n "$(node "$ici/ci-des-branches.mjs" --absente "$root" 2>/dev/null)" ]; then
150
- missing+=("une CI qui se lance sur les branches de ticket agent/** (la file n'entre un lot sur main qu'une fois la CI de sa branche verte : \`npx grillhouse maj\` ajoute agent/** aux branches du push du flux de la CI, sinon ajoute-le à la main, \`branches: [main, 'agent/**']\`)")
151
- fi
152
143
  command -v bwrap >/dev/null || missing+=("bubblewrap (bwrap), l'enveloppe des agents : sudo apt install bubblewrap")
153
144
 
154
145
  # The key elements the skills read; each one still empty is proposed for a grill.
@@ -19,7 +19,7 @@
19
19
  // - Tagging creates the annotated tag `v<version>` on HEAD, once the release commit is made and
20
20
  // the working tree holds no change. Nothing is pushed: the owner validates the push, whose
21
21
  // command the script names; `.github/workflows/release.yml` then calls the CI on the tagged
22
- // commit (which plays nothing again when a branch agent/** already judged that commit) and, once
22
+ // commit (a call of the release always plays) and, once
23
23
  // it is green or skipped, checks the tag (`--verifier-etiquette`), publishes the package
24
24
  // on the npm registry (trusted publishing, no token stored) and the release on GitHub. The git
25
25
  // it runs is passed in (`etiqueter`'s `git`): the command runs git in the repository.