mustflow 2.74.5 → 2.74.6
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/dist/cli/commands/api.js
CHANGED
|
@@ -9,6 +9,7 @@ import { listActiveRunLocks } from '../../core/active-run-locks.js';
|
|
|
9
9
|
import { createChangeVerificationReport, } from '../../core/change-verification.js';
|
|
10
10
|
import { createComplexityBudgetReport, } from '../../core/complexity-budget.js';
|
|
11
11
|
import { readUtf8FileInsideWithoutSymlinks } from '../../core/safe-filesystem.js';
|
|
12
|
+
import { createScriptPackSuggestionReport, } from '../../core/script-pack-suggestions.js';
|
|
12
13
|
import { createVerificationPlanId } from '../../core/verification-plan-id.js';
|
|
13
14
|
import { printUsageError, renderHelp } from '../lib/cli-output.js';
|
|
14
15
|
import { hasCliOptionToken } from '../lib/option-parser.js';
|
|
@@ -18,6 +19,7 @@ import { readGitChangedFiles } from '../lib/git-changes.js';
|
|
|
18
19
|
import { t } from '../lib/i18n.js';
|
|
19
20
|
import { resolveMustflowRoot } from '../lib/project-root.js';
|
|
20
21
|
import { createRunPlan } from '../lib/run-plan.js';
|
|
22
|
+
import { listScriptPackScripts } from '../lib/script-pack-registry.js';
|
|
21
23
|
import { checkMustflowProjectReport } from '../lib/validation.js';
|
|
22
24
|
const API_WORKSPACE_SUMMARY_SCHEMA_VERSION = '1';
|
|
23
25
|
const API_COMMAND_CATALOG_SCHEMA_VERSION = '1';
|
|
@@ -411,6 +413,39 @@ function toVerificationPlanTestSelection(report) {
|
|
|
411
413
|
note: report.test_selection.notes[0] ?? null,
|
|
412
414
|
};
|
|
413
415
|
}
|
|
416
|
+
function createEmptyScriptPackSuggestions() {
|
|
417
|
+
return {
|
|
418
|
+
status: 'empty',
|
|
419
|
+
input: {
|
|
420
|
+
phases: [],
|
|
421
|
+
skills: [],
|
|
422
|
+
paths: [],
|
|
423
|
+
changed: false,
|
|
424
|
+
},
|
|
425
|
+
analyzed_paths: [],
|
|
426
|
+
suggestions: [],
|
|
427
|
+
issues: [],
|
|
428
|
+
};
|
|
429
|
+
}
|
|
430
|
+
function createApiScriptPackSuggestions(mustflowRoot, classification) {
|
|
431
|
+
if (!classification || classification.files.length === 0) {
|
|
432
|
+
return createEmptyScriptPackSuggestions();
|
|
433
|
+
}
|
|
434
|
+
const report = createScriptPackSuggestionReport(mustflowRoot, {
|
|
435
|
+
changed: false,
|
|
436
|
+
phases: ['after_change', 'review'],
|
|
437
|
+
skills: [],
|
|
438
|
+
paths: classification.files,
|
|
439
|
+
scripts: listScriptPackScripts(),
|
|
440
|
+
});
|
|
441
|
+
return {
|
|
442
|
+
status: report.status,
|
|
443
|
+
input: report.input,
|
|
444
|
+
analyzed_paths: report.analyzed_paths,
|
|
445
|
+
suggestions: report.suggestions,
|
|
446
|
+
issues: report.issues,
|
|
447
|
+
};
|
|
448
|
+
}
|
|
414
449
|
function createUnavailableVerificationPlanOutput(mustflowRoot, classification, issue) {
|
|
415
450
|
return {
|
|
416
451
|
schema_version: API_VERIFICATION_PLAN_SCHEMA_VERSION,
|
|
@@ -426,6 +461,7 @@ function createUnavailableVerificationPlanOutput(mustflowRoot, classification, i
|
|
|
426
461
|
risk_assessment: null,
|
|
427
462
|
schedule: null,
|
|
428
463
|
test_selection: null,
|
|
464
|
+
script_pack_suggestions: createApiScriptPackSuggestions(mustflowRoot, classification),
|
|
429
465
|
execution_policy: createVerificationPlanExecutionPolicy(),
|
|
430
466
|
issues: [issue],
|
|
431
467
|
};
|
|
@@ -484,6 +520,7 @@ function createVerificationPlanOutput() {
|
|
|
484
520
|
risk_assessment: report.risk_assessment,
|
|
485
521
|
schedule: toVerificationPlanSchedule(report),
|
|
486
522
|
test_selection: toVerificationPlanTestSelection(report),
|
|
523
|
+
script_pack_suggestions: createApiScriptPackSuggestions(mustflowRoot, classification),
|
|
487
524
|
execution_policy: createVerificationPlanExecutionPolicy(),
|
|
488
525
|
issues: [],
|
|
489
526
|
};
|
package/package.json
CHANGED
package/schemas/README.md
CHANGED
|
@@ -11,7 +11,8 @@ Current schemas:
|
|
|
11
11
|
- `workspace-summary.schema.json`: output of `mf api workspace-summary --json`
|
|
12
12
|
- `command-catalog.schema.json`: output of `mf api command-catalog --json`
|
|
13
13
|
- `verification-plan.schema.json`: output of `mf api verification-plan --changed --json`, including
|
|
14
|
-
risk-priced evidence assessment for the changed surfaces
|
|
14
|
+
risk-priced evidence assessment for the changed surfaces, selected command contract, and optional
|
|
15
|
+
read-only script-pack helper suggestions
|
|
15
16
|
- `latest-evidence.schema.json`: output of `mf api latest-evidence --json`
|
|
16
17
|
- `diff-risk.schema.json`: output of `mf api diff-risk --changed --json`, including a read-only
|
|
17
18
|
complexity budget for structural additions
|
|
@@ -66,6 +66,27 @@
|
|
|
66
66
|
{ "$ref": "#/$defs/testSelection" }
|
|
67
67
|
]
|
|
68
68
|
},
|
|
69
|
+
"script_pack_suggestions": {
|
|
70
|
+
"type": "object",
|
|
71
|
+
"additionalProperties": false,
|
|
72
|
+
"required": ["status", "input", "analyzed_paths", "suggestions", "issues"],
|
|
73
|
+
"properties": {
|
|
74
|
+
"status": { "type": "string", "enum": ["suggested", "empty", "partial"] },
|
|
75
|
+
"input": { "$ref": "#/$defs/scriptPackSuggestionInput" },
|
|
76
|
+
"analyzed_paths": {
|
|
77
|
+
"type": "array",
|
|
78
|
+
"items": { "$ref": "#/$defs/scriptPackAnalyzedPath" }
|
|
79
|
+
},
|
|
80
|
+
"suggestions": {
|
|
81
|
+
"type": "array",
|
|
82
|
+
"items": { "$ref": "#/$defs/scriptPackSuggestion" }
|
|
83
|
+
},
|
|
84
|
+
"issues": {
|
|
85
|
+
"type": "array",
|
|
86
|
+
"items": { "type": "string" }
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
},
|
|
69
90
|
"execution_policy": { "$ref": "#/$defs/executionPolicy" },
|
|
70
91
|
"issues": {
|
|
71
92
|
"type": "array",
|
|
@@ -86,6 +107,123 @@
|
|
|
86
107
|
"type": "array",
|
|
87
108
|
"items": { "type": "string" }
|
|
88
109
|
},
|
|
110
|
+
"scriptPackPhase": {
|
|
111
|
+
"type": "string",
|
|
112
|
+
"enum": ["before_change", "during_change", "after_change", "review"]
|
|
113
|
+
},
|
|
114
|
+
"scriptPackSurface": {
|
|
115
|
+
"type": "string",
|
|
116
|
+
"enum": [
|
|
117
|
+
"config",
|
|
118
|
+
"docs",
|
|
119
|
+
"generated",
|
|
120
|
+
"package",
|
|
121
|
+
"schema",
|
|
122
|
+
"skill",
|
|
123
|
+
"source",
|
|
124
|
+
"template",
|
|
125
|
+
"test",
|
|
126
|
+
"unknown"
|
|
127
|
+
]
|
|
128
|
+
},
|
|
129
|
+
"scriptPackSuggestionInput": {
|
|
130
|
+
"type": "object",
|
|
131
|
+
"additionalProperties": false,
|
|
132
|
+
"required": ["phases", "skills", "paths", "changed"],
|
|
133
|
+
"properties": {
|
|
134
|
+
"phases": {
|
|
135
|
+
"type": "array",
|
|
136
|
+
"items": { "$ref": "#/$defs/scriptPackPhase" }
|
|
137
|
+
},
|
|
138
|
+
"skills": {
|
|
139
|
+
"type": "array",
|
|
140
|
+
"items": { "type": "string", "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$" }
|
|
141
|
+
},
|
|
142
|
+
"paths": {
|
|
143
|
+
"type": "array",
|
|
144
|
+
"items": { "type": "string" }
|
|
145
|
+
},
|
|
146
|
+
"changed": { "type": "boolean" }
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
"scriptPackAnalyzedPath": {
|
|
150
|
+
"type": "object",
|
|
151
|
+
"additionalProperties": false,
|
|
152
|
+
"required": ["path", "surfaces"],
|
|
153
|
+
"properties": {
|
|
154
|
+
"path": { "type": "string" },
|
|
155
|
+
"surfaces": {
|
|
156
|
+
"type": "array",
|
|
157
|
+
"items": { "$ref": "#/$defs/scriptPackSurface" },
|
|
158
|
+
"minItems": 1
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
"scriptPackSuggestion": {
|
|
163
|
+
"type": "object",
|
|
164
|
+
"additionalProperties": false,
|
|
165
|
+
"required": [
|
|
166
|
+
"script_ref",
|
|
167
|
+
"score",
|
|
168
|
+
"confidence",
|
|
169
|
+
"usage",
|
|
170
|
+
"phases",
|
|
171
|
+
"matched_phases",
|
|
172
|
+
"matched_skills",
|
|
173
|
+
"matched_surfaces",
|
|
174
|
+
"reasons",
|
|
175
|
+
"read_only",
|
|
176
|
+
"mutates",
|
|
177
|
+
"network",
|
|
178
|
+
"risk_level",
|
|
179
|
+
"cost",
|
|
180
|
+
"report_schema_file",
|
|
181
|
+
"run_hint"
|
|
182
|
+
],
|
|
183
|
+
"properties": {
|
|
184
|
+
"script_ref": {
|
|
185
|
+
"type": "string",
|
|
186
|
+
"pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*/[a-z0-9]+(?:-[a-z0-9]+)*$"
|
|
187
|
+
},
|
|
188
|
+
"score": { "type": "integer", "minimum": 0 },
|
|
189
|
+
"confidence": { "type": "string", "enum": ["low", "medium", "high"] },
|
|
190
|
+
"usage": { "type": "string" },
|
|
191
|
+
"phases": {
|
|
192
|
+
"type": "array",
|
|
193
|
+
"items": { "$ref": "#/$defs/scriptPackPhase" },
|
|
194
|
+
"minItems": 1
|
|
195
|
+
},
|
|
196
|
+
"matched_phases": {
|
|
197
|
+
"type": "array",
|
|
198
|
+
"items": { "$ref": "#/$defs/scriptPackPhase" }
|
|
199
|
+
},
|
|
200
|
+
"matched_skills": {
|
|
201
|
+
"type": "array",
|
|
202
|
+
"items": { "type": "string", "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$" }
|
|
203
|
+
},
|
|
204
|
+
"matched_surfaces": {
|
|
205
|
+
"type": "array",
|
|
206
|
+
"items": { "$ref": "#/$defs/scriptPackSurface" }
|
|
207
|
+
},
|
|
208
|
+
"reasons": {
|
|
209
|
+
"type": "array",
|
|
210
|
+
"items": { "type": "string" },
|
|
211
|
+
"minItems": 1
|
|
212
|
+
},
|
|
213
|
+
"read_only": { "type": "boolean" },
|
|
214
|
+
"mutates": { "type": "boolean" },
|
|
215
|
+
"network": { "type": "boolean" },
|
|
216
|
+
"risk_level": { "type": "string", "enum": ["low", "medium", "high"] },
|
|
217
|
+
"cost": { "type": "string", "enum": ["low", "medium", "high"] },
|
|
218
|
+
"report_schema_file": {
|
|
219
|
+
"anyOf": [
|
|
220
|
+
{ "type": "string", "pattern": "^[a-z0-9-]+\\.schema\\.json$" },
|
|
221
|
+
{ "type": "null" }
|
|
222
|
+
]
|
|
223
|
+
},
|
|
224
|
+
"run_hint": { "type": "string" }
|
|
225
|
+
}
|
|
226
|
+
},
|
|
89
227
|
"classification": {
|
|
90
228
|
"type": "object",
|
|
91
229
|
"additionalProperties": false,
|