@deksden-com/dd-flow-cli 0.2.0 → 0.3.1

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 (47) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/README.md +76 -5
  3. package/dist/build-info.json +10 -6
  4. package/dist/cli/help.js +165 -20
  5. package/dist/cli/run-cli.js +427 -17
  6. package/dist/schemas/compatibility.schema.json +105 -0
  7. package/dist/schemas/engine-manifest.schema.json +61 -0
  8. package/dist/schemas/flow-guidance.schema.json +90 -0
  9. package/dist/schemas/flow-run-index.schema.json +30 -4
  10. package/dist/schemas/global-dashboard-data.schema.json +126 -0
  11. package/dist/schemas/mb-sdlc-review-report.schema.json +242 -0
  12. package/dist/schemas/mb-upgrade-migration-report.schema.json +93 -0
  13. package/dist/schemas/plan-stage-report.schema.json +83 -0
  14. package/dist/schemas/project-dashboard-data.schema.json +122 -0
  15. package/dist/schemas/project-flow-pack-manifest.schema.json +5 -1
  16. package/dist/schemas/project-summary.schema.json +73 -0
  17. package/dist/schemas/protocol-dashboard-data.schema.json +112 -0
  18. package/dist/schemas/status-report.schema.json +38 -2
  19. package/dist/schemas/version-report.schema.json +22 -0
  20. package/dist/services/build-info.js +26 -3
  21. package/dist/services/canon.js +93 -22
  22. package/dist/services/cleanup.js +45 -1
  23. package/dist/services/cli-operation-classifier.js +104 -0
  24. package/dist/services/compatibility-preflight.js +124 -0
  25. package/dist/services/config.js +31 -0
  26. package/dist/services/dashboard-targets.js +95 -0
  27. package/dist/services/dashboard.js +972 -10
  28. package/dist/services/engines.js +532 -0
  29. package/dist/services/flow-guidance.js +221 -0
  30. package/dist/services/hooks.js +1 -1
  31. package/dist/services/ids.js +106 -0
  32. package/dist/services/lanes.js +333 -1
  33. package/dist/services/merge-queue.js +106 -16
  34. package/dist/services/merge-worker.js +67 -4
  35. package/dist/services/migrations.js +231 -0
  36. package/dist/services/project-summary.js +122 -0
  37. package/dist/services/projects.js +44 -3
  38. package/dist/services/protocol-lifecycle.js +144 -0
  39. package/dist/services/protocols.js +660 -7
  40. package/dist/services/runs.js +98 -21
  41. package/dist/services/schema-validation.js +84 -4
  42. package/dist/services/sessions.js +21 -4
  43. package/dist/services/status.js +199 -1
  44. package/dist/services/version-status.js +59 -9
  45. package/dist/storage/database.js +31 -0
  46. package/dist/storage/paths.js +33 -0
  47. package/package.json +3 -2
