@deksden-com/dd-flow-cli 0.7.0 → 0.8.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 (69) hide show
  1. package/CHANGELOG.md +666 -0
  2. package/README.md +7 -2
  3. package/dist/build-info.json +5 -5
  4. package/dist/cli/help.js +88 -10
  5. package/dist/cli/run-cli.js +523 -28
  6. package/dist/domain/stage-catalog.js +22 -0
  7. package/dist/domain/validation.js +1 -1
  8. package/dist/schemas/code-review-decision.schema.json +26 -0
  9. package/dist/schemas/code-review-result.schema.json +14 -0
  10. package/dist/schemas/code-verification.schema.json +14 -0
  11. package/dist/schemas/code-work-batch.schema.json +24 -0
  12. package/dist/schemas/code-work-result.schema.json +16 -0
  13. package/dist/schemas/compatibility.schema.json +32 -0
  14. package/dist/schemas/flow-contract.schema.json +9 -5
  15. package/dist/schemas/flow-run.schema.json +16 -123
  16. package/dist/schemas/plan-aspect-map.schema.json +22 -0
  17. package/dist/schemas/plan-review-decision.schema.json +14 -0
  18. package/dist/schemas/plan-review-result.schema.json +42 -0
  19. package/dist/schemas/protocol-plan.schema.json +15 -182
  20. package/dist/schemas/stage-finish-input.schema.json +16 -2
  21. package/dist/schemas/stage-report.schema.json +8 -7
  22. package/dist/schemas/stage-start-response.schema.json +4 -2
  23. package/dist/schemas/status-report.schema.json +76 -0
  24. package/dist/schemas/vnext-protocol-plan.schema.json +37 -0
  25. package/dist/schemas/vnext-protocolize-result.schema.json +29 -0
  26. package/dist/schemas/vnext-specify.schema.json +45 -0
  27. package/dist/services/branch-context.js +1 -1
  28. package/dist/services/cleanup.js +8 -8
  29. package/dist/services/cli-operation-classifier.js +10 -2
  30. package/dist/services/code-checks.js +244 -0
  31. package/dist/services/config.js +7 -1
  32. package/dist/services/dashboard.js +12 -12
  33. package/dist/services/engines.js +1 -1
  34. package/dist/services/eval-snapshots.js +404 -0
  35. package/dist/services/hooks.js +774 -18
  36. package/dist/services/ids.js +16 -6
  37. package/dist/services/lanes.js +1 -1
  38. package/dist/services/merge-queue.js +5 -5
  39. package/dist/services/merge-worker.js +2 -2
  40. package/dist/services/migrations.js +2 -2
  41. package/dist/services/plan-runtime.js +1 -1
  42. package/dist/services/projects.js +4 -4
  43. package/dist/services/prompts.js +17 -11
  44. package/dist/services/protocols.js +8 -8
  45. package/dist/services/run-projection.js +49 -13
  46. package/dist/services/runs.js +504 -51
  47. package/dist/services/schema-validation.js +21 -3
  48. package/dist/services/sessions.js +51 -12
  49. package/dist/services/stage-blocker.js +57 -0
  50. package/dist/services/stage-context.js +90 -0
  51. package/dist/services/stage-lifecycle.js +198 -75
  52. package/dist/services/stage-pause.js +175 -0
  53. package/dist/services/stage-report-renderer.js +65 -0
  54. package/dist/services/usage.js +526 -18
  55. package/dist/services/vnext-code-review.js +305 -0
  56. package/dist/services/vnext-code.js +686 -0
  57. package/dist/services/vnext-contracts.js +1 -0
  58. package/dist/services/vnext-execution-profile.js +27 -0
  59. package/dist/services/vnext-fanout.js +79 -0
  60. package/dist/services/vnext-plan-review.js +499 -0
  61. package/dist/services/vnext-plan.js +552 -0
  62. package/dist/services/vnext-protocolize.js +542 -0
  63. package/dist/services/vnext-specify.js +595 -0
  64. package/dist/services/vnext-workspace-policy.js +87 -0
  65. package/dist/services/work-registry.js +522 -0
  66. package/dist/services/worktrees.js +58 -37
  67. package/dist/storage/database.js +263 -34
  68. package/dist/storage/paths.js +47 -1
  69. package/package.json +12 -12
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "cli_package": "@deksden-com/dd-flow-cli",
3
- "cli_version": "0.7.0",
4
- "cli_commit": "a09f6b663231d3179bea64b2fd9bb4ffa30096c2",
5
- "built_at": "2026-08-13T04:31:51.147Z",
3
+ "cli_version": "0.8.0",
4
+ "cli_commit": "f0a5e35190c960c16caa0913837d4426b3c35db7",
5
+ "built_at": "2026-08-31T10:23:34.510Z",
6
6
  "built_with_canon": {
7
- "version": "3.2.0",
8
- "commit": "2a1aaec84ee7d62b9f5a6549de5d1f0cb88082c0",
7
+ "version": "4.0.0",
8
+ "commit": "39728d7091691ad32e94d7b79b3656821c63ccc2",
9
9
  "flow_contract": "dd-flow-canonical-2026-08",
10
10
  "repo_root": "/Users/deksden/Documents/_Projects/dd-memorybank",
11
11
  "memorybank_root": "/Users/deksden/Documents/_Projects/dd-memorybank/.memory-bank",
package/dist/cli/help.js CHANGED
@@ -20,10 +20,12 @@ Core commands:
20
20
  protocol register/status/transition Register, inspect, transition and repair protocol state.
21
21
  migration impact/plan/report/verify/apply Assess release impact and explicitly apply mb-upgrade migration evidence.
22
22
  cleanup scan/apply Detect and repair stale local runtime state.
23
- run start/status/list/timeline/usage/flags Track concrete flow executions, timing, source-aware usage and RUN-local flow flags.
24
- stage start/finish Run the canonical two-command stage lifecycle and generate evidence.
23
+ run start/status/list/timeline/usage/flags/vars Track concrete flow executions, timing, source-aware usage and RUN context.
24
+ stat usage/run sessions ls Refresh source-backed usage and reconcile settled Sessions, or list RUN Sessions.
25
+ stage start/pause/resume/finish Run a stage lifecycle, including in-stage user interaction.
26
+ work status|add-batch|ls|show|deps|delete|start|finish|fail|retry|cancel Manage vNext Work.
25
27
  id next Preview next typed ids for protocol or run allocation.
26
- plan status/item Inspect canonical plans and update SQLite progress.
28
+ plan status/item/reviews Inspect plans, update SQLite progress, or dispatch vNext grouped reviews.
27
29
  prompt render Render one bounded, RUN-local worker launch prompt.
28
30
  lane workspace/lock/status Manage shared workspace lanes and leases.
29
31
  merge status/one-shot/bundle Inspect, claim, or complete merge work from the current session.
@@ -35,6 +37,10 @@ Core commands:
35
37
  memory permissions preflight Check Memory Bank write/read permissions.
36
38
  integration cmux status Inspect optional cmux integration.
37
39
  codex home/hooks/hook Manage Codex homes, hooks, and hook events.
40
+ zcode event/usage Ingest trusted zcode-acp lifecycle and usage evidence.
41
+ grok event/usage Ingest trusted Grok Build lifecycle and usage evidence.
42
+ opencode event/usage Ingest trusted OpenCode lifecycle and usage evidence.
43
+ agy event/usage Ingest trusted Antigravity CLI lifecycle and usage evidence.
38
44
  worktree plan/create/status Record Worktrunk-backed feature worktrees.
39
45
 
40
46
  Examples:
@@ -147,15 +153,23 @@ Usage:
147
153
  dd-flow id next --type protocol|run --project-root <root> --slug <slug> --json
148
154
  dd-flow run status <RUN-ID|RUN-short-id> --project-root <root> --json
149
155
  dd-flow run list --project-root <root> --json
156
+ dd-flow run prepare-vnext-specify --project-root <root> --slug <slug> --json
157
+ dd-flow run snapshot create <RUN-ID|RUN-short-id> (--stage-entry <stage>|--candidate) --project-root <root> --output <directory> --json
158
+ dd-flow run snapshot restore --snapshot <directory> --project-root <prepared-root> --json
159
+ dd-flow run snapshot bootstrap create --project-root <root> --output <directory> --json
160
+ dd-flow run snapshot bootstrap restore --snapshot <directory> --project-root <prepared-root> --json
150
161
  dd-flow run timeline <RUN-ID|RUN-short-id> --project-root <root> --json
151
- dd-flow run usage <RUN-ID|RUN-short-id> --project-root <root> [--group-by session|role|stage|aspect|plan-item] --json
162
+ dd-flow stat usage --run <RUN-ID|RUN-short-id> --project-root <root> [--stage <stage[,stage...]>] [--session <session-id>] --json
163
+ dd-flow stat run sessions ls --run <RUN-ID|RUN-short-id> --project-root <root> --json
152
164
  dd-flow run flags status <RUN-ID|RUN-short-id> --project-root <root> --json
153
165
  dd-flow run flags revise <RUN-ID|RUN-short-id> --project-root <root> --expected-revision <n> --idempotency-key <key> [--preset <name>] [--flag key=value] [--flag key=value] [--allow-downgrade --reason <text>] --json
154
166
  dd-flow run attach-stage <RUN-ID|RUN-short-id> --project-root <root> --stage <name> --dir <NN-stage-slug> --status <status> [--data-schema-id <id>] --json
155
167
  dd-flow run complete-stage <RUN-ID|RUN-short-id> --project-root <root> --stage <name> --status <status> [--stage-report <path>] [--data <path>] [--data-schema-id <id>] [--report <path>] [--alias <path>] --json
156
- dd-flow run complete <RUN-ID|RUN-short-id> --project-root <root> --status done|blocked|cancelled|failed [--verdict <text>] [--next-action <text>] --json
168
+ dd-flow run override <RUN-ID|RUN-short-id> --project-root <root> --status cancelled|failed --reason <text> [--verdict <text>] [--next-action <text>] --json
157
169
 
158
- RUN-* is the execution envelope for one concrete flow launch. Semantic truth remains in protocol, experiment, DEF, scenario, evidence, and Memory Bank documents. New run artifacts are stored under DD_FLOW_HOME/projects/<PRJ-ID-slug>/runs/<RUN-ID-slug>/ with one run.json projection and an append-only timeline.jsonl. Timeline is the compact full run report: summary is always present, while --hide may suppress bulky sections. The run usage command reconciles registered local Codex transcript counters before reporting; unavailable data is explicit rather than zero.
170
+ RUN-* is the execution envelope for one concrete flow launch. Semantic truth remains in protocol, experiment, DEF, scenario, evidence, and Memory Bank documents. New run artifacts are stored under DD_FLOW_HOME/projects/<PRJ-ID-slug>/runs/<RUN-ID-slug>/ with one run.json projection and an append-only timeline.jsonl. Timeline is the compact full run report: summary is always present, while --hide may suppress bulky sections. Use \`dd-flow stat usage --run …\` to reread registered local Codex transcript counters and tool-call facts and refresh the current usage projection; unavailable data is explicit rather than zero.
171
+
172
+ run prepare-vnext-specify allocates an otherwise unstarted vNext RUN for the canonical SPECIFY entry checkpoint. run snapshot is the eval-only checkpoint boundary: it snapshots one quiescent RUN, its dedicated DD_FLOW_HOME, and the exact project tree including its Git repository, then restores them into a fresh dedicated runtime. It is not a general runtime backup command and fails closed for a shared runtime.
159
173
 
160
174
  Examples:
161
175
  dd-flow run start --project-root "$PWD" --flow-kind mb_sdlc --subject-type protocol --subject-id PRT-001-demo --slug demo --json
@@ -168,11 +182,31 @@ Examples:
168
182
  `dd-flow stage - execute one bounded stage lifecycle
169
183
 
170
184
  Usage:
171
- dd-flow stage start <RUN-ID|RUN-short-id> --project-root <root> --stage <name> [--dir <NN-stage-slug>] --json
172
- dd-flow stage start --bootstrap --project-root <root> --stage specify --subject <safe-subject> [--intake-file <path>] --json
173
- dd-flow stage finish <RUN-ID|RUN-short-id> --project-root <root> --stage <name> [--outcome done|blocked|failed] [--semantic-file <RUN-local-json>] --json
185
+ dd-flow stage start <RUN-ID|RUN-short-id> --project-root <root> --stage <name> [--dir <NN-stage-slug>] [--require-session-binding] --json
186
+ dd-flow stage start --bootstrap --project-root <root> --stage specify --subject <safe-subject> (--intake-file <path>|--intake-stdin) [--require-session-binding] --json
187
+ dd-flow stage pause <RUN-ID|RUN-short-id> --project-root <root> --stage <name> --work <WORK-ID> --question-stdin --json
188
+ dd-flow stage resume <RUN-ID|RUN-short-id> --project-root <root> --stage <name> --work <WORK-ID> --answer-stdin --json
189
+ dd-flow stage block <RUN-ID|RUN-short-id> --project-root <root> --stage <name> --work <WORK-ID> --kind engine|harness|environment --code <code> --summary-stdin [--retryable] --json
190
+ dd-flow stage unblock <RUN-ID|RUN-short-id> --project-root <root> --stage <name> --work <WORK-ID> --json
191
+ dd-flow stage fanout status <RUN-ID|RUN-short-id> --project-root <root> --stage <name> --json
192
+ dd-flow stage fanout dispatch <RUN-ID|RUN-short-id> --project-root <root> --stage <name> --json
193
+ dd-flow stage finish <RUN-ID|RUN-short-id> --project-root <root> --stage <name> [--semantic-file <RUN-local-json>] --json
194
+ dd-flow stage finish <RUN-ID|RUN-short-id> --project-root <root> --stage specify (--result-file <RUN-local-specify.json>|--result-stdin) --outcome <specified|failed|cancelled> --json
174
195
 
175
- stage start is the worker's first practical flow command. It performs deterministic setup and returns a ready-to-use, stage-specific work packet with trusted runtime facts, compatibility and permission preflight, aliases, write boundary and exact finish command. The same packet is written to RUN-local stage-prompt.md and stage-prompt.json. --bootstrap creates the initial protocol/RUN envelope and copies the supplied intake into the RUN home before starting specify. stage finish defaults to @stage/stage-input.json, accepts semantic --outcome and always generates validated JSON, Markdown, template-backed HTML and a durable protocol-summary projection. Raw intake and telemetry remain RUN-local.`
196
+ stage start is the worker's first practical flow command. It performs deterministic setup and returns a ready-to-use, stage-specific work packet with trusted runtime facts, compatibility and permission preflight, aliases, write boundary and exact lifecycle commands. A material user question uses stage pause, not stage finish: pause leaves the same stage, Work, Session and attempt open and returns the exact resume command. Engine, harness and environment failures use stage block and never create HITL. On the next Turn, pass a complete user answer to stage resume, or repair an external blocker and call its returned stage unblock command. stage fanout is read-only orchestration state plus the stage's deterministic Work materialization action for an external runner; it never makes product decisions. stage finish is reserved for actual stage completion and generates the final deterministic reports. Generated lifecycle commands include DD_FLOW_HOME when the RUN uses a non-default runtime.`
197
+ ],
198
+ [
199
+ "work",
200
+ `dd-flow work - inspect or advance a beta vNext Work
201
+
202
+ Usage:
203
+ dd-flow work ls (--run <RUN-ID>|--parent <WORK-ID>) [--ready] --json
204
+ dd-flow work show <WORK-ID> --json
205
+ dd-flow work start <WORK-ID> --project-root <root> --json
206
+ dd-flow work finish <WORK-ID> (--result-file <path>|--result-stdin) --project-root <root> --json
207
+ dd-flow work repair add --run <RUN-ID> --from-check <CHECK-ID> --origin-work <WORK-ID>... --task-stdin --project-root <root> --json
208
+
209
+ CODE workers receive their full accepted packet from work start. work finish validates the result and executes the packet's focused checks before completion. A failed aggregate CODE gate returns the exact failed receipt and repair command; repair add creates a new Work from the selected completed origin context plus that failure evidence. Its planned write areas are coordination hints only; the repair may change any necessary project file inside its RUN workspace.`
176
210
  ],
