@lumenflow/cli 5.7.17 → 5.7.21

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 (37) hide show
  1. package/README.md +63 -61
  2. package/dist/agent-runtime-enrollment-events.js +1 -1
  3. package/dist/agent-runtime-enrollment-events.js.map +1 -1
  4. package/dist/cost-summary.js +160 -3
  5. package/dist/cost-summary.js.map +1 -1
  6. package/dist/events-validate-core.js +169 -0
  7. package/dist/events-validate-core.js.map +1 -0
  8. package/dist/events-validate.js +48 -0
  9. package/dist/events-validate.js.map +1 -0
  10. package/dist/orchestrate-pre-phase-audit.js +83 -0
  11. package/dist/orchestrate-pre-phase-audit.js.map +1 -0
  12. package/dist/public-manifest.js +18 -2
  13. package/dist/public-manifest.js.map +1 -1
  14. package/dist/wu-claim-branch.js +2 -2
  15. package/dist/wu-claim-branch.js.map +1 -1
  16. package/dist/wu-claim-worktree.js +1 -1
  17. package/dist/wu-claim-worktree.js.map +1 -1
  18. package/dist/wu-claim.js +1 -1
  19. package/dist/wu-claim.js.map +1 -1
  20. package/dist/wu-create-orchestration-advisory.js +32 -0
  21. package/dist/wu-create-orchestration-advisory.js.map +1 -0
  22. package/dist/wu-create.js +24 -3
  23. package/dist/wu-create.js.map +1 -1
  24. package/dist/wu-proto.js +72 -6
  25. package/dist/wu-proto.js.map +1 -1
  26. package/dist/wu-spawn-strategy-resolver.js +74 -3
  27. package/dist/wu-spawn-strategy-resolver.js.map +1 -1
  28. package/package.json +13 -11
  29. package/packs/agent-runtime/package.json +1 -1
  30. package/packs/sidekick/package.json +1 -1
  31. package/packs/software-delivery/package.json +1 -1
  32. package/templates/core/AGENTS.md.template +4 -4
  33. package/templates/core/LUMENFLOW.md.template +5 -5
  34. package/templates/core/ai/onboarding/agent-invocation-guide.md.template +10 -4
  35. package/templates/core/ai/onboarding/existing-project-bootstrap.md.template +17 -0
  36. package/templates/core/ai/onboarding/quick-ref-commands.md.template +6 -2
  37. package/templates/core/ai/onboarding/wu-create-checklist.md.template +18 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumenflow/cli",
3
- "version": "5.7.17",
3
+ "version": "5.7.21",
4
4
  "description": "Command-line interface for LumenFlow workflow framework",
5
5
  "keywords": [
6
6
  "lumenflow",
@@ -45,6 +45,7 @@
45
45
  "cost-summary": "./dist/cost-summary.js",
46
46
  "db-journal-recover": "./dist/db-journal-recover.js",
47
47
  "delegation-list": "./dist/delegation-list.js",
48
+ "events-validate": "./dist/events-validate.js",
48
49
  "file-delete": "./dist/file-delete.js",
49
50
  "file-edit": "./dist/file-edit.js",
50
51
  "file-read": "./dist/file-read.js",
@@ -120,6 +121,7 @@
120
121
  "orchestrate-init-status": "./dist/orchestrate-init-status.js",
121
122
  "orchestrate-initiative": "./dist/orchestrate-initiative.js",
122
123
  "orchestrate-monitor": "./dist/orchestrate-monitor.js",
124
+ "orchestrate-pre-phase-audit": "./dist/orchestrate-pre-phase-audit.js",
123
125
  "pack-author": "./dist/pack-author.js",
124
126
  "pack-hash": "./dist/pack-hash.js",
125
127
  "pack-install": "./dist/pack-install.js",
@@ -201,16 +203,16 @@
201
203
  "xstate": "^5.28.0",
202
204
  "yaml": "^2.8.2",
203
205
  "zod": "^4.3.6",
204
- "@lumenflow/initiatives": "5.7.17",
205
- "@lumenflow/agent": "5.7.17",
206
- "@lumenflow/control-plane-sdk": "5.7.17",
207
- "@lumenflow/core": "5.7.17",
208
- "@lumenflow/host": "^5.7.17",
209
- "@lumenflow/memory": "5.7.17",
210
- "@lumenflow/kernel": "5.7.17",
211
- "@lumenflow/packs-software-delivery": "^5.7.17",
212
- "@lumenflow/metrics": "5.7.17",
213
- "@lumenflow/packs-agent-runtime": "^5.7.17"
206
+ "@lumenflow/initiatives": "5.7.21",
207
+ "@lumenflow/host": "^5.7.21",
208
+ "@lumenflow/agent": "5.7.21",
209
+ "@lumenflow/memory": "5.7.21",
210
+ "@lumenflow/kernel": "5.7.21",
211
+ "@lumenflow/metrics": "5.7.21",
212
+ "@lumenflow/packs-agent-runtime": "^5.7.21",
213
+ "@lumenflow/control-plane-sdk": "5.7.21",
214
+ "@lumenflow/packs-software-delivery": "^5.7.21",
215
+ "@lumenflow/core": "5.7.21"
214
216
  },
