@deksden-com/dd-flow-cli 0.9.0-beta.144 → 0.9.0-beta.149
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 +130 -0
- package/README.md +13 -8
- package/dist/build-info.json +7 -7
- package/dist/cli/command-inputs.js +13 -3
- package/dist/cli/command-metadata.js +51 -16
- package/dist/cli/diagnostic-invocation.js +46 -0
- package/dist/cli/diagnostic.js +120 -0
- package/dist/cli/help.js +67 -1
- package/dist/cli/hook-ingress.js +27 -3
- package/dist/cli/memory-flow-admission.js +9 -3
- package/dist/cli/memory-init-invocation.js +10 -3
- package/dist/cli/memory-init.js +77 -68
- package/dist/cli/memory-storage-admission.js +3 -2
- package/dist/cli/memory-storage-qualification.js +105 -0
- package/dist/cli/memory-storage-transition.js +123 -0
- package/dist/cli/memory-upgrade.js +189 -0
- package/dist/cli/native-hook-ingress.js +14 -4
- package/dist/cli/native-hook-preparation.js +55 -0
- package/dist/cli/response-file.js +2 -1
- package/dist/cli/run-cli.js +79 -40
- package/dist/cli/setup.js +2 -1
- package/dist/cli.js +18 -0
- package/dist/domain/diagnostic-aspects.js +103 -0
- package/dist/domain/diagnostic-flows.js +8 -0
- package/dist/domain/stage-handler-identities.js +8 -0
- package/dist/harness-runtime/bin/dd-agy.mjs +3 -3
- package/dist/harness-runtime/bin/dd-grok.mjs +3 -3
- package/dist/harness-runtime/bin/dd-zcode.mjs +5 -5
- package/dist/harness-runtime/lib/agy-error-boundary.mjs +58 -0
- package/dist/harness-runtime/lib/agy-native-inspection.mjs +216 -0
- package/dist/harness-runtime/lib/agy-native_pb.js +117 -0
- package/dist/harness-runtime/lib/daemon-operations.d.mts +1 -0
- package/dist/harness-runtime/lib/daemon-operations.mjs +84 -10
- package/dist/harness-runtime/lib/dd-agy-daemon.mjs +366 -52
- package/dist/harness-runtime/lib/dd-agy.mjs +17 -3
- package/dist/harness-runtime/lib/dd-codex-daemon.mjs +27 -13
- package/dist/harness-runtime/lib/dd-codex.mjs +4 -0
- package/dist/harness-runtime/lib/dd-droid-daemon.mjs +4 -3
- package/dist/harness-runtime/lib/dd-droid.mjs +71 -29
- package/dist/harness-runtime/lib/dd-grok-daemon.mjs +73 -16
- package/dist/harness-runtime/lib/dd-grok.mjs +6 -3
- package/dist/harness-runtime/lib/dd-opencode-daemon.mjs +66 -20
- package/dist/harness-runtime/lib/dd-opencode.mjs +30 -3
- package/dist/harness-runtime/lib/dd-zcode-daemon.mjs +7 -6
- package/dist/harness-runtime/lib/dd-zcode.mjs +44 -14
- package/dist/harness-runtime/lib/delegation-instructions.mjs +1 -1
- package/dist/harness-runtime/lib/driver-recovery.mjs +9 -8
- package/dist/harness-runtime/lib/entity-references.d.mts +2 -0
- package/dist/harness-runtime/lib/entity-references.mjs +9 -0
- package/dist/harness-runtime/lib/managed-daemon.d.mts +1 -1
- package/dist/harness-runtime/lib/managed-daemon.mjs +24 -9
- package/dist/harness-runtime/lib/native-children.d.mts +8 -1
- package/dist/harness-runtime/lib/native-children.mjs +114 -8
- package/dist/harness-runtime/lib/native-hook-command.mjs +4 -4
- package/dist/harness-runtime/lib/native-request-proof.mjs +1 -1
- package/dist/harness-runtime/lib/observation-clock.d.mts +2 -2
- package/dist/harness-runtime/lib/observation-clock.mjs +7 -4
- package/dist/harness-runtime/lib/opencode-plugin.mjs +3 -3
- package/dist/harness-runtime/lib/operation-errors.mjs +1 -1
- package/dist/harness-runtime/lib/provider-overload-policy.d.mts +5 -3
- package/dist/harness-runtime/lib/provider-overload-policy.mjs +20 -7
- package/dist/harness-runtime/lib/runner-events.mjs +3 -1
- package/dist/harness-runtime/lib/setup-progress.mjs +8 -6
- package/dist/harness-runtime/lib/tool-observations.mjs +1 -1
- package/dist/schemas/diagnostic-stage-result.schema.json +354 -0
- package/dist/schemas/diagnostic-work-result.schema.json +296 -0
- package/dist/schemas/execution-bundle.schema.json +7 -1
- package/dist/schemas/mb-upgrade-stage-result.schema.json +863 -0
- package/dist/schemas/memory-repair-work-result.schema.json +9 -2
- package/dist/schemas/project-flow-pack-manifest.schema.json +1 -1
- package/dist/schemas/release-impact.schema.json +3 -3
- package/dist/schemas/stage-start-response.schema.json +4 -0
- package/dist/services/accepted-intent.js +13 -1
- package/dist/services/canon.js +43 -7
- package/dist/services/check-environment.js +21 -0
- package/dist/services/check-runner-evidence.js +267 -15
- package/dist/services/cli-operation-classifier.js +1 -1
- package/dist/services/cli-upgrade-allowlist.js +1 -1
- package/dist/services/code-checks.js +34 -19
- package/dist/services/compatibility-preflight.js +5 -2
- package/dist/services/controller-execution.js +10 -4
- package/dist/services/controller-fanout.js +34 -10
- package/dist/services/controller-memory-task.js +45 -0
- package/dist/services/controller-memory-worker.js +49 -0
- package/dist/services/dashboard.js +2 -2
- package/dist/services/descriptor-run-settlement.js +5 -3
- package/dist/services/descriptor-run-start.js +46 -20
- package/dist/services/descriptor-stage-coordinator.js +66 -13
- package/dist/services/descriptor-stage-settlement.js +2 -1
- package/dist/services/descriptor-stage-start.js +40 -4
- package/dist/services/diagnostic-evidence.js +73 -0
- package/dist/services/diagnostic-report-publication.js +72 -0
- package/dist/services/diagnostic-report.js +67 -0
- package/dist/services/diagnostic-run-bundle.js +74 -0
- package/dist/services/diagnostic-snapshot.js +159 -0
- package/dist/services/diagnostic-stage-handlers.js +108 -0
- package/dist/services/diagnostic-stage-results.js +132 -0
- package/dist/services/diagnostic-start.js +84 -0
- package/dist/services/diagnostic-work-batch.js +34 -0
- package/dist/services/diagnostic-work-collection.js +97 -0
- package/dist/services/diagnostic-work-registration.js +101 -0
- package/dist/services/diagnostic-work-results.js +93 -0
- package/dist/services/engines.js +64 -14
- package/dist/services/eval-snapshots.js +186 -119
- package/dist/services/execution-bundles.js +19 -7
- package/dist/services/external-work-launch.js +5 -3
- package/dist/services/flow-catalog.js +13 -4
- package/dist/services/frozen-engine.js +148 -11
- package/dist/services/hook-memory-routing.js +188 -0
- package/dist/services/hook-recovery-guard.js +14 -0
- package/dist/services/hook-session-observation.js +24 -0
- package/dist/services/hooks.js +27 -8
- package/dist/services/hybrid-contracts.js +4 -13
- package/dist/services/hybrid-digest.js +14 -0
- package/dist/services/installed-flow-source.js +47 -4
- package/dist/services/lifecycle-invocations.js +179 -38
- package/dist/services/memory-accepted-composition.js +5 -4
- package/dist/services/memory-completed-correction-wave.js +23 -15
- package/dist/services/memory-compose-handler.js +163 -21
- package/dist/services/memory-composition-acceptance.js +186 -10
- package/dist/services/memory-composition-graph.js +42 -11
- package/dist/services/memory-composition-registration.js +23 -8
- package/dist/services/memory-composition-work-custody.js +14 -9
- package/dist/services/memory-composition-work-results.js +15 -3
- package/dist/services/memory-corrected-review-batch.js +10 -3
- package/dist/services/memory-corrected-review-findings.js +4 -2
- package/dist/services/memory-corrected-review-inputs.js +10 -5
- package/dist/services/memory-corrected-review-receipt.js +17 -9
- package/dist/services/memory-corrected-review-registration.js +3 -2
- package/dist/services/memory-correction-check-receipt.js +20 -4
- package/dist/services/memory-custody-snapshot.js +36 -0
- package/dist/services/memory-finish-evidence.js +44 -22
- package/dist/services/memory-finish-handler.js +37 -23
- package/dist/services/memory-finish-integration.js +218 -48
- package/dist/services/memory-finish-readiness.js +66 -19
- package/dist/services/memory-git-integration.js +87 -18
- package/dist/services/memory-historical-corrected-review.js +21 -15
- package/dist/services/memory-historical-original-review.js +22 -9
- package/dist/services/memory-historical-repair-registration.js +14 -8
- package/dist/services/memory-historical-second-review.js +30 -11
- package/dist/services/memory-init-contexts.js +44 -2
- package/dist/services/memory-init-controller-start.js +27 -8
- package/dist/services/memory-init-git-policy.js +50 -21
- package/dist/services/memory-init-lint-capability.js +24 -6
- package/dist/services/memory-init-native-capacity.js +17 -4
- package/dist/services/memory-init-preflight.js +21 -17
- package/dist/services/memory-init-request-candidate.js +73 -17
- package/dist/services/memory-init-request-input.js +23 -7
- package/dist/services/memory-init-run-bundle.js +49 -12
- package/dist/services/memory-init-storage.js +17 -7
- package/dist/services/memory-init-worktrunk-capability.js +3 -7
- package/dist/services/memory-layer.js +71 -6
- package/dist/services/memory-lint-config.js +111 -2
- package/dist/services/memory-native-review-copy.js +5 -67
- package/dist/services/memory-normal-flow-entry.js +12 -0
- package/dist/services/memory-ordinary-defaults.js +22 -5
- package/dist/services/memory-preflight-handler.js +15 -0
- package/dist/services/memory-repair-current-view.js +1 -1
- package/dist/services/memory-repair-document-delta.js +70 -33
- package/dist/services/memory-repair-history.js +12 -7
- package/dist/services/memory-repair-physical-binding.js +1 -119
- package/dist/services/memory-repair-publication-plan.js +5 -3
- package/dist/services/memory-repair-publication-source.js +1 -1
- package/dist/services/memory-repair-publication.js +3 -2
- package/dist/services/memory-repair-registration.js +2 -1
- package/dist/services/memory-repair-work-baseline.js +4 -2
- package/dist/services/memory-repair-work-completion.js +32 -12
- package/dist/services/memory-repair-work-results.js +21 -2
- package/dist/services/memory-repair-workspace.js +11 -2
- package/dist/services/memory-repair-writer-copy.js +2 -1
- package/dist/services/memory-result-binding.js +78 -12
- package/dist/services/memory-retained-review-authority.js +17 -8
- package/dist/services/memory-retained-second-baseline.js +1 -1
- package/dist/services/memory-retained-second-repairs.js +12 -6
- package/dist/services/memory-review-correction-plan.js +47 -12
- package/dist/services/memory-review-handler.js +17 -17
- package/dist/services/memory-review-inputs.js +55 -9
- package/dist/services/memory-review-limits.js +10 -0
- package/dist/services/memory-review-receipt.js +2 -2
- package/dist/services/memory-review-registration.js +13 -4
- package/dist/services/memory-review-work-custody.js +3 -1
- package/dist/services/memory-review-work-input.js +26 -7
- package/dist/services/memory-review-work-results.js +26 -4
- package/dist/services/memory-second-corrected-review-inputs.js +5 -3
- package/dist/services/memory-second-correction-plan.js +2 -1
- package/dist/services/memory-second-repair-launch.js +4 -4
- package/dist/services/memory-second-repair-source.js +1 -1
- package/dist/services/memory-stage-dispatch.js +38 -1
- package/dist/services/memory-stage-results.js +113 -22
- package/dist/services/memory-tool-probe.js +25 -0
- package/dist/services/memory-upgrade-analysis-handler.js +243 -0
- package/dist/services/memory-upgrade-bootstrap-readiness.js +251 -0
- package/dist/services/memory-upgrade-evidence.js +100 -0
- package/dist/services/memory-upgrade-inventory.js +442 -0
- package/dist/services/memory-upgrade-publication-custody.js +73 -0
- package/dist/services/memory-upgrade-publication.js +413 -0
- package/dist/services/memory-upgrade-selection.js +430 -0
- package/dist/services/memory-upgrade-start.js +60 -0
- package/dist/services/memory-upgrade-storage-readiness.js +340 -0
- package/dist/services/memory-verification-acceptance.js +38 -17
- package/dist/services/memory-verification-checks.js +92 -27
- package/dist/services/memory-verification-receipt.js +6 -5
- package/dist/services/memory-verify-handler.js +15 -13
- package/dist/services/memory-work-result-json.js +12 -0
- package/dist/services/memory-work-result-preparation.js +5 -4
- package/dist/services/merge-server.js +4 -2
- package/dist/services/migrations.js +127 -98
- package/dist/services/native-daemon-history.js +2 -1
- package/dist/services/physical-startup.js +45 -0
- package/dist/services/project-registry.js +97 -0
- package/dist/services/project-summary.js +1 -1
- package/dist/services/projects.js +3 -93
- package/dist/services/prompt-delivery.js +71 -0
- package/dist/services/provider-capacity.js +112 -46
- package/dist/services/recovery-snapshot-database.js +32 -4
- package/dist/services/release-cache.js +8 -0
- package/dist/services/repair-intents.js +1 -12
- package/dist/services/repair-receipt.js +13 -0
- package/dist/services/run-control-worker.js +35 -18
- package/dist/services/run-control.js +2 -1
- package/dist/services/run-controller-adapter.js +2 -1
- package/dist/services/run-controller-process.js +4 -7
- package/dist/services/run-controller-recovery.js +8 -2
- package/dist/services/run-controller.js +215 -94
- package/dist/services/run-fork.js +1 -1
- package/dist/services/run-recovery-guard.js +30 -0
- package/dist/services/run-recovery.js +11 -44
- package/dist/services/run-start-custody.js +17 -5
- package/dist/services/runs.js +6 -1
- package/dist/services/runtime-scope-resume.js +12 -6
- package/dist/services/runtime-scope-stop.js +3 -2
- package/dist/services/runtime-scope-worker.js +46 -19
- package/dist/services/runtime-service.js +2 -1
- package/dist/services/sessions.js +3 -24
- package/dist/services/setup.js +63 -13
- package/dist/services/stage-handlers.js +22 -7
- package/dist/services/stage-pause.js +111 -44
- package/dist/services/version-status.js +1 -1
- package/dist/services/vnext-code.js +2 -2
- package/dist/services/vnext-fanout.js +51 -9
- package/dist/services/vnext-plan-review.js +3 -5
- package/dist/services/work-registry.js +117 -39
- package/dist/services/workspace-bootstrap.js +2 -1
- package/dist/services/workspace-files.js +1 -1
- package/dist/shared/entity-references.js +1 -8
- package/dist/storage/data-preservation.js +65 -0
- package/dist/storage/database.js +53 -19
- package/dist/storage/import-guard.js +84 -27
- package/dist/storage/memory-upgrade-schema-bootstrap.js +38 -0
- package/dist/storage/paired-writer-migration.js +424 -0
- package/dist/storage/writer-contract.js +11 -4
- package/dist/storage/writer-migration.js +313 -52
- package/dist/storage/writer-restore.js +217 -0
- package/package.json +13 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,135 @@
|
|
|
1
1
|
# @deksden-com/dd-flow-cli
|
|
2
2
|
|
|
3
|
+
## 0.9.0-beta.149
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 54899ed: Publish explicit proven Codex and OpenCode shutdown activity, reject unknown activity as clean settlement, and decode OpenCode finite log synchronization markers consistently for revision and completion.
|
|
8
|
+
|
|
9
|
+
## 0.9.0-beta.148
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Validate lifecycle issuance before accessing storage, and align native readiness,
|
|
14
|
+
shutdown and overload regression fixtures with the current execution contract.
|
|
15
|
+
|
|
16
|
+
## 0.9.0-beta.147
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- Use the shared setup startup budget for silent prerequisite probes and preserve
|
|
21
|
+
typed subprocess failure diagnostics for init and upgrade without leaking output.
|
|
22
|
+
|
|
23
|
+
## 0.9.0-beta.146
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- d031e09: Add owned, trajectory-bound read-only AGY node-state inspection for native qualification. Capture parent executor idle independently from required-tree readiness, native task inventories and pending completion messages. Preserve qualified production prompt/stop ordering and owned fixture cleanup in native acceptance tooling.
|
|
28
|
+
- acee374: Dispatch independent architectural criticism for Memory Bank audits when their accepted architecture aspect is applicable, matching the frozen review instructions.
|
|
29
|
+
- 709f281: Reject diagnostic citation hash mismatches as correctable no-effect proposal errors, returning only the assigned relative path and computed digest. Retain bounded lifecycle correction, strict evidence acceptance and fatal snapshot/custody protection.
|
|
30
|
+
- 18b0593: Treat unchanged-scope coverage annotations as correctable proposal errors and assign global diagnostic finding IDs from exact completed Work results during analysis settlement. Preserve strict scope, content, source and independent-review custody checks.
|
|
31
|
+
- 7457963: Reject rewritten diagnostic focus as a bounded, no-effect proposal correction
|
|
32
|
+
requiring an exact copy of the accepted predecessor. Foreign focus modes,
|
|
33
|
+
changed aspect applicability and ownership violations remain fatal; no changed
|
|
34
|
+
focus is accepted and no frozen source selection is rewritten.
|
|
35
|
+
- 1b315bf: Issue the exact immediate predecessor in diagnostic coordinator bindings and
|
|
36
|
+
align the frozen schema's list bound with the runtime contract. Transitive
|
|
37
|
+
history is a correctable proposal shape error; foreign direct bindings still
|
|
38
|
+
fail without acceptance.
|
|
39
|
+
- da5bbf0: Allow diagnostics to record newly discovered unavailable sources without treating
|
|
40
|
+
them as a scope change. Retain accepted source-gap observations independently of
|
|
41
|
+
coordinator paraphrasing, while keeping focus, coverage and source-custody guards.
|
|
42
|
+
- 6825b76: Allow diagnostic reports to disclose additional limitations while retaining all reviewed evidence, decisions and existing uncertainty unchanged.
|
|
43
|
+
- e779d4d: Express diagnostic analyst/critic field restrictions in the frozen Work schema.
|
|
44
|
+
An analyst supplying review decisions remains rejected, but uses the existing
|
|
45
|
+
correctable schema-output path rather than a fatal foreign-aspect error.
|
|
46
|
+
- 9939c87: Carry accepted predecessor and independently settled Work limitations into diagnostic analytical and review results in the CLI. Preserve coordinator annotations and raw proposals; retain schema bounds, scope, evidence and independent-review checks.
|
|
47
|
+
- b765022: Clarify that generated review observations are not original project evidence.
|
|
48
|
+
Reject missing snapshot citations as correctable no-effect result errors while
|
|
49
|
+
preserving fatal containment, non-file and filesystem-access failures.
|
|
50
|
+
- 249e5e3: Express preflight and analytical coordinator output boundaries in the frozen
|
|
51
|
+
stage schema, so unsupported findings or review decisions use existing format
|
|
52
|
+
correction while independent review remains mandatory.
|
|
53
|
+
- 6f4011f: Separate required native execution readiness from owned resource retirement across harnesses. Require versioned, incarnation-bound shutdown phase proofs and retain process birth identities before provider shutdown. Qualify AGY daemon readiness independently from physical cleanup; ambiguous ancestry and native service identities remain unproven.
|
|
54
|
+
|
|
55
|
+
Fence retained recovery by the current control generation and preserve late activity during shutdown publication. Add metadata-bound AGY native tree control for typed services, gated by complete native qualification; control acknowledgements never substitute for physical retirement.
|
|
56
|
+
|
|
57
|
+
- a5461c9: Preserve validated repair authority through lifecycle settlement, atomically issue
|
|
58
|
+
nonterminal successors, and retain accepted HITL context across same-session
|
|
59
|
+
overload continuation. Support versioned bounded runner and browser evidence,
|
|
60
|
+
and separate AGY physical shutdown from current native idle proof.
|
|
61
|
+
- e00cda9: Use the verified relocated engine when launching a forked hybrid RUN. Preserve
|
|
62
|
+
the original bundle and manifest bytes as provenance; reject changed executable
|
|
63
|
+
content, semantic manifest metadata, or an unbound relocation path.
|
|
64
|
+
- 759138b: Start restored generic-flow coordinator sessions in the current admitted RUN
|
|
65
|
+
workspace instead of the historical frozen execution path, without changing
|
|
66
|
+
retained execution bytes or profiles.
|
|
67
|
+
- 5bea245: Use the verified current RUN project and workspace paths when settling restored
|
|
68
|
+
descriptor stages and terminal RUNs. Preserve frozen provenance, ownership,
|
|
69
|
+
Git-drift checks and exact replay rather than querying historical project roots.
|
|
70
|
+
- 42cb47b: Read retained descriptor stage-input custody through trusted RUN publication
|
|
71
|
+
relocations after restore, preserving original packet bytes and rejecting
|
|
72
|
+
ambiguous or changed custody.
|
|
73
|
+
|
|
74
|
+
## 0.9.0-beta.145
|
|
75
|
+
|
|
76
|
+
### Patch Changes
|
|
77
|
+
|
|
78
|
+
- Normalize Git diagnostics for gitless workspace inventories without masking damaged repositories; keep integration fixture tools on an explicitly selected PATH and scope simulated journal stalls to failure persistence.
|
|
79
|
+
|
|
80
|
+
- Select Gemini's encoded reasoning level without an unsupported AGY `--effort` override; reject conflicting requested levels before native launch, while retaining explicit effort for other model families.
|
|
81
|
+
|
|
82
|
+
- Preserve the effective environment across pinned engine dispatch. Isolate package-consumer routing and own executable test discovery; reduce duplicate gate preparation without removing release guarantees.
|
|
83
|
+
|
|
84
|
+
- ea4e88e: Add hybrid mb-upgrade with retained current/target selection, scoped migration
|
|
85
|
+
bootstrap, preserved old-bank evidence, independent Work review and marker-free
|
|
86
|
+
ordinary flow readiness. Keep existing RUN engine bindings and reconcile partial
|
|
87
|
+
startup and publication through their original requests.
|
|
88
|
+
|
|
89
|
+
Retain bounded Codex admission phase diagnostics and separate native-host startup
|
|
90
|
+
headroom from the shared admission deadline. Refuse writer migration while a
|
|
91
|
+
MERGE request remains unresolved, including same-session integration without a
|
|
92
|
+
live process; terminal historical requests do not block migration.
|
|
93
|
+
|
|
94
|
+
Preserve project lint exclusions while independently checking affected active
|
|
95
|
+
Markdown through a separate mb-lint configuration when needed (`--config`
|
|
96
|
+
support required). Retain both reports and the effective configuration as check
|
|
97
|
+
evidence. Allow malformed terminal proposal JSON to be corrected through the
|
|
98
|
+
existing no-effect lifecycle successor without repeating Git integration.
|
|
99
|
+
Align generated FINISH guidance with the minimal proposal and CLI-owned sealed
|
|
100
|
+
coverage, findings and evidence for both initialization and upgrade.
|
|
101
|
+
Keep exact source-canon spec/protocol provenance relations distinct from
|
|
102
|
+
consumer-owned link targets when checking customized guidance. Derive scoped
|
|
103
|
+
exceptions from retained target bytes; new project/body links and Git-aware
|
|
104
|
+
ignored-target checks remain active, and project configuration stays unchanged.
|
|
105
|
+
Reject malformed bounded JSON at the shared Memory finish ingress as a
|
|
106
|
+
correctable proposal before stage-specific projections can misclassify it as
|
|
107
|
+
retained-custody corruption. Reuse the existing issued lifecycle successor;
|
|
108
|
+
empty/oversized input, unknown stages and downstream identity/effect checks
|
|
109
|
+
remain strict. Never repair proposal bytes or rerun settled work implicitly.
|
|
110
|
+
|
|
111
|
+
Keep the native hook's per-call deadline out of project-check input identity so
|
|
112
|
+
VERIFY can accept unchanged passed checks across ordinary CLI and hook calls.
|
|
113
|
+
Continue to invalidate evidence when application environment, files, policy or
|
|
114
|
+
physical receipts change.
|
|
115
|
+
|
|
116
|
+
Check retained process birth after a permission-denied existence probe, so a
|
|
117
|
+
reused macOS system PID cannot keep an already closed agent scope unresolved.
|
|
118
|
+
Unknown identity remains conservative and foreign processes are never signaled.
|
|
119
|
+
|
|
120
|
+
Validate a current completed correction wave as one synchronous SQL snapshot,
|
|
121
|
+
sharing private successful proofs across its registration and settled histories.
|
|
122
|
+
Fresh traversals, failures, allocation fences and physical file checks remain
|
|
123
|
+
independent; no proof is reused across commands or asynchronous boundaries.
|
|
124
|
+
|
|
125
|
+
- 481702b: Keep native hook admission within its qualified shared deadline without loading execution/recovery graphs. Retain matched late native terminal outcomes before shutdown, support AGY ordered stream request evidence and recovered lifecycle boundaries, and publish exact current instruction packets as readable Markdown without replaying committed lifecycle operations.
|
|
126
|
+
|
|
127
|
+
Distinguish repeated real checksum scans from duplicate progress notifications. Retry only effect-free physical self-start observations within the existing owner-bound startup horizon, without relaunching processes or renewing unconfirmed leases.
|
|
128
|
+
|
|
129
|
+
Allow an initially bound maintenance cancellation signal to drain its owned heartbeat transport during daemon shutdown.
|
|
130
|
+
|
|
131
|
+
Retain startup failures only for the exact physical owner, preventing duplicate workers from overwriting or cleaning up a winner. Keep setup progress distinct across owned CLI producers without admitting stale or duplicate notifications.
|
|
132
|
+
|
|
3
133
|
## 0.9.0-beta.144
|
|
4
134
|
|
|
5
135
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -161,6 +161,8 @@ dd-flow canon status --json
|
|
|
161
161
|
|
|
162
162
|
`canon resolve` checks explicit `--root`, then `DD_MEMORYBANK`, then the globally registered value in `DD_FLOW_HOME`, then known nearby `dd-memorybank` checkouts from the current working directory. If two different valid canonical roots are discovered, it fails closed with structured blockers and bootstrap hints. Use `DD_MEMORYBANK` for the local canonical `dd-memorybank` checkout.
|
|
163
163
|
|
|
164
|
+
With no explicit, environment or registered source, the release installed by `setup` in `DD_FLOW_HOME` takes precedence over nearby checkouts. Archive provenance comes from its retained release manifest. A degraded installation does not silently fall back to a local checkout. Discovery remains read-only and does not open SQLite before runtime context admission.
|
|
165
|
+
|
|
164
166
|
Register a project:
|
|
165
167
|
|
|
166
168
|
```bash
|
|
@@ -508,22 +510,25 @@ remain invalid and receive a standalone retry.
|
|
|
508
510
|
|
|
509
511
|
## Verification
|
|
510
512
|
|
|
511
|
-
|
|
513
|
+
For a code merge, start with the cheap common contracts, then select affected
|
|
514
|
+
storage/process/flow checks explicitly and record the selection reason:
|
|
512
515
|
|
|
513
516
|
```bash
|
|
514
|
-
pnpm
|
|
515
|
-
pnpm lint
|
|
516
|
-
pnpm build
|
|
517
|
-
pnpm test
|
|
517
|
+
pnpm gate:merge
|
|
518
518
|
```
|
|
519
519
|
|
|
520
|
-
|
|
521
|
-
|
|
520
|
+
For release acceptance, freeze source/canon, build once, then use
|
|
521
|
+
`DD_FLOW_GATE_REPORT_ROOT=/absolute/external/report pnpm gate:release`.
|
|
522
|
+
Node family selection lives in `package.json`, Vitest membership in
|
|
523
|
+
`vitest.config.ts`, and required release receipts in `scripts/release-candidate.mjs`.
|
|
524
|
+
The local and CI profiles cover the same required guarantees; qualification-only
|
|
525
|
+
cases report their prerequisites/skips separately. Tests invoking compiled CLI
|
|
526
|
+
must use the current frozen build, even for a partial merge check.
|
|
522
527
|
For development use `pnpm test:fast`, `pnpm test:core` or `pnpm test:flow` plus
|
|
523
528
|
the affected native contracts; these subsets are not full acceptance.
|
|
524
529
|
New files default to serial core execution. A forced serial fallback is
|
|
525
530
|
`pnpm test:integration --no-file-parallelism --maxWorkers=1`.
|
|
526
|
-
The [test-suite verification runbook](https://github.com/deksden-com/dd-eval/blob/
|
|
531
|
+
The [test-suite verification runbook](https://github.com/deksden-com/dd-eval/blob/main/runbooks/flow-test-suite-verification.md)
|
|
527
532
|
owns group qualification, complete reports and cross-repository commands.
|
|
528
533
|
|
|
529
534
|
Manual smoke checks should use a temporary `DD_FLOW_HOME` when they do not intentionally inspect the operator's real local state.
|
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.149",
|
|
4
|
+
"cli_commit": "7d17167f768483ffdb5d37f64cc385035c7d4658",
|
|
5
|
+
"built_at": "2026-10-24T10:44:58.080Z",
|
|
6
6
|
"built_with_canon": {
|
|
7
7
|
"version": "4.1.2",
|
|
8
|
-
"commit": "
|
|
8
|
+
"commit": "925ef10ecc0b683f7feba6f74913e15560842500",
|
|
9
9
|
"flow_contract": "dd-flow-canonical-2026-08",
|
|
10
|
-
"repo_root": "/Users/deksden/Documents/_Projects/_worktrees/dd-canon-
|
|
11
|
-
"memorybank_root": "/Users/deksden/Documents/_Projects/_worktrees/dd-canon-
|
|
12
|
-
"flow_root": "/Users/deksden/Documents/_Projects/_worktrees/dd-canon-
|
|
10
|
+
"repo_root": "/Users/deksden/Documents/_Projects/_worktrees/dd-canon-release146",
|
|
11
|
+
"memorybank_root": "/Users/deksden/Documents/_Projects/_worktrees/dd-canon-release146/.memory-bank",
|
|
12
|
+
"flow_root": "/Users/deksden/Documents/_Projects/_worktrees/dd-canon-release146/.memory-bank/dd-flow",
|
|
13
13
|
"layout": "dot_memory_bank"
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -15,7 +15,8 @@ const control = "project-root run";
|
|
|
15
15
|
const protocolTransitionInput = route(1, "to", `${scoped} payload-file json-file reason`, "force");
|
|
16
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
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
|
-
|
|
18
|
+
const diagnosticInput = route(0, "project-root request-id", "intake-file profile profile-file stage-profile work-profile max-parallel", "detach non-interactive prepare-only", "stage-profile work-profile");
|
|
19
|
+
export const commandAliases = { transition: "protocol transition", init: "flow mb-init", upgrade: "flow mb-upgrade", review: "flow project-review" };
|
|
19
20
|
/** Path-shaped arguments default to physical paths unless the route explicitly
|
|
20
21
|
* opts into contextualPaths. This inventory does not expand arbitrary strings. */
|
|
21
22
|
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"));
|
|
@@ -33,8 +34,15 @@ export const commandInputs = {
|
|
|
33
34
|
"flow show": route(1),
|
|
34
35
|
"flow mb-init": memoryInitInput,
|
|
35
36
|
"init": memoryInitInput,
|
|
36
|
-
"
|
|
37
|
-
"
|
|
37
|
+
"flow mb-upgrade": memoryInitInput,
|
|
38
|
+
"upgrade": memoryInitInput,
|
|
39
|
+
"flow mb-audit": diagnosticInput,
|
|
40
|
+
"flow project-review": diagnosticInput,
|
|
41
|
+
"review": diagnosticInput,
|
|
42
|
+
"runtime storage admit": route(0, "operation", "", "", "", { operation: ["memory-init", "memory-upgrade"] }),
|
|
43
|
+
"runtime storage qualify": route(0, "operation", "", "", "", { operation: ["memory-upgrade"] }),
|
|
44
|
+
"runtime storage transition": route(0, "action project-root workspace-root request-id selection-sha256", "expected-sha256 recovery-id", "offline", "", { action: ["plan", "apply", "status", "recovery-plan", "recover", "recovery-status"] }),
|
|
45
|
+
"runtime flow admit": route(0, "operation", "", "", "", { operation: ["memory-init", "memory-upgrade", "mb-audit", "project-review"] }),
|
|
38
46
|
"completion bash": route(0),
|
|
39
47
|
"completion zsh": route(0),
|
|
40
48
|
"completion fish": route(0),
|
|
@@ -218,6 +226,7 @@ export const commandInputs = {
|
|
|
218
226
|
"canon status": route(0, "", "root"),
|
|
219
227
|
"canon resolve": route(0, "", "root"),
|
|
220
228
|
"migration impact": route(0, project, "target-version mode"),
|
|
229
|
+
"migration readiness": route(0, `${project} workspace-root request-id`),
|
|
221
230
|
"migration plan": route(0, project, "source-version target-version run backup-path backup-created-at"),
|
|
222
231
|
"migration report": route(0, project, "source-version target-version run backup-path backup-created-at"),
|
|
223
232
|
"migration verify": route(0, "file"),
|
|
@@ -265,6 +274,7 @@ export const commandInputs = {
|
|
|
265
274
|
"schema validate": { ...route(0, "schema file", "schema-dir project-root run"), contextualPaths: words("project-root file") },
|
|
266
275
|
"memory permissions preflight": route(0, "root memory-bank flow mode", "tasks"),
|
|
267
276
|
"memory compose register": route(0, "project-root run request-key result-file"),
|
|
277
|
+
"memory upgrade publish": route(0, "project-root run"),
|
|
268
278
|
"memory verify checks": route(0, "project-root run"),
|
|
269
279
|
"memory review register": route(0, "project-root run"),
|
|
270
280
|
"memory review collect": route(0, "project-root run"),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { commandInputs, physicalPathOptions } from "./command-inputs.js";
|
|
1
|
+
import { commandInputs, commandAliases, physicalPathOptions } from "./command-inputs.js";
|
|
2
2
|
import { runtimeOptionDescriptions } from "./command-option-descriptions.js";
|
|
3
3
|
const optionDescriptions = {
|
|
4
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.",
|
|
@@ -61,10 +61,27 @@ const memoryInitOptions = {
|
|
|
61
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
62
|
};
|
|
63
63
|
const commandOptionDescriptions = {
|
|
64
|
+
"flow mb-audit": {
|
|
65
|
+
"project-root": "Canonical absolute project identity. The runtime creates an isolated read-only source snapshot; neither the project nor its Memory Bank is a write destination.",
|
|
66
|
+
"intake-file": "Bounded UTF-8 original diagnostic request, including audit mode/focus and constraints. Required for a fresh request; optional on exact replay, where supplied bytes must match.",
|
|
67
|
+
"stage-profile": "Repeatable preflight/audit/review/report=profile override. Each stage may occur once and all profiles are frozen before dispatch.",
|
|
68
|
+
"prepare-only": "Retain the request, source snapshot and RUN without starting its controller or provider Sessions. Runtime state is created; this is not a dry run.",
|
|
69
|
+
"max-parallel": "External Work concurrency from 1 to 64; default 1. Never claims native child qualification."
|
|
70
|
+
},
|
|
71
|
+
"flow project-review": {
|
|
72
|
+
"project-root": "Canonical absolute project identity, assessed through an isolated read-only snapshot. Findings never authorize implicit repair.",
|
|
73
|
+
"intake-file": "Bounded UTF-8 original project-conformance review request and focus. Required fresh; supplied replay bytes must match the retained objective.",
|
|
74
|
+
"stage-profile": "Repeatable preflight/analyze/review/report=profile override. This is project review, not the SDLC CODE-REVIEW stage.",
|
|
75
|
+
"prepare-only": "Retain the request, source snapshot and RUN without launching a controller or provider Sessions. Not a dry run.",
|
|
76
|
+
"max-parallel": "External Work concurrency from 1 to 64; default 1."
|
|
77
|
+
},
|
|
64
78
|
"flow mb-init": memoryInitOptions,
|
|
65
79
|
init: memoryInitOptions,
|
|
66
|
-
"
|
|
67
|
-
|
|
80
|
+
"flow mb-upgrade": { ...memoryInitOptions, "stage-profile": "Repeatable stage=profile assignment for preflight, diff-analysis, upgrade, verify, review or finish. The original selection is frozen before dispatch.", "prepare-only": "Prepare or replay the upgrade RUN and accepted storage/bootstrap selection without launching its controller or a productive Session. This is not a dry run; it does not publish the upgraded canonical layer or accept semantic preservation." },
|
|
81
|
+
upgrade: { ...memoryInitOptions, "stage-profile": "Repeatable stage=profile assignment for preflight, diff-analysis, upgrade, verify, review or finish. The original selection is frozen before dispatch.", "prepare-only": "Prepare or replay the upgrade RUN and accepted storage/bootstrap selection without launching its controller or a productive Session. This is not a dry run; it does not publish the upgraded canonical layer or accept semantic preservation." },
|
|
82
|
+
"runtime storage admit": { operation: "Operation-specific writable-connection admission: memory-init or memory-upgrade. Upgrade also checks retained request storage. Requires explicit canonical DD_FLOW_HOME and an existing compatible resource registry. Never initializes, migrates, repairs or starts agents." },
|
|
83
|
+
"runtime storage qualify": { operation: "memory-upgrade only. Qualify the selected engine before a native probe. Incompatible drained stores are copied privately with committed WAL; the actual transition and operation admission run on those copies. Requires both explicit canonical Homes. Never migrates real stores, grants productive admission, creates a RUN or starts agents." },
|
|
84
|
+
"runtime flow admit": { operation: "Handler admission for memory-init or memory-upgrade in the executing engine. Reads bounded UTF-8 JSON stdin with source and source_sha256; memory-init additionally accepts startup_input_schema to require its startup reader. Validates the matching 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." },
|
|
68
85
|
"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." },
|
|
69
86
|
"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." },
|
|
70
87
|
"profiles alias": {
|
|
@@ -79,6 +96,11 @@ const commandOptionDescriptions = {
|
|
|
79
96
|
},
|
|
80
97
|
"schema validate": { file: "JSON document to validate against --schema in the selected schema directory. Validation does not execute a flow or accept semantic completion." },
|
|
81
98
|
"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." },
|
|
99
|
+
"migration readiness": {
|
|
100
|
+
"request-id": "Stable upgrade request ID. Retains a physically verified content-only storage proof; identical replay reuses it and changed inputs refuse. Does not create a RUN, sync content or migrate stores.",
|
|
101
|
+
"workspace-root": "Existing canonical absolute assigned workspace. Recorded with the project and request; this storage-only operation does not establish Git/workspace eligibility for the full upgrade.",
|
|
102
|
+
"project-root": "Registered active project requiring a complete release-impact chain and valid current provenance. Existing compatible run/resource stores are mandatory; this command never initializes or repairs them. Explicit mb-upgrade mode is required."
|
|
103
|
+
},
|
|
82
104
|
"migration apply": { file: "Explicit migration report JSON file used for admission to the requested apply operation; backup and ownership gates remain mandatory." },
|
|
83
105
|
"prompt render": { profile: "Prompt profile name required by the assigned Work execution context; not an operator executor profile ID or a Codex home profile." },
|
|
84
106
|
"runtime process register": { harness: "Harness family associated with the registered process/budget; registration is not a discovery or doctor probe.", "state-dir": "Adapter runtime state directory retained with the physical process for later ownership/admission checks." },
|
|
@@ -105,17 +127,28 @@ const commandOptionDescriptions = {
|
|
|
105
127
|
"run control resume": { from: "Exact retained pause/stop control ID whose captured state authorizes this resume request; not a snapshot path." },
|
|
106
128
|
"stage block": { kind: "Blocker category: engine, harness or environment; code and summary identify the actionable cause." },
|
|
107
129
|
"migration impact": { mode: "Optional full_migration request forces the strict full-migration assessment; otherwise impact evidence determines patch, targeted_minor or full_migration." },
|
|
130
|
+
"runtime storage transition": {
|
|
131
|
+
"selection-sha256": "Exact independently retained full upgrade selection; checked before any storage effect. Commands issued by the selected engine include this value.",
|
|
132
|
+
action: "Selected frozen engine transport: plan retains the pair; apply performs its explicit cutover; status observes it. recovery-plan selects and fences separate recovery; recover executes it; recovery-status observes recovery. No command starts a model or RUN.",
|
|
133
|
+
"expected-sha256": "Exact retained migration request SHA for apply/status/recovery-plan, or retained recovery request SHA for recover/recovery-status. Not a fresh selector or permission to replace a request.",
|
|
134
|
+
"recovery-id": "Explicit recovery identity (1..86 safe ASCII characters); required only for recovery-plan. Recovery aborts the original apply.",
|
|
135
|
+
offline: "Required for apply, recovery-plan and recover after all local/external writers are drained. The engine independently checks registered logical and physical owners; it never kills them.",
|
|
136
|
+
"project-root": "Original retained upgrade project identity. No project or database is initialized by this transport.",
|
|
137
|
+
"workspace-root": "Original assigned upgrade workspace; must match the frozen request.",
|
|
138
|
+
"request-id": "Original upgrade request identity; the engine and migration files come only from that request."
|
|
139
|
+
},
|
|
108
140
|
"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
|
|
110
|
-
"memory
|
|
111
|
-
"memory
|
|
112
|
-
"memory review
|
|
113
|
-
"memory
|
|
114
|
-
"memory finish
|
|
115
|
-
"memory
|
|
116
|
-
"memory corrections
|
|
117
|
-
"memory
|
|
118
|
-
"memory review selective-
|
|
141
|
+
"memory compose register": { "run": "Active mb-init or mb-upgrade RUN whose accepted discovery/diff-analysis 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." },
|
|
142
|
+
"memory upgrade publish": { run: "Active mb-upgrade authoring Stage with a registered blueprint and settled Work. Apply only its retained canonical publication plan and recovery archive; this does not accept the Stage or complete the RUN." },
|
|
143
|
+
"memory verify checks": { "run": "Active mb-init or mb-upgrade RUN. Execute only its independently selected declared verification checks." },
|
|
144
|
+
"memory review register": { "run": "Active mb-init or mb-upgrade RUN with accepted verification. Register initial independent reviewers; this does not launch providers." },
|
|
145
|
+
"memory review collect": { "run": "Active mb-init or mb-upgrade RUN. Collect genuine registered initial-wave results without accepting the Stage or granting correction authority." },
|
|
146
|
+
"memory finish evidence": { "run": "Active mb-init or mb-upgrade finish RUN. Publish independently prepared coverage, integration and readiness evidence; publication does not complete Stage or RUN." },
|
|
147
|
+
"memory finish integrate": { "run": "Active mb-init or mb-upgrade 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." },
|
|
148
|
+
"memory corrections register": { run: "Active mb-init or mb-upgrade 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." },
|
|
149
|
+
"memory corrections checks": { run: "Active mb-init or mb-upgrade 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." },
|
|
150
|
+
"memory review selective-register": { run: "Active mb-init or mb-upgrade 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." },
|
|
151
|
+
"memory review selective-collect": { run: "Active mb-init or mb-upgrade 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
152
|
"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
153
|
"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
154
|
"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." },
|
|
@@ -143,7 +176,8 @@ export function optionsForCommand(input, command) {
|
|
|
143
176
|
}));
|
|
144
177
|
}
|
|
145
178
|
function optionDescription(name, command) {
|
|
146
|
-
const description = (command ? commandOptionDescriptions[command]?.[name]
|
|
179
|
+
const description = (command ? commandOptionDescriptions[command]?.[name]
|
|
180
|
+
?? commandOptionDescriptions[commandAliases[command] ?? command]?.[name] : undefined) ?? optionDescriptions[name] ?? runtimeOptionDescriptions[name];
|
|
147
181
|
if (!description)
|
|
148
182
|
throw new Error(`Missing CLI option documentation: ${command ?? "inventory"} --${name}`);
|
|
149
183
|
return description;
|
|
@@ -162,8 +196,9 @@ export function optionsForCommandTree(command) {
|
|
|
162
196
|
/** One exact native routing classification shared by router and compatibility admission. */
|
|
163
197
|
export function routerNativeRoute(key) {
|
|
164
198
|
return key === "version" || key.startsWith("engine ") || key === "schema validate"
|
|
165
|
-
|| key === "flow list" || key === "flow show" || key === "flow mb-init" || key === "init"
|
|
166
|
-
|| key === "
|
|
199
|
+
|| key === "flow list" || key === "flow show" || key === "flow mb-init" || key === "init" || key === "flow mb-upgrade" || key === "upgrade"
|
|
200
|
+
|| key === "flow mb-audit" || key === "flow project-review" || key === "review"
|
|
201
|
+
|| key === "run reconcile" || key === "runtime storage admit" || key === "runtime storage qualify" || key === "runtime storage transition"
|
|
167
202
|
|| key === "runtime flow admit"
|
|
168
203
|
|| key.startsWith("profiles ") || key.startsWith("models ") || key.startsWith("harnesses ") || key.startsWith("completion ") || key === "setup" || key.startsWith("setup ")
|
|
169
204
|
|| key === "storage migrate-writer" || key === "codex hook handle"
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { AppError } from "../shared/errors.js";
|
|
3
|
+
import { diagnosticFlowStages } from "../domain/diagnostic-flows.js";
|
|
4
|
+
import { prepareCommandRoute } from "./command-inputs.js";
|
|
5
|
+
function refuse(message) { throw new AppError("usage", message, 2, { effect: "no_effect" }); }
|
|
6
|
+
/** Parser only: no files, operator settings, project mutation or runtime state. */
|
|
7
|
+
export function prepareDiagnosticInvocation(args) {
|
|
8
|
+
const route = prepareCommandRoute(args), options = route.parsed.options;
|
|
9
|
+
const flowId = route.key === "flow mb-audit" ? "mb-audit"
|
|
10
|
+
: ["review", "flow project-review"].includes(route.key) ? "project-review" : refuse("Use flow mb-audit or review / flow project-review");
|
|
11
|
+
const value = (key) => options.get(key)?.[0];
|
|
12
|
+
const projectRoot = value("project-root"), requestId = value("request-id");
|
|
13
|
+
if (!path.isAbsolute(projectRoot) || path.resolve(projectRoot) !== projectRoot
|
|
14
|
+
|| !/^[A-Za-z0-9][A-Za-z0-9_.-]{0,95}$/.test(requestId))
|
|
15
|
+
refuse("Use a canonical absolute project root and a bounded request ID");
|
|
16
|
+
if (value("profile") && value("profile-file"))
|
|
17
|
+
refuse("Use either --profile or --profile-file");
|
|
18
|
+
if (options.has("detach") && options.has("prepare-only"))
|
|
19
|
+
refuse("--detach and --prepare-only are exclusive");
|
|
20
|
+
const execution = {};
|
|
21
|
+
if (value("profile"))
|
|
22
|
+
execution.rootProfile = value("profile");
|
|
23
|
+
const stageProfiles = {};
|
|
24
|
+
for (const assignment of options.get("stage-profile") ?? []) {
|
|
25
|
+
const match = /^([^=]+)=([^=]+)$/.exec(assignment);
|
|
26
|
+
if (!match || !diagnosticFlowStages[flowId].includes(match[1]) || Object.hasOwn(stageProfiles, match[1]))
|
|
27
|
+
refuse("--stage-profile requires one known stage=profile assignment per stage");
|
|
28
|
+
stageProfiles[match[1]] = match[2];
|
|
29
|
+
}
|
|
30
|
+
if (Object.keys(stageProfiles).length)
|
|
31
|
+
execution.stageProfiles = stageProfiles;
|
|
32
|
+
const workProfiles = options.get("work-profile");
|
|
33
|
+
if (workProfiles) {
|
|
34
|
+
if (workProfiles.some(id => !id.trim()) || new Set(workProfiles).size !== workProfiles.length)
|
|
35
|
+
refuse("Work profiles must be nonempty and unique");
|
|
36
|
+
execution.workProfiles = [...workProfiles];
|
|
37
|
+
}
|
|
38
|
+
if (value("max-parallel") !== undefined) {
|
|
39
|
+
const raw = value("max-parallel"), n = Number(raw);
|
|
40
|
+
if (!/^[1-9][0-9]*$/.test(raw) || !Number.isSafeInteger(n) || n > 64)
|
|
41
|
+
refuse("--max-parallel must be an integer from 1 to 64");
|
|
42
|
+
execution.delegation = { mode: "external", max_parallel: n };
|
|
43
|
+
}
|
|
44
|
+
return { scope: { projectRoot, requestId, flowId }, execution, profileFile: value("profile-file"), intakeFile: value("intake-file"),
|
|
45
|
+
detach: options.has("detach"), prepareOnly: options.has("prepare-only"), nonInteractive: options.has("non-interactive") };
|
|
46
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { createContext } from "../runtime/context.js";
|
|
2
|
+
import { AppError, errorRecord } from "../shared/errors.js";
|
|
3
|
+
import { resolveDdFlowHome, resolveProjectRoot } from "../storage/paths.js";
|
|
4
|
+
import { readSetupStatus } from "../services/setup.js";
|
|
5
|
+
import { PreparedInstalledFlowSource } from "../services/installed-flow-source.js";
|
|
6
|
+
import { selectMemoryInitInstalledEngine } from "../services/memory-init-engine-release.js";
|
|
7
|
+
import { readOperatorProfiles, readOperatorProfileInput } from "../services/operator-profiles.js";
|
|
8
|
+
import { FrozenGenericExecution } from "../services/generic-execution.js";
|
|
9
|
+
import { openMemoryInitStores } from "../services/memory-init-stores.js";
|
|
10
|
+
import { registerProject, requireProjectByRoot } from "../services/projects.js";
|
|
11
|
+
import { diagnosticSnapshotRoot } from "../services/diagnostic-snapshot.js";
|
|
12
|
+
import { readDiagnosticRequest, retainDiagnosticRequest, startDiagnosticRun } from "../services/diagnostic-start.js";
|
|
13
|
+
import { readFlowRunExecutionBundle } from "../services/runs.js";
|
|
14
|
+
import { hybridDigest } from "../services/hybrid-contracts.js";
|
|
15
|
+
import { onboardExecutor } from "../services/executor-onboarding.js";
|
|
16
|
+
import { askExecutorChoice } from "./executor-onboarding.js";
|
|
17
|
+
import { prepareDiagnosticInvocation } from "./diagnostic-invocation.js";
|
|
18
|
+
import { parseOutputOptions } from "./output-options.js";
|
|
19
|
+
import { prepareResponseDestination } from "./response-file.js";
|
|
20
|
+
import { prepareFileBytes } from "./input-preparation.js";
|
|
21
|
+
import { writePreparationError } from "./error-output.js";
|
|
22
|
+
import { launchAndObserveMemoryFlow } from "./memory-init.js";
|
|
23
|
+
import { publishSetup } from "../harness-runtime/lib/setup-progress.mjs";
|
|
24
|
+
export async function runDiagnosticCli(args, env = process.env, io = process) {
|
|
25
|
+
let context, effects = false;
|
|
26
|
+
try {
|
|
27
|
+
const output = parseOutputOptions(args), invocation = prepareDiagnosticInvocation(output.args), home = resolveDdFlowHome(env);
|
|
28
|
+
if (output.responseFile)
|
|
29
|
+
prepareResponseDestination(output.responseFile);
|
|
30
|
+
const scope = invocation.scope;
|
|
31
|
+
if (resolveProjectRoot(scope.projectRoot) !== scope.projectRoot)
|
|
32
|
+
throw new AppError("usage", "Project root must be canonical", 2, { effect: "no_effect" });
|
|
33
|
+
const reader = createContext(env, "read_existing");
|
|
34
|
+
let retained = null;
|
|
35
|
+
try {
|
|
36
|
+
const project = reader.db.get("SELECT status FROM projects WHERE root=?", [scope.projectRoot]);
|
|
37
|
+
if (project?.status && project.status !== "active")
|
|
38
|
+
throw new AppError("diagnostic_project_inactive", "Activate the selected project explicitly before diagnosis", 2, { effect: "no_effect" });
|
|
39
|
+
if (project)
|
|
40
|
+
retained = readDiagnosticRequest(reader, scope);
|
|
41
|
+
}
|
|
42
|
+
finally {
|
|
43
|
+
reader.db.close?.();
|
|
44
|
+
}
|
|
45
|
+
if (invocation.profileFile)
|
|
46
|
+
invocation.execution.rootProfile = readOperatorProfileInput(invocation.profileFile);
|
|
47
|
+
const readIntake = () => {
|
|
48
|
+
if (!invocation.intakeFile)
|
|
49
|
+
throw new AppError("usage", "Fresh diagnosis requires --intake-file with the requested focus and constraints", 2, { effect: "no_effect" });
|
|
50
|
+
const bytes = prepareFileBytes(invocation.intakeFile, "diagnostic intake", 64 * 1024).bytes;
|
|
51
|
+
let text;
|
|
52
|
+
try {
|
|
53
|
+
text = new TextDecoder("utf-8", { fatal: true, ignoreBOM: true }).decode(bytes);
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
throw new AppError("usage", "Diagnostic intake must be UTF-8", 2, { effect: "no_effect" });
|
|
57
|
+
}
|
|
58
|
+
if (!text.trim())
|
|
59
|
+
throw new AppError("usage", "Diagnostic intake cannot be empty", 2, { effect: "no_effect" });
|
|
60
|
+
return text;
|
|
61
|
+
};
|
|
62
|
+
if (retained) {
|
|
63
|
+
if (Object.entries(invocation.execution).some(([key, value]) => !Object.hasOwn(retained.selection, key) || hybridDigest(value) !== hybridDigest(retained.selection[key]))
|
|
64
|
+
|| invocation.intakeFile && readIntake() !== retained.objective)
|
|
65
|
+
throw new AppError("diagnostic_request_conflict", "Supplied selectors differ from the original diagnostic request", 2, { effect: "no_effect" });
|
|
66
|
+
}
|
|
67
|
+
const objective = retained?.objective ?? readIntake();
|
|
68
|
+
let source, engine;
|
|
69
|
+
let rootProfile = invocation.execution.rootProfile;
|
|
70
|
+
if (!retained) {
|
|
71
|
+
const setup = readSetupStatus(home), installation = setup.installation;
|
|
72
|
+
if (!installation || setup.installation_readiness !== "installed")
|
|
73
|
+
throw new AppError("diagnostic_setup_required", "Install the desired canon and CLI with setup before diagnosis", 2, { effect: "no_effect" });
|
|
74
|
+
publishSetup("dependency_check_completed", "diagnostic:installation");
|
|
75
|
+
source = PreparedInstalledFlowSource.fromInstalledRelease(home, installation.manifest_sha256, scope.flowId);
|
|
76
|
+
publishSetup("dependency_check_completed", "diagnostic:canon");
|
|
77
|
+
engine = selectMemoryInitInstalledEngine(home, installation.manifest_sha256);
|
|
78
|
+
publishSetup("dependency_check_completed", "diagnostic:engine");
|
|
79
|
+
engine.admitDiagnosticFlow(source, scope.flowId);
|
|
80
|
+
publishSetup("dependency_check_completed", "diagnostic:handlers");
|
|
81
|
+
const stdin = io.stdin ?? process.stdin;
|
|
82
|
+
const selected = await onboardExecutor({ ...(typeof rootProfile === "string" ? { profileId: rootProfile } : {}),
|
|
83
|
+
...(invocation.profileFile ? { profileFile: invocation.profileFile } : {}) }, () => readOperatorProfiles(home), { allowSkip: false, nonInteractive: invocation.nonInteractive || output.json || output.progressJsonl
|
|
84
|
+
|| !stdin.isTTY || !io.stderr.isTTY }, settings => askExecutorChoice(settings, { stdin, stderr: io.stderr }, { allowSave: false, allowSkip: false }));
|
|
85
|
+
if (!selected.profile)
|
|
86
|
+
throw new AppError("diagnostic_executor_required", "Select an executor profile before diagnosis", 2, { effect: "no_effect" });
|
|
87
|
+
rootProfile ??= selected.profile;
|
|
88
|
+
}
|
|
89
|
+
effects = true;
|
|
90
|
+
context = openMemoryInitStores(env, { scope: { projectRoot: scope.projectRoot, workspaceRoot: scope.projectRoot, requestId: scope.requestId },
|
|
91
|
+
selectionSha256: hybridDigest({ scope, objective, selection: retained?.selection ?? invocation.execution }) }).context;
|
|
92
|
+
publishSetup("dependency_check_completed", "diagnostic:stores");
|
|
93
|
+
registerProject(context, { root: scope.projectRoot });
|
|
94
|
+
if (!retained) {
|
|
95
|
+
const project = requireProjectByRoot(context, scope.projectRoot);
|
|
96
|
+
const workspace = diagnosticSnapshotRoot(context, { projectId: project.id, projectRoot: scope.projectRoot, sourceRoot: scope.projectRoot,
|
|
97
|
+
requestId: scope.requestId, flowId: scope.flowId });
|
|
98
|
+
const execution = FrozenGenericExecution.prepare(source.resolveRegisteredFlow(), readOperatorProfiles(home), {
|
|
99
|
+
...invocation.execution, ...(rootProfile !== undefined ? { rootProfile } : {}), execution: "managed", stageSessionMode: "new_session",
|
|
100
|
+
delegation: invocation.execution.delegation ?? { mode: "external", max_parallel: 1 }
|
|
101
|
+
}, { requestId: scope.requestId, projectRoot: scope.projectRoot, workspace });
|
|
102
|
+
retainDiagnosticRequest(context, { scope, source: source, execution, engine: engine, objective, selection: invocation.execution });
|
|
103
|
+
}
|
|
104
|
+
const started = startDiagnosticRun(context, scope), bundle = readFlowRunExecutionBundle(context, { projectRoot: scope.projectRoot, runId: started.runId });
|
|
105
|
+
if (!bundle)
|
|
106
|
+
throw new AppError("diagnostic_bundle_missing", "Restore the retained diagnostic bundle", 1, { effect: "committed" });
|
|
107
|
+
return await launchAndObserveMemoryFlow(context, { ...invocation,
|
|
108
|
+
scope: { projectRoot: scope.projectRoot, workspaceRoot: bundle.execution.snapshot().scope.workspace, requestId: scope.requestId } }, started, scope.flowId, output, env, io);
|
|
109
|
+
}
|
|
110
|
+
catch (error) {
|
|
111
|
+
const record = errorRecord(error);
|
|
112
|
+
if (effects)
|
|
113
|
+
record.details = { ...record.details, effect: ["unknown", "committed", "partial"].includes(String(record.details.effect)) ? record.details.effect : "partial", next_action: "reconcile_exact_request" };
|
|
114
|
+
writePreparationError(io, args, record);
|
|
115
|
+
return record.exitCode;
|
|
116
|
+
}
|
|
117
|
+
finally {
|
|
118
|
+
context?.db.close?.();
|
|
119
|
+
}
|
|
120
|
+
}
|