@deksden-com/dd-flow-cli 0.2.0 → 0.3.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 (33) hide show
  1. package/README.md +2 -0
  2. package/dist/build-info.json +10 -6
  3. package/dist/cli/help.js +70 -13
  4. package/dist/cli/run-cli.js +140 -10
  5. package/dist/schemas/compatibility.schema.json +26 -0
  6. package/dist/schemas/flow-guidance.schema.json +73 -0
  7. package/dist/schemas/flow-run-index.schema.json +30 -4
  8. package/dist/schemas/global-dashboard-data.schema.json +68 -0
  9. package/dist/schemas/mb-sdlc-review-report.schema.json +242 -0
  10. package/dist/schemas/plan-stage-report.schema.json +83 -0
  11. package/dist/schemas/project-dashboard-data.schema.json +98 -0
  12. package/dist/schemas/project-flow-pack-manifest.schema.json +5 -1
  13. package/dist/schemas/protocol-dashboard-data.schema.json +89 -0
  14. package/dist/schemas/status-report.schema.json +34 -0
  15. package/dist/schemas/version-report.schema.json +22 -0
  16. package/dist/services/build-info.js +26 -3
  17. package/dist/services/canon.js +93 -22
  18. package/dist/services/cleanup.js +14 -1
  19. package/dist/services/config.js +25 -0
  20. package/dist/services/dashboard.js +655 -10
  21. package/dist/services/flow-guidance.js +214 -0
  22. package/dist/services/ids.js +106 -0
  23. package/dist/services/merge-queue.js +9 -1
  24. package/dist/services/merge-worker.js +31 -2
  25. package/dist/services/projects.js +7 -1
  26. package/dist/services/protocols.js +637 -6
  27. package/dist/services/runs.js +98 -21
  28. package/dist/services/schema-validation.js +84 -4
  29. package/dist/services/status.js +189 -1
  30. package/dist/services/version-status.js +28 -2
  31. package/dist/storage/database.js +6 -0
  32. package/dist/storage/paths.js +21 -0
  33. package/package.json +1 -1
