mustflow 1.30.0 → 2.11.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 (82) hide show
  1. package/README.md +35 -11
  2. package/dist/cli/commands/classify.js +61 -6
  3. package/dist/cli/commands/contract-lint.js +13 -4
  4. package/dist/cli/commands/dashboard.js +6 -0
  5. package/dist/cli/commands/index.js +5 -0
  6. package/dist/cli/commands/run.js +224 -48
  7. package/dist/cli/commands/upgrade.js +65 -0
  8. package/dist/cli/commands/verify.js +550 -33
  9. package/dist/cli/i18n/en.js +73 -10
  10. package/dist/cli/i18n/es.js +73 -10
  11. package/dist/cli/i18n/fr.js +73 -10
  12. package/dist/cli/i18n/hi.js +73 -10
  13. package/dist/cli/i18n/ko.js +73 -10
  14. package/dist/cli/i18n/zh.js +73 -10
  15. package/dist/cli/index.js +27 -46
  16. package/dist/cli/lib/command-registry.js +5 -0
  17. package/dist/cli/lib/dashboard-export.js +62 -12
  18. package/dist/cli/lib/dashboard-html/client-script.js +1936 -0
  19. package/dist/cli/lib/dashboard-html/locale-bootstrap.js +8 -0
  20. package/dist/cli/lib/dashboard-html/styles.js +572 -0
  21. package/dist/cli/lib/dashboard-html/template.js +134 -0
  22. package/dist/cli/lib/dashboard-html/types.js +1 -0
  23. package/dist/cli/lib/dashboard-html.js +1 -1907
  24. package/dist/cli/lib/dashboard-locale.js +37 -0
  25. package/dist/cli/lib/local-index/constants.js +48 -0
  26. package/dist/cli/lib/local-index/index.js +2256 -0
  27. package/dist/cli/lib/local-index/sql.js +15 -0
  28. package/dist/cli/lib/local-index/types.js +1 -0
  29. package/dist/cli/lib/local-index.js +1 -1908
  30. package/dist/cli/lib/reporter.js +6 -0
  31. package/dist/cli/lib/run-plan.js +96 -4
  32. package/dist/cli/lib/templates.js +18 -1
  33. package/dist/cli/lib/validation/command-intents.js +11 -0
  34. package/dist/cli/lib/validation/constants.js +238 -0
  35. package/dist/cli/lib/validation/index.js +1384 -0
  36. package/dist/cli/lib/validation/primitives.js +198 -0
  37. package/dist/cli/lib/validation/test-selection.js +95 -0
  38. package/dist/cli/lib/validation/types.js +1 -0
  39. package/dist/cli/lib/validation.js +1 -1661
  40. package/dist/core/bounded-output.js +38 -0
  41. package/dist/core/change-classification.js +6 -2
  42. package/dist/core/change-verification.js +240 -6
  43. package/dist/core/check-issues.js +12 -0
  44. package/dist/core/command-contract-validation.js +20 -0
  45. package/dist/core/command-effects.js +13 -0
  46. package/dist/core/completion-verdict.js +209 -0
  47. package/dist/core/contract-lint.js +316 -7
  48. package/dist/core/dashboard-verification.js +8 -0
  49. package/dist/core/external-evidence.js +9 -0
  50. package/dist/core/public-json-contracts.js +28 -0
  51. package/dist/core/repeated-failure.js +17 -0
  52. package/dist/core/repro-evidence.js +53 -0
  53. package/dist/core/run-performance-history.js +307 -0
  54. package/dist/core/run-profile.js +87 -0
  55. package/dist/core/run-receipt.js +171 -4
  56. package/dist/core/run-write-drift.js +18 -2
  57. package/dist/core/scope-risk.js +64 -0
  58. package/dist/core/skill-route-alignment.js +110 -0
  59. package/dist/core/source-anchor-status.js +4 -1
  60. package/dist/core/test-selection.js +227 -0
  61. package/dist/core/validation-ratchet.js +52 -0
  62. package/dist/core/verification-decision-graph.js +67 -0
  63. package/dist/core/verification-evidence.js +249 -0
  64. package/dist/core/verification-scheduler.js +96 -2
  65. package/examples/README.md +12 -4
  66. package/package.json +1 -1
  67. package/schemas/README.md +18 -4
  68. package/schemas/change-verification-report.schema.json +169 -5
  69. package/schemas/commands.schema.json +51 -1
  70. package/schemas/contract-lint-report.schema.json +80 -0
  71. package/schemas/dashboard-export.schema.json +500 -0
  72. package/schemas/explain-report.schema.json +2 -0
  73. package/schemas/latest-run-pointer.schema.json +384 -0
  74. package/schemas/run-receipt.schema.json +113 -0
  75. package/schemas/test-selection.schema.json +81 -0
  76. package/schemas/verify-report.schema.json +361 -1
  77. package/schemas/verify-run-manifest.schema.json +410 -0
  78. package/templates/default/common/.mustflow/config/commands.toml +1 -1
  79. package/templates/default/i18n.toml +1 -1
  80. package/templates/default/locales/en/.mustflow/skills/INDEX.md +124 -29
  81. package/templates/default/locales/en/.mustflow/skills/routes.toml +289 -0
  82. package/templates/default/manifest.toml +29 -2
