mustflow 2.103.16 → 2.103.20

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 (32) hide show
  1. package/README.md +2 -0
  2. package/dist/cli/commands/run/args.js +83 -0
  3. package/dist/cli/commands/run/execution.js +334 -0
  4. package/dist/cli/commands/run/preview.js +29 -0
  5. package/dist/cli/commands/run/profile.js +6 -0
  6. package/dist/cli/commands/run.js +19 -425
  7. package/dist/cli/commands/script-pack.js +1 -0
  8. package/dist/cli/commands/verify.js +15 -18
  9. package/dist/cli/i18n/en.js +27 -0
  10. package/dist/cli/i18n/es.js +27 -0
  11. package/dist/cli/i18n/fr.js +27 -0
  12. package/dist/cli/i18n/hi.js +27 -0
  13. package/dist/cli/i18n/ko.js +27 -0
  14. package/dist/cli/i18n/zh.js +27 -0
  15. package/dist/cli/lib/command-registry.js +92 -0
  16. package/dist/cli/lib/script-pack-registry.js +39 -0
  17. package/dist/cli/script-packs/code-module-boundary.js +210 -0
  18. package/dist/core/module-boundary.js +523 -0
  19. package/dist/core/public-json-contracts.js +50 -0
  20. package/dist/core/script-pack-suggestions.js +5 -0
  21. package/package.json +1 -1
  22. package/schemas/README.md +12 -0
  23. package/schemas/check-report.schema.json +52 -0
  24. package/schemas/index-report.schema.json +103 -0
  25. package/schemas/module-boundary-report.schema.json +210 -0
  26. package/schemas/search-report.schema.json +102 -0
  27. package/schemas/status-report.schema.json +50 -0
  28. package/templates/default/i18n.toml +3 -3
  29. package/templates/default/locales/en/.mustflow/skills/database-migration-change/SKILL.md +16 -2
  30. package/templates/default/locales/en/.mustflow/skills/module-boundary-review/SKILL.md +12 -1
  31. package/templates/default/locales/en/.mustflow/skills/payment-integrity-review/SKILL.md +17 -10
  32. package/templates/default/manifest.toml +1 -1
