@deksden-com/dd-flow-cli 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/README.md +274 -0
  2. package/dist/cli/help.js +308 -0
  3. package/dist/cli/run-cli.js +945 -0
  4. package/dist/cli.js +4 -0
  5. package/dist/domain/contracts.js +57 -0
  6. package/dist/domain/entity-ids.js +47 -0
  7. package/dist/domain/flow-contract.js +233 -0
  8. package/dist/domain/validation.js +91 -0
  9. package/dist/protocol/local-files.js +141 -0
  10. package/dist/runtime/context.js +11 -0
  11. package/dist/schemas/code-stage-report.schema.json +181 -0
  12. package/dist/schemas/flow-run-index.schema.json +129 -0
  13. package/dist/schemas/mb-upgrade-review-data.schema.json +813 -0
  14. package/dist/schemas/memorybank-permissions-preflight.schema.json +154 -0
  15. package/dist/schemas/merge-stage-report.schema.json +135 -0
  16. package/dist/services/audit.js +19 -0
  17. package/dist/services/cleanup.js +310 -0
  18. package/dist/services/config.js +143 -0
  19. package/dist/services/dashboard.js +436 -0
  20. package/dist/services/hooks.js +929 -0
  21. package/dist/services/lanes.js +327 -0
  22. package/dist/services/memory-permissions.js +344 -0
  23. package/dist/services/merge-queue.js +333 -0
  24. package/dist/services/plans.js +149 -0
  25. package/dist/services/projects.js +286 -0
  26. package/dist/services/protocols.js +606 -0
  27. package/dist/services/runs.js +359 -0
  28. package/dist/services/schema-validation.js +185 -0
  29. package/dist/services/sessions.js +365 -0
  30. package/dist/services/worktrees.js +204 -0
  31. package/dist/shared/errors.js +14 -0
  32. package/dist/shared/json.js +17 -0
  33. package/dist/storage/database.js +325 -0
  34. package/dist/storage/paths.js +56 -0
  35. package/package.json +44 -0