@@ -13,7 +13,8 @@
13
13
  "candidates",
14
14
  "gaps",
15
15
  "schedule",
16
- "decision_graph"
16
+ "decision_graph",
17
+ "test_selection"
17
18
  ],
18
19
  "properties": {
19
20
  "schema_version": {
@@ -28,6 +29,10 @@
28
29
  "classification_summary": {
29
30
  "$ref": "#/$defs/classificationSummary"
30
31
  },
32
+ "verification_plan_id": {
33
+ "type": "string",
34
+ "pattern": "^sha256:[0-9a-f]{64}$"
35
+ },
31
36
  "requirements": {
32
37
  "type": "array",
33
38
  "items": {
@@ -51,6 +56,9 @@
51
56
  },
52
57
  "decision_graph": {
53
58
  "$ref": "#/$defs/verificationDecisionGraph"
59
+ },
60
+ "test_selection": {
61
+ "$ref": "#/$defs/testSelectionReport"
54
62
  }
55
63
  },
56
64
  "$defs": {
@@ -249,7 +257,16 @@
249
257
  "verificationCandidate": {
250
258
  "type": "object",
251
259
  "additionalProperties": false,
252
- "required": ["reason", "intent", "status", "skipReason", "detail"],
260
+ "required": [
261
+ "reason",
262
+ "intent",
263
+ "status",
264
+ "skipReason",
265
+ "detail",
266
+ "candidateState",
267
+ "eligibilityState",
268
+ "selectionState"
269
+ ],
253
270
  "properties": {
254
271
  "reason": {
255
272
  "type": "string"
@@ -272,6 +289,15 @@
272
289
  },
273
290
  "detail": {
274
291
  "type": ["string", "null"]
292
+ },
293
+ "candidateState": {
294
+ "enum": ["candidate", "gap"]
295
+ },
296
+ "eligibilityState": {
297
+ "enum": ["eligible", "ineligible", "missing"]
298
+ },
299
+ "selectionState": {
300
+ "enum": ["selected", "not_selected", "not_applicable"]
275
301
  }
276
302
  }
277
303
  },
@@ -294,6 +320,113 @@
294
320
  }
295
321
  }
296
322
  },
