mustflow 2.18.0 → 2.18.3

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 (38) hide show
  1. package/README.md +2 -2
  2. package/dist/cli/commands/explain-verify.js +2 -2
  3. package/dist/cli/commands/run/builtin-dispatch.js +92 -0
  4. package/dist/cli/commands/run/executor.js +112 -0
  5. package/dist/cli/commands/run/output.js +59 -0
  6. package/dist/cli/commands/run/process-tree.js +91 -0
  7. package/dist/cli/commands/run/receipt.js +42 -0
  8. package/dist/cli/commands/run.js +22 -414
  9. package/dist/cli/commands/verify/args.js +262 -0
  10. package/dist/cli/commands/verify.js +106 -263
  11. package/dist/cli/i18n/en.js +3 -1
  12. package/dist/cli/i18n/es.js +3 -1
  13. package/dist/cli/i18n/fr.js +3 -1
  14. package/dist/cli/i18n/hi.js +3 -1
  15. package/dist/cli/i18n/ko.js +3 -1
  16. package/dist/cli/i18n/zh.js +3 -1
  17. package/dist/cli/index.js +6 -72
  18. package/dist/cli/lib/command-registry.js +27 -0
  19. package/dist/cli/lib/repo-map.js +10 -3
  20. package/dist/core/atomic-state-write.js +31 -0
  21. package/dist/core/bounded-output.js +23 -1
  22. package/dist/core/check-issues.js +1 -0
  23. package/dist/core/command-contract-validation.js +57 -7
  24. package/dist/core/completion-verdict.js +2 -1
  25. package/dist/core/public-json-contracts.js +1 -1
  26. package/dist/core/run-receipt.js +20 -13
  27. package/dist/core/source-anchors.js +96 -24
  28. package/dist/core/verification-evidence.js +4 -1
  29. package/package.json +1 -1
  30. package/schemas/README.md +1 -1
  31. package/schemas/run-receipt.schema.json +26 -3
  32. package/schemas/verify-report.schema.json +1 -1
  33. package/schemas/verify-run-manifest.schema.json +1 -1
  34. package/templates/default/i18n.toml +7 -1
  35. package/templates/default/locales/en/.mustflow/skills/INDEX.md +2 -1
  36. package/templates/default/locales/en/.mustflow/skills/routes.toml +6 -0
  37. package/templates/default/locales/en/.mustflow/skills/source-anchor-authoring/SKILL.md +147 -0
  38. package/templates/default/manifest.toml +8 -1
