@deksden-com/dd-flow-cli 0.4.2 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -4
- package/dist/build-info.json +6 -6
- package/dist/cli/help.js +14 -3
- package/dist/cli/run-cli.js +32 -16
- package/dist/domain/flow-contract.js +81 -2
- package/dist/domain/validation.js +56 -28
- package/dist/protocol/local-files.js +1 -16
- package/dist/schemas/code-stage-report.schema.json +2 -2
- package/dist/schemas/flow-contract.schema.json +150 -94
- package/dist/schemas/flow-run.schema.json +129 -23
- package/dist/schemas/mb-upgrade-review-data.schema.json +2 -2
- package/dist/schemas/memorybank-permissions-preflight.schema.json +13 -73
- package/dist/schemas/merge-stage-report.schema.json +2 -2
- package/dist/schemas/plan-stage-report.schema.json +38 -335
- package/dist/schemas/project-flow-pack-manifest.schema.json +4 -4
- package/dist/schemas/protocol-plan.schema.json +197 -0
- package/dist/schemas/release-impact.schema.json +9 -5
- package/dist/schemas/session-usage.schema.json +16 -0
- package/dist/schemas/stage-finish-input.schema.json +20 -0
- package/dist/schemas/stage-prompt.schema.json +31 -0
- package/dist/schemas/stage-report.schema.json +20 -0
- package/dist/schemas/stage-start-response.schema.json +29 -0
- package/dist/schemas/timeline-event.schema.json +29 -0
- package/dist/schemas/worktrunk-workspace.schema.json +19 -0
- package/dist/services/branch-context.js +9 -4
- package/dist/services/dashboard.js +51 -26
- package/dist/services/engines.js +84 -18
- package/dist/services/hooks.js +80 -246
- package/dist/services/memory-permissions.js +77 -69
- package/dist/services/plan-runtime.js +124 -0
- package/dist/services/plans.js +22 -84
- package/dist/services/projects.js +2 -1
- package/dist/services/prompts.js +26 -21
- package/dist/services/protocols.js +29 -25
- package/dist/services/run-projection.js +77 -11
- package/dist/services/runs.js +95 -61
- package/dist/services/schema-validation.js +168 -7
- package/dist/services/sessions.js +132 -68
- package/dist/services/stage-lifecycle.js +572 -0
- package/dist/services/tooling.js +285 -0
- package/dist/services/usage.js +183 -30
- package/dist/services/version-status.js +1 -1
- package/dist/services/worktrees.js +88 -39
- package/dist/storage/database.js +72 -30
- package/dist/storage/paths.js +0 -9
- package/package.json +14 -13
- package/tools/worktrunk-manifest.json +34 -0
- package/dist/schemas/flow-run-index-v3.schema.json +0 -203
- package/dist/schemas/flow-run-index.schema.json +0 -175
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
-
"$id": "dd-flow/flow-run-index@3",
|
|
4
|
-
"title": "dd-flow run index v3",
|
|
5
|
-
"description": "Compact, privacy-safe navigation projection for one flow RUN.",
|
|
6
|
-
"type": "object",
|
|
7
|
-
"additionalProperties": false,
|
|
8
|
-
"required": [
|
|
9
|
-
"schema_id",
|
|
10
|
-
"run_id",
|
|
11
|
-
"short_id",
|
|
12
|
-
"flow_kind",
|
|
13
|
-
"subject",
|
|
14
|
-
"project",
|
|
15
|
-
"workspace",
|
|
16
|
-
"stage_runs",
|
|
17
|
-
"sessions",
|
|
18
|
-
"artifacts",
|
|
19
|
-
"status",
|
|
20
|
-
"verdict",
|
|
21
|
-
"next_action",
|
|
22
|
-
"created_at",
|
|
23
|
-
"updated_at",
|
|
24
|
-
"started_at",
|
|
25
|
-
"timing_status",
|
|
26
|
-
"runtime_revision",
|
|
27
|
-
"snapshot_revision",
|
|
28
|
-
"snapshot_checksum",
|
|
29
|
-
"reconciliation_status",
|
|
30
|
-
"flow_flags"
|
|
31
|
-
],
|
|
32
|
-
"properties": {
|
|
33
|
-
"schema_id": { "const": "dd-flow/flow-run-index@3" },
|
|
34
|
-
"run_id": { "type": "string", "pattern": "^RUN-[0-9]{3}-[a-z0-9]+(?:-[a-z0-9]+)*$" },
|
|
35
|
-
"short_id": { "type": "string", "pattern": "^RUN-[0-9]{3}$" },
|
|
36
|
-
"flow_kind": { "type": "string", "minLength": 1 },
|
|
37
|
-
"subject": {
|
|
38
|
-
"type": "object",
|
|
39
|
-
"additionalProperties": false,
|
|
40
|
-
"required": ["type", "id"],
|
|
41
|
-
"properties": { "type": { "type": "string", "minLength": 1 }, "id": { "type": "string", "minLength": 1 } }
|
|
42
|
-
},
|
|
43
|
-
"project": {
|
|
44
|
-
"type": "object",
|
|
45
|
-
"additionalProperties": false,
|
|
46
|
-
"required": ["id", "root"],
|
|
47
|
-
"properties": { "id": { "type": "string", "minLength": 1 }, "root": { "type": "string", "minLength": 1 } }
|
|
48
|
-
},
|
|
49
|
-
"workspace": {
|
|
50
|
-
"type": "object",
|
|
51
|
-
"additionalProperties": false,
|
|
52
|
-
"required": ["root", "run_dir"],
|
|
53
|
-
"properties": { "root": { "type": "string", "minLength": 1 }, "run_dir": { "type": "string", "minLength": 1 } }
|
|
54
|
-
},
|
|
55
|
-
"run_home": {
|
|
56
|
-
"type": "object",
|
|
57
|
-
"additionalProperties": false,
|
|
58
|
-
"required": ["storage", "path"],
|
|
59
|
-
"properties": {
|
|
60
|
-
"storage": { "type": "string", "enum": ["dd_flow_home", "workspace_tasks_legacy", "project_projection"] },
|
|
61
|
-
"path": { "type": "string", "minLength": 1 },
|
|
62
|
-
"relative_path": { "type": "string", "minLength": 1 }
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
"execution": {
|
|
66
|
-
"type": "object",
|
|
67
|
-
"additionalProperties": false,
|
|
68
|
-
"required": ["project_root", "workspace_root"],
|
|
69
|
-
"properties": {
|
|
70
|
-
"project_root": { "type": "string", "minLength": 1 },
|
|
71
|
-
"workspace_root": { "type": "string", "minLength": 1 },
|
|
72
|
-
"git": {
|
|
73
|
-
"type": "object",
|
|
74
|
-
"additionalProperties": false,
|
|
75
|
-
"required": ["branch", "head"],
|
|
76
|
-
"properties": { "branch": { "type": ["string", "null"] }, "head": { "type": ["string", "null"] } }
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
"legacy": {
|
|
81
|
-
"type": "object",
|
|
82
|
-
"additionalProperties": false,
|
|
83
|
-
"properties": { "project_tasks_run_dir": { "type": ["string", "null"] } }
|
|
84
|
-
},
|
|
85
|
-
"stage_runs": { "type": "array", "items": { "$ref": "#/definitions/stageRun" } },
|
|
86
|
-
"sessions": { "type": "array", "items": { "$ref": "#/definitions/session" } },
|
|
87
|
-
"artifacts": { "type": "array", "items": { "type": "object" } },
|
|
88
|
-
"status": { "type": "string", "enum": ["running", "done", "blocked", "cancelled", "failed"] },
|
|
89
|
-
"verdict": { "type": "string", "minLength": 1 },
|
|
90
|
-
"next_action": { "type": ["string", "null"] },
|
|
91
|
-
"created_at": { "type": "string", "format": "date-time" },
|
|
92
|
-
"updated_at": { "type": "string", "format": "date-time" },
|
|
93
|
-
"started_at": { "type": "string", "format": "date-time" },
|
|
94
|
-
"completed_at": { "type": "string", "format": "date-time" },
|
|
95
|
-
"timing_status": { "enum": ["measured", "legacy_incomplete"] },
|
|
96
|
-
"runtime_revision": { "type": "integer", "minimum": 1 },
|
|
97
|
-
"snapshot_revision": { "type": "integer", "minimum": 1 },
|
|
98
|
-
"snapshot_checksum": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
|
|
99
|
-
"reconciliation_status": { "enum": ["reconciled", "reconciliation_required", "legacy_incomplete"] },
|
|
100
|
-
"flow_flags": { "$ref": "#/definitions/flowFlags" }
|
|
101
|
-
},
|
|
102
|
-
"definitions": {
|
|
103
|
-
"stageRun": {
|
|
104
|
-
"type": "object",
|
|
105
|
-
"additionalProperties": false,
|
|
106
|
-
"required": ["order", "stage", "dir", "status", "updated_at"],
|
|
107
|
-
"properties": {
|
|
108
|
-
"order": { "type": "integer", "minimum": 1 },
|
|
109
|
-
"stage": { "type": "string", "minLength": 1 },
|
|
110
|
-
"dir": { "type": "string", "pattern": "^[0-9]{2}-[a-z0-9]+(?:-[a-z0-9]+)*$" },
|
|
111
|
-
"status": { "enum": ["pending", "running", "done", "blocked", "skipped", "failed"] },
|
|
112
|
-
"stage_report": { "type": "string", "minLength": 1 },
|
|
113
|
-
"dashboard": { "type": "string", "minLength": 1 },
|
|
114
|
-
"data": { "type": "string", "minLength": 1 },
|
|
115
|
-
"data_schema_id": { "type": "string", "minLength": 1 },
|
|
116
|
-
"report": { "type": "string", "minLength": 1 },
|
|
117
|
-
"artifact_aliases": { "type": "array", "items": { "type": "string", "minLength": 1 } },
|
|
118
|
-
"updated_at": { "type": "string", "format": "date-time" },
|
|
119
|
-
"started_at": { "type": "string", "format": "date-time" },
|
|
120
|
-
"completed_at": { "type": "string", "format": "date-time" },
|
|
121
|
-
"attempt": { "type": "string", "pattern": "^try-[0-9]{3}$" }
|
|
122
|
-
}
|
|
123
|
-
},
|
|
124
|
-
"session": {
|
|
125
|
-
"type": "object",
|
|
126
|
-
"additionalProperties": false,
|
|
127
|
-
"required": ["session_id", "status", "created_at", "updated_at", "coverage_units"],
|
|
128
|
-
"properties": {
|
|
129
|
-
"session_id": { "type": "string", "minLength": 1 },
|
|
130
|
-
"parent_session_id": { "type": ["string", "null"] },
|
|
131
|
-
"role": { "type": ["string", "null"] },
|
|
132
|
-
"session_kind": { "type": ["string", "null"] },
|
|
133
|
-
"worker_id": { "type": ["string", "null"] },
|
|
134
|
-
"current_stage": { "type": ["string", "null"] },
|
|
135
|
-
"status": { "type": "string", "minLength": 1 },
|
|
136
|
-
"created_at": { "type": "string", "format": "date-time" },
|
|
137
|
-
"updated_at": { "type": "string", "format": "date-time" },
|
|
138
|
-
"stopped_at": { "type": ["string", "null"], "format": "date-time" },
|
|
139
|
-
"coverage_units": { "type": "array", "items": { "$ref": "#/definitions/coverageUnit" } }
|
|
140
|
-
}
|
|
141
|
-
},
|
|
142
|
-
"coverageUnit": {
|
|
143
|
-
"type": "object",
|
|
144
|
-
"additionalProperties": false,
|
|
145
|
-
"required": ["unit_id"],
|
|
146
|
-
"properties": {
|
|
147
|
-
"unit_id": { "type": "string", "minLength": 1 },
|
|
148
|
-
"group_id": { "type": ["string", "null"] },
|
|
149
|
-
"job_id": { "type": ["string", "null"] },
|
|
150
|
-
"kind": { "type": ["string", "null"] }
|
|
151
|
-
}
|
|
152
|
-
},
|
|
153
|
-
"flowFlags": {
|
|
154
|
-
"type": "object",
|
|
155
|
-
"additionalProperties": false,
|
|
156
|
-
"required": ["contract", "flow_kind", "snapshot_revision", "resolution_status", "values", "snapshot_checksum"],
|
|
157
|
-
"properties": {
|
|
158
|
-
"contract": {
|
|
159
|
-
"type": "object",
|
|
160
|
-
"additionalProperties": false,
|
|
161
|
-
"required": ["id", "version"],
|
|
162
|
-
"properties": { "id": { "type": "string" }, "version": { "type": "integer", "minimum": 1 }, "capabilities": { "type": "array", "items": { "type": "string" } } }
|
|
163
|
-
},
|
|
164
|
-
"flow_kind": { "type": "string", "minLength": 1 },
|
|
165
|
-
"preset": {
|
|
166
|
-
"type": "object",
|
|
167
|
-
"additionalProperties": false,
|
|
168
|
-
"required": ["requested", "applied", "source_ref"],
|
|
169
|
-
"properties": {
|
|
170
|
-
"requested": { "type": ["string", "null"] },
|
|
171
|
-
"applied": { "type": "string", "minLength": 1 },
|
|
172
|
-
"source_ref": { "type": "string", "minLength": 1 }
|
|
173
|
-
}
|
|
174
|
-
},
|
|
175
|
-
"snapshot_revision": { "type": "integer", "minimum": 1 },
|
|
176
|
-
"resolution_status": { "enum": ["valid", "legacy_incomplete", "reconciliation_required"] },
|
|
177
|
-
"values": { "type": "object", "additionalProperties": { "$ref": "#/definitions/flagValue" } },
|
|
178
|
-
"snapshot_checksum": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
|
|
179
|
-
"compatibility_projection": { "type": "object" },
|
|
180
|
-
"resolved_at": { "type": "string", "format": "date-time" },
|
|
181
|
-
"floors_applied": { "type": "array", "items": { "type": "string" } }
|
|
182
|
-
}
|
|
183
|
-
},
|
|
184
|
-
"flagValue": {
|
|
185
|
-
"type": "object",
|
|
186
|
-
"additionalProperties": false,
|
|
187
|
-
"required": ["value", "value_type", "owner", "source", "rationale", "resolved_at"],
|
|
188
|
-
"properties": {
|
|
189
|
-
"value": {},
|
|
190
|
-
"value_type": { "type": "string" },
|
|
191
|
-
"owner": { "type": "string" },
|
|
192
|
-
"source": {
|
|
193
|
-
"type": "object",
|
|
194
|
-
"additionalProperties": false,
|
|
195
|
-
"required": ["kind", "ref"],
|
|
196
|
-
"properties": { "kind": { "type": "string" }, "ref": { "type": "string" }, "revision": { "type": ["integer", "null"] } }
|
|
197
|
-
},
|
|
198
|
-
"rationale": { "type": "string" },
|
|
199
|
-
"resolved_at": { "type": "string", "format": "date-time" }
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
}
|
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
-
"$id": "dd-flow/flow-run-index@2",
|
|
4
|
-
"title": "dd-flow run index",
|
|
5
|
-
"description": "Navigation and artifact discovery contract for one concrete dd-flow execution.",
|
|
6
|
-
"type": "object",
|
|
7
|
-
"additionalProperties": false,
|
|
8
|
-
"required": [
|
|
9
|
-
"schema_id",
|
|
10
|
-
"run_id",
|
|
11
|
-
"short_id",
|
|
12
|
-
"flow_kind",
|
|
13
|
-
"subject",
|
|
14
|
-
"project",
|
|
15
|
-
"workspace",
|
|
16
|
-
"stage_runs",
|
|
17
|
-
"sessions",
|
|
18
|
-
"artifacts",
|
|
19
|
-
"status",
|
|
20
|
-
"verdict",
|
|
21
|
-
"next_action",
|
|
22
|
-
"created_at",
|
|
23
|
-
"updated_at"
|
|
24
|
-
],
|
|
25
|
-
"properties": {
|
|
26
|
-
"schema_id": {
|
|
27
|
-
"enum": ["dd-flow/flow-run-index@1", "dd-flow/flow-run-index@2"]
|
|
28
|
-
},
|
|
29
|
-
"run_id": {
|
|
30
|
-
"type": "string",
|
|
31
|
-
"pattern": "^RUN-[0-9]{3}-[a-z0-9]+(?:-[a-z0-9]+)*$"
|
|
32
|
-
},
|
|
33
|
-
"short_id": {
|
|
34
|
-
"type": "string",
|
|
35
|
-
"pattern": "^RUN-[0-9]{3}$"
|
|
36
|
-
},
|
|
37
|
-
"flow_kind": {
|
|
38
|
-
"type": "string",
|
|
39
|
-
"enum": ["mb_sdlc", "coding", "experiment", "mb-init", "mb-upgrade", "mb-audit", "mb-distill", "mb-upgrade-review", "mb-sdlc-review", "review", "custom"]
|
|
40
|
-
},
|
|
41
|
-
"subject": {
|
|
42
|
-
"type": "object",
|
|
43
|
-
"additionalProperties": false,
|
|
44
|
-
"required": ["type", "id"],
|
|
45
|
-
"properties": {
|
|
46
|
-
"type": { "type": "string", "minLength": 1 },
|
|
47
|
-
"id": { "type": "string", "minLength": 1 }
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
"project": {
|
|
51
|
-
"type": "object",
|
|
52
|
-
"additionalProperties": false,
|
|
53
|
-
"required": ["id", "root"],
|
|
54
|
-
"properties": {
|
|
55
|
-
"id": { "type": "string", "pattern": "^PRJ-[0-9]{3}-[a-z0-9]+(?:-[a-z0-9]+)*$" },
|
|
56
|
-
"root": { "type": "string", "minLength": 1 }
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
"workspace": {
|
|
60
|
-
"type": "object",
|
|
61
|
-
"additionalProperties": false,
|
|
62
|
-
"required": ["root", "run_dir"],
|
|
63
|
-
"properties": {
|
|
64
|
-
"root": { "type": "string", "minLength": 1 },
|
|
65
|
-
"run_dir": { "type": "string", "minLength": 1 }
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
"run_home": {
|
|
69
|
-
"type": "object",
|
|
70
|
-
"additionalProperties": false,
|
|
71
|
-
"required": ["storage", "path"],
|
|
72
|
-
"properties": {
|
|
73
|
-
"storage": { "type": "string", "enum": ["dd_flow_home", "workspace_tasks_legacy", "project_projection"] },
|
|
74
|
-
"path": { "type": "string", "minLength": 1 },
|
|
75
|
-
"relative_path": { "type": "string", "minLength": 1 }
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
"execution": {
|
|
79
|
-
"type": "object",
|
|
80
|
-
"additionalProperties": false,
|
|
81
|
-
"required": ["project_root", "workspace_root"],
|
|
82
|
-
"properties": {
|
|
83
|
-
"project_root": { "type": "string", "minLength": 1 },
|
|
84
|
-
"workspace_root": { "type": "string", "minLength": 1 },
|
|
85
|
-
"git": {
|
|
86
|
-
"type": "object",
|
|
87
|
-
"additionalProperties": false,
|
|
88
|
-
"required": ["branch", "head"],
|
|
89
|
-
"properties": {
|
|
90
|
-
"branch": { "type": ["string", "null"] },
|
|
91
|
-
"head": { "type": ["string", "null"] }
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
"legacy": {
|
|
97
|
-
"type": "object",
|
|
98
|
-
"additionalProperties": false,
|
|
99
|
-
"properties": {
|
|
100
|
-
"project_tasks_run_dir": { "type": ["string", "null"] }
|
|
101
|
-
}
|
|
102
|
-
},
|
|
103
|
-
"stage_runs": {
|
|
104
|
-
"type": "array",
|
|
105
|
-
"items": { "$ref": "#/definitions/stageRun" }
|
|
106
|
-
},
|
|
107
|
-
"sessions": {
|
|
108
|
-
"type": "array"
|
|
109
|
-
},
|
|
110
|
-
"artifacts": {
|
|
111
|
-
"type": "array"
|
|
112
|
-
},
|
|
113
|
-
"status": {
|
|
114
|
-
"type": "string",
|
|
115
|
-
"enum": ["running", "done", "blocked", "cancelled", "failed"]
|
|
116
|
-
},
|
|
117
|
-
"verdict": {
|
|
118
|
-
"type": "string",
|
|
119
|
-
"minLength": 1
|
|
120
|
-
},
|
|
121
|
-
"next_action": {
|
|
122
|
-
"type": ["string", "null"]
|
|
123
|
-
},
|
|
124
|
-
"created_at": {
|
|
125
|
-
"type": "string",
|
|
126
|
-
"minLength": 1
|
|
127
|
-
},
|
|
128
|
-
"updated_at": {
|
|
129
|
-
"type": "string",
|
|
130
|
-
"minLength": 1
|
|
131
|
-
},
|
|
132
|
-
"completed_at": {
|
|
133
|
-
"type": "string",
|
|
134
|
-
"minLength": 1
|
|
135
|
-
},
|
|
136
|
-
"started_at": {
|
|
137
|
-
"type": "string",
|
|
138
|
-
"minLength": 1
|
|
139
|
-
},
|
|
140
|
-
"timing_status": {
|
|
141
|
-
"type": "string",
|
|
142
|
-
"enum": ["measured", "legacy_incomplete"]
|
|
143
|
-
}
|
|
144
|
-
},
|
|
145
|
-
"definitions": {
|
|
146
|
-
"stageRun": {
|
|
147
|
-
"type": "object",
|
|
148
|
-
"additionalProperties": false,
|
|
149
|
-
"required": ["order", "stage", "dir", "status", "updated_at"],
|
|
150
|
-
"properties": {
|
|
151
|
-
"order": { "type": "integer", "minimum": 1 },
|
|
152
|
-
"stage": { "type": "string", "minLength": 1 },
|
|
153
|
-
"dir": { "type": "string", "pattern": "^[0-9]{2}-[a-z0-9]+(?:-[a-z0-9]+)*$" },
|
|
154
|
-
"status": { "type": "string", "enum": ["pending", "running", "done", "blocked", "skipped", "failed"] },
|
|
155
|
-
"stage_report": { "type": "string", "minLength": 1 },
|
|
156
|
-
"dashboard": {
|
|
157
|
-
"type": "string",
|
|
158
|
-
"minLength": 1,
|
|
159
|
-
"description": "Deprecated compatibility field. New stage run indexes use stage_report."
|
|
160
|
-
},
|
|
161
|
-
"data": { "type": "string", "minLength": 1 },
|
|
162
|
-
"data_schema_id": { "type": "string", "minLength": 1 },
|
|
163
|
-
"report": { "type": "string", "minLength": 1 },
|
|
164
|
-
"artifact_aliases": {
|
|
165
|
-
"type": "array",
|
|
166
|
-
"items": { "type": "string", "minLength": 1 }
|
|
167
|
-
},
|
|
168
|
-
"updated_at": { "type": "string", "minLength": 1 },
|
|
169
|
-
"started_at": { "type": "string", "minLength": 1 },
|
|
170
|
-
"completed_at": { "type": "string", "minLength": 1 },
|
|
171
|
-
"attempt": { "type": "string", "pattern": "^try-[0-9]{3}$" }
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
}
|