@@ -0,0 +1,52 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://mustflow.github.io/schemas/check-report.schema.json",
4
+ "title": "mustflow check report",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "ok",
9
+ "strict",
10
+ "issueCount",
11
+ "issues",
12
+ "warningCount",
13
+ "warnings",
14
+ "issueDetails"
15
+ ],
16
+ "properties": {
17
+ "ok": { "type": "boolean" },
18
+ "strict": { "type": "boolean" },
19
+ "issueCount": { "type": "integer", "minimum": 0 },
20
+ "issues": {
21
+ "type": "array",
22
+ "items": { "type": "string" }
23
+ },
24
+ "warningCount": { "type": "integer", "minimum": 0 },
25
+ "warnings": {
26
+ "type": "array",
27
+ "items": { "type": "string" }
28
+ },
29
+ "issueDetails": {
30
+ "type": "array",
31
+ "items": { "$ref": "#/$defs/issueDetail" }
32
+ }
33
+ },
34
+ "$defs": {
35
+ "issueDetail": {
36
+ "type": "object",
37
+ "additionalProperties": false,
38
+ "required": ["id", "severity", "mode", "message"],
39
+ "properties": {
40
+ "id": {
41
+ "anyOf": [
42
+ { "type": "string" },
43
+ { "type": "null" }
44
+ ]
45
+ },
46
+ "severity": { "enum": ["error", "warning"] },
47
+ "mode": { "enum": ["base", "strict"] },
48
+ "message": { "type": "string" }
49
+ }
50
+ }
51
+ }
52
+ }
@@ -0,0 +1,103 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://mustflow.github.io/schemas/index-report.schema.json",
4
+ "title": "mustflow local index report",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "schema_version",
9
+ "command",
10
+ "ok",
11
+ "mustflow_root",
12
+ "database_path",
13
+ "dry_run",
14
+ "wrote_files",
15
+ "index_mode",
16
+ "reused_existing",
17
+ "rebuild_reason",
18
+ "document_count",
19
+ "skill_count",
20
+ "skill_route_count",
21
+ "command_intent_count",
22
+ "command_effect_count",
23
+ "verification_evidence_summary_count",
24
+ "verification_plan_count",
25
+ "acceptance_criteria_count",
26
+ "criterion_coverage_count",
27
+ "verification_receipt_summary_count",
28
+ "command_receipt_summary_count",
29
+ "verification_coverage_state_count",
30
+ "verification_risk_signal_count",
31
+ "validation_ratchet_signal_count",
32
+ "completion_verdict_summary_count",
33
+ "repro_route_count",
34
+ "repro_observation_count",
35
+ "failure_fingerprint_count",
36
+ "source_index_enabled",
37
+ "source_anchor_count",
38
+ "source_anchor_risk_signal_count",
39
+ "search_backend",
40
+ "search_fts5_available",
41
+ "content_mode",
42
+ "store_full_content",
43
+ "max_snippet_bytes_per_document",
44
+ "excluded_raw_data_kinds",
45
+ "indexed_file_count",
46
+ "indexed_paths"
47
+ ],
48
+ "properties": {
49
+ "schema_version": { "type": "string", "pattern": "^[0-9]+$" },
50
+ "command": { "const": "index" },
51
+ "ok": { "type": "boolean" },
52
+ "mustflow_root": { "type": "string" },
53
+ "database_path": { "type": "string" },
54
+ "dry_run": { "type": "boolean" },
55
+ "wrote_files": { "type": "boolean" },
56
+ "index_mode": { "enum": ["full", "incremental"] },
57
+ "reused_existing": { "type": "boolean" },
58
+ "rebuild_reason": {
59
+ "anyOf": [
60
+ { "type": "string" },
61
+ { "type": "null" }
62
+ ]
63
+ },
64
+ "document_count": { "$ref": "#/$defs/count" },
65
+ "skill_count": { "$ref": "#/$defs/count" },
66
+ "skill_route_count": { "$ref": "#/$defs/count" },
67
+ "command_intent_count": { "$ref": "#/$defs/count" },
68
+ "command_effect_count": { "$ref": "#/$defs/count" },
69
+ "verification_evidence_summary_count": { "$ref": "#/$defs/count" },
70
+ "verification_plan_count": { "$ref": "#/$defs/count" },
71
+ "acceptance_criteria_count": { "$ref": "#/$defs/count" },
72
+ "criterion_coverage_count": { "$ref": "#/$defs/count" },
73
+ "verification_receipt_summary_count": { "$ref": "#/$defs/count" },
74
+ "command_receipt_summary_count": { "$ref": "#/$defs/count" },
75
+ "verification_coverage_state_count": { "$ref": "#/$defs/count" },
76
+ "verification_risk_signal_count": { "$ref": "#/$defs/count" },
77
+ "validation_ratchet_signal_count": { "$ref": "#/$defs/count" },
78
+ "completion_verdict_summary_count": { "$ref": "#/$defs/count" },
79
+ "repro_route_count": { "$ref": "#/$defs/count" },
80
+ "repro_observation_count": { "$ref": "#/$defs/count" },
81
+ "failure_fingerprint_count": { "$ref": "#/$defs/count" },
82
+ "source_index_enabled": { "type": "boolean" },
83
+ "source_anchor_count": { "$ref": "#/$defs/count" },
84
+ "source_anchor_risk_signal_count": { "$ref": "#/$defs/count" },
85
+ "search_backend": { "enum": ["fts5", "table_scan"] },
86
+ "search_fts5_available": { "type": "boolean" },
87
+ "content_mode": { "const": "metadata_and_snippets" },
88
+ "store_full_content": { "const": false },
89
+ "max_snippet_bytes_per_document": { "type": "integer", "minimum": 0 },
90
+ "excluded_raw_data_kinds": {
91
+ "type": "array",
92
+ "items": { "type": "string" }
93
+ },
94
+ "indexed_file_count": { "$ref": "#/$defs/count" },
95
+ "indexed_paths": {
96
+ "type": "array",
97
+ "items": { "type": "string" }
98
+ }
99
+ },
100
+ "$defs": {
101
+ "count": { "type": "integer", "minimum": 0 }
102
+ }
103
+ }
@@ -0,0 +1,210 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://mustflow.github.io/schemas/module-boundary-report.schema.json",
4
+ "title": "mustflow module-boundary report",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "schema_version",
9
+ "command",
10
+ "pack_id",
11
+ "script_id",
12
+ "script_ref",
13
+ "action",
14
+ "status",
15
+ "ok",
16
+ "mustflow_root",
17
+ "policy",
18
+ "input_hash",
19
+ "config",
20
+ "targets",
21
+ "graph",
22
+ "rules",
23
+ "cycles",
24
+ "shared_metrics",
25
+ "truncated",
26
+ "findings",
27
+ "issues"
28
+ ],
29
+ "properties": {
30
+ "schema_version": { "const": "1" },
31
+ "command": { "const": "script-pack" },
32
+ "pack_id": { "const": "code" },
33
+ "script_id": { "const": "module-boundary" },
34
+ "script_ref": { "const": "code/module-boundary" },
35
+ "action": { "const": "check" },
36
+ "status": { "enum": ["passed", "failed", "error"] },
37
+ "ok": { "type": "boolean" },
38
+ "mustflow_root": { "type": "string" },
39
+ "policy": { "$ref": "#/$defs/policy" },
40
+ "input_hash": { "$ref": "#/$defs/sha256" },
41
+ "config": { "$ref": "#/$defs/config" },
42
+ "targets": { "type": "array", "items": { "$ref": "#/$defs/target" } },
43
+ "graph": { "$ref": "#/$defs/graph" },
44
+ "rules": { "type": "array", "items": { "$ref": "#/$defs/rule" } },
45
+ "cycles": { "type": "array", "items": { "$ref": "#/$defs/cycle" } },
46
+ "shared_metrics": { "type": "array", "items": { "$ref": "#/$defs/sharedMetric" } },
47
+ "truncated": { "type": "boolean" },
48
+ "findings": { "type": "array", "items": { "$ref": "#/$defs/finding" } },
49
+ "issues": { "type": "array", "items": { "type": "string" } }
50
+ },
51
+ "$defs": {
52
+ "sha256": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
53
+ "stringArray": { "type": "array", "items": { "type": "string" } },
54
+ "language": {
55
+ "enum": [
56
+ "typescript",
57
+ "tsx",
58
+ "javascript",
59
+ "jsx",
60
+ "javascript-module",
61
+ "javascript-commonjs",
62
+ "json",
63
+ "other"
64
+ ]
65
+ },
66
+ "targetKind": { "enum": ["file", "directory", "missing", "other", "unknown"] },
67
+ "edgeKind": { "enum": ["static_import", "static_export", "dynamic_import", "require"] },
68
+ "configStatus": { "enum": ["found", "missing", "invalid"] },
69
+ "ruleKind": {
70
+ "enum": ["layer_deny", "public_entrypoint", "feature_direct_import", "shared_budget", "import_cycle"]
71
+ },
72
+ "policy": {
73
+ "type": "object",
74
+ "additionalProperties": false,
75
+ "required": [
76
+ "max_file_bytes",
77
+ "max_files",
78
+ "max_depth",
79
+ "max_nodes",
80
+ "max_edges",
81
+ "extensions",
82
+ "ignored_directories",
83
+ "config_path",
84
+ "max_cycles",
85
+ "max_shared_files"
86
+ ],
87
+ "properties": {
88
+ "max_file_bytes": { "type": "integer", "minimum": 1 },
89
+ "max_files": { "type": "integer", "minimum": 1 },
90
+ "max_depth": { "type": "integer", "minimum": 1 },
91
+ "max_nodes": { "type": "integer", "minimum": 1 },
92
+ "max_edges": { "type": "integer", "minimum": 1 },
93
+ "extensions": { "$ref": "#/$defs/stringArray" },
94
+ "ignored_directories": { "$ref": "#/$defs/stringArray" },
95
+ "config_path": { "type": "string" },
96
+ "max_cycles": { "type": "integer", "minimum": 1 },
97
+ "max_shared_files": { "type": "integer", "minimum": 1 }
98
+ }
99
+ },
100
+ "config": {
101
+ "type": "object",
102
+ "additionalProperties": false,
103
+ "required": [
104
+ "path",
105
+ "status",
106
+ "layer_rule_count",
107
+ "public_entrypoint_rule_count",
108
+ "feature_group_rule_count",
109
+ "shared_budget_rule_count"
110
+ ],
111
+ "properties": {
112
+ "path": { "type": "string" },
113
+ "status": { "$ref": "#/$defs/configStatus" },
114
+ "layer_rule_count": { "type": "integer", "minimum": 0 },
115
+ "public_entrypoint_rule_count": { "type": "integer", "minimum": 0 },
116
+ "feature_group_rule_count": { "type": "integer", "minimum": 0 },
117
+ "shared_budget_rule_count": { "type": "integer", "minimum": 0 }
118
+ }
119
+ },
120
+ "target": {
121
+ "type": "object",
122
+ "additionalProperties": false,
123
+ "required": ["input", "path", "exists", "kind", "language"],
124
+ "properties": {
125
+ "input": { "type": "string" },
126
+ "path": { "type": "string" },
127
+ "exists": { "type": ["boolean", "null"] },
128
+ "kind": { "$ref": "#/$defs/targetKind" },
129
+ "language": { "$ref": "#/$defs/language" }
130
+ }
131
+ },
132
+ "graph": {
133
+ "type": "object",
134
+ "additionalProperties": false,
135
+ "required": ["script_ref", "status", "node_count", "edge_count", "cycle_hint_count", "truncated"],
136
+ "properties": {
137
+ "script_ref": { "const": "code/dependency-graph" },
138
+ "status": { "enum": ["passed", "failed", "error"] },
139
+ "node_count": { "type": "integer", "minimum": 0 },
140
+ "edge_count": { "type": "integer", "minimum": 0 },
141
+ "cycle_hint_count": { "type": "integer", "minimum": 0 },
142
+ "truncated": { "type": "boolean" }
143
+ }
144
+ },
145
+ "rule": {
146
+ "type": "object",
147
+ "additionalProperties": false,
148
+ "required": ["rule_id", "kind", "finding_count"],
149
+ "properties": {
150
+ "rule_id": { "type": "string" },
151
+ "kind": { "$ref": "#/$defs/ruleKind" },
152
+ "finding_count": { "type": "integer", "minimum": 0 }
153
+ }
154
+ },
155
+ "cycle": {
156
+ "type": "object",
157
+ "additionalProperties": false,
158
+ "required": ["cycle_id", "path_count", "paths"],
159
+ "properties": {
160
+ "cycle_id": { "type": "string", "pattern": "^cycle:[a-f0-9]{12}$" },
161
+ "path_count": { "type": "integer", "minimum": 0 },
162
+ "paths": { "$ref": "#/$defs/stringArray" }
163
+ }
164
+ },
165
+ "sharedMetric": {
166
+ "type": "object",
167
+ "additionalProperties": false,
168
+ "required": ["rule_id", "path", "file_count", "export_count", "max_files", "max_exports"],
169
+ "properties": {
170
+ "rule_id": { "type": "string" },
171
+ "path": { "type": "string" },
172
+ "file_count": { "type": "integer", "minimum": 0 },
173
+ "export_count": { "type": "integer", "minimum": 0 },
174
+ "max_files": { "type": ["integer", "null"], "minimum": 0 },
175
+ "max_exports": { "type": ["integer", "null"], "minimum": 0 }
176
+ }
177
+ },
178
+ "finding": {
179
+ "type": "object",
180
+ "additionalProperties": false,
181
+ "required": ["code", "severity", "message", "path"],
182
+ "properties": {
183
+ "code": {
184
+ "enum": [
185
+ "dependency_graph_path_outside_root",
186
+ "dependency_graph_unreadable_path",
187
+ "dependency_graph_max_files_exceeded",
188
+ "dependency_graph_max_nodes_exceeded",
189
+ "dependency_graph_max_edges_exceeded",
190
+ "module_boundary_config_missing",
191
+ "module_boundary_invalid_config",
192
+ "module_boundary_forbidden_import",
193
+ "module_boundary_public_entry_violation",
194
+ "module_boundary_feature_direct_import",
195
+ "module_boundary_shared_budget_exceeded",
196
+ "module_boundary_import_cycle_detected"
197
+ ]
198
+ },
199
+ "severity": { "enum": ["low", "medium", "high", "critical"] },
200
+ "message": { "type": "string" },
201
+ "path": { "type": "string" },
202
+ "rule_id": { "type": "string" },
203
+ "source_path": { "type": "string" },
204
+ "target_path": { "type": "string" },
205
+ "line": { "type": "integer", "minimum": 1 },
206
+ "cycle_id": { "type": "string", "pattern": "^cycle:[a-f0-9]{12}$" }
207
+ }
208
+ }
209
+ }
210
+ }
@@ -0,0 +1,102 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://mustflow.github.io/schemas/search-report.schema.json",
4
+ "title": "mustflow local search report",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "schema_version",
9
+ "command",
10
+ "ok",
11
+ "mustflow_root",
12
+ "database_path",
13
+ "query",
14
+ "limit",
15
+ "scope",
16
+ "index_fresh",
17
+ "stale_paths",
18
+ "search_backend",
19
+ "search_fts5_available",
20
+ "result_count",
21
+ "results"
22
+ ],
23
+ "properties": {
24
+ "schema_version": { "type": "string", "pattern": "^[0-9]+$" },
25
+ "command": { "const": "search" },
26
+ "ok": { "type": "boolean" },
27
+ "mustflow_root": { "type": "string" },
28
+ "database_path": { "type": "string" },
29
+ "query": { "type": "string" },
30
+ "limit": { "type": "integer", "minimum": 1, "maximum": 50 },
31
+ "scope": { "enum": ["workflow", "source", "all"] },
32
+ "index_fresh": { "type": "boolean" },
33
+ "stale_paths": {
34
+ "type": "array",
35
+ "items": { "type": "string" }
36
+ },
37
+ "search_backend": { "enum": ["fts5", "table_scan"] },
38
+ "search_fts5_available": { "type": "boolean" },
39
+ "result_count": { "type": "integer", "minimum": 0 },
40
+ "results": {
41
+ "type": "array",
42
+ "items": { "$ref": "#/$defs/searchItem" }
43
+ }
44
+ },
45
+ "$defs": {
46
+ "searchItem": {
47
+ "type": "object",
48
+ "additionalProperties": false,
49
+ "required": [
50
+ "kind",
51
+ "cache_layer",
52
+ "volatile",
53
+ "authority_rank",
54
+ "authority_label",
55
+ "source_scope",
56
+ "navigation_only",
57
+ "can_instruct_agent",
58
+ "match",
59
+ "score"
60
+ ],
61
+ "properties": {
62
+ "kind": { "enum": ["document", "skill", "skill_route", "command_intent", "source_anchor"] },
63
+ "path": { "type": "string" },
64
+ "name": { "type": "string" },
65
+ "title": { "type": "string" },
66
+ "document_type": { "type": "string" },
67
+ "anchor_id": { "type": "string" },
68
+ "line_start": { "type": "integer", "minimum": 1 },
69
+ "risk": { "type": "string" },
70
+ "cache_layer": { "enum": ["stable", "task", "volatile"] },
71
+ "volatile": { "type": "boolean" },
72
+ "authority_rank": { "type": "integer", "minimum": 0 },
73
+ "authority_label": { "type": "string" },
74
+ "source_scope": { "enum": ["workflow", "source"] },
75
+ "navigation_only": { "type": "boolean" },
76
+ "can_instruct_agent": { "type": "boolean" },
77
+ "stale_status": { "type": "string" },
78
+ "stale_confidence": { "type": "number" },
79
+ "effect_locks": {
80
+ "type": "array",
81
+ "items": { "type": "string" }
82
+ },
83
+ "effect_paths": {
84
+ "type": "array",
85
+ "items": { "type": "string" }
86
+ },
87
+ "effect_modes": {
88
+ "type": "array",
89
+ "items": { "type": "string" }
90
+ },
91
+ "route_trigger": { "type": "string" },
92
+ "route_risk": { "type": "string" },
93
+ "verification_intents": {
94
+ "type": "array",
95
+ "items": { "type": "string" }
96
+ },
97
+ "match": { "type": "string" },
98
+ "score": { "type": "number" }
99
+ }
100
+ }
101
+ }
102
+ }
@@ -0,0 +1,50 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://mustflow.github.io/schemas/status-report.schema.json",
4
+ "title": "mustflow status report",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "installed",
9
+ "manifestLock",
10
+ "trackedFiles",
11
+ "changedFiles",
12
+ "missingFiles",
13
+ "issues",
14
+ "template"
15
+ ],
16
+ "properties": {
17
+ "installed": { "type": "boolean" },
18
+ "manifestLock": { "enum": ["missing", "invalid", "present"] },
19
+ "trackedFiles": { "type": "integer", "minimum": 0 },
20
+ "changedFiles": {
21
+ "type": "array",
22
+ "items": { "type": "string" }
23
+ },
24
+ "missingFiles": {
25
+ "type": "array",
26
+ "items": { "type": "string" }
27
+ },
28
+ "issues": {
29
+ "type": "array",
30
+ "items": { "type": "string" }
31
+ },
32
+ "template": {
33
+ "anyOf": [
34
+ { "$ref": "#/$defs/template" },
35
+ { "type": "null" }
36
+ ]
37
+ }
38
+ },
39
+ "$defs": {
40
+ "template": {
41
+ "type": "object",
42
+ "additionalProperties": false,
43
+ "required": ["id", "version"],
44
+ "properties": {
45
+ "id": { "type": "string" },
46
+ "version": { "type": "string" }
47
+ }
48
+ }
49
+ }
50
+ }
@@ -128,7 +128,7 @@ translations = {}
128
128
  [documents."skill.module-boundary-review"]