@@ -0,0 +1,262 @@
1
+ export const DEFAULT_VERIFY_PARALLELISM = 1;
2
+ export function parseVerifyArgs(args) {
3
+ let reason;
4
+ let fromClassification;
5
+ let fromPlan;
6
+ let writePlan;
7
+ let reproEvidence;
8
+ let externalEvidence;
9
+ let json = false;
10
+ let planOnly = false;
11
+ let changed = false;
12
+ let parallelism = DEFAULT_VERIFY_PARALLELISM;
13
+ for (let index = 0; index < args.length; index += 1) {
14
+ const arg = args[index];
15
+ if (arg === '--json') {
16
+ json = true;
17
+ continue;
18
+ }
19
+ if (arg === '--plan-only') {
20
+ planOnly = true;
21
+ continue;
22
+ }
23
+ if (arg === '--changed') {
24
+ changed = true;
25
+ continue;
26
+ }
27
+ if (arg === '--parallel') {
28
+ const value = args[index + 1];
29
+ if (!value || value.startsWith('-')) {
30
+ return { json, planOnly, changed, reason, parallelism, error: 'missing_parallel_value' };
31
+ }
32
+ const parsedParallelism = parseVerifyParallelism(value);
33
+ if (parsedParallelism === null) {
34
+ return { json, planOnly, changed, reason, parallelism, error: 'invalid_parallel_value' };
35
+ }
36
+ parallelism = parsedParallelism;
37
+ index += 1;
38
+ continue;
39
+ }
40
+ if (arg === '--reason') {
41
+ const value = args[index + 1];
42
+ if (!value || value.startsWith('-')) {
43
+ return { json, planOnly, changed, reason, error: 'missing_reason_value' };
44
+ }
45
+ reason = value;
46
+ index += 1;
47
+ continue;
48
+ }
49
+ if (arg === '--from-plan') {
50
+ const value = args[index + 1];
51
+ if (!value || value.startsWith('-')) {
52
+ return { json, planOnly, changed, reason, fromClassification, fromPlan, error: 'missing_from_plan_value' };
53
+ }
54
+ fromPlan = value;
55
+ index += 1;
56
+ continue;
57
+ }
58
+ if (arg === '--from-classification') {
59
+ const value = args[index + 1];
60
+ if (!value || value.startsWith('-')) {
61
+ return {
62
+ json,
63
+ planOnly,
64
+ changed,
65
+ reason,
66
+ fromClassification,
67
+ fromPlan,
68
+ error: 'missing_from_classification_value',
69
+ };
70
+ }
71
+ fromClassification = value;
72
+ index += 1;
73
+ continue;
74
+ }
75
+ if (arg === '--write-plan') {
76
+ const value = args[index + 1];
77
+ if (!value || value.startsWith('-')) {
78
+ return {
79
+ json,
80
+ planOnly,
81
+ changed,
82
+ reason,
83
+ fromClassification,
84
+ fromPlan,
85
+ writePlan,
86
+ error: 'missing_write_plan_value',
87
+ };
88
+ }
89
+ writePlan = value;
90
+ index += 1;
91
+ continue;
92
+ }
93
+ if (arg === '--external-evidence') {
94
+ const value = args[index + 1];
95
+ if (!value || value.startsWith('-')) {
96
+ return {
97
+ json,
98
+ planOnly,
99
+ changed,
100
+ reason,
101
+ fromClassification,
102
+ fromPlan,
103
+ writePlan,
104
+ externalEvidence,
105
+ error: 'missing_external_evidence_value',
106
+ };
107
+ }
108
+ externalEvidence = value;
109
+ index += 1;
110
+ continue;
111
+ }
112
+ if (arg === '--repro-evidence') {
113
+ const value = args[index + 1];
114
+ if (!value || value.startsWith('-')) {
115
+ return {
116
+ json,
117
+ planOnly,
118
+ changed,
119
+ reason,
120
+ fromClassification,
121
+ fromPlan,
122
+ writePlan,
123
+ reproEvidence,
124
+ externalEvidence,
125
+ error: 'missing_repro_evidence_value',
126
+ };
127
+ }
128
+ reproEvidence = value;
129
+ index += 1;
130
+ continue;
131
+ }
132
+ if (arg.startsWith('--reason=')) {
133
+ const value = arg.slice('--reason='.length);
134
+ if (value.length === 0) {
135
+ return { json, planOnly, changed, reason, error: 'missing_reason_value' };
136
+ }
137
+ reason = value;
138
+ continue;
139
+ }
140
+ if (arg.startsWith('--parallel=')) {
141
+ const value = arg.slice('--parallel='.length);
142
+ const parsedParallelism = parseVerifyParallelism(value);
143
+ if (parsedParallelism === null) {
144
+ return { json, planOnly, changed, reason, parallelism, error: 'invalid_parallel_value' };
145
+ }
146
+ parallelism = parsedParallelism;
147
+ continue;
148
+ }
149
+ if (arg.startsWith('--from-plan=')) {
150
+ const value = arg.slice('--from-plan='.length);
151
+ if (value.length === 0) {
152
+ return { json, planOnly, changed, reason, fromClassification, fromPlan, error: 'missing_from_plan_value' };
153
+ }
154
+ fromPlan = value;
155
+ continue;
156
+ }
157
+ if (arg.startsWith('--from-classification=')) {
158
+ const value = arg.slice('--from-classification='.length);
159
+ if (value.length === 0) {
160
+ return {
161
+ json,
162
+ planOnly,
163
+ changed,
164
+ reason,
165
+ fromClassification,
166
+ fromPlan,
167
+ error: 'missing_from_classification_value',
168
+ };
169
+ }
170
+ fromClassification = value;
171
+ continue;
172
+ }
173
+ if (arg.startsWith('--write-plan=')) {
174
+ const value = arg.slice('--write-plan='.length);
175
+ if (value.length === 0) {
176
+ return {
177
+ json,
178
+ planOnly,
179
+ changed,
180
+ reason,
181
+ fromClassification,
182
+ fromPlan,
183
+ writePlan,
184
+ error: 'missing_write_plan_value',
185
+ };
186
+ }
187
+ writePlan = value;
188
+ continue;
189
+ }
190
+ if (arg.startsWith('--external-evidence=')) {
191
+ const value = arg.slice('--external-evidence='.length);
192
+ if (value.length === 0) {
193
+ return {
194
+ json,
195
+ planOnly,
196
+ changed,
197
+ reason,
198
+ fromClassification,
199
+ fromPlan,
200
+ writePlan,
201
+ externalEvidence,
202
+ error: 'missing_external_evidence_value',
203
+ };
204
+ }
205
+ externalEvidence = value;
206
+ continue;
207
+ }
208
+ if (arg.startsWith('--repro-evidence=')) {
209
+ const value = arg.slice('--repro-evidence='.length);
210
+ if (value.length === 0) {
211
+ return {
212
+ json,
213
+ planOnly,
214
+ changed,
215
+ reason,
216
+ fromClassification,
217
+ fromPlan,
218
+ writePlan,
219
+ reproEvidence,
220
+ externalEvidence,
221
+ error: 'missing_repro_evidence_value',
222
+ };
223
+ }
224
+ reproEvidence = value;
225
+ continue;
226
+ }
227
+ if (arg.startsWith('-')) {
228
+ return { json, planOnly, changed, reason, fromClassification, fromPlan, writePlan, reproEvidence, externalEvidence, error: arg };
229
+ }
230
+ return {
231
+ json,
232
+ planOnly,
233
+ changed,
234
+ reason,
235
+ fromClassification,
236
+ fromPlan,
237
+ writePlan,
238
+ reproEvidence,
239
+ externalEvidence,
240
+ error: `unexpected:${arg}`,
241
+ };
242
+ }
243
+ return {
244
+ json,
245
+ planOnly,
246
+ changed,
247
+ reason,
248
+ fromClassification,
249
+ fromPlan,
250
+ writePlan,
251
+ reproEvidence,
252
+ externalEvidence,
253
+ parallelism,
254
+ };
255
+ }
256
+ function parseVerifyParallelism(value) {
257
+ if (!/^[1-9][0-9]*$/u.test(value)) {
258
+ return null;
259
+ }
260
+ const parsed = Number(value);
261
+ return Number.isSafeInteger(parsed) ? parsed : null;
262
+ }