@deksden-com/dd-flow-cli 0.9.0-beta.136 → 0.9.0-beta.138
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.
- package/CHANGELOG.md +12 -0
- package/README.md +9 -0
- package/dist/build-info.json +6 -6
- package/dist/cli/argument-values.js +5 -5
- package/dist/cli/command-inputs.js +89 -20
- package/dist/cli/command-metadata.js +56 -3
- package/dist/cli/command-option-descriptions.js +5 -0
- package/dist/cli/executor-onboarding.js +8 -3
- package/dist/cli/flows.js +29 -0
- package/dist/cli/help.js +240 -6
- package/dist/cli/input-preparation.js +54 -5
- package/dist/cli/memory-flow-admission.js +44 -0
- package/dist/cli/memory-init-invocation.js +78 -0
- package/dist/cli/memory-init.js +240 -0
- package/dist/cli/memory-storage-admission.js +53 -0
- package/dist/cli/native-hook-ingress.js +1 -1
- package/dist/cli/response-file.js +2 -0
- package/dist/cli/run-cli.js +283 -160
- package/dist/cli/setup.js +9 -7
- package/dist/cli.js +54 -2
- package/dist/domain/stage-handler-identities.js +20 -0
- package/dist/harness-runtime/DD-ZCODE.md +13 -0
- package/dist/harness-runtime/bin/dd-opencode.mjs +3 -3
- package/dist/harness-runtime/lib/daemon-operations.d.mts +1 -0
- package/dist/harness-runtime/lib/daemon-operations.mjs +4 -3
- package/dist/harness-runtime/lib/dd-agy-daemon.mjs +4 -2
- package/dist/harness-runtime/lib/dd-codex-daemon.mjs +11 -5
- package/dist/harness-runtime/lib/dd-codex.mjs +22 -10
- package/dist/harness-runtime/lib/dd-droid-daemon.mjs +2 -1
- package/dist/harness-runtime/lib/dd-droid.mjs +2 -1
- package/dist/harness-runtime/lib/dd-grok-daemon.mjs +4 -2
- package/dist/harness-runtime/lib/dd-opencode-daemon.mjs +20 -5
- package/dist/harness-runtime/lib/dd-zcode-daemon.mjs +45 -10
- package/dist/harness-runtime/lib/dd-zcode.mjs +7 -3
- package/dist/harness-runtime/lib/delegation-instructions.mjs +5 -3
- package/dist/harness-runtime/lib/lifecycle-command.mjs +1 -0
- package/dist/harness-runtime/lib/managed-daemon.d.mts +1 -0
- package/dist/harness-runtime/lib/managed-daemon.mjs +50 -15
- package/dist/harness-runtime/lib/managed-flow-env.mjs +15 -0
- package/dist/harness-runtime/lib/native-hook-command.mjs +1 -1
- package/dist/harness-runtime/lib/native-request-proof.d.mts +2 -0
- package/dist/harness-runtime/lib/native-request-proof.mjs +65 -0
- package/dist/harness-runtime/lib/opencode-plugin.mjs +5 -1
- package/dist/harness-runtime/lib/operation-progress.mjs +3 -1
- package/dist/runtime/context.js +1 -1
- package/dist/schemas/discovery-result.schema.json +184 -0
- package/dist/schemas/execution-bundle.schema.json +205 -0
- package/dist/schemas/execution-settings.schema.json +162 -0
- package/dist/schemas/flow-descriptor.schema.json +54 -0
- package/dist/schemas/flow-run.schema.json +22 -0
- package/dist/schemas/harness-catalog.schema.json +80 -0
- package/dist/schemas/mb-init-compose-result.schema.json +457 -0
- package/dist/schemas/mb-init-discover-result.schema.json +500 -0
- package/dist/schemas/mb-init-finish-result.schema.json +422 -0
- package/dist/schemas/mb-init-preflight-result.schema.json +367 -0
- package/dist/schemas/mb-init-review-result.schema.json +396 -0
- package/dist/schemas/mb-init-verify-result.schema.json +391 -0
- package/dist/schemas/memory-bootstrap-receipt-v2.schema.json +67 -0
- package/dist/schemas/memory-bootstrap-receipt.schema.json +354 -0
- package/dist/schemas/memory-composition-work-result.schema.json +38 -0
- package/dist/schemas/memory-repair-work-result.schema.json +49 -0
- package/dist/schemas/memory-review-correction-plan.schema.json +30 -0
- package/dist/schemas/memory-review-work-result.schema.json +43 -0
- package/dist/schemas/model-catalog.schema.json +153 -0
- package/dist/schemas/profile-settings.schema.json +122 -0
- package/dist/schemas/release-manifest.schema.json +291 -0
- package/dist/schemas/run-engine-binding.schema.json +1 -1
- package/dist/services/check-runner-evidence.js +51 -4
- package/dist/services/cli-operation-classifier.js +8 -47
- package/dist/services/code-checks.js +387 -34
- package/dist/services/controller-child-observer.js +99 -0
- package/dist/services/controller-execution.js +88 -0
- package/dist/services/controller-fanout.js +79 -13
- package/dist/services/dashboard.js +8 -2
- package/dist/services/descriptor-coordinator-session.js +35 -0
- package/dist/services/descriptor-root-work.js +53 -0
- package/dist/services/descriptor-run-settlement.js +105 -0
- package/dist/services/descriptor-run-start.js +449 -0
- package/dist/services/descriptor-stage-coordinator.js +197 -0
- package/dist/services/descriptor-stage-settlement.js +222 -0
- package/dist/services/descriptor-stage-start.js +139 -0
- package/dist/services/engines.js +39 -22
- package/dist/services/eval-snapshots.js +83 -25
- package/dist/services/execution-bundles.js +263 -0
- package/dist/services/execution-policy.js +20 -16
- package/dist/services/external-work-launch.js +91 -11
- package/dist/services/flow-catalog.js +21 -0
- package/dist/services/flow-descriptors.js +82 -0
- package/dist/services/frozen-engine.js +242 -0
- package/dist/services/generic-execution.js +164 -0
- package/dist/services/harness-adapter.js +28 -2
- package/dist/services/hooks.js +24 -6
- package/dist/services/hybrid-contracts.js +31 -3
- package/dist/services/ids.js +29 -1
- package/dist/services/installation-lock.js +7 -4
- package/dist/services/installed-flow-source.js +183 -0
- package/dist/services/lifecycle-invocations.js +257 -78
- package/dist/services/memory-accepted-composition.js +77 -0
- package/dist/services/memory-baseline-preservation.js +65 -0
- package/dist/services/memory-completed-correction-wave.js +320 -0
- package/dist/services/memory-compose-handler.js +258 -0
- package/dist/services/memory-composition-acceptance.js +199 -0
- package/dist/services/memory-composition-graph.js +134 -0
- package/dist/services/memory-composition-registration.js +146 -0
- package/dist/services/memory-composition-work-custody.js +151 -0
- package/dist/services/memory-composition-work-results.js +96 -0
- package/dist/services/memory-corrected-review-acceptance.js +129 -0
- package/dist/services/memory-corrected-review-batch.js +30 -0
- package/dist/services/memory-corrected-review-findings.js +106 -0
- package/dist/services/memory-corrected-review-inputs.js +210 -0
- package/dist/services/memory-corrected-review-projection.js +78 -0
- package/dist/services/memory-corrected-review-receipt.js +170 -0
- package/dist/services/memory-corrected-review-registration.js +191 -0
- package/dist/services/memory-correction-check-receipt.js +219 -0
- package/dist/services/memory-correction-input-owner.js +6 -0
- package/dist/services/memory-discover-handler.js +104 -0
- package/dist/services/memory-finish-evidence.js +435 -0
- package/dist/services/memory-finish-handler.js +215 -0
- package/dist/services/memory-finish-integration.js +280 -0
- package/dist/services/memory-finish-readiness.js +122 -0
- package/dist/services/memory-git-integration.js +151 -0
- package/dist/services/memory-historical-corrected-review.js +206 -0
- package/dist/services/memory-historical-original-review.js +130 -0
- package/dist/services/memory-historical-repair-registration.js +99 -0
- package/dist/services/memory-historical-second-review.js +128 -0
- package/dist/services/memory-init-bootstrap-readiness.js +210 -0
- package/dist/services/memory-init-contexts.js +89 -0
- package/dist/services/memory-init-controller-start.js +84 -0
- package/dist/services/memory-init-engine-release.js +223 -0
- package/dist/services/memory-init-git-policy.js +136 -0
- package/dist/services/memory-init-lint-capability.js +185 -0
- package/dist/services/memory-init-native-capacity.js +241 -0
- package/dist/services/memory-init-preflight.js +312 -0
- package/dist/services/memory-init-project-bootstrap.js +599 -0
- package/dist/services/memory-init-request-candidate.js +157 -0
- package/dist/services/memory-init-request-input.js +66 -0
- package/dist/services/memory-init-resource-storage.js +125 -0
- package/dist/services/memory-init-run-allocation.js +81 -0
- package/dist/services/memory-init-run-bundle.js +98 -0
- package/dist/services/memory-init-start.js +175 -0
- package/dist/services/memory-init-startup-custody.js +80 -0
- package/dist/services/memory-init-startup-input.js +240 -0
- package/dist/services/memory-init-storage.js +81 -0
- package/dist/services/memory-init-stores.js +359 -0
- package/dist/services/memory-init-worktrunk-capability.js +172 -0
- package/dist/services/memory-layer-publication.js +611 -0
- package/dist/services/memory-layer.js +156 -0
- package/dist/services/memory-lint-config.js +85 -0
- package/dist/services/memory-native-review-copy.js +165 -0
- package/dist/services/memory-normal-flow-entry.js +75 -0
- package/dist/services/memory-ordinary-defaults.js +112 -0
- package/dist/services/memory-preflight-bootstrap-custody.js +115 -0
- package/dist/services/memory-preflight-handler.js +259 -0
- package/dist/services/memory-repair-current-view.js +299 -0
- package/dist/services/memory-repair-document-delta.js +451 -0
- package/dist/services/memory-repair-history.js +491 -0
- package/dist/services/memory-repair-physical-binding.js +312 -0
- package/dist/services/memory-repair-publication-files.js +152 -0
- package/dist/services/memory-repair-publication-intent.js +27 -0
- package/dist/services/memory-repair-publication-plan.js +160 -0
- package/dist/services/memory-repair-publication-source.js +225 -0
- package/dist/services/memory-repair-publication.js +794 -0
- package/dist/services/memory-repair-registration.js +239 -0
- package/dist/services/memory-repair-work-baseline.js +413 -0
- package/dist/services/memory-repair-work-completion.js +97 -0
- package/dist/services/memory-repair-work-custody.js +73 -0
- package/dist/services/memory-repair-work-results.js +89 -0
- package/dist/services/memory-repair-workspace.js +252 -0
- package/dist/services/memory-repair-writer-copy.js +735 -0
- package/dist/services/memory-result-binding.js +173 -0
- package/dist/services/memory-retained-review-authority.js +129 -0
- package/dist/services/memory-retained-review-results.js +70 -0
- package/dist/services/memory-retained-second-baseline.js +102 -0
- package/dist/services/memory-retained-second-repairs.js +156 -0
- package/dist/services/memory-review-acceptance.js +214 -0
- package/dist/services/memory-review-correction-plan.js +171 -0
- package/dist/services/memory-review-handler.js +585 -0
- package/dist/services/memory-review-inputs.js +200 -0
- package/dist/services/memory-review-receipt.js +180 -0
- package/dist/services/memory-review-registration.js +108 -0
- package/dist/services/memory-review-work-custody.js +124 -0
- package/dist/services/memory-review-work-input.js +72 -0
- package/dist/services/memory-review-work-results.js +73 -0
- package/dist/services/memory-second-corrected-review-inputs.js +165 -0
- package/dist/services/memory-second-correction-plan.js +76 -0
- package/dist/services/memory-second-repair-baseline.js +91 -0
- package/dist/services/memory-second-repair-launch.js +614 -0
- package/dist/services/memory-second-repair-registration.js +88 -0
- package/dist/services/memory-second-repair-source.js +187 -0
- package/dist/services/memory-second-review-acceptance.js +115 -0
- package/dist/services/memory-source-observations.js +117 -0
- package/dist/services/memory-stage-dispatch.js +28 -0
- package/dist/services/memory-stage-results.js +199 -0
- package/dist/services/memory-verification-acceptance.js +135 -0
- package/dist/services/memory-verification-checks.js +252 -0
- package/dist/services/memory-verification-receipt.js +159 -0
- package/dist/services/memory-verify-handler.js +135 -0
- package/dist/services/memory-work-result-preparation.js +63 -0
- package/dist/services/projects.js +17 -2
- package/dist/services/recovery-snapshot-database.js +416 -1
- package/dist/services/repair-intents.js +1 -1
- package/dist/services/review-copy.js +10 -2
- package/dist/services/run-control.js +80 -9
- package/dist/services/run-controller-capture.js +10 -3
- package/dist/services/run-controller-process.js +21 -0
- package/dist/services/run-controller-recovery.js +3 -1
- package/dist/services/run-controller-state.js +1 -1
- package/dist/services/run-controller.js +184 -48
- package/dist/services/run-recovery-guard.js +2 -0
- package/dist/services/run-recovery.js +145 -5
- package/dist/services/run-start-custody.js +177 -0
- package/dist/services/runs.js +319 -25
- package/dist/services/stage-context.js +9 -1
- package/dist/services/stage-handlers.js +74 -0
- package/dist/services/stage-lifecycle.js +2 -1
- package/dist/services/stage-report-renderer.js +76 -0
- package/dist/services/stage-work-graph.js +17 -0
- package/dist/services/vnext-code.js +3 -3
- package/dist/services/vnext-execution-profile.js +2 -2
- package/dist/services/vnext-fanout.js +136 -10
- package/dist/services/vnext-merge.js +8 -3
- package/dist/services/vnext-plan-review.js +6 -4
- package/dist/services/vnext-protocolize.js +60 -2
- package/dist/services/work-registry.js +616 -71
- package/dist/services/workspace-files.js +1 -1
- package/dist/storage/database.js +84 -6
- package/dist/storage/writer-contract.js +11 -7
- package/package.json +13 -3
- package/tools/create-canon-release.mjs +33 -0
- package/tools/produce-hybrid-release.mjs +41 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @deksden-com/dd-flow-cli
|
|
2
2
|
|
|
3
|
+
## 0.9.0-beta.138
|
|
4
|
+
|
|
5
|
+
- Retain causal native check failures and permit fenced source repair in the same Session. Reject malformed repair proofs and preserve physical execution blockers during reconciliation.
|
|
6
|
+
|
|
7
|
+
## 0.9.0-beta.137
|
|
8
|
+
|
|
9
|
+
- Preserve shared reasoning/mode options in OpenCode v2 and support non-generative doctor before daemon startup.
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- e65a615: Retain scoped native child failures through read-only ZCode observation and durable dispatch fences. Bind failure provenance to current Work/Session/controller identities. Publish materialized PROTOCOLIZE evidence separately from authored input, and replay completed stages without revalidating an archived worktree or regressing later stages.
|
|
14
|
+
|
|
3
15
|
## 0.9.0-beta.136
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -36,6 +36,15 @@ Add `DD_TEST_OPENCODE_LONG=1` to prove shell progress beyond the old 120s cutoff
|
|
|
36
36
|
|
|
37
37
|
## Native daemon shutdown
|
|
38
38
|
|
|
39
|
+
Managed native shells use the launch-bound `DD_FLOW_DAEMON_ID`, `DD_FLOW_HOME`,
|
|
40
|
+
`DD_FLOW_BIN` and resource path. Inherited invocation/control authority is
|
|
41
|
+
cleared; security-only launches do not borrow a previous RUN's identity.
|
|
42
|
+
Compact lifecycle commands resolve private arguments from the issued assignment
|
|
43
|
+
and its native receipt, not from a model-supplied ID or the latest matching row.
|
|
44
|
+
A lost managed binding is a tooling failure, not permission to replay a short
|
|
45
|
+
command. Corrective retries are scoped to the action, Session and Stage attempt;
|
|
46
|
+
exact native event re-delivery returns the retained outcome.
|
|
47
|
+
|
|
39
48
|
`daemon.stop` fences productive dispatch before awaiting settlement. A successful
|
|
40
49
|
durable stop receipt follows native tree settlement, physical provider exit,
|
|
41
50
|
journal drain and required resource/auth finalization. The endpoint then retires
|
package/dist/build-info.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"cli_package": "@deksden-com/dd-flow-cli",
|
|
3
|
-
"cli_version": "0.9.0-beta.
|
|
4
|
-
"cli_commit": "
|
|
5
|
-
"built_at": "2026-10-
|
|
3
|
+
"cli_version": "0.9.0-beta.138",
|
|
4
|
+
"cli_commit": "c1a9786d04e0944daac204e1c767414904d9ced2",
|
|
5
|
+
"built_at": "2026-10-15T05:27:46.626Z",
|
|
6
6
|
"built_with_canon": {
|
|
7
7
|
"version": "4.1.2",
|
|
8
8
|
"commit": "1ddedf9d3f086e046f8e7b194c739ec386e7c8b9",
|
|
9
9
|
"flow_contract": "dd-flow-canonical-2026-08",
|
|
10
|
-
"repo_root": "/Users/deksden/Documents/_Projects/dd-memorybank",
|
|
11
|
-
"memorybank_root": "/Users/deksden/Documents/_Projects/dd-memorybank/.memory-bank",
|
|
12
|
-
"flow_root": "/Users/deksden/Documents/_Projects/dd-memorybank/.memory-bank/dd-flow",
|
|
10
|
+
"repo_root": "/Users/deksden/Documents/_Projects/_worktrees/dd-memorybank-084-release",
|
|
11
|
+
"memorybank_root": "/Users/deksden/Documents/_Projects/_worktrees/dd-memorybank-084-release/.memory-bank",
|
|
12
|
+
"flow_root": "/Users/deksden/Documents/_Projects/_worktrees/dd-memorybank-084-release/.memory-bank/dd-flow",
|
|
13
13
|
"layout": "dot_memory_bank"
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -4,15 +4,15 @@ export function optionalOption(parsed, key) {
|
|
|
4
4
|
const values = parsed.options.get(key);
|
|
5
5
|
const value = values?.[values.length - 1];
|
|
6
6
|
if (value === flagValue)
|
|
7
|
-
throw new AppError("usage", `--${key} requires a value`, 2);
|
|
7
|
+
throw new AppError("usage", `--${key} requires a value`, 2, { parameter: key, reason: "missing_option_value" });
|
|
8
8
|
if (value !== undefined && !value.trim())
|
|
9
|
-
throw new AppError("usage", `--${key} requires a non-empty value`, 2);
|
|
9
|
+
throw new AppError("usage", `--${key} requires a non-empty value`, 2, { parameter: key, reason: "empty_option_value" });
|
|
10
10
|
return value;
|
|
11
11
|
}
|
|
12
12
|
export function requiredOption(parsed, key) {
|
|
13
13
|
const value = optionalOption(parsed, key);
|
|
14
14
|
if (!value) {
|
|
15
|
-
throw new AppError("usage", `Missing required option: --${key}`, 2);
|
|
15
|
+
throw new AppError("usage", `Missing required option: --${key}`, 2, { parameter: key, reason: "missing_required_option" });
|
|
16
16
|
}
|
|
17
17
|
return value;
|
|
18
18
|
}
|
|
@@ -23,7 +23,7 @@ export function optionalNumber(parsed, key) {
|
|
|
23
23
|
}
|
|
24
24
|
const parsedNumber = Number(value);
|
|
25
25
|
if (!Number.isFinite(parsedNumber)) {
|
|
26
|
-
throw new AppError("validation", `--${key} must be a number`, 2);
|
|
26
|
+
throw new AppError("validation", `--${key} must be a number`, 2, { parameter: key, reason: "invalid_number" });
|
|
27
27
|
}
|
|
28
28
|
return parsedNumber;
|
|
29
29
|
}
|
|
@@ -32,7 +32,7 @@ export function optionalPositiveNumber(parsed, key, integer = false) {
|
|
|
32
32
|
if (typeof value === "undefined")
|
|
33
33
|
return undefined;
|
|
34
34
|
if (value <= 0 || (integer && !Number.isInteger(value))) {
|
|
35
|
-
throw new AppError("validation", `--${key} must be a positive${integer ? " integer" : ""} number`, 2);
|
|
35
|
+
throw new AppError("validation", `--${key} must be a positive${integer ? " integer" : ""} number`, 2, { parameter: key, reason: "invalid_number" });
|
|
36
36
|
}
|
|
37
37
|
return value;
|
|
38
38
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AppError } from "../shared/errors.js";
|
|
2
2
|
import { parseCommandArgs } from "../services/lifecycle-command.js";
|
|
3
3
|
import { lifecycleInternalOptions, lifecycleRouteForOperation } from "../services/lifecycle-contract.js";
|
|
4
|
-
import { isUpgradeAllowlisted } from "../services/cli-
|
|
4
|
+
import { isUpgradeAllowlisted } from "../services/cli-upgrade-allowlist.js";
|
|
5
5
|
const words = (value) => value.split(" ").filter(Boolean);
|
|
6
6
|
const route = (positions, required = "", values = "", switches = "", repeatable = "", enums = {}) => ({
|
|
7
7
|
positions: typeof positions === "number" ? [positions, positions] : positions,
|
|
@@ -12,12 +12,50 @@ const scoped = "project-root"; // Optional when the router resolves a unique ret
|
|
|
12
12
|
const lifecycle = lifecycleInternalOptions.join(" ");
|
|
13
13
|
const worker = "worker-id";
|
|
14
14
|
const control = "project-root run";
|
|
15
|
+
const protocolTransitionInput = route(1, "to", `${scoped} payload-file json-file reason`, "force");
|
|
16
|
+
const setupInput = route(0, "request-id trust-file", "canon-source canon-version release-registry channel profile profile-file save-profile-intent", "non-interactive skip-agent-setup", "", { channel: ["stable", "preview", "development"] });
|
|
17
|
+
const memoryInitInput = route(0, "project-root workspace-root request-id", "intake-file intake-sha256 profile profile-file stage-profile work-profile max-parallel delegation native-config-home git-route integration-branch", "detach non-interactive prepare-only allow-live-probe", "stage-profile work-profile", { "git-route": ["integration_branch_direct", "feature_worktree"], delegation: ["external", "native"] });
|
|
18
|
+
export const commandAliases = { transition: "protocol transition", init: "flow mb-init" };
|
|
15
19
|
/** Path-shaped arguments default to physical paths unless the route explicitly
|
|
16
20
|
* opts into contextualPaths. This inventory does not expand arbitrary strings. */
|
|
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"));
|
|
21
|
+
export const physicalPathOptions = new Set(words("canon-source trust-file root project-root workspace-root workspace-path 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"));
|
|
22
|
+
physicalPathOptions.add("profile-file");
|
|
23
|
+
physicalPathOptions.add("save-profile-intent");
|
|
24
|
+
physicalPathOptions.add("model-observation-file");
|
|
25
|
+
physicalPathOptions.add("release-registry");
|
|
26
|
+
physicalPathOptions.add("seed-file");
|
|
27
|
+
physicalPathOptions.add("native-executable");
|
|
28
|
+
physicalPathOptions.add("native-config-home");
|
|
18
29
|
physicalPathOptions.add("operational-decision-file");
|
|
19
30
|
export const commandInputs = {
|
|
20
31
|
"version": route(0),
|
|
32
|
+
"flow list": route(0),
|
|
33
|
+
"flow show": route(1),
|
|
34
|
+
"flow mb-init": memoryInitInput,
|
|
35
|
+
"init": memoryInitInput,
|
|
36
|
+
"runtime storage admit": route(0, "operation", "", "", "", { operation: ["memory-init"] }),
|
|
37
|
+
"runtime flow admit": route(0, "operation", "", "", "", { operation: ["memory-init"] }),
|
|
38
|
+
"completion bash": route(0),
|
|
39
|
+
"completion zsh": route(0),
|
|
40
|
+
"completion fish": route(0),
|
|
41
|
+
"completion candidates": route([0, 1000]),
|
|
42
|
+
"harnesses list": route(0),
|
|
43
|
+
"models list": route(0, "", "harness provider account-sha256 seed-file observation-file", "", "", { harness: ["codex", "zcode", "agy", "opencode", "grok", "droid"] }),
|
|
44
|
+
"models show": route(1, "", "harness provider account-sha256 seed-file observation-file", "", "", { harness: ["codex", "zcode", "agy", "opencode", "grok", "droid"] }),
|
|
45
|
+
"harnesses show": route(1),
|
|
46
|
+
"harnesses discover": route(0, "", "harness executable", "", "", { harness: ["codex", "zcode", "agy", "opencode", "grok", "droid"] }),
|
|
47
|
+
"harnesses probe-version": route(0, "harness", "executable timeout-ms", "allow-processes allow-credentials allow-writes", "", { harness: ["codex", "zcode", "agy", "opencode", "grok", "droid"] }),
|
|
48
|
+
"harnesses doctor": route(0, "harness", "executable native-executable state-dir timeout-ms provider account-sha256 model-observation-file", "allow-processes allow-services allow-credentials allow-writes", "", { harness: ["codex", "zcode", "agy", "opencode", "grok", "droid"] }),
|
|
49
|
+
"setup": setupInput,
|
|
50
|
+
"setup update": setupInput,
|
|
51
|
+
"setup status": route(0),
|
|
52
|
+
"profiles list": route(0),
|
|
53
|
+
"profiles show": route(1),
|
|
54
|
+
"profiles create": route(0, "file expected-revision", "", "set-default"),
|
|
55
|
+
"profiles edit": route(0, "file expected-revision"),
|
|
56
|
+
"profiles remove": route(1, "expected-revision"),
|
|
57
|
+
"profiles alias": route(1, "expected-revision", "target", "remove"),
|
|
58
|
+
"profiles set-default": route([0, 1], "expected-revision", "", "clear"),
|
|
21
59
|
"status": route(0, "", "root project-root", "check-registry"),
|
|
22
60
|
"project register": route(0, "root"),
|
|
23
61
|
"project status": route(0, "root"),
|
|
@@ -34,8 +72,8 @@ export const commandInputs = {
|
|
|
34
72
|
"protocol blockers": route(1, project),
|
|
35
73
|
"protocol implement": route(1, "", `${scoped} reason`, "force"),
|
|
36
74
|
"protocol ready-for-merge": route(1, "", scoped),
|
|
37
|
-
"protocol transition":
|
|
38
|
-
"transition":
|
|
75
|
+
"protocol transition": protocolTransitionInput,
|
|
76
|
+
"transition": protocolTransitionInput,
|
|
39
77
|
"protocol sync-from-run": route(1, "run", `${scoped} target`),
|
|
40
78
|
"protocol cancel": route(1, "reason", `${scoped} close-sessions cancel-queue release-locks worktree`, "force"),
|
|
41
79
|
"plan status": route(1, "", scoped),
|
|
@@ -57,7 +95,7 @@ export const commandInputs = {
|
|
|
57
95
|
"stage fanout reconcile": { ...route(1, "stage observations-file", scoped), contextualPaths: words("project-root observations-file") },
|
|
58
96
|
"stage native observe": { ...route(1, "stage observations-file", scoped), contextualPaths: words("project-root observations-file") },
|
|
59
97
|
"work status": route(1, project),
|
|
60
|
-
"work add-batch": { ...route(0, "parent file", scoped), contextualPaths: words("project-root file") },
|
|
98
|
+
"work add-batch": { ...route(0, "parent file", `${scoped} stage request-key`), contextualPaths: words("project-root file") },
|
|
61
99
|
"work ls": route(0, "", `${scoped} run parent status limit`, "ready include-results", "", { status: ["created", "running", "paused", "completed", "failed", "cancelled"] }),
|
|
62
100
|
"work show": route(1, "", scoped),
|
|
63
101
|
"work repair add": { ...route(0, "run", `${scoped} origin-work from-check from-finding from-unresolved check-ref verification-file task-file`, "task-stdin", "origin-work from-finding from-unresolved check-ref"), contextualPaths: words("project-root verification-file task-file") },
|
|
@@ -101,7 +139,7 @@ export const commandInputs = {
|
|
|
101
139
|
"run recovery capture": route(1, `${project} recovery-id capture-path`),
|
|
102
140
|
"run recovery resume": route(1, `${project} recovery-id daemon-id harness native-session-id`),
|
|
103
141
|
"run recovery accept": { ...route(1, `${project} recovery-id`, lifecycle), contextualPaths: ["project-root"] },
|
|
104
|
-
"run snapshot bootstrap create": route(0, `${project} output`),
|
|
142
|
+
"run snapshot bootstrap create": route(0, `${project} output flow`),
|
|
105
143
|
"run snapshot bootstrap restore": route(0, `${project} snapshot`),
|
|
106
144
|
"run snapshot create": route(1, `${project} output`, "recovery-id stage-entry", "candidate incomplete"),
|
|
107
145
|
"run snapshot restore": route(0, `${project} snapshot`, "execution-routing-file operational-decision-file recovery-id"),
|
|
@@ -225,14 +263,33 @@ export const commandInputs = {
|
|
|
225
263
|
"dashboard refresh": route(0, "", "project project-root protocol open format output", "all"),
|
|
226
264
|
"dashboard refresh-global": route(0, "", "output format"),
|
|
227
265
|
"schema validate": { ...route(0, "schema file", "schema-dir project-root run"), contextualPaths: words("project-root file") },
|
|
228
|
-
"memory permissions preflight": route(0, "root memory-bank flow mode", "tasks")
|
|
266
|
+
"memory permissions preflight": route(0, "root memory-bank flow mode", "tasks"),
|
|
267
|
+
"memory compose register": route(0, "project-root run request-key result-file"),
|
|
268
|
+
"memory verify checks": route(0, "project-root run"),
|
|
269
|
+
"memory review register": route(0, "project-root run"),
|
|
270
|
+
"memory review collect": route(0, "project-root run"),
|
|
271
|
+
"memory finish evidence": route(0, "project-root run"),
|
|
272
|
+
"memory finish integrate": route(0, "project-root run"),
|
|
273
|
+
"memory corrections register": route(0, "project-root run wave result-file", "", "", "", { wave: ["1", "2"] }),
|
|
274
|
+
"memory corrections checks": route(0, "project-root run wave", "", "", "", { wave: ["1", "2"] }),
|
|
275
|
+
"memory review selective-register": route(0, "project-root run wave", "", "", "", { wave: ["1", "2"] }),
|
|
276
|
+
"memory review selective-collect": route(0, "project-root run wave", "", "", "", { wave: ["1", "2"] }),
|
|
277
|
+
"memory repair baseline": route(0, "project-root run wave work", "", "", "", { wave: ["1", "2"] }),
|
|
278
|
+
"memory repair copy-reserve": route(0, "project-root run wave work", "", "", "", { wave: ["1", "2"] }),
|
|
279
|
+
"memory repair copy-materialize": route(0, "project-root run wave work", "", "", "", { wave: ["1", "2"] }),
|
|
280
|
+
"memory repair copy-dispatch": route(0, "project-root run wave work", "", "", "", { wave: ["1", "2"] }),
|
|
281
|
+
"memory repair current-view": route(0, "project-root run wave work workspace-root", "", "", "", { wave: ["1", "2"] }),
|
|
282
|
+
"memory repair publication-source": route(0, "project-root run wave work workspace-root work-session", "", "", "", { wave: ["1"] }),
|
|
283
|
+
"memory repair publication-reserve": route(0, "project-root run wave work workspace-root work-session result-file", "", "", "", { wave: ["1", "2"] }),
|
|
284
|
+
"memory repair publication-apply": route(0, "project-root run wave work workspace-root work-session", "", "", "", { wave: ["1", "2"] }),
|
|
285
|
+
"memory repair publication-finish": route(0, "project-root run wave work workspace-root work-session", "", "", "", { wave: ["1", "2"] })
|
|
229
286
|
};
|
|
230
287
|
export function contextualPathOptionsForLifecycle(operation) {
|
|
231
288
|
const key = lifecycleRouteForOperation(operation);
|
|
232
289
|
return new Set(commandInputs[key]?.contextualPaths ?? []);
|
|
233
290
|
}
|
|
234
291
|
const flag = "__dd_flow_flag__";
|
|
235
|
-
const positiveInteger = new Set(words("limit lease-ms pid owner-pid process-group-id ready-timeout-ms max-parallel-projects expected-revision"));
|
|
292
|
+
const positiveInteger = new Set(words("limit lease-ms pid owner-pid process-group-id ready-timeout-ms max-parallel max-parallel-projects expected-revision"));
|
|
236
293
|
const nonnegativeInteger = new Set(words("after generation wait-ms grace-ms available-slots"));
|
|
237
294
|
const positiveNumber = new Set(words("ttl poll-interval poll-seconds"));
|
|
238
295
|
const booleans = new Set(words("write close-sessions cancel-queue release-locks user-required requeue acquire-lock"));
|
|
@@ -240,7 +297,7 @@ export function prepareCommandRoute(args) {
|
|
|
240
297
|
const parsed = parseCommandArgs(args);
|
|
241
298
|
const key = Object.keys(commandInputs).filter(key => key.split(" ").every((part, index) => parsed.positional[index] === part))
|
|
242
299
|
.sort((a, b) => b.split(" ").length - a.split(" ").length)[0];
|
|
243
|
-
const reject = (message, parameter) => { throw new AppError("usage", message, 2, { phase: "prepare", effect: "no_effect", recoverable: true, ...(parameter ? { parameter } : {}) }); };
|
|
300
|
+
const reject = (message, parameter, reason = "invalid_argument") => { throw new AppError("usage", message, 2, { phase: "prepare", effect: "no_effect", recoverable: true, reason, ...(parameter ? { parameter } : {}) }); };
|
|
244
301
|
if (!key)
|
|
245
302
|
return reject("Unknown command; use dd-flow --help");
|
|
246
303
|
const contract = commandInputs[key];
|
|
@@ -259,7 +316,7 @@ export function prepareCommandRoute(args) {
|
|
|
259
316
|
if (!upgrade && !contract.values.includes(name) && !contract.switches.includes(name))
|
|
260
317
|
reject(`${key} does not accept --${name}`, name);
|
|
261
318
|
if (values.length > 1 && !contract.repeatable.includes(name))
|
|
262
|
-
reject(`--${name} must occur once`, name);
|
|
319
|
+
reject(`--${name} must occur once`, name, "duplicate_option");
|
|
263
320
|
for (const value of values) {
|
|
264
321
|
if (contract.switches.includes(name) || name === "mb-upgrade-mode") {
|
|
265
322
|
if (value !== flag)
|
|
@@ -267,26 +324,38 @@ export function prepareCommandRoute(args) {
|
|
|
267
324
|
continue;
|
|
268
325
|
}
|
|
269
326
|
if (value === flag || !value.trim())
|
|
270
|
-
reject(`--${name} requires a non-empty value`, name);
|
|
327
|
+
reject(`--${name} requires a non-empty value`, name, value === flag ? "missing_option_value" : "empty_option_value");
|
|
271
328
|
if (name === "compatibility-mode" && value !== "mb-upgrade")
|
|
272
|
-
reject("--compatibility-mode must be mb-upgrade", name);
|
|
329
|
+
reject("--compatibility-mode must be mb-upgrade", name, "invalid_choice");
|
|
273
330
|
const choices = contract.enums[name];
|
|
274
331
|
if (choices && !choices.includes(key === "id next" && name === "type" ? value.toLowerCase() : value))
|
|
275
|
-
reject(`--${name} must be ${choices.join(" or ")}`, name);
|
|
332
|
+
reject(`--${name} must be ${choices.join(" or ")}`, name, "invalid_choice");
|
|
276
333
|
if (booleans.has(name) && !["true", "false"].includes(value))
|
|
277
|
-
reject(`--${name} must be true or false`, name);
|
|
334
|
+
reject(`--${name} must be true or false`, name, "invalid_choice");
|
|
278
335
|
const number = Number(value);
|
|
279
|
-
|
|
336
|
+
const profileRevision = key.startsWith("profiles ") && name === "expected-revision";
|
|
337
|
+
if (profileRevision && !/^[a-f0-9]{64}$/.test(value))
|
|
338
|
+
reject("--expected-revision requires the SHA-256 returned by profiles list", name);
|
|
339
|
+
if (!profileRevision && positiveInteger.has(name) && (!/^[0-9]+$/.test(value) || !Number.isSafeInteger(number) || number <= 0)
|
|
280
340
|
|| nonnegativeInteger.has(name) && (!/^[0-9]+$/.test(value) || !Number.isSafeInteger(number) || number < 0)
|
|
281
341
|
|| positiveNumber.has(name) && (!Number.isFinite(number) || number <= 0)
|
|
282
342
|
|| name === "timeout" && (!Number.isFinite(number) || number < 0)
|
|
283
|
-
|| name === "available-slots" && number > 15
|
|
284
|
-
|
|
343
|
+
|| name === "available-slots" && number > 15
|
|
344
|
+
|| name === "max-parallel" && number > 256)
|
|
345
|
+
reject(`Invalid numeric value for --${name}`, name, "invalid_number");
|
|
285
346
|
}
|
|
286
347
|
}
|
|
287
348
|
for (const name of contract.required)
|
|
288
349
|
if (!parsed.options.has(name))
|
|
289
|
-
reject(`Missing required option: --${name}`, name);
|
|
350
|
+
reject(`Missing required option: --${name}`, name, "missing_required_option");
|
|
351
|
+
if (key === "work add-batch" && parsed.options.has("request-key")) {
|
|
352
|
+
const requestKey = parsed.options.get("request-key")[0];
|
|
353
|
+
const stage = parsed.options.get("stage")?.[0];
|
|
354
|
+
if (!/^[A-Za-z0-9][A-Za-z0-9_.-]{0,95}$/.test(requestKey))
|
|
355
|
+
reject("--request-key requires a bounded identifier (1..96 characters)", "request-key");
|
|
356
|
+
if (!stage || !/^[A-Za-z0-9][A-Za-z0-9_.-]{0,127}$/.test(stage))
|
|
357
|
+
reject("--request-key requires an explicit bounded --stage", "stage");
|
|
358
|
+
}
|
|
290
359
|
for (const aliases of [
|
|
291
360
|
["root", "project-root"], ["payload-file", "json-file"],
|
|
292
361
|
["payload-file", "payload-json", "payload-base64"], ["semantic-file", "data", "result-file", "result-stdin"],
|
|
@@ -296,12 +365,12 @@ export function prepareCommandRoute(args) {
|
|
|
296
365
|
]) {
|
|
297
366
|
const present = aliases.filter(name => parsed.options.has(name));
|
|
298
367
|
if (present.length > 1)
|
|
299
|
-
reject(`Use only one of ${present.map(name => `--${name}`).join(", ")}
|
|
368
|
+
reject(`Use only one of ${present.map(name => `--${name}`).join(", ")}`, [...present].sort(), "duplicate_option");
|
|
300
369
|
}
|
|
301
370
|
if (contract.values.includes("retry-check") && parsed.options.has("retry-check") !== (parsed.options.has("reason") || parsed.options.has("reason-file")))
|
|
302
371
|
reject("--retry-check requires exactly one of --reason or --reason-file");
|
|
303
372
|
// Retain the dispatcher's historic offsets for nested action positions.
|
|
304
373
|
const family = parsed.positional[0];
|
|
305
|
-
const singleWord = ["status", "version", "transition"].includes(family);
|
|
374
|
+
const singleWord = ["status", "version", "transition", "init"].includes(family);
|
|
306
375
|
return { key, family, command: singleWord ? undefined : parsed.positional[1], parsed: { options: parsed.options, positional: parsed.positional.slice(singleWord ? 1 : 2) } };
|
|
307
376
|
}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { commandInputs, physicalPathOptions } from "./command-inputs.js";
|
|
2
2
|
import { runtimeOptionDescriptions } from "./command-option-descriptions.js";
|
|
3
3
|
const optionDescriptions = {
|
|
4
|
+
"intake-sha256": "SHA-256 of the exact original intake file bytes. Fresh execution verifies the bytes; replay compares the retained hash without reopening the original file.",
|
|
5
|
+
"stage-profile": "Repeatable stage=profile assignment for the six mb-init stages. Each stage may occur once; the selected profile ID or alias is frozen before dispatch.",
|
|
6
|
+
"work-profile": "Repeatable approved Work executor profile ID or alias. Explicit order is retained; duplicate profiles refuse.",
|
|
7
|
+
"git-route": "Explicit project Git integration route. Direct integration uses the integration branch checkout; feature_worktree uses an already assigned separate checkout.",
|
|
8
|
+
"integration-branch": "Explicit project integration branch, validated with Git before project publication. No branch is inferred from the current checkout.",
|
|
9
|
+
"detach": "Return the accepted managed-controller receipt without observing until completion. Disconnecting the observer never stops the controller.",
|
|
4
10
|
"harness": "Select one supported harness family. Static discovery checks executable presence, not authentication or model access; diagnostics require separate effect consent.",
|
|
5
11
|
"provider": "Exact provider namespace for model filtering or doctor observation binding, including namespaced IDs such as builtin:zai-coding-plan. An account binding requires --account-sha256; this selector does not authenticate credentials.",
|
|
6
12
|
"executable": "Explicit installed harness executable path, including paths with spaces. Resolves ambiguous installations without choosing an arbitrary PATH candidate. Discovery never executes it; probes require explicit effect flags.",
|
|
@@ -33,6 +39,7 @@ const optionDescriptions = {
|
|
|
33
39
|
"run": "Exact retained RUN identity; its frozen execution settings remain authoritative.",
|
|
34
40
|
"reason": "Operator explanation retained with the requested change.",
|
|
35
41
|
"request-id": "Stable request identity for reconciliation and idempotent retry.",
|
|
42
|
+
"request-key": "Stable exact-request replay identity; changed inputs or missing independent custody refuse rather than allocate again. The owning command defines scope and syntax.",
|
|
36
43
|
"expected-revision": "Required current revision; stale changes are rejected instead of overwriting concurrent edits.",
|
|
37
44
|
"profile": "Explicit configured profile identifier; credentials are not stored in profiles.",
|
|
38
45
|
"profile-file": "Complete validated executor profile; exclusive with --profile and --skip-agent-setup. Does not change operator defaults.",
|
|
@@ -41,7 +48,23 @@ const optionDescriptions = {
|
|
|
41
48
|
"offline": "Explicit drained/offline operation; does not establish physical settlement by itself."
|
|
42
49
|
};
|
|
43
50
|
/** Option names alone are insufficient when different commands own different inputs. */
|
|
51
|
+
const memoryRepairOptions = {
|
|
52
|
+
run: "Active registered mb-init review RUN; retained correction graph and frozen execution own every repair operation.",
|
|
53
|
+
wave: "Exact causal correction wave 1 or 2; never falls back to another wave or permits a third wave.",
|
|
54
|
+
work: "Exact registered repair Work in the selected correction wave; foreign Work and generation custody refuse.",
|
|
55
|
+
"workspace-root": "Shared frozen RUN workspace, not the private repair copy; independent source and scope custody remain required.",
|
|
56
|
+
"work-session": "Exact independently started repair WorkSession; this command never creates or claims a provider Session."
|
|
57
|
+
};
|
|
58
|
+
const memoryInitOptions = {
|
|
59
|
+
"prepare-only": "Prepare or replay the frozen Memory RUN and project bootstrap without launching a controller or provider Session. This publishes project/runtime state; it is not a dry run. Use run drive launch with the returned RUN to select bounded observation/capture. Exclusive with --detach; replay never stops an existing controller.",
|
|
60
|
+
"profile-file": "Absolute regular JSON file with one complete validated operation-only executor profile. Exclusive with --profile; never saves settings or changes defaults. Omit on replay to reuse frozen bytes; supplied profile content must match the original selection.",
|
|
61
|
+
"non-interactive": "Never open the first-flow executor dialog, even on a terminal. Without an explicit profile/file or configured default, refuse before project effects; init cannot skip its executor."
|
|
62
|
+
};
|
|
44
63
|
const commandOptionDescriptions = {
|
|
64
|
+
"flow mb-init": memoryInitOptions,
|
|
65
|
+
init: memoryInitOptions,
|
|
66
|
+
"runtime storage admit": { operation: "Operation-specific writable-connection admission: memory-init only. Requires explicit canonical DD_FLOW_HOME and an existing compatible resource registry. Never initializes, migrates, repairs or starts agents." },
|
|
67
|
+
"runtime flow admit": { operation: "Memory-init handler admission in the executing engine. Reads bounded UTF-8 JSON stdin with source and source_sha256; optional startup_input_schema additionally requires support by this engine's startup reader. Validates the exact six-stage descriptor using actual registered handlers. Does not establish release trust, storage/provider readiness or semantic completion, and never creates Home, RUN or agents." },
|
|
45
68
|
"profiles create": { file: "Regular UTF-8 JSON file containing one complete validated agent profile. The ID must be unused. Credentials and unknown fields are refused; creation uses --expected-revision and never starts a model Turn." },
|
|
46
69
|
"profiles edit": { file: "Regular UTF-8 JSON file containing the complete replacement agent profile, not a patch. Its ID must already exist. Revision conflicts refuse the edit; retained RUN snapshots are unchanged." },
|
|
47
70
|
"profiles alias": {
|
|
@@ -49,7 +72,11 @@ const commandOptionDescriptions = {
|
|
|
49
72
|
remove: "Remove the positional alias, not its target profile. Exclusive with --target. The revision-checked change does not rewrite retained RUN settings."
|
|
50
73
|
},
|
|
51
74
|
"profiles set-default": { clear: "Clear only the operator global default. Exclusive with a positional profile ID or alias; existing profiles, project routing and frozen RUN settings remain unchanged." },
|
|
52
|
-
"work add-batch": {
|
|
75
|
+
"work add-batch": {
|
|
76
|
+
file: "Validated Work batch JSON file declaring children of --parent, including their task and dependency inputs. Adding logical Work does not launch physical Sessions.",
|
|
77
|
+
stage: "Explicit owner stage. With --request-key it must be the active running coordinator stage; attempt and cycle are resolved from retained RUN authority.",
|
|
78
|
+
"request-key": "Stable registration ID (1..96 letters, digits, dots, underscores or hyphens, starting with a letter or digit). Requires --stage. Identical replay returns the retained Work IDs; changed input or missing custody refuses allocation. Without this option the historical non-replayable batch behavior is retained."
|
|
79
|
+
},
|
|
53
80
|
"schema validate": { file: "JSON document to validate against --schema in the selected schema directory. Validation does not execute a flow or accept semantic completion." },
|
|
54
81
|
"migration verify": { file: "Existing dd-flow/mb-upgrade-migration-report@1 JSON report to verify against migration evidence; verification does not apply a storage migration." },
|
|
55
82
|
"migration apply": { file: "Explicit migration report JSON file used for admission to the requested apply operation; backup and ownership gates remain mandatory." },
|
|
@@ -70,11 +97,34 @@ const commandOptionDescriptions = {
|
|
|
70
97
|
"codex hooks install": { target: "Hook installation target: isolated (default) or default Codex home; mutation also requires explicit confirmation.", profile: "Project Codex home profile used to locate isolated hooks; not an executor profile." },
|
|
71
98
|
"codex hooks remove": { target: "Hook installation target: isolated (default) or default Codex home; removal also requires explicit confirmation.", profile: "Project Codex home profile used to locate isolated hooks; not an executor profile." },
|
|
72
99
|
"protocol sync-from-run": { target: "Protocol state target derived from the selected RUN; auto uses the command's supported state mapping." },
|
|
100
|
+
"run reconcile": {
|
|
101
|
+
apply: "Persist the observed RUN health under its current ownership and revision fences. Without this switch, report only; never launch, resume or stop a provider.",
|
|
102
|
+
"no-progress-ms": "Override the health-assessment progress-age threshold in milliseconds; integer at least 1000. Defaults are 120000 for starting, 300000 for capturing and 1800000 otherwise. This is not a productive command timeout or permission to stop a live owner."
|
|
103
|
+
},
|
|
73
104
|
"run fork": { from: "Existing retained snapshot path to fork into a new RUN with the explicitly selected engine; not a control request identity." },
|
|
74
105
|
"run control resume": { from: "Exact retained pause/stop control ID whose captured state authorizes this resume request; not a snapshot path." },
|
|
75
106
|
"stage block": { kind: "Blocker category: engine, harness or environment; code and summary identify the actionable cause." },
|
|
76
107
|
"migration impact": { mode: "Optional full_migration request forces the strict full-migration assessment; otherwise impact evidence determines patch, targeted_minor or full_migration." },
|
|
77
|
-
"memory permissions preflight": { mode: "Permission contour to check: read, write, repair or report_only; write checks may create temporary permission probes.", flow: "Workflow permission contour: mb-init, mb-upgrade, mb-audit, mb-fix, mb-upgrade-review or custom. Not a filesystem path." }
|
|
108
|
+
"memory permissions preflight": { mode: "Permission contour to check: read, write, repair or report_only; write checks may create temporary permission probes.", flow: "Workflow permission contour: mb-init, mb-upgrade, mb-audit, mb-fix, mb-upgrade-review or custom. Not a filesystem path." },
|
|
109
|
+
"memory compose register": { "run": "Active registered mb-init RUN whose accepted discovery and immutable execution bind the composition graph.", "request-key": "Stable composition registration identity; exact replay retains the original Work graph.", "result-file": "Bounded proposed composition JSON. Bytes are prepared before registration; agent fields do not grant Work or write authority." },
|
|
110
|
+
"memory verify checks": { "run": "Active registered mb-init RUN. Execute only its independently selected declared verification checks." },
|
|
111
|
+
"memory review register": { "run": "Active registered mb-init RUN with accepted verification. Register initial independent reviewers; this does not launch providers." },
|
|
112
|
+
"memory review collect": { "run": "Active registered mb-init RUN. Collect genuine registered initial-wave results without accepting the Stage or granting correction authority." },
|
|
113
|
+
"memory finish evidence": { "run": "Active registered mb-init finish RUN. Publish independently prepared coverage, integration and readiness evidence; publication does not complete Stage or RUN." },
|
|
114
|
+
"memory finish integrate": { "run": "Active mb-init finish RUN. Commit only accepted Memory Bank and owned lint files under retained Git policy, then integrate the admitted workspace locally. Preserve unrelated staged/dirty files; never push. Lost-response replay observes the original effects without another commit." },
|
|
115
|
+
"memory corrections register": { run: "Active registered mb-init review RUN. Register only the correction plan bound to the independently retained preceding review.", wave: "Correction wave 1 follows initial review; wave 2 requires settled first selective review. A third wave is unsupported.", "result-file": "Bounded correction-plan JSON prepared before graph registration; exact retained replay cannot substitute another plan." },
|
|
116
|
+
"memory corrections checks": { run: "Active registered mb-init review RUN with a genuinely settled correction view.", wave: "Run only the independently selected finite check profile for correction wave 1 or 2; this does not accept semantic quality." },
|
|
117
|
+
"memory review selective-register": { run: "Active registered mb-init review RUN. Allocate selective reviewers only after their wave's committed checks.", wave: "Select correction wave 1 or 2. Unaffected accepted units remain retained; registration does not launch providers." },
|
|
118
|
+
"memory review selective-collect": { run: "Active registered mb-init review RUN. Return genuine selective reviewer references, not Stage or RUN acceptance.", wave: "Select independently registered review of correction wave 1 or 2; missing wave custody never falls back to initial review." },
|
|
119
|
+
"memory repair baseline": { ...memoryRepairOptions, work: "Register the immutable prelaunch baseline for this repair Work; dependent/peer changes require explicit current-view registration first. Does not launch providers." },
|
|
120
|
+
"memory repair copy-reserve": { ...memoryRepairOptions, work: "Reserve the owned private copy for this repair Work after its committed baseline; reservation does not create the copy or launch providers." },
|
|
121
|
+
"memory repair copy-materialize": { ...memoryRepairOptions, work: "Materialize the reserved private copy for this repair Work with retained build/ready receipts; no provider launch or shared document publication." },
|
|
122
|
+
"memory repair copy-dispatch": { ...memoryRepairOptions, work: "Prepare the frozen profile and verified ready-copy root for this repair Work. Read-only packet output does not launch a provider, claim a Session or replace fresh launcher custody checks." },
|
|
123
|
+
"memory repair current-view": { ...memoryRepairOptions, work: "Retain the explained settled-peer input view for this repair Work; does not replace an existing immutable baseline or grant launch authority." },
|
|
124
|
+
"memory repair publication-source": { ...memoryRepairOptions, wave: "Wave 1 only: retain independently explained shared publication source before reserving output. Wave 2 uses its separate retained launch owner." },
|
|
125
|
+
"memory repair publication-reserve": { ...memoryRepairOptions, "result-file": "Bounded exact private repair result bytes prepared before dispatch. Reserve the independently validated delta only; wave 1 requires a previously registered publication-source." },
|
|
126
|
+
"memory repair publication-apply": { ...memoryRepairOptions, work: "Apply or reconcile one retained publication action for this repair Work; repeat until physical publication completes. Unknown effect never authorizes blind retry." },
|
|
127
|
+
"memory repair publication-finish": { ...memoryRepairOptions, work: "Settle this repair Work only after independently proven physical publication completion; does not accept semantic review or finish Stage/RUN." }
|
|
78
128
|
};
|
|
79
129
|
export const globalOptionDocumentation = [
|
|
80
130
|
{ name: "help", description: "Show help before command preparation or resource access; -h is equivalent.", kind: "switch", required: false, repeatable: false, choices: [], physical_path: false },
|
|
@@ -111,7 +161,10 @@ export function optionsForCommandTree(command) {
|
|
|
111
161
|
}
|
|
112
162
|
/** One exact native routing classification shared by router and compatibility admission. */
|
|
113
163
|
export function routerNativeRoute(key) {
|
|
114
|
-
return key === "version" || key
|
|
164
|
+
return key === "version" || key.startsWith("engine ") || key === "schema validate"
|
|
165
|
+
|| key === "flow list" || key === "flow show" || key === "flow mb-init" || key === "init"
|
|
166
|
+
|| key === "run reconcile" || key === "runtime storage admit"
|
|
167
|
+
|| key === "runtime flow admit"
|
|
115
168
|
|| key.startsWith("profiles ") || key.startsWith("models ") || key.startsWith("harnesses ") || key.startsWith("completion ") || key === "setup" || key.startsWith("setup ")
|
|
116
169
|
|| key === "storage migrate-writer" || key === "codex hook handle"
|
|
117
170
|
|| key === "zcode hook handle" || key === "zcode invocation prepare"
|
|
@@ -12,6 +12,10 @@ export const runtimeOptionDescriptions = {
|
|
|
12
12
|
"answer-stdin": "Read the stage answer from standard input instead of --answer-file.",
|
|
13
13
|
apply: "Apply the proposed project-ID migration; without this switch the command remains a preview.",
|
|
14
14
|
"available-slots": "Record available native delegation capacity as an integer from 0 through 15; capacity is not proof of child settlement.",
|
|
15
|
+
"max-parallel": "Freeze the Work concurrency limit (external integer 1..256; explicit native 1..15). Omit on replay to retain the original selection; native capacity requires an authorized technical probe and never overrides runtime budgets or Work dependencies.",
|
|
16
|
+
"delegation": "Select external Work sessions (default) or explicit native children. Native fresh init requires --allow-live-probe; it cannot switch worker profiles.",
|
|
17
|
+
"allow-live-probe": "Authorize this request's bounded technical native child probe outside the RUN. It can incur provider usage; unknown effects retain exact operation custody and never restart fan-out.",
|
|
18
|
+
"native-config-home": "Optional absolute provider configuration home for native qualification. Otherwise preserve normal harness authentication and configuration. The CLI never copies or links credentials or rewrites operator configuration.",
|
|
15
19
|
backup: "New absolute backup destination for the explicitly drained database; an existing backup is never overwritten.",
|
|
16
20
|
"backup-created-at": "Timestamp of the retained backup used as migration evidence; must agree with the selected migration inputs.",
|
|
17
21
|
"backup-path": "Path to the retained backup bound into migration planning, reporting or application evidence.",
|
|
@@ -77,6 +81,7 @@ export const runtimeOptionDescriptions = {
|
|
|
77
81
|
lane: "Named project workspace lane whose workspace, waiters or lock are being inspected or changed.",
|
|
78
82
|
"lease-ms": "Runtime process lease duration in milliseconds; renewal requires the current lease token.",
|
|
79
83
|
"lease-token": "Current owned lease token for the exact process or lane; not an executor credential or an ownership override.",
|
|
84
|
+
"registration-sha256": "Exact managed-process registration binding returned by confirmation or renewal. Pins the resource Home and registered owner/PID identity; a changed registration refuses rather than matching a reused process ID.",
|
|
80
85
|
limit: "Maximum number of Work entries returned by the listing; must be a positive integer.",
|
|
81
86
|
"manifest-json": "Inline runtime-scope manifest declaration binding the selected source manifest and executions; changed declarations refuse.",
|
|
82
87
|
"max-parallel-projects": "Maximum projects processed concurrently by the merge server; does not widen per-project merge authority.",
|
|
@@ -2,10 +2,10 @@ import { createInterface } from "node:readline";
|
|
|
2
2
|
import { AppError } from "../shared/errors.js";
|
|
3
3
|
import { prepareOperatorProfile, prepareProfileCreation, readOperatorProfileInput } from "../services/operator-profiles.js";
|
|
4
4
|
/** One explicit choice; prompts go to stderr so stdout remains machine-readable. */
|
|
5
|
-
export async function askExecutorChoice(settings, io) {
|
|
5
|
+
export async function askExecutorChoice(settings, io, policy = {}) {
|
|
6
6
|
const ids = settings.profiles.map(entry => entry.id);
|
|
7
7
|
io.stderr.write(`Executor profiles: ${ids.length ? ids.join(", ") : "none configured"}\n`);
|
|
8
|
-
io.stderr.write(
|
|
8
|
+
io.stderr.write(`Choose a profile ID/alias, file:/absolute/profile.json, create${policy.allowSkip === false ? "" : ", or skip"}. No model is selected automatically.\n`);
|
|
9
9
|
const terminal = createInterface({ input: io.stdin, output: io.stderr });
|
|
10
10
|
const lines = terminal[Symbol.asyncIterator]();
|
|
11
11
|
const cancelled = () => new AppError("onboarding_cancelled", "Executor onboarding was cancelled", 1, { effect: "no_effect" });
|
|
@@ -22,8 +22,11 @@ export async function askExecutorChoice(settings, io) {
|
|
|
22
22
|
};
|
|
23
23
|
try {
|
|
24
24
|
const answer = await ask("Executor: ");
|
|
25
|
-
if (answer === "skip")
|
|
25
|
+
if (answer === "skip") {
|
|
26
|
+
if (policy.allowSkip === false)
|
|
27
|
+
throw new AppError("agent_profile_missing", "This flow requires an executor profile", 1, { effect: "no_effect" });
|
|
26
28
|
return { skip: true };
|
|
29
|
+
}
|
|
27
30
|
if (answer === "create") {
|
|
28
31
|
io.stderr.write("Enter explicit profile settings; this does not probe providers or verify model access. Nothing is saved by this dialog.\n");
|
|
29
32
|
const input = { schema_id: "dd-flow/agent-profile@1" };
|
|
@@ -39,6 +42,8 @@ export async function askExecutorChoice(settings, io) {
|
|
|
39
42
|
}
|
|
40
43
|
if (await ask("Use this profile for this operation? Type yes: ") !== "yes")
|
|
41
44
|
throw cancelled();
|
|
45
|
+
if (policy.allowSave === false)
|
|
46
|
+
return { profile };
|
|
42
47
|
const save = await ask("Save this profile globally during installation? Type yes or no: ");
|
|
43
48
|
if (save !== "yes" && save !== "no")
|
|
44
49
|
throw cancelled();
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { prepareCommandRoute } from "./command-inputs.js";
|
|
2
|
+
import { parseOutputOptions } from "./output-options.js";
|
|
3
|
+
import { prepareResponseDestination, writeResponseFile } from "./response-file.js";
|
|
4
|
+
import { listBundledFlows, showBundledFlow } from "../services/flow-catalog.js";
|
|
5
|
+
import { AppError, errorRecord } from "../shared/errors.js";
|
|
6
|
+
import { writePreparationError } from "./error-output.js";
|
|
7
|
+
/** Catalog inspection never creates an AppContext or executes a flow. */
|
|
8
|
+
export function runFlowCatalogCli(args, io = process) {
|
|
9
|
+
try {
|
|
10
|
+
const output = parseOutputOptions(args);
|
|
11
|
+
const route = prepareCommandRoute(output.args);
|
|
12
|
+
let result;
|
|
13
|
+
if (route.key === "flow list")
|
|
14
|
+
result = { flows: listBundledFlows() };
|
|
15
|
+
else if (route.key === "flow show")
|
|
16
|
+
result = { flow: showBundledFlow(route.parsed.positional[0]) };
|
|
17
|
+
else
|
|
18
|
+
throw new AppError("usage", "Use dd-flow flow list or flow show <id>", 2, { effect: "no_effect" });
|
|
19
|
+
if (output.responseFile)
|
|
20
|
+
prepareResponseDestination(output.responseFile);
|
|
21
|
+
io.stdout.write(`${JSON.stringify(writeResponseFile({ ok: true, action: route.key.replaceAll(" ", "_"), ...result }, output), null, output.json ? undefined : 2)}\n`);
|
|
22
|
+
return 0;
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
const record = errorRecord(error);
|
|
26
|
+
writePreparationError(io, args, record);
|
|
27
|
+
return record.exitCode;
|
|
28
|
+
}
|
|
29
|
+
}
|