@sylad/cadence 1.39.0 → 1.41.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 (56) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/README.md +3 -3
  4. package/agents/spec-writer.md +1 -0
  5. package/agents/ux-reviewer.md +2 -0
  6. package/dist/cli.js +49 -62
  7. package/dist/config-set.js +2 -0
  8. package/dist/config.js +8 -8
  9. package/dist/deliver-lots.js +37 -0
  10. package/dist/deliver.js +15 -39
  11. package/dist/docs-ok-file.js +25 -0
  12. package/dist/lot-lines.js +51 -0
  13. package/dist/memory-index.js +113 -0
  14. package/dist/orchestrate/command.js +8 -8
  15. package/dist/orchestrate/continue.js +4 -2
  16. package/dist/orchestrate/cycle.js +23 -29
  17. package/dist/orchestrate/deja-traitee.js +76 -0
  18. package/dist/orchestrate/integrate.js +7 -2
  19. package/dist/orchestrate/lot-budget.js +2 -2
  20. package/dist/orchestrate/maquette.js +3 -0
  21. package/dist/orchestrate/spec.js +51 -6
  22. package/dist/orchestrate/table.js +29 -11
  23. package/dist/plan-extras.js +118 -0
  24. package/dist/plan-read.js +144 -0
  25. package/dist/plan-states.js +119 -0
  26. package/dist/plan.js +91 -157
  27. package/dist/raf-close-checks.js +25 -0
  28. package/dist/raf-status.js +28 -0
  29. package/dist/session.js +8 -0
  30. package/dist/state.js +23 -0
  31. package/dist/verify.js +20 -3
  32. package/dist/yaml-keys.js +2 -0
  33. package/docs/concepts-livraison-dark.svg +32 -0
  34. package/docs/concepts-livraison-light.svg +32 -0
  35. package/docs/concepts-lot-dark.svg +52 -0
  36. package/docs/concepts-lot-light.svg +52 -0
  37. package/docs/concepts-vague-dark.svg +39 -0
  38. package/docs/concepts-vague-light.svg +39 -0
  39. package/docs/concepts-worktrees-dark.svg +45 -0
  40. package/docs/concepts-worktrees-light.svg +45 -0
  41. package/docs/concepts.md +159 -0
  42. package/docs/deliver.md +24 -2
  43. package/docs/fonctionnement.md +11 -5
  44. package/docs/lead.md +10 -6
  45. package/docs/orchestrate.md +22 -5
  46. package/docs/overview.md +1 -1
  47. package/docs/perf.md +1 -0
  48. package/docs/qualite.md +13 -3
  49. package/docs/raf.md +42 -5
  50. package/docs/session.md +32 -0
  51. package/docs/spec.md +5 -2
  52. package/docs/whats-new.md +6 -0
  53. package/package.json +10 -1
  54. package/skills/lead/SKILL.md +6 -0
  55. package/skills/session-close/SKILL.md +6 -0
  56. package/templates/orchestrate/spec.md +2 -2
