@deksden-com/dd-flow-cli 0.9.0-beta.124 → 0.9.0-beta.127

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 (113) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +10 -1
  3. package/dist/build-info.json +7 -7
  4. package/dist/cli/argument-values.js +38 -0
  5. package/dist/cli/command-inputs.js +4 -3
  6. package/dist/cli/help.js +1 -0
  7. package/dist/cli/hook-ingress.js +1 -1
  8. package/dist/cli/run-cli.js +126 -193
  9. package/dist/cli/runtime-maintenance-diagnostics.js +46 -0
  10. package/dist/cli/runtime-maintenance-ingress.js +51 -0
  11. package/dist/cli/runtime-process.js +128 -0
  12. package/dist/cli.js +8 -5
  13. package/dist/harness-runtime/bin/dd-agy.mjs +3 -2
  14. package/dist/harness-runtime/bin/dd-codex.mjs +3 -2
  15. package/dist/harness-runtime/bin/dd-droid.mjs +3 -2
  16. package/dist/harness-runtime/bin/dd-grok.mjs +16 -6
  17. package/dist/harness-runtime/bin/dd-opencode.mjs +3 -2
  18. package/dist/harness-runtime/bin/dd-zcode.mjs +20 -16
  19. package/dist/harness-runtime/lib/adapter-timeouts.d.mts +5 -0
  20. package/dist/harness-runtime/lib/adapter-timeouts.mjs +34 -0
  21. package/dist/harness-runtime/lib/daemon-observation.d.mts +2 -0
  22. package/dist/harness-runtime/lib/daemon-observation.mjs +163 -0
  23. package/dist/harness-runtime/lib/daemon-operations.mjs +60 -13
  24. package/dist/harness-runtime/lib/dd-agy-daemon.mjs +151 -72
  25. package/dist/harness-runtime/lib/dd-agy.mjs +11 -23
  26. package/dist/harness-runtime/lib/dd-codex-daemon.mjs +9 -14
  27. package/dist/harness-runtime/lib/dd-codex.mjs +252 -80
  28. package/dist/harness-runtime/lib/dd-droid-daemon.mjs +14 -19
  29. package/dist/harness-runtime/lib/dd-droid.mjs +117 -31
  30. package/dist/harness-runtime/lib/dd-grok-daemon.mjs +56 -30
  31. package/dist/harness-runtime/lib/dd-grok.mjs +15 -13
  32. package/dist/harness-runtime/lib/dd-opencode-daemon.mjs +18 -27
  33. package/dist/harness-runtime/lib/dd-opencode.mjs +44 -14
  34. package/dist/harness-runtime/lib/dd-zcode-daemon.mjs +56 -53
  35. package/dist/harness-runtime/lib/dd-zcode.mjs +200 -111
  36. package/dist/harness-runtime/lib/lease-renewal.d.mts +8 -0
  37. package/dist/harness-runtime/lib/lease-renewal.mjs +23 -0
  38. package/dist/harness-runtime/lib/lifecycle-command.d.mts +3 -3
  39. package/dist/harness-runtime/lib/lifecycle-command.mjs +74 -20
  40. package/dist/harness-runtime/lib/managed-daemon.d.mts +10 -1
  41. package/dist/harness-runtime/lib/managed-daemon.mjs +228 -40
  42. package/dist/harness-runtime/lib/native-children.d.mts +13 -0
  43. package/dist/harness-runtime/lib/native-children.mjs +78 -0
  44. package/dist/harness-runtime/lib/native-hook-command.d.mts +4 -0
  45. package/dist/harness-runtime/lib/native-hook-command.mjs +115 -11
  46. package/dist/harness-runtime/lib/native-streams.mjs +45 -0
  47. package/dist/harness-runtime/lib/observation-clock.d.mts +18 -0
  48. package/dist/harness-runtime/lib/observation-clock.mjs +73 -17
  49. package/dist/harness-runtime/lib/operation-errors.d.mts +14 -0
  50. package/dist/harness-runtime/lib/operation-errors.mjs +105 -8
  51. package/dist/harness-runtime/lib/operation-progress.d.mts +7 -0
  52. package/dist/harness-runtime/lib/operation-progress.mjs +112 -0
  53. package/dist/harness-runtime/lib/process-json.mjs +136 -38
  54. package/dist/harness-runtime/lib/tool-observations.d.mts +1 -0
  55. package/dist/harness-runtime/lib/tool-observations.mjs +5 -2
  56. package/dist/harness-runtime/lib/zcode-usage.mjs +3 -2
  57. package/dist/runtime/context.js +8 -4
  58. package/dist/schemas/run-control-receipt.schema.json +19 -0
  59. package/dist/services/code-checks.js +79 -9
  60. package/dist/services/codex-capacity.js +117 -41
  61. package/dist/services/codex-hook-delivery.js +2 -2
  62. package/dist/services/compatibility-preflight.js +4 -1
  63. package/dist/services/controller-fanout.js +9 -76
  64. package/dist/services/engines.js +70 -20
  65. package/dist/services/eval-snapshots.js +179 -40
  66. package/dist/services/external-work-launch.js +13 -8
  67. package/dist/services/harness-adapter.js +175 -11
  68. package/dist/services/hooks.js +65 -21
  69. package/dist/services/lifecycle-invocations.js +404 -32
  70. package/dist/services/managed-lease-monitor.js +128 -0
  71. package/dist/services/managed-processes.js +103 -47
  72. package/dist/services/merge-server.js +58 -21
  73. package/dist/services/recovery-observation-budget.js +67 -7
  74. package/dist/services/recovery-snapshot-database.js +7 -4
  75. package/dist/services/run-control-receipt.js +1 -1
  76. package/dist/services/run-control-worker.js +177 -118
  77. package/dist/services/run-control.js +99 -8
  78. package/dist/services/run-controller-adapter.js +169 -46
  79. package/dist/services/run-controller-capture.js +14 -2
  80. package/dist/services/run-controller-process.js +11 -4
  81. package/dist/services/run-controller-state.js +68 -7
  82. package/dist/services/run-controller.js +166 -94
  83. package/dist/services/run-fork.js +8 -3
  84. package/dist/services/run-recovery-guard.js +75 -0
  85. package/dist/services/run-recovery-runtime.js +1 -56
  86. package/dist/services/run-recovery.js +17 -13
  87. package/dist/services/runs.js +39 -6
  88. package/dist/services/runtime-budget.js +32 -15
  89. package/dist/services/runtime-scope-control.js +8 -0
  90. package/dist/services/runtime-scope-resume.js +30 -8
  91. package/dist/services/runtime-scope-worker.js +118 -73
  92. package/dist/services/runtime-service.js +6 -7
  93. package/dist/services/scope-writer-cleanup.js +3 -2
  94. package/dist/services/stage-context.js +135 -0
  95. package/dist/services/stage-lifecycle.js +3 -15
  96. package/dist/services/stage-pause.js +3 -2
  97. package/dist/services/usage.js +14 -3
  98. package/dist/services/vnext-code-review.js +10 -9
  99. package/dist/services/vnext-code.js +10 -8
  100. package/dist/services/vnext-contracts.js +10 -1
  101. package/dist/services/vnext-execution-profile.js +75 -2
  102. package/dist/services/vnext-fanout.js +5 -0
  103. package/dist/services/vnext-merge.js +10 -9
  104. package/dist/services/vnext-plan-review.js +21 -17
  105. package/dist/services/vnext-plan.js +9 -7
  106. package/dist/services/vnext-protocolize.js +15 -9
  107. package/dist/services/vnext-specify.js +6 -6
  108. package/dist/services/work-registry.js +34 -4
  109. package/dist/services/workspace-bootstrap.js +14 -3
  110. package/dist/shared/errors.js +11 -6
  111. package/dist/storage/agent-output.js +26 -0
  112. package/dist/storage/database.js +80 -21
  113. package/package.json +7 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @deksden-com/dd-flow-cli