@@ -0,0 +1,68 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "dd-flow/global-dashboard-data@1",
4
+ "title": "dd-flow global dashboard data",
5
+ "type": "object",
6
+ "additionalProperties": true,
7
+ "required": ["schema_id", "generated_at", "target_language", "page", "metrics", "project_cards", "warnings"],
8
+ "properties": {
9
+ "schema_id": { "const": "dd-flow/global-dashboard-data@1" },
10
+ "generated_at": { "type": "string", "format": "date-time" },
11
+ "target_language": { "type": "string", "minLength": 2 },
12
+ "page": { "$ref": "#/definitions/page" },
13
+ "links": { "type": "object", "additionalProperties": { "$ref": "#/definitions/link" } },
14
+ "metrics": { "type": "array", "items": { "$ref": "#/definitions/metric" } },
15
+ "project_cards": { "type": "array", "items": { "$ref": "#/definitions/card" } },
16
+ "warnings": { "type": "array" }
17
+ },
18
+ "definitions": {
19
+ "page": {
20
+ "type": "object",
21
+ "additionalProperties": true,
22
+ "required": ["kind", "screen_id", "title", "html_path", "json_path"],
23
+ "properties": {
24
+ "kind": { "const": "global" },
25
+ "screen_id": { "const": "SCR-DD-FLOW-GLOBAL-DASHBOARD" },
26
+ "title": { "type": "string", "minLength": 1 },
27
+ "html_path": { "type": "string", "minLength": 1 },
28
+ "json_path": { "type": "string", "minLength": 1 }
29
+ }
30
+ },
31
+ "metric": {
32
+ "type": "object",
33
+ "additionalProperties": true,
34
+ "required": ["id", "label", "value", "status", "source"],
35
+ "properties": {
36
+ "id": { "type": "string", "minLength": 1 },
37
+ "label": { "type": "string", "minLength": 1 },
38
+ "value": { "type": ["number", "null"] },
39
+ "status": { "type": "string", "enum": ["known", "unknown", "degraded", "not_applicable"] },
40
+ "source": { "type": "string", "minLength": 1 }
41
+ }
42
+ },
43
+ "link": {
44
+ "type": "object",
45
+ "additionalProperties": true,
46
+ "required": ["label", "href", "path_kind", "status"],
47
+ "properties": {
48
+ "label": { "type": "string", "minLength": 1 },
49
+ "href": { "type": "string" },
50
+ "path_kind": { "type": "string", "enum": ["absolute", "relative"] },
51
+ "status": { "type": "string", "enum": ["available", "pending", "missing", "not_applicable"] },
52
+ "degraded_reason": { "type": "string" }
53
+ }
54
+ },
55
+ "card": {
56
+ "type": "object",
57
+ "additionalProperties": true,
58
+ "required": ["id", "title", "display_status", "action_level", "metrics"],
59
+ "properties": {
60
+ "id": { "type": "string", "minLength": 1 },
61
+ "title": { "type": "string", "minLength": 1 },
62
+ "display_status": { "type": "string", "minLength": 1 },
63
+ "action_level": { "type": "string", "enum": ["none", "watch", "actionable", "blocked"] },
64
+ "metrics": { "type": "object" }
65
+ }
66
+ }
67
+ }
68
+ }
@@ -0,0 +1,242 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "dd-flow/mb-sdlc-review-report@1",
4
+ "title": "mb-sdlc-review report",
5
+ "description": "Canonical data contract for project-level mb-sdlc-review stage-report.json.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "schema_version",
10
+ "schema_id",
11
+ "run",
12
+ "review_focus",
13
+ "source_map",
14
+ "aspect_coverage",
15
+ "critic_pass",
16
+ "findings_register",
17
+ "conformance_summary",
18
+ "review_fix_recommendation",
19
+ "deferrals",
20
+ "dashboard_links"
21
+ ],
22
+ "properties": {
23
+ "schema_version": { "const": "1.0.0" },
24
+ "schema_id": { "const": "dd-flow/mb-sdlc-review-report@1" },
25
+ "run": { "$ref": "#/definitions/run" },
26
+ "review_focus": { "$ref": "#/definitions/reviewFocus" },
27
+ "source_map": { "$ref": "#/definitions/sourceMap" },
28
+ "aspect_coverage": {
29
+ "type": "array",
30
+ "minItems": 12,
31
+ "items": { "$ref": "#/definitions/aspectCoverage" }
32
+ },
33
+ "critic_pass": { "$ref": "#/definitions/criticPass" },
34
+ "findings_register": {
35
+ "type": "array",
36
+ "items": { "$ref": "#/definitions/finding" }
37
+ },
38
+ "conformance_summary": { "$ref": "#/definitions/conformanceSummary" },
39
+ "review_fix_recommendation": { "$ref": "#/definitions/reviewFixRecommendation" },
40
+ "deferrals": {
41
+ "type": "array",
42
+ "items": { "$ref": "#/definitions/deferral" }
43
+ },
44
+ "dashboard_links": {
45
+ "type": "object",
46
+ "additionalProperties": { "$ref": "#/definitions/link" }
47
+ }
48
+ },
49
+ "definitions": {
50
+ "nonEmptyString": { "type": "string", "minLength": 1 },
51
+ "run": {
52
+ "type": "object",
53
+ "additionalProperties": false,
54
+ "required": ["run_id", "project_id", "project_root", "generated_at", "report_dir", "stage_report_path", "html_report_path", "final_report_path"],
55
+ "properties": {
56
+ "run_id": { "$ref": "#/definitions/nonEmptyString" },
57
+ "project_id": { "$ref": "#/definitions/nonEmptyString" },
58
+ "project_root": { "$ref": "#/definitions/nonEmptyString" },
59
+ "generated_at": { "type": "string", "format": "date-time" },
60
+ "report_dir": { "$ref": "#/definitions/nonEmptyString" },
61
+ "stage_report_path": { "$ref": "#/definitions/nonEmptyString" },
62
+ "html_report_path": { "$ref": "#/definitions/nonEmptyString" },
63
+ "final_report_path": { "$ref": "#/definitions/nonEmptyString" },
64
+ "target_language": { "type": "string" }
65
+ }
66
+ },
67
+ "reviewFocus": {
68
+ "type": "object",
69
+ "additionalProperties": false,
70
+ "required": ["mode", "target", "title", "summary"],
71
+ "properties": {
72
+ "mode": {
73
+ "enum": ["whole_project", "latest_protocol", "specific_protocol", "protocol_set", "subsystem_or_spec_area", "feature_or_epic", "diff_or_commit_range"]
74
+ },
75
+ "target": { "$ref": "#/definitions/nonEmptyString" },
76
+ "title": { "$ref": "#/definitions/nonEmptyString" },
77
+ "summary": { "$ref": "#/definitions/nonEmptyString" },
78
+ "related_protocol_id": { "type": "string" },
79
+ "related_protocol_set": { "type": "string" }
80
+ }
81
+ },
82
+ "sourceMap": {
83
+ "type": "object",
84
+ "additionalProperties": false,
85
+ "required": ["sources", "missing_expected_sources", "notes"],
86
+ "properties": {
87
+ "sources": { "type": "array", "items": { "$ref": "#/definitions/source" } },
88
+ "missing_expected_sources": { "type": "array", "items": { "$ref": "#/definitions/source" } },
89
+ "notes": { "type": "array", "items": { "type": "string" } }
90
+ }
91
+ },
92
+ "source": {
93
+ "type": "object",
94
+ "additionalProperties": false,
95
+ "required": ["kind", "path", "status"],
96
+ "properties": {
97
+ "kind": { "enum": ["spec", "feature", "epic", "adr", "scenario", "protocol", "protocol_set", "evidence", "code", "test", "policy", "def", "dashboard", "run", "other"] },
98
+ "path": { "$ref": "#/definitions/nonEmptyString" },
99
+ "status": { "enum": ["available", "missing", "not_applicable", "degraded"] },
100
+ "summary": { "type": "string" }
101
+ }
102
+ },
103
+ "aspectCoverage": {
104
+ "type": "object",
105
+ "additionalProperties": false,
106
+ "required": ["aspect_id", "applicability", "coverage_mode", "status", "verdict", "reason", "task_packet_path", "report_path", "findings"],
107
+ "properties": {
108
+ "aspect_id": { "$ref": "#/definitions/aspectId" },
109
+ "applicability": { "enum": ["applicable", "not_applicable", "blocked"] },
110
+ "coverage_mode": { "enum": ["self_review", "focused_subagent", "multi_subagent", "external_tool", "degraded"] },
111
+ "status": { "enum": ["selected", "reviewed", "not_applicable", "blocked", "degraded"] },
112
+ "verdict": { "enum": ["pass", "watch", "fail", "blocked", "not_applicable", "degraded"] },
113
+ "reason": { "$ref": "#/definitions/nonEmptyString" },
114
+ "task_packet_path": { "type": "string" },
115
+ "report_path": { "type": "string" },
116
+ "findings": { "type": "array", "items": { "type": "string" } }
117
+ }
118
+ },
119
+ "aspectId": {
120
+ "enum": [
121
+ "structure_navigation_review",
122
+ "feature_epic_layer_review",
123
+ "spec_conformance_review",
124
+ "architecture_harmonization_review",
125
+ "adr_decision_review",
126
+ "scenario_evidence_review",
127
+ "contract_traceability_review",
128
+ "frontmatter_crosslink_review",
129
+ "engineering_standards_review",
130
+ "operations_policy_review",
131
+ "protocol_delivery_trace_review",
132
+ "def_followup_review"
133
+ ]
134
+ },
135
+ "criticPass": {
136
+ "type": "object",
137
+ "additionalProperties": false,
138
+ "required": ["candidate_count", "accepted_count", "rejected_count", "critics", "decisions"],
139
+ "properties": {
140
+ "candidate_count": { "type": "integer", "minimum": 0 },
141
+ "accepted_count": { "type": "integer", "minimum": 0 },
142
+ "rejected_count": { "type": "integer", "minimum": 0 },
143
+ "critics": { "type": "array", "items": { "$ref": "#/definitions/critic" } },
144
+ "decisions": { "type": "array", "items": { "$ref": "#/definitions/criticDecision" } }
145
+ }
146
+ },
147
+ "critic": {
148
+ "type": "object",
149
+ "additionalProperties": false,
150
+ "required": ["id", "mode", "verdict", "summary"],
151
+ "properties": {
152
+ "id": { "$ref": "#/definitions/nonEmptyString" },
153
+ "mode": { "enum": ["universal", "architectural_harmonization", "focused"] },
154
+ "verdict": { "enum": ["accepted", "accepted_with_downgrades", "degraded", "blocked"] },
155
+ "summary": { "$ref": "#/definitions/nonEmptyString" }
156
+ }
157
+ },
158
+ "criticDecision": {
159
+ "type": "object",
160
+ "additionalProperties": false,
161
+ "required": ["candidate_id", "disposition", "rationale"],
162
+ "properties": {
163
+ "candidate_id": { "$ref": "#/definitions/nonEmptyString" },
164
+ "finding_id": { "type": "string" },
165
+ "disposition": { "enum": ["accepted", "downgraded", "rejected", "duplicate", "def_candidate", "review_fix_candidate"] },
166
+ "rationale": { "$ref": "#/definitions/nonEmptyString" }
167
+ }
168
+ },
169
+ "finding": {
170
+ "type": "object",
171
+ "additionalProperties": false,
172
+ "required": ["id", "type", "severity", "confidence", "title", "problem", "impact", "recommended_action", "affected_objects", "evidence"],
173
+ "properties": {
174
+ "id": { "pattern": "^FIND-SDLC-REVIEW-[0-9]{3}$" },
175
+ "type": { "enum": ["project_defect", "spec_drift", "code_drift", "memory_bank_gap", "frontmatter_crosslink_gap", "coding_standards_gap", "policy_process_gap", "evidence_gap", "observation", "rejected_noise"] },
176
+ "severity": { "enum": ["blocking", "major", "minor", "informational"] },
177
+ "confidence": { "enum": ["high", "medium", "low"] },
178
+ "title": { "$ref": "#/definitions/nonEmptyString" },
179
+ "problem": { "$ref": "#/definitions/nonEmptyString" },
180
+ "impact": { "$ref": "#/definitions/nonEmptyString" },
181
+ "recommended_action": { "$ref": "#/definitions/nonEmptyString" },
182
+ "disposition": { "enum": ["fix_now", "create_protocol", "create_protocol_set", "create_DEF", "report_only", "reject"] },
183
+ "affected_objects": { "type": "array", "items": { "$ref": "#/definitions/source" } },
184
+ "evidence": { "type": "array", "items": { "$ref": "#/definitions/source" } }
185
+ }
186
+ },
187
+ "conformanceSummary": {
188
+ "type": "object",
189
+ "additionalProperties": false,
190
+ "required": ["overall_verdict", "summary", "items"],
191
+ "properties": {
192
+ "overall_verdict": { "enum": ["accepted", "accepted_with_findings", "failed", "blocked", "degraded"] },
193
+ "summary": { "$ref": "#/definitions/nonEmptyString" },
194
+ "items": {
195
+ "type": "array",
196
+ "items": {
197
+ "type": "object",
198
+ "additionalProperties": false,
199
+ "required": ["id", "label", "status", "summary"],
200
+ "properties": {
201
+ "id": { "$ref": "#/definitions/nonEmptyString" },
202
+ "label": { "$ref": "#/definitions/nonEmptyString" },
203
+ "status": { "enum": ["pass", "watch", "fail", "blocked", "not_applicable", "degraded"] },
204
+ "summary": { "$ref": "#/definitions/nonEmptyString" }
205
+ }
206
+ }
207
+ }
208
+ }
209
+ },
210
+ "reviewFixRecommendation": {
211
+ "type": "object",
212
+ "additionalProperties": false,
213
+ "required": ["required", "strategy", "next_action", "candidate_protocols"],
214
+ "properties": {
215
+ "required": { "type": "boolean" },
216
+ "strategy": { "enum": ["none", "single_protocol", "protocol_set", "DEF", "user_decision_required"] },
217
+ "next_action": { "$ref": "#/definitions/nonEmptyString" },
218
+ "candidate_protocols": { "type": "array", "items": { "type": "string" } }
219
+ }
220
+ },
221
+ "deferral": {
222
+ "type": "object",
223
+ "additionalProperties": false,
224
+ "required": ["id", "reason", "next_gate"],
225
+ "properties": {
226
+ "id": { "$ref": "#/definitions/nonEmptyString" },
227
+ "reason": { "$ref": "#/definitions/nonEmptyString" },
228
+ "next_gate": { "$ref": "#/definitions/nonEmptyString" }
229
+ }
230
+ },
231
+ "link": {
232
+ "type": "object",
233
+ "additionalProperties": false,
234
+ "required": ["label", "href", "status"],
235
+ "properties": {
236
+ "label": { "$ref": "#/definitions/nonEmptyString" },
237
+ "href": { "type": "string" },
238
+ "status": { "enum": ["available", "pending", "missing", "not_applicable"] }
239
+ }
240
+ }
241
+ }
242
+ }
@@ -65,6 +65,29 @@
65
65
  }