177
211
  [
178
212
  "id",
@@ -412,6 +446,16 @@ Usage:
412
446
  dd-flow session stop-worker --project-root <root> --worker-id <id> --reason <text> --json
413
447
 
414
448
  Session registration is the durable contract used by Stop hooks. Prompts register flow_kind, continuation_policy, protocol_id, worker_id, and workspace_path explicitly. Prefer --payload-file in Codex prompts because PreToolUse hooks see the raw shell command before variable expansion.`
449
+ ],
450
+ [
451
+ "run config",
452
+ `dd-flow run config - inspect and set RUN-scoped flow choices
453
+
454
+ Usage:
455
+ dd-flow run config status <RUN-ID> --project-root <root> --json
456
+ dd-flow run config set <RUN-ID> --project-root <root> --key plan_review.mode --value auto|off|standard|deep --reason <text> --json
457
+
458
+ PLAN review policy belongs to the RUN. It defaults to auto and is frozen once PLAN-REVIEW starts. The CLI never infers this choice from intake prose.`
415
459
  ],
416
460
  [
417
461
  "project config",
@@ -540,6 +584,40 @@ handler resolves the registered project from cwd. The option is only a manual
540
584
  override.
541
585
 
542
586
  Managed homes isolate dd-flow hooks while sharing selected Codex state from the source home.`
587
+ ],
588
+ [
589
+ "zcode event",
590
+ `dd-flow zcode event - ingest a zcode-acp session/update notification
591
+
592
+ Usage:
593
+ dd-flow zcode event handle --project-root <root> --json
594
+ dd-flow zcode usage ingest --project-root <root> --json
595
+
596
+ Both payloads are read from stdin. The event adapter retains lifecycle identity;
597
+ the usage adapter retains cumulative provider counters for RUN accounting.`
598
+ ],
599
+ [
600
+ "opencode event",
601
+ `dd-flow opencode event - ingest a controlled OpenCode tool hook
602
+
603
+ Usage:
604
+ dd-flow opencode event handle --project-root <root> --json
605
+ dd-flow opencode usage ingest --project-root <root> --json
606
+
607
+ Both payloads are read from stdin. The event adapter reuses the trusted
608
+ lifecycle receipt; the usage adapter retains cumulative OpenCode Session and
609
+ tool counters for RUN accounting.`
610
+ ],
611
+ [
612
+ "agy event",
613
+ `dd-flow agy event - ingest a controlled Antigravity CLI tool hook
614
+
615
+ Usage:
616
+ dd-flow agy event handle --project-root <root> --json
617
+ dd-flow agy usage ingest --project-root <root> --json
618
+
619
+ Both payloads are read from stdin. The event adapter records lifecycle identity;
620
+ the usage adapter retains cumulative conversation and tool counters.`
543
621
  ],
544
622
  [
545
623
  "worktree",