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
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
---
|
|
2
|
+
mustflow_doc: skill.database-change-safety
|
|
3
|
+
locale: zh
|
|
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
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
id = "default"
|
|
2
2
|
name = "default"
|
|
3
|
-
version = "1.18.
|
|
3
|
+
version = "1.18.14"
|
|
4
4
|
description = "Minimal workflow for LLM agents to read, edit, and verify their work in a repository."
|
|
5
5
|
common_root = "common"
|
|
6
6
|
locales_root = "locales"
|
|
@@ -19,6 +19,7 @@ creates = [
|
|
|
19
19
|
".mustflow/skills/composition-over-inheritance/SKILL.md",
|
|
20
20
|
".mustflow/skills/contract-sync-check/SKILL.md",
|
|
21
21
|
".mustflow/skills/date-number-audit/SKILL.md",
|
|
22
|
+
".mustflow/skills/database-change-safety/SKILL.md",
|
|
22
23
|
".mustflow/skills/dependency-injection/SKILL.md",
|
|
23
24
|
".mustflow/skills/dependency-reality-check/SKILL.md",
|
|
24
25
|
".mustflow/skills/diff-risk-review/SKILL.md",
|
|
@@ -87,6 +88,7 @@ minimal = [
|
|
|
87
88
|
"composition-over-inheritance",
|
|
88
89
|
"contract-sync-check",
|
|
89
90
|
"date-number-audit",
|
|
91
|
+
"database-change-safety",
|
|
90
92
|
"dependency-injection",
|
|
91
93
|
"dependency-reality-check",
|
|
92
94
|
"diff-risk-review",
|
|
@@ -118,6 +120,7 @@ oss = [
|
|
|
118
120
|
"composition-over-inheritance",
|
|
119
121
|
"contract-sync-check",
|
|
120
122
|
"date-number-audit",
|
|
123
|
+
"database-change-safety",
|
|
121
124
|
"dependency-injection",
|
|
122
125
|
"dependency-reality-check",
|
|
123
126
|
"diff-risk-review",
|
|
@@ -156,6 +159,7 @@ team = [
|
|
|
156
159
|
"composition-over-inheritance",
|
|
157
160
|
"contract-sync-check",
|
|
158
161
|
"date-number-audit",
|
|
162
|
+
"database-change-safety",
|
|
159
163
|
"dependency-injection",
|
|
160
164
|
"dependency-reality-check",
|
|
161
165
|
"diff-risk-review",
|
|
@@ -187,6 +191,7 @@ product = [
|
|
|
187
191
|
"composition-over-inheritance",
|
|
188
192
|
"contract-sync-check",
|
|
189
193
|
"date-number-audit",
|
|
194
|
+
"database-change-safety",
|
|
190
195
|
"dependency-injection",
|
|
191
196
|
"dependency-reality-check",
|
|
192
197
|
"diff-risk-review",
|
|
@@ -222,6 +227,7 @@ library = [
|
|
|
222
227
|
"composition-over-inheritance",
|
|
223
228
|
"contract-sync-check",
|
|
224
229
|
"date-number-audit",
|
|
230
|
+
"database-change-safety",
|
|
225
231
|
"dependency-injection",
|
|
226
232
|
"dependency-reality-check",
|
|
227
233
|
"diff-risk-review",
|