66
66
  }
67
67
  },
68
+ "task_profile": {
69
+ "type": "object",
70
+ "additionalProperties": true,
71
+ "properties": {
72
+ "size": {"type": "string"},
73
+ "risk": {"type": "string"},
74
+ "planning_route_hint": {"type": "string"},
75
+ "execution_mode_hint": {"type": "string"},
76
+ "verification_mode": {"type": "string"}
77
+ }
78
+ },
79
+ "route_decision": {
80
+ "type": "object",
81
+ "additionalProperties": true,
82
+ "properties": {
83
+ "selected_planning_route": {"type": "string"},
84
+ "selected_execution_mode": {"type": "string"},
85
+ "selected_git_route": {"type": "string"},
86
+ "selected_verification_depth": {"type": "string"},
87
+ "selected_evidence_level": {"type": "string"},
88
+ "reason": {"type": "string"}
89
+ }
90
+ },
68
91
  "graph": {
69
92
  "type": "object",
70
93
  "additionalProperties": false,
@@ -130,6 +153,51 @@
130
153
  }
131
154
  }
132
155
  },
156
+ "sdlc_contours": {
157
+ "type": "object",
158
+ "additionalProperties": true,
159
+ "properties": {
160
+ "summary": {"type": "string"},
161
+ "contours": {
162
+ "type": "array",
163
+ "items": {
164
+ "type": "object",
165
+ "additionalProperties": true,
166
+ "required": ["name", "applicability_status", "gate_status", "summary"],
167
+ "properties": {
168
+ "name": {"type": "string", "minLength": 1},
169
+ "applicability_status": {"type": "string", "minLength": 1},
170
+ "verification_state": {"type": "string"},
171
+ "closure_state": {"type": "string"},
172
+ "gate_status": {"type": "string", "minLength": 1},
173
+ "target_stage": {"type": "string"},
174
+ "delivery_target": {"type": "string"},
175
+ "summary": {"type": "string", "minLength": 1},
176
+ "reason": {"type": "string"},
177
+ "evidence": {"type": "string"},
178
+ "next_action": {"type": "string"}
179
+ }
180
+ }
181
+ },
182
+ "policy_migration": {"type": "string"},
183
+ "next_delivery_action": {"type": "string"}
184
+ }
185
+ },
186
+ "links": {
187
+ "type": "object",
188
+ "additionalProperties": { "$ref": "#/definitions/link" },
189
+ "properties": {
190
+ "global_dashboard": { "$ref": "#/definitions/link" },
191
+ "project_dashboard": { "$ref": "#/definitions/link" },
192
+ "protocol_page": { "$ref": "#/definitions/link" },
193
+ "run_index": { "$ref": "#/definitions/link" },
194
+ "run_summary": { "$ref": "#/definitions/link" },
195
+ "protocol_source": { "$ref": "#/definitions/link" },
196
+ "protocol_summary": { "$ref": "#/definitions/link" },
197
+ "previous_stage_report": { "$ref": "#/definitions/link" },
198
+ "next_stage_report": { "$ref": "#/definitions/link" }
199
+ }
200
+ },
133
201
  "plan_items": {
134
202
  "type": "array",
135
203
  "minItems": 1,
@@ -168,5 +236,20 @@
168
236
  "next_gate": {"type": "string", "minLength": 1}
169
237
  }