129
129
  source = "locales/en/.mustflow/skills/module-boundary-review/SKILL.md"
130
130
  source_locale = "en"
131
- revision = 1
131
+ revision = 2
132
132
  translations = {}
133
133
 
134
134
  [documents."skill.change-blast-radius-review"]
@@ -146,7 +146,7 @@ translations = {}
146
146
  [documents."skill.payment-integrity-review"]
147
147
  source = "locales/en/.mustflow/skills/payment-integrity-review/SKILL.md"
148
148
  source_locale = "en"
149
- revision = 2
149
+ revision = 3
150
150
  translations = {}
151
151
 
152
152
  [documents."skill.credit-ledger-integrity-review"]
@@ -446,7 +446,7 @@ translations = {}
446
446
  [documents."skill.database-migration-change"]
447
447
  source = "locales/en/.mustflow/skills/database-migration-change/SKILL.md"
448
448
  source_locale = "en"
449
- revision = 2
449
+ revision = 3
450
450
  translations = {}
451
451
 
452
452
  [documents."skill.database-query-bottleneck-review"]
@@ -2,11 +2,11 @@
2
2
  mustflow_doc: skill.database-migration-change
3
3
  locale: en
4
4
  canonical: true
5
- revision: 2
5
+ revision: 3
6
6
  lifecycle: mustflow-owned