@@ -0,0 +1,181 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "dd-flow/code-stage-report@1",
4
+ "title": "Code stage report data",
5
+ "type": "object",
6
+ "additionalProperties": true,
7
+ "required": [
8
+ "schema_id",
9
+ "run",
10
+ "stage",
11
+ "project",
12
+ "subject",
13
+ "overall",
14
+ "breadcrumbs",
15
+ "implemented_goals",
16
+ "acceptance_scenarios",
17
+ "changed_files",
18
+ "checks",
19
+ "review",
20
+ "defs"
21
+ ],
22
+ "properties": {
23
+ "schema_id": { "const": "dd-flow/code-stage-report@1" },
24
+ "run": { "$ref": "#/definitions/run" },
25
+ "stage": { "$ref": "#/definitions/stage" },
26
+ "project": { "$ref": "#/definitions/namedEntity" },
27
+ "subject": { "$ref": "#/definitions/namedEntity" },
28
+ "overall": { "$ref": "#/definitions/overall" },
29
+ "breadcrumbs": {
30
+ "type": "array",
31
+ "items": { "$ref": "#/definitions/breadcrumb" }
32
+ },
33
+ "implemented_goals": {
34
+ "type": "array",
35
+ "items": { "$ref": "#/definitions/textBlock" }
36
+ },
37
+ "acceptance_scenarios": {
38
+ "type": "array",
39
+ "items": { "$ref": "#/definitions/scenario" }
40
+ },
41
+ "changed_files": {
42
+ "type": "array",
43
+ "items": { "$ref": "#/definitions/fileRef" }
44
+ },
45
+ "checks": {
46
+ "type": "array",
47
+ "items": { "$ref": "#/definitions/check" }
48
+ },
49
+ "review": {
50
+ "type": "object",
51
+ "additionalProperties": true,
52
+ "required": ["verdict", "findings"],
53
+ "properties": {
54
+ "verdict": { "type": "string", "minLength": 1 },
55
+ "findings": {
56
+ "type": "array",
57
+ "items": { "$ref": "#/definitions/finding" }
58
+ }
59
+ }
60
+ },
61
+ "defs": {
62
+ "type": "array",
63
+ "items": { "$ref": "#/definitions/deferral" }
64
+ }
65
+ },
66
+ "definitions": {
67
+ "run": {
68
+ "type": "object",
69
+ "additionalProperties": true,
70
+ "required": ["run_id", "run_index"],
71
+ "properties": {
72
+ "run_id": { "type": "string", "pattern": "^RUN-[0-9]{3}-[a-z0-9]+(?:-[a-z0-9]+)*$" },
73
+ "run_index": { "type": "string", "minLength": 1 }
74
+ }
75
+ },
76
+ "stage": {
77
+ "type": "object",
78
+ "additionalProperties": true,
79
+ "required": ["name", "dir", "status"],
80
+ "properties": {
81
+ "name": { "type": "string", "minLength": 1 },
82
+ "dir": { "type": "string", "pattern": "^[0-9]{2}-[a-z0-9]+(?:-[a-z0-9]+)*$" },
83
+ "status": { "type": "string", "minLength": 1 }
84
+ }
85
+ },
86
+ "namedEntity": {
87
+ "type": "object",
88
+ "additionalProperties": true,
89
+ "required": ["id", "title"],
90
+ "properties": {
91
+ "id": { "type": "string", "minLength": 1 },
92
+ "title": { "type": "string", "minLength": 1 }
93
+ }
94
+ },
95
+ "overall": {
96
+ "type": "object",
97
+ "additionalProperties": true,
98
+ "required": ["verdict", "summary", "next_action"],
99
+ "properties": {
100
+ "verdict": { "type": "string", "minLength": 1 },
101
+ "summary": { "type": "string", "minLength": 1 },
102
+ "next_action": { "type": "string", "minLength": 1 }
103
+ }
104
+ },
105
+ "breadcrumb": {
106
+ "type": "object",
107
+ "additionalProperties": false,
108
+ "required": ["label", "href", "status"],
109
+ "properties": {
110
+ "label": { "type": "string", "minLength": 1 },
111
+ "href": { "type": "string" },
112
+ "status": { "type": "string", "minLength": 1 }
113
+ }
114
+ },
115
+ "textBlock": {
116
+ "type": "object",
117
+ "additionalProperties": true,
118
+ "required": ["title", "summary"],
119
+ "properties": {
120
+ "title": { "type": "string", "minLength": 1 },
121
+ "summary": { "type": "string", "minLength": 1 }
122
+ }
123
+ },
124
+ "scenario": {
125
+ "type": "object",
126
+ "additionalProperties": true,
127
+ "required": ["id", "title", "verdict", "steps", "evidence"],
128
+ "properties": {
129
+ "id": { "type": "string", "minLength": 1 },
130
+ "title": { "type": "string", "minLength": 1 },
131
+ "verdict": { "type": "string", "minLength": 1 },
132
+ "steps": {
133
+ "type": "array",
134
+ "items": { "$ref": "#/definitions/textBlock" }
135
+ },
136
+ "evidence": {
137
+ "type": "array",
138
+ "items": { "$ref": "#/definitions/fileRef" }
139
+ }
140
+ }
141
+ },
142
+ "fileRef": {
143
+ "type": "object",
144
+ "additionalProperties": true,
145
+ "required": ["path", "label"],
146
+ "properties": {
147
+ "path": { "type": "string", "minLength": 1 },
148
+ "label": { "type": "string", "minLength": 1 }
149
+ }
150
+ },
151
+ "check": {
152
+ "type": "object",
153
+ "additionalProperties": true,
154
+ "required": ["name", "status"],
155
+ "properties": {
156
+ "name": { "type": "string", "minLength": 1 },
157
+ "status": { "type": "string", "minLength": 1 }
158
+ }
159
+ },
160
+ "finding": {
161
+ "type": "object",
162
+ "additionalProperties": true,
163
+ "required": ["severity", "title", "status"],
164
+ "properties": {
165
+ "severity": { "type": "string", "minLength": 1 },
166
+ "title": { "type": "string", "minLength": 1 },
167
+ "status": { "type": "string", "minLength": 1 }
168
+ }
169
+ },
170
+ "deferral": {
171
+ "type": "object",
172
+ "additionalProperties": true,
173
+ "required": ["id", "status", "summary"],
174
+ "properties": {
175
+ "id": { "type": "string", "minLength": 1 },
176
+ "status": { "type": "string", "minLength": 1 },
177
+ "summary": { "type": "string", "minLength": 1 }
178
+ }
179
+ }
180
+ }
181
+ }
@@ -0,0 +1,129 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "dd-flow/flow-run-index@1",
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
+ "const": "dd-flow/flow-run-index@1"
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": ["coding", "experiment", "mb-init", "mb-upgrade", "mb-audit", "mb-distill", "mb-upgrade-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", "pattern": "^\\.tasks/dd-flow-runs/RUN-[0-9]{3}-[a-z0-9]+(?:-[a-z0-9]+)*$" }
66
+ }
67
+ },
68
+ "stage_runs": {
69
+ "type": "array",
70
+ "items": { "$ref": "#/definitions/stageRun" }
71
+ },
72
+ "sessions": {
73
+ "type": "array"
74
+ },
75
+ "artifacts": {
76
+ "type": "array"
77
+ },
78
+ "status": {
79
+ "type": "string",
80
+ "enum": ["running", "done", "blocked", "cancelled", "failed"]
81
+ },
82
+ "verdict": {
83
+ "type": "string",
84
+ "minLength": 1
85
+ },
86
+ "next_action": {
87
+ "type": ["string", "null"]
88
+ },
89
+ "created_at": {
90
+ "type": "string",
91
+ "minLength": 1
92
+ },
93
+ "updated_at": {
94
+ "type": "string",
95
+ "minLength": 1
96
+ },
97
+ "completed_at": {
98
+ "type": "string",
99
+ "minLength": 1
100
+ }
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": { "type": "string", "enum": ["pending", "running", "done", "blocked", "skipped", "failed"] },
112
+ "stage_report": { "type": "string", "minLength": 1 },
113
+ "dashboard": {
114
+ "type": "string",
115
+ "minLength": 1,
116
+ "description": "Deprecated compatibility field. New stage run indexes use stage_report."
117
+ },
118
+ "data": { "type": "string", "minLength": 1 },
119
+ "data_schema_id": { "type": "string", "minLength": 1 },
120
+ "report": { "type": "string", "minLength": 1 },
121
+ "artifact_aliases": {
122
+ "type": "array",
123
+ "items": { "type": "string", "minLength": 1 }
124
+ },
125
+ "updated_at": { "type": "string", "minLength": 1 }
126
+ }
127
+ }
128
+ }
129
+ }