170
238
  }
239
+ },
240
+ "definitions": {
241
+ "link": {
242
+ "type": "object",
243
+ "additionalProperties": true,
244
+ "required": ["href", "label", "path_kind", "status"],
245
+ "properties": {
246
+ "href": { "type": "string" },
247
+ "label": { "type": "string", "minLength": 1 },
248
+ "path_kind": { "type": "string", "enum": ["relative", "absolute"] },
249
+ "status": { "type": "string", "enum": ["available", "pending", "missing", "not_applicable"] },
250
+ "degraded_reason": { "type": "string" },
251
+ "source": { "type": "string" }
252
+ }
253
+ }
171
254
  }
172
255
  }
@@ -0,0 +1,98 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "dd-flow/project-dashboard-data@1",
4
+ "title": "dd-flow project dashboard data",
5
+ "type": "object",
6
+ "additionalProperties": true,
7
+ "required": ["schema_id", "generated_at", "target_language", "page", "project", "metrics", "protocol_cards", "warnings"],
8
+ "properties": {
9
+ "schema_id": { "const": "dd-flow/project-dashboard-data@1" },
10
+ "generated_at": { "type": "string", "format": "date-time" },
11
+ "target_language": { "type": "string", "minLength": 2 },
12
+ "page": { "$ref": "#/definitions/page" },
13
+ "project": {
14
+ "type": "object",
15
+ "additionalProperties": true,
16
+ "required": ["id", "title", "root", "status", "updated_at"],
17
+ "properties": {
18
+ "id": { "type": "string", "minLength": 1 },
19
+ "title": { "type": "string", "minLength": 1 },
20
+ "root": { "type": "string", "minLength": 1 },
21
+ "status": { "type": "string", "minLength": 1 },
22
+ "updated_at": { "type": "string", "minLength": 1 }
23
+ }
24
+ },
25
+ "links": { "type": "object", "additionalProperties": { "$ref": "#/definitions/link" } },
26
+ "metrics": { "type": "array", "items": { "$ref": "#/definitions/metric" } },
27
+ "protocol_cards": { "type": "array", "items": { "$ref": "#/definitions/protocolCard" } },
28
+ "review_runs": { "type": "array", "items": { "$ref": "#/definitions/reviewRun" } },
29
+ "merge_queue": { "type": "array" },
30
+ "sessions": { "type": "array" },
31
+ "locks": { "type": "array" },
32
+ "warnings": { "type": "array" }
33
+ },
34
+ "definitions": {
35
+ "page": {
36
+ "type": "object",
37
+ "additionalProperties": true,
38
+ "required": ["kind", "screen_id", "title", "html_path", "json_path"],
39
+ "properties": {
40
+ "kind": { "const": "project" },
41
+ "screen_id": { "const": "SCR-DD-FLOW-PROJECT-DASHBOARD" },
42
+ "title": { "type": "string", "minLength": 1 },
43
+ "html_path": { "type": "string", "minLength": 1 },
44
+ "json_path": { "type": "string", "minLength": 1 }
45
+ }
46
+ },
47
+ "metric": {
48
+ "type": "object",
49
+ "additionalProperties": true,
50
+ "required": ["id", "label", "value", "status", "source"],
51
+ "properties": {
52
+ "id": { "type": "string", "minLength": 1 },
53
+ "label": { "type": "string", "minLength": 1 },
54
+ "value": { "type": ["number", "null"] },
55
+ "status": { "type": "string", "enum": ["known", "unknown", "degraded", "not_applicable"] },
56
+ "source": { "type": "string", "minLength": 1 }
57
+ }
58
+ },
59
+ "link": {
60
+ "type": "object",
61
+ "additionalProperties": true,
62
+ "required": ["label", "href", "path_kind", "status"],
63
+ "properties": {
64
+ "label": { "type": "string", "minLength": 1 },
65
+ "href": { "type": "string" },
66
+ "path_kind": { "type": "string", "enum": ["absolute", "relative"] },
67
+ "status": { "type": "string", "enum": ["available", "pending", "missing", "not_applicable"] },
68
+ "degraded_reason": { "type": "string" }
69
+ }
70
+ },
71
+ "protocolCard": {
72
+ "type": "object",
73
+ "additionalProperties": true,
74
+ "required": ["id", "short_id", "display_status", "action_level", "current_stage", "href"],
75
+ "properties": {
76
+ "id": { "type": "string", "minLength": 1 },
77
+ "short_id": { "type": "string", "minLength": 1 },
78
+ "display_status": { "type": "string", "minLength": 1 },
79
+ "action_level": { "type": "string", "enum": ["none", "watch", "actionable", "blocked"] },
80
+ "current_stage": { "type": "string", "minLength": 1 },
81
+ "href": { "type": "string", "minLength": 1 }
82
+ }
83
+ },
84
+ "reviewRun": {
85
+ "type": "object",
86
+ "additionalProperties": true,
87
+ "required": ["id", "short_id", "flow_kind", "status", "display_status"],
88
+ "properties": {
89
+ "id": { "type": "string", "minLength": 1 },
90
+ "short_id": { "type": "string", "minLength": 1 },
91
+ "flow_kind": { "type": "string", "minLength": 1 },
92
+ "status": { "type": "string", "minLength": 1 },
93
+ "display_status": { "type": "string", "minLength": 1 },
94
+ "subject_id": { "type": "string" }
95
+ }
96
+ }
97
+ }
98
+ }
@@ -32,6 +32,10 @@
32
32
  "type": "string",