@@ -0,0 +1,105 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "dd-flow/compatibility@1",
4
+ "title": "dd-flow compatibility manifest",
5
+ "description": "Canonical compatibility map between a Memory Bank release, tool packages, routed CLI engine expectations and machine data contracts required or recommended by that release.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": ["schema_id", "memory_bank_version", "dd_flow_cli", "router", "engine", "contracts", "migrations", "mb_lint"],
9
+ "properties": {
10
+ "schema_id": { "const": "dd-flow/compatibility@1" },
11
+ "memory_bank_version": { "type": "string", "minLength": 1 },
12
+ "dd_flow_cli": {
13
+ "type": "object",
14
+ "additionalProperties": false,
15
+ "required": ["package_name", "min_version", "recommended_version", "status_contract", "version_contract", "flow_contract"],
16
+ "properties": {
17
+ "package_name": { "type": "string", "minLength": 1 },
18
+ "min_version": { "type": "string", "minLength": 1 },
19
+ "recommended_version": { "type": "string", "minLength": 1 },
20
+ "status_contract": { "type": "string", "minLength": 1 },
21
+ "version_contract": { "type": "string", "minLength": 1 },
22
+ "flow_contract": { "type": "string", "minLength": 1 }
23
+ }
24
+ },
25
+ "router": {
26
+ "type": "object",
27
+ "additionalProperties": false,
28
+ "required": ["package_name", "min_version", "recommended_version", "routing_model", "engine_store"],
29
+ "properties": {
30
+ "package_name": { "type": "string", "minLength": 1 },
31
+ "min_version": { "type": "string", "minLength": 1 },
32
+ "recommended_version": { "type": "string", "minLength": 1 },
33
+ "routing_model": { "type": "string", "minLength": 1 },
34
+ "engine_store": { "type": "string", "minLength": 1 },
35
+ "notes": { "type": "string" }
36
+ }
37
+ },
38
+ "engine": {
39
+ "type": "object",
40
+ "additionalProperties": false,
41
+ "required": ["package_name", "version_range", "recommended_version", "install_hint", "old_engine_install_hint", "first_engine_installable_version", "legacy_direct_cli_before", "manifest_contract", "status"],
42
+ "properties": {
43
+ "package_name": { "type": "string", "minLength": 1 },
44
+ "version_range": { "type": "string", "minLength": 1 },
45
+ "recommended_version": { "type": "string", "minLength": 1 },
46
+ "install_hint": { "type": "string", "minLength": 1 },
47
+ "old_engine_install_hint": { "type": "string", "minLength": 1 },
48
+ "first_engine_installable_version": { "type": "string", "minLength": 1 },
49
+ "legacy_direct_cli_before": { "type": "string", "minLength": 1 },
50
+ "manifest_contract": { "type": "string", "minLength": 1 },
51
+ "status": { "type": "string", "minLength": 1 }
52
+ }
53
+ },
54
+ "contracts": {
55
+ "type": "object",
56
+ "additionalProperties": false,
57
+ "required": ["storage_contract_set", "project_summary_contract", "project_dashboard_contract", "global_dashboard_contract", "status_contract", "version_contract"],
58
+ "properties": {
59
+ "storage_contract_set": { "type": "string", "minLength": 1 },
60
+ "project_summary_contract": { "type": "string", "minLength": 1 },
61
+ "project_dashboard_contract": { "type": "string", "minLength": 1 },
62
+ "global_dashboard_contract": { "type": "string", "minLength": 1 },
63
+ "status_contract": { "type": "string", "minLength": 1 },
64
+ "version_contract": { "type": "string", "minLength": 1 }
65
+ }
66
+ },
67
+ "global_dashboard": {
68
+ "type": "object",
69
+ "additionalProperties": false,
70
+ "required": ["supported_project_summary_contracts", "unsupported_project_visibility", "summary_version_groups"],
71
+ "properties": {
72
+ "supported_project_summary_contracts": {
73
+ "type": "array",
74
+ "minItems": 1,
75
+ "items": { "type": "string", "minLength": 1 }
76
+ },
77
+ "unsupported_project_visibility": { "type": "boolean" },
78
+ "summary_version_groups": { "type": "boolean" }
79
+ }
80
+ },
81
+ "migrations": {
82
+ "type": "object",
83
+ "additionalProperties": false,
84
+ "required": ["mode", "from_previous", "to_this", "adjacent_only", "normal_commands_may_migrate"],
85
+ "properties": {
86
+ "mode": { "const": "mb-upgrade-only" },
87
+ "from_previous": { "type": ["string", "null"] },
88
+ "to_this": { "type": "string", "minLength": 1 },
89
+ "adjacent_only": { "type": "boolean" },
90
+ "normal_commands_may_migrate": { "const": false }
91
+ }
92
+ },
93
+ "mb_lint": {
94
+ "type": "object",
95
+ "additionalProperties": false,
96
+ "required": ["package_name", "min_version", "recommended_version", "command_contract"],
97
+ "properties": {
98
+ "package_name": { "type": "string", "minLength": 1 },
99
+ "min_version": { "type": "string", "minLength": 1 },
100
+ "recommended_version": { "type": "string", "minLength": 1 },
101
+ "command_contract": { "type": "string", "minLength": 1 }
102
+ }
103
+ }
104
+ }
105
+ }
@@ -0,0 +1,61 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "dd-flow/engine-manifest@1",
4
+ "title": "dd-flow engine manifest",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "schema_id",
9
+ "package_name",
10
+ "package_version",
11
+ "engine_id",
12
+ "engine_version",
13
+ "installed_at",
14
+ "install_source",
15
+ "package_root",
16
+ "snapshot_root",
17
+ "entrypoint",
18
+ "supports_memorybank",
19
+ "supports_contracts",
20
+ "integrity"
21
+ ],
22
+ "properties": {
23
+ "schema_id": { "const": "dd-flow/engine-manifest@1" },
24
+ "package_name": { "type": "string", "minLength": 1 },
25
+ "package_version": { "type": "string", "minLength": 1 },
26
+ "engine_id": { "const": "dd-flow-engine" },
27
+ "engine_version": { "type": "string", "minLength": 1 },
28
+ "installed_at": { "type": "string", "format": "date-time" },
29
+ "install_source": {
30
+ "type": "string",
31
+ "enum": ["bundled_package", "npx_package", "local_development"]
32
+ },
33
+ "package_root": { "type": "string", "minLength": 1 },
34
+ "snapshot_root": { "type": "string", "minLength": 1 },
35
+ "entrypoint": { "type": "string", "minLength": 1 },
36
+ "supports_memorybank": {
37
+ "type": "array",
38
+ "items": { "type": "string", "minLength": 1 }
39
+ },
40
+ "supports_contracts": {
41
+ "type": "object",
42
+ "additionalProperties": {
43
+ "type": "array",
44
+ "items": { "type": "string", "minLength": 1 }
45
+ }
46
+ },
47
+ "integrity": {
48
+ "type": "object",
49
+ "additionalProperties": false,
50
+ "required": ["source", "checksum", "mode"],
51
+ "properties": {
52
+ "source": { "const": "package_snapshot" },
53
+ "checksum": { "type": ["string", "null"] },
54
+ "mode": {
55
+ "type": "string",
56
+ "enum": ["file_list", "full_content", "package_manifest", "degraded_local_development"]
57
+ }
58
+ }
59
+ }
60
+ }
61
+ }
@@ -0,0 +1,90 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "dd-flow/flow-guidance@1",
4
+ "title": "dd-flow CLI flow guidance block",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "current_stage",
9
+ "allowed_next_stages",
10
+ "recommended_next_action",
11
+ "recommended_prompt",
12
+ "required_predecessor_evidence",
13
+ "guards",
14
+ "blocked_if_missing"
15
+ ],
16
+ "properties": {
17
+ "current_stage": {
18
+ "type": "string",
19
+ "minLength": 1
20
+ },
21
+ "lifecycle": {
22
+ "type": "object",
23
+ "additionalProperties": true,
24
+ "required": ["flow", "stage", "status", "terminal", "raw_stage", "raw_status"],
25
+ "properties": {
26
+ "flow": { "type": "string", "minLength": 1 },
27
+ "stage": { "type": "string", "minLength": 1 },
28
+ "substage": { "type": ["string", "null"] },
29
+ "status": { "type": "string", "minLength": 1 },
30
+ "terminal": { "type": "boolean" },
31
+ "legacy_stage": { "type": ["string", "null"] },
32
+ "legacy_status": { "type": ["string", "null"] },
33
+ "raw_stage": { "type": "string", "minLength": 1 },
34
+ "raw_status": { "type": "string", "minLength": 1 },
35
+ "queue_status": { "type": ["string", "null"] }
36
+ }
37
+ },
38
+ "allowed_next_stages": {
39
+ "type": "array",
40
+ "items": {
41
+ "type": "string",
42
+ "minLength": 1
43
+ }
44
+ },
45
+ "recommended_next_action": {
46
+ "type": "string",
47
+ "minLength": 1
48
+ },
49
+ "recommended_prompt": {
50
+ "type": "string",
51
+ "minLength": 1
52
+ },
53
+ "required_predecessor_evidence": {
54
+ "type": "array",
55
+ "items": {
56
+ "type": "string",
57
+ "minLength": 1
58
+ }
59
+ },
60
+ "guards": {
61
+ "type": "array",
62
+ "items": {
63
+ "type": "object",
64
+ "additionalProperties": false,
65
+ "required": ["id", "status", "summary"],
66
+ "properties": {
67
+ "id": {
68
+ "type": "string",
69
+ "minLength": 1
70
+ },
71
+ "status": {
72
+ "type": "string",
73
+ "enum": ["pass", "fail", "unknown", "not_applicable", "degraded"]
74
+ },
75
+ "summary": {
76
+ "type": "string",
77
+ "minLength": 1
78
+ }
79
+ }
80
+ }
81
+ },
82
+ "blocked_if_missing": {
83
+ "type": "array",
84
+ "items": {
85
+ "type": "string",
86
+ "minLength": 1
87
+ }
88
+ }
89
+ }
90
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "dd-flow/flow-run-index@1",
3
+ "$id": "dd-flow/flow-run-index@2",
4
4
  "title": "dd-flow run index",