2
2
 
3
+ ## 0.9.0-beta.127
4
+
5
+ ### Patch Changes
6
+
7
+ - Scope boundary consistency to productive RUN authority and retain accepted Work results across snapshot relocation without requiring unchanged provider service files.
8
+ - Reject conflicting retained native operation inputs before transport dispatch, preserving the same conflict classification across all harness observers.
9
+ - Distinguish recoverable pre-shutdown refusal from durable unclean shutdown in full-cycle fixtures. Verify clean settlement or retained blocker custody before teardown, with native operation-inspection and cancel-tree parameter parity.
10
+
11
+ ## 0.9.0-beta.126
12
+
13
+ ### Patch Changes
14
+
15
+ - Separate existing controller renewal from productive launch admission, allowing terminal RUNs to finish sealed boundary capture and native settlement.
16
+ - Make terminal stop retain durable cleanup without changing subject outcomes or reopening productive recovery; expose scoped read-only finalization diagnostics.
17
+ - Verify final snapshot identity and physical retirement before full-cycle fixture teardown.
18
+
3
19
  ## 0.9.0-beta.124
4
20
 
5
21
  ### Patch Changes
package/README.md CHANGED
@@ -471,12 +471,21 @@ remain invalid and receive a standalone retry.
471
471
  Local verification for this repository:
