@lumenflow/cli 4.23.0 → 5.0.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 (296) hide show
  1. package/README.md +54 -52
  2. package/dist/agent-issues-query.js +10 -2
  3. package/dist/agent-issues-query.js.map +1 -1
  4. package/dist/agent-runtime-enrollment-events.js +44 -0
  5. package/dist/agent-runtime-enrollment-events.js.map +1 -0
  6. package/dist/agent-session-end.js +47 -0
  7. package/dist/agent-session-end.js.map +1 -1
  8. package/dist/agent-session-heartbeat.js +250 -0
  9. package/dist/agent-session-heartbeat.js.map +1 -0
  10. package/dist/agent-session.js +299 -5
  11. package/dist/agent-session.js.map +1 -1
  12. package/dist/capacity-snapshot-emitter.js +73 -0
  13. package/dist/capacity-snapshot-emitter.js.map +1 -0
  14. package/dist/claim-queue.js +276 -0
  15. package/dist/claim-queue.js.map +1 -0
  16. package/dist/config-set.js +22 -3
  17. package/dist/config-set.js.map +1 -1
  18. package/dist/control-plane-sidecar-runner.js +145 -0
  19. package/dist/control-plane-sidecar-runner.js.map +1 -0
  20. package/dist/delegation-list.js +160 -1
  21. package/dist/delegation-list.js.map +1 -1
  22. package/dist/delegation-role-resolver.js +69 -0
  23. package/dist/delegation-role-resolver.js.map +1 -0
  24. package/dist/docs-generate-pack-reference.js +500 -0
  25. package/dist/docs-generate-pack-reference.js.map +1 -0
  26. package/dist/docs-sync.js +116 -1
  27. package/dist/docs-sync.js.map +1 -1
  28. package/dist/file-edit.js +28 -8
  29. package/dist/file-edit.js.map +1 -1
  30. package/dist/file-write.js +29 -5
  31. package/dist/file-write.js.map +1 -1
  32. package/dist/gate-co-change.js +25 -7
  33. package/dist/gate-co-change.js.map +1 -1
  34. package/dist/gate-conditional.js +19 -7
  35. package/dist/gate-conditional.js.map +1 -1
  36. package/dist/gates-runners.js +42 -33
  37. package/dist/gates-runners.js.map +1 -1
  38. package/dist/gates-utils.js +34 -20
  39. package/dist/gates-utils.js.map +1 -1
  40. package/dist/gates.js +79 -7
  41. package/dist/gates.js.map +1 -1
  42. package/dist/hooks/config-resolver.js +10 -1
  43. package/dist/hooks/config-resolver.js.map +1 -1
  44. package/dist/init-package-config.js +1 -1
  45. package/dist/init-package-config.js.map +1 -1
  46. package/dist/init-scaffolding.js +5 -1
  47. package/dist/init-scaffolding.js.map +1 -1
  48. package/dist/init-templates.js +10 -0
  49. package/dist/init-templates.js.map +1 -1
  50. package/dist/init.js +1 -1
  51. package/dist/init.js.map +1 -1
  52. package/dist/initiative-create.js +17 -0
  53. package/dist/initiative-create.js.map +1 -1
  54. package/dist/initiative-remove-wu.js +17 -3
  55. package/dist/initiative-remove-wu.js.map +1 -1
  56. package/dist/kernel-event-sync/emitters.js +104 -0
  57. package/dist/kernel-event-sync/emitters.js.map +1 -0
  58. package/dist/kernel-event-sync/index.js +13 -0
  59. package/dist/kernel-event-sync/index.js.map +1 -0
  60. package/dist/kernel-event-sync/lifecycle-emitters.js +160 -0
  61. package/dist/kernel-event-sync/lifecycle-emitters.js.map +1 -0
  62. package/dist/kernel-event-sync/narrow-emissions.js +89 -0
  63. package/dist/kernel-event-sync/narrow-emissions.js.map +1 -0
  64. package/dist/kernel-event-sync/software-delivery-emitters.js +297 -0
  65. package/dist/kernel-event-sync/software-delivery-emitters.js.map +1 -0
  66. package/dist/lane-lock.js +14 -1
  67. package/dist/lane-lock.js.map +1 -1
  68. package/dist/lane-suggest.js +21 -0
  69. package/dist/lane-suggest.js.map +1 -1
  70. package/dist/lumenflow-upgrade.js +7 -5
  71. package/dist/lumenflow-upgrade.js.map +1 -1
  72. package/dist/mem-context.js +145 -0
  73. package/dist/mem-context.js.map +1 -1
  74. package/dist/mem-create.js +39 -6
  75. package/dist/mem-create.js.map +1 -1
  76. package/dist/mem-inbox.js +16 -0
  77. package/dist/mem-inbox.js.map +1 -1
  78. package/dist/mem-roster.js +95 -0
  79. package/dist/mem-roster.js.map +1 -0
  80. package/dist/mem-signal.js +97 -2
  81. package/dist/mem-signal.js.map +1 -1
  82. package/dist/metrics-cli.js +3 -2
  83. package/dist/metrics-cli.js.map +1 -1
  84. package/dist/metrics-snapshot.js +271 -13
  85. package/dist/metrics-snapshot.js.map +1 -1
  86. package/dist/orchestrate-init-status.js +117 -2
  87. package/dist/orchestrate-init-status.js.map +1 -1
  88. package/dist/orchestrate-initiative.js +83 -10
  89. package/dist/orchestrate-initiative.js.map +1 -1
  90. package/dist/orchestrate-monitor-quality.js +289 -0
  91. package/dist/orchestrate-monitor-quality.js.map +1 -0
  92. package/dist/orchestrate-monitor.js +85 -0
  93. package/dist/orchestrate-monitor.js.map +1 -1
  94. package/dist/pack-validate.js +127 -2
  95. package/dist/pack-validate.js.map +1 -1
  96. package/dist/plan-create.js +18 -0
  97. package/dist/plan-create.js.map +1 -1
  98. package/dist/plan-link.js +13 -0
  99. package/dist/plan-link.js.map +1 -1
  100. package/dist/plan-promote.js +14 -0
  101. package/dist/plan-promote.js.map +1 -1
  102. package/dist/pre-commit-check.js +4 -3
  103. package/dist/pre-commit-check.js.map +1 -1
  104. package/dist/public-manifest.js +17 -3
  105. package/dist/public-manifest.js.map +1 -1
  106. package/dist/release.js +10 -10
  107. package/dist/release.js.map +1 -1
  108. package/dist/session-cross-link.js +139 -0
  109. package/dist/session-cross-link.js.map +1 -0
  110. package/dist/sidecar-manager.js +208 -0
  111. package/dist/sidecar-manager.js.map +1 -0
  112. package/dist/state-path-resolvers.js +18 -0
  113. package/dist/state-path-resolvers.js.map +1 -1
  114. package/dist/stream-heartbeat.js +151 -0
  115. package/dist/stream-heartbeat.js.map +1 -0
  116. package/dist/sync-templates.js +56 -2
  117. package/dist/sync-templates.js.map +1 -1
  118. package/dist/wu-block.js +47 -5
  119. package/dist/wu-block.js.map +1 -1
  120. package/dist/wu-claim-branch.js +8 -4
  121. package/dist/wu-claim-branch.js.map +1 -1
  122. package/dist/wu-claim-state.js +5 -3
  123. package/dist/wu-claim-state.js.map +1 -1
  124. package/dist/wu-claim-worktree.js +5 -3
  125. package/dist/wu-claim-worktree.js.map +1 -1
  126. package/dist/wu-claim.js +261 -9
  127. package/dist/wu-claim.js.map +1 -1
  128. package/dist/wu-done-auto-cleanup.js +3 -2
  129. package/dist/wu-done-auto-cleanup.js.map +1 -1
  130. package/dist/wu-done-git-ops.js +12 -8
  131. package/dist/wu-done-git-ops.js.map +1 -1
  132. package/dist/wu-done-preflight.js +3 -3
  133. package/dist/wu-done-preflight.js.map +1 -1
  134. package/dist/wu-done.js +46 -10
  135. package/dist/wu-done.js.map +1 -1
  136. package/dist/wu-lifecycle-sync/gate-scope-resolver.js +16 -0
  137. package/dist/wu-lifecycle-sync/gate-scope-resolver.js.map +1 -0
  138. package/dist/wu-lifecycle-sync/kernel-event-sync-shim.js +10 -0
  139. package/dist/wu-lifecycle-sync/kernel-event-sync-shim.js.map +1 -0
  140. package/dist/wu-prep.js +363 -22
  141. package/dist/wu-prep.js.map +1 -1
  142. package/dist/wu-prune.js +68 -27
  143. package/dist/wu-prune.js.map +1 -1
  144. package/dist/wu-release.js +34 -3
  145. package/dist/wu-release.js.map +1 -1
  146. package/dist/wu-review.js +167 -0
  147. package/dist/wu-review.js.map +1 -0
  148. package/dist/wu-spawn-prompt-builders.js +296 -40
  149. package/dist/wu-spawn-prompt-builders.js.map +1 -1
  150. package/dist/wu-spawn-strategy-resolver.js +126 -14
  151. package/dist/wu-spawn-strategy-resolver.js.map +1 -1
  152. package/dist/wu-unblock.js +52 -22
  153. package/dist/wu-unblock.js.map +1 -1
  154. package/package.json +13 -8
  155. package/packs/agent-runtime/.turbo/turbo-build.log +1 -1
  156. package/packs/agent-runtime/.turbo/turbo-test.log +25 -0
  157. package/packs/agent-runtime/.turbo/turbo-typecheck.log +4 -0
  158. package/packs/agent-runtime/agent-heartbeat.ts +163 -0
  159. package/packs/agent-runtime/auto-session-integration.ts +874 -0
  160. package/packs/agent-runtime/delegation-registry-schema.ts +220 -0
  161. package/packs/agent-runtime/delegation-registry-store.ts +269 -0
  162. package/packs/agent-runtime/delegation-tree.ts +328 -0
  163. package/packs/agent-runtime/index.ts +9 -0
  164. package/packs/agent-runtime/manifest.ts +103 -19
  165. package/packs/agent-runtime/manifest.yaml +132 -0
  166. package/packs/agent-runtime/memory-coordination-contract.ts +86 -0
  167. package/packs/agent-runtime/memory.d.ts +19 -0
  168. package/packs/agent-runtime/orchestration.ts +238 -23
  169. package/packs/agent-runtime/package.json +11 -2
  170. package/packs/agent-runtime/remote-controls/index.ts +7 -0
  171. package/packs/agent-runtime/remote-controls/operations.ts +399 -0
  172. package/packs/agent-runtime/remote-controls/port.ts +48 -0
  173. package/packs/agent-runtime/remote-controls/state-store.ts +258 -0
  174. package/packs/agent-runtime/remote-controls/types.ts +105 -0
  175. package/packs/agent-runtime/session-schema.ts +423 -0
  176. package/packs/agent-runtime/tool-impl/index.ts +1 -0
  177. package/packs/agent-runtime/tool-impl/remote-controls.mock.ts +252 -0
  178. package/packs/agent-runtime/tool-impl/remote-controls.ts +273 -0
  179. package/packs/agent-runtime/tsconfig.json +1 -1
  180. package/packs/agent-runtime/turn-lifecycle-events.ts +501 -0
  181. package/packs/sidekick/.lumenflow/state/conductor/outbox/sidekick-events.jsonl +213 -0
  182. package/packs/sidekick/.turbo/turbo-build.log +1 -1
  183. package/packs/sidekick/.turbo/turbo-test.log +25 -0
  184. package/packs/sidekick/.turbo/turbo-typecheck.log +4 -0
  185. package/packs/sidekick/channel-ingress.ts +137 -0
  186. package/packs/sidekick/manifest.ts +74 -0
  187. package/packs/sidekick/manifest.yaml +88 -0
  188. package/packs/sidekick/package.json +3 -1
  189. package/packs/sidekick/sidekick-events.ts +517 -0
  190. package/packs/sidekick/src/adapters/cloud-queue.ts +101 -0
  191. package/packs/sidekick/src/adapters/control-plane-bridge.adapter.ts +378 -0
  192. package/packs/sidekick/src/adapters/filesystem-bridge.adapter.ts +224 -0
  193. package/packs/sidekick/src/domain/channel.types.ts +84 -0
  194. package/packs/sidekick/src/ports/channel-bridge.port.ts +75 -0
  195. package/packs/sidekick/src/routines/commit.ts +74 -0
  196. package/packs/sidekick/tool-impl/channel-tools.ts +47 -0
  197. package/packs/sidekick/tool-impl/memory-tools.ts +17 -0
  198. package/packs/sidekick/tool-impl/routine-commit.ts +102 -0
  199. package/packs/sidekick/tool-impl/routine-tools.ts +67 -7
  200. package/packs/sidekick/tool-impl/runtime-context.ts +4 -0
  201. package/packs/sidekick/tool-impl/storage.ts +3 -0
  202. package/packs/sidekick/tool-impl/system-tools.ts +7 -0
  203. package/packs/sidekick/tool-impl/task-tools.ts +46 -0
  204. package/packs/sidekick/tsconfig.json +1 -1
  205. package/packs/software-delivery/.turbo/turbo-build.log +1 -1
  206. package/packs/software-delivery/.turbo/turbo-test.log +63 -0
  207. package/packs/software-delivery/.turbo/turbo-typecheck.log +4 -0
  208. package/packs/software-delivery/manifest-schema.ts +30 -0
  209. package/packs/software-delivery/manifest.ts +99 -1
  210. package/packs/software-delivery/manifest.yaml +46 -0
  211. package/packs/software-delivery/package.json +88 -3
  212. package/packs/software-delivery/src/commands/index.ts +5 -0
  213. package/packs/software-delivery/src/config/delivery-review-contract.ts +20 -0
  214. package/packs/software-delivery/src/config/env-accessors.ts +19 -0
  215. package/packs/software-delivery/src/config/index.ts +8 -0
  216. package/packs/software-delivery/src/config/normalize-config-keys.ts +19 -0
  217. package/packs/software-delivery/src/config/schemas/lumenflow-config-schema-types.ts +436 -0
  218. package/packs/software-delivery/src/config/workspace-reader.ts +310 -0
  219. package/packs/software-delivery/src/constants/backlog-patterns.ts +31 -0
  220. package/packs/software-delivery/src/constants/client-ids.ts +19 -0
  221. package/packs/software-delivery/src/constants/config-contract.ts +7 -0
  222. package/packs/software-delivery/src/constants/docs-layout-presets.ts +50 -0
  223. package/packs/software-delivery/src/constants/duration-constants.ts +20 -0
  224. package/packs/software-delivery/src/constants/gate-constants.ts +32 -0
  225. package/packs/software-delivery/src/constants/index.ts +29 -0
  226. package/packs/software-delivery/src/constants/lock-constants.ts +35 -0
  227. package/packs/software-delivery/src/constants/object-guards.ts +12 -0
  228. package/packs/software-delivery/src/constants/section-headings.ts +107 -0
  229. package/packs/software-delivery/src/constants/wu-cli-constants.ts +485 -0
  230. package/packs/software-delivery/src/constants/wu-domain-constants.ts +466 -0
  231. package/packs/software-delivery/src/constants/wu-git-constants.ts +7 -0
  232. package/packs/software-delivery/src/constants/wu-id-format.ts +327 -0
  233. package/packs/software-delivery/src/constants/wu-paths-constants.ts +358 -0
  234. package/packs/software-delivery/src/constants/wu-statuses.ts +287 -0
  235. package/packs/software-delivery/src/constants/wu-type-helpers.ts +67 -0
  236. package/packs/software-delivery/src/constants/wu-ui-constants.ts +267 -0
  237. package/packs/software-delivery/src/constants/wu-validation-constants.ts +73 -0
  238. package/packs/software-delivery/src/domain/index.ts +5 -0
  239. package/packs/software-delivery/src/domain/orchestration.constants.ts +168 -0
  240. package/packs/software-delivery/src/domain/orchestration.schemas.ts +239 -0
  241. package/packs/software-delivery/src/domain/orchestration.types.ts +178 -0
  242. package/packs/software-delivery/src/methodology/incremental-test.ts +90 -0
  243. package/packs/software-delivery/src/methodology/index.ts +6 -0
  244. package/packs/software-delivery/src/methodology/manual-test-validator.ts +292 -0
  245. package/packs/software-delivery/src/policy/coverage-gate.ts +270 -0
  246. package/packs/software-delivery/src/policy/gates-agent-mode.ts +223 -0
  247. package/packs/software-delivery/src/policy/gates-config-internal.ts +121 -0
  248. package/packs/software-delivery/src/policy/gates-config.ts +293 -0
  249. package/packs/software-delivery/src/policy/gates-coverage.ts +247 -0
  250. package/packs/software-delivery/src/policy/gates-presets.ts +134 -0
  251. package/packs/software-delivery/src/policy/gates-schemas.ts +173 -0
  252. package/packs/software-delivery/src/policy/index.ts +22 -0
  253. package/packs/software-delivery/src/policy/package-manager-resolver.ts +319 -0
  254. package/packs/software-delivery/src/policy/resolve-policy.ts +518 -0
  255. package/packs/software-delivery/src/ports/config.ports.ts +90 -0
  256. package/packs/software-delivery/src/ports/dashboard-renderer.port.ts +125 -0
  257. package/packs/software-delivery/src/ports/index.ts +10 -0
  258. package/packs/software-delivery/src/ports/sync-validator.ports.ts +59 -0
  259. package/packs/software-delivery/src/ports/wu-helpers.ports.ts +168 -0
  260. package/packs/software-delivery/src/ports/wu-state.ports.ts +241 -0
  261. package/packs/software-delivery/src/primitives/index.ts +5 -0
  262. package/packs/software-delivery/src/runtime/index.ts +6 -0
  263. package/packs/software-delivery/src/runtime/work-classifier.ts +561 -0
  264. package/packs/software-delivery/src/sandbox/index.ts +10 -0
  265. package/packs/software-delivery/src/sandbox/sandbox-allowlist.ts +118 -0
  266. package/packs/software-delivery/src/sandbox/sandbox-backend-linux.ts +88 -0
  267. package/packs/software-delivery/src/sandbox/sandbox-backend-macos.ts +154 -0
  268. package/packs/software-delivery/src/sandbox/sandbox-backend-windows.ts +47 -0
  269. package/packs/software-delivery/src/sandbox/sandbox-profile.ts +153 -0
  270. package/packs/software-delivery/src/schemas/index.ts +5 -0
  271. package/packs/software-delivery/src/state/date-utils.ts +158 -0
  272. package/packs/software-delivery/src/state/index.ts +15 -0
  273. package/packs/software-delivery/src/state/state-machine.ts +119 -0
  274. package/packs/software-delivery/src/state/wu-doc-types.ts +51 -0
  275. package/packs/software-delivery/src/state/wu-paths.ts +381 -0
  276. package/packs/software-delivery/src/state/wu-schema.ts +1139 -0
  277. package/packs/software-delivery/src/state/wu-state-schema.ts +255 -0
  278. package/packs/software-delivery/src/state/wu-yaml.ts +338 -0
  279. package/packs/software-delivery/src/types.d.ts +16 -0
  280. package/packs/software-delivery/tool-impl/wu-lifecycle-tools.ts +18 -0
  281. package/packs/software-delivery/tsconfig.json +28 -2
  282. package/templates/core/AGENTS.md.template +76 -17
  283. package/templates/core/LUMENFLOW.md.template +265 -66
  284. package/templates/core/_frameworks/lumenflow/wu-sizing-guide.md.template +180 -116
  285. package/templates/core/ai/onboarding/agent-invocation-guide.md.template +26 -8
  286. package/templates/core/ai/onboarding/existing-project-bootstrap.md.template +171 -0
  287. package/templates/core/ai/onboarding/first-15-mins.md.template +3 -1
  288. package/templates/core/ai/onboarding/first-wu-mistakes.md.template +1 -1
  289. package/templates/core/ai/onboarding/initiative-orchestration.md.template +46 -30
  290. package/templates/core/ai/onboarding/quick-ref-commands.md.template +36 -33
  291. package/templates/core/ai/onboarding/release-process.md.template +8 -7
  292. package/templates/core/ai/onboarding/starting-prompt.md.template +2 -0
  293. package/templates/core/ai/onboarding/troubleshooting-wu-done.md.template +62 -0
  294. package/templates/vendors/claude/.claude/CLAUDE.md.template +29 -54
  295. package/templates/vendors/cursor/.cursor/rules/lumenflow.md.template +24 -52
  296. package/templates/vendors/windsurf/.windsurf/rules/lumenflow.md.template +24 -52