33
33
  "minLength": 1
34
34
  },
35
+ "canon_memory_bank_root": {
36
+ "type": "string",
37
+ "minLength": 1
38
+ },
35
39
  "canon_flow_root": {
36
40
  "type": "string",
37
41
  "minLength": 1
@@ -101,7 +105,7 @@
101
105
  }
102
106
  },
103
107
  "then": {
104
- "required": ["canon_version_at_source_commit", "flow_contract"]
108
+ "required": ["canon_memory_bank_root", "canon_flow_root", "canon_version_at_source_commit", "flow_contract"]
105
109
  }
106
110
  }
107
111
  ],
@@ -0,0 +1,89 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "dd-flow/protocol-dashboard-data@1",
4
+ "title": "dd-flow protocol dashboard data",
5
+ "type": "object",
6
+ "additionalProperties": true,
7
+ "required": ["schema_id", "generated_at", "target_language", "page", "project", "protocol", "primary_run_id", "run_history", "stage_pipeline", "metrics", "warnings"],
8
+ "properties": {
9
+ "schema_id": { "const": "dd-flow/protocol-dashboard-data@1" },
10
+ "generated_at": { "type": "string", "format": "date-time" },
11
+ "target_language": { "type": "string", "minLength": 2 },
12
+ "page": { "$ref": "#/definitions/page" },
13
+ "project": { "type": "object", "additionalProperties": true, "required": ["id", "title", "root"] },
14
+ "protocol": {
15
+ "type": "object",
16
+ "additionalProperties": true,
17
+ "required": ["id", "short_id", "raw_status", "raw_stage", "display_status", "action_level", "updated_at"],
18
+ "properties": {
19
+ "id": { "type": "string", "minLength": 1 },
20
+ "short_id": { "type": "string", "minLength": 1 },
21
+ "raw_status": { "type": "string", "minLength": 1 },
22
+ "raw_stage": { "type": "string", "minLength": 1 },
23
+ "display_status": { "type": "string", "minLength": 1 },
24
+ "action_level": { "type": "string", "enum": ["none", "watch", "actionable", "blocked"] },
25
+ "updated_at": { "type": "string", "minLength": 1 }
26
+ }
27
+ },
28
+ "links": { "type": "object", "additionalProperties": { "$ref": "#/definitions/link" } },
29
+ "primary_run_id": { "type": ["string", "null"] },
30
+ "primary_run_reason": { "type": "string" },
31
+ "run_history": { "type": "array", "items": { "$ref": "#/definitions/run" } },
32
+ "review_runs": { "type": "array", "items": { "$ref": "#/definitions/run" } },
33
+ "stage_pipeline": { "type": "array" },
34
+ "metrics": { "type": "array", "items": { "$ref": "#/definitions/metric" } },
35
+ "warnings": { "type": "array" }
36
+ },
37
+ "definitions": {
38
+ "page": {
39
+ "type": "object",
40
+ "additionalProperties": true,
41
+ "required": ["kind", "screen_id", "title", "html_path", "json_path"],
42
+ "properties": {
43
+ "kind": { "const": "protocol" },
44
+ "screen_id": { "const": "SCR-DD-FLOW-PROTOCOL-PAGE" },
45
+ "title": { "type": "string", "minLength": 1 },
46
+ "html_path": { "type": "string", "minLength": 1 },
47
+ "json_path": { "type": "string", "minLength": 1 }
48
+ }
49
+ },
50
+ "metric": {
51
+ "type": "object",
52
+ "additionalProperties": true,
53
+ "required": ["id", "label", "value", "status", "source"],
54
+ "properties": {
55
+ "id": { "type": "string", "minLength": 1 },
56
+ "label": { "type": "string", "minLength": 1 },
57
+ "value": { "type": ["number", "null"] },
58
+ "status": { "type": "string", "enum": ["known", "unknown", "degraded", "not_applicable"] },
59
+ "source": { "type": "string", "minLength": 1 }
60
+ }
61
+ },
62
+ "link": {
63
+ "type": "object",
64
+ "additionalProperties": true,
65
+ "required": ["label", "href", "path_kind", "status"],
66
+ "properties": {
67
+ "label": { "type": "string", "minLength": 1 },
68
+ "href": { "type": "string" },
69
+ "path_kind": { "type": "string", "enum": ["absolute", "relative"] },
70
+ "status": { "type": "string", "enum": ["available", "pending", "missing", "not_applicable"] },
71
+ "degraded_reason": { "type": "string" }
72
+ }
73
+ },
74
+ "run": {
75
+ "type": "object",
76
+ "additionalProperties": true,
77
+ "required": ["id", "short_id", "flow_kind", "display_flow_kind", "status", "display_status", "stages"],
78
+ "properties": {
79
+ "id": { "type": "string", "minLength": 1 },
80
+ "short_id": { "type": "string", "minLength": 1 },
81
+ "flow_kind": { "type": "string", "minLength": 1 },
82
+ "display_flow_kind": { "type": "string", "minLength": 1 },
83
+ "status": { "type": "string", "minLength": 1 },
84
+ "display_status": { "type": "string", "minLength": 1 },
85
+ "stages": { "type": "array" }
86
+ }
87
+ }
88
+ }
89
+ }