@@ -0,0 +1,52 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1100 300" width="1100" height="300" role="img" font-family="-apple-system,BlinkMacSystemFont,'Segoe UI',Helvetica,Arial,sans-serif" font-size="13" fill="#1f2328">
2
+ <title>Journey of a lot</title>
3
+ <desc>A lot goes through spec, code, review, correction when the review is not compliant, UX if the lot is visible, then ready; below each step, who does it.</desc>
4
+ <defs><marker id="arr" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,0 L10,5 L0,10 z" fill="#57606a"/></marker></defs>
5
+ <rect width="1100" height="300" fill="#ffffff"/>
6
+ <text x="20" y="26" text-anchor="start" font-size="11.5" font-weight="600" fill="#57606a">STEP</text>
7
+ <text x="20" y="168" text-anchor="start" font-size="11.5" font-weight="600" fill="#57606a">WHO</text>
8
+ <rect x="20" y="40" width="160" height="60" rx="6" fill="#ffffff" stroke="#57606a" stroke-width="1.5" stroke-dasharray="6 4"/>
9
+ <text x="100" y="66" text-anchor="middle" font-weight="600" font-size="13.5" fill="#1f2328">spec</text>
10
+ <text x="100" y="83" text-anchor="middle" font-size="11.5" fill="#57606a">if screen or spec: true</text>
11
+ <rect x="200" y="40" width="160" height="60" rx="6" fill="#ffffff" stroke="#57606a" stroke-width="1.5"/>
12
+ <text x="280" y="66" text-anchor="middle" font-weight="600" font-size="13.5" fill="#1f2328">code</text>
13
+ <text x="280" y="83" text-anchor="middle" font-size="11.5" fill="#57606a">test first</text>
14
+ <rect x="380" y="40" width="160" height="60" rx="6" fill="#ffffff" stroke="#57606a" stroke-width="1.5"/>
15
+ <text x="460" y="66" text-anchor="middle" font-weight="600" font-size="13.5" fill="#1f2328">review</text>
16
+ <text x="460" y="83" text-anchor="middle" font-size="11.5" fill="#57606a">code</text>
17
+ <rect x="560" y="40" width="160" height="60" rx="6" fill="#ffffff" stroke="#57606a" stroke-width="1.5" stroke-dasharray="6 4"/>
18
+ <text x="640" y="66" text-anchor="middle" font-weight="600" font-size="13.5" fill="#1f2328">correction</text>
19
+ <text x="640" y="83" text-anchor="middle" font-size="11.5" fill="#57606a">if not compliant</text>
20
+ <rect x="740" y="40" width="160" height="60" rx="6" fill="#ffffff" stroke="#57606a" stroke-width="1.5" stroke-dasharray="6 4"/>
21
+ <text x="820" y="66" text-anchor="middle" font-weight="600" font-size="13.5" fill="#1f2328">UX</text>
22
+ <text x="820" y="83" text-anchor="middle" font-size="11.5" fill="#57606a">if visible</text>
23
+ <rect x="920" y="40" width="160" height="60" rx="6" fill="#ddf4ff" stroke="#0969da" stroke-width="2"/>
24
+ <text x="1000" y="66" text-anchor="middle" font-weight="600" font-size="13.5" fill="#1f2328">ready</text>
25
+ <text x="1000" y="83" text-anchor="middle" font-size="11.5" fill="#57606a">integrated (worktree mode)</text>
26
+ <polyline points="180,70 198,70" fill="none" stroke="#57606a" stroke-width="1.5" marker-end="url(#arr)"/>
27
+ <polyline points="360,70 378,70" fill="none" stroke="#57606a" stroke-width="1.5" marker-end="url(#arr)"/>
28
+ <polyline points="540,70 558,70" fill="none" stroke="#57606a" stroke-width="1.5" marker-end="url(#arr)"/>
29
+ <polyline points="720,70 738,70" fill="none" stroke="#57606a" stroke-width="1.5" marker-end="url(#arr)"/>
30
+ <polyline points="900,70 918,70" fill="none" stroke="#57606a" stroke-width="1.5" marker-end="url(#arr)"/>
31
+ <polyline points="640,40 640,22 460,22 460,38" fill="none" stroke="#57606a" stroke-width="1.5" stroke-dasharray="5 3" marker-end="url(#arr)"/>
32
+ <text x="550" y="16" text-anchor="middle" font-size="11.5" fill="#57606a">back to the review after each correction</text>
33
+ <rect x="20" y="180" width="160" height="56" rx="6" fill="#ffffff" stroke="#57606a" stroke-width="1"/>
34
+ <text x="100" y="204" text-anchor="middle" font-size="12.5" font-weight="600" fill="#1f2328">spec-writer</text>
35
+ <text x="100" y="222" text-anchor="middle" font-size="11.5" fill="#57606a">then reviewer</text>
36
+ <rect x="200" y="180" width="160" height="56" rx="6" fill="#ffffff" stroke="#57606a" stroke-width="1"/>
37
+ <text x="280" y="204" text-anchor="middle" font-size="12.5" font-weight="600" fill="#1f2328">fresh session</text>
38
+ <text x="280" y="222" text-anchor="middle" font-size="11.5" fill="#57606a">of the program</text>
39
+ <rect x="380" y="180" width="160" height="56" rx="6" fill="#ffffff" stroke="#57606a" stroke-width="1"/>
40
+ <text x="460" y="204" text-anchor="middle" font-size="12.5" font-weight="600" fill="#1f2328">code-reviewer</text>
41
+ <text x="460" y="222" text-anchor="middle" font-size="11.5" fill="#57606a">agent</text>
42
+ <rect x="560" y="180" width="160" height="56" rx="6" fill="#ffffff" stroke="#57606a" stroke-width="1"/>
43
+ <text x="640" y="204" text-anchor="middle" font-size="12.5" font-weight="600" fill="#1f2328">fresh session</text>
44
+ <text x="640" y="222" text-anchor="middle" font-size="11.5" fill="#57606a">2 passes, 3 if it converges</text>
45
+ <rect x="740" y="180" width="160" height="56" rx="6" fill="#ffffff" stroke="#57606a" stroke-width="1"/>
46
+ <text x="820" y="204" text-anchor="middle" font-size="12.5" font-weight="600" fill="#1f2328">ux-reviewer</text>
47
+ <text x="820" y="222" text-anchor="middle" font-size="11.5" fill="#57606a">then the human</text>
48
+ <rect x="920" y="180" width="160" height="56" rx="6" fill="#ffffff" stroke="#57606a" stroke-width="1"/>
49
+ <text x="1000" y="204" text-anchor="middle" font-size="12.5" font-weight="600" fill="#1f2328">the lead</text>
50
+ <text x="1000" y="222" text-anchor="middle" font-size="11.5" fill="#57606a">re-checks, raf done</text>
51
+ <text x="550" y="270" text-anchor="middle" font-size="11.5" fill="#57606a">Dashed: a conditional step. The program chains the sessions; the verdicts of the review and of the UX pass are recorded in the plan.</text>
52
+ </svg>
@@ -0,0 +1,39 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1100 390" width="1100" height="390" role="img" font-family="-apple-system,BlinkMacSystemFont,'Segoe UI',Helvetica,Arial,sans-serif" font-size="13" fill="#e6edf3">
2
+ <title>Wave and slots</title>
3
+ <desc>A wave plays its lots in fresh sessions under a cap of slots; a lot waits in the queue until a slot is free, and a session the lead started by hand is held and takes a slot.</desc>
4
+ <defs><marker id="arr" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,0 L10,5 L0,10 z" fill="#8b949e"/></marker></defs>
5
+ <rect width="1100" height="390" fill="#0d1117"/>
6
+ <rect x="20" y="44" width="170" height="240" rx="6" fill="#0d1117" stroke="#8b949e" stroke-width="1.5"/>
7
+ <text x="105" y="160" text-anchor="middle" font-weight="600" font-size="13.5" fill="#e6edf3">Queue</text>
8
+ <text x="105" y="177" text-anchor="middle" font-size="11.5" fill="#8b949e">lots waiting, in the</text>
9
+ <text x="105" y="190" text-anchor="middle" font-size="11.5" fill="#8b949e">priority order</text>
10
+ <text x="105" y="222" text-anchor="middle" font-size="11.5" fill="#8b949e">a lot that depends on</text>
11
+ <text x="105" y="238" text-anchor="middle" font-size="11.5" fill="#8b949e">another waits for it</text>
12
+ <text x="230" y="26" text-anchor="start" font-size="11.5" font-weight="600" fill="#e6edf3">SLOTS: as many sessions at once as the cap (CADENCE_MAX_SESSIONS)</text>
13
+ <rect x="270" y="44" width="380" height="52" rx="6" fill="#0d1117" stroke="#8b949e" stroke-width="1.5"/>
14
+ <text x="460" y="66" text-anchor="middle" font-weight="600" font-size="13.5" fill="#e6edf3">slot 1 · L1</text>
15
+ <text x="460" y="83" text-anchor="middle" font-size="11.5" fill="#8b949e">implementation: a session running</text>
16
+ <polyline points="190,164 268,70" fill="none" stroke="#8b949e" stroke-width="1.5" marker-end="url(#arr)"/>
17
+ <rect x="270" y="108" width="380" height="52" rx="6" fill="#0d1117" stroke="#8b949e" stroke-width="1.5"/>
18
+ <text x="460" y="130" text-anchor="middle" font-weight="600" font-size="13.5" fill="#e6edf3">slot 2 · L2</text>
19
+ <text x="460" y="147" text-anchor="middle" font-size="11.5" fill="#8b949e">review: a session running</text>
20
+ <polyline points="190,164 268,134" fill="none" stroke="#8b949e" stroke-width="1.5" marker-end="url(#arr)"/>
21
+ <rect x="270" y="172" width="380" height="52" rx="6" fill="#0c2d6b" stroke="#58a6ff" stroke-width="2" stroke-dasharray="6 4"/>
22
+ <text x="460" y="194" text-anchor="middle" font-weight="600" font-size="13.5" fill="#e6edf3">slot 3 · hold</text>
23
+ <text x="460" y="211" text-anchor="middle" font-size="11.5" fill="#8b949e">a fix started by hand by the lead</text>
24
+ <polyline points="190,164 268,198" fill="none" stroke="#8b949e" stroke-width="1.5" marker-end="url(#arr)"/>
25
+ <rect x="270" y="236" width="380" height="52" rx="6" fill="#0d1117" stroke="#8b949e" stroke-width="1.5" stroke-dasharray="6 4"/>
26
+ <text x="460" y="258" text-anchor="middle" font-weight="600" font-size="13.5" fill="#e6edf3">slot 4 · free</text>
27
+ <text x="460" y="275" text-anchor="middle" font-size="11.5" fill="#8b949e">with --continue, the next ready lot is drawn</text>
28
+ <polyline points="190,164 268,262" fill="none" stroke="#8b949e" stroke-width="1.5" marker-end="url(#arr)"/>
29
+ <rect x="740" y="44" width="200" height="80" rx="6" fill="#0d1117" stroke="#8b949e" stroke-width="1.5"/>
30
+ <text x="840" y="80" text-anchor="middle" font-weight="600" font-size="13.5" fill="#e6edf3">Table of the wave</text>
31
+ <text x="840" y="97" text-anchor="middle" font-size="11.5" fill="#8b949e">ready · handed back · questions</text>
32
+ <polyline points="650,70 738,84" fill="none" stroke="#8b949e" stroke-width="1.5" marker-end="url(#arr)"/>
33
+ <rect x="740" y="170" width="200" height="80" rx="6" fill="#0c2d6b" stroke="#58a6ff" stroke-width="2"/>
34
+ <text x="840" y="206" text-anchor="middle" font-weight="600" font-size="13.5" fill="#e6edf3">The lead</text>
35
+ <text x="840" y="223" text-anchor="middle" font-size="11.5" fill="#8b949e">relays, re-checks, delivers</text>
36
+ <polyline points="840,124 840,168" fill="none" stroke="#8b949e" stroke-width="1.5" marker-end="url(#arr)"/>
37
+ <text x="550" y="330" text-anchor="middle" font-size="11.5" fill="#8b949e">A hold (cadence lead hold) counts against the cap like a running session: the wave waits for it instead of overtaking it.</text>
38
+ <text x="550" y="352" text-anchor="middle" font-size="11.5" fill="#8b949e">A freed slot goes to the wave queue; with --continue it also draws the next ready lot of the plan.</text>
39
+ </svg>
@@ -0,0 +1,39 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1100 390" width="1100" height="390" role="img" font-family="-apple-system,BlinkMacSystemFont,'Segoe UI',Helvetica,Arial,sans-serif" font-size="13" fill="#1f2328">
2
+ <title>Wave and slots</title>
3
+ <desc>A wave plays its lots in fresh sessions under a cap of slots; a lot waits in the queue until a slot is free, and a session the lead started by hand is held and takes a slot.</desc>
4
+ <defs><marker id="arr" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,0 L10,5 L0,10 z" fill="#57606a"/></marker></defs>
5
+ <rect width="1100" height="390" fill="#ffffff"/>
6
+ <rect x="20" y="44" width="170" height="240" rx="6" fill="#ffffff" stroke="#57606a" stroke-width="1.5"/>
7
+ <text x="105" y="160" text-anchor="middle" font-weight="600" font-size="13.5" fill="#1f2328">Queue</text>
8
+ <text x="105" y="177" text-anchor="middle" font-size="11.5" fill="#57606a">lots waiting, in the</text>
9
+ <text x="105" y="190" text-anchor="middle" font-size="11.5" fill="#57606a">priority order</text>
10
+ <text x="105" y="222" text-anchor="middle" font-size="11.5" fill="#57606a">a lot that depends on</text>
11
+ <text x="105" y="238" text-anchor="middle" font-size="11.5" fill="#57606a">another waits for it</text>
12
+ <text x="230" y="26" text-anchor="start" font-size="11.5" font-weight="600" fill="#1f2328">SLOTS: as many sessions at once as the cap (CADENCE_MAX_SESSIONS)</text>
13
+ <rect x="270" y="44" width="380" height="52" rx="6" fill="#ffffff" stroke="#57606a" stroke-width="1.5"/>
14
+ <text x="460" y="66" text-anchor="middle" font-weight="600" font-size="13.5" fill="#1f2328">slot 1 · L1</text>
15
+ <text x="460" y="83" text-anchor="middle" font-size="11.5" fill="#57606a">implementation: a session running</text>
16
+ <polyline points="190,164 268,70" fill="none" stroke="#57606a" stroke-width="1.5" marker-end="url(#arr)"/>
17
+ <rect x="270" y="108" width="380" height="52" rx="6" fill="#ffffff" stroke="#57606a" stroke-width="1.5"/>
18
+ <text x="460" y="130" text-anchor="middle" font-weight="600" font-size="13.5" fill="#1f2328">slot 2 · L2</text>
19
+ <text x="460" y="147" text-anchor="middle" font-size="11.5" fill="#57606a">review: a session running</text>
20
+ <polyline points="190,164 268,134" fill="none" stroke="#57606a" stroke-width="1.5" marker-end="url(#arr)"/>
21
+ <rect x="270" y="172" width="380" height="52" rx="6" fill="#ddf4ff" stroke="#0969da" stroke-width="2" stroke-dasharray="6 4"/>
22
+ <text x="460" y="194" text-anchor="middle" font-weight="600" font-size="13.5" fill="#1f2328">slot 3 · hold</text>
23
+ <text x="460" y="211" text-anchor="middle" font-size="11.5" fill="#57606a">a fix started by hand by the lead</text>
24
+ <polyline points="190,164 268,198" fill="none" stroke="#57606a" stroke-width="1.5" marker-end="url(#arr)"/>
25
+ <rect x="270" y="236" width="380" height="52" rx="6" fill="#ffffff" stroke="#57606a" stroke-width="1.5" stroke-dasharray="6 4"/>
26
+ <text x="460" y="258" text-anchor="middle" font-weight="600" font-size="13.5" fill="#1f2328">slot 4 · free</text>
27
+ <text x="460" y="275" text-anchor="middle" font-size="11.5" fill="#57606a">with --continue, the next ready lot is drawn</text>
28
+ <polyline points="190,164 268,262" fill="none" stroke="#57606a" stroke-width="1.5" marker-end="url(#arr)"/>
29
+ <rect x="740" y="44" width="200" height="80" rx="6" fill="#ffffff" stroke="#57606a" stroke-width="1.5"/>
30
+ <text x="840" y="80" text-anchor="middle" font-weight="600" font-size="13.5" fill="#1f2328">Table of the wave</text>
31
+ <text x="840" y="97" text-anchor="middle" font-size="11.5" fill="#57606a">ready · handed back · questions</text>
32
+ <polyline points="650,70 738,84" fill="none" stroke="#57606a" stroke-width="1.5" marker-end="url(#arr)"/>
33
+ <rect x="740" y="170" width="200" height="80" rx="6" fill="#ddf4ff" stroke="#0969da" stroke-width="2"/>
34
+ <text x="840" y="206" text-anchor="middle" font-weight="600" font-size="13.5" fill="#1f2328">The lead</text>
35
+ <text x="840" y="223" text-anchor="middle" font-size="11.5" fill="#57606a">relays, re-checks, delivers</text>
36
+ <polyline points="840,124 840,168" fill="none" stroke="#57606a" stroke-width="1.5" marker-end="url(#arr)"/>
37
+ <text x="550" y="330" text-anchor="middle" font-size="11.5" fill="#57606a">A hold (cadence lead hold) counts against the cap like a running session: the wave waits for it instead of overtaking it.</text>
38
+ <text x="550" y="352" text-anchor="middle" font-size="11.5" fill="#57606a">A freed slot goes to the wave queue; with --continue it also draws the next ready lot of the plan.</text>
39
+ </svg>
@@ -0,0 +1,45 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1100 330" width="1100" height="330" role="img" font-family="-apple-system,BlinkMacSystemFont,'Segoe UI',Helvetica,Arial,sans-serif" font-size="13" fill="#e6edf3">
2
+ <title>Worktrees to main</title>
3
+ <desc>Each lot works on its own branch in its own worktree; at the end of its cycle it is rebased onto the tip of main, its checks are replayed, and it is fast-forwarded into main one lot at a time under a lock.</desc>
4
+ <defs><marker id="arr" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,0 L10,5 L0,10 z" fill="#8b949e"/></marker></defs>
5
+ <rect width="1100" height="330" fill="#0d1117"/>
6
+ <rect x="20" y="30" width="200" height="56" rx="6" fill="#0d1117" stroke="#8b949e" stroke-width="1.5"/>
7
+ <text x="120" y="54" text-anchor="middle" font-weight="600" font-size="13.5" fill="#e6edf3">worktree L1</text>
8
+ <text x="120" y="71" text-anchor="middle" font-size="11.5" fill="#8b949e">cadence/&lt;wave&gt;/&lt;project&gt;--L1</text>
9
+ <rect x="280" y="30" width="180" height="56" rx="6" fill="#0d1117" stroke="#8b949e" stroke-width="1.5"/>
10
+ <text x="370" y="54" text-anchor="middle" font-weight="600" font-size="13.5" fill="#e6edf3">cycle</text>
11
+ <text x="370" y="71" text-anchor="middle" font-size="11.5" fill="#8b949e">code · review · UX</text>
12
+ <polyline points="220,58 278,58" fill="none" stroke="#8b949e" stroke-width="1.5" marker-end="url(#arr)"/>
13
+ <polyline points="460,58 518,58" fill="none" stroke="#8b949e" stroke-width="1.5" marker-end="url(#arr)"/>
14
+ <rect x="20" y="110" width="200" height="56" rx="6" fill="#0d1117" stroke="#8b949e" stroke-width="1.5"/>
15
+ <text x="120" y="134" text-anchor="middle" font-weight="600" font-size="13.5" fill="#e6edf3">worktree L2</text>
16
+ <text x="120" y="151" text-anchor="middle" font-size="11.5" fill="#8b949e">cadence/&lt;wave&gt;/&lt;project&gt;--L2</text>
17
+ <rect x="280" y="110" width="180" height="56" rx="6" fill="#0d1117" stroke="#8b949e" stroke-width="1.5"/>
18
+ <text x="370" y="134" text-anchor="middle" font-weight="600" font-size="13.5" fill="#e6edf3">cycle</text>
19
+ <text x="370" y="151" text-anchor="middle" font-size="11.5" fill="#8b949e">code · review · UX</text>
20
+ <polyline points="220,138 278,138" fill="none" stroke="#8b949e" stroke-width="1.5" marker-end="url(#arr)"/>
21
+ <polyline points="460,138 518,138" fill="none" stroke="#8b949e" stroke-width="1.5" marker-end="url(#arr)"/>
22
+ <rect x="20" y="190" width="200" height="56" rx="6" fill="#0d1117" stroke="#8b949e" stroke-width="1.5"/>
23
+ <text x="120" y="214" text-anchor="middle" font-weight="600" font-size="13.5" fill="#e6edf3">worktree L3</text>
24
+ <text x="120" y="231" text-anchor="middle" font-size="11.5" fill="#8b949e">cadence/&lt;wave&gt;/&lt;project&gt;--L3</text>
25
+ <rect x="280" y="190" width="180" height="56" rx="6" fill="#0d1117" stroke="#8b949e" stroke-width="1.5"/>
26
+ <text x="370" y="214" text-anchor="middle" font-weight="600" font-size="13.5" fill="#e6edf3">cycle</text>
27
+ <text x="370" y="231" text-anchor="middle" font-size="11.5" fill="#8b949e">code · review · UX</text>
28
+ <polyline points="220,218 278,218" fill="none" stroke="#8b949e" stroke-width="1.5" marker-end="url(#arr)"/>
29
+ <polyline points="460,218 518,218" fill="none" stroke="#8b949e" stroke-width="1.5" marker-end="url(#arr)"/>
30
+ <rect x="520" y="30" width="240" height="216" rx="6" fill="#0d1117" stroke="#8b949e" stroke-width="1.5"/>
31
+ <text x="640" y="142" text-anchor="middle" font-weight="600" font-size="13.5" fill="#e6edf3"></text>
32
+ <text x="640" y="56" text-anchor="middle" font-size="13.5" font-weight="600" fill="#e6edf3">Integration</text>
33
+ <text x="640" y="120" text-anchor="middle" font-size="11.5" fill="#e6edf3">one lot at a time (lock)</text>
34
+ <text x="640" y="142" text-anchor="middle" font-size="11.5" fill="#8b949e">1. rebase onto the tip of main</text>
35
+ <text x="640" y="160" text-anchor="middle" font-size="11.5" fill="#8b949e">2. replay the checks</text>
36
+ <text x="640" y="178" text-anchor="middle" font-size="11.5" fill="#8b949e">3. fast-forward main</text>
37
+ <text x="640" y="200" text-anchor="middle" font-size="11.5" fill="#8b949e">main moved? replay, twice at most</text>
38
+ <polyline points="760,138 858,138" fill="none" stroke="#8b949e" stroke-width="1.5" marker-end="url(#arr)"/>
39
+ <rect x="860" y="100" width="220" height="76" rx="6" fill="#0c2d6b" stroke="#58a6ff" stroke-width="2"/>
40
+ <text x="970" y="134" text-anchor="middle" font-weight="600" font-size="13.5" fill="#e6edf3">main</text>
41
+ <text x="970" y="151" text-anchor="middle" font-size="11.5" fill="#8b949e">linear history, then ready</text>
42
+ <text x="970" y="196" text-anchor="middle" font-size="11.5" fill="#8b949e">the plan is written here, by the program</text>
43
+ <text x="550" y="280" text-anchor="middle" font-size="11.5" fill="#8b949e">orchestrate.worktrees: true lets independent lots of one repository play at the same time.</text>
44
+ <text x="550" y="300" text-anchor="middle" font-size="11.5" fill="#8b949e">Without it, lots play one after the other in the repository itself.</text>
45
+ </svg>
@@ -0,0 +1,45 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1100 330" width="1100" height="330" role="img" font-family="-apple-system,BlinkMacSystemFont,'Segoe UI',Helvetica,Arial,sans-serif" font-size="13" fill="#1f2328">
2
+ <title>Worktrees to main</title>
3
+ <desc>Each lot works on its own branch in its own worktree; at the end of its cycle it is rebased onto the tip of main, its checks are replayed, and it is fast-forwarded into main one lot at a time under a lock.</desc>
4
+ <defs><marker id="arr" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,0 L10,5 L0,10 z" fill="#57606a"/></marker></defs>
5
+ <rect width="1100" height="330" fill="#ffffff"/>
6
+ <rect x="20" y="30" width="200" height="56" rx="6" fill="#ffffff" stroke="#57606a" stroke-width="1.5"/>
7
+ <text x="120" y="54" text-anchor="middle" font-weight="600" font-size="13.5" fill="#1f2328">worktree L1</text>
8
+ <text x="120" y="71" text-anchor="middle" font-size="11.5" fill="#57606a">cadence/&lt;wave&gt;/&lt;project&gt;--L1</text>
9
+ <rect x="280" y="30" width="180" height="56" rx="6" fill="#ffffff" stroke="#57606a" stroke-width="1.5"/>
10
+ <text x="370" y="54" text-anchor="middle" font-weight="600" font-size="13.5" fill="#1f2328">cycle</text>
11
+ <text x="370" y="71" text-anchor="middle" font-size="11.5" fill="#57606a">code · review · UX</text>
12
+ <polyline points="220,58 278,58" fill="none" stroke="#57606a" stroke-width="1.5" marker-end="url(#arr)"/>
13
+ <polyline points="460,58 518,58" fill="none" stroke="#57606a" stroke-width="1.5" marker-end="url(#arr)"/>
14
+ <rect x="20" y="110" width="200" height="56" rx="6" fill="#ffffff" stroke="#57606a" stroke-width="1.5"/>
15
+ <text x="120" y="134" text-anchor="middle" font-weight="600" font-size="13.5" fill="#1f2328">worktree L2</text>
16
+ <text x="120" y="151" text-anchor="middle" font-size="11.5" fill="#57606a">cadence/&lt;wave&gt;/&lt;project&gt;--L2</text>
17
+ <rect x="280" y="110" width="180" height="56" rx="6" fill="#ffffff" stroke="#57606a" stroke-width="1.5"/>
18
+ <text x="370" y="134" text-anchor="middle" font-weight="600" font-size="13.5" fill="#1f2328">cycle</text>
19
+ <text x="370" y="151" text-anchor="middle" font-size="11.5" fill="#57606a">code · review · UX</text>
20
+ <polyline points="220,138 278,138" fill="none" stroke="#57606a" stroke-width="1.5" marker-end="url(#arr)"/>
21
+ <polyline points="460,138 518,138" fill="none" stroke="#57606a" stroke-width="1.5" marker-end="url(#arr)"/>
22
+ <rect x="20" y="190" width="200" height="56" rx="6" fill="#ffffff" stroke="#57606a" stroke-width="1.5"/>
23
+ <text x="120" y="214" text-anchor="middle" font-weight="600" font-size="13.5" fill="#1f2328">worktree L3</text>
24
+ <text x="120" y="231" text-anchor="middle" font-size="11.5" fill="#57606a">cadence/&lt;wave&gt;/&lt;project&gt;--L3</text>
25
+ <rect x="280" y="190" width="180" height="56" rx="6" fill="#ffffff" stroke="#57606a" stroke-width="1.5"/>
26
+ <text x="370" y="214" text-anchor="middle" font-weight="600" font-size="13.5" fill="#1f2328">cycle</text>
27
+ <text x="370" y="231" text-anchor="middle" font-size="11.5" fill="#57606a">code · review · UX</text>
28
+ <polyline points="220,218 278,218" fill="none" stroke="#57606a" stroke-width="1.5" marker-end="url(#arr)"/>
29
+ <polyline points="460,218 518,218" fill="none" stroke="#57606a" stroke-width="1.5" marker-end="url(#arr)"/>
30
+ <rect x="520" y="30" width="240" height="216" rx="6" fill="#ffffff" stroke="#57606a" stroke-width="1.5"/>
31
+ <text x="640" y="142" text-anchor="middle" font-weight="600" font-size="13.5" fill="#1f2328"></text>
32
+ <text x="640" y="56" text-anchor="middle" font-size="13.5" font-weight="600" fill="#1f2328">Integration</text>
33
+ <text x="640" y="120" text-anchor="middle" font-size="11.5" fill="#1f2328">one lot at a time (lock)</text>
34
+ <text x="640" y="142" text-anchor="middle" font-size="11.5" fill="#57606a">1. rebase onto the tip of main</text>
35
+ <text x="640" y="160" text-anchor="middle" font-size="11.5" fill="#57606a">2. replay the checks</text>
36
+ <text x="640" y="178" text-anchor="middle" font-size="11.5" fill="#57606a">3. fast-forward main</text>
37
+ <text x="640" y="200" text-anchor="middle" font-size="11.5" fill="#57606a">main moved? replay, twice at most</text>
38
+ <polyline points="760,138 858,138" fill="none" stroke="#57606a" stroke-width="1.5" marker-end="url(#arr)"/>
39
+ <rect x="860" y="100" width="220" height="76" rx="6" fill="#ddf4ff" stroke="#0969da" stroke-width="2"/>
40
+ <text x="970" y="134" text-anchor="middle" font-weight="600" font-size="13.5" fill="#1f2328">main</text>
41
+ <text x="970" y="151" text-anchor="middle" font-size="11.5" fill="#57606a">linear history, then ready</text>
42
+ <text x="970" y="196" text-anchor="middle" font-size="11.5" fill="#57606a">the plan is written here, by the program</text>
43
+ <text x="550" y="280" text-anchor="middle" font-size="11.5" fill="#57606a">orchestrate.worktrees: true lets independent lots of one repository play at the same time.</text>
44
+ <text x="550" y="300" text-anchor="middle" font-size="11.5" fill="#57606a">Without it, lots play one after the other in the repository itself.</text>
45
+ </svg>
@@ -0,0 +1,159 @@
1
+ [← cadence](../README.md)
2
+
3
+ # The notions of cadence, for a human
4
+
5
+ cadence has become a rich tool, and its vocabulary comes faster than its pages. This one explains each notion in a few sentences,
6
+ **in the order you meet them**, with four figures; the technical detail stays in the pages it links, and the
7
+ [glossary](#glossary) at the end is the one-line version. You do not need to know cadence to read it: the journey of a lot
8
+ ([figure 1](#the-steps-of-a-lot)) is the five minutes to keep if you keep only one thing.
9
+
10
+ ## Plan and lot
11
+
12
+ The **plan** is a file in your repository (`.cadence/raf.yaml`): the list of what is left to do and what was done.
13
+ Each item is a **lot**: a piece of work small enough to be finished in a day or two, with an identifier (`L12`), a title, an
14
+ estimate and a status (`todo`, `doing`, `done`, or `dropped`). A commit that belongs to a lot cites it in its subject:
15
+ `feat(L12): …`. That link is the whole idea: from any commit you know what it was for, from any lot you know its commits.
16
+ The `raf` command reads and writes the plan; `raf check` lists the commits that cite no lot. Detail: [raf.md](raf.md).
17
+
18
+ ## Verdicts
19
+
20
+ A lot is not finished when its code is written, but when two independent readers said so, and the plan keeps their word:
21
+ the **review verdict** (`raf review`) says the code is compliant, the **UX verdict** (`raf ux`) says the screen is
22
+ usable, for a lot that shows one (a `visible` lot). A verdict is recorded by the program (the review) or by the lead (the UX verdict, on the human's word), not by
23
+ the session that wrote the code. `raf done` is refused while a sub-task is open. Detail: [raf.md](raf.md), [news.md](news.md).
24
+
25
+ ## Session and wave
26
+
27
+ A **session** is one fresh run of Claude Code with a brief and a single job (write the spec, write the code, review, fix). It
28
+ remembers nothing of the previous one: what it needs is in the brief and in the repository. A **wave** is a run of
29
+ `cadence orchestrate` over several lots: the program (not a model) starts the sessions, chains the steps of each lot, runs
30
+ the tests, and prints a final table with the lots ready and the lots handed back. A session cannot ask you anything: when it is
31
+ stuck it stops and reports, and the question comes back to you through the lead. Detail: [orchestrate.md](orchestrate.md).
32
+
33
+ ## The steps of a lot
34
+
35
+ <picture>
36
+ <source media="(prefers-color-scheme: dark)" srcset="concepts-lot-dark.svg">
37
+ <img alt="A lot goes through spec, code, review, correction, UX and ready; under each step, who does it: spec-writer, a fresh session, the code-reviewer, a fresh session, the ux-reviewer, the lead" src="concepts-lot-light.svg">
38
+ </picture>
39
+
40
+ Inside a wave, a lot goes through these steps, each in a fresh session. Dashed boxes are conditional.
41
+
42
+ | Step | What happens | Who |
43
+ |---|---|---|
44
+ | **spec** | For a lot that creates a screen (`screen: page`) or has a behaviour to pin down (`spec: true`): a mockup and a **sheet** (fields, states, numbered rules); reviewed before any code, and the acceptance tests are written from it, committed red and locked | the `spec-writer` agent, reviewed by the `ux-reviewer` (mockup) or the `code-reviewer` (sheet); then the `acceptance-writer` agent, a separate session, writes the tests; the program locks them |
45
+ | **code** | Test first, then the code, commits that cite the lot; the lot's own tests must pass | a fresh session of the program |
46
+ | **review** | Reads the diff against the lot (and the sheet, rule by rule) and returns findings: blocking, major, minor | the `code-reviewer` agent; the program records `raf review` when it is compliant |
47
+ | **correction** | Only if the review is not compliant: a new session fixes the findings, then a new review. Two passes at most, three when the findings converge; then the lot is **handed back** | a fresh session; the program decides how many |
48
+ | **UX** | For a visible lot: the screen is opened in a real browser, in each state, with captures at 1440 and 390 px | the `ux-reviewer` agent for the report; the verdict is **the human's**, or the lead's when the parent folder says `lead.ux: lead` |
49
+ | **ready** | In worktree mode the lot is integrated (see [below](#one-worktree-per-lot-and-integration)); without worktree (the default) it is ready as soon as its review is compliant; the lead re-checks it, records `raf done`, delivers it | the lead |
50
+
51
+ Before all that, a lot whose title cites a finding or another lot gets a **precheck**: « is it already done? ». Small lots (half a day or
52
+ less) get a single review pass. Detail: [fonctionnement.md](fonctionnement.md#2-a-lot-inside-a-wave), [spec.md](spec.md).
53
+
54
+ ## The test gate
55
+
56
+ After each writing session the program plays the project's own **gate**: the build (`orchestrate.build`), then the tests
57
+ (`orchestrate.test`). A session's « the tests pass » is never taken on trust. Three rules keep the gate honest:
58
+
59
+ - **Already red at the start.** If a test fails, the program replays the suite at the sha the lot started from, in a **throwaway copy**
60
+ of the repository (a temporary `git worktree` outside it, removed afterwards). A test that was already red is not the lot's fault: no correction pass,
61
+ and the table lists it apart.
62
+ - **Replayed alone.** With `orchestrate.testReplay`, a test red in the whole suite is replayed alone: green alone means a load
63
+ failure, not a defect, so no correction is spent on it. Without this key, nothing is replayed.
64
+ - **A test that reads the plan.** The commits that only touch the plan are crossed when the gate's verdict is carried over them. A project whose
65
+ tests read `.cadence/raf.yaml` says so with `orchestrate.gate: { readsPlan: true }`, or the gate would not see a break.
66
+
67
+ A **resume** (`cadence orchestrate --resume`) picks a suspended or handed-back wave where it stopped, instead of starting again.
68
+ Detail: [orchestrate.md](orchestrate.md#orchestrate), [deliver.md](deliver.md), [remote-gate.md](remote-gate.md).
69
+
70
+ ## One worktree per lot, and integration
71
+
72
+ <picture>
73
+ <source media="(prefers-color-scheme: dark)" srcset="concepts-worktrees-dark.svg">
74
+ <img alt="Three lots each work in their own worktree on their own branch; at the end of their cycle they pass one at a time through the integration (rebase, replayed checks, fast-forward) into main" src="concepts-worktrees-light.svg">
75
+ </picture>
76
+
77
+ By default a wave plays the lots of a repository one after the other. With `orchestrate.worktrees: true`, independent lots play **at the same
78
+ time**, each in its own **worktree** (a second checkout of the same repository, in its own folder) on its own branch
79
+ `cadence/<wave>/<project>--<lot>`, so two sessions never edit the same files. When a lot's cycle ends, the program **integrates** it: one
80
+ lot at a time under a lock, it rebases the branch on the tip of `main`, replays the checks, and fast-forwards `main`. Only then is the
81
+ lot `ready`. If `main` moved in the meantime the rebase is replayed, twice at most, then the lot is handed back. Two rules protect
82
+ you: the program, not the sessions, writes the plan; and a session never commits on the `main` branch of another repository
83
+ (it uses a `wip/` branch). Detail: [orchestrate.md](orchestrate.md#one-worktree-per-lot-orchestrateworktrees-l279).
84
+
85
+ ## Deliverable up to a sha
86
+
87
+ <picture>
88
+ <source media="(prefers-color-scheme: dark)" srcset="concepts-livraison-dark.svg">
89
+ <img alt="Commits stack on main: L1 and L2 are ready, L3 is handed back, L4 is ready above it; the deliverable sha is the last commit of L2, so L3 and L4 are not pushed" src="concepts-livraison-light.svg">
90
+ </picture>
91
+
92
+ Lots commit on top of each other on `main`. When a ready lot sits **under** a lot that is not ready, pushing `HEAD` would also publish
93
+ unreviewed code. The final table then says « **livrable jusqu'à `<sha>`** »: the last commit of the highest ready lot that has no
94
+ unfinished lot beneath it. You ship exactly that, and nothing above:
95
+
96
+ ```sh
97
+ git push origin <sha>:main && cadence deliver --sha <sha>
98
+ ```
99
+
100
+ `cadence deliver` waits for the CI of that exact sha, deploys, and replays the effect checks: a delivery is finished only when its effect is proved.
101
+ Where the project declares a gate, the `pre-push` hook refuses a sha with no green `cadence verify --gate`. Detail: [deliver.md](deliver.md), [orchestrate.md](orchestrate.md#orchestrate).
102
+
103
+ ## Lead and delivery agent
104
+
105
+ The **lead** is a Claude Code session (`/cadence:lead`) that drives the waves for you: it reads the state of every project
106
+ (`cadence lead tour`), proposes lots, starts the waves, relays each line of the journal and each question, **re-verifies** what comes back
107
+ (git log, tests, build, `raf check`), then delivers. It never codes and never commits where a wave runs. The **delivery agent**
108
+ (`livreur`) is a subagent the lead hands one ready lot to: it checks the sha, runs the gate, records `raf done`, pushes the sha and
109
+ delivers, then reports in one line. You stay the one who decides what matters, and the UX verdict if you did not delegate it.
110
+ Detail: [lead.md](lead.md), [skills.md](skills.md).
111
+
112
+ ## Slots and holds
113
+
114
+ <picture>
115
+ <source media="(prefers-color-scheme: dark)" srcset="concepts-vague-dark.svg">
116
+ <img alt="A queue of lots feeds the slots of a wave: two sessions running, a slot held by a fix the lead started by hand, a free slot that `--continue` fills from the plan; the wave's table goes to the lead" src="concepts-vague-light.svg">
117
+ </picture>
118
+
119
+ The machine and your quota are shared, so at most **N sessions run at once**: N is the cap (`CADENCE_MAX_SESSIONS` or `--max-sessions`, 2 by default;
120
+ the lead never raises it itself). Each running session occupies a **slot**; a lot waits in the queue until one is free, and a freed slot goes to the next
121
+ lot of the wave's queue; with `--continue`, a freed slot is also filled at once by the next ready lot of the plan; without it, nothing is drawn from the plan. A session the lead starts by hand (a fix, a QA pass) is invisible to the waves, so
122
+ the lead declares it with `cadence lead hold <label>` and lifts it with `cadence lead release <label>`: a **hold** takes a slot, and
123
+ the waves wait for it instead of overtaking it. `cadence orchestrate --status` prints `créneaux libres : 1 sur 3`. Detail: [lead.md](lead.md#lead-hold-and-release), [orchestrate.md](orchestrate.md#orchestrate).
124
+
125
+ ## Escalation
126
+
127
+ A lot that is still not compliant after its correction passes would normally be handed back. A project can ask for one more try
128
+ with a stronger model: `orchestrate.escalation: { model: fable }` plays one correction and one fresh review on that model first
129
+ (absent, nothing changes; it costs a share of the lot's budget). If that is not enough, the lot is **handed back** to the lead,
130
+ who either fixes it, answers the question, or brings it to you: the question always reaches a human, never a session. Detail: [orchestrate.md](orchestrate.md#orchestrate), [perf.md](perf.md).
131
+
132
+ ## Putting into service and release
133
+
134
+ Two moments are easy to confuse. **Putting into service** concerns cadence itself, where the `raf` and `cadence` commands you type must
135
+ not run the code a wave is rewriting: they read a separate copy, updated only by `npm run service -- <sha>`, which refuses a sha
136
+ that is not an ancestor of `HEAD` or whose lots are not `done`. A **release** is a published version: `cadence release patch|minor|major` writes the version
137
+ files and the changelog, then prints the steps the lead plays (tag, gate, push, CI, publication). Detail: [fonctionnement.md](fonctionnement.md#4-putting-cadence-itself-in-service), [releasing.md](releasing.md).
138
+
139
+ ## Glossary
140
+
141
+ - **plan**: the file `.cadence/raf.yaml` that lists the lots; the single source of truth.
142
+ - **lot**: one item of the plan, cited by its commits (`feat(L12): …`).
143
+ - **verdict**: the recorded opinion of a reviewer on a lot: `raf review` (code) and `raf ux` (screen).
144
+ - **session**: one fresh Claude Code run with a brief and one job.
145
+ - **wave**: a `cadence orchestrate` run that plays several lots and prints a table of what is ready and what is handed back.
146
+ - **sheet**: the written spec of a screen or a behaviour, with numbered rules, each tested.
147
+ - **gate**: the build and the tests the program plays after each session, with the already-red baseline and the replay alone.
148
+ - **readsPlan**: `orchestrate.gate` key declaring that a test reads the plan, so plan-only commits are not crossed.
149
+ - **worktree**: a second checkout of the repository on its own branch, one per lot, so lots play at the same time.
150
+ - **integration**: rebasing a lot on the tip of `main`, replaying the checks and fast-forwarding, one lot at a time, before `ready`.
151
+ - **handed back**: a lot the wave could not finish and returns to the lead with its cause.
152
+ - **deliverable up to**: the sha up to which a delivery is safe, below the first lot that is not ready.
153
+ - **lead**: the session that drives the waves, re-verifies and delivers; it never codes.
154
+ - **delivery agent**: the `livreur` subagent that delivers one ready lot and reports in one line.
155
+ - **slot**: one place under the cap of simultaneous sessions.
156
+ - **hold**: a slot kept by a session the lead started by hand, so waves do not overtake it.
157
+ - **escalation**: one more correction and review on a stronger model before a lot is handed back.
158
+ - **service**: the separate copy of cadence the `PATH` commands read, updated by `npm run service -- <sha>`.
159
+ - **release**: a published version, prepared by `cadence release`.
package/docs/deliver.md CHANGED
@@ -234,8 +234,9 @@ about it anywhere, the script declares it in `CADENCE_DEPLOYED_FILE` (above). Ex
234
234
  ## verify: replay the effect checks, outside a delivery
235
235
 
236
236
  A green delivery says the effect was right *then*. `cadence verify` replays the
237
- `deliver.verify` checks of `cadence.yaml` at any time — no CI, no deploy, no lock,
238
- no journal entry, nothing written.
237
+ `deliver.verify` checks of `cadence.yaml` at any time — no CI, no deploy, no lock.
238
+ It writes nothing, with one exception (below): a green verify at the sha of the last
239
+ red delivery.
239
240
 
240
241
  ```sh
241
242
  cadence verify # one pass, one line per check, then a one-line summary
@@ -249,6 +250,27 @@ cadence verify --sha 6b0d9aa # the sha that replaces ${SHA} / ${SHORT} (default
249
250
  verify : 1 effet rouge sur 2 vérifications
250
251
  ```
251
252
 
253
+ **A green verify clears a red delivery of the same sha** (L435). When every check is
254
+ green and the sha verified is the one of the *last* line of `deliveries-failed.log`
255
+ (a `[verification]` delivery that failed on an outage, say, while the effect is there), `verify` appends
256
+ `day sha` to `deliveries.log` and prints `verify : <sha> avait une livraison rouge,
257
+ l'effet est vert — inscrit au journal des livraisons`; the `cadence-hud` panel, which
258
+ shows the red line until `deliveries.log` is newer than `deliveries-failed.log`, drops
259
+ it without delivering again. That line **is** a delivery: as after `cadence deliver`, the
260
+ lots cited by the commits since the previous green delivery are announced (`livré : L… — raf
261
+ done …`) and the « Article <project> à rafraîchir » lot is opened when one has a public title
262
+ (`docs.articles`, L144) — the next delivery starts from this line, so the lots in between are
263
+ said here or never. Nothing is written when a check is red, when the last red
264
+ delivery is another sha's (writing would hide it), when it is not of class `[verification]`
265
+ (a red `[ci]`, `[refus]` or `[deploiement]` stays: checks do not always read the sha, so a green
266
+ verify proves nothing about a commit that was never built or deployed), when there is no red delivery, or when
267
+ `deliveries.log` was already modified after `deliveries-failed.log`. `deliveries-failed.log`
268
+ is never rewritten, so `cadence perf` still counts the red delivery and now also the green one.
269
+ One limit: the red line keeps the sha the delivery *started* from, so the green line written by
270
+ `verify` is that sha too, even when a green `deliver` would have written the sha its script
271
+ declared (`CADENCE_DEPLOYED_FILE`) or the head it moved to — that sha is not kept anywhere once the
272
+ delivery is red; deliver again when the journal must name it.
273
+
252
274
  Exit code: **0** every check green · **1** at least one red effect · **2** nothing
253
275
  to verify or invalid configuration.
254
276
 
@@ -1,5 +1,7 @@
1
1
  # How cadence works
2
2
 
3
+ New to the vocabulary? Start with [the notions of cadence](concepts.md); this page is the mechanics.
4
+
3
5
  A versioned plan (`raf`) tied to the commits, waves of fresh sessions driven by a program
4
6
  (`cadence orchestrate`), a lead that decides and re-verifies, then deliveries proved by their effect.
5
7
  Four figures go from the isolated lot to the tool itself. Dashed boxes are conditional steps; a
@@ -29,8 +31,11 @@ A lot without commits yet whose title cites a finding (`constat`, `revue`, `revi
29
31
  to the lead; « partial » passes what exists to the implementation. Then:
30
32
 
31
33
  - `screen: page` only: **spec** (mockup and screen sheet), **mockup review** (`ux-reviewer`, two
32
- passes at most), then **accept**. `screen: component` and `screen: journey` lots take the ordinary
33
- path, unless their sheet already exists.
34
+ passes at most), then **accept**.
35
+ - a visible lot above 0.1 day with `screen: component`, `screen: journey` or no `screen:` (L459): **light
36
+ mockup**, a `spec` session (current screen and target for the touched states) and the same mockup review,
37
+ no **accept**; the `ux` pass after the code checks conformity to the mockup. Other lots take the ordinary
38
+ path (`orchestrate.maquette: false` brings it back for these too).
34
39
  - `spec: true` (a lot with a behaviour to pin down and no screen): **back-end spec** (cases, rules,
35
40
  contracts), **sheet review** (`code-reviewer` in sheet mode, two passes at most), then **accept**.
36
41
  A mixed lot (a page whose sheet has a `sujet` block) gets both reviews and a single second spec pass.
@@ -86,12 +91,13 @@ The budget a wave gives a lot is derived from its estimate, measured on the runs
86
91
  | beyond | 570 k per day, 750 k at least |
87
92
  | `screen: page` | 1.3 M at least, or the ordinary budget + 450 k if that is more |
88
93
  | `spec: true` | ordinary budget + 450 k |
94
+ | visible, above 0.1 day, `screen: component` or `journey` or none (light mockup, L459) | ordinary budget + 450 k |
89
95
  | fix pass and short review | 155 k reserved |
90
96
  | escalation (`orchestrate.escalation` declared, L349) | + 175 k reserved (estimate: one correction and one fresh review on the escalation model) |
91
97
 
92
- The final review is always played; the budget bounds the writing passes. A `screen: component` or
93
- `screen: journey` lot takes the ordinary budget, unless its sheet already exists: it then gets the
94
- `screen: page` budget.
98
+ The final review is always played; the budget bounds the writing passes. A non-visible lot, or one of
99
+ 0.1 day or less, with `screen: component`, `screen: journey` or none takes the ordinary budget; a visible one
100
+ above 0.1 day gets the light mockup budget of the table.
95
101
 
96
102
  ## Permanent rules
97
103
 
package/docs/lead.md CHANGED
@@ -10,7 +10,7 @@ summaries, decides with the human, and leaves the work to fresh short sessions r
10
10
  <img alt="The lead workflow in three lanes (human, lead session, orchestrate program and agents), from the tour of the projects to the close of the session" src="lead-workflow-light.svg">
11
11
  </picture>
12
12
 
13
- Dashed boxes are conditional steps: the precheck runs only for a lot without a commit yet whose title cites a finding (`constat`, `revue`, `review`, `audit`) or another lot (unless `orchestrate.precheck: false`), and the spec, sheet review and accept steps run only for a `screen: page` lot or a `spec: true` lot. The skill itself is `skills/lead/SKILL.md`; this page is its
13
+ Dashed boxes are conditional steps: the precheck runs only for a lot without a commit yet whose title cites a finding (`constat`, `revue`, `review`, `audit`) or another lot (unless `orchestrate.precheck: false`), and the spec steps depend on the lot: a `screen: page` lot or a `spec: true` lot plays the full chain (spec, sheet review or mockup review, accept); a visible lot above 0.1 day without `screen: page` plays spec then the light mockup review, with no accept unless it already has a sealed acceptation (L459). The skill itself is `skills/lead/SKILL.md`; this page is its
14
14
  picture, not its source.
15
15
 
16
16
  ## The steps
@@ -24,11 +24,13 @@ picture, not its source.
24
24
  For each lot the program runs, in fresh sessions and in this order: `precheck → spec → maquette →
25
25
  accept → implement → review → ux`. The **precheck** applies to a lot without a commit yet whose title cites a finding (`constat`, `revue`, `review`, `audit`) or another lot (unless
26
26
  `orchestrate.precheck: false`; L288). The spec steps exist only for a lot that declares
27
- a `screen:` of `page` (a visible lot that creates or changes a whole screen; `screen: component` and `screen: journey`
28
- lots take the ordinary path, straight to the implementation, unless they already have a sheet) or `spec: true` (a lot without a screen
27
+ a `screen:` of `page` (a visible lot that creates or changes a whole screen) or `spec: true` (a lot without a screen
29
28
  that still has a behaviour to pin down: `precheck → spec → fiche → accept → implement → review`);
30
- spec, sheet review and accept apply to `screen: page` and to `spec: true` alike; the other lots go
31
- straight from the precheck (when it applies) to the implementation:
29
+ spec, sheet review and accept apply to `screen: page` and to `spec: true` alike. A visible lot above
30
+ 0.1 day with `screen: component`, `screen: journey` or no `screen:` (and no `spec: true`) plays the
31
+ **light mockup** instead (L459): `precheck → spec → maquette → implement → review → ux`, no accept, and
32
+ the `ux` pass checks conformity to the mockup. The other lots go straight from the precheck (when it
33
+ applies) to the implementation:
32
34
  - **spec**: the `spec-writer` agent draws a static mockup to the project's own style and writes the
33
35
  screen sheet (`fiche.yaml`: fields, states, numbered rules), rendered at 1440 and 390 px;
34
36
  - **fiche** (a lot with a back-end part: `spec: true`, or a screen lot whose sheet has a `sujet` block):
@@ -158,7 +160,7 @@ cadence config set orchestrate.build 'npx tsc --noEmit' --all
158
160
  - `<key>` is a dotted path (`orchestrate.escalation`); `<value>` is read as YAML, so `true`, a command, or a flow mapping like `{ model: fable }` all work. A key already at that value is left alone.
159
161
  - The rest of the file is kept as it is, byte for byte — comments, key order, blank lines, inline lists (`[a, b]`) and mappings: only the lines of the key change (a new key goes at the end of its parent; a value replaced in place keeps its end-of-line comment). The only exception is a file whose rewrite by the YAML library moves lines other than the key's (its line count changes, a comment lands on another line, or the lines carried over would not read back as the same document): then the whole file is rewritten in the library's style. A project with no `cadence.yaml` gets one.
160
162
  - In each project it creates a **config lot** that quotes the key (`config cadence.yaml : <key> = <value>`, estimate 0.05), as `raf add` then `raf start` would, and commits `cadence.yaml`, the plan file and, when the project names `plan.onWrite`, the files that command produces (it runs when the plan is written; see `docs/raf.md`) with explicit paths (`chore(L12): cadence.yaml — <key> = <value>`): nothing else in the index or the working tree goes in. The lot is left `doing`: closing it (`raf done`) stays the lead's step. **Nothing is pushed.**
161
- - The new text is read back with cadence's own config loaders (plan, news, hook, perf, session, orchestrate, docs, references, migrate, lead.ux, depth, priority, deliver) before anything is written. A `cadence.yaml` that does not read back — before the change or after it — **stops the run** (exit code 1) at that project, with nothing written there; the projects after it are named `non traités`. A commit the repository refuses (a hook) or a `plan.onWrite` command that fails stops it the same way (`lot ou commit impossible`), `cadence.yaml`, the plan file and the produced files put back as they were (a produced file HEAD does not know is deleted).
163
+ - The new text is read back with cadence's own config loaders (plan, news, hook, perf, session, orchestrate, docs, references, migrate, memory, lead.ux, depth, priority, deliver) before anything is written. A `cadence.yaml` that does not read back — before the change or after it — **stops the run** (exit code 1) at that project, with nothing written there; the projects after it are named `non traités`. A commit the repository refuses (a hook) or a `plan.onWrite` command that fails stops it the same way (`lot ou commit impossible`), `cadence.yaml`, the plan file and the produced files put back as they were (a produced file HEAD does not know is deleted).
162
164
  - A project is **skipped**, with the reason, when: it is not its own git repository; the key is already at that value; the key cannot be set in its file (a plain value in the way); `cadence.yaml`, the plan file or a file named by `plan.onWrite.files` has uncommitted changes (the explicit-path commit would take them); or its plan is read-only (kept by another tool) and `cadence.yaml` names no creation command. A read-only plan that names one with `plan.add` (a shell command containing `{title}`, replaced by the quoted title of the config lot, e.g. `plan: { path: taches.yaml, lots: taches, add: 'mytool add {title}' }`) gets its config lot from that command, run in the project folder; the lot id is the first id-like word of its output (the commit subject has none when there is none), and `cadence.yaml` and the plan file are committed together. The command alone decides the lot's status.
163
165
  - `--dry-run` prints the same lines, prefixed `+ … serait fait`, and writes and commits nothing. The last line counts what was done and skipped. Without `--all` the command refuses (run `raf`/an editor inside the project for a single one).
164
166
 
@@ -194,6 +196,8 @@ After the project lines the tour lists the **worktrees kept by waves** (L279, `o
194
196
 
195
197
  Before the project lines the tour prints the **perf header** (L227): one line per `⚠` of `cadence perf` for the folder, in the order of `perf`, each ending with its decision and, for a trend, the value of its quality twin (speed and quality side by side); the net-bottleneck `⚠ goulot` line is relayed as is. Nothing is printed when no `⚠` stands, and the output is then the one of a tour without header. The header is read with `perf`'s own reading of the folder (projects up to two levels, whatever `--depth`) and only in the text output: `--json` is unchanged. When `perf` cannot read the folder (no `.cadence/runs`, malformed price grid, unreadable journals or plans) the tour prints no header, reports no perf error and exits 0. The [lead skill](skills.md) reads the header before proposing the three lots and opens an improvement lot only on a trend confirmed on two windows or a net bottleneck.
196
198
 
199
+ After the worktree lines the tour prints, when the `MEMORY.md` index of Claude Code for the parent folder outgrows its threshold (L442), `mémoire · MEMORY.md 15700 octets > seuil 12000 · 14 entrée(s) datée(s) à regrouper (cadence session close détaille)`. The index is `projects/<parent folder>/memory/MEMORY.md` under the Claude Code folder (`CLAUDE_CONFIG_DIR`, else the default one) (the folder resolved from the argument of `lead tour`); the threshold is 12000 bytes, or `memory.indexMaxBytes` in the parent folder's `cadence.yaml`, the same key and the same rule as for `cadence session close` ([docs/session.md](session.md#memory-index-size-l442)). A value that is not an integer ≥ 1 does not stop the tour (exit code 0): the line `cadence.yaml · ✗ erreur : memory.indexMaxBytes doit être un entier ≥ 1 (octets), pas <valeur>` replaces it. An unreadable index prints `mémoire · MEMORY.md illisible (<cause>)`. Nothing is printed for an absent index or one at the threshold, `--json` is unchanged, and the tour never writes the memory: the [lead skill](skills.md) relays the line and proposes the grouping, which is done once the human agrees.
200
+
197
201
  When an orchestrated wave is live, one more line closes the tour (not part of `--json`): `vagues en cours : 1 · sessions en cours : 0 · créneaux libres : 1 sur 2` — the lead reads the free slots there instead of computing them (L141). The `sur M` is the cap the human set (`CADENCE_MAX_SESSIONS`, 2 by default), not a fixed 2 (L208); an invalid value falls back to 2 in this display. The sessions held with [`lead hold`](#lead-hold-and-release) are subtracted from the free slots. The line is always printed (L416), with no live wave and no held session too: `vagues en cours : 0 · sessions en cours : 0 · créneaux libres : 3 sur 3`, so that an empty slot is read, not deduced from a missing line.
198
202
 
199
203
  Next to it, when at least one ready lot is free, a line `prêts, ressources libres : alpha:L3 <title> · beta:L2 <title> (banc)` (L252, GitHub issue #13, 2/3) lists, for every project of the tour, the ready lots (same rule as `next`, minus the ones marked « à décider ») that can start now: a lot is free when none of the resources in its `uses:` (shown in parentheses) is held by a lot `doing` in any project of the tour or in any project that shares its resources (the projects under the folder whose `cadence.yaml` declares `resources:`, walked with that file's `depth:`, one level by default, so `P/x` and `P/grp/alpha` share the `banc` of `P/cadence.yaml` with `depth: 2` wherever the tour is launched from, even from inside one project; with no declared resource, the projects of the parent folder), nor by an unfinished lot of a live wave (a wave's lot is recognised by its repository and its id, not by the project name: a nested project `grp/alpha` matches the wave launched from `grp/` that cites it as `alpha`, and a wave launched from another folder only hides the lots of its own repositories); a lot with no `uses:` holds none and is always free. The line shows at most 3 lots per project, then `alpha +K` for the others. Like the slots line it is always printed (L416), whether or not a wave is live or a session is held. It is a display: nothing locks, `raf start` and `orchestrate` still start a lot whose resource is taken. `--json` gives the same lots, always, as a `free` array on each project (`id`, `title`, and `uses` when the lot has any; absent when the project has none).