472
472
 
473
473
  ```bash
474
- pnpm test
475
474
  pnpm typecheck
476
475
  pnpm lint
477
476
  pnpm build
477
+ pnpm test
478
478
  ```
479
479
 
480
+ Build once before testing: release contracts and native fixtures verify the
481
+ copied `dist` bytes. `pnpm test` remains release → integration → runtime-sensitive.
482
+ For development use `pnpm test:fast`, `pnpm test:core` or `pnpm test:flow` plus
483
+ the affected native contracts; these subsets are not full acceptance.
484
+ New files default to serial core execution. A forced serial fallback is
485
+ `pnpm test:integration --no-file-parallelism --maxWorkers=1`.
486
+ The [test-suite verification runbook](https://github.com/deksden-com/dd-eval/blob/docs/066-test-suite-optimization/runbooks/flow-test-suite-verification.md)
487
+ owns group qualification, complete reports and cross-repository commands.
488
+
480
489
  Manual smoke checks should use a temporary `DD_FLOW_HOME` when they do not intentionally inspect the operator's real local state.
481
490
 
482
491
  ### RUN status during recovery
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "cli_package": "@deksden-com/dd-flow-cli",
3
- "cli_version": "0.9.0-beta.124",
4
- "cli_commit": "7bc8e8d17471c2cd33a93ca25e55770a4cb6e336",
5
- "built_at": "2026-10-01T12:53:56.722Z",
3
+ "cli_version": "0.9.0-beta.127",
4
+ "cli_commit": "8c98b4fa9e0f69be85ef616d7c7c3dac884fc0f5",
5
+ "built_at": "2026-10-11T11:57:17.805Z",
6
6
  "built_with_canon": {
7
7
  "version": "4.1.2",
8
- "commit": "2e57b987ec91b7c3b0fa97f6169047802a1233fb",
8
+ "commit": "2ba0b9ceedf8e4544ad9566c240ef37ea5e8d099",
9
9
  "flow_contract": "dd-flow-canonical-2026-08",
10
- "repo_root": "/home/runner/work/dd-flow-cli/dd-flow-cli/dd-memorybank",
11
- "memorybank_root": "/home/runner/work/dd-flow-cli/dd-flow-cli/dd-memorybank/.memory-bank",
12
- "flow_root": "/home/runner/work/dd-flow-cli/dd-flow-cli/dd-memorybank/.memory-bank/dd-flow",
10
+ "repo_root": "/Users/deksden/.dd-eval/qualification/cp-214-release-canon",
11
+ "memorybank_root": "/Users/deksden/.dd-eval/qualification/cp-214-release-canon/.memory-bank",
12
+ "flow_root": "/Users/deksden/.dd-eval/qualification/cp-214-release-canon/.memory-bank/dd-flow",
13
13
  "layout": "dot_memory_bank"
14
14
  }
15
15
  }