7
7
  authority: procedure
8
8
  name: database-migration-change
9
- description: Apply this skill when database migration files, schema migration history, ORM schema migrations, generated clients, schema dumps, SQL snapshots, online DDL, large indexes, constraints, backfills, rolling deploy compatibility, expand-and-contract changes, destructive database changes, migration rollback or roll-forward claims, cut-over plans, lock or timeout policy, replication lag risk, migration observability, or production database migration procedures are created, changed, reviewed, or reported.
9
+ description: Apply this skill when database migration files, schema migration history, ORM schema migrations, generated clients, schema dumps, SQL snapshots, online DDL, large indexes, constraints, state-dependent CHECK constraints, backfills, rolling deploy compatibility, expand-and-contract changes, destructive database changes, migration rollback or roll-forward claims, cut-over plans, lock or timeout policy, replication lag risk, migration observability, or production database migration procedures are created, changed, reviewed, or reported.
10
10
  metadata:
11
11
  mustflow_schema: "1"
12
12
  mustflow_kind: procedure
@@ -58,6 +58,9 @@ Migration incidents usually happen in the interval where old code, new code, old
58
58
  - Deployment shape: single-step deploy, rolling deploy, blue-green, multiple app versions, background workers, read replicas, multiple services, serverless functions, mobile clients, or external integrations.