215
217
  "devDependencies": {
216
218
  "@vitest/coverage-v8": "^4.0.18",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumenflow/packs-agent-runtime",
3
- "version": "5.7.17",
3
+ "version": "5.7.21",
4
4
  "description": "Agent runtime pack scaffold for LumenFlow — governed model-turn execution, pack config, and provider capability baselines",
5
5
  "keywords": [
6
6
  "lumenflow",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumenflow/packs-sidekick",
3
- "version": "5.7.17",
3
+ "version": "5.7.21",
4
4
  "description": "Sidekick personal assistant pack for LumenFlow — 16 tools for task management, typed memory, channels, routines, and audit",
5
5
  "keywords": [
6
6
  "lumenflow",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumenflow/packs-software-delivery",
3
- "version": "5.7.17",
3
+ "version": "5.7.21",
4
4
  "description": "Software delivery pack for LumenFlow — work units, gates, lanes, initiatives, and agent coordination",
5
5
  "keywords": [
6
6
  "lumenflow",
@@ -45,7 +45,7 @@ pnpm lane:lock
45
45
  pnpm wu:claim --id WU-XXXX --lane <Lane>
46
46
  cd worktrees/<lane>-wu-xxxx
47
47
 
48
- # 2. Record handoff evidence (MANDATORY — wu:done blocks without this)
48
+ # 2. Record canonical handoff evidence (MANDATORY — wu:done blocks without this)
49
49
  pnpm wu:brief --id WU-XXXX --client <client>
50
50
 
51
51
  # 3. Engage disciplines (see below)
@@ -71,7 +71,7 @@ cd <project-root> && pnpm wu:done --id WU-XXXX
71
71
 
72
72
  Step 2 above is not optional:
73
73
 
74
- - `wu:brief` records checkpoint evidence; `wu:done` **blocks** without it for feature/bug WUs.
74
+ - `wu:brief` is the singular canonical handoff source of truth after `wu:claim`; it records checkpoint evidence, and `wu:done` **blocks** without it for feature/bug WUs.
75
75
  - `wu:brief` also auto-loads shared memory and coordination signals into the generated prompt (WU-1240, WU-2607) — read the `## Memory Context` section in the brief output before coding. Manual `mem:context`/`mem:inbox` calls are still available as ad-hoc lookups mid-WU.
76
76
  - Load relevant skills (`design-first`, `tdd-workflow`, `frontend-design`, `worktree-discipline`, `lumenflow-gates`) via your vendor's skill primitive. Claude Code, Codex, Cursor, and Windsurf all support `SKILL.md`-based skills (with minor invocation differences); Aider uses `CONVENTIONS.md`; Cline uses `.clinerules`. See [LUMENFLOW.md "Skills & Agents"](LUMENFLOW.md#skills--agents) for the invocation table, and your per-vendor rules file for specifics.
77
77
 
@@ -381,7 +381,7 @@ A skill named in prose does nothing — load it through the vendor's invocation
381
381
  | ------------ | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
382
382
  | 1. Create WU | main | `pnpm wu:create --lane <Lane> --title "Title" --description "..." --acceptance "..." --code-paths "..." --test-paths-unit "..." --exposure backend-only` (ID auto-generated) |
383
383
  | 2. Claim | main | `pnpm wu:claim --id WU-XXX --lane <Lane>` |
384
- | 3. Brief | worktree | `cd worktrees/<lane>-wu-xxx && pnpm wu:brief --id WU-XXX --client <client>` **(mandatory — wu:done blocks without this)** |
384
+ | 3. Brief | worktree | `cd worktrees/<lane>-wu-xxx && pnpm wu:brief --id WU-XXX --client <client>` **(canonical handoff; mandatory — wu:done blocks without this)** |
385
385
  | 4. Work | worktree | Implement changes per acceptance criteria |
386
386
  | 5. Prep | worktree | `pnpm wu:prep --id WU-XXX` (runs gates) |
387
387
  | 6. Complete | main | `pnpm wu:done --id WU-XXX` (copy-paste from wu:prep) |
@@ -392,7 +392,7 @@ A skill named in prose does nothing — load it through the vendor's invocation
392
392
  | ------------ | ----------- | ------------------------------------------------------------------------------------------- |
393
393
  | 1. Create WU | lane branch | `pnpm wu:create --lane <Lane> --title "..." ... --cloud` (ID auto-generated) |
394
394
  | 2. Claim | lane branch | `pnpm wu:claim --id WU-XXX --lane <Lane> --cloud` |
395
- | 3. Brief | lane branch | `pnpm wu:brief --id WU-XXX --client <client>` **(mandatory — wu:done blocks without this)** |
395
+ | 3. Brief | lane branch | `pnpm wu:brief --id WU-XXX --client <client>` **(canonical handoff; mandatory — wu:done blocks without this)** |
396
396
  | 4. Work | lane branch | Work on `lane/<lane>/wu-xxx` in cloud environment |
397
397
  | 5. Prep | lane branch | `pnpm wu:prep --id WU-XXX` (validates branch, runs gates) |
398
398
  | 6. Complete | lane branch | `pnpm wu:done --id WU-XXX` (creates PR) |
@@ -50,7 +50,7 @@ cd worktrees/<lane>-wu-xxxx
50
50
  # 4b. Build CLI in worktree (required for gates)
51
51
  pnpm bootstrap
52
52
 
53
- # 4c. Run wu:brief (MANDATORY — wu:done blocks without this)
53
+ # 4c. Run wu:brief (canonical handoff; MANDATORY — wu:done blocks without this)
54
54
  pnpm wu:brief --id WU-XXXX --client <client>
55
55
 
56
56
  # 5. Implement in worktree
@@ -238,7 +238,7 @@ If a fact would help a different vendor working the same repo, it belongs in sha
238
238
 
239
239
  ### Before you code (auto-loaded by wu:brief)
240
240
 
241
- `wu:brief` auto-loads the read-side of the memory contract into the generated prompt under a `## Memory Context` section (WU-1240, WU-2607). It includes WU-scoped discoveries, summaries, project profile, and coordination signals from peer agents since `wu:claim`. Read that section before writing code — skipping it means working blind to what peer agents already found.
241
+ `wu:brief` is the singular canonical handoff source of truth after `wu:claim`. It auto-loads the read-side of the memory contract into the generated prompt under a `## Memory Context` section (WU-1240, WU-2607). It includes WU-scoped discoveries, summaries, project profile, and coordination signals from peer agents since `wu:claim`. Read that section before writing code — skipping it means working blind to what peer agents already found.
242
242
 
243
243
  For ad-hoc lookups mid-WU (rarely needed; the brief is normally sufficient):
244
244
 
@@ -556,7 +556,7 @@ For the full worktree lifecycle (parallel execution, bootstrap, isolation guaran
556
556
  | `pnpm wu:unblock` | Unblock WU (transitions to in_progress) |
557
557
  | `pnpm wu:release` | Release orphaned WU (in_progress to ready) AND reset lane branch (WU-2941) |
558
558
  | `pnpm wu:status` | Show WU status, location, and valid commands |
559
- | `pnpm wu:brief` | **MANDATORY after wu:claim.** Generate handoff prompt + record evidence |
559
+ | `pnpm wu:brief` | **MANDATORY after wu:claim.** Generate canonical handoff prompt + record evidence |
560
560
  | `pnpm wu:delegate` | Generate prompt + record lineage + brief hash attestation |
561
561
  | `pnpm wu:validate` | Validate WU spec completeness and schema |
562
562
  | `pnpm wu:recover` | Analyze and fix WU state inconsistencies |
@@ -968,7 +968,7 @@ is required for `pnpm db:reset` and similar workflows. Non-blocking informationa
968
968
  | `pnpm flow:report` | Generate flow metrics report |
969
969
  | `pnpm flow:bottlenecks` | Identify flow bottlenecks |
970
970
  | `pnpm metrics:snapshot` | Capture metrics snapshot |
971
- | `pnpm cost:summary` | Summarize local cost telemetry |
971
+ | `pnpm cost:summary` | Summarize local cost telemetry; use `--brief` for local wu:brief token metrics |
972
972
  | `pnpm strict:progress` | Report strict TypeScript backlog and guard regressions |
973
973
 
974
974
  ### State Management
@@ -1096,7 +1096,7 @@ Recommended framework roster (vendor-neutral aliases):
1096
1096
  Client-specific overlays may implement these aliases in different native surfaces such as
1097
1097
  `.claude/agents/`, `.codex/agents/`, or vendor rule/config directories.
1098
1098
 
1099
- Generate handoff prompts (prompt-only, execution is a separate step): `pnpm wu:brief --id WU-XXX --client <client>`
1099
+ Generate the canonical handoff prompt and record evidence after claim: `pnpm wu:brief --id WU-XXX --client <client>`
1100
1100
  Record explicit delegation lineage when needed: `pnpm wu:delegate --id WU-XXX --parent-wu WU-YYY --client <client>`
1101
1101
 
1102
1102
  Supported clients: `claude-code`, `codex-cli`, `cursor`, `gemini-cli`, `windsurf`
@@ -2,7 +2,7 @@
2
2
 
3
3
  **Last updated:** {{DATE}}
4
4
 
5
- This guide defines how to generate and hand off sub-agent delegation briefs, or record `wu:brief` evidence for self-implementation, so agents start with the right context, follow LumenFlow constraints, and leave durable artifacts for handoff.
5
+ This guide defines how to generate and hand off sub-agent delegation briefs, or record canonical `wu:brief` evidence for self-implementation, so agents start with the right context, follow LumenFlow constraints, and leave durable artifacts for handoff.
6
6
 
7
7
  Use this document when:
8
8
 
@@ -38,7 +38,7 @@ Use Tier 1 after `/clear` to stay lean, then load more only if needed.
38
38
  ## 2) Session Management (Start Fresh)
39
39
 
40
40
  When approaching context limits, **start a fresh agent instead of compaction**.
41
- The handoff prompt is the bridge between sessions. `wu:brief` always generates the full WU context prompt and records evidence, whether you are delegating or self-implementing.
41
+ The handoff prompt is the bridge between sessions. After `wu:claim`, `wu:brief` is the singular canonical handoff source of truth: it always generates the full WU context prompt and records evidence, whether you are delegating or self-implementing.
42
42
 
43
43
  **Mandatory triggers:**
44
44
 
@@ -129,13 +129,19 @@ pnpm wu:brief --id WU-XXX --client <client>
129
129
  # Then continue implementation directly in this session (no Task spawn).
130
130
  ```
131
131
 
132
- `wu:brief` always provides full context and records evidence in a single step. Use delegation flow (`wu:delegate`) only when you need auditable lineage tracking for initiative work.
132
+ `wu:brief` is still required for self-implementation. It is the canonical handoff source after claim and always provides full context and records evidence in a single step. Use delegation flow (`wu:delegate`) only when you need auditable lineage tracking for initiative work.
133
+
134
+ For local prompt accounting, add `--report-tokens`. The command prints total
135
+ and section-level token counts, appends a schema-versioned
136
+ `brief:token_reported` record to `.lumenflow/telemetry/brief-metrics.ndjson`,
137
+ and keeps the data local unless a separate telemetry sync is configured. Review
138
+ history with `pnpm cost:summary --brief`.
133
139
 
134
140
  ---
135
141
 
136
142
  ## 3) Canonical Handoff Surfaces
137
143
 
138
- Use the canonical handoff output verbatim when you have it:
144
+ Use the canonical handoff output verbatim when you have it. For a claimed WU, `wu:brief` is the singular handoff source of truth; do not replace it with ad-hoc notes or a local summary.
139
145
 
140
146
  - `pnpm wu:brief --id WU-XXX --client <client>` for self-implementation
141
147
  - `pnpm wu:delegate --id WU-XXX --parent-wu <P> --client <client>` for auditable delegation
@@ -45,6 +45,23 @@ pnpm lumenflow --client <claude-code | cursor | windsurf>
45
45
 
46
46
  At this point `workspace.yaml` exists but is **untracked**. This is the trap.
47
47
 
48
+ ### Existing LumenFlow Projects: Upgrade First
49
+
50
+ If the project already has LumenFlow files and package dependencies, do not reinstall or
51
+ manually edit dependency versions. Run the managed upgrade command from the integration
52
+ checkout:
53
+
54
+ ```bash
55
+ pnpm lumenflow:upgrade --latest
56
+ ```
57
+
58
+ After upgrade, `package.json` and `pnpm-lock.yaml` should contain the published
59
+ `@lumenflow/*` packages managed by the command, with `@lumenflow/cli` as the CLI
60
+ entrypoint. The old unscoped `lumenflow` wrapper is private/internal and should not
61
+ remain in consumer dependencies or lockfile entries. If the command reports a
62
+ non-fatal `NPM_TOKEN` config warning, set the token for private registry access or
63
+ remove the stale placeholder from `.npmrc`; a successful install is still valid.
64
+
48
65
  ---
49
66
 
50
67
  ## Step 2: Commit the Baseline Before `lane:setup`
@@ -153,7 +153,8 @@ you want to refresh docs without upgrading packages (e.g., after manually editin
153
153
  | `pnpm wu:unblock --id WU-XXX` | Unblock WU (ownership-guarded, v3.19.0) |
154
154
  | `pnpm wu:release --id WU-XXX --reason "..."` | Release orphaned WU (ownership-guarded, v3.19.0) |
155
155
  | `pnpm wu:status --id WU-XXX` | Show WU status, location, valid commands |
156
- | `pnpm wu:brief --id WU-XXX --client <client>` | **MANDATORY after wu:claim.** Generate handoff prompt + record evidence. wu:done blocks without this (WU-2379) |
156
+ | `pnpm wu:brief --id WU-XXX --client <client>` | **MANDATORY after wu:claim.** Generate the canonical handoff prompt + record evidence. wu:done blocks without this (WU-2379) |
157
+ | `pnpm wu:brief --id WU-XXX --client <client> --report-tokens` | Print total/section token counts and append local `.lumenflow/telemetry/brief-metrics.ndjson` metrics |
157
158
  | `pnpm wu:brief --id WU-XXX --no-context` | Generate prompt without memory context injection |
158
159
  | `pnpm wu:delegate --id WU-XXX --parent-wu <P>` | Generate prompt, record lineage, and store brief hash attestation |
159
160
  | `pnpm wu:sandbox --id WU-XXX -- <cmd>` | Run command through hardened WU sandbox backend |
@@ -478,6 +479,7 @@ Treat orchestration as a control plane: planning, handoff, execution, reconcilia
478
479
  | `pnpm flow:bottlenecks` | Identify flow bottlenecks |
479
480
  | `pnpm metrics:snapshot` | Capture metrics snapshot |
480
481
  | `pnpm cost:summary` | Summarize local cost telemetry by model, agent, and WU |
482
+ | `pnpm cost:summary --brief` | Summarize local wu:brief token metrics by WU, client, and date |
481
483
  | `pnpm metrics` | View workflow metrics |
482
484
  | `pnpm strict:progress` | Report strict TypeScript backlog and guard regressions |
483
485
 
@@ -616,10 +618,11 @@ pnpm wu:create --lane "Framework: Core" --title "Add feature" \
616
618
 
617
619
  # 2. Claim (creates worktree) -- use the ID from wu:create output
618
620
  pnpm wu:claim --id WU-1990 --lane "Framework: Core"
621
+ # 2b. Record canonical handoff evidence before coding
619
622
  pnpm wu:brief --id WU-1990 --client <client>
620
623
  cd worktrees/framework-core-wu-1990
621
624
 
622
- # 2b. Bootstrap (build CLI for dist-backed commands)
625
+ # 2c. Bootstrap (build CLI for dist-backed commands)
623
626
  pnpm bootstrap
624
627
 
625
628
  # 3. Implement (TDD)
@@ -830,6 +833,7 @@ For cloud agents that cannot use local worktrees:
830
833
  # 1. Claim in cloud mode
831
834
  pnpm wu:claim --id WU-XXX --lane "<Lane>" --cloud
832
835
  # Or: LUMENFLOW_CLOUD=1 pnpm wu:claim --id WU-XXX --lane "<Lane>"
836
+ # 1b. Record canonical handoff evidence before coding
833
837
  pnpm wu:brief --id WU-XXX --client <client>
834
838
 
835
839
  # 2. Work on lane branch, push commits
@@ -9,11 +9,16 @@ Use this checklist before running `pnpm wu:create`.
9
9
  ## Step 1: Confirm the Lane
10
10
 
11
11
  ```bash
12
+ pnpm lane:setup --template react-vite # or nextjs | node-cli | fastify
13
+ pnpm lane:validate
14
+ pnpm lane:lock
12
15
  pnpm lane:status
13
16
  pnpm wu:infer-lane --paths "packages/@lumenflow/cli/src/init.ts" --desc "Fix init docs drift"
14
17
  ```
15
18
 
16
- The lane should match the real implementation scope, not just the first file you noticed.
19
+ Omit `--template` when you want LumenFlow to infer the stack from `package.json` and visible
20
+ directories. The lane should match the real implementation scope, not just the first file you
21
+ noticed.
17
22
 
18
23
  ---
19
24
 
@@ -33,17 +38,28 @@ The lane should match the real implementation scope, not just the first file you
33
38
 
34
39
  `--id` is optional. If omitted, `wu:create` allocates the next WU ID automatically.
35
40
 
41
+ For `--exposure ui`, include concrete reachability evidence. User-flow features should use
42
+ `navigation_path`, a page route in `code_paths`, or manual wording like
43
+ `"Open /settings and verify ..."`. UI infrastructure/theme WUs can instead use manual wording like
44
+ `"Run pnpm dev at http://localhost:3000 and confirm the component/theme state"`.
45
+
36
46
  ---
37
47
 
38
48
  ## Step 3: Decide Plan Storage
39
49
 
40
- If the work needs a plan, prefer repo-native or `lumenflow://plans/` references:
50
+ If the work needs a plan, prefer repo-native `lumenflow://plans/` references:
41
51
 
42
52
  ```bash
43
53
  pnpm plan:create --id INIT-XXX --title "Plan title"
44
54
  pnpm wu:create --lane "Framework: CLI" --title "..." --plan
45
55
  ```
46
56
 
57
+ Generated WU plans live in the repository plans directory
58
+ (`software_delivery.directories.plansDir`, default `{{DOCS_OPERATIONS_PATH}}/plans`) so
59
+ the same WU number can exist in separate projects without colliding. Older
60
+ plans under `$LUMENFLOW_HOME/plans` still resolve as a compatibility fallback,
61
+ but new WU work should use repo-local plans.
62
+
47
63
  Avoid pointing `--spec-refs` at random local filesystem notes that other agents cannot resolve.
48
64
 
49
65
  ---