@@ -0,0 +1,38 @@
1
+ import { AppError } from "../shared/errors.js";
2
+ const flagValue = "__dd_flow_flag__";
3
+ export function optionalOption(parsed, key) {
4
+ const values = parsed.options.get(key);
5
+ const value = values?.[values.length - 1];
6
+ if (value === flagValue)
7
+ throw new AppError("usage", `--${key} requires a value`, 2);
8
+ if (value !== undefined && !value.trim())
9
+ throw new AppError("usage", `--${key} requires a non-empty value`, 2);
10
+ return value;
11
+ }
12
+ export function requiredOption(parsed, key) {
13
+ const value = optionalOption(parsed, key);
14
+ if (!value) {
15
+ throw new AppError("usage", `Missing required option: --${key}`, 2);
16
+ }
17
+ return value;
18
+ }
19
+ export function optionalNumber(parsed, key) {
20
+ const value = optionalOption(parsed, key);
21
+ if (typeof value === "undefined") {
22
+ return undefined;
23
+ }
24
+ const parsedNumber = Number(value);
25
+ if (!Number.isFinite(parsedNumber)) {
26
+ throw new AppError("validation", `--${key} must be a number`, 2);
27
+ }
28
+ return parsedNumber;
29
+ }
30
+ export function optionalPositiveNumber(parsed, key, integer = false) {
31
+ const value = optionalNumber(parsed, key);
32
+ if (typeof value === "undefined")
33
+ return undefined;
34
+ if (value <= 0 || (integer && !Number.isInteger(value))) {
35
+ throw new AppError("validation", `--${key} must be a positive${integer ? " integer" : ""} number`, 2);
36
+ }
37
+ return value;
38
+ }
@@ -15,6 +15,7 @@ const control = "project-root run";
15
15
  /** Path-shaped arguments default to physical paths unless the route explicitly
16
16
  * opts into contextualPaths. This inventory does not expand arbitrary strings. */
17
17
  export const physicalPathOptions = new Set(words("root project-root workspace-root workspace-path path dir file schema-dir output result-file semantic-file data decision-file verification-file reason-file task-file intake-file context-file observations-file observation-file summary-file question-file answer-file payload-file json-file task-profile-file execution-routing-file protocol-override-file manifest-file routing-file config-file input-file report-file snapshot-file output-dir state-dir capture-root capture-path destination source archive snapshot plan-file backup-path database backup source-home target-home stdout stderr adapter-executable memory-bank flow stage-report dashboard report"));