59
59
  - Database engine and operational surface: PostgreSQL, MySQL, SQLite, SQL Server, managed database, migration lock behavior, DDL transaction behavior, online DDL options, table size, write load, long-running transactions, replication or CDC topology, expected lock time, statement timeout, lock timeout, and restore capability when known.
60
60
  - Data preservation needs, compatibility window, backfill size, batch strategy, cursor or checkpoint marker, validation query, observability query, rollback or roll-forward type, cut-over control, and whether old code can run after the new schema lands.
61
+ - State and timestamp invariant matrix when a migration introduces lifecycle statuses, terminal
62
+ timestamps, retry or dead-letter states, delivery states, soft-delete states, approval states, or
63
+ other columns whose valid nullability depends on status.
61
64
  - Relevant command-intent entries for build, generated-output checks, tests, docs, release, and mustflow validation.
62
65
 
63
66
  <!-- mustflow-section: preconditions -->
@@ -114,6 +117,14 @@ Migration incidents usually happen in the interval where old code, new code, old
114
117
  11. For constraints and foreign keys, use staged validation when the database supports it.
115
118
  - PostgreSQL `NOT VALID` constraints and later `VALIDATE CONSTRAINT` can avoid validating old rows during the first lock-sensitive change while still protecting new writes.
116
119
  - Foreign keys on large or hot tables need separate add, repair/backfill, validate, and fallback planning rather than one heroic migration.