323
+ "testSelectionReport": {
324
+ "type": "object",
325
+ "additionalProperties": false,
326
+ "required": [
327
+ "source",
328
+ "status",
329
+ "configPath",
330
+ "authority",
331
+ "commandAuthority",
332
+ "grantsCommandAuthority",
333
+ "matches",
334
+ "selected",
335
+ "notes"
336
+ ],
337
+ "properties": {
338
+ "source": {
339
+ "const": "test-selection.toml"
340
+ },
341
+ "status": {
342
+ "enum": ["missing", "matched", "unmatched", "invalid"]
343
+ },
344
+ "configPath": {
345
+ "const": ".mustflow/config/test-selection.toml"
346
+ },
347
+ "authority": {
348
+ "const": ".mustflow/config/test-selection.toml"
349
+ },
350
+ "commandAuthority": {
351
+ "const": ".mustflow/config/commands.toml"
352
+ },
353
+ "grantsCommandAuthority": {
354
+ "const": false
355
+ },
356
+ "matches": {
357
+ "type": "array",
358
+ "items": {
359
+ "$ref": "#/$defs/testSelectionRuleMatch"
360
+ }
361
+ },
362
+ "selected": {
363
+ "type": "array",
364
+ "items": {
365
+ "$ref": "#/$defs/testSelectionCandidate"
366
+ }
367
+ },
368
+ "notes": {
369
+ "$ref": "#/$defs/stringArray"
370
+ }
371
+ }
372
+ },
373
+ "testSelectionRuleMatch": {
374
+ "type": "object",
375
+ "additionalProperties": false,
376
+ "required": [
377
+ "ruleId",
378
+ "risk",
379
+ "reason",
380
+ "files",
381
+ "surfaces",
382
+ "intent",
383
+ "fallbackIntent",
384
+ "testTargets"
385
+ ],
386
+ "properties": {
387
+ "ruleId": { "type": "string" },
388
+ "risk": { "type": "string" },
389
+ "reason": { "type": "string" },
390
+ "files": { "$ref": "#/$defs/stringArray" },
391
+ "surfaces": { "$ref": "#/$defs/stringArray" },
392
+ "intent": { "type": "string" },
393
+ "fallbackIntent": { "type": "string" },
394
+ "testTargets": { "$ref": "#/$defs/stringArray" }
395
+ }
396
+ },
397
+ "testSelectionCandidate": {
398
+ "type": "object",
399
+ "additionalProperties": false,
400
+ "required": [
401
+ "ruleId",
402
+ "reason",
403
+ "intent",
404
+ "role",
405
+ "status",
406
+ "skipReason",
407
+ "detail",
408
+ "testTargets",
409
+ "appliedTestTargets",
410
+ "testTargetsApplied"
411
+ ],
412
+ "properties": {
413
+ "ruleId": { "type": "string" },
414
+ "reason": { "type": "string" },
415
+ "intent": { "type": "string" },
416
+ "role": { "enum": ["primary", "fallback"] },
417
+ "status": { "enum": ["runnable", "skipped"] },
418
+ "skipReason": {
419
+ "anyOf": [
420
+ { "$ref": "#/$defs/skipReason" },
421
+ { "type": "null" }
422
+ ]
423
+ },
424
+ "detail": { "type": ["string", "null"] },
425
+ "testTargets": { "$ref": "#/$defs/stringArray" },
426
+ "appliedTestTargets": { "$ref": "#/$defs/stringArray" },
427
+ "testTargetsApplied": { "type": "boolean" }
428
+ }
429
+ },
297
430
  "verificationScheduleEffect": {
298
431
  "type": "object",
299
432
  "additionalProperties": false,
@@ -312,7 +445,7 @@
312
445
  "enum": ["read", "write", "append", "replace", "delete_recreate"]
313
446
  },
314
447
  "path": {
315
- "type": "string"
448
+ "type": ["string", "null"]
316
449
  },