18
+ physicalPathOptions.add("operational-decision-file");
18
19
  export const commandInputs = {
19
20
  "version": route(0),
20
21
  "status": route(0, "", "root project-root", "check-registry"),
@@ -102,8 +103,8 @@ export const commandInputs = {
102
103
  "run snapshot bootstrap create": route(0, `${project} output`),
103
104
  "run snapshot bootstrap restore": route(0, `${project} snapshot`),
104
105
  "run snapshot create": route(1, `${project} output`, "recovery-id stage-entry", "candidate incomplete"),
105
- "run snapshot restore": route(0, `${project} snapshot`, "execution-routing-file recovery-id"),
106
- "run fork": route(0, "from output engine-version request-id", "integrity-checksum"),
106
+ "run snapshot restore": route(0, `${project} snapshot`, "execution-routing-file operational-decision-file recovery-id"),
107
+ "run fork": route(0, "from output engine-version request-id", "integrity-checksum operational-decision-file"),
107
108
  "run drive status": route(0, control, "after"),
108
109
  "run drive launch": route(0, `${control} request-id context-file context-sha256`, "stop-after capture-root"),
109
110
  "run drive serve": route(0, `${control} controller-id`),
@@ -125,7 +126,7 @@ export const commandInputs = {
125
126
  "runtime process check-admission": route(0, "id lease-token"),
126
127
  "runtime process start": route(0, `${control} command ports ready-port`, "ready-path ready-timeout-ms"),
127
128
  "runtime process stop": route(0, "id lease-token", "grace-ms"),
128
- "runtime process register": route(0, "kind owner", "lease-ms budget-json project-id run pid process-group-id owner-pid work check operation stdout stderr harness dispatch-barrier role state-dir adapter-executable"),
129
+ "runtime process register": route(0, "kind owner", "id lease-ms budget-json project-id run pid process-group-id owner-pid work check operation stdout stderr harness dispatch-barrier role state-dir adapter-executable"),
129
130
  "runtime process confirm": route(0, "id lease-token pid", "owner-pid lease-ms process-group-id"),
130
131
  "runtime process heartbeat": route(0, "id lease-token", "lease-ms"),
131
132
  "runtime process admission": route(0, "id lease-token owner state-dir", "daemon-id operation-id operation native-session-id prompt-sha256"),
package/dist/cli/help.js CHANGED
@@ -213,6 +213,7 @@ RUN-* is the execution envelope for one concrete flow launch. Semantic truth rem
213
213
 
214
214
  run start and prepare-vnext-specify accept --execution-routing-file for vNext RUNs: dd-flow/execution-routing@1 with an execution object selects the complete routing policy from existing agent-profiles. RUN creation freezes the input and selected profiles without changing project settings.
215
215
  run snapshot restore also accepts --execution-routing-file for a new stage-entry experiment. Its fresh DD_FLOW_HOME may contain only agent-profiles and the empty database; selected profiles are read before import, previous RUN policy is archived, and existing Work overrides must resolve against the selected frozen profiles. Recovery imports reject this option.
216
+ run snapshot restore and run fork accept --operational-decision-file for an explicitly accepted decision bound to the new stage-entry experiment. Store the input outside fork output; its bytes are bound to the idempotent request. A snapshot with a scoped decision cannot grant it to another execution implicitly. Recovery retains the original decision and rejects replacement.
216
217
  run fork restores one sealed stage-entry snapshot to an isolated project and DD_FLOW_HOME, archives source authority, then binds an exact engine only in that copy. It is idempotent by request ID and output receipt; it never resumes a provider session or changes its source RUN.
217
218
  run prepare-vnext-specify allocates an otherwise unstarted vNext RUN for the canonical SPECIFY entry checkpoint. run recovery makes an interrupted RUN read-only, requires an explicit settled-tree receipt, captures immutable recovery evidence, then explicitly returns delegated Work to the ready graph. 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.
218
219
 
@@ -26,7 +26,7 @@ export async function runHookIngress(args) {
26
26
  const payload = parseJsonObject(stdin || "{}", "native hook stdin");
27
27
  const command = lifecycleCommandFromPayload(payload);
28
28
  const analysis = command ? parseLifecycleCommand(command) : { kind: "none", unresolved: false };
29
- if (event !== "PreToolUse" || !command || (analysis.kind === "none" && !analysis.unresolved && !continuationCommand(command))) {
29
+ if (event !== "PreToolUse" || !command || (analysis.kind === "none" && (!("participation" in analysis) || !["lifecycle", "auxiliary"].includes(analysis.participation)) && !continuationCommand(command))) {
30
30
  process.stdout.write("{}\n");
31
31
  return 0;
32
32
  }