120
+ - CHECK constraints must reject impossible domain states, not only prove column types. For
121
+ lifecycle tables, build a status matrix before writing the constraint: each status should name
122
+ which timestamps or reason fields are required, forbidden, or still pending. For example,
123
+ a delivered row should not also have a dead-letter timestamp, and a dead-lettered row should
124
+ not also look delivered unless the domain explicitly has a separate correction state.
125
+ - When existing rows may already violate the new matrix, split the change into repair, add
126
+ unvalidated constraint where supported, validate, and then rely on the constraint as the last
127
+ gate. Do not let application comments or happy-path tests stand in for the database invariant.
117
128
  12. For indexes, check table size, write load, lock behavior, concurrent or online index support, uniqueness validation, existing duplicates, and whether generated ORM queries will use the index.
118
129
  - PostgreSQL `CREATE INDEX CONCURRENTLY` avoids blocking ordinary writes but still scans more than once, waits for old transactions, consumes I/O, and cannot run inside a transaction block.
119
130
  - MySQL online DDL and `ALGORITHM=INSTANT` have version, row-format, index, row-size, and operation limits; specify `ALGORITHM=INSTANT` or `LOCK=NONE` only when unsupported fallback should fail instead of silently rebuilding a table.
@@ -170,6 +181,8 @@ Migration incidents usually happen in the interval where old code, new code, old
170
181
  - Expand, backfill, switch, and contract phases are separated or explicitly proven unnecessary.