317
450
  "lock": {
318
451
  "type": "string"
@@ -344,7 +477,7 @@
344
477
  "verificationScheduleEntry": {
345
478
  "type": "object",
346
479
  "additionalProperties": false,
347
- "required": ["intent", "status", "effects", "locks", "conflicts"],
480
+ "required": ["intent", "status", "parallelEligible", "parallelReason", "effects", "locks", "conflicts"],
348
481
  "properties": {
349
482
  "intent": {
350
483
  "type": "string"
@@ -352,6 +485,12 @@
352
485
  "status": {
353
486
  "const": "runnable"
354
487
  },
488
+ "parallelEligible": {
489
+ "type": "boolean"
490
+ },
491
+ "parallelReason": {
492
+ "enum": ["explicit_effects", "missing_explicit_effects", "undeclared_write_drift"]
493
+ },
355
494
  "effects": {
356
495
  "type": "array",
357
496
  "items": {
@@ -497,11 +636,14 @@
497
636
  "verificationSchedule": {
498
637
  "type": "object",
499
638
  "additionalProperties": false,
500
- "required": ["runner", "batches", "entries", "notes"],
639
+ "required": ["runner", "failurePolicy", "batches", "entries", "notes"],
501
640
  "properties": {
502
641
  "runner": {
503
642
  "const": "serial_mf_run_receipts"
504
643
  },
644
+ "failurePolicy": {
645
+ "$ref": "#/$defs/verificationScheduleFailurePolicy"
646
+ },
505
647
  "batches": {
506
648
  "type": "array",
507
649
  "items": {
@@ -519,6 +661,22 @@
519
661
  }
520
662
  }
521
663
  },
664
+ "verificationScheduleFailurePolicy": {
665
+ "type": "object",
666
+ "additionalProperties": false,
667
+ "required": ["mode", "startedBatch", "nextBatch"],
668
+ "properties": {
669
+ "mode": {
670
+ "const": "batch_boundary"
671
+ },
672
+ "startedBatch": {
673
+ "const": "wait_for_completion"
674
+ },
675
+ "nextBatch": {
676
+ "const": "stop_on_failure"
677
+ }
678
+ }
679
+ },
522
680
  "verificationDecisionGraph": {
523
681
  "type": "object",
524
682
  "additionalProperties": false,
@@ -582,6 +740,12 @@
582
740
  "unknown": {
583
741
  "type": "integer"
584
742
  },
743
+ "selected": {
744
+ "type": "integer"
745
+ },
746
+ "not_selected": {
747
+ "type": "integer"
748
+ },
585
749
  "gapCount": {
586
750
  "type": "integer"
587
751
  }
@@ -60,7 +60,7 @@
60
60
  "type": "object",
61
61
  "additionalProperties": false,
62
62
  "properties": {
63
- "type": { "enum": ["path"] },
63
+ "type": { "enum": ["path", "cache", "database", "service", "port", "gpu", "resource"] },
64
64
  "paths": { "$ref": "#/$defs/stringArray" },
65
65
  "concurrency": { "enum": ["shared_reader", "exclusive_writer", "exclusive"] },
66
66
  "description": { "type": "string" }
@@ -78,6 +78,48 @@
78
78
  "concurrency": { "enum": ["shared", "exclusive"] }
79
79
  }
80
80
  },
81
+ "coverageHints": {
82
+ "type": "object",
83
+ "additionalProperties": false,
84
+ "properties": {
85
+ "reasons": { "$ref": "#/$defs/stringArray" },
86
+ "surfaces": { "$ref": "#/$defs/stringArray" },
87
+ "paths": { "$ref": "#/$defs/stringArray" },
88
+ "contracts": { "$ref": "#/$defs/stringArray" }
89
+ }
90
+ },
91
+ "selectionHints": {
92
+ "type": "object",
93
+ "additionalProperties": false,
94
+ "properties": {
95
+ "coverage_level": { "type": "string" },
96
+ "coverage_confidence": { "type": "string" },
97
+ "accepts_changed_files": { "type": "string" },
98
+ "accepts_test_targets": { "type": "boolean" },
99
+ "fallback_intents": { "$ref": "#/$defs/stringArray" },
100
+ "escalate_to": { "$ref": "#/$defs/stringArray" }
101
+ }
102
+ },
103
+ "costHints": {
104
+ "type": "object",
105
+ "additionalProperties": false,
106
+ "properties": {
107
+ "expected_seconds": { "type": "integer", "minimum": 0 },
108
+ "cold_start_seconds": { "type": "integer", "minimum": 0 },
109
+ "timeout_ratio_expectation": { "type": "number", "minimum": 0 },
110
+ "cost_tier": { "type": "string" }
111
+ }
112
+ },
113
+ "relationHints": {
114
+ "type": "object",
115
+ "additionalProperties": false,
116
+ "properties": {
117
+ "subsumes": { "$ref": "#/$defs/stringArray" },
118
+ "subsumed_by": { "$ref": "#/$defs/stringArray" },
119
+ "requires_with": { "$ref": "#/$defs/stringArray" },
120
+ "escalate_to": { "$ref": "#/$defs/stringArray" }
121
+ }
122
+ },
81
123
  "intent": {
82
124
  "type": "object",
83
125
  "additionalProperties": false,
@@ -105,6 +147,10 @@
105
147
  },
106
148
  "env_policy": { "$ref": "#/$defs/envPolicy" },
107
149
  "env_allowlist": { "$ref": "#/$defs/stringArray" },
150
+ "manual_start_hint": { "type": "string" },
151
+ "health_check_url": { "type": "string" },
152
+ "stop_instruction": { "type": "string" },
153
+ "related_oneshot_checks": { "$ref": "#/$defs/stringArray" },
108
154
  "effects": {
109
155
  "type": "array",
110
156
  "items": { "$ref": "#/$defs/effect" }
@@ -115,6 +161,10 @@
115
161
  "type": "array",
116
162
  "items": { "type": "string" }
117
163
  },
164
+ "covers": { "$ref": "#/$defs/coverageHints" },
165
+ "selection": { "$ref": "#/$defs/selectionHints" },
166
+ "cost": { "$ref": "#/$defs/costHints" },
167
+ "relations": { "$ref": "#/$defs/relationHints" },
118
168
  "reason": { "type": "string" },
119
169
  "agent_action": { "type": "string" }
120
170
  }
@@ -55,6 +55,35 @@
55
55
  "type": "array",
56
56
  "items": { "type": "string" }
57
57
  },
58
+ "suggestions": {
59
+ "type": "array",
60
+ "items": {
61
+ "type": "object",
62
+ "additionalProperties": false,
63
+ "required": [
64
+ "sourceFile",
65
+ "sourceKind",
66
+ "sourceName",
67
+ "commandHint",
68
+ "suggestedIntent",
69
+ "status",
70
+ "reason",
71
+ "snippet"
72
+ ],
73
+ "properties": {
74
+ "sourceFile": { "type": "string" },
75
+ "sourceKind": {
76
+ "enum": ["package_script", "make_target", "just_recipe"]
77
+ },
78
+ "sourceName": { "type": "string" },
79
+ "commandHint": { "type": "string" },
80
+ "suggestedIntent": { "type": "string" },
81
+ "status": { "const": "unknown" },
82
+ "reason": { "type": "string" },
83
+ "snippet": { "type": "string" }
84
+ }
85
+ }
86
+ },
58
87
  "coverage": {
59
88
  "type": "object",
60
89
  "additionalProperties": false,
@@ -82,6 +111,57 @@
82
111
  "type": "array",
83
112
  "items": { "type": "string" }
84
113
  },
114
+ "matrix": {
115
+ "type": "array",
116
+ "items": {
117
+ "type": "object",
118
+ "additionalProperties": false,
119
+ "required": ["reason", "source", "intents", "gaps", "relatedSkills", "relatedDocs"],
120
+ "properties": {
121
+ "reason": { "type": "string" },
122
+ "source": { "enum": ["classification", "documented", "required_after"] },
123
+ "intents": {
124
+ "type": "array",
125
+ "items": {
126
+ "type": "object",
127
+ "additionalProperties": false,
128
+ "required": ["intent", "status", "runnable", "detail"],
129
+ "properties": {
130
+ "intent": { "type": "string" },
131
+ "status": {
132
+ "enum": [
133
+ "ok",
134
+ "intent_not_table",
135
+ "status_not_configured",
136
+ "lifecycle_not_oneshot",
137
+ "run_policy_not_agent_allowed",
138
+ "stdin_not_closed",
139
+ "missing_timeout",
140
+ "missing_command_source",
141
+ "unsafe_intent_name",
142
+ "blocked_shell_background_pattern"
143
+ ]
144
+ },
145
+ "runnable": { "type": "boolean" },
146
+ "detail": { "type": ["string", "null"] }
147
+ }
148
+ }
149
+ },
150
+ "gaps": {
151
+ "type": "array",
152
+ "items": { "type": "string" }
153
+ },
154
+ "relatedSkills": {
155
+ "type": "array",
156
+ "items": { "type": "string" }
157
+ },
158
+ "relatedDocs": {
159
+ "type": "array",
160
+ "items": { "type": "string" }
161
+ }
162
+ }
163
+ }
164
+ },
85
165
  "findings": {
86
166
  "type": "array",
87
167
  "items": {