5
5
  "description": "Navigation and artifact discovery contract for one concrete dd-flow execution.",
6
6
  "type": "object",
@@ -24,7 +24,7 @@
24
24
  ],
25
25
  "properties": {
26
26
  "schema_id": {
27
- "const": "dd-flow/flow-run-index@1"
27
+ "enum": ["dd-flow/flow-run-index@1", "dd-flow/flow-run-index@2"]
28
28
  },
29
29
  "run_id": {
30
30
  "type": "string",
@@ -36,7 +36,7 @@
36
36
  },
37
37
  "flow_kind": {
38
38
  "type": "string",
39
- "enum": ["coding", "experiment", "mb-init", "mb-upgrade", "mb-audit", "mb-distill", "mb-upgrade-review", "custom"]
39
+ "enum": ["mb_sdlc", "coding", "experiment", "mb-init", "mb-upgrade", "mb-audit", "mb-distill", "mb-upgrade-review", "mb-sdlc-review", "review", "custom"]
40
40
  },
41
41
  "subject": {
42
42
  "type": "object",
@@ -62,7 +62,33 @@
62
62
  "required": ["root", "run_dir"],
63
63
  "properties": {
64
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]+)*$" }
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
+ }
86
+ },
87
+ "legacy": {
88
+ "type": "object",
89
+ "additionalProperties": false,
90
+ "properties": {
91
+ "project_tasks_run_dir": { "type": ["string", "null"] }
66
92
  }
67
93
  },
