mustflow 1.18.0 → 1.18.14
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/README.md +16 -6
- package/dist/cli/commands/context.js +2 -2
- package/dist/cli/commands/dashboard.js +61 -7
- package/dist/cli/commands/explain.js +47 -7
- package/dist/cli/commands/index.js +9 -2
- package/dist/cli/commands/run.js +7 -15
- package/dist/cli/commands/verify.js +44 -9
- package/dist/cli/i18n/en.js +3 -0
- package/dist/cli/i18n/es.js +3 -0
- package/dist/cli/i18n/fr.js +3 -0
- package/dist/cli/i18n/hi.js +3 -0
- package/dist/cli/i18n/ko.js +3 -0
- package/dist/cli/i18n/zh.js +3 -0
- package/dist/cli/lib/agent-context.js +19 -4
- package/dist/cli/lib/dashboard-html.js +41 -0
- package/dist/cli/lib/dashboard-locale.js +2 -0
- package/dist/cli/lib/local-index.js +910 -32
- package/dist/core/change-classification.js +33 -60
- package/dist/core/command-classification.js +0 -2
- package/dist/core/source-anchor-status.js +4 -4
- package/dist/core/source-anchor-validation.js +2 -6
- package/dist/core/source-anchors.js +81 -3
- package/package.json +1 -1
- package/schemas/change-verification-report.schema.json +194 -0
- package/schemas/context-report.schema.json +30 -2
- package/schemas/explain-report.schema.json +191 -0
- package/templates/default/i18n.toml +16 -6
- package/templates/default/locales/en/.mustflow/skills/INDEX.md +2 -1
- package/templates/default/locales/en/.mustflow/skills/database-change-safety/SKILL.md +155 -0
- package/templates/default/locales/en/AGENTS.md +5 -5
- package/templates/default/locales/es/.mustflow/skills/INDEX.md +2 -1
- package/templates/default/locales/es/.mustflow/skills/database-change-safety/SKILL.md +155 -0
- package/templates/default/locales/fr/.mustflow/skills/INDEX.md +2 -1
- package/templates/default/locales/fr/.mustflow/skills/database-change-safety/SKILL.md +155 -0
- package/templates/default/locales/hi/.mustflow/skills/INDEX.md +2 -1
- package/templates/default/locales/hi/.mustflow/skills/database-change-safety/SKILL.md +155 -0
- package/templates/default/locales/ko/.mustflow/skills/INDEX.md +2 -1
- package/templates/default/locales/ko/.mustflow/skills/database-change-safety/SKILL.md +155 -0
- package/templates/default/locales/zh/.mustflow/skills/INDEX.md +2 -1
- package/templates/default/locales/zh/.mustflow/skills/database-change-safety/SKILL.md +155 -0
- package/templates/default/manifest.toml +7 -1
|
@@ -111,6 +111,94 @@
|
|
|
111
111
|
"type": "array",
|
|
112
112
|
"items": { "type": "string" }
|
|
113
113
|
},
|
|
114
|
+
"readModel": {
|
|
115
|
+
"$ref": "#/$defs/localPathSurfaceReadModel"
|
|
116
|
+
},
|
|
117
|
+
"surface": {
|
|
118
|
+
"type": "object",
|
|
119
|
+
"additionalProperties": false,
|
|
120
|
+
"required": [
|
|
121
|
+
"kind",
|
|
122
|
+
"category",
|
|
123
|
+
"isPublicSurface",
|
|
124
|
+
"validationReasons",
|
|
125
|
+
"affectedContracts",
|
|
126
|
+
"updatePolicy",
|
|
127
|
+
"driftChecks"
|
|
128
|
+
],
|
|
129
|
+
"properties": {
|
|
130
|
+
"kind": { "type": "string" },
|
|
131
|
+
"category": { "type": "string" },
|
|
132
|
+
"isPublicSurface": { "type": "boolean" },
|
|
133
|
+
"validationReasons": {
|
|
134
|
+
"type": "array",
|
|
135
|
+
"items": { "type": "string" }
|
|
136
|
+
},
|
|
137
|
+
"affectedContracts": {
|
|
138
|
+
"type": "array",
|
|
139
|
+
"items": { "type": "string" }
|
|
140
|
+
},
|
|
141
|
+
"updatePolicy": { "enum": ["update", "update_or_mark_stale", "not_applicable"] },
|
|
142
|
+
"driftChecks": {
|
|
143
|
+
"type": "array",
|
|
144
|
+
"items": { "type": "string" }
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
"localPathSurfaceReadModel": {
|
|
151
|
+
"type": "object",
|
|
152
|
+
"additionalProperties": false,
|
|
153
|
+
"required": [
|
|
154
|
+
"source",
|
|
155
|
+
"status",
|
|
156
|
+
"databasePath",
|
|
157
|
+
"indexFresh",
|
|
158
|
+
"stalePaths",
|
|
159
|
+
"inputPath",
|
|
160
|
+
"match",
|
|
161
|
+
"refreshHint"
|
|
162
|
+
],
|
|
163
|
+
"properties": {
|
|
164
|
+
"source": { "const": "local_index" },
|
|
165
|
+
"status": { "enum": ["fresh", "missing", "stale", "unreadable"] },
|
|
166
|
+
"databasePath": { "type": "string" },
|
|
167
|
+
"indexFresh": { "type": "boolean" },
|
|
168
|
+
"stalePaths": {
|
|
169
|
+
"type": "array",
|
|
170
|
+
"items": { "type": "string" }
|
|
171
|
+
},
|
|
172
|
+
"inputPath": { "type": ["string", "null"] },
|
|
173
|
+
"match": {
|
|
174
|
+
"anyOf": [
|
|
175
|
+
{ "type": "null" },
|
|
176
|
+
{ "$ref": "#/$defs/localPathSurfaceRuleMatch" }
|
|
177
|
+
]
|
|
178
|
+
},
|
|
179
|
+
"refreshHint": { "type": ["string", "null"] }
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
"localPathSurfaceRuleMatch": {
|
|
183
|
+
"type": "object",
|
|
184
|
+
"additionalProperties": false,
|
|
185
|
+
"required": [
|
|
186
|
+
"ruleId",
|
|
187
|
+
"patternKind",
|
|
188
|
+
"pattern",
|
|
189
|
+
"patternFlags",
|
|
190
|
+
"changeKinds",
|
|
191
|
+
"surface"
|
|
192
|
+
],
|
|
193
|
+
"properties": {
|
|
194
|
+
"ruleId": { "type": "string" },
|
|
195
|
+
"patternKind": { "type": "string" },
|
|
196
|
+
"pattern": { "type": "string" },
|
|
197
|
+
"patternFlags": { "type": "string" },
|
|
198
|
+
"changeKinds": {
|
|
199
|
+
"type": "array",
|
|
200
|
+
"items": { "type": "string" }
|
|
201
|
+
},
|
|
114
202
|
"surface": {
|
|
115
203
|
"type": "object",
|
|
116
204
|
"additionalProperties": false,
|
|
@@ -263,6 +351,109 @@
|
|
|
263
351
|
"items": { "type": "string" }
|
|
264
352
|
}
|
|
265
353
|
}
|
|
354
|
+
},
|
|
355
|
+
"effectGraph": {
|
|
356
|
+
"$ref": "#/$defs/commandEffectGraph"
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
},
|
|
360
|
+
"commandEffectGraph": {
|
|
361
|
+
"type": "object",
|
|
362
|
+
"additionalProperties": false,
|
|
363
|
+
"required": [
|
|
364
|
+
"source",
|
|
365
|
+
"status",
|
|
366
|
+
"databasePath",
|
|
367
|
+
"indexFresh",
|
|
368
|
+
"stalePaths",
|
|
369
|
+
"writeLocks",
|
|
370
|
+
"lockConflicts",
|
|
371
|
+
"refreshHint"
|
|
372
|
+
],
|
|
373
|
+
"properties": {
|
|
374
|
+
"source": { "const": "local_index" },
|
|
375
|
+
"status": { "enum": ["fresh", "missing", "stale", "unreadable"] },
|
|
376
|
+
"databasePath": { "type": "string" },
|
|
377
|
+
"indexFresh": { "type": "boolean" },
|
|
378
|
+
"stalePaths": {
|
|
379
|
+
"type": "array",
|
|
380
|
+
"items": { "type": "string" }
|
|
381
|
+
},
|
|
382
|
+
"writeLocks": {
|
|
383
|
+
"type": "array",
|
|
384
|
+
"items": { "$ref": "#/$defs/commandWriteLock" }
|
|
385
|
+
},
|
|
386
|
+
"lockConflicts": {
|
|
387
|
+
"type": "array",
|
|
388
|
+
"items": { "$ref": "#/$defs/commandLockConflict" }
|
|
389
|
+
},
|
|
390
|
+
"refreshHint": { "type": ["string", "null"] }
|
|
391
|
+
}
|
|
392
|
+
},
|
|
393
|
+
"commandWriteLock": {
|
|
394
|
+
"type": "object",
|
|
395
|
+
"additionalProperties": false,
|
|
396
|
+
"required": ["lock", "paths", "modes", "sources", "concurrencies", "effectCount"],
|
|
397
|
+
"properties": {
|
|
398
|
+
"lock": { "type": "string" },
|
|
399
|
+
"paths": {
|
|
400
|
+
"type": "array",
|
|
401
|
+
"items": { "type": "string" }
|
|
402
|
+
},
|
|
403
|
+
"modes": {
|
|
404
|
+
"type": "array",
|
|
405
|
+
"items": { "type": "string" }
|
|
406
|
+
},
|
|
407
|
+
"sources": {
|
|
408
|
+
"type": "array",
|
|
409
|
+
"items": { "type": "string" }
|
|
410
|
+
},
|
|
411
|
+
"concurrencies": {
|
|
412
|
+
"type": "array",
|
|
413
|
+
"items": { "type": "string" }
|
|
414
|
+
},
|
|
415
|
+
"effectCount": { "type": "integer" }
|
|
416
|
+
}
|
|
417
|
+
},
|
|
418
|
+
"commandLockConflict": {
|
|
419
|
+
"type": "object",
|
|
420
|
+
"additionalProperties": false,
|
|
421
|
+
"required": [
|
|
422
|
+
"intent",
|
|
423
|
+
"lock",
|
|
424
|
+
"paths",
|
|
425
|
+
"modes",
|
|
426
|
+
"concurrencies",
|
|
427
|
+
"conflictingPaths",
|
|
428
|
+
"conflictingModes",
|
|
429
|
+
"conflictingConcurrencies"
|
|
430
|
+
],
|
|
431
|
+
"properties": {
|
|
432
|
+
"intent": { "type": "string" },
|
|
433
|
+
"lock": { "type": "string" },
|
|
434
|
+
"paths": {
|
|
435
|
+
"type": "array",
|
|
436
|
+
"items": { "type": "string" }
|
|
437
|
+
},
|
|
438
|
+
"modes": {
|
|
439
|
+
"type": "array",
|
|
440
|
+
"items": { "type": "string" }
|
|
441
|
+
},
|
|
442
|
+
"concurrencies": {
|
|
443
|
+
"type": "array",
|
|
444
|
+
"items": { "type": "string" }
|
|
445
|
+
},
|
|
446
|
+
"conflictingPaths": {
|
|
447
|
+
"type": "array",
|
|
448
|
+
"items": { "type": "string" }
|
|
449
|
+
},
|
|
450
|
+
"conflictingModes": {
|
|
451
|
+
"type": "array",
|
|
452
|
+
"items": { "type": "string" }
|
|
453
|
+
},
|
|
454
|
+
"conflictingConcurrencies": {
|
|
455
|
+
"type": "array",
|
|
456
|
+
"items": { "type": "string" }
|
|
266
457
|
}
|
|
267
458
|
}
|
|
268
459
|
},
|
|
@@ -56,12 +56,12 @@ translations = {}
|
|
|
56
56
|
[documents."skills.index"]
|
|
57
57
|
source = "locales/en/.mustflow/skills/INDEX.md"
|
|
58
58
|
source_locale = "en"
|
|
59
|
-
revision =
|
|
60
|
-
translations.ko = { path = "locales/ko/.mustflow/skills/INDEX.md", source_revision =
|
|
61
|
-
translations.zh = { path = "locales/zh/.mustflow/skills/INDEX.md", source_revision =
|
|
62
|
-
translations.es = { path = "locales/es/.mustflow/skills/INDEX.md", source_revision =
|
|
63
|
-
translations.fr = { path = "locales/fr/.mustflow/skills/INDEX.md", source_revision =
|
|
64
|
-
translations.hi = { path = "locales/hi/.mustflow/skills/INDEX.md", source_revision =
|
|
59
|
+
revision = 44
|
|
60
|
+
translations.ko = { path = "locales/ko/.mustflow/skills/INDEX.md", source_revision = 44, status = "needs_review" }
|
|
61
|
+
translations.zh = { path = "locales/zh/.mustflow/skills/INDEX.md", source_revision = 44, status = "needs_review" }
|
|
62
|
+
translations.es = { path = "locales/es/.mustflow/skills/INDEX.md", source_revision = 44, status = "needs_review" }
|
|
63
|
+
translations.fr = { path = "locales/fr/.mustflow/skills/INDEX.md", source_revision = 44, status = "needs_review" }
|
|
64
|
+
translations.hi = { path = "locales/hi/.mustflow/skills/INDEX.md", source_revision = 44, status = "needs_review" }
|
|
65
65
|
|
|
66
66
|
[documents."skill.adapter-boundary"]
|
|
67
67
|
source = "locales/en/.mustflow/skills/adapter-boundary/SKILL.md"
|
|
@@ -123,6 +123,16 @@ translations.es = { path = "locales/es/.mustflow/skills/date-number-audit/SKILL.
|
|
|
123
123
|
translations.fr = { path = "locales/fr/.mustflow/skills/date-number-audit/SKILL.md", source_revision = 1, status = "needs_review" }
|
|
124
124
|
translations.hi = { path = "locales/hi/.mustflow/skills/date-number-audit/SKILL.md", source_revision = 1, status = "needs_review" }
|
|
125
125
|
|
|
126
|
+
[documents."skill.database-change-safety"]
|
|
127
|
+
source = "locales/en/.mustflow/skills/database-change-safety/SKILL.md"
|
|
128
|
+
source_locale = "en"
|
|
129
|
+
revision = 1
|
|
130
|
+
translations.ko = { path = "locales/ko/.mustflow/skills/database-change-safety/SKILL.md", source_revision = 1, status = "needs_review" }
|
|
131
|
+
translations.zh = { path = "locales/zh/.mustflow/skills/database-change-safety/SKILL.md", source_revision = 1, status = "needs_review" }
|
|
132
|
+
translations.es = { path = "locales/es/.mustflow/skills/database-change-safety/SKILL.md", source_revision = 1, status = "needs_review" }
|
|
133
|
+
translations.fr = { path = "locales/fr/.mustflow/skills/database-change-safety/SKILL.md", source_revision = 1, status = "needs_review" }
|
|
134
|
+
translations.hi = { path = "locales/hi/.mustflow/skills/database-change-safety/SKILL.md", source_revision = 1, status = "needs_review" }
|
|
135
|
+
|
|
126
136
|
[documents."skill.dependency-injection"]
|
|
127
137
|
source = "locales/en/.mustflow/skills/dependency-injection/SKILL.md"
|
|
128
138
|
source_locale = "en"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
mustflow_doc: skills.index
|
|
3
3
|
locale: en
|
|
4
4
|
canonical: true
|
|
5
|
-
revision:
|
|
5
|
+
revision: 44
|
|
6
6
|
authority: router
|
|
7
7
|
lifecycle: mustflow-owned
|
|
8
8
|
---
|
|
@@ -49,6 +49,7 @@ refer to `AGENTS.md` and `.mustflow/config/commands.toml` to implement the most
|
|
|
49
49
|
| Changed files need risk classification and verification selection | `.mustflow/skills/diff-risk-review/SKILL.md` | Changed-file list, diff summary, and task goal | Changed surfaces and verification report | under- or over-verification | `changes_status`, `changes_diff_summary`, `test`, `test_related`, `test_audit`, `lint`, `build`, `docs_validate`, `mustflow_check` | Risk level, verification choice, rollback notes |
|
|
50
50
|
| Declared behavior must stay aligned across code, schemas, templates, tests, and docs | `.mustflow/skills/contract-sync-check/SKILL.md` | Changed files, intended behavior, source of truth, derived surfaces, and command contract entries | Contract source and required synchronized surfaces | contract drift | `changes_status`, `changes_diff_summary`, `docs_validate_fast`, `test_release`, `mustflow_check` | Contract source, synchronized surfaces, deferred surfaces, verification, and drift risk |
|
|
51
51
|
| Dates, versions, counts, durations, limits, metrics, benchmarks, prices, percentages, or other numeric facts are created, edited, or reported | `.mustflow/skills/date-number-audit/SKILL.md` | Date or numeric fact, source of truth, dependent surfaces, precision expectation, and command contract entries | Numeric statements, metadata, tests, docs, templates, and reports | invented, stale, or mismatched numeric claim | `changes_status`, `changes_diff_summary`, `docs_validate_fast`, `test_release`, `mustflow_check` | Audited values, source of truth, synchronized surfaces, skipped checks, and remaining numeric risk |
|
|
52
|
+
| Database schema, query, transaction, ORM model, repository/store, index, cache-backed read model, data retention, pagination, concurrency, idempotency, audit log, or persistence boundary is introduced, changed, reviewed, or reported | `.mustflow/skills/database-change-safety/SKILL.md` | Data role, affected tables or stores, read/write path, transaction boundary, migration or rollback expectations, local DB or ORM patterns, changed files, and command contract entries | Schema, migrations, repositories, stores, queries, transactions, indexes, read models, fixtures, tests, docs, and directly synchronized templates | data loss, stale cache, authorization leak, transaction bug, duplicate side effect, slow query, or unverified migration claim | `changes_status`, `changes_diff_summary`, `test_related`, `test`, `lint`, `build`, `docs_validate_fast`, `test_release`, `mustflow_check` | Data role, schema/query/transaction review, migration and rollback status, index/performance notes, security/retention checks, tests, verification, and remaining database risk |
|
|
52
53
|
| Packages, runtimes, tools, commands, services, or platform capabilities are assumed, added, invoked, or documented | `.mustflow/skills/dependency-reality-check/SKILL.md` | Dependency or capability, repository declarations, version or capability claim, and command contract entries | Dependency declarations, imports, command metadata, tests, and docs | invented or unavailable dependency | `changes_status`, `changes_diff_summary`, `build`, `test_release`, `mustflow_check` | Dependency status, synchronized surfaces, verification, and remaining dependency risk |
|
|
53
54
|
| External systems, protocols, SDKs, databases, webhooks, queues, files, caches, framework requests or responses, AI models, browser storage, or provider data cross the core boundary or need port/adapter translation, error mapping, retry, idempotency, security, or observability handling | `.mustflow/skills/adapter-boundary/SKILL.md` | External system or protocol, inbound/outbound direction, internal use case, local port/adapter patterns, provider risk, changed files, and command contract entries | Ports, adapters, mappers, controllers, workers, stores, gateways, tests, fixtures, assembly wiring, and directly synchronized docs or templates | provider leakage, pass-through wrapper, unclassified external failure, duplicate side effect, unsafe retry, missing timeout, secret or personal-data leak, or untested integration drift | `changes_status`, `changes_diff_summary`, `test_related`, `test`, `lint`, `build`, `docs_validate_fast`, `test_release`, `mustflow_check` | Boundary classification, internal port, provider containment, validation and mapping, timeout/retry/idempotency handling, security notes, verification, and remaining provider risk |
|
|
54
55
|
| Core or application logic creates, imports, resolves, or hides external dependencies such as databases, SDKs, clocks, random generators, configuration, loggers, framework objects, filesystems, queues, AI clients, or payment/email providers | `.mustflow/skills/dependency-injection/SKILL.md` | Target code area, hidden dependency, intended business capability, layer ownership, local port/adapter patterns, changed files, and command contract entries | Core logic signatures, ports, adapters, assembly roots, tests, and directly synchronized docs or templates | hidden global state, untestable business logic, provider leakage, lifecycle drift, or service-locator coupling | `changes_status`, `changes_diff_summary`, `test_related`, `test`, `lint`, `build`, `docs_validate_fast`, `test_release`, `mustflow_check` | Dependency boundary, direct dependencies found, injection style, ports/adapters, assembly boundary, tests or fakes, verification, and remaining dependency leakage |
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
---
|
|
2
|
+
mustflow_doc: skill.database-change-safety
|
|
3
|
+
locale: en
|
|
4
|
+
canonical: true
|
|
5
|
+
revision: 1
|
|
6
|
+
lifecycle: mustflow-owned
|
|
7
|
+
authority: procedure
|
|
8
|
+
name: database-change-safety
|
|
9
|
+
description: Apply this skill when database schema, queries, transactions, ORM models, repositories, stores, indexes, cache-backed read models, retention, pagination, concurrency, idempotency, audit logs, or persistence boundaries are introduced, changed, reviewed, or reported.
|
|
10
|
+
metadata:
|
|
11
|
+
mustflow_schema: "1"
|
|
12
|
+
mustflow_kind: procedure
|
|
13
|
+
pack_id: mustflow.core
|
|
14
|
+
skill_id: mustflow.core.database-change-safety
|
|
15
|
+
command_intents:
|
|
16
|
+
- changes_status
|
|
17
|
+
- changes_diff_summary
|
|
18
|
+
- test_related
|
|
19
|
+
- test
|
|
20
|
+
- lint
|
|
21
|
+
- build
|
|
22
|
+
- docs_validate_fast
|
|
23
|
+
- test_release
|
|
24
|
+
- mustflow_check
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
# Database Change Safety
|
|
28
|
+
|
|
29
|
+
<!-- mustflow-section: purpose -->
|
|
30
|
+
## Purpose
|
|
31
|
+
|
|
32
|
+
Keep database-backed behavior explicit, scoped, recoverable where possible, and verifiable without treating database rows, ORM models, generated caches, or read models as domain truth.
|
|
33
|
+
|
|
34
|
+
Use the smallest persistence boundary that proves the risk. Do not introduce repositories, services, transactions, migrations, outbox machinery, or read models when a direct scoped query or fixture update is enough.
|
|
35
|
+
|
|
36
|
+
<!-- mustflow-section: use-when -->
|
|
37
|
+
## Use When
|
|
38
|
+
|
|
39
|
+
- A schema, migration, table, collection, ORM model, query, repository, store, transaction, index, cache, read model, audit log, or retention rule is introduced or changed.
|
|
40
|
+
- Code reads from or writes to a database, browser storage, cache, local SQLite file, external database, or generated data store.
|
|
41
|
+
- A task changes authorization, tenant scoping, pagination, sorting, soft delete, status filters, idempotency, duplicate handling, retry, or concurrency behavior around persisted data.
|
|
42
|
+
- Documentation, tests, or final reports claim that a database change is safe, fast, indexed, migrated, reversible, idempotent, or verified.
|
|
43
|
+
|
|
44
|
+
<!-- mustflow-section: do-not-use-when -->
|
|
45
|
+
## Do Not Use When
|
|
46
|
+
|
|
47
|
+
- The change is pure in-memory logic with no persisted, cached, indexed, or generated state.
|
|
48
|
+
- The task only changes external protocol mapping and no database-backed state; use `adapter-boundary`.
|
|
49
|
+
- The task only changes file or template migration behavior and no database or persistence surface; use `migration-safety-check`.
|
|
50
|
+
- The change only documents general database advice without touching or claiming project behavior.
|
|
51
|
+
|
|
52
|
+
<!-- mustflow-section: required-inputs -->
|
|
53
|
+
## Required Inputs
|
|
54
|
+
|
|
55
|
+
- Database role: source of truth, rebuildable cache, read model, runtime state, analytics store, external provider, or browser storage.
|
|
56
|
+
- Data owner and affected tables, collections, stores, indexes, caches, generated files, or read models.
|
|
57
|
+
- Read and write paths, query or ORM behavior, authorization scope, tenant or user scope, and retention expectations.
|
|
58
|
+
- Transaction boundary, idempotency, retry, duplicate-delivery, concurrency, migration, rollback, or rebuild expectations.
|
|
59
|
+
- Local database, ORM, repository, fixture, migration, cache, and test patterns.
|
|
60
|
+
- Relevant command-intent contract entries for tests, builds, docs, release checks, and mustflow validation.
|
|
61
|
+
|
|
62
|
+
<!-- mustflow-section: preconditions -->
|
|
63
|
+
## Preconditions
|
|
64
|
+
|
|
65
|
+
- The task matches the Use When conditions and does not match the Do Not Use When exclusions.
|
|
66
|
+
- Required inputs are available, or missing inputs can be reported without guessing.
|
|
67
|
+
- Higher-priority instructions and `.mustflow/config/commands.toml` have been checked for the current scope.
|
|
68
|
+
- If database clients, ORM types, rows, browser storage, cache values, or provider data cross into core logic, also use `adapter-boundary`.
|
|
69
|
+
- If hidden construction or global lookup creates the database dependency, also use `dependency-injection`.
|
|
70
|
+
- If schema, data, cache, or generated state changes must move from an old state to a new state, also use `migration-safety-check`.
|
|
71
|
+
- If personal data, authentication, authorization, retention, logs, telemetry, or secret-like values are involved, also use `security-privacy-review`.
|
|
72
|
+
- If index, query-time, startup, package-size, search, count, or read-model performance claims are involved, also use `performance-budget-check`.
|
|
73
|
+
|
|
74
|
+
<!-- mustflow-section: allowed-edits -->
|
|
75
|
+
## Allowed Edits
|
|
76
|
+
|
|
77
|
+
- Update schema, query, repository, store, transaction, index, cache, read-model, fixture, test, documentation, and directly synchronized template surfaces tied to the task.
|
|
78
|
+
- Add or tighten constraints, scoping, pagination, ordering, idempotency keys, concurrency guards, retention checks, and redaction behavior when the changed surface justifies it.
|
|
79
|
+
- Mark rollback, migration, performance, privacy, or concurrency gaps as unverified when they cannot be proven.
|
|
80
|
+
- Do not expose database rows, ORM models, query builders, or provider clients as domain objects.
|
|
81
|
+
- Do not treat generated caches or read models as source of truth.
|
|
82
|
+
- Do not add broad repository methods that accept arbitrary filters unless authorization, tenant scope, and caller ownership are explicit.
|
|
83
|
+
- Do not call external APIs inside a database transaction unless a local rule explicitly accepts the coupling and a recovery path exists.
|
|
84
|
+
- Do not store raw logs, secrets, hidden reasoning, full transcripts, unnecessary provider payloads, or unbounded personal data in local state or caches.
|
|
85
|
+
|
|
86
|
+
<!-- mustflow-section: procedure -->
|
|
87
|
+
## Procedure
|
|
88
|
+
|
|
89
|
+
1. Classify the database role.
|
|
90
|
+
- Source of truth: owns current business state.
|
|
91
|
+
- Rebuildable cache: can be deleted and regenerated from files, provider data, or another source.
|
|
92
|
+
- Read model: derived for lookup, search, reporting, or dashboard use.
|
|
93
|
+
- Runtime state: coordinates in-flight work, locks, sessions, jobs, or retries.
|
|
94
|
+
- Analytics store, external provider, or browser storage: owned outside the core domain boundary.
|
|
95
|
+
2. Identify the data owner and derived surfaces. Name which table, file, provider, event log, configuration, or generated artifact owns each value.
|
|
96
|
+
3. Check schema shape: primary keys, foreign keys, unique constraints, nullable fields, defaults, check constraints, status values, timestamps, soft delete fields, tenant scope, audit fields, and retention rules.
|
|
97
|
+
4. Check query semantics: authorization scope, tenant or user scope, role or visibility filters, deleted or archived rows, draft or unpublished rows, effective dates, null handling, stale-data behavior, and error or absence handling.
|
|
98
|
+
5. Check pagination and ordering. Lists need deterministic ordering; cursor pagination needs a stable tie breaker such as a unique id in addition to a timestamp.
|
|
99
|
+
6. Check transaction boundaries. Keep database writes and external side effects separate by default; use explicit states, an outbox, an action ledger, or reconciliation when both must be coordinated.
|
|
100
|
+
7. Check idempotency, retries, duplicate delivery, and concurrency. Look for webhook duplicates, job retries, import reruns, payment callbacks, optimistic locks, compare-and-swap updates, unique-constraint races, and double state transitions.
|
|
101
|
+
8. Check indexes and workload cost. Match indexes to `WHERE`, `JOIN`, `ORDER BY`, and `GROUP BY` behavior, but account for write cost. Look for N+1 queries, expensive counts, full scans, materialized read-model needs, and search-index boundaries.
|
|
102
|
+
9. Check privacy and retention. Prefer omission or bounded metadata over storing raw payloads. Do not persist secrets, hidden reasoning, full transcripts, unbounded logs, or personal data without a clear product rule and retention path.
|
|
103
|
+
10. Check migration, rollback, and rebuild paths. If a migration claim exists, prove idempotency and recovery with `migration-safety-check` or report the gap. If the store is a cache, name the rebuild source and stale-index detection.
|
|
104
|
+
11. Check tests and fixtures. Reuse or add repository/store tests, migration fixtures, query fixtures, adapter fixtures, permission regressions, idempotency or concurrency regressions, and cache rebuild checks as justified by the risk.
|
|
105
|
+
12. Verify and report. Separate proven behavior from unverified rollback, migration, privacy, performance, live-data, or concurrency risks.
|
|
106
|
+
|
|
107
|
+
<!-- mustflow-section: postconditions -->
|
|
108
|
+
## Postconditions
|
|
109
|
+
|
|
110
|
+
- The database role and source of truth are explicit.
|
|
111
|
+
- Database rows, ORM models, generated caches, and read models do not leak into domain truth unless the local architecture intentionally owns that boundary.
|
|
112
|
+
- Queries preserve authorization, tenant or user scope, deterministic ordering, expected absence behavior, and retention rules.
|
|
113
|
+
- Transaction, external side effect, idempotency, duplicate, retry, and concurrency decisions are intentional and reported.
|
|
114
|
+
- Index, query-cost, migration, rollback, rebuild, privacy, and verification claims are tied to evidence or marked as unverified.
|
|
115
|
+
|
|
116
|
+
<!-- mustflow-section: verification -->
|
|
117
|
+
## Verification
|
|
118
|
+
|
|
119
|
+
Use configured oneshot command intents when available:
|
|
120
|
+
|
|
121
|
+
- `changes_status`
|
|
122
|
+
- `changes_diff_summary`
|
|
123
|
+
- `test_related`
|
|
124
|
+
- `test`
|
|
125
|
+
- `lint`
|
|
126
|
+
- `build`
|
|
127
|
+
- `docs_validate_fast`
|
|
128
|
+
- `test_release`
|
|
129
|
+
- `mustflow_check`
|
|
130
|
+
|
|
131
|
+
Prefer the narrowest configured test, build, docs, release, or mustflow intent that proves the changed persistence surface. Do not infer raw database, migration, package, or benchmark commands.
|
|
132
|
+
|
|
133
|
+
<!-- mustflow-section: failure-handling -->
|
|
134
|
+
## Failure Handling
|
|
135
|
+
|
|
136
|
+
- If the source of truth is unclear, stop changing persistence behavior and report the competing owners.
|
|
137
|
+
- If authorization, tenant scope, soft delete, or retention behavior cannot be confirmed, fail closed or report the missing project rule.
|
|
138
|
+
- If rollback, migration idempotency, rebuild, or stale-cache detection cannot be proven, avoid claiming safety and name the remaining recovery risk.
|
|
139
|
+
- If a performance claim lacks a configured measurement path, report it as unmeasured instead of inventing a budget.
|
|
140
|
+
- If sensitive data appears in queries, fixtures, logs, generated state, package contents, or final output, route that surface through `security-privacy-review` before continuing.
|
|
141
|
+
- If the safest fix would require live data access, destructive migration, dependency installation, or unavailable credentials, stop at that boundary and report the skipped check.
|
|
142
|
+
|
|
143
|
+
<!-- mustflow-section: output-format -->
|
|
144
|
+
## Output Format
|
|
145
|
+
|
|
146
|
+
- Database role and owner
|
|
147
|
+
- Affected read and write paths
|
|
148
|
+
- Schema, constraint, and query semantics reviewed
|
|
149
|
+
- Authorization, tenant scope, retention, and privacy checks
|
|
150
|
+
- Transaction, idempotency, retry, and concurrency decisions
|
|
151
|
+
- Index, pagination, and performance notes
|
|
152
|
+
- Migration, rollback, dry-run, rebuild, or compatibility status
|
|
153
|
+
- Tests, fixtures, or verification command intents run
|
|
154
|
+
- Skipped checks and reasons
|
|
155
|
+
- Remaining database risk
|
|
@@ -39,7 +39,7 @@ mustflow-managed details are under `.mustflow/`.
|
|
|
39
39
|
intent is still running, especially when an intent declares non-empty `writes` such as `dist/`.
|
|
40
40
|
- Choose the narrowest configured verification intent that covers the risk. Prefer related or
|
|
41
41
|
fast checks over broad suites when the command contract exposes them, and report missing
|
|
42
|
-
narrower intents instead of defaulting
|
|
42
|
+
narrower intents instead of silently defaulting to slow full-suite tests.
|
|
43
43
|
- Do not directly start development servers, watchers, browser interfaces, interactive prompts,
|
|
44
44
|
or background processes.
|
|
45
45
|
- Do not start autonomous loops, worker processes, persona systems, or long-running harness
|
|
@@ -66,7 +66,7 @@ mustflow-managed details are under `.mustflow/`.
|
|
|
66
66
|
- Before creating or modifying any file, use `.mustflow/skills/INDEX.md` to decide whether one or more skills apply.
|
|
67
67
|
This skill-selection gate is mandatory even for small or seemingly obvious tasks.
|
|
68
68
|
- `mf doctor`, `mf check`, and other health checks do not satisfy the skill-selection gate. They
|
|
69
|
-
confirm repository health; they do not
|
|
69
|
+
confirm repository health; they do not determine which task procedure applies.
|
|
70
70
|
- If a matching skill applies, read the matching `SKILL.md` before editing that scope. After
|
|
71
71
|
creating or modifying files, include a concise skill-selection note in the final report: name the
|
|
72
72
|
skills used, state that no matching installed skill was found, or report that a plausible skill is
|
|
@@ -80,7 +80,7 @@ mustflow-managed details are under `.mustflow/`.
|
|
|
80
80
|
|
|
81
81
|
## Parent and Child Rule Priority
|
|
82
82
|
|
|
83
|
-
- The
|
|
83
|
+
- The `AGENTS.md` closest to the edited files takes precedence.
|
|
84
84
|
- If workflow, style, tests, or command rules conflict, follow the child repository's `AGENTS.md`
|
|
85
85
|
and `.mustflow/config/commands.toml`.
|
|
86
86
|
- Safety rules for secrets, privacy, destructive commands, and permitted edit paths are cumulative.
|
|
@@ -94,14 +94,14 @@ mustflow-managed details are under `.mustflow/`.
|
|
|
94
94
|
Some coding hosts may read additional host-specific instruction files or enforce their own
|
|
95
95
|
approval, sandbox, checkpoint, and command execution policies.
|
|
96
96
|
|
|
97
|
-
Treat those host policies as
|
|
97
|
+
Treat those host policies as additional safety and execution constraints. They do not replace this
|
|
98
98
|
repository's mustflow command contract. When host instructions conflict with mustflow rules:
|
|
99
99
|
|
|
100
100
|
- Direct user instructions define the task goal unless unsafe.
|
|
101
101
|
- Host safety and approval gates remain binding.
|
|
102
102
|
- Repository work rules come from the nearest `AGENTS.md` and `.mustflow/config/*.toml`.
|
|
103
103
|
- Project verification commands must use configured mustflow intents.
|
|
104
|
-
- Stricter privacy, secret, destructive-command, and Git push rules
|
|
104
|
+
- Stricter privacy, secret, destructive-command, and Git push rules take precedence.
|
|
105
105
|
- Generated state, summaries, and caches never override current files or current user instructions.
|
|
106
106
|
|
|
107
107
|
When the effective rule is unclear, stop and report the conflict instead of guessing.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
mustflow_doc: skills.index
|
|
3
3
|
locale: es
|
|
4
4
|
canonical: false
|
|
5
|
-
revision:
|
|
5
|
+
revision: 44
|
|
6
6
|
authority: router
|
|
7
7
|
lifecycle: mustflow-owned
|
|
8
8
|
---
|
|
@@ -43,6 +43,7 @@ Consulta únicamente el documento de la skill correspondiente a la tarea actual.
|
|
|
43
43
|
| Los archivos modificados requieren clasificación de riesgo y selección de verificación | `.mustflow/skills/diff-risk-review/SKILL.md` | Lista de archivos modificados, resumen de diferencias y objetivo de la tarea | Superficies modificadas e informe de verificación | Verificación insuficiente o excesiva | `changes_status`, `changes_diff_summary`, `test`, `test_related`, `test_audit`, `lint`, `build`, `docs_validate`, `mustflow_check` | Nivel de riesgo, elección de verificación, notas de rollback |
|
|
44
44
|
| El comportamiento declarado debe mantenerse alineado entre código, esquemas, plantillas, pruebas y documentación | `.mustflow/skills/contract-sync-check/SKILL.md` | Archivos modificados, comportamiento previsto, fuente de verdad, superficies derivadas y entradas de contrato de comando | Fuente del contrato y superficies sincronizadas requeridas | Deriva del contrato | `changes_status`, `changes_diff_summary`, `docs_validate_fast`, `test_release`, `mustflow_check` | Fuente del contrato, superficies sincronizadas, superficies diferidas, verificación y riesgo de deriva |
|
|
45
45
|
| Se crean, editan o reportan fechas, versiones, conteos, duraciones, límites, métricas, benchmarks, precios, porcentajes u otros hechos numéricos | `.mustflow/skills/date-number-audit/SKILL.md` | Hecho numérico o fecha, fuente de verdad, superficies dependientes, expectativa de precisión y entradas de contrato de comando | Declaraciones numéricas, metadatos, pruebas, documentación, plantillas e informes | Afirmación numérica inventada, obsoleta o desajustada | `changes_status`, `changes_diff_summary`, `docs_validate_fast`, `test_release`, `mustflow_check` | Valores auditados, fuente de verdad, superficies sincronizadas, chequeos omitidos y riesgo numérico restante |
|
|
46
|
+
| Database schema, query, transaction, ORM model, repository/store, index, cache-backed read model, data retention, pagination, concurrency, idempotency, audit log, or persistence boundary is introduced, changed, reviewed, or reported | `.mustflow/skills/database-change-safety/SKILL.md` | Data role, affected tables or stores, read/write path, transaction boundary, migration or rollback expectations, local DB or ORM patterns, changed files, and command contract entries | Schema, migrations, repositories, stores, queries, transactions, indexes, read models, fixtures, tests, docs, and directly synchronized templates | data loss, stale cache, authorization leak, transaction bug, duplicate side effect, slow query, or unverified migration claim | `changes_status`, `changes_diff_summary`, `test_related`, `test`, `lint`, `build`, `docs_validate_fast`, `test_release`, `mustflow_check` | Data role, schema/query/transaction review, migration and rollback status, index/performance notes, security/retention checks, tests, verification, and remaining database risk |
|
|
46
47
|
| Se asumen, agregan, invocan o documentan paquetes, runtimes, herramientas, comandos, servicios o capacidades de plataforma | `.mustflow/skills/dependency-reality-check/SKILL.md` | Dependencia o capacidad, declaraciones del repositorio, versión o afirmación de capacidad y entradas de contrato de comando | Declaraciones de dependencia, importaciones, metadatos de comando, pruebas y documentación | Dependencia inventada o no disponible | `changes_status`, `changes_diff_summary`, `build`, `test_release`, `mustflow_check` | Estado de dependencia, superficies sincronizadas, verificación y riesgo restante de dependencia |
|
|
47
48
|
|
|
48
49
|
| Sistemas externos, protocolos, SDKs, bases de datos, webhooks, colas, archivos, cachés, solicitudes o respuestas del framework, modelos de IA, almacenamiento del navegador o datos del proveedor que cruzan el límite del núcleo o requieren traducción de puerto/adaptador, mapeo de errores, reintentos, idempotencia, seguridad o manejo de observabilidad | `.mustflow/skills/adapter-boundary/SKILL.md` | Sistema o protocolo externo, dirección entrante/saliente, caso de uso interno, patrones locales de puerto/adaptador, riesgo del proveedor, archivos modificados y entradas del contrato de comandos | Puertos, adaptadores, mapeadores, controladores, trabajadores, almacenes, gateways, pruebas, fixtures, cableado de ensamblaje y documentación o plantillas sincronizadas directamente | Fuga del proveedor, wrapper de paso, fallo externo no clasificado, efecto secundario duplicado, reintento inseguro, falta de timeout, fuga de secretos o datos personales, o deriva de integración no probada | `changes_status`, `changes_diff_summary`, `test_related`, `test`, `lint`, `build`, `docs_validate_fast`, `test_release`, `mustflow_check` | Clasificación del límite, puerto interno, contención del proveedor, validación y mapeo, manejo de timeout/reintentos/idempotencia, notas de seguridad, verificación y riesgo residual del proveedor |
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
---
|
|
2
|
+
mustflow_doc: skill.database-change-safety
|
|
3
|
+
locale: es
|
|
4
|
+
canonical: false
|
|
5
|
+
revision: 1
|
|
6
|
+
lifecycle: mustflow-owned
|
|
7
|
+
authority: procedure
|
|
8
|
+
name: database-change-safety
|
|
9
|
+
description: Apply this skill when database schema, queries, transactions, ORM models, repositories, stores, indexes, cache-backed read models, retention, pagination, concurrency, idempotency, audit logs, or persistence boundaries are introduced, changed, reviewed, or reported.
|
|
10
|
+
metadata:
|
|
11
|
+
mustflow_schema: "1"
|
|
12
|
+
mustflow_kind: procedure
|
|
13
|
+
pack_id: mustflow.core
|
|
14
|
+
skill_id: mustflow.core.database-change-safety
|
|
15
|
+
command_intents:
|
|
16
|
+
- changes_status
|
|
17
|
+
- changes_diff_summary
|
|
18
|
+
- test_related
|
|
19
|
+
- test
|
|
20
|
+
- lint
|
|
21
|
+
- build
|
|
22
|
+
- docs_validate_fast
|
|
23
|
+
- test_release
|
|
24
|
+
- mustflow_check
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
# Database Change Safety
|
|
28
|
+
|
|
29
|
+
<!-- mustflow-section: purpose -->
|
|
30
|
+
## Purpose
|
|
31
|
+
|
|
32
|
+
Keep database-backed behavior explicit, scoped, recoverable where possible, and verifiable without treating database rows, ORM models, generated caches, or read models as domain truth.
|
|
33
|
+
|
|
34
|
+
Use the smallest persistence boundary that proves the risk. Do not introduce repositories, services, transactions, migrations, outbox machinery, or read models when a direct scoped query or fixture update is enough.
|
|
35
|
+
|
|
36
|
+
<!-- mustflow-section: use-when -->
|
|
37
|
+
## Use When
|
|
38
|
+
|
|
39
|
+
- A schema, migration, table, collection, ORM model, query, repository, store, transaction, index, cache, read model, audit log, or retention rule is introduced or changed.
|
|
40
|
+
- Code reads from or writes to a database, browser storage, cache, local SQLite file, external database, or generated data store.
|
|
41
|
+
- A task changes authorization, tenant scoping, pagination, sorting, soft delete, status filters, idempotency, duplicate handling, retry, or concurrency behavior around persisted data.
|
|
42
|
+
- Documentation, tests, or final reports claim that a database change is safe, fast, indexed, migrated, reversible, idempotent, or verified.
|
|
43
|
+
|
|
44
|
+
<!-- mustflow-section: do-not-use-when -->
|
|
45
|
+
## Do Not Use When
|
|
46
|
+
|
|
47
|
+
- The change is pure in-memory logic with no persisted, cached, indexed, or generated state.
|
|
48
|
+
- The task only changes external protocol mapping and no database-backed state; use `adapter-boundary`.
|
|
49
|
+
- The task only changes file or template migration behavior and no database or persistence surface; use `migration-safety-check`.
|
|
50
|
+
- The change only documents general database advice without touching or claiming project behavior.
|
|
51
|
+
|
|
52
|
+
<!-- mustflow-section: required-inputs -->
|
|
53
|
+
## Required Inputs
|
|
54
|
+
|
|
55
|
+
- Database role: source of truth, rebuildable cache, read model, runtime state, analytics store, external provider, or browser storage.
|
|
56
|
+
- Data owner and affected tables, collections, stores, indexes, caches, generated files, or read models.
|
|
57
|
+
- Read and write paths, query or ORM behavior, authorization scope, tenant or user scope, and retention expectations.
|
|
58
|
+
- Transaction boundary, idempotency, retry, duplicate-delivery, concurrency, migration, rollback, or rebuild expectations.
|
|
59
|
+
- Local database, ORM, repository, fixture, migration, cache, and test patterns.
|
|
60
|
+
- Relevant command-intent contract entries for tests, builds, docs, release checks, and mustflow validation.
|
|
61
|
+
|
|
62
|
+
<!-- mustflow-section: preconditions -->
|
|
63
|
+
## Preconditions
|
|
64
|
+
|
|
65
|
+
- The task matches the Use When conditions and does not match the Do Not Use When exclusions.
|
|
66
|
+
- Required inputs are available, or missing inputs can be reported without guessing.
|
|
67
|
+
- Higher-priority instructions and `.mustflow/config/commands.toml` have been checked for the current scope.
|
|
68
|
+
- If database clients, ORM types, rows, browser storage, cache values, or provider data cross into core logic, also use `adapter-boundary`.
|
|
69
|
+
- If hidden construction or global lookup creates the database dependency, also use `dependency-injection`.
|
|
70
|
+
- If schema, data, cache, or generated state changes must move from an old state to a new state, also use `migration-safety-check`.
|
|
71
|
+
- If personal data, authentication, authorization, retention, logs, telemetry, or secret-like values are involved, also use `security-privacy-review`.
|
|
72
|
+
- If index, query-time, startup, package-size, search, count, or read-model performance claims are involved, also use `performance-budget-check`.
|
|
73
|
+
|
|
74
|
+
<!-- mustflow-section: allowed-edits -->
|
|
75
|
+
## Allowed Edits
|
|
76
|
+
|
|
77
|
+
- Update schema, query, repository, store, transaction, index, cache, read-model, fixture, test, documentation, and directly synchronized template surfaces tied to the task.
|
|
78
|
+
- Add or tighten constraints, scoping, pagination, ordering, idempotency keys, concurrency guards, retention checks, and redaction behavior when the changed surface justifies it.
|
|
79
|
+
- Mark rollback, migration, performance, privacy, or concurrency gaps as unverified when they cannot be proven.
|
|
80
|
+
- Do not expose database rows, ORM models, query builders, or provider clients as domain objects.
|
|
81
|
+
- Do not treat generated caches or read models as source of truth.
|
|
82
|
+
- Do not add broad repository methods that accept arbitrary filters unless authorization, tenant scope, and caller ownership are explicit.
|
|
83
|
+
- Do not call external APIs inside a database transaction unless a local rule explicitly accepts the coupling and a recovery path exists.
|
|
84
|
+
- Do not store raw logs, secrets, hidden reasoning, full transcripts, unnecessary provider payloads, or unbounded personal data in local state or caches.
|
|
85
|
+
|
|
86
|
+
<!-- mustflow-section: procedure -->
|
|
87
|
+
## Procedure
|
|
88
|
+
|
|
89
|
+
1. Classify the database role.
|
|
90
|
+
- Source of truth: owns current business state.
|
|
91
|
+
- Rebuildable cache: can be deleted and regenerated from files, provider data, or another source.
|
|
92
|
+
- Read model: derived for lookup, search, reporting, or dashboard use.
|
|
93
|
+
- Runtime state: coordinates in-flight work, locks, sessions, jobs, or retries.
|
|
94
|
+
- Analytics store, external provider, or browser storage: owned outside the core domain boundary.
|
|
95
|
+
2. Identify the data owner and derived surfaces. Name which table, file, provider, event log, configuration, or generated artifact owns each value.
|
|
96
|
+
3. Check schema shape: primary keys, foreign keys, unique constraints, nullable fields, defaults, check constraints, status values, timestamps, soft delete fields, tenant scope, audit fields, and retention rules.
|
|
97
|
+
4. Check query semantics: authorization scope, tenant or user scope, role or visibility filters, deleted or archived rows, draft or unpublished rows, effective dates, null handling, stale-data behavior, and error or absence handling.
|
|
98
|
+
5. Check pagination and ordering. Lists need deterministic ordering; cursor pagination needs a stable tie breaker such as a unique id in addition to a timestamp.
|
|
99
|
+
6. Check transaction boundaries. Keep database writes and external side effects separate by default; use explicit states, an outbox, an action ledger, or reconciliation when both must be coordinated.
|
|
100
|
+
7. Check idempotency, retries, duplicate delivery, and concurrency. Look for webhook duplicates, job retries, import reruns, payment callbacks, optimistic locks, compare-and-swap updates, unique-constraint races, and double state transitions.
|
|
101
|
+
8. Check indexes and workload cost. Match indexes to `WHERE`, `JOIN`, `ORDER BY`, and `GROUP BY` behavior, but account for write cost. Look for N+1 queries, expensive counts, full scans, materialized read-model needs, and search-index boundaries.
|
|
102
|
+
9. Check privacy and retention. Prefer omission or bounded metadata over storing raw payloads. Do not persist secrets, hidden reasoning, full transcripts, unbounded logs, or personal data without a clear product rule and retention path.
|
|
103
|
+
10. Check migration, rollback, and rebuild paths. If a migration claim exists, prove idempotency and recovery with `migration-safety-check` or report the gap. If the store is a cache, name the rebuild source and stale-index detection.
|
|
104
|
+
11. Check tests and fixtures. Reuse or add repository/store tests, migration fixtures, query fixtures, adapter fixtures, permission regressions, idempotency or concurrency regressions, and cache rebuild checks as justified by the risk.
|
|
105
|
+
12. Verify and report. Separate proven behavior from unverified rollback, migration, privacy, performance, live-data, or concurrency risks.
|
|
106
|
+
|
|
107
|
+
<!-- mustflow-section: postconditions -->
|
|
108
|
+
## Postconditions
|
|
109
|
+
|
|
110
|
+
- The database role and source of truth are explicit.
|
|
111
|
+
- Database rows, ORM models, generated caches, and read models do not leak into domain truth unless the local architecture intentionally owns that boundary.
|
|
112
|
+
- Queries preserve authorization, tenant or user scope, deterministic ordering, expected absence behavior, and retention rules.
|
|
113
|
+
- Transaction, external side effect, idempotency, duplicate, retry, and concurrency decisions are intentional and reported.
|
|
114
|
+
- Index, query-cost, migration, rollback, rebuild, privacy, and verification claims are tied to evidence or marked as unverified.
|
|
115
|
+
|
|
116
|
+
<!-- mustflow-section: verification -->
|
|
117
|
+
## Verification
|
|
118
|
+
|
|
119
|
+
Use configured oneshot command intents when available:
|
|
120
|
+
|
|
121
|
+
- `changes_status`
|
|
122
|
+
- `changes_diff_summary`
|
|
123
|
+
- `test_related`
|
|
124
|
+
- `test`
|
|
125
|
+
- `lint`
|
|
126
|
+
- `build`
|
|
127
|
+
- `docs_validate_fast`
|
|
128
|
+
- `test_release`
|
|
129
|
+
- `mustflow_check`
|
|
130
|
+
|
|
131
|
+
Prefer the narrowest configured test, build, docs, release, or mustflow intent that proves the changed persistence surface. Do not infer raw database, migration, package, or benchmark commands.
|
|
132
|
+
|
|
133
|
+
<!-- mustflow-section: failure-handling -->
|
|
134
|
+
## Failure Handling
|
|
135
|
+
|
|
136
|
+
- If the source of truth is unclear, stop changing persistence behavior and report the competing owners.
|
|
137
|
+
- If authorization, tenant scope, soft delete, or retention behavior cannot be confirmed, fail closed or report the missing project rule.
|
|
138
|
+
- If rollback, migration idempotency, rebuild, or stale-cache detection cannot be proven, avoid claiming safety and name the remaining recovery risk.
|
|
139
|
+
- If a performance claim lacks a configured measurement path, report it as unmeasured instead of inventing a budget.
|
|
140
|
+
- If sensitive data appears in queries, fixtures, logs, generated state, package contents, or final output, route that surface through `security-privacy-review` before continuing.
|
|
141
|
+
- If the safest fix would require live data access, destructive migration, dependency installation, or unavailable credentials, stop at that boundary and report the skipped check.
|
|
142
|
+
|
|
143
|
+
<!-- mustflow-section: output-format -->
|
|
144
|
+
## Output Format
|
|
145
|
+
|
|
146
|
+
- Database role and owner
|
|
147
|
+
- Affected read and write paths
|
|
148
|
+
- Schema, constraint, and query semantics reviewed
|
|
149
|
+
- Authorization, tenant scope, retention, and privacy checks
|
|
150
|
+
- Transaction, idempotency, retry, and concurrency decisions
|
|
151
|
+
- Index, pagination, and performance notes
|
|
152
|
+
- Migration, rollback, dry-run, rebuild, or compatibility status
|
|
153
|
+
- Tests, fixtures, or verification command intents run
|
|
154
|
+
- Skipped checks and reasons
|
|
155
|
+
- Remaining database risk
|