@@ -0,0 +1,171 @@
1
+ # Adopting LumenFlow on an Existing Project
2
+
3
+ **Last updated:** {{DATE}}
4
+
5
+ For agents running `lumenflow init` on a repo that already has code, tests, and (likely) uncommitted work. If you are in a project where LumenFlow is already configured, use [first-15-mins.md](./first-15-mins.md) instead — this doc is only for the adoption event itself.
6
+
7
+ ---
8
+
9
+ ## Why This Doc Exists
10
+
11
+ The default Quick Start in [starting-prompt.md](./starting-prompt.md) assumes LumenFlow is already set up. Real adoption sessions have three extra hazards that are not obvious from the main flow:
12
+
13
+ 1. `lane:setup` silently lost commits when `workspace.yaml` was untracked (fixed in WU-2591; older CLI versions still exhibit the bug).
14
+ 2. Enforcement hooks activate immediately after `lumenflow:integrate`, so any pre-existing uncommitted work suddenly needs a WU to commit — but that work was authored before lane lock, so no WU exists for it.
15
+ 3. The `LUMENFLOW_FORCE` / `LUMENFLOW_FORCE_REASON` escape hatch is legitimate exactly once during adoption, and misunderstanding that window leads to either data loss (force-pushing over history) or theatre (creating fake WUs to retroactively bless existing files).
16
+
17
+ Follow the sequence below to avoid all three.
18
+
19
+ ---
20
+
21
+ ## Pre-Flight: Clean Your Working Tree
22
+
23
+ Before `lumenflow init`, decide what to do with any uncommitted work:
24
+
25
+ ```bash
26
+ git status
27
+ ```
28
+
29
+ - **Clean tree:** proceed to the next section.
30
+ - **In-progress work you want to keep:** commit it first with your normal workflow, or `git stash` it. Do not run `lumenflow init` with uncommitted unrelated changes in the tree.
31
+ - **Incidental scratch:** discard it (`git restore`, `git clean -f`) — easier than reasoning about whether it belongs in the baseline commit.
32
+
33
+ Rule of thumb: **everything that exists in your working tree at the moment of `lumenflow init` is about to become "pre-LumenFlow baseline" from the workflow's point of view.** Make sure that framing is accurate.
34
+
35
+ ---
36
+
37
+ ## Step 1: Install and Initialize
38
+
39
+ ```bash
40
+ pnpm add -D @lumenflow/cli
41
+ pnpm lumenflow --client <claude-code | cursor | windsurf>
42
+ ```
43
+
44
+ `lumenflow init` generates `workspace.yaml`, LumenFlow directories (`.lumenflow/`, `{{DOCS_OPERATIONS_PATH}}/`), vendor config (`CLAUDE.md`, `AGENTS.md`, etc.), and — for clients that support it — enforcement hooks.
45
+
46
+ At this point `workspace.yaml` exists but is **untracked**. This is the trap.
47
+
48
+ ---
49
+
50
+ ## Step 2: Commit the Baseline Before `lane:setup`
51
+
52
+ This single command prevents the most common adoption footgun:
53
+
54
+ ```bash
55
+ git add workspace.yaml
56
+ git commit -m "chore: workspace.yaml baseline"
57
+ ```
58
+
59
+ Why: `lane:setup` uses micro-worktree isolation to produce an atomic commit of your lane definitions. It commits inside a temp branch, then merges into local main. If `workspace.yaml` is untracked in main at merge time, git refuses the merge ("would be overwritten by merge") and the cleanup step discards the temp branch — your lane setup commit is silently lost. Modern CLI versions (post-WU-2591) refuse to run and tell you to commit first. Older versions fail silently.
60
+
61
+ Also commit the other init-generated files in the same logical baseline. Keep it to one commit if you can:
62
+
63
+ ```bash
64
+ git add AGENTS.md CLAUDE.md LUMENFLOW.md .lumenflow/ .claude/ {{DOCS_OPERATIONS_PATH}}/
65
+ git commit -m "chore: LumenFlow scaffold"
66
+ ```
67
+
68
+ ---
69
+
70
+ ## Step 3: Lane Lifecycle
71
+
72
+ ```bash
73
+ pnpm lane:suggest # optional: infer lane topology from project structure
74
+ pnpm lane:setup # generate draft lane definitions
75
+ pnpm lane:list # inspect what was generated
76
+ pnpm lane:edit --name <lane> --rename <new-name> --add-path <glob> # tailor as needed
77
+ pnpm lane:validate
78
+ pnpm lane:lock
79
+ ```
80
+
81
+ Key points:
82
+
83
+ - `lane:setup` emits a set of opinionated template lanes. To reshape them into your topology, use `lane:edit --rename` (and `lane:remove` for ones you don't want). Do not hand-edit `workspace.yaml` — that violates [Constraint 9](../../../../../.lumenflow/constraints.md) and bypasses schema validation.
84
+ - `lane:list` is read-only and prints names, WIP limits, and code paths. Use it whenever you lose track of available lane names.
85
+ - Once `lane:lock` runs, the workflow transitions from setup mode to delivery mode: from now on, edits flow through WUs.
86
+
87
+ ---
88
+
89
+ ## Step 4: Handling Pre-Existing Work That Was Not Committed in Step 2
90
+
91
+ This is where most adoption sessions go wrong.
92
+
93
+ After `lane:lock`, enforcement hooks block any file edit that is not part of a claimed WU. If you still have pre-LumenFlow files in the working tree, you have two options:
94
+
95
+ ### Option A (recommended): Sealed Baseline Commit
96
+
97
+ Commit the pre-existing work as a single "baseline seal" using the documented escape hatch:
98
+
99
+ ```bash
100
+ git status # confirm scope — only pre-LumenFlow files should appear
101
+ git add <specific-files> # avoid blanket `git add -A`
102
+ LUMENFLOW_FORCE=1 \
103
+ LUMENFLOW_FORCE_REASON="Phase 0 baseline seal YYYY-MM-DD: pre-LumenFlow source (tests, docs, config) existing before lane lock. All subsequent edits route through WUs." \
104
+ git commit -m "chore: pre-LumenFlow baseline seal"
105
+ ```
106
+
107
+ This is the **one legitimate use** of `LUMENFLOW_FORCE` during adoption. The bypass is audited to `.lumenflow/force-bypasses.log` (git-tracked) with your reason. A specific, dated reason is more useful six months later than "bootstrap".
108
+
109
+ Rules:
110
+
111
+ - **One commit**, not several. If you find yourself wanting a second force commit, you are past the bootstrap window — stop and claim a WU instead.
112
+ - **Scope-check first.** Run `git diff --stat` and verify every path is genuinely pre-LumenFlow. Do not smuggle net-new work through the baseline seal.
113
+ - **Do not `--no-verify`**. The hook has an explicit escape; use it with a reason so the audit log remains coherent.
114
+
115
+ ### Option B: Retroactive WUs (not recommended)
116
+
117
+ Create one WU per lane, claim it, and commit the pre-existing files inside its worktree. This produces a trail of WUs whose evidence says "this WU authored these files" when the reality is "this WU ritualistically committed pre-existing content." That pollutes the evidence graph and is not a better audit trail — it is a worse one. Use this path only if you have a specific reason to split the baseline across lane boundaries for downstream metrics.
118
+
119
+ ---
120
+
121
+ ## Step 5: Verify and Commit the First Real WU
122
+
123
+ ```bash
124
+ pnpm lumenflow:doctor # expect clean or only informational notices
125
+ pnpm lane:status # should report "locked"
126
+ git status # should be clean
127
+ ```
128
+
129
+ If all three are green, create your first real WU:
130
+
131
+ ```bash
132
+ pnpm wu:create --lane "<Lane>" --title "..." --type feature --description "..."
133
+ pnpm wu:claim --id WU-NNNN --lane "<Lane>"
134
+ ```
135
+
136
+ From this point on, follow [first-15-mins.md](./first-15-mins.md) or [starting-prompt.md](./starting-prompt.md) as the canonical flow.
137
+
138
+ ---
139
+
140
+ ## When `LUMENFLOW_FORCE` Is NOT the Right Tool
141
+
142
+ The baseline seal in Step 4 is the only adoption-time use. `LUMENFLOW_FORCE` is **not** a way to:
143
+
144
+ - Skip a failing gate. Fix the gate or claim a bug WU.
145
+ - Commit from main without a WU after adoption is complete. Claim a WU.
146
+ - Work around the pre-commit hook because it is inconvenient. The hook is enforcing the rule; the rule is the point.
147
+ - Bypass `wu:done` to "finalize" a WU. Run `wu:prep` first and fix whatever it reports.
148
+
149
+ See [.lumenflow/constraints.md](../../../../../.lumenflow/constraints.md) ("Agent LUMENFLOW_FORCE Usage Policy") for the full policy. Agents must not use `LUMENFLOW_FORCE` without explicit user approval, except for the one-time baseline seal described above — and even then, a specific `LUMENFLOW_FORCE_REASON` is required.
150
+
151
+ ---
152
+
153
+ ## Common Footguns and Where to Find Them
154
+
155
+ | Symptom | Cause | Fix |
156
+ | :---------------------------------------------------------------- | :--------------------------------------------- | :----------------------------------------------------------------- |
157
+ | `lane:setup` prints "merge rejected" and exits | `workspace.yaml` untracked | Commit it first (Step 2). Modern CLI refuses before the temp merge |
158
+ | `lane:edit --name "Foo"` → "Lane not found" | Typo or drift from canonical "Parent: Sublane" | Run `pnpm lane:list`; use the "Did you mean" hint in the error |
159
+ | Pre-commit hook blocks a commit you believe is legitimate | Enforcement active, no claimed WU | Claim a WU first; use `LUMENFLOW_FORCE` only for the baseline seal |
160
+ | `lumenflow:doctor` reports managed files with uncommitted changes | Step 4 incomplete | Finish the baseline seal, then re-run doctor |
161
+ | A second `LUMENFLOW_FORCE` commit feels necessary | Scope of the baseline was underestimated | Revert the first, widen the scope, re-do as a single seal |
162
+
163
+ ---
164
+
165
+ ## Related Documentation
166
+
167
+ - [first-15-mins.md](./first-15-mins.md) — once the project is configured
168
+ - [starting-prompt.md](./starting-prompt.md) — full onboarding reference
169
+ - [.lumenflow/constraints.md](../../../../../.lumenflow/constraints.md) — LUMENFLOW_FORCE policy
170
+ - [lumenflow-force-usage.md](./lumenflow-force-usage.md) — retrospective analysis of real-world force-bypass usage
171
+ - [first-wu-mistakes.md](./first-wu-mistakes.md) — common WU-lifecycle errors after adoption
@@ -2,7 +2,9 @@
2
2
 
3
3
  **Last updated:** {{DATE}}
4
4
 
5
- A fast start for agents entering an existing LumenFlow project.
5
+ A fast start for agents entering an **already-configured** LumenFlow project.
6
+
7
+ > **Adopting LumenFlow right now?** If you are running `lumenflow init` on a project that has never used LumenFlow before, read [existing-project-bootstrap.md](./existing-project-bootstrap.md) first. This doc assumes `workspace.yaml` is committed, lanes are locked, and enforcement hooks are active.
6
8
 
7
9
  ---
8
10
 
@@ -340,7 +340,7 @@ sizing_estimate:
340
340
  pnpm wu:brief --id WU-XXX --client claude-code --strict-sizing
341
341
  ```
342
342
 
343
- See the [WU Sizing Guide](../../wu-sizing-guide.md) section 1.5 for the full contract specification.
343
+ See the [WU Sizing Guide](../../wu-sizing-guide.md) section 1.6 for the full contract specification.
344
344
 
345
345
  ---
346
346
 
@@ -25,7 +25,7 @@ Before orchestrating an initiative, ensure:
25
25
  When orchestrating an initiative, reason in these layers:
26
26
 
27
27
  1. **Planning** -- `orchestrate:initiative --dry-run` computes logical waves and bottlenecks.
28
- 2. **Handoff** -- `wu:delegate` / `wu:brief` generate worker context and record evidence.
28
+ 2. **Handoff** -- `wu:delegate` / `wu:brief` generate the canonical worker context and record evidence. `orchestrate:initiative -c` and continuous mode print lean launch summaries by default and point at durable handoff artifacts instead of dumping prompt bodies to stdout.
29
29
  3. **Execution** -- workers claim the WU and produce work in a worktree or branch-pr lane branch.
30
30
  4. **Reconciliation** -- the orchestrator inspects WU status, worktree/branch state, gate results, stamps, and memory receipts to decide what actually happened.
31
31
  5. **Finish** -- ready WUs go through `wu:prep`, then `wu:done` (or `wu:cleanup` after merge in branch-pr mode).
@@ -61,15 +61,20 @@ Before accepting the wave plan, sanity-check the decomposition. If several WUs s
61
61
 
62
62
  ### Step 2: Choose Execution Mode
63
63
 
64
- | Mode | Command | When to use |
65
- | --------------------- | ---------------------------------------------------- | -------------------------------------- |
66
- | Checkpoint-per-wave | `pnpm orchestrate:initiative -i INIT-XXX -c` | Large initiatives (>3 WUs or >2 waves) |
67
- | Continuous | `pnpm orchestrate:initiative -i INIT-XXX` | Small initiatives (<=3 WUs, 1-2 waves) |
68
- | Manual brief/delegate | `pnpm wu:brief --id WU-XXX --client <client>` per WU | Testing individual WUs, debugging |
69
- | Manual self-implement | `pnpm wu:brief --id WU-XXX --client <client>` per WU | You are implementing without sub-agent |
64
+ | Mode | Command | When to use |
65
+ | --------------------- | ------------------------------------------------------------- | --------------------------------------- |
66
+ | Checkpoint-per-wave | `pnpm orchestrate:initiative -i INIT-XXX -c` | Large initiatives (>3 WUs or >2 waves) |
67
+ | Continuous | `pnpm orchestrate:initiative -i INIT-XXX` | Small initiatives (<=3 WUs, 1-2 waves) |
68
+ | Inline handoff replay | `pnpm orchestrate:initiative -i INIT-XXX -c --print-handoffs` | Manual copy/paste from stored artifacts |
69
+ | Manual brief/delegate | `pnpm wu:brief --id WU-XXX --client <client>` per WU | Testing individual WUs, debugging |
70
+ | Manual self-implement | `pnpm wu:brief --id WU-XXX --client <client>` per WU | You are implementing without sub-agent |
70
71
 
71
72
  Checkpoint-per-wave is recommended for most initiatives. It processes one logical wave at a time and writes checkpoint artifacts before exiting, giving you control between waves.
72
73
 
74
+ `orchestrate:initiative -c` and continuous mode print the
75
+ wave summary, next actions, artifact bundle paths, and per-WU handoff file paths by default. Use
76
+ `--print-handoffs` only when a human needs the stored handoff body inline for manual copy/paste.
77
+
73
78
  ### Step 3: Delegate WUs
74
79
 
75
80
  For each WU in the current wave, choose delegation vs self-implementation:
@@ -96,6 +101,11 @@ pnpm wu:delegate --id WU-100 --parent-wu WU-050 --client claude-code
96
101
 
97
102
  `wu:brief` always outputs full WU context and records evidence in a single step. There is no separate evidence-only mode.
98
103
 
104
+ For supported clients, initiative orchestration uses the same canonical handoff renderer as
105
+ `wu:brief` / `wu:delegate` when it writes launch artifacts. Treat the stored handoff artifact as the
106
+ source of truth for launch content. Do not prepend or append a separate wrapper block around the
107
+ generated handoff.
108
+
99
109
  Whether you hand off manually or via `orchestrate:initiative`, the handoff material is only a launch candidate. A WU is not truly live until a worker claims it, and it is not complete until the lifecycle reaches its completion boundary:
100
110
 
101
111
  - **Launched** -- a worker actually claims the WU (or an equivalent launch receipt exists) and the worktree / lane branch exists.
@@ -108,7 +118,8 @@ Whether you hand off manually or via `orchestrate:initiative`, the handoff mater
108
118
  2. The `</constraints>` block is present near the end
109
119
  3. The `LUMENFLOW_TRUNCATION_WARNING` banner is at the start
110
120
 
111
- If any of these are missing, the prompt was truncated. Re-generate it or use `--codex` for a shorter format.
121
+ If any of these are missing, the prompt was truncated. Re-generate it or inspect the stored handoff
122
+ artifact via `--print-handoffs`. Do not "fix" a truncated brief by inventing extra wrapper text.
112
123
 
113
124
  ### Step 4: Monitor Progress
114
125
 
@@ -180,12 +191,12 @@ Wave 2 Agent (WU-103) │
180
191
 
181
192
  ### Key Commands
182
193
 
183
- | Command | Who runs it | When |
184
- | -------------------------------- | -------------- | ----------------------------- |
185
- | `mem:signal "msg" --wu WU-XXX` | Worker agent | After significant progress |
194
+ | Command | Who runs it | When |
195
+ | -------------------------------- | -------------- | --------------------------------- |
196
+ | `mem:signal "msg" --wu WU-XXX` | Worker agent | After significant progress |
186
197
  | `mem:inbox --since <duration>` | Orchestrator | Read signal traffic between waves |
187
- | `mem:checkpoint "msg" --wu WU-X` | Worker agent | Before risky operations |
188
- | `mem:ready --wu WU-XXX` | Recovery agent | When taking over a stuck WU |
198
+ | `mem:checkpoint "msg" --wu WU-X` | Worker agent | Before risky operations |
199
+ | `mem:ready --wu WU-XXX` | Recovery agent | When taking over a stuck WU |
189
200
 
190
201
  ### Signal Storage
191
202
 
@@ -204,6 +215,10 @@ When running with `--checkpoint-per-wave` (or `-c`):
204
215
  3. It writes checkpoint artifacts, including compatibility files under `.lumenflow/artifacts/waves/`
205
216
  4. It exits (does not poll or wait)
206
217
 
218
+ Stdout stays lean in this mode. By default it prints launch receipts and per-WU handoff artifact
219
+ paths, not inline XML/markdown bodies. `--print-handoffs` replays the stored handoff artifacts
220
+ inline when manual copy/paste is needed.
221
+
207
222
  If the selected client cannot be invoked directly, checkpoint mode may stop at handoff generation and wait for the operator or agent runtime to launch workers. Treat that as **handoff prepared**, not **execution proved**.
208
223
 
209
224
  ### Checkpoint Artifact Model
@@ -431,23 +446,24 @@ pnpm delegation:list --initiative INIT-XXX --json
431
446
 
432
447
  ## Quick Reference: All Orchestration Commands
433
448
 
434
- | Command | Description |
435
- | --------------------------------------------------- | -------------------------------------------------------- |
436
- | `pnpm orchestrate:initiative -i INIT-XXX --dry-run` | Preview logical waves and bottlenecks without executing |
437
- | `pnpm orchestrate:initiative -i INIT-XXX -c` | Prepare/launch one logical wave, write checkpoints, exit |
438
- | `pnpm orchestrate:initiative -i INIT-XXX` | Continue launch/reconciliation flow across waves |
439
- | `pnpm orchestrate:init-status -i INIT-XXX` | Initiative status surface (reconcile against WU truth when debugging) |
440
- | `pnpm orchestrate:monitor` | Detect stuck agents, zombie locks, and recovery signals |
441
- | `pnpm wu:brief --id WU-XXX --client <client>` | **MANDATORY after wu:claim.** Generate prompt + evidence |
442
- | `pnpm wu:delegate --id WU-XXX --parent-wu <P>` | Generate prompt + record delegation |
443
- | `pnpm delegation:list --initiative INIT-XXX` | View delegation tree / launch lineage |
444
- | `pnpm mem:signal "msg" --wu WU-XXX` | Broadcast coordination signal |
445
- | `pnpm mem:inbox --since <duration>` | Read signal traffic (not the full execution ledger) |
446
- | `pnpm mem:checkpoint "msg" --wu WU-XXX` | Save progress checkpoint |
447
- | `pnpm mem:ready --wu WU-XXX` | Check pending work/checkpoints |
448
- | `pnpm wu:block --id WU-XXX --reason "..."` | Block stuck WU |
449
- | `pnpm wu:unblock --id WU-XXX` | Unblock recovered WU |
450
- | `pnpm wu:release --id WU-XXX` | Release abandoned WU for re-claim |
449
+ | Command | Description |
450
+ | ------------------------------------------------------------- | ----------------------------------------------------------------------------- |
451
+ | `pnpm orchestrate:initiative -i INIT-XXX --dry-run` | Preview logical waves and bottlenecks without executing |
452
+ | `pnpm orchestrate:initiative -i INIT-XXX -c` | Prepare/launch one logical wave, write checkpoints, print lean launch summary |
453
+ | `pnpm orchestrate:initiative -i INIT-XXX` | Continue launch/reconciliation flow across waves with lean stdout |
454
+ | `pnpm orchestrate:initiative -i INIT-XXX -c --print-handoffs` | Replay stored handoff artifacts inline for manual copy/paste |
455
+ | `pnpm orchestrate:init-status -i INIT-XXX` | Initiative status surface (reconcile against WU truth when debugging) |
456
+ | `pnpm orchestrate:monitor` | Detect stuck agents, zombie locks, and recovery signals |
457
+ | `pnpm wu:brief --id WU-XXX --client <client>` | **MANDATORY after wu:claim.** Generate the canonical full handoff + evidence |
458
+ | `pnpm wu:delegate --id WU-XXX --parent-wu <P>` | Generate prompt + record delegation |
459
+ | `pnpm delegation:list --initiative INIT-XXX` | View delegation tree / launch lineage |
460
+ | `pnpm mem:signal "msg" --wu WU-XXX` | Broadcast coordination signal |
461
+ | `pnpm mem:inbox --since <duration>` | Read signal traffic (not the full execution ledger) |
462
+ | `pnpm mem:checkpoint "msg" --wu WU-XXX` | Save progress checkpoint |
463
+ | `pnpm mem:ready --wu WU-XXX` | Check pending work/checkpoints |
464
+ | `pnpm wu:block --id WU-XXX --reason "..."` | Block stuck WU |
465
+ | `pnpm wu:unblock --id WU-XXX` | Unblock recovered WU |
466
+ | `pnpm wu:release --id WU-XXX` | Release abandoned WU for re-claim |
451
467
 
452
468
  ---
453
469
 
@@ -21,6 +21,9 @@ Reference for CLI commands. Organized by category for quick discovery.
21
21
  >
22
22
  > **Never conclude a command doesn't exist without running `pnpm lumenflow:commands` first.**
23
23
  >
24
+ > Maintainers: when the public CLI surface changes, update the canonical onboarding sources and
25
+ > rerun `pnpm docs:sync` so scaffold-like onboarding copies stay aligned.
26
+ >
24
27
  > Repo-only scripts such as `pnpm docs:validate`, `pnpm docs:generate`, and
25
28
  > `pnpm pre-release:check` are maintainer scripts, not part of the public CLI manifest.
26
29
  >
@@ -73,9 +76,9 @@ Run `--help` first, then run the real command with explicit flags.
73
76
  | `pnpm lumenflow:upgrade` | Upgrade LumenFlow packages |
74
77
  | `pnpm lumenflow:doctor` | Diagnose LumenFlow configuration |
75
78
  | `pnpm lumenflow:integrate` | Generate enforcement hooks for client |
76
- | `pnpm lumenflow:disable` | Turn enforcement off reversibly (regenerates hooks as no-ops) |
77
- | `pnpm lumenflow:enable` | Re-enable enforcement after `lumenflow:disable` (restores prior state) |
78
- | `pnpm lumenflow:uninstall` | Remove LumenFlow-generated files (dry-run by default; `--confirm` required) |
79
+ | `pnpm lumenflow:disable` | Turn enforcement off reversibly (regenerates hooks as no-ops) |
80
+ | `pnpm lumenflow:enable` | Re-enable enforcement after `lumenflow:disable` (restores prior state) |
81
+ | `pnpm lumenflow:uninstall` | Remove LumenFlow-generated files (dry-run by default; `--confirm` required) |
79
82
  | `pnpm cloud:connect` | Configure cloud control-plane access |
80
83
  | `npx lumenflow commands` | List all available CLI commands |
81
84
 
@@ -196,32 +199,32 @@ without explicit human instruction.**
196
199
 
197
200
  ## Gates & Quality
198
201
 
199
- | Command | Description |
200
- | ------------------------------------------------------------------ | ---------------------------------------------------- |
201
- | `pnpm gates` | Run all quality gates |
202
- | `pnpm gates:docs` | Preferred docs-only alias (`pnpm gates --docs-only`) |
203
- | `pnpm gates --docs-only` | Equivalent flag form for docs-only gates |
204
- | `pnpm format` | Format all files (Prettier) |
205
- | `pnpm format:check` | Check formatting without changes |
206
- | `pnpm lint` | Run ESLint |
207
- | `pnpm typecheck` | Run TypeScript type checking |
208
- | `pnpm test` | Run all tests (Vitest) |
209
- | `pnpm spec:linter` | Validate WU specs (all) ¹ |
210
- | `pnpm lane:health` | Check lane config health |
211
- | `pnpm lane:suggest --output workspace.lanes.yaml` | Generate a workspace lane-definition snippet |
212
- | `pnpm lane:status` | Show lane lifecycle status |
213
- | `pnpm lane:setup` | Create/update draft lane config |
214
- | `pnpm lane:validate` | Validate lane draft artifacts |
215
- | `pnpm lane:lock` | Lock lane lifecycle for WU create |
216
- | `pnpm lane:edit --name <L>` | Edit lane definition (rename, wip-limit, paths) |
217
- | `pnpm gate:co-change --add --name <N> --trigger <G> --require <G>` | Add co-change gate rule |
218
- | `pnpm gate:co-change --remove --name <N>` | Remove co-change gate rule |
219
- | `pnpm gate:co-change --edit --name <N> --severity <S>` | Edit co-change gate rule |
220
- | `pnpm gate:co-change --list` | List all co-change rules (built-in + custom) |
202
+ | Command | Description |
203
+ | -------------------------------------------------------------------- | ---------------------------------------------------- |
204
+ | `pnpm gates` | Run all quality gates |
205
+ | `pnpm gates:docs` | Preferred docs-only alias (`pnpm gates --docs-only`) |
206
+ | `pnpm gates --docs-only` | Equivalent flag form for docs-only gates |
207
+ | `pnpm format` | Format all files (Prettier) |
208
+ | `pnpm format:check` | Check formatting without changes |
209
+ | `pnpm lint` | Run ESLint |
210
+ | `pnpm typecheck` | Run TypeScript type checking |
211
+ | `pnpm test` | Run all tests (Vitest) |
212
+ | `pnpm spec:linter` | Validate WU specs (all) ¹ |
213
+ | `pnpm lane:health` | Check lane config health |
214
+ | `pnpm lane:suggest --output workspace.lanes.yaml` | Generate a workspace lane-definition snippet |
215
+ | `pnpm lane:status` | Show lane lifecycle status |
216
+ | `pnpm lane:setup` | Create/update draft lane config |
217
+ | `pnpm lane:validate` | Validate lane draft artifacts |
218
+ | `pnpm lane:lock` | Lock lane lifecycle for WU create |
219
+ | `pnpm lane:edit --name <L>` | Edit lane definition (rename, wip-limit, paths) |
220
+ | `pnpm gate:co-change --add --name <N> --trigger <G> --require <G>` | Add co-change gate rule |
221
+ | `pnpm gate:co-change --remove --name <N>` | Remove co-change gate rule |
222
+ | `pnpm gate:co-change --edit --name <N> --severity <S>` | Edit co-change gate rule |
223
+ | `pnpm gate:co-change --list` | List all co-change rules (built-in + custom) |
221
224
  | `pnpm gate:conditional --add --name <N> --trigger <G> --command <C>` | Add conditional command |
222
- | `pnpm gate:conditional --remove --name <N>` | Remove conditional command |
223
- | `pnpm gate:conditional --edit --name <N> --severity <S>` | Edit conditional command |
224
- | `pnpm gate:conditional --list [--json]` | List conditional commands |
225
+ | `pnpm gate:conditional --remove --name <N>` | Remove conditional command |
226
+ | `pnpm gate:conditional --edit --name <N> --severity <S>` | Edit conditional command |
227
+ | `pnpm gate:conditional --list [--json]` | List conditional commands |
225
228
 
226
229
  ¹ **Script aliases:** `spec:linter` and `tasks:validate` are pnpm script aliases
227
230
  for `wu:validate --all`. They are not standalone CLI commands.
@@ -456,12 +459,12 @@ pnpm initiative:edit --id INIT-025 --phase-id 1 --phase-status in_progress
456
459
 
457
460
  ## Orchestration
458
461
 
459
- | Command | Description |
460
- | -------------------------------------------- | --------------------------------- |
461
- | `pnpm orchestrate:initiative --id INIT-XXX` | Orchestrate initiative execution |
462
- | `pnpm orchestrate:init-status --id INIT-XXX` | Initiative status surface |
462
+ | Command | Description |
463
+ | -------------------------------------------- | ---------------------------------------------- |
464
+ | `pnpm orchestrate:initiative --id INIT-XXX` | Orchestrate initiative execution |
465
+ | `pnpm orchestrate:init-status --id INIT-XXX` | Initiative status surface |
463
466
  | `pnpm orchestrate:monitor` | Monitor launches, stalls, and recovery signals |
464
- | `pnpm delegation:list` | List delegation / launch receipts |
467
+ | `pnpm delegation:list` | List delegation / launch receipts |
465
468
 
466
469
  Treat orchestration as a control plane: planning, handoff, execution, reconciliation, finish, and status are separate concerns. `mem:inbox` carries signal traffic only, and a worker reply is not WU completion; reconcile live truth against WU status, worktree / branch presence, gates, stamps, and integrity evidence. For the complete orchestration workflow (delegation, memory coordination, failure recovery, logical-wave vs launch-attempt semantics, and checkpoint-per-wave mechanics), see [initiative-orchestration.md](initiative-orchestration.md).
467
470
 
@@ -33,8 +33,9 @@ pnpm release --release-version 1.3.0 --skip-publish
33
33
  3. Syncs templates with source docs (`pnpm lumenflow:sync-templates`)
34
34
  4. Bumps all `@lumenflow/*` package versions using micro-worktree isolation
35
35
  5. Builds all packages
36
- 6. Creates and pushes git tag `vX.Y.Z`
37
- 7. Optionally publishes to npm (unless `--skip-publish`)
36
+ 6. Validates packed artifacts against package contracts
37
+ 7. Creates and pushes git tag `vX.Y.Z`
38
+ 8. Optionally publishes to npm (unless `--skip-publish`)
38
39
 
39
40
  ### Options
40
41
 
@@ -42,7 +43,7 @@ pnpm release --release-version 1.3.0 --skip-publish
42
43
  | --------------------------- | --------------------------------------- |
43
44
  | `--release-version <X.Y.Z>` | **Required.** Semver version to release |
44
45
  | `--dry-run` | Preview changes without making them |
45
- | `--skip-publish` | Bump and tag only (no npm publish) |
46
+ | `--skip-publish` | Skip npm publish only; validation still runs |
46
47
  | `--skip-build` | Skip build step (use existing dist) |
47
48
  | `--version`, `-V` | Show CLI version |
48
49
  | `--help`, `-h` | Show help |
@@ -50,10 +51,10 @@ pnpm release --release-version 1.3.0 --skip-publish
50
51
  ### Examples
51
52
 
52
53
  ```bash
53
- # Version bump and tag only (CI will publish)
54
+ # Version bump and tag only (CI will publish after local validation passes)
54
55
  pnpm release --release-version 1.3.0 --skip-publish
55
56
 
56
- # Preview what would happen
57
+ # Preview what would happen, including packed-artifact validation
57
58
  pnpm release --release-version 1.3.0 --skip-publish --dry-run
58
59
  ```
59
60
 
@@ -404,11 +405,11 @@ Use this as the standard workflow:
404
405
  # Preview first
405
406
  pnpm release --release-version 1.3.0 --skip-publish --dry-run
406
407
 
407
- # Execute (version bump + tag, publish delegated to GitHub Actions)
408
+ # Execute (version bump + validation + tag, publish delegated to GitHub Actions)
408
409
  pnpm release --release-version 1.3.0 --skip-publish
409
410
  ```
410
411
 
411
- This handles version bump and tag locally; GitHub Actions handles npm publish, GitHub release creation, and the docs build/deploy path when the Vercel secrets are configured correctly.
412
+ This handles version bump, packed-artifact validation, and tag creation locally; GitHub Actions handles npm publish, GitHub release creation, and the docs build/deploy path when the Vercel secrets are configured correctly.
412
413
 
413
414
  ### Release Steps (Manual)
414
415
 
@@ -19,6 +19,8 @@ pnpm lumenflow:commands # List public CLI commands, aliases, and legacy surfa
19
19
  LumenFlow has commands for WU lifecycle, maintenance, memory, initiatives, orchestration, metrics, packs, and more. Never guess or assume — run `pnpm lumenflow:commands` first.
20
20
  Repo-only scripts such as `pnpm docs:validate` and `pnpm pre-release:check` are monorepo scripts,
21
21
  not part of that public command list.
22
+ When the public CLI surface changes, update the canonical onboarding sources and rerun
23
+ `pnpm docs:sync` so scaffold-like onboarding copies stay aligned.
22
24
 
23
25
  ### Help-First Rule
24
26
 
@@ -127,6 +127,68 @@ pnpm wu:prep --id WU-XXX
127
127
 
128
128
  Feature WUs **must** include `spec_refs` (use `pnpm wu:create --plan` if the plan exists only in conversation).
129
129
 
130
+ ### Scoped Gate Parity Between `wu:prep` and `wu:done`
131
+
132
+ When a WU declares `tests.unit`, both `wu:prep` and `wu:done` reuse that same scoped unit-test
133
+ surface. A green `wu:prep` should not be followed by a broader repo-wide `wu:done` test rerun for
134
+ the same unchanged worktree.
135
+
136
+ - If `wu:done` fails outside that scope after a green `wu:prep`, treat it as real drift or a new
137
+ main-branch regression and investigate that root cause.
138
+ - Use `--skip-gates` only when `wu:prep` already confirmed the failure is pre-existing on main and
139
+ you have a real `--fix-wu` recorded for the follow-up.
140
+ - If you intentionally want broader coverage during prep, pass `pnpm wu:prep --id WU-XXX --full-tests`.
141
+
142
+ ### "Known bootstrap-trap detected"
143
+
144
+ `wu:prep` now distinguishes ordinary gate failures from the two bootstrap traps that repeatedly
145
+ showed up during the INIT-058 pack moves:
146
+
147
+ - package export / cross-module resolution failures:
148
+ `ERR_PACKAGE_PATH_NOT_EXPORTED` or `Package subpath ... is not defined by "exports"`
149
+ - dependency-cycle failures:
150
+ `Invalid package dependency graph`, `cyclic dependency`, or `turbo cycle`
151
+
152
+ Use the surfaced remediation path:
153
+
154
+ 1. Inspect the message that `wu:prep` printed. It tells you which signature matched.
155
+ 2. Verify the worktree build with `pnpm build`.
156
+ 3. If `pnpm build` is green and `wu:prep` identified the package-export trap, use the surfaced
157
+ audited completion command from main:
158
+
159
+ ```bash
160
+ cd /path/to/main && pnpm wu:done --id WU-XXX --skip-gates --reason "bootstrap-trap: pack file moves cause wu:prep cross-module resolution; worktree build green" --fix-wu WU-XXXX
161
+ ```
162
+
163
+ 4. Replace `WU-XXXX` with the follow-up WU that lands the export-surface fix.
164
+ 5. If `pnpm build` itself fails with a package-export or dependency-cycle signature, do **not**
165
+ skip gates. Fix the package surface or dependency graph first, then rerun `pnpm wu:prep --id WU-XXX`.
166
+
167
+ ### "Missing automated test diff evidence"
168
+
169
+ `wu:prep` now reads the resolved
170
+ `software_delivery.gates.tdd_diff_evidence` policy. It does **not** assume that
171
+ every repository or every WU is governed by the same hardcoded TDD rule.
172
+
173
+ Default behavior:
174
+
175
+ - `software_delivery.methodology.testing: tdd` =>
176
+ `software_delivery.gates.tdd_diff_evidence.mode: block`
177
+ - `software_delivery.methodology.testing: test-after` =>
178
+ `software_delivery.gates.tdd_diff_evidence.mode: off`
179
+ - `software_delivery.methodology.testing: none` =>
180
+ `software_delivery.gates.tdd_diff_evidence.mode: off`
181
+ - default `applies_to_types` => `feature`, `bug`
182
+ - default `exempt_paths` => `[]`
183
+
184
+ If `wu:prep` blocks on automated test diff evidence:
185
+
186
+ 1. Add or update the relevant automated test files in your branch, or
187
+ 2. Adjust workspace policy if the team wants different covered WU types or
188
+ path-based exemptions, or
189
+ 3. Use `tdd-exception: <reason>` in WU notes only when the WU is intentionally
190
+ exempt and policy does not already exclude it
191
+
130
192
  ---
131
193
 
132
194
  ### "non-fast-forward" or "branch is behind main"