171
182
  - Old-code/new-schema and new-code/expanded-schema compatibility is classified.
172
183
  - Backfill and validation behavior is cursor-based or otherwise bounded, restartable, idempotent, observable, and checkable where relevant.
184
+ - State-dependent CHECK constraints, terminal timestamp exclusivity, and valid nullability matrices
185
+ are explicit where status columns can otherwise contradict timestamp or reason columns.
173
186
  - Lock levels, online DDL support, long-running transaction waits, replication lag, cut-over control, timeout policy, and observability queries are explicit where production data may be affected.
174
187
  - Rollback claims distinguish schema rollback, data rollback, app rollback, roll-forward, forward-fix, and restore-required cases.
175
188
  - Destructive changes and production lock risks are either deferred, measured, guarded, or reported as remaining risk.
@@ -212,6 +225,7 @@ Prefer configured migration dry-run, generated-output, schema-diff, or database
212
225
  - Old-code/new-schema and new-code/expanded-schema compatibility
213
226
  - Expand/backfill/switch/contract plan and destructive cleanup timing
214
227
  - Backfill cursor, idempotency, throttle, pause/resume, validation, lock, timeout, replication, cut-over, and observability classification
228
+ - Status, timestamp, CHECK constraint, and existing-row validation matrix where relevant
215
229
  - Rollback, app rollback, roll-forward, forward-fix, and restore-required classification