68
94
  "stage_runs": {
@@ -0,0 +1,126 @@
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": [
8
+ "schema_id",
9
+ "generated_at",
10
+ "target_language",
11
+ "page",
12
+ "metrics",
13
+ "supported_summary_versions",
14
+ "summary_version_groups",
15
+ "unsupported_projects",
16
+ "project_cards",
17
+ "warnings"
18
+ ],
19
+ "properties": {
20
+ "schema_id": { "const": "dd-flow/global-dashboard-data@1" },
21
+ "generated_at": { "type": "string", "format": "date-time" },
22
+ "target_language": { "type": "string", "minLength": 2 },
23
+ "page": { "$ref": "#/definitions/page" },
24
+ "links": { "type": "object", "additionalProperties": { "$ref": "#/definitions/link" } },
25
+ "metrics": { "type": "array", "items": { "$ref": "#/definitions/metric" } },
26
+ "supported_summary_versions": { "type": "array", "items": { "$ref": "#/definitions/summaryVersion" } },
27
+ "summary_version_groups": { "type": "array", "items": { "$ref": "#/definitions/summaryVersionGroup" } },
28
+ "unsupported_projects": { "type": "array", "items": { "$ref": "#/definitions/unsupportedProject" } },
29
+ "project_cards": { "type": "array", "items": { "$ref": "#/definitions/card" } },
30
+ "warnings": { "type": "array" }
31
+ },
32
+ "definitions": {
33
+ "page": {
34
+ "type": "object",
35
+ "additionalProperties": true,
36
+ "required": ["kind", "screen_id", "title", "html_path", "json_path"],
37
+ "properties": {
38
+ "kind": { "const": "global" },
39
+ "screen_id": { "const": "SCR-DD-FLOW-GLOBAL-DASHBOARD" },
40
+ "title": { "type": "string", "minLength": 1 },
41
+ "html_path": { "type": "string", "minLength": 1 },
42
+ "json_path": { "type": "string", "minLength": 1 }
43
+ }
44
+ },
45
+ "metric": {
46
+ "type": "object",
47
+ "additionalProperties": true,
48
+ "required": ["id", "label", "value", "status", "source"],
49
+ "properties": {
50
+ "id": { "type": "string", "minLength": 1 },
51
+ "label": { "type": "string", "minLength": 1 },
52
+ "value": { "type": ["number", "null"] },
53
+ "status": { "type": "string", "enum": ["known", "unknown", "degraded", "not_applicable"] },
54
+ "source": { "type": "string", "minLength": 1 }
55
+ }
56
+ },
57
+ "link": {
58
+ "type": "object",
59
+ "additionalProperties": true,
60
+ "required": ["label", "href", "path_kind", "status"],
61
+ "properties": {
62
+ "label": { "type": "string", "minLength": 1 },
63
+ "href": { "type": "string" },
64
+ "path_kind": { "type": "string", "enum": ["absolute", "relative"] },
65
+ "status": { "type": "string", "enum": ["available", "pending", "missing", "not_applicable"] },
66
+ "degraded_reason": { "type": "string" }
67
+ }
68
+ },
69
+ "card": {
70
+ "type": "object",
71
+ "additionalProperties": true,
72
+ "required": ["id", "title", "display_status", "action_level", "lifecycle_summary", "resource_summary", "metrics"],
73
+ "properties": {
74
+ "id": { "type": "string", "minLength": 1 },
75
+ "title": { "type": "string", "minLength": 1 },
76
+ "display_status": { "type": "string", "minLength": 1 },
77
+ "action_level": { "type": "string", "enum": ["none", "watch", "actionable", "blocked"] },
78
+ "lifecycle_summary": { "type": "object", "additionalProperties": true },
79
+ "resource_summary": { "type": "object", "additionalProperties": true },
80
+ "metrics": { "type": "object" }
81
+ }
82
+ },
83
+ "summaryVersion": {
84
+ "type": "object",
85
+ "additionalProperties": true,
86
+ "required": ["schema_id", "schema_version", "label", "status"],
87
+ "properties": {
88
+ "schema_id": { "type": "string", "minLength": 1 },
89
+ "schema_version": { "type": ["string", "null"] },
90
+ "label": { "type": "string", "minLength": 1 },
91
+ "status": { "type": "string", "minLength": 1 }
92
+ }
93
+ },
94
+ "summaryVersionGroup": {
95
+ "type": "object",
96
+ "additionalProperties": true,
97
+ "required": ["schema_id", "schema_version", "compatible", "count", "project_ids", "project_names"],
98
+ "properties": {
99
+ "schema_id": { "type": "string", "minLength": 1 },
100
+ "schema_version": { "type": "string", "minLength": 1 },
101
+ "compatible": { "type": "boolean" },
102
+ "count": { "type": "integer", "minimum": 0 },
103
+ "project_ids": { "type": "array", "items": { "type": "string" } },
104
+ "project_names": { "type": "array", "items": { "type": "string" } }
105
+ }
106
+ },
107
+ "unsupportedProject": {
108
+ "type": "object",
109
+ "additionalProperties": true,
110
+ "required": ["id", "title", "root", "status", "display_status", "reason", "summary_path"],
111
+ "properties": {
112
+ "id": { "type": "string", "minLength": 1 },
113
+ "title": { "type": "string", "minLength": 1 },
114
+ "root": { "type": "string", "minLength": 1 },
115
+ "status": { "type": "string", "minLength": 1 },
116
+ "display_status": { "const": "unsupported" },
117
+ "reason": { "type": "string", "minLength": 1 },
118
+ "detail": { "type": "string" },
119
+ "summary_schema_id": { "type": ["string", "null"] },
120
+ "summary_schema_version": { "type": ["string", "null"] },
121
+ "summary_path": { "type": "string", "minLength": 1 },
122
+ "install_hint": { "type": ["string", "null"] }
123
+ }
124
+ }
125
+ }
126
+ }