@sylad/cadence 1.19.0 → 1.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/dist/verify-gate.js +32 -10
- package/docs/deliver.md +1 -1
- package/docs/whats-new.md +3 -0
- package/package.json +1 -1
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
{
|
|
9
9
|
"name": "cadence",
|
|
10
10
|
"description": "Session start and close rituals driven by a versioned plan (raf), and deliveries proven by their effect. Needs the cadence CLI (npm i -g @sylad/cadence).",
|
|
11
|
-
"version": "1.19.
|
|
11
|
+
"version": "1.19.1",
|
|
12
12
|
"source": "./",
|
|
13
13
|
"author": {
|
|
14
14
|
"name": "Sylvain Ladoire"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cadence",
|
|
3
3
|
"description": "A repo-native working method: session start and close rituals driven by a versioned plan (raf), deliveries proven by their effect, and three reviewer agents (UX, code, QA).",
|
|
4
|
-
"version": "1.19.
|
|
4
|
+
"version": "1.19.1",
|
|
5
5
|
"author": { "name": "Sylvain Ladoire" },
|
|
6
6
|
"homepage": "https://github.com/Sylad/cadence",
|
|
7
7
|
"repository": "https://github.com/Sylad/cadence",
|
package/dist/verify-gate.js
CHANGED
|
@@ -63,12 +63,31 @@ function mainTreeObstacle(repo, sha) {
|
|
|
63
63
|
return `l'état de l'arbre principal est illisible (${gitFailure(e)})`;
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* Ce qui a changé dans l'arbre principal depuis le début d'une porte en place (L393) : HEAD n'est plus au sha et/ou `git status --porcelain` n'est plus vide ; null si rien n'a bougé.
|
|
68
|
+
* Relu à la fin de la porte, après toutes les étapes, y compris rouges.
|
|
69
|
+
*/
|
|
70
|
+
function mainTreeMoved(repo, sha) {
|
|
71
|
+
try {
|
|
72
|
+
const head = git(repo, 'rev-parse', 'HEAD');
|
|
73
|
+
const status = git(repo, 'status', '--porcelain');
|
|
74
|
+
const changes = [];
|
|
75
|
+
if (head !== sha)
|
|
76
|
+
changes.push(`HEAD est passé de ${sha.slice(0, 7)} à ${head.slice(0, 7)}`);
|
|
77
|
+
if (status)
|
|
78
|
+
changes.push(`git status n'est plus vide (${status.split('\n').length} entrée(s))`);
|
|
79
|
+
return changes.length ? changes.join(' ; ') : null;
|
|
80
|
+
}
|
|
81
|
+
catch (e) {
|
|
82
|
+
return `l'état de l'arbre principal est illisible (${gitFailure(e)})`;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
66
85
|
/**
|
|
67
86
|
* `cadence verify --gate` (L348) : la porte du projet (`orchestrate.build`, puis `orchestrate.test`, dans l'ordre de la vague : les tests lisent ce que le build produit)
|
|
68
87
|
* rejouée au `sha` (L389) dans l'arbre principal quand il est propre et à ce sha (les outils qui refusent un `node_modules` venu d'un autre arbre y tournent chez eux) ;
|
|
69
88
|
* sinon dans un worktree jetable, hors du dépôt, dont les dépendances non suivies sont copiées depuis le dépôt vivant (`orchestrate.worktreeDeps`,
|
|
70
89
|
* sinon les `node_modules` de tout niveau et le `.venv` ; les autres dossiers ignorés sont reliés, comme dans les worktrees de vague ; la copie est asynchrone pour que Ctrl-C la coupe). `verify.inPlace` impose l'un (`true`, refus si l'arbre n'est pas propre au sha) ou l'autre (`false`).
|
|
71
|
-
* La première ligne de la sortie dit où la porte a tourné ; en place, l'arbre
|
|
90
|
+
* La première ligne de la sortie dit où la porte a tourné ; en place, HEAD et `git status` sont relus après les étapes et, si l'arbre a bougé (HEAD avancé, status sale), la sortie dit ce qui a changé, que le verdict n'est pas celui du sha et sort en code 2, rouge ou vert ; la ligne « vert » / « rouge » n'est alors pas écrite. Les deux commandes sont rejouées même si la première est rouge : le compte rendu est entier.
|
|
72
91
|
* Chaque commande reçoit `CADENCE_TEST_WORKERS` comme dans la porte d'une vague (L350, L387) : la valeur de l'environnement de l'appelant si c'est un entier positif, sinon cœurs ÷ plafond de sessions (`CADENCE_MAX_SESSIONS`, 2 par défaut) ;
|
|
73
92
|
* sans elle le rejeu `--maxWorkers=$CADENCE_TEST_WORKERS` de `orchestrate.testReplay` sortirait en erreur et ne prouverait rien.
|
|
74
93
|
* La porte déjà jouée par le programme au même sha n'est pas rejouée (L397) : si l'état d'une vague (`ctx.launchDirs`) porte des contrôles enregistrés AU sha, sur un arbre identique, verts et couvrant chaque commande actuelle,
|
|
@@ -122,12 +141,14 @@ export async function verifyGate(ctx) {
|
|
|
122
141
|
killGroup(group.pgid);
|
|
123
142
|
});
|
|
124
143
|
try {
|
|
125
|
-
const code = await runSteps(steps, repo, ctx, group, env, short);
|
|
126
|
-
// Une vague intègre ses lots par fast-forward dans cet arbre : s'il a bougé pendant la porte, les commandes ont lu un mélange de commits.
|
|
127
|
-
const moved =
|
|
128
|
-
if (moved === null)
|
|
144
|
+
const { code, summary } = await runSteps(steps, repo, ctx, group, env, short);
|
|
145
|
+
// Une vague intègre ses lots par fast-forward dans cet arbre et y commite son plan : s'il a bougé pendant la porte, les commandes ont lu un mélange de commits.
|
|
146
|
+
const moved = mainTreeMoved(repo, sha);
|
|
147
|
+
if (moved === null) {
|
|
148
|
+
out(summary);
|
|
129
149
|
return code;
|
|
130
|
-
|
|
150
|
+
}
|
|
151
|
+
out(`verify --gate ${short} : verdict non probant — ${moved} pendant la porte (un lot a pu être intégré ou le plan d'une vague commité pendant qu'elle tournait, ou une commande a écrit hors des dossiers ignorés) ; les ✓/✗ ci-dessus ne sont pas ceux de ${short} ; la rejouer`);
|
|
131
152
|
return 2;
|
|
132
153
|
}
|
|
133
154
|
finally {
|
|
@@ -179,14 +200,16 @@ export async function verifyGate(ctx) {
|
|
|
179
200
|
out(replayReason);
|
|
180
201
|
if (missing.length)
|
|
181
202
|
out(`dépendances déclarées absentes de l'arbre principal, non copiées : ${missing.join(', ')}`);
|
|
182
|
-
|
|
203
|
+
const done = await runSteps(steps, dir, ctx, group, env, short);
|
|
204
|
+
out(done.summary);
|
|
205
|
+
return done.code;
|
|
183
206
|
}
|
|
184
207
|
finally {
|
|
185
208
|
forget();
|
|
186
209
|
cleanup();
|
|
187
210
|
}
|
|
188
211
|
}
|
|
189
|
-
/** Les étapes de la porte jouées dans `cwd` ; le
|
|
212
|
+
/** Les étapes de la porte jouées dans `cwd` ; le code de sortie (0 vert, 1 rouge) et la ligne de verdict, écrite par l'appelant une fois sûr qu'elle vaut pour le sha. */
|
|
190
213
|
async function runSteps(steps, cwd, ctx, group, env, short) {
|
|
191
214
|
const { config, out } = ctx;
|
|
192
215
|
let red = 0;
|
|
@@ -238,6 +261,5 @@ async function runSteps(steps, cwd, ctx, group, env, short) {
|
|
|
238
261
|
out(` | ${l}`);
|
|
239
262
|
}
|
|
240
263
|
}
|
|
241
|
-
|
|
242
|
-
return red === 0 ? 0 : 1;
|
|
264
|
+
return { code: red === 0 ? 0 : 1, summary: red === 0 ? `verify --gate ${short} : vert` : `verify --gate ${short} : rouge (${red} étape${red > 1 ? 's' : ''} sur ${steps.length})` };
|
|
243
265
|
}
|
package/docs/deliver.md
CHANGED
|
@@ -291,7 +291,7 @@ cadence verify --gate --sha 6b0d9aa --project app # from the parent folder, t
|
|
|
291
291
|
|
|
292
292
|
- the main tree is **clean and at the sha** (`git status --porcelain` empty, `HEAD` equal to the sha): the gate runs **there**, in the repository itself, with its own `node_modules` and its real paths (`verify --gate 6b0d9aa : porte jouée dans l'arbre principal /path/app (propre, au sha)`). A tool that refuses a `node_modules` linked from another tree (Astro: « Could not load …/node_modules/astro/… »), or a test that reads files by a path relative to the checkout, is red in a copy for reasons that have nothing to do with the sha; on 27-10 avatar-pandora and finance-tracker's ux-demo.spec were both green in the main tree and red in the copy. The commands may write their usual ignored outputs there (`dist`, caches);
|
|
293
293
|
- otherwise (uncommitted changes, untracked files, or another commit checked out: a wave's lots may be working in it): a throwaway worktree of the sha under the OS temporary folder (`cadence-verify-…`), removed whatever the result, where the **dependencies of the main tree are copied** (`node_modules` of every level and `.venv`; not linked: a copied `node_modules` is a real one for the tools that refuse a link; a `node_modules` that is itself a link is copied by its content; workspace links, relative, are copied as they are and point inside the copy; those that leave the repository, `file:../neighbour`, are redone towards their live target) and the other ignored folders (data, `.env`) are linked, never copied (on 28-10, jobmail's `data` weighed 14 GB, maritime's `docs/refdocs` 961 MB). The copy is asynchronous: Ctrl-C received during it is handled at once. The line names the worktree, why the main tree was not used, and the copied dependencies (`… porte jouée dans une copie jetable /tmp/cadence-verify-x (l'arbre principal a des modifications non validées ou des fichiers non suivis) ; dépendances copiées : node_modules`), always **first**: the notice of declared dependencies absent from the main tree (`orchestrate.worktreeDeps`) comes after it. The copy of a large `node_modules` takes time: this is the price of a gate that does not lie.
|
|
294
|
-
- **The main tree is read again at the end of an in-place gate.** A wave integrates its lots into it by fast-forward and commits the plan there, possibly while the gate runs
|
|
294
|
+
- **The main tree is read again at the end of an in-place gate (L389, L393).** A wave integrates its lots into it by fast-forward and commits the plan there, possibly while the gate runs. After the steps, `HEAD` and `git status --porcelain` are read again: if `HEAD` left the sha or the status is no longer empty, the output says what changed (`HEAD est passé de 6b0d9aa à 1c2d3e4`, `git status n'est plus vide (2 entrée(s))`), adds `verdict non probant … les ✓/✗ ci-dessus ne sont pas ceux de <sha>` and the exit code is 2 whatever the result, red included. The usual `vert` / `rouge` line is then **not written**: the verdict is not the sha's, replay it.
|
|
295
295
|
|
|
296
296
|
**A gate the wave already played is read, not replayed (L397).** A lot that turns ready has just been through the program's gate (`orchestrate.build`, then `orchestrate.test`, at the commit it integrates), and the wave keeps the result in its state (`.cadence/runs/<wave>/<lot>.json`, key `checks`: the commit, its git tree, each command and its code). Replaying the same build and suite on the same commit costs ~5 minutes and says nothing new (L390, 28-10). `cadence verify --gate` therefore looks in the current folder, the repository root and its parent for a wave state of this repository (most recent first) and **reads the verdict** when all of this holds:
|
|
297
297
|
|
package/docs/whats-new.md
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
## In two lines
|
|
6
6
|
|
|
7
|
+
- **1.19.1**: `cadence verify --gate` in the main tree reads `HEAD` and `git status` again after the steps, says what moved and prints no green or red verdict that is not the sha's.
|
|
7
8
|
- **1.19.0**: `raf archive` moves closed lots out of the plan file (565 KB → 5 KB, same output everywhere); live waves share one session cap; wave sessions skip the user's plugins.
|
|
8
9
|
- **1.18.0**: `cadence verify --gate` reuses the green gate of the wave instead of replaying it; `orchestrate.continue` keeps `--continue` from drawing a big lot; `raf check` and `raf now` run about 5 times faster.
|
|
9
10
|
- **1.17.1**: `cadence deliver --sha` during a wave commits the plan it wrote, nothing else; `verify --gate` no longer turns red for reasons of its throwaway copy and says where it ran; the test suite no longer commits into the repository.
|
|
@@ -43,6 +44,8 @@ Each is a paragraph in [docs/whats-new.md](whats-new.md) and a full section in [
|
|
|
43
44
|
|
|
44
45
|
The long form of « In two lines » above (the README no longer carries a « What's new » section since L326: it links here). The full history, with the date of each version, is in [CHANGELOG.md](../CHANGELOG.md).
|
|
45
46
|
|
|
47
|
+
**1.19.1**: a verdict of `cadence verify --gate` run in the main tree is always the verdict of the sha it names (L393, `docs/deliver.md`): after the steps, `HEAD` and `git status` are read again; if the tree moved during the gate (a lot integrated, the plan of a wave committed), the output says what moved, the ✓/✗ lines are said not to be those of the sha, no « vert » / « rouge » line is written and the exit code is 2.
|
|
48
|
+
|
|
46
49
|
**1.19.0**: a plan that only grows no longer weighs on every session. `raf archive [--before date] [--dry-run]` moves the `done` and `dropped` lots into `.cadence/archive/<year>.yaml` (L396, `docs/raf.md`): measured on the cadence plan, 565 KB → 5 KB, and `raf show|check|commits|now|gantt`, `cadence news`, `perf`, `session start`, `lead tour`, `deliver` and `orchestrate` print the same thing before and after (one transverse test); the archiving is lossless whatever fails, the command to commit plan and archive together is printed, a wave's plan commit takes the year files too, and the briefs tell the sessions never to read the archive. `raf todo <id>` reopens a closed lot, archived or not. All live waves now apply the same session cap, the lowest one declared, and the test gate is a visible step of a lot (L395, `docs/orchestrate.md`). Wave sessions start without the user's plugins (`--settings` with `enabledPlugins` false, L398): the first turn of an `implement` session went from 42,541 to 38,330 tokens.
|
|
47
50
|
|
|
48
51
|
**1.18.0**: a re-verification costs seconds instead of minutes, and a wave draws only the lots it can play. `cadence verify --gate` reuses the gate of the wave instead of replaying it (L397, `docs/deliver.md`, skill `lead`): when the state of a wave (`.cadence/runs/<wave>`, looked for in the current folder, the repository root and its parent) holds checks that the program ran at the requested sha, on an identical git tree, green and covering every current `orchestrate.build` / `orchestrate.test` command, the verdict is read from it, nothing runs (exit 0) and the first line says so (`verdict repris de la porte de la vague <vague> (lot …)`). A changed sha (integration, rebase), a different tree, a record without tree, a red or missing step, a changed command or no wave at all replays the gate as before, and the line after the one telling where it ran says why (`verdict rejoué : …`); the wave now records the tree of the checked commit next to its sha. `orchestrate.continue` in the `cadence.yaml` of a project (L390, `docs/orchestrate.md`) takes `maxEstimate` (days) and `exclude` (lot ids), so `cadence orchestrate --continue` no longer draws a big lot with no spec or sub-task (a lot whose title or note says « non tirable » is never drawn either); `--dry-run --continue` prints each project's setting and every ready lot it holds back, with the cause, and a lot given on the command line is still played. The briefs of the writing sessions (implement, fix, minors pass, librarian pass) name the exact `orchestrate.test` and `orchestrate.build` commands of the gate (L399, `docs/orchestrate.md`), so a session that played a narrower `npm run build` no longer announces a green lot that the gate sends back to a correction pass. `cadence verify --gate` in its throwaway copy copies only the dependencies (`node_modules` of every level and `.venv`), never every ignored folder (L392, `docs/deliver.md`); Ctrl-C received during the copy is handled, a `node_modules` that is itself a link is copied by its content, and the line telling where the gate ran is always the first of the output. Last, `raf check`, `raf now` and `cadence session start` read the files of all the commits of a lot in one `git log` call (L394): on 2,764 commits `raf check` goes from 16.5 s to 3.4 s and `raf now` from 14.7 s to 3.5 s, and `cadence lead tour --json` no longer exceeds the 20 s deadline of the HUD band, which showed an empty project list.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sylad/cadence",
|
|
3
|
-
"version": "1.19.
|
|
3
|
+
"version": "1.19.1",
|
|
4
4
|
"description": "A small, repo-native working method: a versioned plan linked to your commits, a changelog with screenshots, session rituals and deliveries proven by their effect.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Sylvain Ladoire",
|