216
230
  - ORM/generated client/schema dump/snapshot surfaces synchronized
217
231
  - Dependent surfaces checked
@@ -2,7 +2,7 @@
2
2
  mustflow_doc: skill.module-boundary-review
3
3
  locale: en
4
4
  canonical: true
5
- revision: 1
5
+ revision: 2
6
6
  lifecycle: mustflow-owned
7
7
  authority: procedure
8
8
  name: module-boundary-review
@@ -76,6 +76,9 @@ who must change, who owns the data, who owns the failure, and who should not nee
76
76
  history showing files that usually move together.
77
77
  - Module graph evidence: imports, exports, public APIs, call sites, dependency direction, cycles,
78
78
  shared helpers, DTO flow, and configuration reads.
79
+ - Configured guardrail evidence when available: `code/module-boundary` results for
80
+ `.mustflow/config/module-boundaries.toml` layer deny rules, public entrypoints, feature imports,
81
+ shared budgets, and import cycles.
79
82
  - Ownership evidence: source of truth for data, owner of policy decisions, owner of failure handling,
80
83
  owner of cache invalidation, owner of time and config interpretation, and owner of authorization.
81
84
  - Test evidence: number and kind of mocks, pure-domain tests, integration tests, worker or batch
@@ -131,6 +134,9 @@ who must change, who owns the data, who owns the failure, and who should not nee
131
134
  - If A imports B and B imports A, identify the missing concept, ownership decision, event, port, or
132
135
  data-flow direction.
133
136
  - Do not accept "they need each other" without naming the invariant that forces the cycle.
137
+ - When the repository declares `.mustflow/config/module-boundaries.toml`, use the read-only
138
+ `code/module-boundary` script-pack report as executable evidence before relying on prose-only
139
+ boundary claims.
134
140
  5. Trace DTO infection.
135
141
  - API response DTOs, request DTOs, ORM rows, provider payloads, and UI view models should not
136
142
  become domain, repository, batch, worker, or event models by default.
@@ -250,6 +256,11 @@ Prefer the narrowest configured test, build, docs, release, or mustflow intent t
250
256
  module boundary. Use release or docs checks when templates, public docs, package metadata, public APIs,
251
257
  schemas, generated clients, or install surfaces change.
252
258
 
259
+ When the command contract and script-pack metadata expose it, `code/module-boundary` may provide
260
+ read-only evidence for configured import-boundary rules. A missing module-boundary config is
261
+ non-blocking evidence that no executable boundary rules were enforced, not proof that the module
262
+ design is clean.
263
+
253
264
  <!-- mustflow-section: failure-handling -->
254
265
  ## Failure Handling
255
266